dev-process-kit 0.0.1 → 0.0.2-beta.1

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.
@@ -0,0 +1,1404 @@
1
+ const ae=globalThis,xe=ae.ShadowRoot&&(ae.ShadyCSS===void 0||ae.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$e=Symbol(),Ye=new WeakMap;let Ze=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==$e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(xe&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=Ye.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ye.set(s,e))}return e}toString(){return this.cssText}};const Qe=t=>new Ze(typeof t=="string"?t:t+"",void 0,$e),R=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,r,i)=>n+(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.")})(r)+t[i+1],t[0]);return new Ze(s,t,$e)},Ms=(t,e)=>{if(xe)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=ae.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},Xe=xe?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return Qe(s)})(t):t,{is:js,defineProperty:Rs,getOwnPropertyDescriptor:Ns,getOwnPropertyNames:Ps,getOwnPropertySymbols:Is,getPrototypeOf:Ls}=Object,le=globalThis,et=le.trustedTypes,zs=et?et.emptyScript:"",Us=le.reactiveElementPolyfillSupport,Y=(t,e)=>t,we={toAttribute(t,e){switch(e){case Boolean:t=t?zs:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},tt=(t,e)=>!js(t,e),st={attribute:!0,type:String,converter:we,reflect:!1,useDefault:!1,hasChanged:tt};Symbol.metadata??=Symbol("metadata"),le.litPropertyMetadata??=new WeakMap;let q=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,s=st){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(e,s),!s.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,s);r!==void 0&&Rs(this.prototype,e,r)}}static getPropertyDescriptor(e,s,n){const{get:r,set:i}=Ns(this.prototype,e)??{get(){return this[s]},set(o){this[s]=o}};return{get:r,set(o){const l=r?.call(this);i?.call(this,o),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??st}static _$Ei(){if(this.hasOwnProperty(Y("elementProperties")))return;const e=Ls(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Y("properties"))){const s=this.properties,n=[...Ps(s),...Is(s)];for(const r of n)this.createProperty(r,s[r])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[n,r]of s)this.elementProperties.set(n,r)}this._$Eh=new Map;for(const[s,n]of this.elementProperties){const r=this._$Eu(s,n);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)s.unshift(Xe(r))}else e!==void 0&&s.push(Xe(e));return s}static _$Eu(e,s){const n=s.attribute;return n===!1?void 0:typeof n=="string"?n: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,s=this.constructor.elementProperties;for(const n of s.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ms(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,s,n){this._$AK(e,n)}_$ET(e,s){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const i=(n.converter?.toAttribute!==void 0?n.converter:we).toAttribute(s,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,s){const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=n.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:we;this._$Em=r;const l=o.fromAttribute(s,i.type);this[r]=l??this._$Ej?.get(r)??l,this._$Em=null}}requestUpdate(e,s,n,r=!1,i){if(e!==void 0){const o=this.constructor;if(r===!1&&(i=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??tt)(i,s)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,s,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:n,reflect:r,wrapped:i},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??s??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(s=void 0),this._$AL.set(e,s)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}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[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,i]of n){const{wrapped:o}=i,l=this[r];o!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,i,l)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(s)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(s)}willUpdate(e){}_$AE(e){this._$EO?.forEach(s=>s.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(s=>this._$ET(s,this[s])),this._$EM()}updated(e){}firstUpdated(e){}};q.elementStyles=[],q.shadowRootOptions={mode:"open"},q[Y("elementProperties")]=new Map,q[Y("finalized")]=new Map,Us?.({ReactiveElement:q}),(le.reactiveElementVersions??=[]).push("2.1.2");const Ae=globalThis,nt=t=>t,ce=Ae.trustedTypes,rt=ce?ce.createPolicy("lit-html",{createHTML:t=>t}):void 0,it="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,ot="?"+O,Bs=`<${ot}>`,N=document,Z=()=>N.createComment(""),Q=t=>t===null||typeof t!="object"&&typeof t!="function",_e=Array.isArray,Ds=t=>_e(t)||typeof t?.[Symbol.iterator]=="function",Se=`[
2
+ \f\r]`,X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,at=/-->/g,lt=/>/g,P=RegExp(`>|${Se}(?:([^\\s"'>=/]+)(${Se}*=${Se}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,pt=/^(?:script|style|textarea|title)$/i,ut=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),g=ut(1),qs=ut(2),I=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),ht=new WeakMap,L=N.createTreeWalker(N,129);function ft(t,e){if(!_e(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return rt!==void 0?rt.createHTML(e):e}const Hs=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=X;for(let l=0;l<s;l++){const a=t[l];let d,p,c=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===X?p[1]==="!--"?o=at:p[1]!==void 0?o=lt:p[2]!==void 0?(pt.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=P):p[3]!==void 0&&(o=P):o===P?p[0]===">"?(o=r??X,c=-1):p[1]===void 0?c=-2:(c=o.lastIndex-p[2].length,d=p[1],o=p[3]===void 0?P:p[3]==='"'?dt:ct):o===dt||o===ct?o=P:o===at||o===lt?o=X:(o=P,r=void 0);const h=o===P&&t[l+1].startsWith("/>")?" ":"";i+=o===X?a+Bs:c>=0?(n.push(d),a.slice(0,c)+it+a.slice(c)+O+h):a+O+(c===-2?l:h)}return[ft(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class oe{constructor({strings:e,_$litType$:s},n){let r;this.parts=[];let i=0,o=0;const l=e.length-1,a=this.parts,[d,p]=Hs(e,s);if(this.el=oe.createElement(d,n),L.currentNode=this.el.content,s===2||s===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=L.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(const c of r.getAttributeNames())if(c.endsWith(it)){const u=p[o++],h=r.getAttribute(c).split(O),v=/([.?@])?(.*)/.exec(u);a.push({type:1,index:i,name:v[2],strings:h,ctor:v[1]==="."?Ks:v[1]==="?"?Js:v[1]==="@"?Vs:de}),r.removeAttribute(c)}else c.startsWith(O)&&(a.push({type:6,index:i}),r.removeAttribute(c));if(pt.test(r.tagName)){const c=r.textContent.split(O),u=c.length-1;if(u>0){r.textContent=ce?ce.emptyScript:"";for(let h=0;h<u;h++)r.append(c[h],Z()),L.nextNode(),a.push({type:2,index:++i});r.append(c[u],Z())}}}else if(r.nodeType===8)if(r.data===ot)a.push({type:2,index:i});else{let c=-1;for(;(c=r.data.indexOf(O,c+1))!==-1;)a.push({type:7,index:i}),c+=O.length-1}i++}}static createElement(e,s){const n=N.createElement("template");return n.innerHTML=e,n}}function H(t,e,s=t,n){if(e===I)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=Q(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=r:s._$Cl=r),r!==void 0&&(e=H(t,r._$AS(t,e.values),r,n)),e}class Fs{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:n}=this._$AD,r=(e?.creationScope??N).importNode(s,!0);L.currentNode=r;let i=L.nextNode(),o=0,l=0,a=n[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new G(i,i.nextSibling,this,e):a.type===1?d=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(d=new Ws(i,this,e)),this._$AV.push(d),a=n[++l]}o!==a?.index&&(i=L.nextNode(),o++)}return L.currentNode=N,r}p(e){let s=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,s),s+=n.strings.length-2):n._$AI(e[s])),s++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,r){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=H(this,e,s),Q(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==I&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ds(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!==m&&Q(this._$AH)?this._$AA.nextSibling.data=e:this.T(N.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=oe.createElement(ft(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new Fs(r,this),o=i.u(this.options);i.p(s),this.T(o),this._$AH=i}}_$AC(e){let s=ht.get(e.strings);return s===void 0&&ht.set(e.strings,s=new oe(e)),s}k(e){_e(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,r=0;for(const i of e)r===s.length?s.push(n=new G(this.O(Z()),this.O(Z()),this,this.options)):n=s[r],n._$AI(i),r++;r<s.length&&(this._$AR(n&&n._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=nt(e).nextSibling;nt(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class de{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,r,i){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=m}_$AI(e,s=this,n,r){const i=this.strings;let o=!1;if(i===void 0)e=H(this,e,s,0),o=!Q(e)||e!==this._$AH&&e!==I,o&&(this._$AH=e);else{const l=e;let a,d;for(e=i[0],a=0;a<i.length-1;a++)d=H(this,l[n+a],s,a),d===I&&(d=this._$AH[a]),o||=!Q(d)||d!==this._$AH[a],d===m?e=m:e!==m&&(e+=(d??"")+i[a+1]),this._$AH[a]=d}o&&!r&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Ks extends de{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}}class Js extends de{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}}class Vs extends de{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=H(this,e,s,0)??m)===I)return;const n=this._$AH,r=e===m&&n!==m||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==m&&(n===m||r);r&&this.element.removeEventListener(this.name,this,n),i&&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 Ws{constructor(e,s,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){H(this,e)}}const Gs={I:G},Ys=Ae.litHtmlPolyfillSupport;Ys?.(oe,G),(Ae.litHtmlVersions??=[]).push("3.3.3");const Zs=(t,e,s)=>{const n=s?.renderBefore??e;let r=n._$litPart$;if(r===void 0){const i=s?.renderBefore??null;n._$litPart$=r=new G(e.insertBefore(Z(),i),i,void 0,s??{})}return r._$AI(t),r},Ce=globalThis;let M=class extends q{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 s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Zs(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}};M._$litElement$=!0,M.finalized=!0,Ce.litElementHydrateSupport?.({LitElement:M});const Qs=Ce.litElementPolyfillSupport;Qs?.({LitElement:M}),(Ce.litElementVersions??=[]).push("4.2.2");const Xs={paper:["#fafbfc","#15171c"],"paper-raised":["#ffffff","#1d2027"],"paper-sunken":["#f3f5f8","#111317"],"paper-inset":["#eceef2","#272b34"],ink:["#1a1d24","#e6e9ef"],"ink-soft":["#4d5566","#aeb5c2"],"ink-faint":["#7c8599","#7f8798"],rule:["rgba(20, 28, 44, 0.08)","rgba(222, 230, 245, 0.09)"],"rule-strong":["rgba(20, 28, 44, 0.14)","rgba(222, 230, 245, 0.16)"],"rule-hover":["rgba(20, 28, 44, 0.22)","rgba(222, 230, 245, 0.26)"],accent:["#d94920","#ee6a40"],"accent-strong":["#c23e12","#d4532a"],"accent-bright":["#e55a2b","#f47d55"],"accent-soft":["rgba(217, 73, 32, 0.07)","rgba(238, 106, 64, 0.15)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3366cc","#6f9bf0"],"blue-strong":["#2952a3","#4f7fdc"],"blue-soft":["rgba(51, 102, 204, 0.08)","rgba(111, 155, 240, 0.15)"],green:["#1a8a4a","#43c07a"],"green-soft":["rgba(26, 138, 74, 0.08)","rgba(67, 192, 122, 0.14)"],amber:["#b47a0a","#e2a73c"],"amber-soft":["rgba(180, 122, 10, 0.09)","rgba(226, 167, 60, 0.15)"],violet:["#7c4dcc","#a88af0"],"violet-soft":["rgba(124, 77, 204, 0.08)","rgba(168, 138, 240, 0.15)"],danger:["#b81c33","#f36b80"],"danger-soft":["rgba(214, 53, 80, 0.08)","rgba(243, 107, 128, 0.14)"],shade:["rgb(20, 28, 44)","rgb(0, 0, 0)"]},gt=t=>Qe(Object.entries(Xs).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
4
+ `)),pe=R`
5
+ :host {
6
+ /* Browsers without light-dark() stay light. */
7
+ ${gt(t=>t)}
8
+ --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
+ --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
+ --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
11
+
12
+ /* Shape + elevation scale, so every surface reads as one system. */
13
+ --dpk-radius-xs: 5px;
14
+ --dpk-radius-sm: 7px;
15
+ --dpk-radius: 8px;
16
+ --dpk-radius-lg: 12px;
17
+ --dpk-shadow-xs:
18
+ 0 1px 2px color-mix(in srgb, var(--dpk-shade) 5%, transparent),
19
+ 0 1px 1px color-mix(in srgb, var(--dpk-shade) 3%, transparent);
20
+ --dpk-shadow-sm:
21
+ 0 1px 2px color-mix(in srgb, var(--dpk-shade) 6%, transparent),
22
+ 0 2px 8px -2px color-mix(in srgb, var(--dpk-shade) 12%, transparent);
23
+ --dpk-shadow:
24
+ 0 1px 3px color-mix(in srgb, var(--dpk-shade) 6%, transparent),
25
+ 0 8px 24px -8px color-mix(in srgb, var(--dpk-shade) 18%, transparent);
26
+ --dpk-shadow-lg:
27
+ 0 2px 6px color-mix(in srgb, var(--dpk-shade) 6%, transparent),
28
+ 0 16px 40px -12px color-mix(in srgb, var(--dpk-shade) 22%, transparent);
29
+ --dpk-focus: 0 0 0 3px color-mix(in srgb, var(--dpk-blue) 28%, transparent);
30
+ --dpk-control-h: 32px;
31
+
32
+ color: var(--dpk-ink);
33
+ font-family: var(--dpk-body);
34
+ font-size: 14px;
35
+ line-height: 1.5;
36
+ -webkit-font-smoothing: antialiased;
37
+ text-rendering: optimizeLegibility;
38
+ display: block;
39
+ }
40
+
41
+ @supports (color: light-dark(#000, #fff)) {
42
+ :host {
43
+ ${gt((t,e)=>`light-dark(${t}, ${e})`)}
44
+ }
45
+ }
46
+
47
+ *,
48
+ *::before,
49
+ *::after {
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ h1,
54
+ h2,
55
+ h3,
56
+ h4 {
57
+ font-family: var(--dpk-display);
58
+ font-weight: 650;
59
+ margin: 0;
60
+ line-height: 1.2;
61
+ letter-spacing: -0.01em;
62
+ }
63
+
64
+ button {
65
+ font: inherit;
66
+ color: inherit;
67
+ }
68
+
69
+ ::selection {
70
+ background: rgba(47, 90, 168, 0.18);
71
+ }
72
+
73
+ .dpk-mono,
74
+ .dpk-num {
75
+ font-variant-numeric: tabular-nums;
76
+ }
77
+
78
+ .dpk-label {
79
+ font-family: var(--dpk-mono);
80
+ font-size: 10px;
81
+ font-weight: 500;
82
+ letter-spacing: 0.12em;
83
+ text-transform: uppercase;
84
+ color: var(--dpk-ink-faint);
85
+ }
86
+ `,ue=R`
87
+ .dpk-btn {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ gap: 6px;
92
+ min-height: 30px;
93
+ padding: 0 12px;
94
+ border: 1px solid var(--dpk-rule-strong);
95
+ border-radius: var(--dpk-radius-sm);
96
+ background: var(--dpk-paper-raised);
97
+ color: var(--dpk-ink);
98
+ font-size: 12.5px;
99
+ font-weight: 520;
100
+ line-height: 1;
101
+ white-space: nowrap;
102
+ box-shadow: var(--dpk-shadow-xs);
103
+ cursor: pointer;
104
+ transition:
105
+ background 140ms ease,
106
+ border-color 140ms ease,
107
+ box-shadow 140ms ease,
108
+ color 140ms ease,
109
+ transform 80ms ease;
110
+ }
111
+
112
+ .dpk-btn:hover:not([disabled]) {
113
+ background: var(--dpk-paper-sunken);
114
+ border-color: var(--dpk-rule-hover);
115
+ box-shadow: var(--dpk-shadow-sm);
116
+ }
117
+
118
+ .dpk-btn:active:not([disabled]) {
119
+ transform: translateY(1px);
120
+ box-shadow: none;
121
+ }
122
+
123
+ .dpk-btn:focus-visible {
124
+ outline: none;
125
+ box-shadow: var(--dpk-focus);
126
+ }
127
+
128
+ .dpk-btn[disabled] {
129
+ opacity: 0.45;
130
+ box-shadow: none;
131
+ cursor: not-allowed;
132
+ }
133
+
134
+ .dpk-btn--accent {
135
+ border-color: transparent;
136
+ background: linear-gradient(180deg, var(--dpk-accent), var(--dpk-accent-strong));
137
+ color: var(--dpk-accent-ink);
138
+ box-shadow:
139
+ 0 1px 2px rgba(217, 73, 32, 0.25),
140
+ 0 0 0 1px rgba(217, 73, 32, 0.15);
141
+ }
142
+
143
+ .dpk-btn--accent:hover:not([disabled]) {
144
+ background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
145
+ border-color: transparent;
146
+ box-shadow:
147
+ 0 2px 6px rgba(217, 73, 32, 0.3),
148
+ 0 0 0 1px rgba(217, 73, 32, 0.2);
149
+ }
150
+
151
+ /* Selection state, shared by every template's filter/nav controls. */
152
+ .dpk-btn--selected {
153
+ border-color: transparent;
154
+ background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
155
+ color: #fff;
156
+ box-shadow: 0 1px 3px rgba(51, 102, 204, 0.3);
157
+ }
158
+
159
+ .dpk-btn--selected:hover:not([disabled]) {
160
+ background: linear-gradient(180deg, var(--dpk-blue-strong), var(--dpk-blue-strong));
161
+ border-color: transparent;
162
+ box-shadow: 0 2px 6px rgba(51, 102, 204, 0.35);
163
+ }
164
+
165
+ .dpk-btn--ghost {
166
+ border-color: transparent;
167
+ background: transparent;
168
+ box-shadow: none;
169
+ color: var(--dpk-ink-soft);
170
+ }
171
+
172
+ .dpk-btn--ghost:hover:not([disabled]) {
173
+ background: var(--dpk-paper-inset);
174
+ border-color: transparent;
175
+ color: var(--dpk-ink);
176
+ }
177
+
178
+ .dpk-icon-btn {
179
+ position: relative;
180
+ display: inline-flex;
181
+ align-items: center;
182
+ justify-content: center;
183
+ width: 26px;
184
+ height: 26px;
185
+ padding: 0;
186
+ border: 1px solid transparent;
187
+ border-radius: var(--dpk-radius-xs);
188
+ background: transparent;
189
+ color: var(--dpk-ink-faint);
190
+ font-size: 11px;
191
+ line-height: 1;
192
+ cursor: pointer;
193
+ transition:
194
+ background 140ms ease,
195
+ color 140ms ease,
196
+ transform 100ms ease;
197
+ }
198
+
199
+ .dpk-icon-btn:hover:not([disabled]) {
200
+ background: var(--dpk-paper-inset);
201
+ color: var(--dpk-ink);
202
+ transform: scale(1.08);
203
+ }
204
+
205
+ .dpk-icon-btn:focus-visible {
206
+ outline: none;
207
+ box-shadow: var(--dpk-focus);
208
+ }
209
+
210
+ .dpk-icon-btn[disabled] {
211
+ opacity: 0.35;
212
+ cursor: default;
213
+ }
214
+
215
+ .dpk-icon-btn[data-active='true'] {
216
+ background: var(--dpk-blue-soft);
217
+ color: var(--dpk-blue);
218
+ }
219
+
220
+ .dpk-icon-btn svg {
221
+ display: block;
222
+ width: 15px;
223
+ height: 15px;
224
+ }
225
+
226
+ /* Count badge for an icon-only control (comments on a card, drafts on the rail). */
227
+ .dpk-icon-badge {
228
+ position: absolute;
229
+ top: -4px;
230
+ right: -4px;
231
+ min-width: 15px;
232
+ height: 15px;
233
+ padding: 0 3px;
234
+ border: 1.5px solid var(--dpk-paper-raised);
235
+ border-radius: 999px;
236
+ background: var(--dpk-accent);
237
+ color: var(--dpk-accent-ink);
238
+ font-family: var(--dpk-mono);
239
+ font-size: 9px;
240
+ font-variant-numeric: tabular-nums;
241
+ line-height: 12px;
242
+ text-align: center;
243
+ }
244
+
245
+ .dpk-input,
246
+ .dpk-textarea,
247
+ .dpk-select {
248
+ box-sizing: border-box;
249
+ width: 100%;
250
+ min-height: var(--dpk-control-h);
251
+ padding: 5px 9px;
252
+ border: 1px solid var(--dpk-rule-strong);
253
+ border-radius: var(--dpk-radius-sm);
254
+ background: var(--dpk-paper-raised);
255
+ color: var(--dpk-ink);
256
+ font: inherit;
257
+ font-size: 12.5px;
258
+ transition:
259
+ border-color 120ms ease,
260
+ box-shadow 120ms ease;
261
+ }
262
+
263
+ .dpk-input:hover,
264
+ .dpk-textarea:hover,
265
+ .dpk-select:hover {
266
+ border-color: var(--dpk-rule-hover);
267
+ }
268
+
269
+ .dpk-input:focus,
270
+ .dpk-textarea:focus,
271
+ .dpk-select:focus {
272
+ outline: none;
273
+ border-color: var(--dpk-blue);
274
+ box-shadow: var(--dpk-focus);
275
+ }
276
+
277
+ .dpk-select {
278
+ appearance: none;
279
+ background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
280
+ background-repeat: no-repeat;
281
+ background-position: right 7px center;
282
+ padding-right: 26px;
283
+ cursor: pointer;
284
+ }
285
+
286
+ .dpk-textarea {
287
+ resize: vertical;
288
+ min-height: 64px;
289
+ line-height: 1.55;
290
+ }
291
+ `,en=R`
292
+ .comment-pop {
293
+ box-sizing: border-box;
294
+ overflow: auto;
295
+ position: fixed;
296
+ inset: auto;
297
+ margin: 0;
298
+ display: grid;
299
+ gap: 8px;
300
+ padding: 12px;
301
+ border: 1px solid var(--dpk-rule);
302
+ border-radius: var(--dpk-radius-lg);
303
+ background: var(--dpk-paper-raised);
304
+ box-shadow: var(--dpk-shadow-lg);
305
+ color: var(--dpk-ink);
306
+ font-size: 12.5px;
307
+ }
308
+
309
+ .comment-pop .comment-list {
310
+ list-style: none;
311
+ margin: 0;
312
+ padding: 0;
313
+ display: grid;
314
+ gap: 4px;
315
+ max-height: 140px;
316
+ overflow: auto;
317
+ font-size: 12px;
318
+ color: var(--dpk-ink-soft);
319
+ }
320
+
321
+ .comment-pop .comment-list li {
322
+ padding-left: 8px;
323
+ border-left: 2px solid var(--dpk-accent);
324
+ }
325
+
326
+ .comment-pop .dpk-textarea {
327
+ min-height: 54px;
328
+ }
329
+
330
+ .pop-actions {
331
+ display: flex;
332
+ gap: 2px;
333
+ align-items: center;
334
+ justify-content: flex-end;
335
+ }
336
+ `,he=(t,e)=>t instanceof e?t:null;class mt extends M{static{this.styles=[pe,ue,R`
337
+ :host {
338
+ display: inline;
339
+ /* Inherit the surrounding type scale instead of forcing the chrome size:
340
+ an inline edit inside a 17px heading must look like a 17px heading.
341
+ Color comes along too, so an edit on a colored card stays legible. */
342
+ font-family: inherit;
343
+ font-size: inherit;
344
+ font-weight: inherit;
345
+ line-height: inherit;
346
+ color: inherit;
347
+ }
348
+
349
+ .view {
350
+ cursor: text;
351
+ border-bottom: 1px dashed transparent;
352
+ border-radius: 3px;
353
+ padding: 1px 3px;
354
+ transition:
355
+ background 140ms ease,
356
+ border-color 140ms ease;
357
+ }
358
+
359
+ .view:hover {
360
+ border-bottom-color: var(--dpk-blue);
361
+ background: var(--dpk-blue-soft);
362
+ }
363
+
364
+ .view[data-empty='true'] {
365
+ color: var(--dpk-ink-faint);
366
+ font-style: italic;
367
+ }
368
+
369
+ input,
370
+ textarea {
371
+ font: inherit;
372
+ color: inherit;
373
+ background: var(--dpk-paper-raised);
374
+ border: 1px solid var(--dpk-blue);
375
+ border-radius: var(--dpk-radius-sm);
376
+ box-shadow: var(--dpk-focus);
377
+ padding: 3px 7px;
378
+ min-width: 0;
379
+ width: 100%;
380
+ transition: box-shadow 140ms ease;
381
+ }
382
+
383
+ textarea {
384
+ min-height: var(--dpk-inline-textarea-min-height, 90px);
385
+ resize: vertical;
386
+ font-family: var(--dpk-body);
387
+ line-height: 1.5;
388
+ }
389
+
390
+ /* wrap: the field wraps like the text it replaces, and Enter still
391
+ commits, so a one-line value is edited without losing sight of it. */
392
+ :host([wrap]) textarea {
393
+ min-height: 0;
394
+ resize: none;
395
+ line-height: inherit;
396
+ }
397
+
398
+ /* seamless: no field chrome at all — the text is edited where it sits.
399
+ The chrome theme paints fields with its own ink and size, so the
400
+ seamless field re-states the inherited type and color. */
401
+ :host([seamless]) input,
402
+ :host([seamless]) textarea {
403
+ padding: 0;
404
+ border: none;
405
+ border-radius: 0;
406
+ background: transparent;
407
+ box-shadow: none;
408
+ height: 100%;
409
+ min-height: 0;
410
+ overflow: auto;
411
+ resize: none;
412
+ font: inherit;
413
+ font-size: inherit;
414
+ line-height: inherit;
415
+ color: inherit;
416
+ }
417
+
418
+ :host([seamless]) .view {
419
+ padding: 0;
420
+ }
421
+ `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},label:{type:String},editing:{state:!0}}}#t="";#i=0;connectedCallback(){super.connectedCallback(),this.#i+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.seamless=!1,this.label="",this.editing=!1,this.#t=""}startEditing(){this.#t=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#t=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector("input, textarea"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.select())}render(){if(!this.editing){const s=this.value.length===0;return g`<span
422
+ class="view"
423
+ data-empty=${String(s)}
424
+ role="button"
425
+ tabindex="0"
426
+ title="クリックして編集"
427
+ @click=${this.#s}
428
+ @keydown=${this.#o}
429
+ >${s?this.placeholder||"\u672A\u8A2D\u5B9A":this.value}</span
430
+ >`}const e=this.label||this.placeholder||"\u7DE8\u96C6";return g`
431
+ ${this.multiline||this.wrap?g`<textarea
432
+ class="dpk-textarea"
433
+ .value=${this.#t}
434
+ aria-label=${e}
435
+ @input=${this.#n}
436
+ @keydown=${this.#e}
437
+ @blur=${this.#r}
438
+ ></textarea>`:g`<input
439
+ class="dpk-input"
440
+ .value=${this.#t}
441
+ aria-label=${e}
442
+ @input=${this.#n}
443
+ @keydown=${this.#e}
444
+ @blur=${this.#r}
445
+ />`}
446
+ `}#s=e=>{e.stopPropagation(),this.editing=!0};#o=e=>{e.isComposing||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#n=e=>{const s=he(e.target,HTMLInputElement)??he(e.target,HTMLTextAreaElement);s!==null&&(this.#t=s.value)};#e=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#t=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#a())}};#r=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#i,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#i?(s.focus(),s.setSelectionRange(r,i)):this.#a())})};#a=()=>{if(!this.editing)return;this.editing=!1;const s=(this.wrap?this.#t.replace(/\r?\n/g," "):this.#t).trim();s!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:s},bubbles:!0,composed:!0}))}}const tn=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",mt)},sn={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Ee(t){return sn}let nn;function rn(t){return nn?.get(t)}let on;function an(t){return on?.get(t)}let ln;function cn(t,e){return ln?.get(t)?.get(e)}function ee(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function k(t,e,s,n,r){const i=r&&"input"in r?r.input:s.value,o=r?.expected??t.expects??null,l=r?.received??ee(i),a={kind:t.kind,type:t.type,input:i,expected:o,received:l,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${l}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},d=t.kind==="schema",p=r?.message??t.message??cn(t.reference,a.lang)??(d?an(a.lang):null)??n.message??rn(a.lang);p!==void 0&&(a.message=typeof p=="function"?p(a):p),d&&(s.typed=!1),s.issues?s.issues.push(a):s.issues=[a]}function dn(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function pn(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Te(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function $(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Ee())},t}var un=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function bt(t){return{kind:"validation",type:"integer",reference:bt,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&k(this,"integer",e,s),e}}}function y(t,e){return{kind:"validation",type:"min_length",reference:y,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&k(this,"length",s,n,{received:`${s.value.length}`}),s}}}function yt(t,e){return{kind:"validation",type:"min_value",reference:yt,async:!1,expects:`>=${t instanceof Date?t.toJSON():ee(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&k(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():ee(s.value)}),s}}}function z(t,e){return{kind:"validation",type:"regex",reference:z,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&k(this,"format",s,n),s}}}function Oe(){return{kind:"transformation",type:"trim",reference:Oe,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}const hn={abortEarly:!0};function vt(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function fe(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function U(t,e){return $({kind:"schema",type:"array",reference:U,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const r=s.value;if(Array.isArray(r)){s.typed=!0,s.value=[];for(let i=0;i<r.length;i++){const o=r[i],l=this.item["~run"]({value:o},n);if(l.issues){const a={type:"array",origin:"value",input:r,key:i,value:o};for(const d of l.issues)d.path?d.path.unshift(a):d.path=[a],s.issues?.push(d);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value.push(l.value)}}else k(this,"type",s,n);return s}})}function kt(t){return $({kind:"schema",type:"boolean",reference:kt,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:k(this,"type",e,s),e}})}function S(t,e){return $({kind:"schema",type:"exact_optional",reference:S,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function xt(t){return $({kind:"schema",type:"lazy",reference:xt,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function F(t,e){return $({kind:"schema",type:"literal",reference:F,expects:ee(t),async:!1,literal:t,message:e,"~run"(s,n){return dn(s.value,this.literal)?s.typed=!0:k(this,"type",s,n),s}})}function $t(t,e){return $({kind:"schema",type:"nullable",reference:$t,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=fe(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function wt(t){return $({kind:"schema",type:"number",reference:wt,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:k(this,"type",e,s),e}})}function w(t,e){return $({kind:"schema",type:"object",reference:w,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const l=i in r?r[i]:fe(o),a=o["~run"]({value:l},n);if(a.issues){const d={type:"object",origin:"value",input:r,key:i,value:l};for(const p of a.issues)p.path?p.path.unshift(d):p.path=[d],s.issues?.push(p);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value[i]=a.value}else if(o.fallback!==void 0)s.value[i]=vt(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(k(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}}else k(this,"type",s,n);return s}})}function ge(t,e){return $({kind:"schema",type:"optional",reference:ge,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=fe(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function me(t,e){return $({kind:"schema",type:"picklist",reference:me,expects:Te(t.map(ee),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:k(this,"type",s,n),s}})}function At(t,e,s){return $({kind:"schema",type:"record",reference:At,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const o in i)if(pn(i,o)){const l=i[o],a=this.key["~run"]({value:o},r);if(a.issues){const p={type:"object",origin:"key",input:i,key:o,value:l};for(const c of a.issues)c.path=[p],n.issues?.push(c);if(n.issues||(n.issues=a.issues),r.abortEarly){n.typed=!1;break}}const d=this.value["~run"]({value:l},r);if(d.issues){const p={type:"object",origin:"value",input:i,key:o,value:l};for(const c of d.issues)c.path?c.path.unshift(p):c.path=[p],n.issues?.push(c);if(n.issues||(n.issues=d.issues),r.abortEarly){n.typed=!1;break}}(!a.typed||!d.typed)&&(n.typed=!1),a.typed&&(n.value[a.value]=d.value)}}else k(this,"type",n,r);return n}})}function K(t,e){return $({kind:"schema",type:"strict_object",reference:K,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const l=i in r?r[i]:fe(o),a=o["~run"]({value:l},n);if(a.issues){const d={type:"object",origin:"value",input:r,key:i,value:l};for(const p of a.issues)p.path?p.path.unshift(d):p.path=[d],s.issues?.push(p);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value[i]=a.value}else if(o.fallback!==void 0)s.value[i]=vt(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(k(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){k(this,"key",s,n,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else k(this,"type",s,n);return s}})}function f(t){return $({kind:"schema",type:"string",reference:f,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:k(this,"type",e,s),e}})}function _t(t){let e;if(t)for(const s of t)if(e)for(const n of s.issues)e.push(n);else e=s.issues;return e}function St(t,e){return $({kind:"schema",type:"union",reference:St,expects:Te(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let r,i,o;for(const l of this.options){const a=l["~run"]({value:s.value},n);if(a.typed)if(a.issues)i?i.push(a):i=[a];else{r=a;break}else o?o.push(a):o=[a]}if(r)return r;if(i){if(i.length===1)return i[0];k(this,"type",s,n,{issues:_t(i)}),s.typed=!0}else{if(o?.length===1)return o[0];k(this,"type",s,n,{issues:_t(o)})}return s}})}function B(){return $({kind:"schema",type:"unknown",reference:B,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Ct(t,e,s){return $({kind:"schema",type:"variant",reference:Ct,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){let o,l=0,a=this.key,d=[];const p=(c,u)=>{for(const h of c.options){if(h.type==="variant")p(h,new Set(u).add(h.key));else{let v=!0,_=0;for(const A of u){const j=h.entries[A];if(A in i?j["~run"]({typed:!1,value:i[A]},hn).issues:j.type!=="exact_optional"&&j.type!=="optional"&&j.type!=="nullish"){v=!1,a!==A&&(l<_||l===_&&A in i&&!(a in i))&&(l=_,a=A,d=[]),a===A&&d.push(h.entries[A].expects);break}_++}if(v){const A=h["~run"]({value:i},r);(!o||!o.typed&&A.typed)&&(o=A)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;k(this,"type",n,r,{input:i[a],expected:Te(d,"|"),path:[{type:"object",origin:"value",input:i,key:a,value:i[a]}]})}else k(this,"type",n,r);return n}})}function Et(t,e,s){const n=t["~run"]({value:e},Ee());if(n.issues)throw new un(n.issues);return n.value}function b(...t){return $({...t[0],pipe:t,"~run"(e,s){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=n["~run"](e,s))}return e}})}function x(t,e,s){const n=t["~run"]({value:e},Ee());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const be=w({type:b(f(),y(1)),id:b(f(),y(1))}),fn=b(f(),y(1),z(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),gn=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const s=t.split(".");return s.length===e&&s.every(n=>n.length>0)?s:null},J=w({id:b(f(),y(1)),type:b(f(),y(1)),target:be,payload:B(),note:S(f()),createdAt:b(f(),y(1))}),mn=(t,e,s,n={})=>{const r=w({id:b(f(),y(1)),type:F(t),target:be,payload:s,note:S(f()),createdAt:b(f(),y(1))}),i=o=>{const l=x(J,o);if(!l.success||l.output.type!==t)return null;const a=x(s,o.payload);return a.success?{id:l.output.id,type:t,target:l.output.target,payload:a.output,...l.output.note===void 0?{}:{note:l.output.note},createdAt:l.output.createdAt}:null};return{schema:r,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:i,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},bn=(t,e)=>{const s=ye(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},yn=(t,e)=>{const s=x(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},ye=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,vn=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},kn=w({id:b(f(),y(1))}),xn=t=>{const e=x(kn,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},C=t=>`${t.type}:${t.id}`,Tt=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Me=(t,e)=>typeof t=="string"?Tt(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},$n=(t,e)=>t.type===e.type&&t.id===e.id,Ot=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},wn=(t,e)=>{const s=Ot(t),n=new Set(e);if(!n.has(s))return s;for(let r=2;r<1e3;r+=1){const i=`${s}-${r}`;if(!n.has(i))return i}return`${s}-${Math.random().toString(36).slice(2,8)}`},Mt=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},E="comment",te=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},jt=w({type:b(f(),y(1)),target:St([b(f(),y(1)),be]),payload:ge(B()),note:S(f()),id:S(b(f(),y(1))),createdAt:S(b(f(),y(1)))}),An=(t,e)=>{const s=x(jt,t);if(!s.success)return{ok:!1,issue:te(s.issues)};const n=s.output,r=Me(n.target,e.targetType),i={id:n.id??Mt(),type:n.type,target:r,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},o=x(e.schema,i);if(!o.success)return{ok:!1,issue:te(o.issues)};const l=x(J,o.output);return l.success?{ok:!0,action:l.output}:{ok:!1,issue:te(l.issues)}},je=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${C(t.target)}`,Re=(t,e,s)=>{const n=je(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||je(r,s)!==n||!_n(r,e)?[...t,e]:[...t.slice(0,-1),e]},_n=(t,e)=>$n(t.target,e.target),ve=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),Rt=w({id:b(f(),y(1)),type:F(E),target:w({type:b(f(),y(1)),id:b(f(),y(1))}),payload:w({body:b(f(),y(1))}),note:S(f()),createdAt:b(f(),y(1))}),Nt={schema:Rt,mode:"append",targetType:"page"},Sn=w({body:f()}),Ne=t=>{const e=x(Sn,t.payload);return e.success?e.output.body:""},Pe="element",Pt=b(f(),z(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),It=At(f(),B()),Cn=w({type:F(Pe),id:b(f(),z(/^[^/]+\/.+/,"component references start with a provider id"))}),En=w({id:b(f(),y(1)),type:Pt,target:Cn,payload:It,note:S(f()),createdAt:b(f(),y(1))}),Tn={schema:En,mode:"sequence",targetType:Pe},On=K({type:Pt,target:b(f(),z(/^element:[^/]+\/.+/)),payload:ge(It,{})}),Lt=K({id:b(f(),y(1)),title:b(f(),y(1)),summary:S(f()),tone:S(me(["create","update","delete","move","meta"])),stale:S(me(["unsupported-action-type","target-missing","constraint-violated"]))}),Ie=t=>{if(t.type!==Pe)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},T=t=>t.type!==E&&Ie(t.target)!==null,Mn=(t,e)=>t.filter(s=>T(s)&&Ie(s.target)===e),zt=(t,e)=>{const s=new Map(t.flatMap(n=>T(n)?[[n.id,Ie(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},Le=Object.freeze({}),ze=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Le;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[r,i]of s)r.length>0&&i.length>0&&(n[r]=i);return n},V=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[n];r!=null&&r!==""&&e.set(n,r)}const s=e.toString();return s.length===0?"":`#${s}`},Ue=(t,e)=>{const s={...t};for(const[n,r]of Object.entries(e))r==null||r===""?delete s[n]:s[n]=r;return s},jn=(t,e="json")=>`\`\`\`${e}
447
+ ${t}
448
+ \`\`\``,Rn=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Be=(t,e,s)=>{const{actions:n,state:r}=t,i=n.filter(a=>a.type===E),o=n.filter(a=>a.type!==E),l=[];if(l.push(`# Review draft \u2014 ${e.label}`),l.push(""),l.push(`- template: \`${e.name}\``),l.push(`- framework: \`dev-process-kit@${s}\``),l.push(`- navigation: \`${V(t.navigation)||"(none)"}\``),l.push(`- pending: ${o.length} change(s), ${i.length} comment(s)`),t.stale.length>0&&l.push(`- stale (not applicable to the current base): ${t.stale.length}`),l.push(""),l.push("## How to apply"),l.push(""),l.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."),o.some(T)&&(l.push(""),l.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.")),l.push(""),i.length>0){l.push(`## Comments (${i.length})`),l.push("");for(const[a,d]of i.entries()){const p=e.describe(d,r,t.base);l.push(`${a+1}. **${p.targetLabel}** \u2014 \`${C(d.target)}\``),l.push(` > ${Ne(d).replace(/\n/g,`
449
+ > `)}`)}l.push("")}if(o.length>0){l.push(`## Requested changes (${o.length})`),l.push("");for(const[a,d]of o.entries()){const p=e.describe(d,r,t.base),c=p.summary?` \u2014 ${p.summary}`:"";l.push(`${a+1}. **${p.title}**${c}`),l.push(` target: \`${C(d.target)}\` (${d.target.type})`),l.push(` \`\`\`json
450
+ ${Rn(d).replace(/\n/g,`
451
+ `)}
452
+ \`\`\``)}l.push("")}return o.length===0&&i.length===0&&(l.push("_No pending draft actions._"),l.push("")),l.push("## Canonical draft (JSON)"),l.push(""),l.push(jn(ve(n))),l.push(""),l.join(`
453
+ `)},W="0.0.2-beta.1",Ut=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,s=document.createElement("textarea");try{return s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.append(s),s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove(),e instanceof HTMLElement&&e.focus()}},Nn=()=>({body:"",attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Bt=t=>t.kind==="explicit"?{kind:t.resume}:t,Dt=(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:Bt(t.attachment)};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:Bt(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending",format:e.format},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:e.ok?{kind:"copied",format:t.copy.format}:{kind:"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}}}},Pn=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},In=4096,Ln="reviews",qt="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact.",zn=t=>new TextEncoder().encode(t).length,Un=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),Bn=t=>{const e=`${qt}
454
+
455
+ ${Un(t)}`;return zn(e)<=In?e:null},Dn=t=>`${qt}
456
+
457
+ 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).`,qn={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Hn=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?qn[e]:void 0)??"error"},Fn={too_large:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",consent:"\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",forbidden:"\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",claude_unavailable:"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",rate_limited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",storage:"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",error:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044"},Ht=t=>Fn[t],Ft=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Kt=(t,e)=>{const{definition:s,state:n,navigation:r,derivation:i}=t,o=s.currentTarget?.(n,r)??null,l=e.attachment,a=l.kind==="explicit"?s.commentTargets(n,r).find(c=>c.value===l.ref):null,d=l.kind==="explicit"?{ref:l.ref,label:a?Ft(a):l.ref}:l.kind==="current"&&o?{ref:o.value,label:Ft(o)}:{ref:`page:${s.name}`,label:"\u30DA\u30FC\u30B8\u5168\u4F53"},p=new Map(i.stale.map(c=>[c.action.id,c.reason]));return{body:e.body,target:d,attachment:l.kind==="explicit"?{kind:"explicit"}:o?{kind:"checkbox",checked:l.kind==="current",group:o.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:i.actions.map(c=>{const u=s.describe(c,n,i.base),h=c.type==="comment";return{id:c.id,title:h?"\u30B3\u30E1\u30F3\u30C8":u.title,targetLabel:u.targetLabel,tone:h?"comment":u.tone,text:{kind:h?"comment":"summary",body:h?Ne(c):u.summary??""},code:s.serialize(c),stale:p.get(c.id)??null}}),issues:t.issues.map(c=>`${c.path?`${c.path}: `:""}${c.message}`),send:t.sendable!==!0?"hidden":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713":e.send.kind==="failed"?Ht(e.send.reason):e.copy.kind==="copied"?`copied ${e.copy.format==="json"?"JSON":"brief"} \u2713`:e.copy.kind==="failed"?"copy failed":""}},Kn=[pe,ue,R`
458
+ :host {
459
+ display: flex;
460
+ flex-direction: column;
461
+ min-height: 0;
462
+ width: 100%;
463
+ background: var(--dpk-paper-raised);
464
+ }
465
+
466
+ header {
467
+ display: flex;
468
+ align-items: center;
469
+ justify-content: space-between;
470
+ gap: 8px;
471
+ padding: 14px 16px 12px;
472
+ border-bottom: 1px solid var(--dpk-rule);
473
+ background: linear-gradient(180deg, var(--dpk-paper-raised), var(--dpk-paper));
474
+ }
475
+
476
+ header h2 {
477
+ font-size: 13.5px;
478
+ font-weight: 620;
479
+ letter-spacing: -0.01em;
480
+ }
481
+
482
+ .composer {
483
+ display: grid;
484
+ gap: 10px;
485
+ padding: 14px 16px 14px;
486
+ border-bottom: 1px solid var(--dpk-rule);
487
+ background: var(--dpk-paper-sunken);
488
+ }
489
+
490
+ .composer textarea {
491
+ min-height: 62px;
492
+ background: var(--dpk-paper-raised);
493
+ border-radius: var(--dpk-radius);
494
+ }
495
+
496
+ .composer .row {
497
+ display: flex;
498
+ align-items: center;
499
+ gap: 8px;
500
+ }
501
+
502
+ .composer .attach {
503
+ display: inline-flex;
504
+ align-items: center;
505
+ gap: 7px;
506
+ font-size: 12px;
507
+ color: var(--dpk-ink-soft);
508
+ cursor: pointer;
509
+ }
510
+
511
+ .composer .attach input {
512
+ width: 14px;
513
+ height: 14px;
514
+ margin: 0;
515
+ accent-color: var(--dpk-accent);
516
+ cursor: pointer;
517
+ }
518
+
519
+ .composer .chip {
520
+ display: inline-flex;
521
+ align-items: center;
522
+ gap: 6px;
523
+ padding: 3px 10px;
524
+ border: 1px solid var(--dpk-rule);
525
+ border-radius: 999px;
526
+ background: var(--dpk-paper-raised);
527
+ font-size: 11.5px;
528
+ cursor: pointer;
529
+ }
530
+
531
+ .composer .chip svg {
532
+ flex: none;
533
+ width: 12px;
534
+ height: 12px;
535
+ }
536
+
537
+ .composer .chip:hover {
538
+ border-color: var(--dpk-rule-strong);
539
+ }
540
+
541
+ .target-line {
542
+ margin-right: auto;
543
+ font-family: var(--dpk-mono);
544
+ font-size: 10px;
545
+ letter-spacing: 0.03em;
546
+ color: var(--dpk-ink-faint);
547
+ }
548
+
549
+ .list {
550
+ list-style: none;
551
+ margin: 0;
552
+ padding: 10px 12px;
553
+ overflow: auto;
554
+ flex: 1;
555
+ min-height: 0;
556
+ display: grid;
557
+ gap: 8px;
558
+ align-content: start;
559
+ }
560
+
561
+ .item {
562
+ position: relative;
563
+ display: grid;
564
+ gap: 4px;
565
+ padding: 10px 12px 11px 14px;
566
+ border: 1px solid var(--dpk-rule);
567
+ border-radius: var(--dpk-radius);
568
+ background: var(--dpk-paper-raised);
569
+ box-shadow: var(--dpk-shadow-xs);
570
+ transition:
571
+ box-shadow 160ms ease,
572
+ border-color 160ms ease;
573
+ }
574
+
575
+ .item:hover {
576
+ box-shadow: var(--dpk-shadow-sm);
577
+ }
578
+
579
+ .item::before {
580
+ content: '';
581
+ position: absolute;
582
+ left: 0;
583
+ top: 10px;
584
+ bottom: 10px;
585
+ width: 3px;
586
+ border-radius: 0 2px 2px 0;
587
+ background: var(--tone, var(--dpk-ink-faint));
588
+ }
589
+
590
+ .item[data-tone='comment'] {
591
+ --tone: var(--dpk-accent);
592
+ background: linear-gradient(90deg, var(--dpk-accent-soft), transparent 55%);
593
+ }
594
+
595
+ .item[data-tone='create'] {
596
+ --tone: var(--dpk-green);
597
+ }
598
+
599
+ .item[data-tone='update'] {
600
+ --tone: var(--dpk-blue);
601
+ }
602
+
603
+ .item[data-tone='delete'] {
604
+ --tone: var(--dpk-accent);
605
+ }
606
+
607
+ .item[data-tone='move'] {
608
+ --tone: var(--dpk-violet);
609
+ }
610
+
611
+ .item[data-stale='true'] {
612
+ opacity: 0.5;
613
+ border-style: dashed;
614
+ box-shadow: none;
615
+ }
616
+
617
+ .item-head {
618
+ display: flex;
619
+ align-items: center;
620
+ gap: 6px;
621
+ }
622
+
623
+ .item-title {
624
+ font-size: 12.5px;
625
+ font-weight: 600;
626
+ }
627
+
628
+ .stale-badge {
629
+ padding: 1px 7px;
630
+ border: 1px solid var(--dpk-rule-strong);
631
+ border-radius: 999px;
632
+ font-family: var(--dpk-mono);
633
+ font-size: 9px;
634
+ letter-spacing: 0.06em;
635
+ text-transform: uppercase;
636
+ color: var(--dpk-ink-faint);
637
+ }
638
+
639
+ .item-head .dpk-icon-btn {
640
+ margin-left: auto;
641
+ }
642
+
643
+ .item-target {
644
+ font-family: var(--dpk-mono);
645
+ font-size: 10px;
646
+ color: var(--dpk-ink-faint);
647
+ }
648
+
649
+ .item-summary {
650
+ font-size: 12px;
651
+ color: var(--dpk-ink-soft);
652
+ }
653
+
654
+ .item-body {
655
+ margin: 2px 0 0;
656
+ padding-left: 9px;
657
+ border-left: 2px solid var(--dpk-accent);
658
+ font-size: 12.5px;
659
+ white-space: pre-wrap;
660
+ }
661
+
662
+ .item-code {
663
+ margin-top: 2px;
664
+ font-family: var(--dpk-mono);
665
+ font-size: 10px;
666
+ color: var(--dpk-ink-faint);
667
+ overflow-wrap: anywhere;
668
+ }
669
+
670
+ .empty {
671
+ padding: 6px 4px;
672
+ font-size: 12px;
673
+ line-height: 1.7;
674
+ color: var(--dpk-ink-faint);
675
+ }
676
+
677
+ .issues {
678
+ margin: 10px 12px 0;
679
+ padding: 9px 11px;
680
+ border: 1px solid rgba(194, 64, 15, 0.35);
681
+ border-radius: var(--dpk-radius-sm);
682
+ background: var(--dpk-accent-soft);
683
+ font-size: 11.5px;
684
+ }
685
+
686
+ .issues ul {
687
+ margin: 4px 0 0;
688
+ padding-left: 16px;
689
+ }
690
+
691
+ footer {
692
+ display: flex;
693
+ flex-wrap: wrap;
694
+ align-items: center;
695
+ gap: 8px;
696
+ padding: 12px 16px;
697
+ border-top: 1px solid var(--dpk-rule);
698
+ background: linear-gradient(180deg, var(--dpk-paper-sunken), var(--dpk-paper-inset));
699
+ }
700
+
701
+ .flash {
702
+ font-family: var(--dpk-mono);
703
+ font-size: 10px;
704
+ letter-spacing: 0.04em;
705
+ color: var(--dpk-green);
706
+ }
707
+ `],Jn={CHILD:2},Jt=t=>(...e)=>({_$litDirective$:t,values:e});let Vt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,n){this._$Ct=e,this._$AM=s,this._$Ci=n}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};const{I:Vn}=Gs,Wt=t=>t,Gt=()=>document.createComment(""),se=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(Gt(),r),o=n.insertBefore(Gt(),r);s=new Vn(i,o,t,t.options)}else{const i=s._$AB.nextSibling,o=s._$AM,l=o!==t;if(l){let a;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(a=t._$AU)!==o._$AU&&s._$AP(a)}if(i!==r||l){let a=s._$AA;for(;a!==i;){const d=Wt(a).nextSibling;Wt(n).insertBefore(a,r),a=d}}}return s},D=(t,e,s=t)=>(t._$AI(e,s),t),Wn={},Yt=(t,e=Wn)=>t._$AH=e,Gn=t=>t._$AH,De=t=>{t._$AR(),t._$AA.remove()},Zt=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},Qt=Jt(class extends Vt{constructor(t){if(super(t),t.type!==Jn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;s===void 0?s=e:e!==void 0&&(n=e);const r=[],i=[];let o=0;for(const l of t)r[o]=n?n(l,o):o,i[o]=s(l,o),o++;return{values:i,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const r=Gn(t),{values:i,keys:o}=this.dt(e,s,n);if(!Array.isArray(r))return this.ut=o,i;const l=this.ut??=[],a=[];let d,p,c=0,u=r.length-1,h=0,v=i.length-1;for(;c<=u&&h<=v;)if(r[c]===null)c++;else if(r[u]===null)u--;else if(l[c]===o[h])a[h]=D(r[c],i[h]),c++,h++;else if(l[u]===o[v])a[v]=D(r[u],i[v]),u--,v--;else if(l[c]===o[v])a[v]=D(r[c],i[v]),se(t,a[v+1],r[c]),c++,v--;else if(l[u]===o[h])a[h]=D(r[u],i[h]),se(t,r[c],r[u]),u--,h++;else if(d===void 0&&(d=Zt(o,h,v),p=Zt(l,c,u)),d.has(l[c]))if(d.has(l[u])){const _=p.get(o[h]),A=_!==void 0?r[_]:null;if(A===null){const j=se(t,r[c]);D(j,i[h]),a[h]=j}else a[h]=D(A,i[h]),se(t,r[c],A),r[_]=null;h++}else De(r[u]),u--;else De(r[c]),c++;for(;h<=v;){const _=se(t,a[v+1]);D(_,i[h]),a[h++]=_}for(;c<=u;){const _=r[c++];_!==null&&De(_)}return this.ut=o,Yt(t,a),I}}),qe=()=>g`<svg
708
+ viewBox="0 0 16 16"
709
+ fill="none"
710
+ stroke="currentColor"
711
+ stroke-width="1.5"
712
+ stroke-linecap="round"
713
+ stroke-linejoin="round"
714
+ aria-hidden="true"
715
+ focusable="false"
716
+ >
717
+ <path d="M4 4l8 8M12 4l-8 8" />
718
+ </svg>`,Yn=()=>g`<svg
719
+ viewBox="0 0 16 16"
720
+ fill="none"
721
+ stroke="currentColor"
722
+ stroke-width="1.5"
723
+ stroke-linecap="round"
724
+ stroke-linejoin="round"
725
+ aria-hidden="true"
726
+ focusable="false"
727
+ >
728
+ <path d="M3.5 5h9M5.5 5V3.5a1 1 0 011-1h3a1 1 0 011 1V5" />
729
+ <path d="M5 5l.5 7.5h5L11 5" />
730
+ <path d="M6.8 7.5v3.5M9.2 7.5v3.5" />
731
+ </svg>`,Zn=()=>g`<svg
732
+ viewBox="0 0 16 16"
733
+ fill="none"
734
+ stroke="currentColor"
735
+ stroke-width="1.5"
736
+ stroke-linecap="round"
737
+ stroke-linejoin="round"
738
+ aria-hidden="true"
739
+ focusable="false"
740
+ >
741
+ <path d="M3 13l1.5-1.5M11.3 2.7a1.5 1.5 0 012.1 2.1L5.5 12.7l-3 .8.8-3z" />
742
+ </svg>`,Qn=()=>g`<svg
743
+ viewBox="0 0 16 16"
744
+ fill="none"
745
+ stroke="currentColor"
746
+ stroke-width="1.5"
747
+ stroke-linecap="round"
748
+ stroke-linejoin="round"
749
+ aria-hidden="true"
750
+ focusable="false"
751
+ >
752
+ <path d="M3.5 3.5h9a1 1 0 011 1v5a1 1 0 01-1 1H8.2l-2.7 2.2v-2.2H3.5a1 1 0 01-1-1v-5a1 1 0 011-1z" />
753
+ </svg>`,Xn=()=>g`<svg
754
+ viewBox="0 0 16 16"
755
+ fill="none"
756
+ stroke="currentColor"
757
+ stroke-width="1.5"
758
+ stroke-linecap="round"
759
+ stroke-linejoin="round"
760
+ aria-hidden="true"
761
+ focusable="false"
762
+ >
763
+ <path d="M6.5 9.5l3-3" />
764
+ <path d="M7 5.5l1-1a2.1 2.1 0 013 3l-1 1" />
765
+ <path d="M9 10.5l-1 1a2.1 2.1 0 01-3-3l1-1" />
766
+ </svg>`,er=()=>g`<svg
767
+ viewBox="0 0 16 16"
768
+ fill="none"
769
+ stroke="currentColor"
770
+ stroke-width="1.5"
771
+ stroke-linecap="round"
772
+ stroke-linejoin="round"
773
+ aria-hidden="true"
774
+ focusable="false"
775
+ >
776
+ <path d="M8 3.5v9M3.5 8h9" />
777
+ </svg>`,tr=()=>g`<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false">
778
+ <circle cx="6.5" cy="4.5" r="1" />
779
+ <circle cx="9.5" cy="4.5" r="1" />
780
+ <circle cx="6.5" cy="8" r="1" />
781
+ <circle cx="9.5" cy="8" r="1" />
782
+ <circle cx="6.5" cy="11.5" r="1" />
783
+ <circle cx="9.5" cy="11.5" r="1" />
784
+ </svg>`,sr=()=>g`<svg
785
+ viewBox="0 0 16 16"
786
+ fill="none"
787
+ stroke="currentColor"
788
+ stroke-width="1.5"
789
+ stroke-linecap="round"
790
+ stroke-linejoin="round"
791
+ aria-hidden="true"
792
+ focusable="false"
793
+ >
794
+ <path
795
+ d="M8 2.5v11M8 2.5L5.5 5M8 2.5l2.5 2.5M8 13.5l-2.5-2.5M8 13.5l2.5-2.5M2.5 8h11M2.5 8L5 5.5M2.5 8l2.5 2.5M13.5 8L11 5.5M13.5 8L11 10.5"
796
+ />
797
+ </svg>`,nr=()=>g`<svg
798
+ viewBox="0 0 16 16"
799
+ fill="none"
800
+ stroke="currentColor"
801
+ stroke-width="1.5"
802
+ stroke-linecap="round"
803
+ stroke-linejoin="round"
804
+ aria-hidden="true"
805
+ focusable="false"
806
+ >
807
+ <path d="M8 12.5V3.5M4.5 7L8 3.5 11.5 7" />
808
+ </svg>`,rr=()=>g`<svg
809
+ viewBox="0 0 16 16"
810
+ fill="none"
811
+ stroke="currentColor"
812
+ stroke-width="1.5"
813
+ stroke-linecap="round"
814
+ stroke-linejoin="round"
815
+ aria-hidden="true"
816
+ focusable="false"
817
+ >
818
+ <path d="M8 3.5v9M4.5 9L8 12.5 11.5 9" />
819
+ </svg>`,ir=()=>g`<svg
820
+ viewBox="0 0 16 16"
821
+ fill="none"
822
+ stroke="currentColor"
823
+ stroke-width="1.5"
824
+ stroke-linecap="round"
825
+ stroke-linejoin="round"
826
+ aria-hidden="true"
827
+ focusable="false"
828
+ >
829
+ <path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5L9 7M2.5 13.5L7 9" />
830
+ </svg>`,or=()=>g`<svg
831
+ viewBox="0 0 16 16"
832
+ fill="none"
833
+ stroke="currentColor"
834
+ stroke-width="1.5"
835
+ stroke-linecap="round"
836
+ stroke-linejoin="round"
837
+ aria-hidden="true"
838
+ focusable="false"
839
+ >
840
+ <path d="M13.5 7h-4.5v-4.5M2.5 9h4.5v4.5M9 7l4.5-4.5M7 9l-4.5 4.5" />
841
+ </svg>`,ar=()=>g`<svg
842
+ viewBox="0 0 16 16"
843
+ fill="none"
844
+ stroke="currentColor"
845
+ stroke-width="1.5"
846
+ stroke-linecap="round"
847
+ stroke-linejoin="round"
848
+ aria-hidden="true"
849
+ focusable="false"
850
+ >
851
+ <circle cx="8" cy="8" r="2.75" />
852
+ <path
853
+ d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1.06 1.06M11.54 11.54l1.06 1.06M3.4 12.6l1.06-1.06M11.54 4.46l1.06-1.06"
854
+ />
855
+ </svg>`,lr=()=>g`<svg
856
+ viewBox="0 0 16 16"
857
+ fill="none"
858
+ stroke="currentColor"
859
+ stroke-width="1.5"
860
+ stroke-linecap="round"
861
+ stroke-linejoin="round"
862
+ aria-hidden="true"
863
+ focusable="false"
864
+ >
865
+ <path d="M13.5 9.6A5.75 5.75 0 016.4 2.5a5.75 5.75 0 107.1 7.1z" />
866
+ </svg>`,cr=(t,e,s=!1)=>g`
867
+ ${s?m:g`<header><h2>Review notes</h2></header>`}
868
+ ${t.issues.length>0?g`<div class="issues" role="alert">
869
+ <strong>Action rejected.</strong>
870
+ <ul>
871
+ ${t.issues.map(n=>g`<li>${n}</li>`)}
872
+ </ul>
873
+ </div>`:m}
874
+ <div class="composer">
875
+ <textarea
876
+ class="dpk-textarea"
877
+ aria-label="レビューコメント"
878
+ placeholder="変更したいこと / 気づきを書く(Agent への指示として渡る)"
879
+ .value=${t.body}
880
+ @input=${n=>{n.currentTarget instanceof HTMLTextAreaElement&&e({kind:"input",body:n.currentTarget.value})}}
881
+ @keydown=${n=>{!n.isComposing&&n.key==="Enter"&&(n.metaKey||n.ctrlKey)&&(n.preventDefault(),e({kind:"submit"}))}}
882
+ ></textarea>
883
+ ${t.attachment.kind==="explicit"?g`<div class="row">
884
+ <button class="chip" type="button" aria-label="紐づけを解除" @click=${()=>e({kind:"clear-target"})}>
885
+ ${t.target.label} ${qe()}
886
+ </button>
887
+ </div>`:t.attachment.kind==="checkbox"?g`<div class="row">
888
+ <label class="attach">
889
+ <input
890
+ type="checkbox"
891
+ .checked=${t.attachment.checked}
892
+ @change=${n=>{n.currentTarget instanceof HTMLInputElement&&e({kind:"attach",current:n.currentTarget.checked})}}
893
+ />
894
+ <span>この ${t.attachment.group} に紐づける</span>
895
+ </label>
896
+ </div>`:m}
897
+ <div class="row">
898
+ <span class="target-line">→ ${t.target.label}</span>
899
+ <button
900
+ class="dpk-btn dpk-btn--accent"
901
+ type="button"
902
+ ?disabled=${!t.canSubmit}
903
+ @click=${()=>e({kind:"submit"})}
904
+ >
905
+ Add note
906
+ </button>
907
+ </div>
908
+ </div>
909
+ <ul class="list">
910
+ ${t.items.length===0?g`<li class="empty">
911
+ No draft actions yet.<br />
912
+ Comments and structural patches both land here, and survive reload via LocalStorage.
913
+ </li>`:Qt(t.items,n=>n.id,n=>dr(n,e))}
914
+ </ul>
915
+ <footer>
916
+ ${s?m:g`
917
+ ${t.send==="hidden"?m:g`<button
918
+ class="dpk-btn dpk-btn--accent"
919
+ type="button"
920
+ ?disabled=${t.send==="disabled"}
921
+ @click=${()=>e({kind:"send"})}
922
+ >
923
+ Claude に送る
924
+ </button>`}
925
+ <button class="dpk-btn" type="button" @click=${()=>e({kind:"copy",format:"json"})}>
926
+ Copy JSON
927
+ </button>
928
+ <button class="dpk-btn" type="button" @click=${()=>e({kind:"copy",format:"brief"})}>
929
+ Copy brief
930
+ </button>
931
+ `}
932
+ <button
933
+ class="dpk-btn dpk-btn--ghost"
934
+ type="button"
935
+ ?disabled=${t.items.length===0}
936
+ @click=${()=>e({kind:"clear"})}
937
+ >
938
+ Clear
939
+ </button>
940
+ ${t.flash?g`<span class="flash" role="status">${t.flash}</span>`:m}
941
+ </footer>
942
+ `,dr=(t,e)=>g`
943
+ <li class="item" data-tone=${t.tone} data-stale=${String(t.stale!==null)}>
944
+ <div class="item-head">
945
+ <span class="item-title">${t.title}</span>
946
+ ${t.stale?g`<span class="stale-badge">${t.stale}</span>`:m}
947
+ <button
948
+ class="dpk-icon-btn"
949
+ type="button"
950
+ aria-label="この draft action を削除"
951
+ @click=${()=>e({kind:"delete",id:t.id})}
952
+ >
953
+ ${qe()}
954
+ </button>
955
+ </div>
956
+ <div class="item-target">${t.targetLabel}</div>
957
+ ${t.text.kind==="comment"?g`<p class="item-body">${t.text.body}</p>`:t.text.body?g`<div class="item-summary">${t.text.body}</div>`:m}
958
+ <code class="item-code">${t.code}</code>
959
+ </li>
960
+ `;class Xt extends M{static{this.styles=Kn}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},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#t=Nn();constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#t=Dt(this.#t,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus()}#i(){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}}render(){const e=this.#i();return e?cr(Kt(e,this.#t),this.#o,this.embedded):m}#s(e){this.#t=Dt(this.#t,e),this.requestUpdate()}#o=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#e(e.format);return;case"send":this.#n();return;case"submit":{const s=this.#i();if(!s||!this.onComment)return;const n=Pn(this.#t,Kt(s,this.#t).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#n(){const e=this.sendToClaude;if(!e||this.#t.send.kind==="pending")return;this.#s({kind:"send-started"});const s=this.#t.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:s,outcome:n})}async#e(e){const s=this.#i();if(!s)return;this.#s({kind:"copy-started",format:e});const n=this.#t.copyRequest;try{const r=e==="json"?ve(s.derivation.actions):this.exportBrief?.()??Be({...s.derivation,navigation:s.navigation,issues:s.issues},s.definition,W),i=await Ut(r);this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:!1})}}}const pr=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Xt)},ne=t=>t==="light"||t==="dark"?t:null,es=t=>t.authored??t.environment,ts=t=>t.preference??es(t),ur=t=>{const e=ts(t)==="dark"?"light":"dark";return e===es(t)?null:e},ss=U(K({value:b(f(),z(/^element:.+/)),label:b(f(),y(1)),group:S(f())})),hr=w({targets:ss,providers:U(w({id:b(f(),y(1)),results:U(Lt)}))}),fr=K({target:b(f(),z(/^element:.+/)),body:b(f(),Oe(),y(1))}),ns=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,rs=(t,e,s)=>{const n=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||n.has(C(i)),commentTargets:(r,i)=>{const o=t.commentTargets(r,i),l=new Set(o.map(a=>a.value));return[...o,...e.filter(a=>!l.has(a.value))]},describe:(r,i,o)=>{if(T(r)){const d=s.get(r.id),p=n.get(C(r.target));return{title:d?.title??r.type,...d?.summary===void 0?{}:{summary:d.summary},tone:d?.tone??"update",targetLabel:p?ns(p):r.target.id}}const l=t.describe(r,i,o),a=r.type==="comment"&&!t.hasTarget(i,r.target)?n.get(C(r.target)):void 0;return a===void 0?l:{...l,targetLabel:ns(a)}},serialize:r=>T(r)?`${r.type} ${C(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},is=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function os(t){return typeof is.Buffer<"u"&&is.Buffer.isBuffer(t)}function as(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 ls(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function cs(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const gr="[object RegExp]",mr="[object String]",br="[object Number]",yr="[object Boolean]",vr="[object Symbol]",kr="[object Date]",xr="[object Map]",$r="[object Set]",wr="[object Array]",Ar="[object Function]",_r="[object ArrayBuffer]",He="[object Object]",Sr="[object Error]",Cr="[object DataView]",Er="[object Uint8Array]",Tr="[object Uint8ClampedArray]",Or="[object Uint16Array]",Mr="[object Uint32Array]",jr="[object BigUint64Array]",Rr="[object Int8Array]",Nr="[object Int16Array]",Pr="[object Int32Array]",Ir="[object BigInt64Array]",Lr="[object Float32Array]",zr="[object Float64Array]";function Ur(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Br(t,e,s){return re(t,e,void 0,void 0,void 0,void 0,s)}function re(t,e,s,n,r,i,o){const l=o(t,e,s,n,r,i);if(l!==void 0)return l;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 ie(t,e,i,o)}return ie(t,e,i,o)}function ie(t,e,s,n){if(Object.is(t,e))return!0;let r=cs(t),i=cs(e);if(r==="[object Arguments]"&&(r=He),i==="[object Arguments]"&&(i=He),r!==i)return!1;switch(r){case mr:return t.toString()===e.toString();case br:return Ur(t.valueOf(),e.valueOf());case yr:case kr:case vr:return Object.is(t.valueOf(),e.valueOf());case gr:return t.source===e.source&&t.flags===e.flags;case Ar:return t===e}s=s??new Map;const o=s.get(t),l=s.get(e);if(o!=null&&l!=null)return o===e;s.set(t,e),s.set(e,t);try{switch(r){case xr:if(t.size!==e.size)return!1;for(const[a,d]of t.entries())if(!e.has(a)||!re(d,e.get(a),a,t,e,s,n))return!1;return!0;case $r:{if(t.size!==e.size)return!1;const a=Array.from(t.values()),d=Array.from(e.values());for(let p=0;p<a.length;p++){const c=a[p],u=d.findIndex(h=>re(c,h,void 0,t,e,s,n));if(u===-1)return!1;d.splice(u,1)}return!0}case wr:case Er:case Tr:case Or:case Mr:case jr:case Rr:case Nr:case Pr:case Ir:case Lr:case zr:if(os(t)!==os(e)||t.length!==e.length)return!1;for(let a=0;a<t.length;a++)if(!re(t[a],e[a],a,t,e,s,n))return!1;return!0;case _r:return t.byteLength!==e.byteLength?!1:ie(new Uint8Array(t),new Uint8Array(e),s,n);case Cr:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:ie(new Uint8Array(t),new Uint8Array(e),s,n);case Sr:return t.name===e.name&&t.message===e.message;case He:{if(!(ie(t.constructor,e.constructor,s,n)||as(t)&&as(e)))return!1;const a=[...Object.keys(t),...ls(t)],d=[...Object.keys(e),...ls(e)];if(a.length!==d.length)return!1;for(let p=0;p<a.length;p++){const c=a[p],u=t[c];if(!Object.hasOwn(e,c))return!1;const h=e[c];if(!re(u,h,c,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function Dr(){}function ke(t,e){return Br(t,e,Dr)}const ds="page",ps=t=>C(t),us=(t,e,s,n=new Map)=>{let r=e;const i=[],o=[],l=[],a=[],d=new Map;for(const c of s){if(c.type===E)continue;if(T(c)){const v=n.get(c.id);v===void 0||v.stale!==void 0?o.push({action:c,reason:v?.stale??"target-missing"}):i.push(c);continue}const u=ye(t.actions,c.type);if(!u){o.push({action:c,reason:"unsupported-action-type"});continue}const h=t.apply(r,c);if(h===null){o.push({action:c,reason:t.hasTarget(r,c.target)?"constraint-violated":"target-missing"});continue}if(u.mode!=="append"&&Fe(t,r,h)){l.push(c);continue}r=h,i.push(c)}for(const c of s){if(c.type!==E)continue;if(c.target.type!==ds&&!t.hasTarget(r,c.target)){o.push({action:c,reason:"target-missing"});continue}a.push(c);const u=ps(c.target);d.set(u,[...d.get(u)??[],c])}const p=new Map(s.map((c,u)=>[c.id,u]));return o.sort((c,u)=>(p.get(c.action.id)??0)-(p.get(u.action.id)??0)),{base:e,state:r,actions:s,applied:i,stale:o,obsolete:l,comments:a,commentsByTarget:d}},Fe=(t,e,s)=>e===s?!0:t.canonicalState===void 0?ke(e,s):ke(t.canonicalState(e),t.canonicalState(s)),hs=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},qr=(t,e,s,n)=>{let r=e;const i=n??fs(r).map(o=>o.id);for(const o of[...i].reverse())r=Hr(t,r,s,o,n!==void 0)??r;return r},fs=t=>t.applied.filter(e=>!T(e)),Hr=(t,e,s,n,r)=>{const i=fs(e),o=i.findIndex(u=>u.id===n),l=i[o];if(l===void 0)return null;const a=i.slice(0,o),d=[...r?Fr(t,e.base,i,o):[],...Kr(t,a,l)],p=new Set,c=d.filter(u=>{const h=u.join(" ");return p.has(h)?!1:(p.add(h),!0)}).sort((u,h)=>h.length-u.length);for(const u of c){const h=Jr(t,e,s,u);if(h!==null)return h}return null},Fr=(t,e,s,n)=>{const r=[];let i=e;for(const o of s.slice(0,n+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,l)=>Fe(t,o,i)?[s.slice(l,n+1).map(a=>a.id)]:[])},Kr=(t,e,s)=>{const n=gs(s),r=e.filter(a=>gs(a).some(d=>n.includes(d))),i=ms(t,s),o=r.filter(a=>ms(t,a)===i),l=a=>a.map((d,p)=>[...a.slice(p).map(c=>c.id),s.id]);return[...l(r),...l(o),...r.map(a=>[a.id,s.id]),...r.map(a=>[a.id])]},gs=t=>{const e=t.target.type===ds?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(n=>typeof n=="string"&&n!==""):[];return[...e,...s]},ms=(t,e)=>ye(t.actions,e.type)?.mode,Jr=(t,e,s,n)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(n);for(;;){const o=s(e.actions.filter(a=>!i.has(a.id))),l=o.stale.filter(a=>!r.has(a.action.id)).map(a=>a.action);if(l.length===0)return Fe(t,o.state,e.state)?o:null;if(l.some(a=>a.type===E||T(a)))return null;for(const a of l)i.add(a.id)}},Vr=w({v:F(1),template:b(f(),y(1)),actions:U(B())});class Ke{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=x(Vr,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const o=x(J,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,s,n){const r={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class Je{constructor(){this.store=new Map}load(e,s){return new Ke({getItem:n=>this.store.get(n)??null,setItem:(n,r)=>{this.store.set(n,r)},removeItem:n=>{this.store.delete(n)}}).load(e,s)}save(e,s,n){this.store.set(e,JSON.stringify({v:1,template:s,actions:n}))}clear(e){this.store.delete(e)}}const Ve=()=>{try{if(typeof localStorage<"u")return new Ke(localStorage)}catch{}return new Je},bs=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Wr=U(B());class ys{#t;#i;#s={targets:[],providers:[]};#o=new Map;#n;#e;#r;#a;#l;#m=new Set;#d=[];#g=0;constructor(e){this.#t=e.definition,this.#i=rs(e.definition,[],this.#o),this.#n=e.base,this.#l=e.storageKey??bs(e.definition.name),this.#a=e.storage===void 0?Ve():e.storage;const s=e.initialActions??this.#a?.load(this.#l,this.definition.name)??[];this.#e=ks(this.definition,s),this.#r=this.#c(this.#e),this.#v()&&this.#b()}get definition(){return this.#i}setComponentSnapshot(e){const s=Et(hr,e);if(!ke(s,this.#s)){this.#s=s,this.#p(),this.#r=this.#c(this.#e);for(const n of this.#m)n()}}#p(){this.#o=zt(this.#e,this.#s.providers),this.#i=rs(this.#t,this.#s.targets,this.#o)}#c(e){return us(this.definition,this.#n,e,zt(e,this.#s.providers))}get base(){return this.#n}get actions(){return this.#e}get derivation(){return this.#r}get lastIssues(){return this.#d}get prunedCount(){return this.#g}descriptorFor(e,s){return vs(this.definition,e,s)}dispatch(e){const s=this.#x(e,this.#r.state);if(!s.ok)return this.#u([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#h(Re(this.#e,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#u([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=x(Wr,e);if(!s.success)return this.#u([te(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#e,i=this.#r.state;const o=[];for(const l of n){const a=this.#x(l,i);if(!a.ok)return this.#u([a.issue]);const d=a.action,p=this.descriptorFor(d.type,d.target);if(!p)return this.#u([{path:"type",message:"unknown action type"}]);if((d.type==="comment"||T(d)?d.target.type==="page"||this.definition.hasTarget(i,d.target)?i:null:this.definition.apply(i,d))===null)return this.#u([{path:"target",message:"batch action is not applicable"}]);r=Re(r,d,p),i=this.#c(r).state,o.push(d.id)}return this.#h(r,o),{ok:!0,ids:o}}#x(e,s){const n=x(jt,e);if(!n.success)return{ok:!1,issue:te(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?Me(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=An(n.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(s,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#u(e){return this.#d=e,{ok:!1,issues:e}}removeAction(e){const s=this.#e.filter(n=>n.id!==e);s.length!==this.#e.length&&this.#h(s)}clearActions(){this.#e.length>0&&this.#h([])}replaceActions(e){this.#h(ks(this.definition,e))}setBase(e){this.#n=e,this.#h(this.#e)}subscribe(e){return this.#m.add(e),()=>{this.#m.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#e}}#h(e,s){this.#d=[],this.#e=e,this.#p(),this.#r=this.#c(this.#e),this.#v(s),this.#b();for(const n of this.#m)n()}#v(e){const s=this.#$(),n=qr(this.definition,this.#r,r=>this.#c(r),e);return n===this.#r?s:(this.#g+=this.#e.length-n.actions.length,this.#e=[...n.actions],this.#p(),this.#r=this.#c(this.#e),this.#$(),!0)}#$(){return this.#r.obsolete.length===0?!1:(this.#g+=this.#r.obsolete.length,this.#e=hs(this.#r),this.#p(),this.#r=this.#c(this.#e),!0)}#b(){this.#a?.save(this.#l,this.definition.name,this.#e)}}const vs=(t,e,s)=>e==="comment"?Nt:s!==void 0&&T({type:e,target:s})?Tn:ye(t.actions,e),ks=(t,e)=>e.flatMap(s=>{const n=x(J,s);if(!n.success)return[];const r=n.output,i=vs(t,r.type,r.target);if(!i)return[];const o=x(i.schema,r);if(!o.success)return[];const l=x(J,o.output);return l.success?[l.output]:[]}),xs=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()}},Gr=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:s=>{const n=typeof s=="string"?s:C(s);return e.commentsByTarget.get(n)?.length??0},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),navigate:(s,n)=>t.navigate(s,n),hashFor:s=>t.hashFor(s),requestComment:s=>t.requestComment(s)}},Yr=(t,e)=>{const s=()=>xs(t);return{version:W,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:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),comment:(n,r)=>t.dispatch({type:E,target:n,payload:{body:r}}),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,r)=>t.navigate(n,r),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(W),exportBrief:()=>Be(s(),t.controller().definition,W),subscribe:n=>t.subscribe(n)}},We=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),Zr=t=>We(t,["use"]),Qr=t=>We(t,["anchorFor","canSendToClaude","sendToClaude"]),Xr=t=>We(t,["collection"]),$s=async(t,e)=>{try{return await t.use(e)}catch{return null}},ei=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=Bn(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Ln).doc();await o.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=Dn(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(o){return{ok:!1,reason:Hn(o)}}}}),ti=async t=>{if(!Zr(t))return null;const[e,s]=await Promise.all([$s(t,"comments"),$s(t,"db")]);return Qr(e)?ei(e,Xr(s)?s:null):null},si=()=>Reflect.get(globalThis,"claude");class ni{#t;#i;#s=null;#o=!1;constructor(e,s=si){this.#t=e,this.#i=s,e.addController(this)}get available(){return this.#o}hostConnected(){this.#s??=ti(this.#i()),this.#n(),window.addEventListener("focus",this.#n)}hostDisconnected(){window.removeEventListener("focus",this.#n)}async send(e){const s=await this.#s;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#n(),n}#n=async()=>{const e=await this.#s,s=e?await e.canSend():!1;s!==this.#o&&(this.#o=s,this.#t.requestUpdate())}}const ws=(t,e)=>({read(s){try{const n=t.getItem(s);return n===null?null:e(JSON.parse(n))}catch{return null}},write(s,n){try{return t.setItem(s,JSON.stringify(n)),!0}catch{return!1}},remove(s){try{t.removeItem(s)}catch{}}}),As=t=>{const e=new Map;return ws({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},ri=t=>{try{if(typeof localStorage<"u")return ws(localStorage,t)}catch{}return As(t)},Ge="dev-process-kit:color-scheme",ii="(prefers-color-scheme: dark)",_s=()=>typeof matchMedia=="function"?matchMedia(ii):null,Ss=()=>ne(document.documentElement.dataset.theme)??(_s()?.matches===!0?"dark":"light");class oi{#t;#i;#s=null;#o=null;#n="light";#e=null;#r=null;constructor(e,s){this.#t=e,this.#i=s,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#i()?ri(ne):As(ne),this.#o=this.#s.read(Ge)),this.#n=Ss(),this.#e=_s(),this.#e?.addEventListener("change",this.#l),this.#r=new MutationObserver(this.#l),this.#r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#e?.removeEventListener("change",this.#l),this.#e=null,this.#r?.disconnect(),this.#r=null}resolve(e){return ts(this.#a(e))}toggle(e){this.#o=ur(this.#a(e)),this.#o===null?this.#s?.remove(Ge):this.#s?.write(Ge,this.#o),this.#t.requestUpdate()}#a(e){return{preference:this.#o,authored:e,environment:this.#n}}#l=()=>{const e=Ss();e!==this.#n&&(this.#n=e,this.#t.requestUpdate())}}const ai=(t,e)=>{const s=[],n=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&s.push(i),n(i),i.shadowRoot&&n(i.shadowRoot))};return n(t),s},Cs=(t,e)=>{const s=new Map;for(const n of t)s.set(e(n),(s.get(e(n))??0)+1);return t.filter(n=>s.get(e(n))===1)},Es=t=>Cs(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),Ts=(t,e)=>{for(const s of Es(t)){const n=Mn(e,s.id),r=Reflect.get(s,"elementActions");Array.isArray(r)&&r.length===n.length&&n.every((o,l)=>{const a=r[l];return typeof a=="object"&&a!==null&&"id"in a&&a.id===o.id})||Reflect.set(s,"elementActions",n)}},li=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=x(Lt,s);return n.success?[n.output]:[]}):[]},ci=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=x(ss,s.commentTargets);n.success&&e.push(...n.output)}return{targets:Cs(e,s=>s.value),providers:Es(t).map(s=>({id:s.id,results:li(s)}))}},Os=()=>ze(typeof location>"u"?"":location.hash),di=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${V(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class pi{#t;#i=null;#s=0;constructor(e){this.#t=e}get orphans(){return this.#s}route(){const e=this.#t.renderRoot,s=he(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#i!==s&&(this.#i=s,s.addEventListener("slotchange",this.#o));const n=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=s.assignedElements();for(const i of r){const o=i.getAttribute("data-preview-id");if(!o)continue;const l=`preview:${o}`;i.getAttribute("slot")!==l&&n.has(l)&&i.setAttribute("slot",l)}r.length!==this.#s&&(this.#s=r.length,queueMicrotask(()=>this.#t.requestUpdate()))}#o=()=>{queueMicrotask(()=>this.route())}}const ui=[pe,ue,R`
961
+ :host {
962
+ display: block;
963
+ min-height: 100%;
964
+ background: var(--dpk-paper);
965
+ color-scheme: light;
966
+ }
967
+
968
+ /* The element stamps its resolved scheme; nested components inherit it. */
969
+ :host([data-theme='dark']) {
970
+ color-scheme: dark;
971
+ }
972
+
973
+ .dpk-shell {
974
+ display: grid;
975
+ grid-template-rows: auto minmax(0, 1fr) auto;
976
+ min-height: 100%;
977
+ max-height: 100%;
978
+ }
979
+
980
+ /* ------------------------------------------------------------- header */
981
+
982
+ .dpk-header {
983
+ display: flex;
984
+ align-items: center;
985
+ gap: 16px;
986
+ /* Right padding keeps the header content clear of the fixed review button. */
987
+ padding: 14px 78px 14px 20px;
988
+ border-bottom: 1px solid var(--dpk-rule);
989
+ background: linear-gradient(180deg, var(--dpk-paper-raised) 0%, var(--dpk-paper) 100%);
990
+ }
991
+
992
+ .dpk-title {
993
+ display: flex;
994
+ flex-direction: column;
995
+ gap: 2px;
996
+ min-width: 0;
997
+ }
998
+
999
+ .dpk-title h1 {
1000
+ font-size: 16.5px;
1001
+ font-weight: 620;
1002
+ white-space: nowrap;
1003
+ overflow: hidden;
1004
+ text-overflow: ellipsis;
1005
+ }
1006
+
1007
+ .dpk-template-mark {
1008
+ display: inline-flex;
1009
+ align-items: center;
1010
+ gap: 6px;
1011
+ padding: 2px 9px 2px 7px;
1012
+ border-radius: 999px;
1013
+ background: var(--dpk-accent-soft);
1014
+ font-family: var(--dpk-mono);
1015
+ font-size: 9.5px;
1016
+ font-weight: 550;
1017
+ letter-spacing: 0.12em;
1018
+ text-transform: uppercase;
1019
+ color: var(--dpk-accent);
1020
+ }
1021
+
1022
+ .dpk-template-mark::before {
1023
+ content: '';
1024
+ width: 6px;
1025
+ height: 6px;
1026
+ border-radius: 50%;
1027
+ background: var(--dpk-accent);
1028
+ }
1029
+
1030
+ .dpk-header-slot {
1031
+ flex: 1;
1032
+ min-width: 0;
1033
+ display: flex;
1034
+ align-items: center;
1035
+ gap: 10px;
1036
+ }
1037
+
1038
+ .dpk-header-meta {
1039
+ display: flex;
1040
+ align-items: center;
1041
+ gap: 8px;
1042
+ margin-left: auto;
1043
+ padding: 4px 12px;
1044
+ border-radius: 999px;
1045
+ border: 1px solid var(--dpk-rule);
1046
+ background: var(--dpk-paper-sunken);
1047
+ font-family: var(--dpk-mono);
1048
+ font-size: 10px;
1049
+ letter-spacing: 0.04em;
1050
+ color: var(--dpk-ink-faint);
1051
+ white-space: nowrap;
1052
+ }
1053
+
1054
+ .dpk-header-meta span + span::before {
1055
+ content: '';
1056
+ display: inline-block;
1057
+ width: 3px;
1058
+ height: 3px;
1059
+ margin-right: 8px;
1060
+ vertical-align: 1px;
1061
+ border-radius: 50%;
1062
+ background: var(--dpk-ink-faint);
1063
+ opacity: 0.5;
1064
+ }
1065
+
1066
+ .dpk-theme-toggle {
1067
+ display: inline-flex;
1068
+ flex: none;
1069
+ align-items: center;
1070
+ justify-content: center;
1071
+ width: 30px;
1072
+ height: 30px;
1073
+ padding: 0;
1074
+ border: 1px solid var(--dpk-rule);
1075
+ border-radius: 999px;
1076
+ background: var(--dpk-paper-sunken);
1077
+ color: var(--dpk-ink-soft);
1078
+ cursor: pointer;
1079
+ transition:
1080
+ color 160ms ease,
1081
+ border-color 160ms ease;
1082
+ }
1083
+
1084
+ .dpk-theme-toggle svg {
1085
+ width: 15px;
1086
+ height: 15px;
1087
+ }
1088
+
1089
+ .dpk-theme-toggle:hover {
1090
+ color: var(--dpk-ink);
1091
+ border-color: var(--dpk-rule-hover);
1092
+ }
1093
+
1094
+ .dpk-theme-toggle:focus-visible {
1095
+ outline: none;
1096
+ box-shadow: var(--dpk-focus);
1097
+ }
1098
+
1099
+ /* --------------------------------------------------------------- body */
1100
+
1101
+ .dpk-body {
1102
+ display: flex;
1103
+ min-height: 0;
1104
+ }
1105
+
1106
+ .dpk-sidebar {
1107
+ width: 252px;
1108
+ flex: 0 0 auto;
1109
+ border-right: 1px solid var(--dpk-rule);
1110
+ background: linear-gradient(180deg, var(--dpk-paper-sunken) 0%, var(--dpk-paper-inset) 100%);
1111
+ overflow: auto;
1112
+ padding: 16px 14px;
1113
+ }
1114
+
1115
+ .dpk-sidebar[hidden] {
1116
+ display: none;
1117
+ }
1118
+
1119
+ .dpk-main {
1120
+ flex: 1 1 0%;
1121
+ display: flex;
1122
+ flex-direction: column;
1123
+ min-width: 0;
1124
+ overflow: auto;
1125
+ background: var(--dpk-paper);
1126
+ }
1127
+
1128
+ .dpk-main-body {
1129
+ flex: 1 0 auto;
1130
+ display: grid;
1131
+ align-content: start;
1132
+ gap: 16px;
1133
+ min-width: 0;
1134
+ padding: 24px;
1135
+ }
1136
+
1137
+ /*
1138
+ * Author memo. It sits at the end of the main column and sticks to the
1139
+ * bottom of the scrollport: always visible, floating over whatever scrolls
1140
+ * behind it, and never stealing height from the preview.
1141
+ */
1142
+ .dpk-memo {
1143
+ position: sticky;
1144
+ bottom: 0;
1145
+ z-index: 5;
1146
+ padding: 0 20px 20px;
1147
+ pointer-events: none;
1148
+ }
1149
+
1150
+ .dpk-memo[hidden] {
1151
+ display: none;
1152
+ }
1153
+
1154
+ .dpk-memo ::slotted(*) {
1155
+ display: block;
1156
+ max-width: 100%;
1157
+ padding: 10px 14px;
1158
+ border: 1px solid var(--dpk-rule);
1159
+ border-radius: var(--dpk-radius-lg);
1160
+ background: var(--dpk-paper-raised);
1161
+ box-shadow: var(--dpk-shadow-lg);
1162
+ font-size: 12.5px;
1163
+ line-height: 1.65;
1164
+ color: var(--dpk-ink-soft);
1165
+ pointer-events: auto;
1166
+ }
1167
+
1168
+ .dpk-orphans {
1169
+ margin-top: 16px;
1170
+ border: 1px dashed var(--dpk-rule-strong);
1171
+ border-radius: var(--dpk-radius-sm);
1172
+ padding: 10px;
1173
+ }
1174
+
1175
+ .dpk-banner {
1176
+ display: grid;
1177
+ gap: 4px;
1178
+ margin-bottom: 14px;
1179
+ border: 1px solid var(--dpk-accent);
1180
+ border-left-width: 3px;
1181
+ border-radius: var(--dpk-radius-sm);
1182
+ background: var(--dpk-accent-soft);
1183
+ padding: 10px 12px;
1184
+ max-width: 900px;
1185
+ }
1186
+
1187
+ .dpk-banner strong {
1188
+ font-size: 13px;
1189
+ }
1190
+
1191
+ .dpk-banner code {
1192
+ font-family: var(--dpk-mono);
1193
+ font-size: 11px;
1194
+ color: var(--dpk-ink-soft);
1195
+ overflow-wrap: anywhere;
1196
+ }
1197
+
1198
+ .dpk-notes {
1199
+ flex: 0 0 auto;
1200
+ width: 344px;
1201
+ border-left: 1px solid var(--dpk-rule);
1202
+ background: var(--dpk-paper-raised);
1203
+ overflow: hidden;
1204
+ display: flex;
1205
+ }
1206
+
1207
+ .dpk-notes[hidden] {
1208
+ display: none;
1209
+ }
1210
+
1211
+ /* ------------------------------------------------------------- footer */
1212
+
1213
+ .dpk-footer {
1214
+ border-top: 1px solid var(--dpk-rule);
1215
+ padding: 10px 20px;
1216
+ display: flex;
1217
+ gap: 12px;
1218
+ align-items: center;
1219
+ background: var(--dpk-paper-sunken);
1220
+ font-size: 12px;
1221
+ color: var(--dpk-ink-faint);
1222
+ }
1223
+
1224
+ /* --------------------------------------------------- floating review */
1225
+
1226
+ /* Review toggle: pinned to the top right corner, always in the same place. */
1227
+ .dpk-fab {
1228
+ position: fixed;
1229
+ top: 10px;
1230
+ right: 16px;
1231
+ z-index: 60;
1232
+ display: inline-flex;
1233
+ align-items: center;
1234
+ justify-content: center;
1235
+ width: 38px;
1236
+ height: 38px;
1237
+ padding: 0;
1238
+ border: 1px solid var(--dpk-rule-strong);
1239
+ border-radius: 999px;
1240
+ background: var(--dpk-paper-raised);
1241
+ color: var(--dpk-ink-soft);
1242
+ box-shadow: var(--dpk-shadow);
1243
+ cursor: pointer;
1244
+ transition:
1245
+ color 160ms ease,
1246
+ background 160ms ease,
1247
+ border-color 160ms ease,
1248
+ box-shadow 160ms ease,
1249
+ transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
1250
+ }
1251
+
1252
+ .dpk-fab:hover {
1253
+ color: var(--dpk-ink);
1254
+ transform: translateY(-2px) scale(1.05);
1255
+ box-shadow: var(--dpk-shadow-lg);
1256
+ }
1257
+
1258
+ .dpk-fab:active {
1259
+ transform: translateY(0) scale(0.97);
1260
+ box-shadow: var(--dpk-shadow-xs);
1261
+ }
1262
+
1263
+ .dpk-fab:focus-visible {
1264
+ outline: none;
1265
+ box-shadow: var(--dpk-focus);
1266
+ }
1267
+
1268
+ .dpk-fab[aria-expanded='true'] {
1269
+ color: var(--dpk-accent-ink);
1270
+ border-color: transparent;
1271
+ background: linear-gradient(135deg, var(--dpk-accent), var(--dpk-accent-strong));
1272
+ box-shadow: 0 2px 8px rgba(217, 73, 32, 0.3);
1273
+ }
1274
+
1275
+ .dpk-fab[aria-expanded='true']:hover {
1276
+ box-shadow: 0 4px 14px rgba(217, 73, 32, 0.4);
1277
+ }
1278
+
1279
+ .dpk-fab-icon {
1280
+ position: relative;
1281
+ display: block;
1282
+ width: 16px;
1283
+ height: 12px;
1284
+ border: 1.6px solid currentColor;
1285
+ border-radius: 3.5px;
1286
+ }
1287
+
1288
+ .dpk-fab-icon::after {
1289
+ content: '';
1290
+ position: absolute;
1291
+ left: 2px;
1292
+ bottom: -4px;
1293
+ border-left: 3.5px solid transparent;
1294
+ border-right: 3.5px solid transparent;
1295
+ border-top: 4px solid currentColor;
1296
+ }
1297
+
1298
+ .dpk-fab-badge {
1299
+ position: absolute;
1300
+ top: -5px;
1301
+ right: -5px;
1302
+ min-width: 18px;
1303
+ height: 18px;
1304
+ padding: 0 4px;
1305
+ border: 2px solid var(--dpk-paper-raised);
1306
+ border-radius: 999px;
1307
+ background: linear-gradient(135deg, var(--dpk-accent-bright), var(--dpk-accent));
1308
+ color: var(--dpk-accent-ink);
1309
+ font-family: var(--dpk-mono);
1310
+ font-size: 9.5px;
1311
+ font-weight: 600;
1312
+ font-variant-numeric: tabular-nums;
1313
+ line-height: 14px;
1314
+ text-align: center;
1315
+ box-shadow: 0 1px 4px rgba(217, 73, 32, 0.3);
1316
+ }
1317
+ `];class hi extends M{static{this.styles=ui}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#t=!1;#i=new pi(this);#s=new oi(this,()=>this.storage!=="off"&&this.storage!=="memory");#o=new ni(this);#n;#e=Le;#r=null;#a=new Set;#l=null;#m;#d;#g;#p=[];#c;#x=new Promise(e=>{this.#c=e});#u;connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#t||(this.#t=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#h(),window.addEventListener("hashchange",this.#S),this.addEventListener("click",this.#O),this.addEventListener("dpk-comment-targets-change",this.#f),this.addEventListener("dpk-comment-request",this.#C),this.addEventListener("dpk-comment-submit",this.#E),this.addEventListener("dpk-element-action",this.#T),this.#g??=new MutationObserver(this.#f),this.#f()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#S),this.removeEventListener("click",this.#O),this.#d?.disconnect(),this.#g?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#f),this.removeEventListener("dpk-comment-request",this.#C),this.removeEventListener("dpk-comment-submit",this.#E),this.removeEventListener("dpk-element-action",this.#T)}#h(e=0){if(this.#n){this.#v();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#h(e+1));return}this.#j()}#v(){this.#m||(this.#m=this.#n?.subscribe(()=>this.#I()))}willUpdate(){this.dataset.theme=this.#s.resolve(ne(this.theme))}updated(){this.#L()}get api(){return this.#u??=this.#M(),this.#u}get controller(){if(!this.#n)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#n}get derivation(){return this.controller.derivation}get navigation(){return this.#e}dispatch(e){const s=this.controller.dispatch(e);return s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#y()),s}dispatchBatch(e){const s=this.controller.dispatchBatch(e);return s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#y()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=V(this.#k());this.#e=Ue(this.#e,e),this.#w(s.replace??!1);const r=V(this.#k());this.requestUpdate(),n!==r&&(this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#e},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#k();return V(this.definition.resolveNavigation(this.derivation.state,Ue(s,e)))}requestComment(e){this.#r=typeof e=="string"?e:C(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#o.available}sendToClaude(){return this.#o.send({brief:this.api.exportBrief(),draft:ve(this.derivation.actions),anchor:this})}renderReviewPanel(e){return g`<dpk-component-comment-panel
1318
+ .definition=${this.controller.definition}
1319
+ .state=${e.state}
1320
+ .navigation=${e.navigation}
1321
+ .derivation=${this.derivation}
1322
+ .issues=${this.controller.lastIssues}
1323
+ .exportBrief=${()=>this.api.exportBrief()}
1324
+ .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
1325
+ .pendingTarget=${this.#r}
1326
+ .embedded=${this.integratedReview}
1327
+ .onDelete=${s=>this.removeAction(s)}
1328
+ .onClear=${()=>this.clearActions()}
1329
+ .onComment=${(s,n)=>{const r=this.dispatch({type:E,target:s,payload:{body:n}});return r.ok&&(this.#r=null),r}}
1330
+ ></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.comments.length;return g`
1331
+ <div class="dpk-shell">
1332
+ <header class="dpk-header">
1333
+ <div class="dpk-title">
1334
+ <span class="dpk-template-mark">${this.definition.label}</span>
1335
+ <h1>${this.definition.title(e.state)}</h1>
1336
+ </div>
1337
+ <div class="dpk-header-slot">
1338
+ ${s.header??m}
1339
+ <slot name="header"></slot>
1340
+ </div>
1341
+ <div class="dpk-header-meta">
1342
+ <span>dev-process-kit@${W}</span>
1343
+ <span>${this.definition.name}</span>
1344
+ <span>${n} draft · ${r} note</span>
1345
+ </div>
1346
+ ${this.#$()}
1347
+ </header>
1348
+ <div class="dpk-body">
1349
+ <aside
1350
+ class="dpk-sidebar"
1351
+ ?hidden=${s.sidebarHidden||!s.sidebar&&!this.hasSidebarContent()}
1352
+ >
1353
+ ${s.sidebar??m}
1354
+ <slot name="sidebar"></slot>
1355
+ </aside>
1356
+ <main class="dpk-main">
1357
+ <div class="dpk-main-body">
1358
+ ${this.#l?g`<div class="dpk-banner" role="alert">
1359
+ <strong>base data を読み込めませんでした(空のページとして表示中)</strong>
1360
+ <code>${this.#l}</code>
1361
+ </div>`:m}
1362
+ ${s.main??m}
1363
+ <slot name="main"></slot>
1364
+ <section class="dpk-orphans" ?hidden=${this.#i.orphans===0}>
1365
+ <p class="dpk-label">previews without metadata</p>
1366
+ <slot name="preview"></slot>
1367
+ </section>
1368
+ </div>
1369
+ <div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
1370
+ <slot name="memo"></slot>
1371
+ </div>
1372
+ </main>
1373
+ ${this.integratedReview?m:g`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
1374
+ </div>
1375
+ ${s.footer||this.hasFooterContent()?g`<footer class="dpk-footer">
1376
+ ${s.footer??m}
1377
+ <slot name="footer"></slot>
1378
+ </footer>`:m}
1379
+ ${this.integratedReview?m:g`<button
1380
+ class="dpk-fab"
1381
+ type="button"
1382
+ aria-expanded=${this.notesOpen?"true":"false"}
1383
+ title="レビュー / コメント"
1384
+ @click=${()=>{this.notesOpen=!this.notesOpen}}
1385
+ >
1386
+ <span class="dpk-fab-icon" aria-hidden="true"></span>
1387
+ <span
1388
+ class="dpk-label"
1389
+ style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
1390
+ >
1391
+ レビュー
1392
+ </span>
1393
+ ${n>0?g`<span class="dpk-fab-badge">${n}</span>`:m}
1394
+ </button>`}
1395
+ </div>
1396
+ `}#$(){const e=this.dataset.theme==="dark",s=e?"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B":"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B";return g`<button
1397
+ class="dpk-theme-toggle"
1398
+ type="button"
1399
+ aria-label=${s}
1400
+ title=${s}
1401
+ @click=${()=>this.#s.toggle(ne(this.theme))}
1402
+ >
1403
+ ${e?ar():lr()}
1404
+ </button>`}render(){if(!this.#n)return m;const e=this.#_();return this.renderChrome(e,this.renderRegions(e))}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#_()}#b(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#x,navigation:()=>this.#k(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#a.add(e),()=>{this.#a.delete(e)}),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,s)=>this.navigate(e,s),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#M(){return Yr(this.#b(),this)}#A(){return xs(this.#b())}#_(){return Gr(this.#b())}#k(){return this.definition.resolveNavigation(this.derivation.state,this.#e)}#j(){const e=this.#N();this.#e=Os();const s=this.storageKey;this.#n=new ys({definition:this.definition,base:e,storage:this.#R(),...typeof s=="string"?{storageKey:s}:{}}),this.#v(),this.#f(),this.#w(!0),this.#c?.(),this.#P(),this.requestUpdate()}#R(){return this.storage==="off"?null:this.storage==="memory"?new Je:Ve()}#N(){const e=this.querySelector('script[type="application/json"]');if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#l='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(s){return console.error("[dev-process-kit] invalid base data:",s),this.#l=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#P(){this.querySelector('script[type="application/json"]')||(this.#d=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#d?.disconnect(),this.#d=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(s){console.error("[dev-process-kit] invalid base data:",s)}}}),this.#d.observe(this,{childList:!0,subtree:!0}))}#y(){const e=this.#A();for(const s of this.#a)s(e)}#I(){if(!this.isConnected){this.requestUpdate(),this.#y();return}this.#w(!0),Ts(this.#p,this.controller.actions),queueMicrotask(this.#f),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#A(),bubbles:!0,composed:!0}))}#w(e){const s=this.#k();this.#e=s,di(s,e)}#S=()=>{this.#e=Os(),this.#w(!0),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#e},bubbles:!0,composed:!0}))};#f=()=>{this.#g?.disconnect(),this.#p=ai(this,e=>{this.isConnected&&this.#g?.observe(e,{childList:!0,subtree:!0})}),this.#n&&(Ts(this.#p,this.#n.actions),this.#n.setComponentSnapshot(ci(this.#p)))};#C=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#n)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#f(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===s.target))||this.requestComment(s.target)};#E=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#n)return;const s=x(fr,e.detail);if(!s.success)return;this.#f();const{target:n,body:r}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===n))return;this.dispatch({type:E,target:n,payload:{body:r}}).ok&&e.preventDefault()};#T=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#n)return;const s=x(On,e.detail);if(!s.success)return;this.#f();const{type:n,target:r,payload:i}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===r))return;this.dispatch({type:n,target:r,payload:i}).ok&&e.preventDefault()};#O=e=>{for(const s of e.composedPath()){if(!(s instanceof Element))continue;if(s===this||s.hasAttribute("data-template"))break;const n=s.getAttribute("data-dpk-navigate");if(n!==null){e.preventDefault(),this.navigate(ze(n.includes("=")?n:`step=${n}`));return}const r=s.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#L(){this.#i.route()}}const fi=(t,e)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e}})};export{R as $,Qn as A,tr as B,E as C,Xt as D,Le as E,W as F,Xn as G,sr as H,Zn as I,er as J,Yn as K,hs as L,Je as M,ze as N,Tt as O,bn as P,Ue as Q,yn as R,ve as S,hi as T,Ot as U,C as V,Ke as W,be as X,Me as Y,pe as Z,en as _,fi as a,m as a0,g as a1,Qt as a2,qs as a3,M as a4,ir as a5,or as a6,Et as a7,K as a8,ge as a9,Yt as aA,U as aa,f as ab,me as ac,b as ad,y as ae,wt as af,Ct as ag,B as ah,F as ai,kt as aj,x as ak,w as al,xt as am,Oe as an,yt as ao,bt as ap,$t as aq,S as ar,fn as as,ke as at,he as au,Ht as av,Ut as aw,gn as ax,Jt as ay,Vt as az,Nt as b,mt as c,ys as d,Re as e,vn as f,Be as g,Rt as h,Ne as i,ps as j,ue as k,Mt as l,wn as m,je as n,Ve as o,bs as p,mn as q,pr as r,tn as s,us as t,J as u,xn as v,V as w,rr as x,nr as y,qe as z};