dev-process-kit 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/chunks/{shared-B0kk4Png.js → shared-8NAMqG0U.js} +1 -1
  2. package/dist/chunks/{shared-DLpKWOi6.js → shared-B00JP4in.js} +1 -1
  3. package/dist/chunks/shared-B5lBiq5s.js +1 -0
  4. package/dist/chunks/{shared-56aw61Mt.js → shared-BtN-8ibq.js} +1 -1
  5. package/dist/chunks/{shared-CYcKSitA.js → shared-C6QYWD8M.js} +3 -3
  6. package/dist/chunks/{shared-CHPc3-vO.js → shared-CUPe-wfx.js} +1 -1
  7. package/dist/chunks/{shared-BMyu-cIr.js → shared-CWKqlSx3.js} +1 -1
  8. package/dist/chunks/shared-CpTDkEui.js +3751 -0
  9. package/dist/chunks/shared-CtHWU02m.js +1 -0
  10. package/dist/chunks/{shared-6yS1zZwk.js → shared-DEjjuQMh.js} +1 -1
  11. package/dist/chunks/{shared-DlMlDHZ3.js → shared-DRvgJdY6.js} +1 -1
  12. package/dist/chunks/{shared-DFT6VIi_.js → shared-DWY93NpU.js} +1 -1
  13. package/dist/chunks/{shared-C1OgX-P6.js → shared-DXaIVZ_z.js} +56 -56
  14. package/dist/chunks/{shared-BqyO8tFt.js → shared-DzxR5Yzc.js} +1 -1
  15. package/dist/chunks/{shared-wOFcYu2a.js → shared-Ezic-gbC.js} +1 -1
  16. package/dist/chunks/{shared-BYBLt-RG.js → shared-IQ2sflGo.js} +1 -1
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/grill.js +1 -1
  23. package/dist/templates/plain.js +1 -1
  24. package/dist/templates/prototype.js +1 -1
  25. package/dist/templates/slides.js +1 -1
  26. package/dist/templates/task-board.js +1 -1
  27. package/dist/templates/usm.js +1 -1
  28. package/dist/templates/whiteboard.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-DdefS1nG.js +0 -1
  31. package/dist/chunks/shared-DewUyNUX.js +0 -2245
  32. package/dist/chunks/shared-sTu0Wlge.js +0 -1
@@ -1,6 +1,6 @@
1
- const xt=globalThis,on=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,an=Symbol(),Es=new WeakMap;let Rs=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==an)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(on&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=Es.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Es.set(n,e))}return e}toString(){return this.cssText}};const _s=t=>new Rs(typeof t=="string"?t:t+"",void 0,an),de=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new Rs(n,t,an)},jo=(t,e)=>{if(on)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=xt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},Ls=on?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return _s(n)})(t):t,{is:qo,defineProperty:Bo,getOwnPropertyDescriptor:Uo,getOwnPropertyNames:Ho,getOwnPropertySymbols:Fo,getPrototypeOf:Wo}=Object,yt=globalThis,Os=yt.trustedTypes,Vo=Os?Os.emptyScript:"",Ko=yt.reactiveElementPolyfillSupport,Ye=(t,e)=>t,ln={toAttribute(t,e){switch(e){case Boolean:t=t?Vo:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Ps=(t,e)=>!qo(t,e),zs={attribute:!0,type:String,converter:ln,reflect:!1,useDefault:!1,hasChanged:Ps};Symbol.metadata??=Symbol("metadata"),yt.litPropertyMetadata??=new WeakMap;let Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=zs){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Bo(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Uo(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zs}static _$Ei(){if(this.hasOwnProperty(Ye("elementProperties")))return;const e=Wo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ye("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ye("properties"))){const n=this.properties,s=[...Ho(n),...Fo(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(Ls(i))}else e!==void 0&&n.push(Ls(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:ln).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ln;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??Ps)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[Ye("elementProperties")]=new Map,Ne[Ye("finalized")]=new Map,Ko?.({ReactiveElement:Ne}),(yt.reactiveElementVersions??=[]).push("2.1.2");const cn=globalThis,Ms=t=>t,wt=cn.trustedTypes,Is=wt?wt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ns="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Ds="?"+pe,Go=`<${Ds}>`,we=document,Je=()=>we.createComment(""),Xe=t=>t===null||typeof t!="object"&&typeof t!="function",dn=Array.isArray,Zo=t=>dn(t)||typeof t?.[Symbol.iterator]=="function",pn=`[
1
+ const xt=globalThis,on=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,an=Symbol(),Es=new WeakMap;let Rs=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==an)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(on&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=Es.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Es.set(n,e))}return e}toString(){return this.cssText}};const _s=t=>new Rs(typeof t=="string"?t:t+"",void 0,an),de=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]);return new Rs(n,t,an)},Bo=(t,e)=>{if(on)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=xt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},Ls=on?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return _s(n)})(t):t,{is:Uo,defineProperty:Ho,getOwnPropertyDescriptor:Fo,getOwnPropertyNames:Wo,getOwnPropertySymbols:Vo,getPrototypeOf:Ko}=Object,yt=globalThis,Os=yt.trustedTypes,Go=Os?Os.emptyScript:"",Zo=yt.reactiveElementPolyfillSupport,Ye=(t,e)=>t,ln={toAttribute(t,e){switch(e){case Boolean:t=t?Go:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Ps=(t,e)=>!Uo(t,e),zs={attribute:!0,type:String,converter:ln,reflect:!1,useDefault:!1,hasChanged:Ps};Symbol.metadata??=Symbol("metadata"),yt.litPropertyMetadata??=new WeakMap;let De=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=zs){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Ho(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Fo(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??zs}static _$Ei(){if(this.hasOwnProperty(Ye("elementProperties")))return;const e=Ko(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ye("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ye("properties"))){const n=this.properties,s=[...Wo(n),...Vo(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(Ls(i))}else e!==void 0&&n.push(Ls(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Bo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:ln).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ln;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??Ps)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};De.elementStyles=[],De.shadowRootOptions={mode:"open"},De[Ye("elementProperties")]=new Map,De[Ye("finalized")]=new Map,Zo?.({ReactiveElement:De}),(yt.reactiveElementVersions??=[]).push("2.1.2");const cn=globalThis,Ms=t=>t,wt=cn.trustedTypes,Is=wt?wt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ns="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Ds="?"+pe,Yo=`<${Ds}>`,we=document,Je=()=>we.createComment(""),Xe=t=>t===null||typeof t!="object"&&typeof t!="function",dn=Array.isArray,Jo=t=>dn(t)||typeof t?.[Symbol.iterator]=="function",pn=`[
2
2
  \f\r]`,Qe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,js=/-->/g,qs=/>/g,$e=RegExp(`>|${pn}(?:([^\\s"'>=/]+)(${pn}*=${pn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Bs=/'/g,Us=/"/g,Hs=/^(?:script|style|textarea|title)$/i,Fs=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=Fs(1),Yo=Fs(2),H=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ws=new WeakMap,Se=we.createTreeWalker(we,129);function Vs(t,e){if(!dn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(e):e}const Jo=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Qe;for(let a=0;a<n;a++){const l=t[a];let c,p,d=-1,h=0;for(;h<l.length&&(o.lastIndex=h,p=o.exec(l),p!==null);)h=o.lastIndex,o===Qe?p[1]==="!--"?o=js:p[1]!==void 0?o=qs:p[2]!==void 0?(Hs.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=$e):p[3]!==void 0&&(o=$e):o===$e?p[0]===">"?(o=i??Qe,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?$e:p[3]==='"'?Us:Bs):o===Us||o===Bs?o=$e:o===js||o===qs?o=Qe:(o=$e,i=void 0);const u=o===$e&&t[a+1].startsWith("/>")?" ":"";r+=o===Qe?l+Go:d>=0?(s.push(c),l.slice(0,d)+Ns+l.slice(d)+pe+u):l+pe+(d===-2?a:u)}return[Vs(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let hn=class Io{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,p]=Jo(e,n);if(this.el=Io.createElement(c,s),Se.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Se.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(Ns)){const h=p[o++],u=i.getAttribute(d).split(pe),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:r,name:f[2],strings:u,ctor:f[1]==="."?Qo:f[1]==="?"?ea:f[1]==="@"?ta:St}),i.removeAttribute(d)}else d.startsWith(pe)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(Hs.test(i.tagName)){const d=i.textContent.split(pe),h=d.length-1;if(h>0){i.textContent=wt?wt.emptyScript:"";for(let u=0;u<h;u++)i.append(d[u],Je()),Se.nextNode(),l.push({type:2,index:++r});i.append(d[h],Je())}}}else if(i.nodeType===8)if(i.data===Ds)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(pe,d+1))!==-1;)l.push({type:7,index:r}),d+=pe.length-1}r++}}static createElement(e,n){const s=we.createElement("template");return s.innerHTML=e,s}};function De(t,e,n=t,s){if(e===H)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Xe(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=De(t,i._$AS(t,e.values),i,s)),e}let Xo=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??we).importNode(n,!0);Se.currentNode=i;let r=Se.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new $t(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new na(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=Se.nextNode(),o++)}return Se.currentNode=we,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},$t=class No{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=De(this,e,n),Xe(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==H&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Zo(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!==g&&Xe(this._$AH)?this._$AA.nextSibling.data=e:this.T(we.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=hn.createElement(Vs(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new Xo(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ws.get(e.strings);return n===void 0&&Ws.set(e.strings,n=new hn(e)),n}k(e){dn(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new No(this.O(Je()),this.O(Je()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=Ms(e).nextSibling;Ms(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class St{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=De(this,e,n,0),o=!Xe(e)||e!==this._$AH&&e!==H,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=De(this,a[s+l],n,l),c===H&&(c=this._$AH[l]),o||=!Xe(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Qo=class extends St{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},ea=class extends St{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},ta=class extends St{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=De(this,e,n,0)??g)===H)return;const s=this._$AH,i=e===g&&s!==g||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==g&&(s===g||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class na{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){De(this,e)}}const sa={I:$t},ia=cn.litHtmlPolyfillSupport;ia?.(hn,$t),(cn.litHtmlVersions??=[]).push("3.3.3");const ra=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new $t(e.insertBefore(Je(),r),r,void 0,n??{})}return i._$AI(t),i},un=globalThis;let he=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ra(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};he._$litElement$=!0,he.finalized=!0,un.litElementHydrateSupport?.({LitElement:he});const oa=un.litElementPolyfillSupport;oa?.({LitElement:he}),(un.litElementVersions??=[]).push("4.2.2");const ue={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},et=t=>(...e)=>({_$litDirective$:t,values:e});let At=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:aa}=sa,Ks=t=>t,la=t=>t.strings===void 0,Gs=()=>document.createComment(""),tt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(Gs(),i),o=s.insertBefore(Gs(),i);n=new aa(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=Ks(l).nextSibling;Ks(s).insertBefore(l,i),l=c}}}return n},Ae=(t,e,n=t)=>(t._$AI(e,n),t),ca={},fn=(t,e=ca)=>t._$AH=e,da=t=>t._$AH,gn=t=>{t._$AR(),t._$AA.remove()},mn=et(class extends At{constructor(t){if(super(t),t.type!==ue.PROPERTY&&t.type!==ue.ATTRIBUTE&&t.type!==ue.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!la(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===H||e===g)return e;const n=t.element,s=t.name;if(t.type===ue.PROPERTY){if(e===n[s])return H}else if(t.type===ue.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return H}else if(t.type===ue.ATTRIBUTE&&n.getAttribute(s)===e+"")return H;return fn(t),e}});class Ct extends At{constructor(e){if(super(e),this.it=g,e.type!==ue.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===H)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Ct.directiveName="unsafeHTML",Ct.resultType=1;const Zs=et(Ct),Tt=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},kn=["en","ja"],Ys="en",Js=t=>kn.some(e=>e===t),Et=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Js(e)?e:Ys},Xs=t=>Et(Tt(t)),bn="dpk-locale-change",Qs=t=>typeof t=="string"&&Js(t)?t:null,pa=t=>t.preference??t.authored,ha=(t,e)=>t===e?null:t,Rt=t=>e=>e==="ja"?t.ja:t.en;class vn{#e;#n;#s=Ys;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=Xs(this.#e),document.addEventListener(bn,this.#r)}hostDisconnected(){document.removeEventListener(bn,this.#r)}#r=()=>{const e=Xs(this.#e);e!==this.#s&&(this.#s=e,this.#n(),this.#e.requestUpdate())}}const ua={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},ei=t=>_s(Object.entries(ua).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Bs=/'/g,Us=/"/g,Hs=/^(?:script|style|textarea|title)$/i,Fs=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=Fs(1),Xo=Fs(2),H=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ws=new WeakMap,Se=we.createTreeWalker(we,129);function Vs(t,e){if(!dn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(e):e}const Qo=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Qe;for(let a=0;a<n;a++){const l=t[a];let c,p,d=-1,h=0;for(;h<l.length&&(o.lastIndex=h,p=o.exec(l),p!==null);)h=o.lastIndex,o===Qe?p[1]==="!--"?o=js:p[1]!==void 0?o=qs:p[2]!==void 0?(Hs.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=$e):p[3]!==void 0&&(o=$e):o===$e?p[0]===">"?(o=i??Qe,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?$e:p[3]==='"'?Us:Bs):o===Us||o===Bs?o=$e:o===js||o===qs?o=Qe:(o=$e,i=void 0);const u=o===$e&&t[a+1].startsWith("/>")?" ":"";r+=o===Qe?l+Yo:d>=0?(s.push(c),l.slice(0,d)+Ns+l.slice(d)+pe+u):l+pe+(d===-2?a:u)}return[Vs(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let hn=class Do{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,p]=Qo(e,n);if(this.el=Do.createElement(c,s),Se.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Se.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(Ns)){const h=p[o++],u=i.getAttribute(d).split(pe),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:r,name:f[2],strings:u,ctor:f[1]==="."?ta:f[1]==="?"?na:f[1]==="@"?sa:St}),i.removeAttribute(d)}else d.startsWith(pe)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(Hs.test(i.tagName)){const d=i.textContent.split(pe),h=d.length-1;if(h>0){i.textContent=wt?wt.emptyScript:"";for(let u=0;u<h;u++)i.append(d[u],Je()),Se.nextNode(),l.push({type:2,index:++r});i.append(d[h],Je())}}}else if(i.nodeType===8)if(i.data===Ds)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(pe,d+1))!==-1;)l.push({type:7,index:r}),d+=pe.length-1}r++}}static createElement(e,n){const s=we.createElement("template");return s.innerHTML=e,s}};function je(t,e,n=t,s){if(e===H)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Xe(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=je(t,i._$AS(t,e.values),i,s)),e}let ea=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??we).importNode(n,!0);Se.currentNode=i;let r=Se.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new $t(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new ia(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=Se.nextNode(),o++)}return Se.currentNode=we,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},$t=class jo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=je(this,e,n),Xe(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==H&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Jo(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!==g&&Xe(this._$AH)?this._$AA.nextSibling.data=e:this.T(we.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=hn.createElement(Vs(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new ea(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Ws.get(e.strings);return n===void 0&&Ws.set(e.strings,n=new hn(e)),n}k(e){dn(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new jo(this.O(Je()),this.O(Je()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=Ms(e).nextSibling;Ms(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class St{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=je(this,e,n,0),o=!Xe(e)||e!==this._$AH&&e!==H,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=je(this,a[s+l],n,l),c===H&&(c=this._$AH[l]),o||=!Xe(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let ta=class extends St{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},na=class extends St{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},sa=class extends St{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=je(this,e,n,0)??g)===H)return;const s=this._$AH,i=e===g&&s!==g||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==g&&(s===g||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class ia{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){je(this,e)}}const ra={I:$t},oa=cn.litHtmlPolyfillSupport;oa?.(hn,$t),(cn.litHtmlVersions??=[]).push("3.3.3");const aa=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new $t(e.insertBefore(Je(),r),r,void 0,n??{})}return i._$AI(t),i},un=globalThis;let he=class extends De{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=aa(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};he._$litElement$=!0,he.finalized=!0,un.litElementHydrateSupport?.({LitElement:he});const la=un.litElementPolyfillSupport;la?.({LitElement:he}),(un.litElementVersions??=[]).push("4.2.2");const ue={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},et=t=>(...e)=>({_$litDirective$:t,values:e});let At=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:ca}=ra,Ks=t=>t,da=t=>t.strings===void 0,Gs=()=>document.createComment(""),tt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(Gs(),i),o=s.insertBefore(Gs(),i);n=new ca(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=Ks(l).nextSibling;Ks(s).insertBefore(l,i),l=c}}}return n},Ae=(t,e,n=t)=>(t._$AI(e,n),t),pa={},fn=(t,e=pa)=>t._$AH=e,ha=t=>t._$AH,gn=t=>{t._$AR(),t._$AA.remove()},mn=et(class extends At{constructor(t){if(super(t),t.type!==ue.PROPERTY&&t.type!==ue.ATTRIBUTE&&t.type!==ue.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!da(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===H||e===g)return e;const n=t.element,s=t.name;if(t.type===ue.PROPERTY){if(e===n[s])return H}else if(t.type===ue.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return H}else if(t.type===ue.ATTRIBUTE&&n.getAttribute(s)===e+"")return H;return fn(t),e}});class Ct extends At{constructor(e){if(super(e),this.it=g,e.type!==ue.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===H)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Ct.directiveName="unsafeHTML",Ct.resultType=1;const Zs=et(Ct),Tt=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},kn=["en","ja"],Ys="en",Js=t=>kn.some(e=>e===t),Et=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Js(e)?e:Ys},Xs=t=>Et(Tt(t)),bn="dpk-locale-change",Qs=t=>typeof t=="string"&&Js(t)?t:null,ua=t=>t.preference??t.authored,fa=(t,e)=>t===e?null:t,Rt=t=>e=>e==="ja"?t.ja:t.en;class vn{#e;#n;#s=Ys;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=Xs(this.#e),document.addEventListener(bn,this.#r)}hostDisconnected(){document.removeEventListener(bn,this.#r)}#r=()=>{const e=Xs(this.#e);e!==this.#s&&(this.#s=e,this.#n(),this.#e.requestUpdate())}}const ga={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},ei=t=>_s(Object.entries(ga).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
4
  `)),_t=de`
5
5
  :host {
6
6
  /* Browsers without light-dark() stay light. */
@@ -328,7 +328,7 @@ const xt=globalThis,on=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeS
328
328
  min-height: 64px;
329
329
  line-height: 1.55;
330
330
  }
331
- `,fa=de`
331
+ `,ma=de`
332
332
  .comment-pop {
333
333
  box-sizing: border-box;
334
334
  overflow: auto;
@@ -489,12 +489,12 @@ const xt=globalThis,on=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeS
489
489
  .dpk-prose img {
490
490
  max-width: 100%;
491
491
  }
492
- `,je=(t,e)=>t instanceof e?t:null;function yn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ce=yn();function ni(t){Ce=t}var Te={exec:()=>null};function qe(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function y(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(P.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var ga=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),P={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:qe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:qe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${st})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:qe(t=>new RegExp(`^ {0,${t}}>`))},ma=/^(?:[ \t]*(?:\n|$))+/,ka=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ba=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,va=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,si=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ii=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),xa=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$n=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ya=/^[^\n]+/,Sn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wa=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Sn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$a=y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wn).getRegex(),st="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",An=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Sa=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",An).replace("tag",st).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ri=t=>y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),Aa=ri(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ca=ri(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ta=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ca).getRegex(),Cn={blockquote:Ta,code:ka,def:wa,fences:ba,heading:va,hr:nt,html:Sa,lheading:ii,list:$a,newline:ma,paragraph:Aa,table:Te,text:ya},oi=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),Ea={...Cn,lheading:xa,table:oi,paragraph:y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex()},Ra={...Cn,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",An).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Te,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y($n).replace("hr",nt).replace("heading",` *#{1,6} *[^
493
- ]`).replace("lheading",ii).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_a=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,La=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ai=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Oa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ne=/[\p{P}\p{S}]/u,Be=/[\s\p{P}\p{S}]/u,it=/[^\s\p{P}\p{S}]/u,Pa=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),za=/[\p{Pi}\p{Ps}"']/u,li=/(?!~)[\p{P}\p{S}]/u,Ma=/(?!~)[\s\p{P}\p{S}]/u,Ia=/(?:[^\s\p{P}\p{S}]|~)/u,Na=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ga?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ci=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Da=y(ci,"u").replace(/punct/g,ne).getRegex(),ja=y(ci,"u").replace(/punct/g,li).getRegex(),qa=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ba=y(qa,"u").replace(/openQuote/g,za).replace(/punct/g,ne).getRegex(),di="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ua=y(di,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ha=y(di,"gu").replace(/notPunctSpace/g,Ia).replace(/punctSpace/g,Ma).replace(/punct/g,li).getRegex(),Fa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Wa=y(Fa,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Va=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ka="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ga=y(Ka,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Za=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ne).getRegex(),Ya="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ja=y(Ya,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Xa=y(/\\(punct)/,"gu").replace(/punct/g,ne).getRegex(),Qa=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),el=y(An).replace("(?:-->|$)","-->").getRegex(),tl=y("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",el).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pi=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Lt=y(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",pi).getRegex(),nl=y(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Lt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sl=y(/^!?\[(label)\]\[(ref)\]/).replace("label",Lt).replace("ref",Sn).getRegex(),il=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Sn).getRegex(),hi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,rl=y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",pi).getRegex(),ol=y("reflink|nolink(?!\\()","g").replace("reflink",y(/^!?\[(label)\]\[(ref)\]/).replace("label",rl).replace("ref",hi).getRegex()).replace("nolink",y(/^!?\[(ref)\](?:\[\])?/).replace("ref",hi).getRegex()).getRegex(),ui=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,al=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,ll=y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,al).getRegex(),Tn={_backpedal:Te,anyPunctuation:Xa,autolink:Qa,blockSkip:Na,br:ai,code:La,del:Te,delLDelim:Te,delRDelim:Te,emStrongLDelim:Da,emStrongRDelimAst:Ua,emStrongRDelimUnd:Va,escape:_a,link:nl,nolink:il,punctuation:Pa,reflink:sl,reflinkSearch:ol,tag:tl,text:Oa,url:Te},cl={...Tn,emStrongLDelim:Ba,emStrongRDelimAst:Wa,emStrongRDelimUnd:Ga,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Lt).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lt).getRegex()},En={...Tn,emStrongRDelimAst:Ha,emStrongLDelim:ja,delLDelim:Za,delRDelim:Ja,url:y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",ll).replace("protocol",ui).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ui).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},dl={...En,br:y(ai).replace("{2,}","*").getRegex(),text:y(En.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ot={normal:Cn,gfm:Ea,pedantic:Ra},rt={normal:Tn,gfm:En,breaks:dl,pedantic:cl},pl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fi=t=>pl[t];function q(t,e){if(e){if(P.escapeTest.test(t))return t.replace(P.escapeReplace,fi)}else if(P.escapeTestNoEncode.test(t))return t.replace(P.escapeReplaceNoEncode,fi);return t}function hl(t){return t.replace(P.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function gi(t){try{t=encodeURI(t).replace(P.percentDecode,"%")}catch{return null}return t}function mi(t,e){let n=t.replace(P.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(P.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(P.slashPipe,"|");return s}function fe(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function ki(t){let e=t.split(`
492
+ `,Ce=(t,e)=>t instanceof e?t:null;function yn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Te=yn();function ni(t){Te=t}var Ee={exec:()=>null};function qe(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function y(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(P.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var ka=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),P={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:qe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:qe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:qe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:qe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${st})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:qe(t=>new RegExp(`^ {0,${t}}>`))},ba=/^(?:[ \t]*(?:\n|$))+/,va=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ya=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,si=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ii=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),wa=y(si).replace(/bull/g,wn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$n=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,$a=/^[^\n]+/,Sn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Sa=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Sn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Aa=y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wn).getRegex(),st="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",An=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ca=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",An).replace("tag",st).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ri=t=>y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),Ta=ri(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ea=ri(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ra=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ea).getRegex(),Cn={blockquote:Ra,code:va,def:Sa,fences:xa,heading:ya,hr:nt,html:Ca,lheading:ii,list:Aa,newline:ba,paragraph:Ta,table:Ee,text:$a},oi=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex(),_a={...Cn,lheading:wa,table:oi,paragraph:y($n).replace("hr",nt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",st).getRegex()},La={...Cn,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",An).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y($n).replace("hr",nt).replace("heading",` *#{1,6} *[^
493
+ ]`).replace("lheading",ii).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oa=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pa=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ai=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,za=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ne=/[\p{P}\p{S}]/u,Be=/[\s\p{P}\p{S}]/u,it=/[^\s\p{P}\p{S}]/u,Ma=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Be).getRegex(),Ia=/[\p{Pi}\p{Ps}"']/u,li=/(?!~)[\p{P}\p{S}]/u,Na=/(?!~)[\s\p{P}\p{S}]/u,Da=/(?:[^\s\p{P}\p{S}]|~)/u,ja=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ka?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ci=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qa=y(ci,"u").replace(/punct/g,ne).getRegex(),Ba=y(ci,"u").replace(/punct/g,li).getRegex(),Ua=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ha=y(Ua,"u").replace(/openQuote/g,Ia).replace(/punct/g,ne).getRegex(),di="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Fa=y(di,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Wa=y(di,"gu").replace(/notPunctSpace/g,Da).replace(/punctSpace/g,Na).replace(/punct/g,li).getRegex(),Va="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ka=y(Va,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ga=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Za="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ya=y(Za,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),Ja=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ne).getRegex(),Xa="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Qa=y(Xa,"gu").replace(/notPunctSpace/g,it).replace(/punctSpace/g,Be).replace(/punct/g,ne).getRegex(),el=y(/\\(punct)/,"gu").replace(/punct/g,ne).getRegex(),tl=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),nl=y(An).replace("(?:-->|$)","-->").getRegex(),sl=y("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",nl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),pi=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Lt=y(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",pi).getRegex(),il=y(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Lt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rl=y(/^!?\[(label)\]\[(ref)\]/).replace("label",Lt).replace("ref",Sn).getRegex(),ol=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Sn).getRegex(),hi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,al=y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",pi).getRegex(),ll=y("reflink|nolink(?!\\()","g").replace("reflink",y(/^!?\[(label)\]\[(ref)\]/).replace("label",al).replace("ref",hi).getRegex()).replace("nolink",y(/^!?\[(ref)\](?:\[\])?/).replace("ref",hi).getRegex()).getRegex(),ui=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,cl=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,dl=y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,cl).getRegex(),Tn={_backpedal:Ee,anyPunctuation:el,autolink:tl,blockSkip:ja,br:ai,code:Pa,del:Ee,delLDelim:Ee,delRDelim:Ee,emStrongLDelim:qa,emStrongRDelimAst:Fa,emStrongRDelimUnd:Ga,escape:Oa,link:il,nolink:ol,punctuation:Ma,reflink:rl,reflinkSearch:ll,tag:sl,text:za,url:Ee},pl={...Tn,emStrongLDelim:Ha,emStrongRDelimAst:Ka,emStrongRDelimUnd:Ya,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",Lt).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lt).getRegex()},En={...Tn,emStrongRDelimAst:Wa,emStrongLDelim:Ba,delLDelim:Ja,delRDelim:Qa,url:y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",dl).replace("protocol",ui).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ui).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},hl={...En,br:y(ai).replace("{2,}","*").getRegex(),text:y(En.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ot={normal:Cn,gfm:_a,pedantic:La},rt={normal:Tn,gfm:En,breaks:hl,pedantic:pl},ul={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fi=t=>ul[t];function q(t,e){if(e){if(P.escapeTest.test(t))return t.replace(P.escapeReplace,fi)}else if(P.escapeTestNoEncode.test(t))return t.replace(P.escapeReplaceNoEncode,fi);return t}function fl(t){return t.replace(P.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function gi(t){try{t=encodeURI(t).replace(P.percentDecode,"%")}catch{return null}return t}function mi(t,e){let n=t.replace(P.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(P.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(P.slashPipe,"|");return s}function fe(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function ki(t){let e=t.split(`
494
494
  `),n=e.length-1;for(;n>=0&&P.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
495
- `)}function Pt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function bi(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function vi(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function xi(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let c=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),h=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=!1,!l){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function ul(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
495
+ `)}function Pt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function bi(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function vi(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function xi(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let c=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),h=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=!1,!l){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function gl(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
496
496
  `).map(r=>{let o=r.match(n.other.beginningSpace);if(o===null)return r;let[a]=o;return r.slice(Math.min(a.length,i.length))}).join(`
497
- `)}function yi(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var zt=class{options;rules;lexer;constructor(t){this.options=t||Ce}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:ki(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=ul(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=fe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:fe(e[0],`
497
+ `)}function yi(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var zt=class{options;rules;lexer;constructor(t){this.options=t||Te}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:ki(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=gl(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=fe(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:fe(e[0],`
498
498
  `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:fe(e[0],`
499
499
  `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=fe(e[0],`
500
500
  `).split(`
@@ -513,16 +513,16 @@ ${A.join(`
513
513
  `);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,c="",p="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let d=e[2].split(`
514
514
  `,1)[0],h=e[1].length,u=this.options.pedantic?vi(d,h):d.replace(this.rules.other.leadingSpaceTab,x=>vi(x,h)),f=t.split(`
515
515
  `,1)[0],k=!u.trim(),m=0;if(this.options.pedantic?(m=2,p=u.trimStart()):k?m=h+1:(m=u.search(this.rules.other.nonSpaceChar),m=m>4?1:m,p=u.slice(m),m+=h),k&&this.rules.other.blankLine.test(f)&&(c+=f+`
516
- `,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(m),$=this.rules.other.hrRegex(m),A=this.rules.other.fencesBeginRegex(m),E=this.rules.other.headingBeginRegex(m),I=this.rules.other.htmlBeginRegex(m),O=this.rules.other.blockquoteBeginRegex(m);for(;t;){let U=t.split(`
517
- `,1)[0],M;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),M=f):M=f.replace(this.rules.other.leadingSpaceTab,te=>te.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||E.test(f)||I.test(f)||O.test(f)||x.test(f)||$.test(f))break;if(M.search(this.rules.other.nonSpaceChar)>=m||!f.trim())p+=`
518
- `+M.slice(m);else{if(k||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||E.test(u)||$.test(u))break;p+=`
516
+ `,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(m),$=this.rules.other.hrRegex(m),A=this.rules.other.fencesBeginRegex(m),R=this.rules.other.headingBeginRegex(m),I=this.rules.other.htmlBeginRegex(m),O=this.rules.other.blockquoteBeginRegex(m);for(;t;){let U=t.split(`
517
+ `,1)[0],M;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),M=f):M=f.replace(this.rules.other.leadingSpaceTab,te=>te.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||R.test(f)||I.test(f)||O.test(f)||x.test(f)||$.test(f))break;if(M.search(this.rules.other.nonSpaceChar)>=m||!f.trim())p+=`
518
+ `+M.slice(m);else{if(k||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||R.test(u)||$.test(u))break;p+=`
519
519
  `+f}k=!f.trim(),c+=U+`
520
520
  `,t=t.substring(U.length+1),u=M.slice(m)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=ki(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&bi(e[2],"()")!==-1)return;let n=Pt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:fe(e[0],`
521
521
  `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=mi(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
522
522
  `):[],r={type:"table",raw:fe(e[0],`
523
523
  `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(mi(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:fe(e[0],`
524
524
  `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
525
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=fe(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=bi(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),xi(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[Pt(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return xi(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,c=s[0][0],p=n===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...s[0]][0].length,u=t.slice(0,i+s.index+h+o);if(Math.min(i,o)%2){let k=u.slice(1,-1);return{type:"em",raw:u,text:k,tokens:this.lexer.inlineTokens(k)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=t.slice(0,i+s.index+c+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:hl(e[0]),escaped:n}}}},K=class $s{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ce,this.options.tokenizer=this.options.tokenizer||new zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:P,block:Ot.normal,inline:rt.normal};this.options.pedantic?(n.block=Ot.pedantic,n.inline=rt.pedantic):this.options.gfm&&(n.block=Ot.gfm,this.options.breaks?n.inline=rt.breaks:n.inline=rt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ot,inline:rt}}static lex(e,n){return new $s(n).lex(e)}static lexInline(e,n){return new $s(n).inlineTokens(e)}lex(e){e=e.replace(P.carriageReturn,`
525
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=fe(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=bi(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),xi(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&yi(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[Pt(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return xi(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,c=s[0][0],p=n===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...s[0]][0].length,u=t.slice(0,i+s.index+h+o);if(Math.min(i,o)%2){let k=u.slice(1,-1);return{type:"em",raw:u,text:k,tokens:this.lexer.inlineTokens(k)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,p=t.slice(0,i+s.index+c+o),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:fl(e[0]),escaped:n}}}},K=class $s{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Te,this.options.tokenizer=this.options.tokenizer||new zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:P,block:Ot.normal,inline:rt.normal};this.options.pedantic?(n.block=Ot.pedantic,n.inline=rt.pedantic):this.options.gfm&&(n.block=Ot.gfm,this.options.breaks?n.inline=rt.breaks:n.inline=rt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ot,inline:rt}}static lex(e,n){return new $s(n).lex(e)}static lexInline(e,n){return new $s(n).inlineTokens(e)}lex(e){e=e.replace(P.carriageReturn,`
526
526
  `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(P.tabCharGlobal," ").replace(P.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
527
527
  `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
528
528
  `)?"":`
@@ -536,7 +536,7 @@ ${A.join(`
536
536
  `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
537
537
  `)?"":`
538
538
  `)+r.raw,a.text+=`
539
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Pt(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Pt(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Mt=class{options;parser;constructor(t){this.options=t||Ce}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(P.notSpaceStart)?.[0],i=t?t.replace(P.endingNewline,"")+`
539
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Pt(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Pt(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Mt=class{options;parser;constructor(t){this.options=t||Te}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(P.notSpaceStart)?.[0],i=t?t.replace(P.endingNewline,"")+`
540
540
  `:"";return s?'<pre><code class="language-'+q(s)+'">'+(n?i:q(i,!0))+`</code></pre>
541
541
  `:"<pre><code>"+(n?i:q(i,!0))+`</code></pre>
542
542
  `}blockquote({tokens:t}){return`<blockquote>
@@ -554,8 +554,8 @@ ${this.parser.parse(t)}</blockquote>
554
554
  `}tablerow({text:t}){return`<tr>
555
555
  ${t}</tr>
556
556
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
557
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${q(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?q(n,!0):this.parser.parseInline(s),o=gi(t);if(o===null)return r;t=q(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+q(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=gi(t);if(i===null)return q(n);t=i;let r=`<img src="${q(t)}" alt="${q(n)}"`;return e&&(r+=` title="${q(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:q(t.text)}},Rn=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},G=class Ss{options;renderer;textRenderer;constructor(e){this.options=e||Ce,this.options.renderer=this.options.renderer||new Mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rn}static parse(e,n){return new Ss(n).parse(e)}static parseInline(e,n){return new Ss(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},ot=class{options;block;constructor(t){this.options=t||Ce}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?K.lex:K.lexInline}provideParser(t=this.block){return t?G.parse:G.parseInline}},wi=class{defaults=yn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=G;Renderer=Mt;TextRenderer=Rn;Lexer=K;Tokenizer=zt;Hooks=ot;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Mt(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new zt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ot;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];ot.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&ot.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return K.lex(t,e??this.defaults)}parser(t,e){return G.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?K.lex:K.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?G.parse:G.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?K.lex:K.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?G.parse:G.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
558
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+q(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ee=new wi;function T(t,e){return Ee.parse(t,e)}T.options=T.setOptions=function(t){return Ee.setOptions(t),T.defaults=Ee.defaults,ni(T.defaults),T},T.getDefaults=yn,T.defaults=Ce;function fl(...t){return Ee.use(...t),T.defaults=Ee.defaults,ni(T.defaults),T}T.use=fl,T.walkTokens=function(t,e){return Ee.walkTokens(t,e)},T.parseInline=Ee.parseInline,T.Parser=G,T.parser=G.parse,T.Renderer=Mt,T.TextRenderer=Rn,T.Lexer=K,T.lexer=K.lex,T.Tokenizer=zt,T.Hooks=ot,T.parse=T,T.options,T.setOptions,T.walkTokens,T.parseInline,G.parse,K.lex;const gl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Re=t=>t.replace(/[&<>"']/g,e=>gl[e]??e),ml=new Set(["http","https","mailto"]),$i=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||ml.has(n.toLowerCase())},kl=t=>/^https?:/i.test(t.trim()),bl=new wi({gfm:!0,breaks:!0,renderer:{html({text:t}){return Re(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!$i(t))return s;const i=e?` title="${Re(e)}"`:"",r=kl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Re(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!$i(t))return Re(n);const s=e?` title="${Re(e)}"`:"";return`<img src="${Re(t)}" alt="${Re(n)}"${s}>`}}}),Si=t=>bl.parse(t,{async:!1}),vl=Rt({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class Ai extends he{static{this.styles=[_t,ti,de`
557
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${q(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?q(n,!0):this.parser.parseInline(s),o=gi(t);if(o===null)return r;t=q(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+q(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=gi(t);if(i===null)return q(n);t=i;let r=`<img src="${q(t)}" alt="${q(n)}"`;return e&&(r+=` title="${q(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:q(t.text)}},Rn=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},G=class Ss{options;renderer;textRenderer;constructor(e){this.options=e||Te,this.options.renderer=this.options.renderer||new Mt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rn}static parse(e,n){return new Ss(n).parse(e)}static parseInline(e,n){return new Ss(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},ot=class{options;block;constructor(t){this.options=t||Te}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?K.lex:K.lexInline}provideParser(t=this.block){return t?G.parse:G.parseInline}},wi=class{defaults=yn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=G;Renderer=Mt;TextRenderer=Rn;Lexer=K;Tokenizer=zt;Hooks=ot;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new Mt(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new zt(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ot;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];ot.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&ot.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,c);return l.call(i,d)})();let p=a.call(i,c);return l.call(i,p)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,c);return d===!1&&(d=await l.apply(i,c)),d})();let p=a.apply(i,c);return p===!1&&(p=l.apply(i,c)),p}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return K.lex(t,e??this.defaults)}parser(t,e){return G.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?K.lex:K.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?G.parse:G.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?K.lex:K.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?G.parse:G.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
558
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+q(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Re=new wi;function T(t,e){return Re.parse(t,e)}T.options=T.setOptions=function(t){return Re.setOptions(t),T.defaults=Re.defaults,ni(T.defaults),T},T.getDefaults=yn,T.defaults=Te;function ml(...t){return Re.use(...t),T.defaults=Re.defaults,ni(T.defaults),T}T.use=ml,T.walkTokens=function(t,e){return Re.walkTokens(t,e)},T.parseInline=Re.parseInline,T.Parser=G,T.parser=G.parse,T.Renderer=Mt,T.TextRenderer=Rn,T.Lexer=K,T.lexer=K.lex,T.Tokenizer=zt,T.Hooks=ot,T.parse=T,T.options,T.setOptions,T.walkTokens,T.parseInline,G.parse,K.lex;const kl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_e=t=>t.replace(/[&<>"']/g,e=>kl[e]??e),bl=new Set(["http","https","mailto"]),$i=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||bl.has(n.toLowerCase())},vl=t=>/^https?:/i.test(t.trim()),xl=new wi({gfm:!0,breaks:!0,renderer:{html({text:t}){return _e(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!$i(t))return s;const i=e?` title="${_e(e)}"`:"",r=vl(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${_e(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!$i(t))return _e(n);const s=e?` title="${_e(e)}"`:"";return`<img src="${_e(t)}" alt="${_e(n)}"${s}>`}}}),Si=t=>xl.parse(t,{async:!1}),yl=Rt({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class Ai extends he{static{this.styles=[_t,ti,de`
559
559
  /* One atomic box in both states, so the text can be edited where it sits:
560
560
  while editing, the text stays (hidden) underneath and keeps sizing the
561
561
  box, and the field lies over it. Starting an edit moves nothing; the
@@ -685,7 +685,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
685
685
  background: transparent;
686
686
  box-shadow: none;
687
687
  }
688
- `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#n=0;#s=new vn(this);connectedCallback(){super.connectedCallback(),this.#n+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement;e&&s!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=vl(this.#s.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=i===""?n:s&&i.endsWith(`
688
+ `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#n=0;#s=new vn(this);connectedCallback(){super.connectedCallback(),this.#n+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement;e&&s!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=yl(this.#s.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=i===""?n:s&&i.endsWith(`
689
689
  `)?`${i}\u200B`:i;return this.markdown&&!s&&i!==""?b`<span class="box"
690
690
  ><div
691
691
  class="view dpk-prose"
@@ -727,20 +727,20 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
727
727
  @input=${this.#o}
728
728
  @keydown=${this.#l}
729
729
  @blur=${this.#a}
730
- />`}#t=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=je(e.target,HTMLInputElement)??je(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#l=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#c())}};#a=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#c())})};#c=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const xl=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Ai)},yl={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function _n(t){return yl}let wl;function $l(t){return wl?.get(t)}let Sl;function Al(t){return Sl?.get(t)}let Cl;function Tl(t,e){return Cl?.get(t)?.get(e)}function Ue(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 R(t,e,n,s,i){const r=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??Ue(r),l={kind:t.kind,type:t.type,input:r,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??Tl(t.reference,l.lang)??(c?Al(l.lang):null)??s.message??$l(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function El(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Rl(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ln(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function z(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},_n())},t}function _l(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var Ll=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Ci(t,e){return{kind:"validation",type:"check",reference:Ci,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&R(this,"input",n,s),n}}}function Ti(t){return{kind:"validation",type:"finite",reference:Ti,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"finite",e,n),e}}}function Ei(t,e){const n=Ue(t);return{kind:"validation",type:"includes",reference:Ei,async:!1,expects:n,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,i,{received:`!${n}`}),s}}}function Ri(t){return{kind:"validation",type:"integer",reference:Ri,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"integer",e,n),e}}}function S(t,e){return{kind:"validation",type:"min_length",reference:S,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&R(this,"length",n,s,{received:`${n.value.length}`}),n}}}function _i(t,e){return{kind:"validation",type:"min_value",reference:_i,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ue(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&R(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():Ue(n.value)}),n}}}function ge(t,e){return{kind:"validation",type:"regex",reference:ge,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&R(this,"format",n,s),n}}}function On(){return{kind:"transformation",type:"trim",reference:On,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Li(t){return{kind:"validation",type:"url",reference:Li,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"URL",e,n),e}}}const Oi={abortEarly:!0};function Pi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function It(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Ol(t,e){return!t["~run"]({value:e},Oi).issues}function F(t,e){return z({kind:"schema",type:"array",reference:F,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let r=0;r<i.length;r++){const o=i[r],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:i,key:r,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],n.issues?.push(c);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else R(this,"type",n,s);return n}})}function zi(t){return z({kind:"schema",type:"boolean",reference:zi,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function B(t,e){return z({kind:"schema",type:"exact_optional",reference:B,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function Mi(t){return z({kind:"schema",type:"lazy",reference:Mi,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function me(t,e){return z({kind:"schema",type:"literal",reference:me,expects:Ue(t),async:!1,literal:t,message:e,"~run"(n,s){return El(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function Ii(t,e){return z({kind:"schema",type:"nullable",reference:Ii,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Ni(t){return z({kind:"schema",type:"number",reference:Ni,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:R(this,"type",e,n),e}})}function L(t,e){return z({kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Pi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function se(t,e){return z({kind:"schema",type:"optional",reference:se,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Nt(t,e){return z({kind:"schema",type:"picklist",reference:Nt,expects:Ln(t.map(Ue),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:R(this,"type",n,s),n}})}function He(t,e,n){return z({kind:"schema",type:"record",reference:He,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const o in r)if(Rl(r,o)){const a=r[o],l=this.key["~run"]({value:o},i);if(l.issues){const p={type:"object",origin:"key",input:r,key:o,value:a};for(const d of l.issues)d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=l.issues),i.abortEarly){s.typed=!1;break}}const c=this.value["~run"]({value:a},i);if(c.issues){const p={type:"object",origin:"value",input:r,key:o,value:a};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=c.issues),i.abortEarly){s.typed=!1;break}}(!l.typed||!c.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=c.value)}}else R(this,"type",s,i);return s}})}function Z(t,e){return z({kind:"schema",type:"strict_object",reference:Z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Pi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const r in i)if(!Object.prototype.hasOwnProperty.call(this.entries,r)){R(this,"key",n,s,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else R(this,"type",n,s);return n}})}function v(t){return z({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:R(this,"type",e,n),e}})}function Di(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function Pn(t,e){return z({kind:"schema",type:"union",reference:Pn,expects:Ln(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let i,r,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)r?r.push(l):r=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(r){if(r.length===1)return r[0];R(this,"type",n,s,{issues:Di(r)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:Di(o)})}return n}})}function ke(){return z({kind:"schema",type:"unknown",reference:ke,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function ji(t,e,n){return z({kind:"schema",type:"variant",reference:ji,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){let o,a=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,k=0;for(const m of h){const x=u.entries[m];if(m in r?x["~run"]({typed:!1,value:r[m]},Oi).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==m&&(a<k||a===k&&m in r&&!(l in r))&&(a=k,l=m,c=[]),l===m&&c.push(u.entries[m].expects);break}k++}if(f){const m=u["~run"]({value:r},i);(!o||!o.typed&&m.typed)&&(o=m)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;R(this,"type",s,i,{input:r[l],expected:Ln(c,"|"),path:[{type:"object",origin:"value",input:r,key:l,value:r[l]}]})}else R(this,"type",s,i);return s}})}function zn(t,e,n){const s=t["~run"]({value:e},_n());if(s.issues)throw new Ll(s.issues);return s.value}function w(...t){return z({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},_n());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Pl(t){let e="";for(const n of t){e&&(e+=`
731
- `),e+=`\xD7 ${n.message}`;const s=_l(n);s&&(e+=`
732
- \u2192 at ${s}`)}return e}const Dt=L({type:w(v(),S(1)),id:w(v(),S(1))}),zl=w(v(),S(1),ge(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Ml=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const n=t.split(".");return n.length===e&&n.every(s=>s.length>0)?n:null},_e=L({id:w(v(),S(1)),type:w(v(),S(1)),target:Dt,payload:ke(),note:B(v()),createdAt:w(v(),S(1))}),Il=(t,e,n,s={})=>{const i=L({id:w(v(),S(1)),type:me(t),target:Dt,payload:n,note:B(v()),createdAt:w(v(),S(1))}),r=o=>{const a=C(_e,o);if(!a.success||a.output.type!==t)return null;const l=C(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:i,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:r,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Nl=(t,e)=>{const n=jt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Dl=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},jt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,jl=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},ql=L({id:w(v(),S(1))}),Bl=t=>{const e=C(ql,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},N=t=>`${t.type}:${t.id}`,at=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Mn=(t,e)=>typeof t=="string"?at(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Ul=(t,e)=>t.type===e.type&&t.id===e.id,qi=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Hl=(t,e)=>{const n=qi(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},Bi=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},D="comment",Le=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Ui=L({type:w(v(),S(1)),target:Pn([w(v(),S(1)),Dt]),payload:se(ke()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Fl=(t,e)=>{const n=C(Ui,t);if(!n.success)return{ok:!1,issue:Le(n.issues)};const s=n.output,i=Mn(s.target,e.targetType),r={id:s.id??Bi(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Le(o.issues)};const a=C(_e,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Le(a.issues)}},In=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${N(t.target)}`,Nn=(t,e,n)=>{const s=In(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||In(i,n)!==s||!Wl(i,e)?[...t,e]:[...t.slice(0,-1),e]},Wl=(t,e)=>Ul(t.target,e.target),Dn=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),Hi=L({id:w(v(),S(1)),type:me(D),target:L({type:w(v(),S(1)),id:w(v(),S(1))}),payload:L({body:w(v(),S(1))}),note:B(v()),createdAt:w(v(),S(1))}),jn={schema:Hi,mode:"append",targetType:"page"},Vl=L({body:v()}),lt=t=>{const e=C(Vl,t.payload);return e.success?e.output.body:""},qn="element",Fi=w(v(),ge(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Wi=He(v(),ke()),Kl=L({type:me(qn),id:w(v(),ge(/^[^/]+\/.+/,"component references start with a provider id"))}),Gl=L({id:w(v(),S(1)),type:Fi,target:Kl,payload:Wi,note:B(v()),createdAt:w(v(),S(1))}),Zl={schema:Gl,mode:"sequence",targetType:qn},Yl=Z({type:Fi,target:w(v(),ge(/^element:[^/]+\/.+/)),payload:se(Wi,{})}),Vi=Z({id:w(v(),S(1)),title:w(v(),S(1)),summary:B(v()),tone:B(Nt(["create","update","delete","move","meta"])),stale:B(Nt(["unsupported-action-type","target-missing","constraint-violated"]))}),Bn=t=>{if(t.type!==qn)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},J=t=>t.type!==D&&Bn(t.target)!==null,Jl=(t,e)=>t.filter(n=>J(n)&&Bn(n.target)===e),Ki=(t,e)=>{const n=new Map(t.flatMap(s=>J(s)?[[s.id,Bn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},Un=Object.freeze({}),qt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Un;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Fe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},Hn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},Xl=(t,e="json")=>`\`\`\`${e}
730
+ />`}#t=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=Ce(e.target,HTMLInputElement)??Ce(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#l=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#c())}};#a=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#c())})};#c=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const wl=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Ai)},$l={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function _n(t){return $l}let Sl;function Al(t){return Sl?.get(t)}let Cl;function Tl(t){return Cl?.get(t)}let El;function Rl(t,e){return El?.get(t)?.get(e)}function Ue(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 E(t,e,n,s,i){const r=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??Ue(r),l={kind:t.kind,type:t.type,input:r,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??Rl(t.reference,l.lang)??(c?Tl(l.lang):null)??s.message??Al(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function _l(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ll(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ln(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function z(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},_n())},t}function Ol(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var Pl=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const zl=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Ml=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Ci(t,e){return{kind:"validation",type:"check",reference:Ci,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&E(this,"input",n,s),n}}}function Ti(t){return{kind:"validation",type:"finite",reference:Ti,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&E(this,"finite",e,n),e}}}function Ei(t,e){const n=Ue(t);return{kind:"validation",type:"includes",reference:Ei,async:!1,expects:n,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&E(this,"content",s,i,{received:`!${n}`}),s}}}function Ri(t){return{kind:"validation",type:"integer",reference:Ri,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&E(this,"integer",e,n),e}}}function _i(t){return{kind:"validation",type:"iso_date",reference:_i,async:!1,expects:null,requirement:zl,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&E(this,"date",e,n),e}}}function Li(t){return{kind:"validation",type:"iso_timestamp",reference:Li,async:!1,expects:null,requirement:Ml,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&E(this,"timestamp",e,n),e}}}function S(t,e){return{kind:"validation",type:"min_length",reference:S,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&E(this,"length",n,s,{received:`${n.value.length}`}),n}}}function Oi(t,e){return{kind:"validation",type:"min_value",reference:Oi,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ue(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&E(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():Ue(n.value)}),n}}}function ge(t,e){return{kind:"validation",type:"regex",reference:ge,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&E(this,"format",n,s),n}}}function On(){return{kind:"transformation",type:"trim",reference:On,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Pi(t){return{kind:"validation",type:"url",reference:Pi,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&E(this,"URL",e,n),e}}}const zi={abortEarly:!0};function Mi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function It(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Il(t,e){return!t["~run"]({value:e},zi).issues}function F(t,e){return z({kind:"schema",type:"array",reference:F,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let r=0;r<i.length;r++){const o=i[r],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:i,key:r,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],n.issues?.push(c);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else E(this,"type",n,s);return n}})}function Ii(t){return z({kind:"schema",type:"boolean",reference:Ii,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:E(this,"type",e,n),e}})}function B(t,e){return z({kind:"schema",type:"exact_optional",reference:B,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function Ni(t){return z({kind:"schema",type:"lazy",reference:Ni,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function me(t,e){return z({kind:"schema",type:"literal",reference:me,expects:Ue(t),async:!1,literal:t,message:e,"~run"(n,s){return _l(n.value,this.literal)?n.typed=!0:E(this,"type",n,s),n}})}function Di(t,e){return z({kind:"schema",type:"nullable",reference:Di,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function ji(t){return z({kind:"schema",type:"number",reference:ji,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:E(this,"type",e,n),e}})}function L(t,e){return z({kind:"schema",type:"object",reference:L,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Mi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(E(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}}else E(this,"type",n,s);return n}})}function se(t,e){return z({kind:"schema",type:"optional",reference:se,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=It(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Nt(t,e){return z({kind:"schema",type:"picklist",reference:Nt,expects:Ln(t.map(Ue),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:E(this,"type",n,s),n}})}function He(t,e,n){return z({kind:"schema",type:"record",reference:He,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const o in r)if(Ll(r,o)){const a=r[o],l=this.key["~run"]({value:o},i);if(l.issues){const p={type:"object",origin:"key",input:r,key:o,value:a};for(const d of l.issues)d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=l.issues),i.abortEarly){s.typed=!1;break}}const c=this.value["~run"]({value:a},i);if(c.issues){const p={type:"object",origin:"value",input:r,key:o,value:a};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],s.issues?.push(d);if(s.issues||(s.issues=c.issues),i.abortEarly){s.typed=!1;break}}(!l.typed||!c.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=c.value)}}else E(this,"type",s,i);return s}})}function Z(t,e){return z({kind:"schema",type:"strict_object",reference:Z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:It(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],n.issues?.push(p);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Mi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(E(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const r in i)if(!Object.prototype.hasOwnProperty.call(this.entries,r)){E(this,"key",n,s,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else E(this,"type",n,s);return n}})}function v(t){return z({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:E(this,"type",e,n),e}})}function qi(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function Pn(t,e){return z({kind:"schema",type:"union",reference:Pn,expects:Ln(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let i,r,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)r?r.push(l):r=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(r){if(r.length===1)return r[0];E(this,"type",n,s,{issues:qi(r)}),n.typed=!0}else{if(o?.length===1)return o[0];E(this,"type",n,s,{issues:qi(o)})}return n}})}function ke(){return z({kind:"schema",type:"unknown",reference:ke,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Bi(t,e,n){return z({kind:"schema",type:"variant",reference:Bi,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){let o,a=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,k=0;for(const m of h){const x=u.entries[m];if(m in r?x["~run"]({typed:!1,value:r[m]},zi).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==m&&(a<k||a===k&&m in r&&!(l in r))&&(a=k,l=m,c=[]),l===m&&c.push(u.entries[m].expects);break}k++}if(f){const m=u["~run"]({value:r},i);(!o||!o.typed&&m.typed)&&(o=m)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;E(this,"type",s,i,{input:r[l],expected:Ln(c,"|"),path:[{type:"object",origin:"value",input:r,key:l,value:r[l]}]})}else E(this,"type",s,i);return s}})}function zn(t,e,n){const s=t["~run"]({value:e},_n());if(s.issues)throw new Pl(s.issues);return s.value}function w(...t){return z({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},_n());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Nl(t){let e="";for(const n of t){e&&(e+=`
731
+ `),e+=`\xD7 ${n.message}`;const s=Ol(n);s&&(e+=`
732
+ \u2192 at ${s}`)}return e}const Dt=L({type:w(v(),S(1)),id:w(v(),S(1))}),Dl=w(v(),S(1),ge(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),jl=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const n=t.split(".");return n.length===e&&n.every(s=>s.length>0)?n:null},Le=L({id:w(v(),S(1)),type:w(v(),S(1)),target:Dt,payload:ke(),note:B(v()),createdAt:w(v(),S(1))}),ql=(t,e,n,s={})=>{const i=L({id:w(v(),S(1)),type:me(t),target:Dt,payload:n,note:B(v()),createdAt:w(v(),S(1))}),r=o=>{const a=C(Le,o);if(!a.success||a.output.type!==t)return null;const l=C(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:i,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:r,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Bl=(t,e)=>{const n=jt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Ul=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},jt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Hl=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Fl=L({id:w(v(),S(1))}),Wl=t=>{const e=C(Fl,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},N=t=>`${t.type}:${t.id}`,at=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Mn=(t,e)=>typeof t=="string"?at(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Vl=(t,e)=>t.type===e.type&&t.id===e.id,Ui=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Kl=(t,e)=>{const n=Ui(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},Hi=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},D="comment",Oe=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Fi=L({type:w(v(),S(1)),target:Pn([w(v(),S(1)),Dt]),payload:se(ke()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Gl=(t,e)=>{const n=C(Fi,t);if(!n.success)return{ok:!1,issue:Oe(n.issues)};const s=n.output,i=Mn(s.target,e.targetType),r={id:s.id??Hi(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Oe(o.issues)};const a=C(Le,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Oe(a.issues)}},In=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${N(t.target)}`,Nn=(t,e,n)=>{const s=In(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||In(i,n)!==s||!Zl(i,e)?[...t,e]:[...t.slice(0,-1),e]},Zl=(t,e)=>Vl(t.target,e.target),Dn=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),Wi=L({id:w(v(),S(1)),type:me(D),target:L({type:w(v(),S(1)),id:w(v(),S(1))}),payload:L({body:w(v(),S(1))}),note:B(v()),createdAt:w(v(),S(1))}),jn={schema:Wi,mode:"append",targetType:"page"},Yl=L({body:v()}),lt=t=>{const e=C(Yl,t.payload);return e.success?e.output.body:""},qn="element",Vi=w(v(),ge(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Ki=He(v(),ke()),Jl=L({type:me(qn),id:w(v(),ge(/^[^/]+\/.+/,"component references start with a provider id"))}),Xl=L({id:w(v(),S(1)),type:Vi,target:Jl,payload:Ki,note:B(v()),createdAt:w(v(),S(1))}),Ql={schema:Xl,mode:"sequence",targetType:qn},ec=Z({type:Vi,target:w(v(),ge(/^element:[^/]+\/.+/)),payload:se(Ki,{})}),Gi=Z({id:w(v(),S(1)),title:w(v(),S(1)),summary:B(v()),tone:B(Nt(["create","update","delete","move","meta"])),stale:B(Nt(["unsupported-action-type","target-missing","constraint-violated"]))}),Bn=t=>{if(t.type!==qn)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},J=t=>t.type!==D&&Bn(t.target)!==null,tc=(t,e)=>t.filter(n=>J(n)&&Bn(n.target)===e),Zi=(t,e)=>{const n=new Map(t.flatMap(s=>J(s)?[[s.id,Bn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},Un=Object.freeze({}),qt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Un;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Fe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},Hn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},nc=(t,e="json")=>`\`\`\`${e}
733
733
  ${t}
734
- \`\`\``,Ql=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Fn=(t,e,n)=>{const{actions:s,state:i}=t,r=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!r.has(p.id)),a=o.filter(p=>p.type===D),l=o.filter(p=>p.type!==D),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${n}\``),c.push(`- navigation: \`${Fe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.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."),l.some(J)&&(c.push(""),c.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.")),c.push(""),a.length>0){c.push(`## Comments (${a.length})`),c.push("");for(const[p,d]of a.entries()){const h=e.describe(d,i,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${N(d.target)}\``),c.push(` > ${lt(d).replace(/\n/g,`
734
+ \`\`\``,sc=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Fn=(t,e,n)=>{const{actions:s,state:i}=t,r=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!r.has(p.id)),a=o.filter(p=>p.type===D),l=o.filter(p=>p.type!==D),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${n}\``),c.push(`- navigation: \`${Fe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.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."),l.some(J)&&(c.push(""),c.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.")),c.push(""),a.length>0){c.push(`## Comments (${a.length})`),c.push("");for(const[p,d]of a.entries()){const h=e.describe(d,i,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${N(d.target)}\``),c.push(` > ${lt(d).replace(/\n/g,`
735
735
  > `)}`)}c.push("")}if(l.length>0){c.push(`## Requested changes (${l.length})`),c.push("");for(const[p,d]of l.entries()){const h=e.describe(d,i,t.base),u=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${u}`),c.push(` target: \`${N(d.target)}\` (${d.target.type})`),c.push(` \`\`\`json
736
- ${Ql(d).replace(/\n/g,`
736
+ ${sc(d).replace(/\n/g,`
737
737
  `)}
738
- \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&(c.push("_No pending draft actions._"),c.push("")),t.stale.length>0){c.push(`## Not applicable to the current base (${t.stale.length})`),c.push(""),c.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),c.push("");for(const[p,{action:d,reason:h}]of t.stale.entries()){const u=e.describe(d,i,t.base),f=d.type===D?lt(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${N(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(Xl(Dn(s))),c.push(""),c.join(`
739
- `)},X="0.0.16",Wn=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Gi=Rt({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),ec=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Zi=t=>t.kind==="explicit"?{kind:t.resume}:t,Yi=(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:Zi(t.attachment)};case"edit-start":return{...t,editing:{id:e.id,body:e.body}};case"edit-input":return t.editing?{...t,editing:{...t.editing,body:e.body}}:t;case"edit-cancel":case"edited":return{...t,editing:null};case"target-requested":return{...t,attachment:{kind:"explicit",ref:e.ref,resume:t.attachment.kind==="explicit"?t.attachment.resume:t.attachment.kind}};case"submitted":return{...t,body:"",attachment:Zi(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-finished":return e.request!==t.copyRequest||t.copy.kind!=="pending"?t:{...t,copy:{kind:e.ok?"copied":"failed"}};case"send-started":return{...t,send:{kind:"pending"},sendRequest:t.sendRequest+1,copy:{kind:"idle"},copyRequest:t.copyRequest+1};case"send-finished":return e.request!==t.sendRequest||t.send.kind!=="pending"?t:{...t,send:e.outcome.ok?{kind:"sent"}:{kind:"failed",reason:e.outcome.reason}}}},tc=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},nc=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},sc={en:"English",ja:"\u65E5\u672C\u8A9E"},W=Rt({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",draftCount:(t,e)=>`${t} ${t===1?"change":"changes"} \xB7 ${e} ${e===1?"note":"notes"}`,handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",draftCount:(t,e)=>`\u5909\u66F4 ${t} \xB7 \u30B3\u30E1\u30F3\u30C8 ${e}`,handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"}}),ic=4096,rc="reviews",Ji="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact. Then answer with ArtifactComments `reply` in this thread: the reader sees only this thread, and the page never shows anything written to the database.",oc=t=>new TextEncoder().encode(t).length,ac=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),lc=t=>{const e=`${Ji}
738
+ \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&(c.push("_No pending draft actions._"),c.push("")),t.stale.length>0){c.push(`## Not applicable to the current base (${t.stale.length})`),c.push(""),c.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),c.push("");for(const[p,{action:d,reason:h}]of t.stale.entries()){const u=e.describe(d,i,t.base),f=d.type===D?lt(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${N(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(nc(Dn(s))),c.push(""),c.join(`
739
+ `)},X="0.0.18",Wn=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Yi=Rt({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),ic=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Ji=t=>t.kind==="explicit"?{kind:t.resume}:t,Xi=(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:Ji(t.attachment)};case"edit-start":return{...t,editing:{id:e.id,body:e.body}};case"edit-input":return t.editing?{...t,editing:{...t.editing,body:e.body}}:t;case"edit-cancel":case"edited":return{...t,editing:null};case"target-requested":return{...t,attachment:{kind:"explicit",ref:e.ref,resume:t.attachment.kind==="explicit"?t.attachment.resume:t.attachment.kind}};case"submitted":return{...t,body:"",attachment:Ji(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-finished":return e.request!==t.copyRequest||t.copy.kind!=="pending"?t:{...t,copy:{kind:e.ok?"copied":"failed"}};case"send-started":return{...t,send:{kind:"pending"},sendRequest:t.sendRequest+1,copy:{kind:"idle"},copyRequest:t.copyRequest+1};case"send-finished":return e.request!==t.sendRequest||t.send.kind!=="pending"?t:{...t,send:e.outcome.ok?{kind:"sent"}:{kind:"failed",reason:e.outcome.reason}}}},rc=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},oc=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},ac={en:"English",ja:"\u65E5\u672C\u8A9E"},W=Rt({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",draftCount:(t,e)=>`${t} ${t===1?"change":"changes"} \xB7 ${e} ${e===1?"note":"notes"}`,handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",draftCount:(t,e)=>`\u5909\u66F4 ${t} \xB7 \u30B3\u30E1\u30F3\u30C8 ${e}`,handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"}}),lc=4096,cc="reviews",Qi="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact. Then answer with ArtifactComments `reply` in this thread: the reader sees only this thread, and the page never shows anything written to the database.",dc=t=>new TextEncoder().encode(t).length,pc=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),hc=t=>{const e=`${Qi}
740
740
 
741
- ${ac(t)}`;return oc(e)<=ic?e:null},cc=t=>`${Ji}
741
+ ${pc(t)}`;return dc(e)<=lc?e:null},uc=t=>`${Qi}
742
742
 
743
- 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).`,dc={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},pc=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?dc[e]:void 0)??"error"},hc={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Vn=(t,e)=>W(e)[hc[t]],Xi=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Qi=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Gi(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,c=l.kind==="explicit"?n.commentTargets(s,i).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?Xi(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Xi(a)}:{ref:`page:${n.name}`,label:o.wholePage},d=new Map(r.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:r.actions.map(h=>{const u=n.describe(h,s,r.base),f=h.type==="comment";return{id:h.id,title:f?o.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?lt(h):u.summary??""},code:f?null:n.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Vn(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},uc=[_t,xn,de`
743
+ 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).`,fc={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},gc=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?fc[e]:void 0)??"error"},mc={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Vn=(t,e)=>W(e)[mc[t]],er=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,tr=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Yi(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,c=l.kind==="explicit"?n.commentTargets(s,i).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?er(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:er(a)}:{ref:`page:${n.name}`,label:o.wholePage},d=new Map(r.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:r.actions.map(h=>{const u=n.describe(h,s,r.base),f=h.type==="comment";return{id:h.id,title:f?o.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?lt(h):u.summary??""},code:f?null:n.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Vn(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},kc=[_t,xn,de`
744
744
  :host {
745
745
  display: flex;
746
746
  flex-direction: column;
@@ -1129,7 +1129,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1129
1129
  letter-spacing: 0.04em;
1130
1130
  color: var(--dpk-green);
1131
1131
  }
1132
- `],er=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},ct=et(class extends At{constructor(t){if(super(t),t.type!==ue.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=da(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,p,d=0,h=i.length-1,u=0,f=r.length-1;for(;d<=h&&u<=f;)if(i[d]===null)d++;else if(i[h]===null)h--;else if(a[d]===o[u])l[u]=Ae(i[d],r[u]),d++,u++;else if(a[h]===o[f])l[f]=Ae(i[h],r[f]),h--,f--;else if(a[d]===o[f])l[f]=Ae(i[d],r[f]),tt(t,l[f+1],i[d]),d++,f--;else if(a[h]===o[u])l[u]=Ae(i[h],r[u]),tt(t,i[d],i[h]),h--,u++;else if(c===void 0&&(c=er(o,u,f),p=er(a,d,h)),c.has(a[d]))if(c.has(a[h])){const k=p.get(o[u]),m=k!==void 0?i[k]:null;if(m===null){const x=tt(t,i[d]);Ae(x,r[u]),l[u]=x}else l[u]=Ae(m,r[u]),tt(t,i[d],m),i[k]=null;u++}else gn(i[h]),h--;else gn(i[d]),d++;for(;u<=f;){const k=tt(t,l[f+1]);Ae(k,r[u]),l[u++]=k}for(;d<=h;){const k=i[d++];k!==null&&gn(k)}return this.ut=o,fn(t,l),H}});class Kn extends Ct{}Kn.directiveName="unsafeSVG",Kn.resultType=2;const fc=et(Kn),tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],nr=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],sr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],ir=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],gc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],mc=[["path",{d:"M20 6 9 17l-5-5"}]],rr=[["path",{d:"m6 9 6 6 6-6"}]],kc=[["path",{d:"m15 18-6-6 6-6"}]],bc=[["path",{d:"m9 18 6-6-6-6"}]],vc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],xc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],yc=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],wc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],$c=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],Sc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Ac=[["path",{d:"M5 12h14"}]],Cc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],Tc=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Ec=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]],Rc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],_c=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Lc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Oc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Pc=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),zc=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Pc(String(i))}"`).join("")}></${e}>`).join(""),_=t=>{const e=zc(t);return()=>b`<svg
1132
+ `],nr=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},ct=et(class extends At{constructor(t){if(super(t),t.type!==ue.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=ha(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,p,d=0,h=i.length-1,u=0,f=r.length-1;for(;d<=h&&u<=f;)if(i[d]===null)d++;else if(i[h]===null)h--;else if(a[d]===o[u])l[u]=Ae(i[d],r[u]),d++,u++;else if(a[h]===o[f])l[f]=Ae(i[h],r[f]),h--,f--;else if(a[d]===o[f])l[f]=Ae(i[d],r[f]),tt(t,l[f+1],i[d]),d++,f--;else if(a[h]===o[u])l[u]=Ae(i[h],r[u]),tt(t,i[d],i[h]),h--,u++;else if(c===void 0&&(c=nr(o,u,f),p=nr(a,d,h)),c.has(a[d]))if(c.has(a[h])){const k=p.get(o[u]),m=k!==void 0?i[k]:null;if(m===null){const x=tt(t,i[d]);Ae(x,r[u]),l[u]=x}else l[u]=Ae(m,r[u]),tt(t,i[d],m),i[k]=null;u++}else gn(i[h]),h--;else gn(i[d]),d++;for(;u<=f;){const k=tt(t,l[f+1]);Ae(k,r[u]),l[u++]=k}for(;d<=h;){const k=i[d++];k!==null&&gn(k)}return this.ut=o,fn(t,l),H}});class Kn extends Ct{}Kn.directiveName="unsafeSVG",Kn.resultType=2;const bc=et(Kn),sr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],ir=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],rr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],or=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],vc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],xc=[["path",{d:"M20 6 9 17l-5-5"}]],ar=[["path",{d:"m6 9 6 6 6-6"}]],yc=[["path",{d:"m15 18-6-6 6-6"}]],wc=[["path",{d:"m9 18 6-6-6-6"}]],$c=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],Sc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],Ac=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],Cc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Tc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],Ec=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Rc=[["path",{d:"M5 12h14"}]],_c=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],Lc=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Oc=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]],Pc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],zc=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Mc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Ic=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Nc=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),Dc=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Nc(String(i))}"`).join("")}></${e}>`).join(""),_=t=>{const e=Dc(t);return()=>b`<svg
1133
1133
  viewBox="0 0 24 24"
1134
1134
  fill="none"
1135
1135
  stroke="currentColor"
@@ -1139,8 +1139,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1139
1139
  aria-hidden="true"
1140
1140
  focusable="false"
1141
1141
  >
1142
- ${fc(e)}
1143
- </svg>`},Bt=_(Oc),or=_(Lc),Gn=_(Ec),Zn=_($c),ar=_(yc),Mc=_(vc),Ic=_(mc),lr=_(Rc),Nc=_(Ac),Dc=_(xc),cr=_(Tc),jc=_(ir),qc=_(tr);_(nr),_(sr);const dr=_(kc),Yn=_(bc),Bc=_(rr),Uc=_(wc),Hc=_(Sc),Fc=_(_c),Wc=_(Cc),pr=_(gc),Vc=t=>{switch(t){case"comment":return Zn();case"create":return lr();case"update":return Gn();case"delete":return or();case"move":return cr();default:return ar()}},Kc=(t,e,n,s=!1)=>b`
1142
+ ${bc(e)}
1143
+ </svg>`},Bt=_(Ic),lr=_(Mc),Gn=_(Oc),Zn=_(Tc),cr=_(Ac),jc=_($c),qc=_(xc),dr=_(Pc),Bc=_(Rc),Uc=_(Sc),pr=_(Lc),Hc=_(or),Fc=_(sr);_(ir),_(rr);const hr=_(yc),Yn=_(wc),Wc=_(ar),Vc=_(Cc),Kc=_(Ec),Gc=_(zc),Zc=_(_c),ur=_(vc),Yc=t=>{switch(t){case"comment":return Zn();case"create":return dr();case"update":return Gn();case"delete":return lr();case"move":return pr();default:return cr()}},Jc=(t,e,n,s=!1)=>b`
1144
1144
  ${s?g:b`<header><h2>${t.heading}</h2></header>`}
1145
1145
  ${e.issues.length>0?b`<div class="issues" role="alert">
1146
1146
  <strong>${t.rejected}</strong>
@@ -1190,7 +1190,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1190
1190
  <p>${t.empty}</p>
1191
1191
  <p class="empty-hint">${t.emptyHint}</p>
1192
1192
  </div>
1193
- </li>`:ct(e.items,i=>i.id,i=>Gc(t,i,n))}
1193
+ </li>`:ct(e.items,i=>i.id,i=>Xc(t,i,n))}
1194
1194
  </ul>
1195
1195
  <footer>
1196
1196
  ${s||e.send==="hidden"?g:b`<button
@@ -1222,10 +1222,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
1222
1222
  </div>
1223
1223
  ${e.flash?b`<span class="flash" role="status">${e.flash}</span>`:g}
1224
1224
  </footer>
1225
- `,Gc=(t,e,n)=>b`
1225
+ `,Xc=(t,e,n)=>b`
1226
1226
  <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
1227
1227
  <div class="item-head">
1228
- <span class="item-icon">${Vc(e.tone)}</span>
1228
+ <span class="item-icon">${Yc(e.tone)}</span>
1229
1229
  <span class="item-title">${e.title}</span>
1230
1230
  ${e.stale?b`<span class="stale-badge">${e.stale}</span>`:g}
1231
1231
  ${e.edit.kind==="available"?b`<button
@@ -1247,10 +1247,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
1247
1247
  </button>
1248
1248
  </div>
1249
1249
  <div class="item-target">${e.targetLabel}</div>
1250
- ${e.edit.kind==="editing"?Zc(t,e.edit,n):e.text.kind==="comment"?b`<p class="item-body">${e.text.body}</p>`:e.text.body?b`<div class="item-summary">${e.text.body}</div>`:g}
1250
+ ${e.edit.kind==="editing"?Qc(t,e.edit,n):e.text.kind==="comment"?b`<p class="item-body">${e.text.body}</p>`:e.text.body?b`<div class="item-summary">${e.text.body}</div>`:g}
1251
1251
  ${e.code===null?g:b`<code class="item-code">${e.code}</code>`}
1252
1252
  </li>
1253
- `,Zc=(t,e,n)=>b`
1253
+ `,Qc=(t,e,n)=>b`
1254
1254
  <div class="item-editor">
1255
1255
  <textarea
1256
1256
  class="dpk-textarea"
@@ -1274,7 +1274,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1274
1274
  </button>
1275
1275
  </div>
1276
1276
  </div>
1277
- `;class hr extends he{static{this.styles=uc}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=ec();#n=null;#s=new vn(this);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.#e=Yi(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#n;n&&(this.#n=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#r(){return!this.definition||!this.derivation?null:{definition:this.definition,state:this.state,navigation:this.navigation,derivation:this.derivation,issues:this.issues,sendable:this.sendToClaude!==void 0,editable:this.onEditComment!==void 0,locale:this.#s.locale}}render(){const e=this.#r();return e?Kc(Gi(this.#s.locale),Qi(e,this.#e),this.#i,this.embedded):g}#t(e){this.#e=Yi(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#l();return;case"send":this.#o();return;case"edit-start":this.#n={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#n={kind:"edit-button",id:n.id}),this.#t(e);return}case"edit-save":{const n=nc(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#n={kind:"edit-button",id:n.id},this.#t({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=tc(this.#e,Qi(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:n,outcome:s})}async#l(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Fn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),i=await Wn(s);this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:!1})}}}const Yc=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",hr)},We=Math.min,ie=Math.max,Ut=Math.round,Ht=Math.floor,re=t=>({x:t,y:t}),Jc={left:"right",right:"left",bottom:"top",top:"bottom"};function Xc(t,e,n){return ie(t,We(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function Oe(t){return t.split("-")[0]}function pt(t){return t.split("-")[1]}function ur(t){return t==="x"?"y":"x"}function fr(t){return t==="y"?"height":"width"}function oe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function gr(t){return ur(oe(t))}function Qc(t,e,n){n===void 0&&(n=!1);const s=pt(t),i=gr(t),r=fr(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ft(o)),[o,Ft(o)]}function ed(t){const e=Ft(t);return[Jn(t),e,Jn(e)]}function Jn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const mr=["left","right"],kr=["right","left"],td=["top","bottom"],nd=["bottom","top"];function sd(t,e,n){switch(t){case"top":case"bottom":return n?e?kr:mr:e?mr:kr;case"left":case"right":return e?td:nd;default:return[]}}function id(t,e,n,s){const i=pt(t);let r=sd(Oe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Jn)))),r}function Ft(t){const e=Oe(t);return Jc[e]+t.slice(e.length)}function rd(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function od(t){return typeof t!="number"?rd(t):{top:t,right:t,bottom:t,left:t}}function Wt(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function br(t,e,n){let{reference:s,floating:i}=t;const r=oe(e),o=gr(e),a=fr(o),l=Oe(e),c=r==="y",p=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let u;switch(l){case"top":u={x:p,y:s.y-i.height};break;case"bottom":u={x:p,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:d};break;case"left":u={x:s.x-i.width,y:d};break;default:u={x:s.x,y:s.y}}const f=pt(e);return f&&(u[o]+=h*(f==="end"?1:-1)*(n&&c?-1:1)),u}async function ad(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:h=!1,padding:u=0}=dt(e,t),f=od(u),m=a[h?d==="floating"?"reference":"floating":d],x=Wt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:p,strategy:l})),$=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),E=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},I=Wt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:$,offsetParent:A,strategy:l}):$);return{top:(x.top-I.top+f.top)/E.y,bottom:(I.bottom-x.bottom+f.bottom)/E.y,left:(x.left-I.left+f.left)/E.x,right:(I.right-x.right+f.right)/E.x}}const ld=50,cd=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:ad},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=br(c,s,l),h=s,u=0;const f={};for(let k=0;k<r.length;k++){const m=r[k];if(!m)continue;const{name:x,fn:$}=m,{x:A,y:E,data:I,reset:O}=await $({x:p,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});p=A??p,d=E??d,f[x]={...f[x],...I},O&&u<ld&&(u++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:p,y:d}=br(c,h,l)),k=-1)}return{x:p,y:d,placement:h,strategy:i,middlewareData:f}},dd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:k=!0,...m}=dt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const x=Oe(i),$=oe(a),A=Oe(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(A||!k?[Ft(a)]:ed(a)),O=f!=="none";!h&&O&&I.push(...id(a,k,f,E));const U=[a,...I],M=await l.detectOverflow(e,m),te=[];let Y=((s=r.flip)==null?void 0:s.overflows)||[];if(p&&te.push(M[x]),d){const xe=Qc(i,o,E);te.push(M[xe[0]],M[xe[1]])}if(Y=[...Y,{placement:i,overflows:te}],!te.every(xe=>xe<=0)){var As,Cs;const xe=(((As=r.flip)==null?void 0:As.index)||0)+1,rn=U[xe];if(rn&&(!(d==="alignment"?$!==oe(rn):!1)||Y.every(V=>oe(V.placement)===$?V.overflows[0]>0:!0)))return{data:{index:xe,overflows:Y},reset:{placement:rn}};let Ze=(Cs=Y.filter(ye=>ye.overflows[0]<=0).sort((ye,V)=>ye.overflows[1]-V.overflows[1])[0])==null?void 0:Cs.placement;if(!Ze)switch(u){case"bestFit":{var Ts;const ye=(Ts=Y.filter(V=>{if(O){const ce=oe(V.placement);return ce===$||ce==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ce=>ce>0).reduce((ce,Do)=>ce+Do,0)]).sort((V,ce)=>V[1]-ce[1])[0])==null?void 0:Ts[0];ye&&(Ze=ye);break}case"initialPlacement":Ze=a;break}if(i!==Ze)return{reset:{placement:Ze}}}return{}}}},pd=new Set(["left","top"]);async function hd(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Oe(n),a=pt(n),l=oe(n)==="y",c=pd.has(o)?-1:1,p=r&&l?-1:1,d=dt(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),l?{x:u*p,y:h*c}:{x:h*c,y:u*p}}const ud=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await hd(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},fd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:$=>{let{x:A,y:E}=$;return{x:A,y:E}}},...c}=dt(t,e),p={x:n,y:s},d=await r.detectOverflow(e,c),h=oe(i),u=ur(h);let f=p[u],k=p[h];const m=($,A)=>Xc(A+d[$==="y"?"top":"left"],A,A-d[$==="y"?"bottom":"right"]);o&&(f=m(u,f)),a&&(k=m(h,k));const x=l.fn({...e,[u]:f,[h]:k});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[u]:o,[h]:a}}}}}},gd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=dt(t,e),l=await i.detectOverflow(e,a),c=Oe(n),p=pt(n),d=oe(n)==="y",{width:h,height:u}=s.floating;let f,k;c==="top"||c==="bottom"?(f=c,k=p===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(k=c,f=p==="end"?"top":"bottom");const m=u-l.top-l.bottom,x=h-l.left-l.right,$=We(u-l[f],m),A=We(h-l[k],x),E=e.middlewareData.shift,I=!E;let O=$,U=A;E!=null&&E.enabled.x&&(U=x),E!=null&&E.enabled.y&&(O=m),I&&!p&&(d?U=h-2*ie(l.left,l.right):O=u-2*ie(l.top,l.bottom)),await o({...e,availableWidth:U,availableHeight:O});const M=await i.getDimensions(r.floating);return h!==M.width||u!==M.height?{reset:{rects:!0}}:{}}}};function Vt(){return typeof window<"u"}function Ve(t){return vr(t)?(t.nodeName||"").toLowerCase():"#document"}function j(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ae(t){var e;return(e=(vr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vr(t){return Vt()?t instanceof Node||t instanceof j(t).Node:!1}function Q(t){return Vt()?t instanceof Element||t instanceof j(t).Element:!1}function be(t){return Vt()?t instanceof HTMLElement||t instanceof j(t).HTMLElement:!1}function xr(t){return!Vt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof j(t).ShadowRoot}function Kt(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ee(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function md(t){return/^(table|td|th)$/.test(Ve(t))}function Gt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const kd=/transform|translate|scale|rotate|perspective|filter/,bd=/paint|layout|strict|content/,Pe=t=>!!t&&t!=="none";let Xn;function Qn(t){const e=Q(t)?ee(t):t;return Pe(e.transform)||Pe(e.translate)||Pe(e.scale)||Pe(e.rotate)||Pe(e.perspective)||!es()&&(Pe(e.backdropFilter)||Pe(e.filter))||kd.test(e.willChange||"")||bd.test(e.contain||"")}function vd(t){let e=ze(t);for(;be(e)&&!ht(e);){if(Qn(e))return e;if(Gt(e))return null;e=ze(e)}return null}function es(){return Xn==null&&(Xn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xn}function ht(t){return/^(html|body|#document)$/.test(Ve(t))}function ee(t){return j(t).getComputedStyle(t)}function Zt(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ze(t){if(Ve(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xr(t)&&t.host||ae(t);return xr(e)?e.host:e}function yr(t){const e=ze(t);return ht(e)?(t.ownerDocument||t).body:be(e)&&Kt(e)?e:yr(e)}function ut(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=yr(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=j(i);if(r){const a=ts(o);return e.concat(o,o.visualViewport||[],Kt(i)?i:[],a&&n?ut(a):[])}else return e.concat(i,ut(i,[],n))}function ts(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wr(t){const e=ee(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=be(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=Ut(n)!==r||Ut(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function ns(t){return Q(t)?t:t.contextElement}function Ke(t){const e=ns(t);if(!be(e))return re(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=wr(e);let o=(r?Ut(n.width):n.width)/s,a=(r?Ut(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const xd=re(0);function $r(t){const e=j(t);return!es()||!e.visualViewport?xd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function yd(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===j(t)}function Me(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ns(t);let o=re(1);e&&(s?Q(s)&&(o=Ke(s)):o=Ke(t));const a=yd(r,n,s)?$r(r):re(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,p=i.width/o.x,d=i.height/o.y;if(r&&s){const h=j(r),u=Q(s)?j(s):s;let f=h,k=ts(f);for(;k&&u!==f;){const m=Ke(k),x=k.getBoundingClientRect(),$=ee(k),A=x.left+(k.clientLeft+parseFloat($.paddingLeft))*m.x,E=x.top+(k.clientTop+parseFloat($.paddingTop))*m.y;l*=m.x,c*=m.y,p*=m.x,d*=m.y,l+=A,c+=E,f=j(k),k=ts(f)}}return Wt({width:p,height:d,x:l,y:c})}function Yt(t,e){const n=Zt(t).scrollLeft;return e?e.left+n:Me(ae(t)).left+n}function Sr(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Yt(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function wd(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ae(s),a=e?Gt(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=re(1);const p=re(0),d=be(s);if((d||!r)&&((Ve(s)!=="body"||Kt(o))&&(l=Zt(s)),d)){const u=Me(s);c=Ke(s),p.x=u.x+s.clientLeft,p.y=u.y+s.clientTop}const h=o&&!d&&!r?Sr(o,l):re(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+p.x+h.x,y:n.y*c.y-l.scrollTop*c.y+p.y+h.y}}function $d(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Sd(t){const e=Zt(t),n=t.ownerDocument.body,s=ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Yt(t);const o=-e.scrollTop;return ee(n).direction==="rtl"&&(r+=ie(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Ad=25;function Cd(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=j(t),r=ae(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,p=0;if(o){const h=!es()||e==="fixed";s?h||(c=-o.offsetLeft,p=-o.offsetTop):(a=o.width,l=o.height,h&&(c=o.offsetLeft,p=o.offsetTop))}if(Yt(r)<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),k=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-k),x=getComputedStyle(r).scrollbarGutter==="stable both-edges"?m/2:m;x<=Ad&&(a-=x)}return{width:a,height:l,x:c,y:p}}function Td(t,e){const n=Me(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=Ke(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function Ar(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=Cd(t,n,e);else if(e==="document")s=Sd(ae(t));else if(Q(e))s=Td(e,n);else{const i=$r(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Wt(s)}function Ed(t,e){const n=e.get(t);if(n)return n;let s=ut(t,[],!1).filter(a=>Q(a)&&Ve(a)!=="body"),i=null;const r=ee(t).position==="fixed";let o=r?ze(t):t;for(;Q(o)&&!ht(o);){const a=ee(o),l=Qn(o),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=ze(o)}return e.set(t,s),s}function Rd(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Gt(e)?[]:Ed(e,this._c):[].concat(n),s],a=Ar(e,o[0],i);let l=a.top,c=a.right,p=a.bottom,d=a.left;for(let h=1;h<o.length;h++){const u=Ar(e,o[h],i);l=ie(u.top,l),c=We(u.right,c),p=We(u.bottom,p),d=ie(u.left,d)}return{width:c-d,height:p-l,x:d,y:l}}function _d(t){const{width:e,height:n}=wr(t);return{width:e,height:n}}function Ld(t,e,n){const s=be(e),i=ae(e),r=n==="fixed",o=Me(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((s||!r)&&((Ve(e)!=="body"||Kt(i))&&(a=Zt(e)),s)){const h=Me(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!s&&i&&(l.x=Yt(i));const c=i&&!s&&!r?Sr(i,a):re(0),p=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:p,y:d,width:o.width,height:o.height}}function ss(t){return ee(t).position==="static"}function Cr(t,e){if(!be(t)||ee(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ae(t)===n&&(n=n.ownerDocument.body),n}function Tr(t,e){const n=j(t);if(Gt(t))return n;if(!be(t)){let i=ze(t);for(;i&&!ht(i);){if(Q(i)&&!ss(i))return i;i=ze(i)}return n}let s=Cr(t,e);for(;s&&md(s)&&ss(s);)s=Cr(s,e);return s&&ht(s)&&ss(s)&&!Qn(s)?n:s||vd(t)||n}const Od=async function(t){const e=this.getOffsetParent||Tr,n=this.getDimensions,s=await n(t.floating);return{reference:Ld(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Pd(t){return ee(t).direction==="rtl"}const zd={convertOffsetParentRelativeRectToViewportRelativeRect:wd,getDocumentElement:ae,getClippingRect:Rd,getOffsetParent:Tr,getElementRects:Od,getClientRects:$d,getDimensions:_d,getScale:Ke,isElement:Q,isRTL:Pd};function Er(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Md(t,e,n){let s=null,i;const r=ae(t);function o(){var p;clearTimeout(i),(p=s)==null||p.disconnect(),s=null}function a(p,d){p===void 0&&(p=!1),d===void 0&&(d=1),o();const h=t.getBoundingClientRect(),{left:u,top:f,width:k,height:m}=h;if(p||e(),!k||!m)return;const x=Ht(f),$=Ht(r.clientWidth-(u+k)),A=Ht(r.clientHeight-(f+m)),E=Ht(u),O={rootMargin:-x+"px "+-$+"px "+-A+"px "+-E+"px",threshold:ie(0,We(1,d))||1};let U=!0;function M(te){const Y=te[0].intersectionRatio;if(!Er(h,t.getBoundingClientRect()))return a();if(Y!==d){if(!U)return a();Y?a(!1,Y):i=setTimeout(()=>{a(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(M,{...O,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,O)}s.observe(t)}const l=j(t),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function Id(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ns(t),p=i||r?[...c?ut(c):[],...e?ut(e):[]]:[];p.forEach(x=>{i&&x.addEventListener("scroll",n),r&&x.addEventListener("resize",n)});const d=c&&a?Md(c,n,r):null;let h=-1,u=null;o&&(u=new ResizeObserver(x=>{let[$]=x;$&&$.target===c&&u&&e&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var A;(A=u)==null||A.observe(e)})),n()}),c&&!l&&u.observe(c),e&&u.observe(e));let f,k=l?Me(t):null;l&&m();function m(){const x=Me(t);k&&!Er(k,x)&&n(),k=x,f=requestAnimationFrame(m)}return n(),()=>{var x;p.forEach($=>{i&&$.removeEventListener("scroll",n),r&&$.removeEventListener("resize",n)}),d?.(),(x=u)==null||x.disconnect(),u=null,l&&cancelAnimationFrame(f)}}const Nd=ud,Dd=fd,jd=dd,qd=gd,Bd=(t,e,n)=>{const s=new Map,i=n??{},r={...zd,...i.platform,_c:s};return cd(t,e,{...i,platform:r})},Ud=(t,e)=>({top:e,bottom:e,right:t}),Hd=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=Id(o,t,()=>{const c=++r;Bd(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Nd(8),jd({padding:8,fallbackAxisSideDirection:"end"}),Dd({padding:8}),qd({padding:8,apply:({availableWidth:p,availableHeight:d})=>{!i||c!==r||(t.style.width=`${Math.max(0,Math.min(n.width,p))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:p,y:d})=>{!i||c!==r||!t.isConnected||(t.style.left=`${p}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Fd=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Rr{#e;#n=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#n)e.isConnected||(n(),this.#n.delete(e))}hostDisconnected(){for(const e of this.#n.values())e();this.#n.clear()}open(e,n,s,i){this.#n.get(e)?.(),this.#n.set(e,Hd(e,n,s,i))}}const _r=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},ft="dpk-version",Lr="version",Wd=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Jt=t=>Wd.test(t),Vd="https://cdn.jsdelivr.net/npm/dev-process-kit@",Or="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",is=t=>{const e=new URLSearchParams(t),n=e.get(ft)??e.get(Lr);return n!==null&&Jt(n)?n:null},Kd=(t,e)=>{const n=is(t);return n===null||n===e?null:n},Gd=(t,e)=>{if(!Jt(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${Vd}${t}/dist/${e}`},Zd=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Lr),e===null?n.searchParams.delete(ft):n.searchParams.set(ft,e),n.href},Yd=L({tags:se(He(v(),ke()),{}),versions:F(L({version:v()}))}),Jd=t=>{const e=zn(Yd,t),n=e.tags.latest;return{latest:typeof n=="string"&&Jt(n)?n:null,versions:e.versions.map(s=>s.version).filter(Jt)}},Pr=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let Xt;const zr=()=>(Xt??=fetch(Or).then(async t=>{if(!t.ok)throw new Error(`${Or} answered ${t.status}`);return Jd(await t.json())}),Xt.catch(()=>{Xt=void 0}),Xt),Mr=t=>{location.assign(Zd(location.href,t))},Xd=t=>import(t),Qd=({entry:t,templates:e,register:n,importModule:s=Xd})=>{const i=()=>{n(),_r(X,e,ft)},r=typeof location>"u"?null:Kd(location.search,X);if(r===null){i();return}s(Gd(r,t)).then(()=>{ep()||np(r)},o=>{console.error(`dev-process-kit@${r} could not be loaded; running ${X}`,o),i()})},ep=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},rs="dpk-version-fallback",tp=`
1277
+ `;class fr extends he{static{this.styles=kc}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=ic();#n=null;#s=new vn(this);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.#e=Xi(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#n;n&&(this.#n=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#r(){return!this.definition||!this.derivation?null:{definition:this.definition,state:this.state,navigation:this.navigation,derivation:this.derivation,issues:this.issues,sendable:this.sendToClaude!==void 0,editable:this.onEditComment!==void 0,locale:this.#s.locale}}render(){const e=this.#r();return e?Jc(Yi(this.#s.locale),tr(e,this.#e),this.#i,this.embedded):g}#t(e){this.#e=Xi(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#l();return;case"send":this.#o();return;case"edit-start":this.#n={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#n={kind:"edit-button",id:n.id}),this.#t(e);return}case"edit-save":{const n=oc(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#n={kind:"edit-button",id:n.id},this.#t({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=rc(this.#e,tr(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:n,outcome:s})}async#l(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Fn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),i=await Wn(s);this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:n,ok:!1})}}}const ed=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",fr)},We=Math.min,ie=Math.max,Ut=Math.round,Ht=Math.floor,re=t=>({x:t,y:t}),td={left:"right",right:"left",bottom:"top",top:"bottom"};function nd(t,e,n){return ie(t,We(e,n))}function dt(t,e){return typeof t=="function"?t(e):t}function Pe(t){return t.split("-")[0]}function pt(t){return t.split("-")[1]}function gr(t){return t==="x"?"y":"x"}function mr(t){return t==="y"?"height":"width"}function oe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function kr(t){return gr(oe(t))}function sd(t,e,n){n===void 0&&(n=!1);const s=pt(t),i=kr(t),r=mr(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Ft(o)),[o,Ft(o)]}function id(t){const e=Ft(t);return[Jn(t),e,Jn(e)]}function Jn(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const br=["left","right"],vr=["right","left"],rd=["top","bottom"],od=["bottom","top"];function ad(t,e,n){switch(t){case"top":case"bottom":return n?e?vr:br:e?br:vr;case"left":case"right":return e?rd:od;default:return[]}}function ld(t,e,n,s){const i=pt(t);let r=ad(Pe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Jn)))),r}function Ft(t){const e=Pe(t);return td[e]+t.slice(e.length)}function cd(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function dd(t){return typeof t!="number"?cd(t):{top:t,right:t,bottom:t,left:t}}function Wt(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function xr(t,e,n){let{reference:s,floating:i}=t;const r=oe(e),o=kr(e),a=mr(o),l=Pe(e),c=r==="y",p=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let u;switch(l){case"top":u={x:p,y:s.y-i.height};break;case"bottom":u={x:p,y:s.y+s.height};break;case"right":u={x:s.x+s.width,y:d};break;case"left":u={x:s.x-i.width,y:d};break;default:u={x:s.x,y:s.y}}const f=pt(e);return f&&(u[o]+=h*(f==="end"?1:-1)*(n&&c?-1:1)),u}async function pd(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:h=!1,padding:u=0}=dt(e,t),f=dd(u),m=a[h?d==="floating"?"reference":"floating":d],x=Wt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:p,strategy:l})),$=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),R=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},I=Wt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:$,offsetParent:A,strategy:l}):$);return{top:(x.top-I.top+f.top)/R.y,bottom:(I.bottom-x.bottom+f.bottom)/R.y,left:(x.left-I.left+f.left)/R.x,right:(I.right-x.right+f.right)/R.x}}const hd=50,ud=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:pd},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=xr(c,s,l),h=s,u=0;const f={};for(let k=0;k<r.length;k++){const m=r[k];if(!m)continue;const{name:x,fn:$}=m,{x:A,y:R,data:I,reset:O}=await $({x:p,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:t,floating:e}});p=A??p,d=R??d,f[x]={...f[x],...I},O&&u<hd&&(u++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:p,y:d}=xr(c,h,l)),k=-1)}return{x:p,y:d,placement:h,strategy:i,middlewareData:f}},fd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:k=!0,...m}=dt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const x=Pe(i),$=oe(a),A=Pe(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(A||!k?[Ft(a)]:id(a)),O=f!=="none";!h&&O&&I.push(...ld(a,k,f,R));const U=[a,...I],M=await l.detectOverflow(e,m),te=[];let Y=((s=r.flip)==null?void 0:s.overflows)||[];if(p&&te.push(M[x]),d){const xe=sd(i,o,R);te.push(M[xe[0]],M[xe[1]])}if(Y=[...Y,{placement:i,overflows:te}],!te.every(xe=>xe<=0)){var As,Cs;const xe=(((As=r.flip)==null?void 0:As.index)||0)+1,rn=U[xe];if(rn&&(!(d==="alignment"?$!==oe(rn):!1)||Y.every(V=>oe(V.placement)===$?V.overflows[0]>0:!0)))return{data:{index:xe,overflows:Y},reset:{placement:rn}};let Ze=(Cs=Y.filter(ye=>ye.overflows[0]<=0).sort((ye,V)=>ye.overflows[1]-V.overflows[1])[0])==null?void 0:Cs.placement;if(!Ze)switch(u){case"bestFit":{var Ts;const ye=(Ts=Y.filter(V=>{if(O){const ce=oe(V.placement);return ce===$||ce==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ce=>ce>0).reduce((ce,qo)=>ce+qo,0)]).sort((V,ce)=>V[1]-ce[1])[0])==null?void 0:Ts[0];ye&&(Ze=ye);break}case"initialPlacement":Ze=a;break}if(i!==Ze)return{reset:{placement:Ze}}}return{}}}},gd=new Set(["left","top"]);async function md(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Pe(n),a=pt(n),l=oe(n)==="y",c=gd.has(o)?-1:1,p=r&&l?-1:1,d=dt(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),l?{x:u*p,y:h*c}:{x:h*c,y:u*p}}const kd=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await md(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},bd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:$=>{let{x:A,y:R}=$;return{x:A,y:R}}},...c}=dt(t,e),p={x:n,y:s},d=await r.detectOverflow(e,c),h=oe(i),u=gr(h);let f=p[u],k=p[h];const m=($,A)=>nd(A+d[$==="y"?"top":"left"],A,A-d[$==="y"?"bottom":"right"]);o&&(f=m(u,f)),a&&(k=m(h,k));const x=l.fn({...e,[u]:f,[h]:k});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[u]:o,[h]:a}}}}}},vd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=dt(t,e),l=await i.detectOverflow(e,a),c=Pe(n),p=pt(n),d=oe(n)==="y",{width:h,height:u}=s.floating;let f,k;c==="top"||c==="bottom"?(f=c,k=p===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(k=c,f=p==="end"?"top":"bottom");const m=u-l.top-l.bottom,x=h-l.left-l.right,$=We(u-l[f],m),A=We(h-l[k],x),R=e.middlewareData.shift,I=!R;let O=$,U=A;R!=null&&R.enabled.x&&(U=x),R!=null&&R.enabled.y&&(O=m),I&&!p&&(d?U=h-2*ie(l.left,l.right):O=u-2*ie(l.top,l.bottom)),await o({...e,availableWidth:U,availableHeight:O});const M=await i.getDimensions(r.floating);return h!==M.width||u!==M.height?{reset:{rects:!0}}:{}}}};function Vt(){return typeof window<"u"}function Ve(t){return yr(t)?(t.nodeName||"").toLowerCase():"#document"}function j(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ae(t){var e;return(e=(yr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function yr(t){return Vt()?t instanceof Node||t instanceof j(t).Node:!1}function Q(t){return Vt()?t instanceof Element||t instanceof j(t).Element:!1}function be(t){return Vt()?t instanceof HTMLElement||t instanceof j(t).HTMLElement:!1}function wr(t){return!Vt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof j(t).ShadowRoot}function Kt(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ee(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function xd(t){return/^(table|td|th)$/.test(Ve(t))}function Gt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const yd=/transform|translate|scale|rotate|perspective|filter/,wd=/paint|layout|strict|content/,ze=t=>!!t&&t!=="none";let Xn;function Qn(t){const e=Q(t)?ee(t):t;return ze(e.transform)||ze(e.translate)||ze(e.scale)||ze(e.rotate)||ze(e.perspective)||!es()&&(ze(e.backdropFilter)||ze(e.filter))||yd.test(e.willChange||"")||wd.test(e.contain||"")}function $d(t){let e=Me(t);for(;be(e)&&!ht(e);){if(Qn(e))return e;if(Gt(e))return null;e=Me(e)}return null}function es(){return Xn==null&&(Xn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Xn}function ht(t){return/^(html|body|#document)$/.test(Ve(t))}function ee(t){return j(t).getComputedStyle(t)}function Zt(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Me(t){if(Ve(t)==="html")return t;const e=t.assignedSlot||t.parentNode||wr(t)&&t.host||ae(t);return wr(e)?e.host:e}function $r(t){const e=Me(t);return ht(e)?(t.ownerDocument||t).body:be(e)&&Kt(e)?e:$r(e)}function ut(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=$r(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=j(i);if(r){const a=ts(o);return e.concat(o,o.visualViewport||[],Kt(i)?i:[],a&&n?ut(a):[])}else return e.concat(i,ut(i,[],n))}function ts(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Sr(t){const e=ee(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=be(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=Ut(n)!==r||Ut(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function ns(t){return Q(t)?t:t.contextElement}function Ke(t){const e=ns(t);if(!be(e))return re(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Sr(e);let o=(r?Ut(n.width):n.width)/s,a=(r?Ut(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Sd=re(0);function Ar(t){const e=j(t);return!es()||!e.visualViewport?Sd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ad(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===j(t)}function Ie(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=ns(t);let o=re(1);e&&(s?Q(s)&&(o=Ke(s)):o=Ke(t));const a=Ad(r,n,s)?Ar(r):re(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,p=i.width/o.x,d=i.height/o.y;if(r&&s){const h=j(r),u=Q(s)?j(s):s;let f=h,k=ts(f);for(;k&&u!==f;){const m=Ke(k),x=k.getBoundingClientRect(),$=ee(k),A=x.left+(k.clientLeft+parseFloat($.paddingLeft))*m.x,R=x.top+(k.clientTop+parseFloat($.paddingTop))*m.y;l*=m.x,c*=m.y,p*=m.x,d*=m.y,l+=A,c+=R,f=j(k),k=ts(f)}}return Wt({width:p,height:d,x:l,y:c})}function Yt(t,e){const n=Zt(t).scrollLeft;return e?e.left+n:Ie(ae(t)).left+n}function Cr(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Yt(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Cd(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ae(s),a=e?Gt(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=re(1);const p=re(0),d=be(s);if((d||!r)&&((Ve(s)!=="body"||Kt(o))&&(l=Zt(s)),d)){const u=Ie(s);c=Ke(s),p.x=u.x+s.clientLeft,p.y=u.y+s.clientTop}const h=o&&!d&&!r?Cr(o,l):re(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+p.x+h.x,y:n.y*c.y-l.scrollTop*c.y+p.y+h.y}}function Td(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Ed(t){const e=Zt(t),n=t.ownerDocument.body,s=ie(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ie(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Yt(t);const o=-e.scrollTop;return ee(n).direction==="rtl"&&(r+=ie(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Rd=25;function _d(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=j(t),r=ae(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,p=0;if(o){const h=!es()||e==="fixed";s?h||(c=-o.offsetLeft,p=-o.offsetTop):(a=o.width,l=o.height,h&&(c=o.offsetLeft,p=o.offsetTop))}if(Yt(r)<=0){const h=r.ownerDocument,u=h.body,f=getComputedStyle(u),k=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-k),x=getComputedStyle(r).scrollbarGutter==="stable both-edges"?m/2:m;x<=Rd&&(a-=x)}return{width:a,height:l,x:c,y:p}}function Ld(t,e){const n=Ie(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=Ke(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function Tr(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=_d(t,n,e);else if(e==="document")s=Ed(ae(t));else if(Q(e))s=Ld(e,n);else{const i=Ar(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Wt(s)}function Od(t,e){const n=e.get(t);if(n)return n;let s=ut(t,[],!1).filter(a=>Q(a)&&Ve(a)!=="body"),i=null;const r=ee(t).position==="fixed";let o=r?Me(t):t;for(;Q(o)&&!ht(o);){const a=ee(o),l=Qn(o),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=Me(o)}return e.set(t,s),s}function Pd(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Gt(e)?[]:Od(e,this._c):[].concat(n),s],a=Tr(e,o[0],i);let l=a.top,c=a.right,p=a.bottom,d=a.left;for(let h=1;h<o.length;h++){const u=Tr(e,o[h],i);l=ie(u.top,l),c=We(u.right,c),p=We(u.bottom,p),d=ie(u.left,d)}return{width:c-d,height:p-l,x:d,y:l}}function zd(t){const{width:e,height:n}=Sr(t);return{width:e,height:n}}function Md(t,e,n){const s=be(e),i=ae(e),r=n==="fixed",o=Ie(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=re(0);if((s||!r)&&((Ve(e)!=="body"||Kt(i))&&(a=Zt(e)),s)){const h=Ie(e,!0,r,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!s&&i&&(l.x=Yt(i));const c=i&&!s&&!r?Cr(i,a):re(0),p=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:p,y:d,width:o.width,height:o.height}}function ss(t){return ee(t).position==="static"}function Er(t,e){if(!be(t)||ee(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ae(t)===n&&(n=n.ownerDocument.body),n}function Rr(t,e){const n=j(t);if(Gt(t))return n;if(!be(t)){let i=Me(t);for(;i&&!ht(i);){if(Q(i)&&!ss(i))return i;i=Me(i)}return n}let s=Er(t,e);for(;s&&xd(s)&&ss(s);)s=Er(s,e);return s&&ht(s)&&ss(s)&&!Qn(s)?n:s||$d(t)||n}const Id=async function(t){const e=this.getOffsetParent||Rr,n=this.getDimensions,s=await n(t.floating);return{reference:Md(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Nd(t){return ee(t).direction==="rtl"}const Dd={convertOffsetParentRelativeRectToViewportRelativeRect:Cd,getDocumentElement:ae,getClippingRect:Pd,getOffsetParent:Rr,getElementRects:Id,getClientRects:Td,getDimensions:zd,getScale:Ke,isElement:Q,isRTL:Nd};function _r(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jd(t,e,n){let s=null,i;const r=ae(t);function o(){var p;clearTimeout(i),(p=s)==null||p.disconnect(),s=null}function a(p,d){p===void 0&&(p=!1),d===void 0&&(d=1),o();const h=t.getBoundingClientRect(),{left:u,top:f,width:k,height:m}=h;if(p||e(),!k||!m)return;const x=Ht(f),$=Ht(r.clientWidth-(u+k)),A=Ht(r.clientHeight-(f+m)),R=Ht(u),O={rootMargin:-x+"px "+-$+"px "+-A+"px "+-R+"px",threshold:ie(0,We(1,d))||1};let U=!0;function M(te){const Y=te[0].intersectionRatio;if(!_r(h,t.getBoundingClientRect()))return a();if(Y!==d){if(!U)return a();Y?a(!1,Y):i=setTimeout(()=>{a(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(M,{...O,root:r.ownerDocument})}catch{s=new IntersectionObserver(M,O)}s.observe(t)}const l=j(t),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function qd(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ns(t),p=i||r?[...c?ut(c):[],...e?ut(e):[]]:[];p.forEach(x=>{i&&x.addEventListener("scroll",n),r&&x.addEventListener("resize",n)});const d=c&&a?jd(c,n,r):null;let h=-1,u=null;o&&(u=new ResizeObserver(x=>{let[$]=x;$&&$.target===c&&u&&e&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var A;(A=u)==null||A.observe(e)})),n()}),c&&!l&&u.observe(c),e&&u.observe(e));let f,k=l?Ie(t):null;l&&m();function m(){const x=Ie(t);k&&!_r(k,x)&&n(),k=x,f=requestAnimationFrame(m)}return n(),()=>{var x;p.forEach($=>{i&&$.removeEventListener("scroll",n),r&&$.removeEventListener("resize",n)}),d?.(),(x=u)==null||x.disconnect(),u=null,l&&cancelAnimationFrame(f)}}const Bd=kd,Ud=bd,Hd=fd,Fd=vd,Wd=(t,e,n)=>{const s=new Map,i=n??{},r={...Dd,...i.platform,_c:s};return ud(t,e,{...i,platform:r})},Vd=(t,e)=>({top:e,bottom:e,right:t}),Kd=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=qd(o,t,()=>{const c=++r;Wd(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Bd(8),Hd({padding:8,fallbackAxisSideDirection:"end"}),Ud({padding:8}),Fd({padding:8,apply:({availableWidth:p,availableHeight:d})=>{!i||c!==r||(t.style.width=`${Math.max(0,Math.min(n.width,p))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:p,y:d})=>{!i||c!==r||!t.isConnected||(t.style.left=`${p}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Gd=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Lr{#e;#n=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#n)e.isConnected||(n(),this.#n.delete(e))}hostDisconnected(){for(const e of this.#n.values())e();this.#n.clear()}open(e,n,s,i){this.#n.get(e)?.(),this.#n.set(e,Kd(e,n,s,i))}}const Or=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},ft="dpk-version",Pr="version",Zd=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Jt=t=>Zd.test(t),Yd="https://cdn.jsdelivr.net/npm/dev-process-kit@",zr="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",is=t=>{const e=new URLSearchParams(t),n=e.get(ft)??e.get(Pr);return n!==null&&Jt(n)?n:null},Jd=(t,e)=>{const n=is(t);return n===null||n===e?null:n},Xd=(t,e)=>{if(!Jt(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${Yd}${t}/dist/${e}`},Qd=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Pr),e===null?n.searchParams.delete(ft):n.searchParams.set(ft,e),n.href},ep=L({tags:se(He(v(),ke()),{}),versions:F(L({version:v()}))}),tp=t=>{const e=zn(ep,t),n=e.tags.latest;return{latest:typeof n=="string"&&Jt(n)?n:null,versions:e.versions.map(s=>s.version).filter(Jt)}},Mr=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let Xt;const Ir=()=>(Xt??=fetch(zr).then(async t=>{if(!t.ok)throw new Error(`${zr} answered ${t.status}`);return tp(await t.json())}),Xt.catch(()=>{Xt=void 0}),Xt),Nr=t=>{location.assign(Qd(location.href,t))},np=t=>import(t),sp=({entry:t,templates:e,register:n,importModule:s=np})=>{const i=()=>{n(),Or(X,e,ft)},r=typeof location>"u"?null:Jd(location.search,X);if(r===null){i();return}s(Xd(r,t)).then(()=>{ip()||op(r)},o=>{console.error(`dev-process-kit@${r} could not be loaded; running ${X}`,o),i()})},ip=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},rs="dpk-version-fallback",rp=`
1278
1278
  .${rs} {
1279
1279
  flex: none;
1280
1280
  height: 24px;
@@ -1293,7 +1293,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1293
1293
  letter-spacing: 0.02em;
1294
1294
  cursor: pointer;
1295
1295
  }
1296
- `,np=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:tp}));for(const n of e)n.append(sp(n,t))}},sp=(t,e)=>{const n=W(Et(Tt(t))),s=document.createElement("select");s.className=rs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Pr({current:e,requested:is(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{zr().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Mr(s.value===""?null:s.value)),i(null),s},ip=L({value:v()}),rp=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(ip,e.detail);n.success&&t(n.output.value)},os=t=>e=>{const n=je(e.target,HTMLSelectElement);n!==null&&t(n.value)},op=t=>e=>{const n=je(e.target,HTMLInputElement);n!==null&&t(n.checked)},Ir="data-dpk-changes",ap=/^[^:\s]+:\S+$/,lp=Z({id:se(w(v(),S(1))),title:w(v(),S(1)),body:se(v()),target:se(w(v(),ge(ap,'target must be written "type:id"'))),navigate:se(w(v(),Ei("=",'navigate must be written "key=value"')))}),cp=F(lp),dp=w(v(),S(1)),Nr=Z({revision:dp,changes:cp}),pp=Z({revisions:w(F(Nr),S(1,"list at least one version"))}),hp=(t,e)=>JSON.stringify([t,e]),gt=t=>[...t.earlier,t.latest],up=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:hp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},fp=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?pp:Nr,t);if(!n.success)return{ok:!1,error:Pl(n.issues)};const s=n.output,i="revisions"in s?s.revisions:[s],r=[];for(const a of i){if(r.some(c=>c.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=up(a);if(typeof l=="string")return{ok:!1,error:l};r.push(l)}const o=r.pop();return o?{ok:!0,log:{earlier:r,latest:o}}:{ok:!1,error:"list at least one version"}},gp=Z({v:me(1),revision:v(),seen:F(v())}),mp=Z({v:me(2),since:v(),seen:He(v(),F(v()))}),Dr=t=>{const e=C(mp,t);if(e.success)return e.output;const n=C(gp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},as={open:!1,fresh:new Set},jr=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),ls=(t,e)=>gt(t).flatMap(n=>n.entries.filter(jr(e))),qr=t=>t.target!==null||t.navigate!==null,kp=(t,e)=>{const n=gt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:as}},cs=(t,e)=>new Set([...t.seen,...e]),bp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=ls(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!qr(o)).map(o=>o.key);return{...e,seen:cs(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:as};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:cs(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:as};case"read-all":return{...e,seen:cs(e,ls(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},vp=(t,e)=>ls(t,e).length,xp=(t,e)=>{const n=gt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(jr(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},yp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?qt(t.navigate):t.target!==null?e(at(t.target)):null,target:t.target},Br=3,wp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:qr(e),fresh:t.list.fresh.has(e.key)}),$p=(t,e)=>{const n=gt(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(wp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:vp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Br),waiting:Math.max(0,i.length-Br)}},mt=t=>t==="light"||t==="dark"?t:null,Ur=t=>t.authored??t.environment,Hr=t=>t.preference??Ur(t),Sp=t=>{const e=Hr(t)==="dark"?"light":"dark";return e===Ur(t)?null:e},Fr=F(Z({value:w(v(),ge(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),Ap=L({targets:Fr,providers:F(L({id:w(v(),S(1)),results:F(Vi)}))}),Cp=Z({target:w(v(),ge(/^element:.+/)),body:w(v(),On(),S(1))}),Wr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Vr=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(N(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(J(i)){const c=n.get(i.id),p=s.get(N(i.target));return{title:c?.title??i.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?Wr(p):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(N(i.target)):void 0;return l===void 0?a:{...a,targetLabel:Wr(l)}},serialize:i=>J(i)?`${i.type} ${N(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},Kr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Gr(t){return typeof Kr.Buffer<"u"&&Kr.Buffer.isBuffer(t)}function Zr(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 Yr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Jr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Tp="[object RegExp]",Ep="[object String]",Rp="[object Number]",_p="[object Boolean]",Lp="[object Symbol]",Op="[object Date]",Pp="[object Map]",zp="[object Set]",Mp="[object Array]",Ip="[object Function]",Np="[object ArrayBuffer]",ds="[object Object]",Dp="[object Error]",jp="[object DataView]",qp="[object Uint8Array]",Bp="[object Uint8ClampedArray]",Up="[object Uint16Array]",Hp="[object Uint32Array]",Fp="[object BigUint64Array]",Wp="[object Int8Array]",Vp="[object Int16Array]",Kp="[object Int32Array]",Gp="[object BigInt64Array]",Zp="[object Float32Array]",Yp="[object Float64Array]";function Jp(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Xp(t,e,n){return kt(t,e,void 0,void 0,void 0,void 0,n)}function kt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return bt(t,e,r,o)}return bt(t,e,r,o)}function bt(t,e,n,s){if(Object.is(t,e))return!0;let i=Jr(t),r=Jr(e);if(i==="[object Arguments]"&&(i=ds),r==="[object Arguments]"&&(r=ds),i!==r)return!1;switch(i){case Ep:return t.toString()===e.toString();case Rp:return Jp(t.valueOf(),e.valueOf());case _p:case Op:case Lp:return Object.is(t.valueOf(),e.valueOf());case Tp:return t.source===e.source&&t.flags===e.flags;case Ip:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Pp:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!kt(c,e.get(l),l,t,e,n,s))return!1;return!0;case zp:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>kt(d,u,void 0,t,e,n,s));if(h===-1)return!1;c.splice(h,1)}return!0}case Mp:case qp:case Bp:case Up:case Hp:case Fp:case Wp:case Vp:case Kp:case Gp:case Zp:case Yp:if(Gr(t)!==Gr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!kt(t[l],e[l],l,t,e,n,s))return!1;return!0;case Np:return t.byteLength!==e.byteLength?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case jp:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case Dp:return t.name===e.name&&t.message===e.message;case ds:{if(!(bt(t.constructor,e.constructor,n,s)||Zr(t)&&Zr(e)))return!1;const l=[...Object.keys(t),...Yr(t)],c=[...Object.keys(e),...Yr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!kt(h,u,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Qp(){}function Qt(t,e){return Xp(t,e,Qp)}const Xr="page",Qr=t=>N(t),eo=(t,e,n,s=new Map)=>{let i=e;const r=[],o=[],a=[],l=[],c=new Map;for(const d of n){if(d.type===D)continue;if(J(d)){const f=s.get(d.id);f===void 0||f.stale!==void 0?o.push({action:d,reason:f?.stale??"target-missing"}):r.push(d);continue}const h=jt(t.actions,d.type);if(!h){o.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(i,d);if(u===null){o.push({action:d,reason:t.hasTarget(i,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&ps(t,i,u)){a.push(d);continue}i=u,r.push(d)}for(const d of n){if(d.type!==D)continue;if(d.target.type!==Xr&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Qr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(n.map((d,h)=>[d.id,h]));return o.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:i,actions:n,applied:r,stale:o,obsolete:a,comments:l,commentsByTarget:c}},ps=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Qt(e,n):Qt(t.canonicalState(e),t.canonicalState(n)),to=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},eh=(t,e,n,s)=>{let i=e;const r=s??no(i).map(o=>o.id);for(const o of[...r].reverse())i=th(t,i,n,o,s!==void 0)??i;return i},no=t=>t.applied.filter(e=>!J(e)),th=(t,e,n,s,i)=>{const r=no(e),o=r.findIndex(h=>h.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=[...i?nh(t,e.base,r,o):[],...sh(t,l,a)],p=new Set,d=c.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of d){const u=ih(t,e,n,h);if(u!==null)return u}return null},nh=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>ps(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},sh=(t,e,n)=>{const s=so(n),i=e.filter(l=>so(l).some(c=>s.includes(c))),r=io(t,n),o=i.filter(l=>io(t,l)===r),a=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},so=t=>{const e=t.target.type===Xr?[]:t.target.id.split("."),n=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(s=>typeof s=="string"&&s!==""):[];return[...e,...n]},io=(t,e)=>jt(t.actions,e.type)?.mode,ih=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return ps(t,o.state,e.state)?o:null;if(a.some(l=>l.type===D||J(l)))return null;for(const l of a)r.add(l.id)}},rh=L({v:me(1),template:w(v(),S(1)),actions:F(ke())});class hs{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(rh,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(_e,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class us{constructor(){this.store=new Map}load(e,n){return new hs({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const fs=()=>{try{if(typeof localStorage<"u")return new hs(localStorage)}catch{}return new us},en=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,oh=F(ke());class ro{#e;#n;#s={targets:[],providers:[]};#r=new Map;#t;#i;#o;#l;#a;#c=new Set;#p=[];#m=0;constructor(e){this.#e=e.definition,this.#n=Vr(e.definition,[],this.#r),this.#t=e.base,this.#a=e.storageKey??en(e.definition.name),this.#l=e.storage===void 0?fs():e.storage;const n=e.initialActions??this.#l?.load(this.#a,this.definition.name)??[];this.#i=ao(this.definition,n),this.#o=this.#h(this.#i),this.#d()&&this.#b()}get definition(){return this.#n}setComponentSnapshot(e){const n=zn(Ap,e);if(!Qt(n,this.#s)){this.#s=n,this.#k(),this.#o=this.#h(this.#i);for(const s of this.#c)s()}}setTemplate(e){this.#e=e,this.#k(),this.#o=this.#h(this.#i);for(const n of this.#c)n()}#k(){this.#r=Ki(this.#i,this.#s.providers),this.#n=Vr(this.#e,this.#s.targets,this.#r)}#h(e){return eo(this.definition,this.#t,e,Ki(e,this.#s.providers))}get base(){return this.#t}get actions(){return this.#i}get derivation(){return this.#o}get lastIssues(){return this.#p}get prunedCount(){return this.#m}descriptorFor(e,n){return oo(this.definition,e,n)}dispatch(e){const n=this.#x(e,this.#o.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#u(Nn(this.#i,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(oh,e);if(!n.success)return this.#g([Le(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#i,r=this.#o.state;const o=[];for(const a of s){const l=this.#x(a,r);if(!l.ok)return this.#g([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||J(c)?c.target.type==="page"||this.definition.hasTarget(r,c.target)?r:null:this.definition.apply(r,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);i=Nn(i,c,p),r=this.#h(i).state,o.push(c.id)}return this.#u(i,o),{ok:!0,ids:o}}#x(e,n){const s=C(Ui,e);if(!s.success)return{ok:!1,issue:Le(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Mn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Fl(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#g(e){return this.#p=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#i.find(a=>a.id===e);if(s?.type!==D)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(lt(s)===n)return{ok:!0,id:e};const i=C(jn.schema,{...s,payload:{body:n}});if(!i.success)return this.#g([Le(i.issues)]);const r=C(_e,i.output);if(!r.success)return this.#g([Le(r.issues)]);const o=r.output;return this.#u(this.#i.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#i.filter(s=>s.id!==e);n.length!==this.#i.length&&this.#u(n)}clearActions(){this.#i.length>0&&this.#u([])}replaceActions(e){this.#u(ao(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#i)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#i}}#u(e,n){this.#p=[],this.#i=e,this.#k(),this.#o=this.#h(this.#i),this.#d(n),this.#b();for(const s of this.#c)s()}#d(e){const n=this.#f(),s=eh(this.definition,this.#o,i=>this.#h(i),e);return s===this.#o?n:(this.#m+=this.#i.length-s.actions.length,this.#i=[...s.actions],this.#k(),this.#o=this.#h(this.#i),this.#f(),!0)}#f(){return this.#o.obsolete.length===0?!1:(this.#m+=this.#o.obsolete.length,this.#i=to(this.#o),this.#k(),this.#o=this.#h(this.#i),!0)}#b(){this.#l?.save(this.#a,this.definition.name,this.#i)}}const oo=(t,e,n)=>e==="comment"?jn:n!==void 0&&J({type:e,target:n})?Zl:jt(t.actions,e),ao=(t,e)=>e.flatMap(n=>{const s=C(_e,n);if(!s.success)return[];const i=s.output,r=oo(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(_e,o.output);return a.success?[a.output]:[]}),ah=()=>({status:{kind:"idle"},request:0}),lh=(t,e)=>{switch(e.kind){case"copy-started":return{status:{kind:"copying"},request:t.request+1};case"send-started":return{status:{kind:"sending"},request:t.request+1};case"copy-finished":return e.request!==t.request||t.status.kind!=="copying"?t:{...t,status:{kind:e.ok?"copied":"copy-failed"}};case"send-finished":return e.request!==t.request||t.status.kind!=="sending"?t:{...t,status:e.outcome.ok?{kind:"sent"}:{kind:"send-failed",reason:e.outcome.reason}};case"settled":return e.request===t.request?{...t,status:{kind:"idle"}}:t}},ch=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=W(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Vn(s.reason,t.locale):null}},lo=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()}},dh=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:N(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},ph=(t,e)=>{const n=()=>lo(t);return{version:X,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:D,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>Fn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},gs=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),le=t=>{const e=new Map;return gs({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Ge=t=>{try{if(typeof localStorage<"u")return gs(localStorage,t)}catch{}return le(t)},hh=t=>{try{if(typeof sessionStorage<"u")return gs(sessionStorage,t)}catch{}return le(t)},uh=8e3,fh=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Ir);class gh{#e;#n;#s=null;#r=null;#t=null;#i=null;#o="";#l=null;#a=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}get view(){return this.#s&&this.#t?$p(this.#s,this.#t):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#k()&&this.#g(),document.addEventListener("pointerdown",this.#b,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#k()&&this.#u()}hostDisconnected(){this.#u(),document.removeEventListener("pointerdown",this.#b,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#a.values())e.handle!==null&&clearTimeout(e.handle);this.#a.clear()}send(e){!this.#s||!this.#t||(this.#t=bp(this.#s,this.#t,e),this.#h(),this.#d(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#t?.list.open?"close-list":"open-list"})}show(e){const n=this.#s?gt(this.#s).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#n.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const i of this.#a.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#a)this.#f(n,s)}#p(){return`${this.#n.storageKey()}:seen-changes`}#m(){return this.#s!==null||this.#r!==null}#k(){const e=[...this.#e.children].find(fh);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#x(i instanceof Error?i.message:String(i))}const s=fp(n);return s.ok?(this.#s=s.log,this.#i=this.#n.persist()?Ge(Dr):le(Dr),this.#t=kp(s.log,this.#i.read(this.#p())),this.#h(),this.#d(),this.#e.requestUpdate(),!0):this.#x(s.error)}#h(){if(!this.#s||!this.#t)return;const e=xp(this.#s,this.#t),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#p(),e))}#x(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#g(){this.#l=new MutationObserver(()=>{(this.#m()||this.#k())&&this.#u()}),this.#l.observe(this.#e,{childList:!0})}#u(){this.#l?.disconnect(),this.#l=null}#d(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#a)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#a.delete(n));for(const n of e){if(this.#a.has(n))continue;const s={handle:null,deadline:0,remaining:uh};this.#a.set(n,s),this.#c.size===0&&this.#f(n,s)}}#f(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#b=e=>{!this.#t?.list.open||this.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#t?.list.open||this.send({kind:"close-list"})}}const tn="dpk-changes",mh=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return b`<button
1296
+ `,op=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:rp}));for(const n of e)n.append(ap(n,t))}},ap=(t,e)=>{const n=W(Et(Tt(t))),s=document.createElement("select");s.className=rs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Mr({current:e,requested:is(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{Ir().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Nr(s.value===""?null:s.value)),i(null),s},lp=L({value:v()}),cp=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(lp,e.detail);n.success&&t(n.output.value)},os=t=>e=>{const n=Ce(e.target,HTMLSelectElement);n!==null&&t(n.value)},dp=t=>e=>{const n=Ce(e.target,HTMLInputElement);n!==null&&t(n.value,n)},pp=t=>e=>{const n=Ce(e.target,HTMLInputElement);n!==null&&t(n.checked)},Dr="data-dpk-changes",hp=/^[^:\s]+:\S+$/,up=Z({id:se(w(v(),S(1))),title:w(v(),S(1)),body:se(v()),target:se(w(v(),ge(hp,'target must be written "type:id"'))),navigate:se(w(v(),Ei("=",'navigate must be written "key=value"')))}),fp=F(up),gp=w(v(),S(1)),jr=Z({revision:gp,changes:fp}),mp=Z({revisions:w(F(jr),S(1,"list at least one version"))}),kp=(t,e)=>JSON.stringify([t,e]),gt=t=>[...t.earlier,t.latest],bp=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:kp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},vp=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?mp:jr,t);if(!n.success)return{ok:!1,error:Nl(n.issues)};const s=n.output,i="revisions"in s?s.revisions:[s],r=[];for(const a of i){if(r.some(c=>c.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=bp(a);if(typeof l=="string")return{ok:!1,error:l};r.push(l)}const o=r.pop();return o?{ok:!0,log:{earlier:r,latest:o}}:{ok:!1,error:"list at least one version"}},xp=Z({v:me(1),revision:v(),seen:F(v())}),yp=Z({v:me(2),since:v(),seen:He(v(),F(v()))}),qr=t=>{const e=C(yp,t);if(e.success)return e.output;const n=C(xp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},as={open:!1,fresh:new Set},Br=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),ls=(t,e)=>gt(t).flatMap(n=>n.entries.filter(Br(e))),Ur=t=>t.target!==null||t.navigate!==null,wp=(t,e)=>{const n=gt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:as}},cs=(t,e)=>new Set([...t.seen,...e]),$p=(t,e,n)=>{switch(n.kind){case"open-list":{const s=ls(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!Ur(o)).map(o=>o.key);return{...e,seen:cs(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:as};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:cs(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:as};case"read-all":return{...e,seen:cs(e,ls(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Sp=(t,e)=>ls(t,e).length,Ap=(t,e)=>{const n=gt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Br(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},Cp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?qt(t.navigate):t.target!==null?e(at(t.target)):null,target:t.target},Hr=3,Tp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Ur(e),fresh:t.list.fresh.has(e.key)}),Ep=(t,e)=>{const n=gt(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Tp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:Sp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Hr),waiting:Math.max(0,i.length-Hr)}},mt=t=>t==="light"||t==="dark"?t:null,Fr=t=>t.authored??t.environment,Wr=t=>t.preference??Fr(t),Rp=t=>{const e=Wr(t)==="dark"?"light":"dark";return e===Fr(t)?null:e},Vr=F(Z({value:w(v(),ge(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),_p=L({targets:Vr,providers:F(L({id:w(v(),S(1)),results:F(Gi)}))}),Lp=Z({target:w(v(),ge(/^element:.+/)),body:w(v(),On(),S(1))}),Kr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Gr=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(N(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(J(i)){const c=n.get(i.id),p=s.get(N(i.target));return{title:c?.title??i.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?Kr(p):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(N(i.target)):void 0;return l===void 0?a:{...a,targetLabel:Kr(l)}},serialize:i=>J(i)?`${i.type} ${N(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},Zr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Yr(t){return typeof Zr.Buffer<"u"&&Zr.Buffer.isBuffer(t)}function Jr(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 Xr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Qr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Op="[object RegExp]",Pp="[object String]",zp="[object Number]",Mp="[object Boolean]",Ip="[object Symbol]",Np="[object Date]",Dp="[object Map]",jp="[object Set]",qp="[object Array]",Bp="[object Function]",Up="[object ArrayBuffer]",ds="[object Object]",Hp="[object Error]",Fp="[object DataView]",Wp="[object Uint8Array]",Vp="[object Uint8ClampedArray]",Kp="[object Uint16Array]",Gp="[object Uint32Array]",Zp="[object BigUint64Array]",Yp="[object Int8Array]",Jp="[object Int16Array]",Xp="[object Int32Array]",Qp="[object BigInt64Array]",eh="[object Float32Array]",th="[object Float64Array]";function nh(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function sh(t,e,n){return kt(t,e,void 0,void 0,void 0,void 0,n)}function kt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return bt(t,e,r,o)}return bt(t,e,r,o)}function bt(t,e,n,s){if(Object.is(t,e))return!0;let i=Qr(t),r=Qr(e);if(i==="[object Arguments]"&&(i=ds),r==="[object Arguments]"&&(r=ds),i!==r)return!1;switch(i){case Pp:return t.toString()===e.toString();case zp:return nh(t.valueOf(),e.valueOf());case Mp:case Np:case Ip:return Object.is(t.valueOf(),e.valueOf());case Op:return t.source===e.source&&t.flags===e.flags;case Bp:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Dp:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!kt(c,e.get(l),l,t,e,n,s))return!1;return!0;case jp:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>kt(d,u,void 0,t,e,n,s));if(h===-1)return!1;c.splice(h,1)}return!0}case qp:case Wp:case Vp:case Kp:case Gp:case Zp:case Yp:case Jp:case Xp:case Qp:case eh:case th:if(Yr(t)!==Yr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!kt(t[l],e[l],l,t,e,n,s))return!1;return!0;case Up:return t.byteLength!==e.byteLength?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case Fp:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:bt(new Uint8Array(t),new Uint8Array(e),n,s);case Hp:return t.name===e.name&&t.message===e.message;case ds:{if(!(bt(t.constructor,e.constructor,n,s)||Jr(t)&&Jr(e)))return!1;const l=[...Object.keys(t),...Xr(t)],c=[...Object.keys(e),...Xr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!kt(h,u,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function ih(){}function Qt(t,e){return sh(t,e,ih)}const eo="page",to=t=>N(t),no=(t,e,n,s=new Map)=>{let i=e;const r=[],o=[],a=[],l=[],c=new Map;for(const d of n){if(d.type===D)continue;if(J(d)){const f=s.get(d.id);f===void 0||f.stale!==void 0?o.push({action:d,reason:f?.stale??"target-missing"}):r.push(d);continue}const h=jt(t.actions,d.type);if(!h){o.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(i,d);if(u===null){o.push({action:d,reason:t.hasTarget(i,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&ps(t,i,u)){a.push(d);continue}i=u,r.push(d)}for(const d of n){if(d.type!==D)continue;if(d.target.type!==eo&&!t.hasTarget(i,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=to(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(n.map((d,h)=>[d.id,h]));return o.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:i,actions:n,applied:r,stale:o,obsolete:a,comments:l,commentsByTarget:c}},ps=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Qt(e,n):Qt(t.canonicalState(e),t.canonicalState(n)),so=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},rh=(t,e,n,s)=>{let i=e;const r=s??io(i).map(o=>o.id);for(const o of[...r].reverse())i=oh(t,i,n,o,s!==void 0)??i;return i},io=t=>t.applied.filter(e=>!J(e)),oh=(t,e,n,s,i)=>{const r=io(e),o=r.findIndex(h=>h.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=[...i?ah(t,e.base,r,o):[],...lh(t,l,a)],p=new Set,d=c.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of d){const u=ch(t,e,n,h);if(u!==null)return u}return null},ah=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>ps(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},lh=(t,e,n)=>{const s=ro(n),i=e.filter(l=>ro(l).some(c=>s.includes(c))),r=oo(t,n),o=i.filter(l=>oo(t,l)===r),a=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},ro=t=>{const e=t.target.type===eo?[]:t.target.id.split("."),n=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(s=>typeof s=="string"&&s!==""):[];return[...e,...n]},oo=(t,e)=>jt(t.actions,e.type)?.mode,ch=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return ps(t,o.state,e.state)?o:null;if(a.some(l=>l.type===D||J(l)))return null;for(const l of a)r.add(l.id)}},dh=L({v:me(1),template:w(v(),S(1)),actions:F(ke())});class hs{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(dh,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(Le,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class us{constructor(){this.store=new Map}load(e,n){return new hs({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const fs=()=>{try{if(typeof localStorage<"u")return new hs(localStorage)}catch{}return new us},en=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ph=F(ke());class ao{#e;#n;#s={targets:[],providers:[]};#r=new Map;#t;#i;#o;#l;#a;#c=new Set;#p=[];#m=0;constructor(e){this.#e=e.definition,this.#n=Gr(e.definition,[],this.#r),this.#t=e.base,this.#a=e.storageKey??en(e.definition.name),this.#l=e.storage===void 0?fs():e.storage;const n=e.initialActions??this.#l?.load(this.#a,this.definition.name)??[];this.#i=co(this.definition,n),this.#o=this.#h(this.#i),this.#d()&&this.#b()}get definition(){return this.#n}setComponentSnapshot(e){const n=zn(_p,e);if(!Qt(n,this.#s)){this.#s=n,this.#k(),this.#o=this.#h(this.#i);for(const s of this.#c)s()}}setTemplate(e){this.#e=e,this.#k(),this.#o=this.#h(this.#i);for(const n of this.#c)n()}#k(){this.#r=Zi(this.#i,this.#s.providers),this.#n=Gr(this.#e,this.#s.targets,this.#r)}#h(e){return no(this.definition,this.#t,e,Zi(e,this.#s.providers))}get base(){return this.#t}get actions(){return this.#i}get derivation(){return this.#o}get lastIssues(){return this.#p}get prunedCount(){return this.#m}descriptorFor(e,n){return lo(this.definition,e,n)}dispatch(e){const n=this.#x(e,this.#o.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#u(Nn(this.#i,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(ph,e);if(!n.success)return this.#g([Oe(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#i,r=this.#o.state;const o=[];for(const a of s){const l=this.#x(a,r);if(!l.ok)return this.#g([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||J(c)?c.target.type==="page"||this.definition.hasTarget(r,c.target)?r:null:this.definition.apply(r,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);i=Nn(i,c,p),r=this.#h(i).state,o.push(c.id)}return this.#u(i,o),{ok:!0,ids:o}}#x(e,n){const s=C(Fi,e);if(!s.success)return{ok:!1,issue:Oe(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Mn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Gl(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#g(e){return this.#p=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#i.find(a=>a.id===e);if(s?.type!==D)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(lt(s)===n)return{ok:!0,id:e};const i=C(jn.schema,{...s,payload:{body:n}});if(!i.success)return this.#g([Oe(i.issues)]);const r=C(Le,i.output);if(!r.success)return this.#g([Oe(r.issues)]);const o=r.output;return this.#u(this.#i.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#i.filter(s=>s.id!==e);n.length!==this.#i.length&&this.#u(n)}clearActions(){this.#i.length>0&&this.#u([])}replaceActions(e){this.#u(co(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#i)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#i}}#u(e,n){this.#p=[],this.#i=e,this.#k(),this.#o=this.#h(this.#i),this.#d(n),this.#b();for(const s of this.#c)s()}#d(e){const n=this.#f(),s=rh(this.definition,this.#o,i=>this.#h(i),e);return s===this.#o?n:(this.#m+=this.#i.length-s.actions.length,this.#i=[...s.actions],this.#k(),this.#o=this.#h(this.#i),this.#f(),!0)}#f(){return this.#o.obsolete.length===0?!1:(this.#m+=this.#o.obsolete.length,this.#i=so(this.#o),this.#k(),this.#o=this.#h(this.#i),!0)}#b(){this.#l?.save(this.#a,this.definition.name,this.#i)}}const lo=(t,e,n)=>e==="comment"?jn:n!==void 0&&J({type:e,target:n})?Ql:jt(t.actions,e),co=(t,e)=>e.flatMap(n=>{const s=C(Le,n);if(!s.success)return[];const i=s.output,r=lo(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(Le,o.output);return a.success?[a.output]:[]}),hh=()=>({status:{kind:"idle"},request:0}),uh=(t,e)=>{switch(e.kind){case"copy-started":return{status:{kind:"copying"},request:t.request+1};case"send-started":return{status:{kind:"sending"},request:t.request+1};case"copy-finished":return e.request!==t.request||t.status.kind!=="copying"?t:{...t,status:{kind:e.ok?"copied":"copy-failed"}};case"send-finished":return e.request!==t.request||t.status.kind!=="sending"?t:{...t,status:e.outcome.ok?{kind:"sent"}:{kind:"send-failed",reason:e.outcome.reason}};case"settled":return e.request===t.request?{...t,status:{kind:"idle"}}:t}},fh=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=W(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Vn(s.reason,t.locale):null}},po=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()}},gh=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:N(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},mh=(t,e)=>{const n=()=>po(t);return{version:X,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:D,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>Fn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},gs=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),le=t=>{const e=new Map;return gs({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Ge=t=>{try{if(typeof localStorage<"u")return gs(localStorage,t)}catch{}return le(t)},kh=t=>{try{if(typeof sessionStorage<"u")return gs(sessionStorage,t)}catch{}return le(t)},bh=8e3,vh=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Dr);class xh{#e;#n;#s=null;#r=null;#t=null;#i=null;#o="";#l=null;#a=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}get view(){return this.#s&&this.#t?Ep(this.#s,this.#t):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#k()&&this.#g(),document.addEventListener("pointerdown",this.#b,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#k()&&this.#u()}hostDisconnected(){this.#u(),document.removeEventListener("pointerdown",this.#b,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#a.values())e.handle!==null&&clearTimeout(e.handle);this.#a.clear()}send(e){!this.#s||!this.#t||(this.#t=$p(this.#s,this.#t,e),this.#h(),this.#d(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#t?.list.open?"close-list":"open-list"})}show(e){const n=this.#s?gt(this.#s).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#n.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const i of this.#a.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#a)this.#f(n,s)}#p(){return`${this.#n.storageKey()}:seen-changes`}#m(){return this.#s!==null||this.#r!==null}#k(){const e=[...this.#e.children].find(vh);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#x(i instanceof Error?i.message:String(i))}const s=vp(n);return s.ok?(this.#s=s.log,this.#i=this.#n.persist()?Ge(qr):le(qr),this.#t=wp(s.log,this.#i.read(this.#p())),this.#h(),this.#d(),this.#e.requestUpdate(),!0):this.#x(s.error)}#h(){if(!this.#s||!this.#t)return;const e=Ap(this.#s,this.#t),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#p(),e))}#x(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#g(){this.#l=new MutationObserver(()=>{(this.#m()||this.#k())&&this.#u()}),this.#l.observe(this.#e,{childList:!0})}#u(){this.#l?.disconnect(),this.#l=null}#d(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#a)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#a.delete(n));for(const n of e){if(this.#a.has(n))continue;const s={handle:null,deadline:0,remaining:bh};this.#a.set(n,s),this.#c.size===0&&this.#f(n,s)}}#f(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#b=e=>{!this.#t?.list.open||this.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#t?.list.open||this.send({kind:"close-list"})}}const tn="dpk-changes",yh=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return b`<button
1297
1297
  class="dpk-bell"
1298
1298
  type="button"
1299
1299
  aria-controls=${tn}
@@ -1302,17 +1302,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
1302
1302
  title=${s}
1303
1303
  @click=${n.toggleList}
1304
1304
  >
1305
- ${pr()} ${t.unread>0?b`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:g}
1306
- </button>`},co=(t,e,n)=>t.jumpable?b`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1305
+ ${ur()} ${t.unread>0?b`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:g}
1306
+ </button>`},ho=(t,e,n)=>t.jumpable?b`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1307
1307
  ${e.changesShow}
1308
- </button>`:g,po=(t,e,n,s)=>s==="list"||t.unread>0?b`<button
1308
+ </button>`:g,uo=(t,e,n,s)=>s==="list"||t.unread>0?b`<button
1309
1309
  class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
1310
1310
  type="button"
1311
1311
  aria-disabled=${t.unread>0?"false":"true"}
1312
1312
  @click=${n.readAll}
1313
1313
  >
1314
1314
  ${e.changesReadAll}
1315
- </button>`:g,kh=(t,e,n)=>b`<section class="dpk-changes-group" data-revision=${t.revision}>
1315
+ </button>`:g,wh=(t,e,n)=>b`<section class="dpk-changes-group" data-revision=${t.revision}>
1316
1316
  <h3 class="dpk-changes-revision">
1317
1317
  <span>${t.revision}</span>
1318
1318
  ${t.latest?b`<span class="dpk-changes-current">${e.changesCurrent}</span>`:g}
@@ -1327,16 +1327,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1327
1327
  <p class="dpk-change-title">
1328
1328
  ${s.fresh?b`<span class="dpk-change-new">${e.changesNew}</span>`:g} ${s.title}
1329
1329
  </p>
1330
- ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`} ${co(s,e,n)}
1330
+ ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`} ${ho(s,e,n)}
1331
1331
  </li>`)}
1332
1332
  </ol>
1333
- </section>`,bh=(t,e,n)=>t.open?b`<div id=${tn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1333
+ </section>`,$h=(t,e,n)=>t.open?b`<div id=${tn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1334
1334
  <div class="dpk-changes-head">
1335
1335
  <h2 class="dpk-changes-title">${e.changesTitle}</h2>
1336
- ${po(t,e,n,"list")}
1336
+ ${uo(t,e,n,"list")}
1337
1337
  </div>
1338
- ${ct(t.groups,s=>s.revision,s=>kh(s,e,n))}
1339
- </div>`:g,vh=(t,e,n)=>b`<section
1338
+ ${ct(t.groups,s=>s.revision,s=>wh(s,e,n))}
1339
+ </div>`:g,Sh=(t,e,n)=>b`<section
1340
1340
  class="dpk-toasts"
1341
1341
  aria-live="polite"
1342
1342
  aria-label=${e.changes}
@@ -1346,12 +1346,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
1346
1346
  @focusout=${()=>n.resume("focus")}
1347
1347
  >
1348
1348
  ${ct(t.toasts,s=>s.key,s=>b`<div class="dpk-toast" data-key=${s.id}>
1349
- <span class="dpk-toast-icon" aria-hidden="true">${pr()}</span>
1349
+ <span class="dpk-toast-icon" aria-hidden="true">${ur()}</span>
1350
1350
  <div class="dpk-toast-text">
1351
1351
  <p class="dpk-change-title">${s.title}</p>
1352
1352
  ${s.body===null?g:b`<p class="dpk-change-body">${s.body}</p>`}
1353
1353
  </div>
1354
- ${co(s,e,n)}
1354
+ ${ho(s,e,n)}
1355
1355
  <button
1356
1356
  class="dpk-toast-close"
1357
1357
  type="button"
@@ -1366,9 +1366,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
1366
1366
  ${t.waiting>0?b`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1367
1367
  ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1368
1368
  </button>`:g}
1369
- ${po(t,e,n,"toasts")}
1369
+ ${uo(t,e,n,"toasts")}
1370
1370
  </div>`:g}
1371
- </section>`,ms=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),xh=t=>ms(t,["use"]),yh=t=>ms(t,["anchorFor","canSendToClaude","sendToClaude"]),wh=t=>ms(t,["collection"]),ho=async(t,e)=>{try{return await t.use(e)}catch{return null}},$h=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=lc(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(rc).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=cc(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:pc(o)}}}}),Sh=async t=>{if(!xh(t))return null;const[e,n]=await Promise.all([ho(t,"comments"),ho(t,"db")]);return yh(e)?$h(e,wh(n)?n:null):null},Ah=()=>Reflect.get(globalThis,"claude");class Ch{#e;#n;#s=null;#r=!1;constructor(e,n=Ah){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#s??=Sh(this.#n()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#t(),s}#t=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const ks="dev-process-kit:color-scheme",Th="(prefers-color-scheme: dark)",uo=()=>typeof matchMedia=="function"?matchMedia(Th):null,fo=()=>mt(document.documentElement.dataset.theme)??(uo()?.matches===!0?"dark":"light");class Eh{#e;#n;#s=null;#r=null;#t="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?Ge(mt):le(mt),this.#r=this.#s.read(ks)),this.#t=fo(),this.#i=uo(),this.#i?.addEventListener("change",this.#a),this.#o=new MutationObserver(this.#a),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#a),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Hr(this.#l(e))}toggle(e){this.#r=Sp(this.#l(e)),this.#r===null?this.#s?.remove(ks):this.#s?.write(ks,this.#r),this.#e.requestUpdate()}#l(e){return{preference:this.#r,authored:e,environment:this.#t}}#a=()=>{const e=fo();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const Rh=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},go=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},mo=t=>go(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),ko=(t,e)=>{for(const n of mo(t)){const s=Jl(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},_h=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(Vi,n);return s.success?[s.output]:[]}):[]},Lh=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(Fr,n.commentTargets);s.success&&e.push(...s.output)}return{targets:go(e,n=>n.value),providers:mo(t).map(n=>({id:n.id,results:_h(n)}))}},Oh=2400;class Ph{#e=ah();#n=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#i()}async copy(e){this.#r({kind:"copy-started"});const n=this.#e.request,s=await Wn(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#t(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#t(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=lh(this.#e,e),this.#s.requestUpdate()}#t(e){e===this.#e.request&&(this.#i(),this.#n=setTimeout(()=>{this.#n=null,this.#r({kind:"settled",request:e})},Oh))}#i(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}const bs="dev-process-kit:locale";class zh{#e;#n;#s;#r=null;#t=null;#i;#o;constructor(e,n,s){this.#e=e,this.#n=n,this.#s=s,e.addController(this)}get authored(){if(this.#i===void 0)return Et(Tt(this.#e));const e=this.#e.parentNode;return Et(this.#i??(e===null?null:Tt(e)))}get locale(){return this.#o??this.#l()}#l(){return pa({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#n()?Ge(Qs):le(Qs),this.#t=this.#r.read(bs)),this.#i??=this.#e.getAttribute("lang"),this.#a()}pick(e){this.#t=ha(e,this.authored),this.#t===null?this.#r?.remove(bs):this.#r?.write(bs,this.#t),this.#a(),this.#e.requestUpdate()}#a(){const e=this.#t??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#s(),(!s||this.#t!==null)&&document.dispatchEvent(new Event(bn))}}const Mh="(max-width: 760px)",Ih=()=>typeof matchMedia=="function"?matchMedia(Mh):null;class Nh{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Ih(),this.#s=this.#n?.matches===!0,this.#n?.addEventListener("change",this.#r)}hostDisconnected(){this.#n?.removeEventListener("change",this.#r),this.#n=null}get narrow(){return this.#s}#r=e=>{this.#s=e.matches,this.#e.requestUpdate()}}const bo=()=>qt(typeof location>"u"?"":location.hash),Dh=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Fe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class jh{#e;#n=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,n=je(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#n!==n&&(this.#n=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#s&&(this.#s=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const vo=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},qh=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},xo=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),yo=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},wo=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=xo(t.scrollTop,yo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},$o=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=xo(t.scrollLeft,yo(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},So="data-dpk-target",Bh=2800,Ao=48,Uh=t=>t.getClientRects().length>0,Co=(t,e)=>{const n=vo(t,`[${So}]`).filter(r=>(r.getAttribute(So)??"").split(/\s+/).includes(e)),s=vo(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(Uh)??i[0]??null},To=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},Hh=(t,e)=>{for(const n of qh(e,t))To(n,"y")&&wo(n,e,Ao),To(n,"x")&&$o(n,e,Ao)},Eo="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",Ie={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Ro={outline:"2px solid transparent",outlineOffset:"3px"},Fh=t=>t?[{...Ie},{...Ie,offset:.85},{...Ro}]:[{...Ie,boxShadow:`0 0 0 0 ${Eo}`},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.3},{...Ie,boxShadow:`0 0 0 0 ${Eo}`,offset:.31},{...Ie,boxShadow:"0 0 0 14px transparent",offset:.6},{...Ie,offset:.85},{...Ro}],vt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},nn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},Wh=t=>t?[{...vt},{...vt,offset:.85},{...nn}]:[{...vt},{...nn,offset:.3},{...vt,offset:.31},{...nn,offset:.6},{...vt,offset:.61},{...nn}],Vh=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?Wh(e):Fh(e),{duration:Bh,easing:"ease-out"})},ve={min:180,max:560,step:16,largeStep:64},Kh={side:"left",defaultWidth:260},sn=t=>Math.round(Math.min(ve.max,Math.max(ve.min,t))),_o=t=>typeof t=="number"&&Number.isFinite(t)?sn(t):null,vs=(t,e)=>t==="left"?e:-e,Gh=(t,e)=>sn(t.startWidth+vs(t.side,e-t.startX)),Zh=(t,e,{key:n,shiftKey:s})=>{const i=s?ve.largeStep:ve.step;switch(n){case"ArrowLeft":return sn(t+vs(e,-i));case"ArrowRight":return sn(t+vs(e,i));case"Home":return ve.min;case"End":return ve.max;default:return null}},Lo=t=>typeof t=="boolean"?t:null,Yh=t=>t==="left"?"right":"left",Jh=(t,e)=>e?{action:"expand",points:Yh(t)}:{action:"collapse",points:t},Xh=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Qh{#e;#n;#s=null;#r="";#t=!1;#i=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(Lo):le(Lo),this.#r=Xh(this.#n.template()),this.#t=this.#s.read(this.#r)??!1)}get collapsed(){return this.#t}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#t=!this.#t,this.#t?this.#s?.write(this.#r,!0):this.#s?.remove(this.#r),this.#e.requestUpdate()}}const eu=t=>`dev-process-kit:sidebar-width:${t}`,xs={kind:"idle"};class tu{constructor(e,n){this.#s=null,this.#r="",this.#t=null,this.#i=xs,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#i={kind:"dragging",pointerId:s.pointerId,side:this.#n.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#i;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(Gh(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=Zh(this.width,this.#n.layout().side,s);i!==null&&(s.preventDefault(),this.#l(i),this.#a())},dblclick:()=>{this.#l(this.#n.layout().defaultWidth),this.#a()}},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#r;#t;#i;hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(_o):le(_o),this.#r=eu(this.#n.template()),this.#t=this.#s.read(this.#r))}hostDisconnected(){this.#i=xs}get width(){return this.#t??this.#n.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=xs,this.#a(),this.#e.requestUpdate())}#l(e){const n=e===this.#n.layout().defaultWidth?null:e;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}#a(){this.#t===null?this.#s?.remove(this.#r):this.#s?.write(this.#r,this.#t)}}const nu=[_t,xn,de`
1371
+ </section>`,ms=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),Ah=t=>ms(t,["use"]),Ch=t=>ms(t,["anchorFor","canSendToClaude","sendToClaude"]),Th=t=>ms(t,["collection"]),fo=async(t,e)=>{try{return await t.use(e)}catch{return null}},Eh=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=hc(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(cc).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=uc(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:gc(o)}}}}),Rh=async t=>{if(!Ah(t))return null;const[e,n]=await Promise.all([fo(t,"comments"),fo(t,"db")]);return Ch(e)?Eh(e,Th(n)?n:null):null},_h=()=>Reflect.get(globalThis,"claude");class Lh{#e;#n;#s=null;#r=!1;constructor(e,n=_h){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#s??=Rh(this.#n()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#t(),s}#t=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const ks="dev-process-kit:color-scheme",Oh="(prefers-color-scheme: dark)",go=()=>typeof matchMedia=="function"?matchMedia(Oh):null,mo=()=>mt(document.documentElement.dataset.theme)??(go()?.matches===!0?"dark":"light");class Ph{#e;#n;#s=null;#r=null;#t="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?Ge(mt):le(mt),this.#r=this.#s.read(ks)),this.#t=mo(),this.#i=go(),this.#i?.addEventListener("change",this.#a),this.#o=new MutationObserver(this.#a),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#a),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Wr(this.#l(e))}toggle(e){this.#r=Rp(this.#l(e)),this.#r===null?this.#s?.remove(ks):this.#s?.write(ks,this.#r),this.#e.requestUpdate()}#l(e){return{preference:this.#r,authored:e,environment:this.#t}}#a=()=>{const e=mo();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const zh=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},ko=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},bo=t=>ko(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),vo=(t,e)=>{for(const n of bo(t)){const s=tc(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Mh=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(Gi,n);return s.success?[s.output]:[]}):[]},Ih=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(Vr,n.commentTargets);s.success&&e.push(...s.output)}return{targets:ko(e,n=>n.value),providers:bo(t).map(n=>({id:n.id,results:Mh(n)}))}},Nh=2400;class Dh{#e=hh();#n=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#i()}async copy(e){this.#r({kind:"copy-started"});const n=this.#e.request,s=await Wn(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#t(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#t(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=uh(this.#e,e),this.#s.requestUpdate()}#t(e){e===this.#e.request&&(this.#i(),this.#n=setTimeout(()=>{this.#n=null,this.#r({kind:"settled",request:e})},Nh))}#i(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}const bs="dev-process-kit:locale";class jh{#e;#n;#s;#r=null;#t=null;#i;#o;constructor(e,n,s){this.#e=e,this.#n=n,this.#s=s,e.addController(this)}get authored(){if(this.#i===void 0)return Et(Tt(this.#e));const e=this.#e.parentNode;return Et(this.#i??(e===null?null:Tt(e)))}get locale(){return this.#o??this.#l()}#l(){return ua({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#n()?Ge(Qs):le(Qs),this.#t=this.#r.read(bs)),this.#i??=this.#e.getAttribute("lang"),this.#a()}pick(e){this.#t=fa(e,this.authored),this.#t===null?this.#r?.remove(bs):this.#r?.write(bs,this.#t),this.#a(),this.#e.requestUpdate()}#a(){const e=this.#t??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#s(),(!s||this.#t!==null)&&document.dispatchEvent(new Event(bn))}}const qh="(max-width: 760px)",Bh=()=>typeof matchMedia=="function"?matchMedia(qh):null;class Uh{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Bh(),this.#s=this.#n?.matches===!0,this.#n?.addEventListener("change",this.#r)}hostDisconnected(){this.#n?.removeEventListener("change",this.#r),this.#n=null}get narrow(){return this.#s}#r=e=>{this.#s=e.matches,this.#e.requestUpdate()}}const xo=()=>qt(typeof location>"u"?"":location.hash),Hh=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Fe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class Fh{#e;#n=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,n=Ce(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#n!==n&&(this.#n=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#s&&(this.#s=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const yo=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},Wh=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},wo=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),$o=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},So=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=wo(t.scrollTop,$o(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Ao=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=wo(t.scrollLeft,$o(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},Co="data-dpk-target",Vh=2800,To=48,Kh=t=>t.getClientRects().length>0,Eo=(t,e)=>{const n=yo(t,`[${Co}]`).filter(r=>(r.getAttribute(Co)??"").split(/\s+/).includes(e)),s=yo(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(Kh)??i[0]??null},Ro=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},Gh=(t,e)=>{for(const n of Wh(e,t))Ro(n,"y")&&So(n,e,To),Ro(n,"x")&&Ao(n,e,To)},_o="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",Ne={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Lo={outline:"2px solid transparent",outlineOffset:"3px"},Zh=t=>t?[{...Ne},{...Ne,offset:.85},{...Lo}]:[{...Ne,boxShadow:`0 0 0 0 ${_o}`},{...Ne,boxShadow:"0 0 0 14px transparent",offset:.3},{...Ne,boxShadow:`0 0 0 0 ${_o}`,offset:.31},{...Ne,boxShadow:"0 0 0 14px transparent",offset:.6},{...Ne,offset:.85},{...Lo}],vt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},nn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},Yh=t=>t?[{...vt},{...vt,offset:.85},{...nn}]:[{...vt},{...nn,offset:.3},{...vt,offset:.31},{...nn,offset:.6},{...vt,offset:.61},{...nn}],Jh=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?Yh(e):Zh(e),{duration:Vh,easing:"ease-out"})},ve={min:180,max:560,step:16,largeStep:64},Xh={side:"left",defaultWidth:260},sn=t=>Math.round(Math.min(ve.max,Math.max(ve.min,t))),Oo=t=>typeof t=="number"&&Number.isFinite(t)?sn(t):null,vs=(t,e)=>t==="left"?e:-e,Qh=(t,e)=>sn(t.startWidth+vs(t.side,e-t.startX)),eu=(t,e,{key:n,shiftKey:s})=>{const i=s?ve.largeStep:ve.step;switch(n){case"ArrowLeft":return sn(t+vs(e,-i));case"ArrowRight":return sn(t+vs(e,i));case"Home":return ve.min;case"End":return ve.max;default:return null}},Po=t=>typeof t=="boolean"?t:null,tu=t=>t==="left"?"right":"left",nu=(t,e)=>e?{action:"expand",points:tu(t)}:{action:"collapse",points:t},su=t=>`dev-process-kit:sidebar-collapsed:${t}`;class iu{#e;#n;#s=null;#r="";#t=!1;#i=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(Po):le(Po),this.#r=su(this.#n.template()),this.#t=this.#s.read(this.#r)??!1)}get collapsed(){return this.#t}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#t=!this.#t,this.#t?this.#s?.write(this.#r,!0):this.#s?.remove(this.#r),this.#e.requestUpdate()}}const ru=t=>`dev-process-kit:sidebar-width:${t}`,xs={kind:"idle"};class ou{constructor(e,n){this.#s=null,this.#r="",this.#t=null,this.#i=xs,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#i={kind:"dragging",pointerId:s.pointerId,side:this.#n.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#i;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(Qh(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=eu(this.width,this.#n.layout().side,s);i!==null&&(s.preventDefault(),this.#l(i),this.#a())},dblclick:()=>{this.#l(this.#n.layout().defaultWidth),this.#a()}},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#r;#t;#i;hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?Ge(Oo):le(Oo),this.#r=ru(this.#n.template()),this.#t=this.#s.read(this.#r))}hostDisconnected(){this.#i=xs}get width(){return this.#t??this.#n.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=xs,this.#a(),this.#e.requestUpdate())}#l(e){const n=e===this.#n.layout().defaultWidth?null:e;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}#a(){this.#t===null?this.#s?.remove(this.#r):this.#s?.write(this.#r,this.#t)}}const au=[_t,xn,de`
1372
1372
  :host {
1373
1373
  display: block;
1374
1374
  min-height: 100%;
@@ -2589,7 +2589,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2589
2589
  order: 1;
2590
2590
  }
2591
2591
  }
2592
- `],su=30,iu=He(v(),L({base:v(),value:v()})),Oo=t=>{const e=C(iu,t);return e.success?e.output:null},ru=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),ou=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-su)))},au=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},lu=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},cu=new Set(["text","search","url","email","tel"]),Po=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&cu.has(t.type)?t:null,du=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},pu=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},hu=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),ys=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(ys):typeof t=="object"&&t!==null?Object.values(t).flatMap(ys):[],zo=t=>t.replace(/\s+/g," ").trim();class uu{#e;#n;#s=null;#r="";#t=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?hh(Oo):le(Oo),this.#r=this.#n.storageKey()),this.#e.addEventListener("focusin",this.#o),this.#e.addEventListener("input",this.#l)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#o),this.#e.removeEventListener("input",this.#l)}settle(e){const n=new Set(e.flatMap(ys).map(zo));for(const s of this.#i){if(!n.has(zo(s.value)))continue;this.#i.delete(s);const i=this.#t.get(s);i!==void 0&&this.#c(au(this.#a(),i.id))}}#o=e=>{const n=Po(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=du(this.#e,n);if(s===null)return;const i=pu(n),r=n.value,o=ru({...i===void 0?{}:{key:i},hosts:s,name:hu(n),base:r});this.#t.set(n,{id:o,base:r});const a=lu(this.#a(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#l=e=>{const n=Po(e.composedPath()[0]),s=n===null?void 0:this.#t.get(n);if(!(n===null||s===void 0)){for(const i of this.#i)i.isConnected||this.#i.delete(i);this.#i.add(n),this.#c(ou(this.#a(),s.id,{base:s.base,value:n.value}))}};#a(){return this.#s?.read(this.#r)??{}}#c(e){Object.keys(e).length===0?this.#s?.remove(this.#r):this.#s?.write(this.#r,e)}}class fu{#e;#n;#s;#r=null;#t=!1;constructor(e,n={}){this.#e=e,this.#n=n.fetchVersions??zr,this.#s=n.switchTo??Mr,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#n().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==X&&this.#s(e===""?null:e)}render(e){const n=W(e),s=Pr({current:X,requested:is(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),i=()=>this.load();return b`<span class="dpk-version"
2592
+ `],lu=30,cu=He(v(),L({base:v(),value:v()})),zo=t=>{const e=C(cu,t);return e.success?e.output:null},du=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),pu=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-lu)))},hu=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},uu=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},fu=new Set(["text","search","url","email","tel"]),Mo=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&fu.has(t.type)?t:null,gu=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},mu=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},ku=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),ys=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(ys):typeof t=="object"&&t!==null?Object.values(t).flatMap(ys):[],Io=t=>t.replace(/\s+/g," ").trim();class bu{#e;#n;#s=null;#r="";#t=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?kh(zo):le(zo),this.#r=this.#n.storageKey()),this.#e.addEventListener("focusin",this.#o),this.#e.addEventListener("input",this.#l)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#o),this.#e.removeEventListener("input",this.#l)}settle(e){const n=new Set(e.flatMap(ys).map(Io));for(const s of this.#i){if(!n.has(Io(s.value)))continue;this.#i.delete(s);const i=this.#t.get(s);i!==void 0&&this.#c(hu(this.#a(),i.id))}}#o=e=>{const n=Mo(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=gu(this.#e,n);if(s===null)return;const i=mu(n),r=n.value,o=du({...i===void 0?{}:{key:i},hosts:s,name:ku(n),base:r});this.#t.set(n,{id:o,base:r});const a=uu(this.#a(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#l=e=>{const n=Mo(e.composedPath()[0]),s=n===null?void 0:this.#t.get(n);if(!(n===null||s===void 0)){for(const i of this.#i)i.isConnected||this.#i.delete(i);this.#i.add(n),this.#c(pu(this.#a(),s.id,{base:s.base,value:n.value}))}};#a(){return this.#s?.read(this.#r)??{}}#c(e){Object.keys(e).length===0?this.#s?.remove(this.#r):this.#s?.write(this.#r,e)}}class vu{#e;#n;#s;#r=null;#t=!1;constructor(e,n={}){this.#e=e,this.#n=n.fetchVersions??Ir,this.#s=n.switchTo??Nr,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#n().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==X&&this.#s(e===""?null:e)}render(e){const n=W(e),s=Mr({current:X,requested:is(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),i=()=>this.load();return b`<span class="dpk-version"
2593
2593
  >dev-process-kit@<select
2594
2594
  class="dpk-version-select"
2595
2595
  aria-label=${n.versionLabel}
@@ -2600,7 +2600,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2600
2600
  >
2601
2601
  ${s.options.map(r=>b`<option value=${r.value} ?selected=${r.value===s.value}>${r.label}</option>`)}
2602
2602
  </select></span
2603
- >`}}const ws=`script[type="application/json"]:not([${Ir}])`,gu=30,Mo={width:360,height:480},mu=t=>{try{return t.matches(":popover-open")}catch{return!1}},ku=()=>new Promise(t=>requestAnimationFrame(()=>t()));class bu extends he{static{this.styles=nu}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#n=new jh(this);#s=new Eh(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new Ch(this);#t=new Ph(this);#i=new tu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new Qh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#l=new Nh(this);#a=new uu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??en(this.definition.name)}:unsent-text`});#c=null;#p=new gh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??en(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===tn||n.classList.contains("dpk-bell"))),show:e=>{this.#G(e)}});#m={toggleList:()=>this.#p.toggleList(),openList:()=>this.#p.send({kind:"open-list"}),show:e=>this.#p.show(e),dismiss:e=>this.#p.send({kind:"close-toast",key:e}),readAll:()=>this.#p.send({kind:"read-all"}),pause:e=>this.#p.pause(e),resume:e=>this.#p.resume(e)};#k=new Rr(this);#h=!1;#x=new fu(this);#g=new zh(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#d?.setTemplate(this.definition));#u;#d;#f=Un;#b=null;#w=new Set;#A=null;#L;#$;#C;#T=[];#O;#F=new Promise(e=>{this.#O=e});#P;get locale(){return this.#g.locale}get definition(){const e=this.locale;return this.#u?.locale!==e&&(this.#u={locale:e,value:this.definitionFor(e)}),this.#u.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#z(),window.addEventListener("hashchange",this.#j),this.addEventListener("click",this.#H),this.addEventListener("dpk-comment-targets-change",this.#v),this.addEventListener("dpk-comment-request",this.#q),this.addEventListener("dpk-comment-submit",this.#B),this.addEventListener("dpk-element-action",this.#U),this.#C??=new MutationObserver(this.#v),this.#v()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#j),this.removeEventListener("click",this.#H),this.#$?.disconnect(),this.#C?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#v),this.removeEventListener("dpk-comment-request",this.#q),this.removeEventListener("dpk-comment-submit",this.#B),this.removeEventListener("dpk-element-action",this.#U)}#z(e=0){if(this.#d){this.#M();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#z(e+1));return}this.#ne()}#M(){this.#L||(this.#L=this.#d?.subscribe(()=>this.#oe()))}willUpdate(){this.dataset.theme=this.#s.resolve(mt(this.theme))}updated(){this.#le(),this.#ae(),this.#K(),this.#h&&(this.#h=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#P??=this.#te(),this.#P}get controller(){if(!this.#d)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#d}get derivation(){return this.controller.derivation}get navigation(){return this.#f}dispatch(e){const n=this.controller.dispatch(e);return n.ok&&this.#a.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}dispatchBatch(e){const n=this.controller.dispatchBatch(e);return n.ok&&this.#a.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}editComment(e,n){const s=this.controller.editComment(e,n);return s.ok&&this.#a.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#y()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,n={}){const s=Fe(this.#S());this.#f=Hn(this.#f,e,this.definition.navigationHierarchy),this.#E(n.replace??!1);const i=Fe(this.#S());this.requestUpdate(),s!==i&&(this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#S();return Fe(this.definition.resolveNavigation(this.derivation.state,Hn(n,e,this.definition.navigationHierarchy)))}requestComment(e){this.#b=typeof e=="string"?e:N(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Dn(this.derivation.actions),anchor:this})}renderReviewPanel(e){return b`<dpk-component-comment-panel
2603
+ >`}}const ws=`script[type="application/json"]:not([${Dr}])`,xu=30,No={width:360,height:480},yu=t=>{try{return t.matches(":popover-open")}catch{return!1}},wu=()=>new Promise(t=>requestAnimationFrame(()=>t()));class $u extends he{static{this.styles=au}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#n=new Fh(this);#s=new Ph(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new Lh(this);#t=new Dh(this);#i=new ou(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new iu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#l=new Uh(this);#a=new bu(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??en(this.definition.name)}:unsent-text`});#c=null;#p=new xh(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??en(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===tn||n.classList.contains("dpk-bell"))),show:e=>{this.#G(e)}});#m={toggleList:()=>this.#p.toggleList(),openList:()=>this.#p.send({kind:"open-list"}),show:e=>this.#p.show(e),dismiss:e=>this.#p.send({kind:"close-toast",key:e}),readAll:()=>this.#p.send({kind:"read-all"}),pause:e=>this.#p.pause(e),resume:e=>this.#p.resume(e)};#k=new Lr(this);#h=!1;#x=new vu(this);#g=new jh(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#d?.setTemplate(this.definition));#u;#d;#f=Un;#b=null;#w=new Set;#A=null;#L;#$;#C;#T=[];#O;#F=new Promise(e=>{this.#O=e});#P;get locale(){return this.#g.locale}get definition(){const e=this.locale;return this.#u?.locale!==e&&(this.#u={locale:e,value:this.definitionFor(e)}),this.#u.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#z(),window.addEventListener("hashchange",this.#j),this.addEventListener("click",this.#H),this.addEventListener("dpk-comment-targets-change",this.#v),this.addEventListener("dpk-comment-request",this.#q),this.addEventListener("dpk-comment-submit",this.#B),this.addEventListener("dpk-element-action",this.#U),this.#C??=new MutationObserver(this.#v),this.#v()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#j),this.removeEventListener("click",this.#H),this.#$?.disconnect(),this.#C?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#v),this.removeEventListener("dpk-comment-request",this.#q),this.removeEventListener("dpk-comment-submit",this.#B),this.removeEventListener("dpk-element-action",this.#U)}#z(e=0){if(this.#d){this.#M();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#z(e+1));return}this.#ne()}#M(){this.#L||(this.#L=this.#d?.subscribe(()=>this.#oe()))}willUpdate(){this.dataset.theme=this.#s.resolve(mt(this.theme))}updated(){this.#le(),this.#ae(),this.#K(),this.#h&&(this.#h=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#P??=this.#te(),this.#P}get controller(){if(!this.#d)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#d}get derivation(){return this.controller.derivation}get navigation(){return this.#f}dispatch(e){const n=this.controller.dispatch(e);return n.ok&&this.#a.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}dispatchBatch(e){const n=this.controller.dispatchBatch(e);return n.ok&&this.#a.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}editComment(e,n){const s=this.controller.editComment(e,n);return s.ok&&this.#a.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#y()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,n={}){const s=Fe(this.#S());this.#f=Hn(this.#f,e,this.definition.navigationHierarchy),this.#E(n.replace??!1);const i=Fe(this.#S());this.requestUpdate(),s!==i&&(this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#S();return Fe(this.definition.resolveNavigation(this.derivation.state,Hn(n,e,this.definition.navigationHierarchy)))}requestComment(e){this.#b=typeof e=="string"?e:N(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Dn(this.derivation.actions),anchor:this})}renderReviewPanel(e){return b`<dpk-component-comment-panel
2604
2604
  .definition=${this.controller.definition}
2605
2605
  .state=${e.state}
2606
2606
  .navigation=${e.navigation}
@@ -2698,8 +2698,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
2698
2698
  </button>`}
2699
2699
  ${this.integratedReview?g:this.#Z(s)} ${this.#V()}
2700
2700
  </div>
2701
- `}#W(){const e=this.#p.view;if(!e)return g;const n=W(this.locale);return b`${mh(e,n,this.#m)}
2702
- ${bh(e,n,this.#m)}`}#V(){const e=this.#p.view;return e?vh(e,W(this.locale),this.#m):g}#K(){const e=this.renderRoot.querySelector(`#${tn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||mu(e)||this.#k.open(e,n,{width:Mo.width,height:Math.min(Mo.height,window.innerHeight-96)})}async#G(e){const n={};this.#c=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,at(e.target))??at(e.target),r=yp({...e,target:i&&N(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;this.showTarget(i);const o=N(i);for(let a=0;a<gu;a+=1){if(await this.updateComplete,await ku(),this.#c!==n)return;const l=Co(this,o);if(!(l===null||l.getClientRects().length===0)){Hh(this,l),Vh(l);return}}}showTarget(e){}#Z(e){const n=ch({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!n)return g;const s=W(this.locale);return b`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
2701
+ `}#W(){const e=this.#p.view;if(!e)return g;const n=W(this.locale);return b`${yh(e,n,this.#m)}
2702
+ ${$h(e,n,this.#m)}`}#V(){const e=this.#p.view;return e?Sh(e,W(this.locale),this.#m):g}#K(){const e=this.renderRoot.querySelector(`#${tn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||yu(e)||this.#k.open(e,n,{width:No.width,height:Math.min(No.height,window.innerHeight-96)})}async#G(e){const n={};this.#c=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,at(e.target))??at(e.target),r=Cp({...e,target:i&&N(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;this.showTarget(i);const o=N(i);for(let a=0;a<xu;a+=1){if(await this.updateComplete,await wu(),this.#c!==n)return;const l=Eo(this,o);if(!(l===null||l.getClientRects().length===0)){Gh(this,l),Jh(l);return}}}showTarget(e){}#Z(e){const n=fh({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!n)return g;const s=W(this.locale);return b`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
2703
2703
  ${n.note?b`<p class="dpk-dock-note" role="alert">${n.note}</p>`:g}
2704
2704
  <div class="dpk-dock-actions">
2705
2705
  ${n.send?b`<button
@@ -2727,7 +2727,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2727
2727
  @change=${os(s=>{const i=kn.find(r=>r===s);i!==void 0&&this.#g.pick(i)})}
2728
2728
  >
2729
2729
  ${kn.map(s=>b`<option value=${s} lang=${s} ?selected=${s===e}>
2730
- ${sc[s]}
2730
+ ${ac[s]}
2731
2731
  </option>`)}
2732
2732
  </select>`}#J(){const e=this.dataset.theme==="dark",n=W(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return b`<button
2733
2733
  class="dpk-theme-toggle"
@@ -2736,8 +2736,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
2736
2736
  title=${s}
2737
2737
  @click=${()=>this.#s.toggle(mt(this.theme))}
2738
2738
  >
2739
- ${e?Fc():Wc()}
2740
- </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}get#X(){return this.#l.narrow&&this.#R&&this.sidebarLayout.narrow!=="stack"}#Q(e,n){const s=this.#R?this.#ee(e,n):g;return e||n?b`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?b`${this.#I()}${s}`:b`${s}${this.#I()}`}#ee(e,n){const s=W(this.locale),i=Jh(this.sidebarLayout.side,e),r=i.action==="collapse"?s.collapseSidebar:s.expandSidebar;return b`<button
2739
+ ${e?Gc():Zc()}
2740
+ </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}get#X(){return this.#l.narrow&&this.#R&&this.sidebarLayout.narrow!=="stack"}#Q(e,n){const s=this.#R?this.#ee(e,n):g;return e||n?b`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?b`${this.#I()}${s}`:b`${s}${this.#I()}`}#ee(e,n){const s=W(this.locale),i=nu(this.sidebarLayout.side,e),r=i.action==="collapse"?s.collapseSidebar:s.expandSidebar;return b`<button
2741
2741
  class="dpk-sidebar-toggle"
2742
2742
  type="button"
2743
2743
  aria-controls="dpk-sidebar"
@@ -2746,7 +2746,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2746
2746
  title=${r}
2747
2747
  @click=${()=>{this.#h=!0,n?this.#o.toggleDrawer():this.#o.toggle()}}
2748
2748
  >
2749
- ${i.points==="left"?dr():Yn()}
2749
+ ${i.points==="left"?hr():Yn()}
2750
2750
  </button>`}#I(){const e=W(this.locale),n=this.#i.handlers;return b`<div
2751
2751
  class="dpk-sidebar-resizer"
2752
2752
  role="separator"
@@ -2763,4 +2763,4 @@ The brief is too long for a comment, so it is stored in this artifact's database
2763
2763
  @pointercancel=${n.pointercancel}
2764
2764
  @keydown=${n.keydown}
2765
2765
  @dblclick=${n.dblclick}
2766
- ></div>`}render(){if(!this.#d)return g;const e=this.#D();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Kh}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#D()}#_(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#F,navigation:()=>this.#S(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#w.add(e),()=>{this.#w.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#te(){return ph(this.#_(),this)}#N(){return lo(this.#_())}#D(){return dh(this.#_())}#S(){return this.definition.resolveNavigation(this.derivation.state,this.#f)}#ne(){const e=this.#ie();this.#f=bo();const n=this.storageKey;this.#d=new ro({definition:this.definition,base:e,storage:this.#se(),...typeof n=="string"?{storageKey:n}:{}}),this.#M(),this.#v(),this.#E(!0),this.#O?.(),this.#re(),this.requestUpdate()}#se(){return this.storage==="off"?null:this.storage==="memory"?new us:fs()}#ie(){const e=this.querySelector(ws);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.#A='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#A=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#re(){this.querySelector(ws)||(this.#$=new MutationObserver(()=>{const e=this.querySelector(ws);if(e){this.#$?.disconnect(),this.#$=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#$.observe(this,{childList:!0,subtree:!0}))}#y(){const e=this.#N();for(const n of this.#w)n(e)}#oe(){if(!this.isConnected){this.requestUpdate(),this.#y();return}this.#E(!0),ko(this.#T,this.controller.actions),queueMicrotask(this.#v),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#N(),bubbles:!0,composed:!0}))}#E(e){const n=this.#S();this.#f=n,Dh(n,e)}#j=()=>{this.#f=bo(),this.#E(!0),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0}))};#v=()=>{this.#C?.disconnect(),this.#T=Rh(this,e=>{this.isConnected&&this.#C?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(ko(this.#T,this.#d.actions),this.#d.setComponentSnapshot(Lh(this.#T)))};#q=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#d)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#v(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#B=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(Cp,e.detail);if(!n.success)return;this.#v();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:D,target:s,payload:{body:i}}).ok&&e.preventDefault()};#U=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(Yl,e.detail);if(!n.success)return;this.#v();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#H=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(qt(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ae(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#le(){this.#n.route()}}export{ft as $,Zn as A,Dc as B,D as C,hr as D,Un as E,X as F,ar as G,cr as H,Gn as I,lr as J,or as K,to as L,us as M,qt as N,at as O,Nl as P,Hn as Q,Dl as R,Dn as S,bu as T,qi as U,N as V,hs as W,Dt as X,Mn as Y,_t as Z,_r as _,jn as a,et as a$,Rt as a0,fa as a1,de as a2,g as a3,b as a4,ct as a5,Nc as a6,Yo as a7,he as a8,Rr as a9,zl as aA,B as aB,Ge as aC,le as aD,rp as aE,os as aF,op as aG,Qt as aH,je as aI,Ud as aJ,Co as aK,Vn as aL,Wn as aM,wo as aN,Ci as aO,Ml as aP,Ol as aQ,He as aR,Zs as aS,Si as aT,_ as aU,rr as aV,nr as aW,sr as aX,mn as aY,ti as aZ,Fd as a_,vn as aa,Uc as ab,Hc as ac,zn as ad,Z as ae,se as af,F as ag,v as ah,Nt as ai,w as aj,S as ak,Ni as al,ji as am,ke as an,me as ao,zi as ap,Yn as aq,Bc as ar,Pn as as,C as at,L as au,Mi as av,On as aw,_i as ax,Ri as ay,Ii as az,Ai as b,At as b0,fn as b1,dr as b2,Ic as b3,Mc as b4,Li as b5,$o as b6,Ti as b7,tr as b8,ir as b9,ro as c,Nn as d,jl as e,Fn as f,Hi as g,lt as h,Qr as i,xn as j,Bi as k,Hl as l,In as m,fs as n,en as o,Il as p,Yc as q,xl as r,Qd as s,eo as t,_e as u,Bl as v,Fe as w,qc as x,jc as y,Bt as z};
2766
+ ></div>`}render(){if(!this.#d)return g;const e=this.#D();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Xh}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#D()}#_(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#F,navigation:()=>this.#S(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#w.add(e),()=>{this.#w.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#te(){return mh(this.#_(),this)}#N(){return po(this.#_())}#D(){return gh(this.#_())}#S(){return this.definition.resolveNavigation(this.derivation.state,this.#f)}#ne(){const e=this.#ie();this.#f=xo();const n=this.storageKey;this.#d=new ao({definition:this.definition,base:e,storage:this.#se(),...typeof n=="string"?{storageKey:n}:{}}),this.#M(),this.#v(),this.#E(!0),this.#O?.(),this.#re(),this.requestUpdate()}#se(){return this.storage==="off"?null:this.storage==="memory"?new us:fs()}#ie(){const e=this.querySelector(ws);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.#A='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#A=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#re(){this.querySelector(ws)||(this.#$=new MutationObserver(()=>{const e=this.querySelector(ws);if(e){this.#$?.disconnect(),this.#$=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#$.observe(this,{childList:!0,subtree:!0}))}#y(){const e=this.#N();for(const n of this.#w)n(e)}#oe(){if(!this.isConnected){this.requestUpdate(),this.#y();return}this.#E(!0),vo(this.#T,this.controller.actions),queueMicrotask(this.#v),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#N(),bubbles:!0,composed:!0}))}#E(e){const n=this.#S();this.#f=n,Hh(n,e)}#j=()=>{this.#f=xo(),this.#E(!0),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#f},bubbles:!0,composed:!0}))};#v=()=>{this.#C?.disconnect(),this.#T=zh(this,e=>{this.isConnected&&this.#C?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(vo(this.#T,this.#d.actions),this.#d.setComponentSnapshot(Ih(this.#T)))};#q=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#d)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#v(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#B=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(Lp,e.detail);if(!n.success)return;this.#v();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:D,target:s,payload:{body:i}}).ok&&e.preventDefault()};#U=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(ec,e.detail);if(!n.success)return;this.#v();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#H=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(qt(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ae(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#le(){this.#n.route()}}export{ft as $,Zn as A,Uc as B,D as C,fr as D,Un as E,X as F,cr as G,pr as H,Gn as I,dr as J,lr as K,so as L,us as M,qt as N,at as O,Bl as P,Hn as Q,Ul as R,Dn as S,$u as T,Ui as U,N as V,hs as W,Dt as X,Mn as Y,_t as Z,Or as _,jn as a,et as a$,Rt as a0,ma as a1,de as a2,g as a3,b as a4,ct as a5,Bc as a6,Xo as a7,he as a8,Lr as a9,Dl as aA,B as aB,Ge as aC,le as aD,cp as aE,os as aF,pp as aG,Qt as aH,Ce as aI,Vd as aJ,Eo as aK,Vn as aL,Wn as aM,So as aN,Ci as aO,jl as aP,Il as aQ,He as aR,Zs as aS,Si as aT,_ as aU,ar as aV,ir as aW,rr as aX,mn as aY,ti as aZ,Gd as a_,vn as aa,Vc as ab,Kc as ac,zn as ad,Z as ae,se as af,F as ag,v as ah,Nt as ai,w as aj,S as ak,ji as al,Bi as am,ke as an,me as ao,Ii as ap,Yn as aq,Wc as ar,Pn as as,C as at,L as au,Ni as av,On as aw,Oi as ax,Ri as ay,Di as az,Ai as b,At as b0,fn as b1,hr as b2,qc as b3,jc as b4,Pi as b5,Li as b6,Ti as b7,_i as b8,dp as b9,Ao as ba,sr as bb,or as bc,ao as c,Nn as d,Hl as e,Fn as f,Wi as g,lt as h,to as i,xn as j,Hi as k,Kl as l,In as m,fs as n,en as o,ql as p,ed as q,wl as r,sp as s,no as t,Le as u,Wl as v,Fe as w,Fc as x,Hc as y,Bt as z};