dev-process-kit 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- const At=globalThis,vn=At.ShadowRoot&&(At.ShadyCSS===void 0||At.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xn=Symbol(),Gs=new WeakMap;let Vs=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==xn)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(vn&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=Gs.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Gs.set(n,e))}return e}toString(){return this.cssText}};const Ks=t=>new Vs(typeof t=="string"?t:t+"",void 0,xn),ue=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,r,i)=>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.")})(r)+t[i+1],t[0]);return new Vs(n,t,xn)},Ra=(t,e)=>{if(vn)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),r=At.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=n.cssText,t.appendChild(s)}},Qs=vn?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return Ks(n)})(t):t,{is:_a,defineProperty:Oa,getOwnPropertyDescriptor:La,getOwnPropertyNames:Pa,getOwnPropertySymbols:za,getPrototypeOf:Ma}=Object,Ct=globalThis,Zs=Ct.trustedTypes,Ia=Zs?Zs.emptyScript:"",Na=Ct.reactiveElementPolyfillSupport,et=(t,e)=>t,yn={toAttribute(t,e){switch(e){case Boolean:t=t?Ia: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}},Ys=(t,e)=>!_a(t,e),Js={attribute:!0,type:String,converter:yn,reflect:!1,useDefault:!1,hasChanged:Ys};Symbol.metadata??=Symbol("metadata"),Ct.litPropertyMetadata??=new WeakMap;let Be=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=Js){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(),r=this.getPropertyDescriptor(e,s,n);r!==void 0&&Oa(this.prototype,e,r)}}static getPropertyDescriptor(e,n,s){const{get:r,set:i}=La(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:r,set(o){const a=r?.call(this);i?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Js}static _$Ei(){if(this.hasOwnProperty(et("elementProperties")))return;const e=Ma(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(et("properties"))){const n=this.properties,s=[...Pa(n),...za(n)];for(const r of s)this.createProperty(r,n[r])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,r]of n)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const r=this._$Eu(n,s);r!==void 0&&this._$Eh.set(r,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 r of s)n.unshift(Qs(r))}else e!==void 0&&n.push(Qs(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 Ra(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),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const i=(s.converter?.toAttribute!==void 0?s.converter:yn).toAttribute(n,s.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,n){const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=s.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:yn;this._$Em=r;const a=o.fromAttribute(n,i.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,n,s,r=!1,i){if(e!==void 0){const o=this.constructor;if(r===!1&&(i=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??Ys)(i,n)||s.useDefault&&s.reflect&&i===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:r,wrapped:i},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),r===!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[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,i]of s){const{wrapped:o}=i,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,i,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){}};Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Be[et("elementProperties")]=new Map,Be[et("finalized")]=new Map,Na?.({ReactiveElement:Be}),(Ct.reactiveElementVersions??=[]).push("2.1.2");const wn=globalThis,Xs=t=>t,Tt=wn.trustedTypes,er=Tt?Tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,tr="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,nr="?"+fe,Da=`<${nr}>`,Se=document,tt=()=>Se.createComment(""),nt=t=>t===null||typeof t!="object"&&typeof t!="function",$n=Array.isArray,ja=t=>$n(t)||typeof t?.[Symbol.iterator]=="function",Sn=`[
2
- \f\r]`,st=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,sr=/-->/g,rr=/>/g,Ae=RegExp(`>|${Sn}(?:([^\\s"'>=/]+)(${Sn}*=${Sn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ir=/'/g,or=/"/g,ar=/^(?:script|style|textarea|title)$/i,lr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),m=lr(1),qa=lr(2),K=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),cr=new WeakMap,Ce=Se.createTreeWalker(Se,129);function dr(t,e){if(!$n(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return er!==void 0?er.createHTML(e):e}const Ba=(t,e)=>{const n=t.length-1,s=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=st;for(let a=0;a<n;a++){const l=t[a];let d,c,p=-1,u=0;for(;u<l.length&&(o.lastIndex=u,c=o.exec(l),c!==null);)u=o.lastIndex,o===st?c[1]==="!--"?o=sr:c[1]!==void 0?o=rr:c[2]!==void 0?(ar.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ae):c[3]!==void 0&&(o=Ae):o===Ae?c[0]===">"?(o=r??st,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,d=c[1],o=c[3]===void 0?Ae:c[3]==='"'?or:ir):o===or||o===ir?o=Ae:o===sr||o===rr?o=st:(o=Ae,r=void 0);const h=o===Ae&&t[a+1].startsWith("/>")?" ":"";i+=o===st?l+Da:p>=0?(s.push(d),l.slice(0,p)+tr+l.slice(p)+fe+h):l+fe+(p===-2?a:h)}return[dr(t,i+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let An=class Ca{constructor({strings:e,_$litType$:n},s){let r;this.parts=[];let i=0,o=0;const a=e.length-1,l=this.parts,[d,c]=Ba(e,n);if(this.el=Ca.createElement(d,s),Ce.currentNode=this.el.content,n===2||n===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Ce.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(tr)){const u=c[o++],h=r.getAttribute(p).split(fe),f=/([.?@])?(.*)/.exec(u);l.push({type:1,index:i,name:f[2],strings:h,ctor:f[1]==="."?Ua:f[1]==="?"?Fa:f[1]==="@"?Wa:Rt}),r.removeAttribute(p)}else p.startsWith(fe)&&(l.push({type:6,index:i}),r.removeAttribute(p));if(ar.test(r.tagName)){const p=r.textContent.split(fe),u=p.length-1;if(u>0){r.textContent=Tt?Tt.emptyScript:"";for(let h=0;h<u;h++)r.append(p[h],tt()),Ce.nextNode(),l.push({type:2,index:++i});r.append(p[u],tt())}}}else if(r.nodeType===8)if(r.data===nr)l.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(fe,p+1))!==-1;)l.push({type:7,index:i}),p+=fe.length-1}i++}}static createElement(e,n){const s=Se.createElement("template");return s.innerHTML=e,s}};function He(t,e,n=t,s){if(e===K)return e;let r=s!==void 0?n._$Co?.[s]:n._$Cl;const i=nt(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=r:n._$Cl=r),r!==void 0&&(e=He(t,r._$AS(t,e.values),r,s)),e}let Ha=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,r=(e?.creationScope??Se).importNode(n,!0);Ce.currentNode=r;let i=Ce.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new Et(i,i.nextSibling,this,e):l.type===1?d=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(d=new Ga(i,this,e)),this._$AV.push(d),l=s[++a]}o!==l?.index&&(i=Ce.nextNode(),o++)}return Ce.currentNode=Se,r}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++}},Et=class Ta{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=r,this._$Cv=r?.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=He(this,e,n),nt(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==K&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ja(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!==k&&nt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Se.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=An.createElement(dr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(n);else{const i=new Ha(r,this),o=i.u(this.options);i.p(n),this.T(o),this._$AH=i}}_$AC(e){let n=cr.get(e.strings);return n===void 0&&cr.set(e.strings,n=new An(e)),n}k(e){$n(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of e)r===n.length?n.push(s=new Ta(this.O(tt()),this.O(tt()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=Xs(e).nextSibling;Xs(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,r,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,n=this,s,r){const i=this.strings;let o=!1;if(i===void 0)e=He(this,e,n,0),o=!nt(e)||e!==this._$AH&&e!==K,o&&(this._$AH=e);else{const a=e;let l,d;for(e=i[0],l=0;l<i.length-1;l++)d=He(this,a[s+l],n,l),d===K&&(d=this._$AH[l]),o||=!nt(d)||d!==this._$AH[l],d===k?e=k:e!==k&&(e+=(d??"")+i[l+1]),this._$AH[l]=d}o&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Ua=class extends Rt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},Fa=class extends Rt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Wa=class extends Rt{constructor(e,n,s,r,i){super(e,n,s,r,i),this.type=5}_$AI(e,n=this){if((e=He(this,e,n,0)??k)===K)return;const s=this._$AH,r=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==k&&(s===k||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class Ga{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){He(this,e)}}const Va={I:Et},Ka=wn.litHtmlPolyfillSupport;Ka?.(An,Et),(wn.litHtmlVersions??=[]).push("3.3.3");const Qa=(t,e,n)=>{const s=n?.renderBefore??e;let r=s._$litPart$;if(r===void 0){const i=n?.renderBefore??null;s._$litPart$=r=new Et(e.insertBefore(tt(),i),i,void 0,n??{})}return r._$AI(t),r},Cn=globalThis;let ge=class extends Be{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=Qa(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}};ge._$litElement$=!0,ge.finalized=!0,Cn.litElementHydrateSupport?.({LitElement:ge});const Za=Cn.litElementPolyfillSupport;Za?.({LitElement:ge}),(Cn.litElementVersions??=[]).push("4.2.2");const me={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},rt=t=>(...e)=>({_$litDirective$:t,values:e});let _t=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:Ya}=Va,pr=t=>t,Ja=t=>t.strings===void 0,hr=()=>document.createComment(""),it=(t,e,n)=>{const s=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(n===void 0){const i=s.insertBefore(hr(),r),o=s.insertBefore(hr(),r);n=new Ya(i,o,t,t.options)}else{const i=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(i!==r||a){let l=n._$AA;for(;l!==i;){const d=pr(l).nextSibling;pr(s).insertBefore(l,r),l=d}}}return n},Te=(t,e,n=t)=>(t._$AI(e,n),t),Xa={},Tn=(t,e=Xa)=>t._$AH=e,el=t=>t._$AH,En=t=>{t._$AR(),t._$AA.remove()},Rn=rt(class extends _t{constructor(t){if(super(t),t.type!==me.PROPERTY&&t.type!==me.ATTRIBUTE&&t.type!==me.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ja(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===K||e===k)return e;const n=t.element,s=t.name;if(t.type===me.PROPERTY){if(e===n[s])return K}else if(t.type===me.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return K}else if(t.type===me.ATTRIBUTE&&n.getAttribute(s)===e+"")return K;return Tn(t),e}});class Ot extends _t{constructor(e){if(super(e),this.it=k,e.type!==me.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===K)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Ot.directiveName="unsafeHTML",Ot.resultType=1;const ur=rt(Ot),Lt=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},_n=["en","ja"],fr="en",gr=t=>_n.some(e=>e===t),Pt=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return gr(e)?e:fr},mr=t=>Pt(Lt(t)),On="dpk-locale-change",kr=t=>typeof t=="string"&&gr(t)?t:null,tl=t=>t.preference??t.authored,nl=(t,e)=>t===e?null:t,zt=t=>e=>e==="ja"?t.ja:t.en;class Ln{#e;#t;#n=fr;constructor(e,n=()=>{}){this.#e=e,this.#t=n,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=mr(this.#e),document.addEventListener(On,this.#r)}hostDisconnected(){document.removeEventListener(On,this.#r)}#r=()=>{const e=mr(this.#e);e!==this.#n&&(this.#n=e,this.#t(),this.#e.requestUpdate())}}const sl={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)"]},br=t=>Ks(Object.entries(sl).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
- `)),Mt=ue`
1
+ const Ct=globalThis,Sn=Ct.ShadowRoot&&(Ct.ShadyCSS===void 0||Ct.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,An=Symbol(),Xs=new WeakMap;let er=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(Sn&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=Xs.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Xs.set(n,e))}return e}toString(){return this.cssText}};const tr=t=>new er(typeof t=="string"?t:t+"",void 0,An),fe=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,r,i)=>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.")})(r)+t[i+1],t[0]);return new er(n,t,An)},Va=(t,e)=>{if(Sn)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),r=Ct.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=n.cssText,t.appendChild(s)}},nr=Sn?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return tr(n)})(t):t,{is:Ka,defineProperty:Qa,getOwnPropertyDescriptor:Za,getOwnPropertyNames:Ya,getOwnPropertySymbols:Ja,getPrototypeOf:Xa}=Object,Et=globalThis,sr=Et.trustedTypes,el=sr?sr.emptyScript:"",tl=Et.reactiveElementPolyfillSupport,tt=(t,e)=>t,Tn={toAttribute(t,e){switch(e){case Boolean:t=t?el: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}},rr=(t,e)=>!Ka(t,e),ir={attribute:!0,type:String,converter:Tn,reflect:!1,useDefault:!1,hasChanged:rr};Symbol.metadata??=Symbol("metadata"),Et.litPropertyMetadata??=new WeakMap;let Be=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=ir){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(),r=this.getPropertyDescriptor(e,s,n);r!==void 0&&Qa(this.prototype,e,r)}}static getPropertyDescriptor(e,n,s){const{get:r,set:i}=Za(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:r,set(o){const a=r?.call(this);i?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ir}static _$Ei(){if(this.hasOwnProperty(tt("elementProperties")))return;const e=Xa(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(tt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tt("properties"))){const n=this.properties,s=[...Ya(n),...Ja(n)];for(const r of s)this.createProperty(r,n[r])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,r]of n)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const r=this._$Eu(n,s);r!==void 0&&this._$Eh.set(r,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 r of s)n.unshift(nr(r))}else e!==void 0&&n.push(nr(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 Va(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),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const i=(s.converter?.toAttribute!==void 0?s.converter:Tn).toAttribute(n,s.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,n){const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=s.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Tn;this._$Em=r;const a=o.fromAttribute(n,i.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,n,s,r=!1,i){if(e!==void 0){const o=this.constructor;if(r===!1&&(i=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??rr)(i,n)||s.useDefault&&s.reflect&&i===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:r,wrapped:i},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),r===!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[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,i]of s){const{wrapped:o}=i,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,i,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){}};Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Be[tt("elementProperties")]=new Map,Be[tt("finalized")]=new Map,tl?.({ReactiveElement:Be}),(Et.reactiveElementVersions??=[]).push("2.1.2");const Cn=globalThis,or=t=>t,Rt=Cn.trustedTypes,ar=Rt?Rt.createPolicy("lit-html",{createHTML:t=>t}):void 0,lr="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,cr="?"+ge,nl=`<${cr}>`,Se=document,nt=()=>Se.createComment(""),st=t=>t===null||typeof t!="object"&&typeof t!="function",En=Array.isArray,sl=t=>En(t)||typeof t?.[Symbol.iterator]=="function",Rn=`[
2
+ \f\r]`,rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dr=/-->/g,pr=/>/g,Ae=RegExp(`>|${Rn}(?:([^\\s"'>=/]+)(${Rn}*=${Rn}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),hr=/'/g,ur=/"/g,fr=/^(?:script|style|textarea|title)$/i,gr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),m=gr(1),rl=gr(2),K=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),mr=new WeakMap,Te=Se.createTreeWalker(Se,129);function kr(t,e){if(!En(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ar!==void 0?ar.createHTML(e):e}const il=(t,e)=>{const n=t.length-1,s=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=rt;for(let a=0;a<n;a++){const l=t[a];let d,c,p=-1,u=0;for(;u<l.length&&(o.lastIndex=u,c=o.exec(l),c!==null);)u=o.lastIndex,o===rt?c[1]==="!--"?o=dr:c[1]!==void 0?o=pr:c[2]!==void 0?(fr.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ae):c[3]!==void 0&&(o=Ae):o===Ae?c[0]===">"?(o=r??rt,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,d=c[1],o=c[3]===void 0?Ae:c[3]==='"'?ur:hr):o===ur||o===hr?o=Ae:o===dr||o===pr?o=rt:(o=Ae,r=void 0);const h=o===Ae&&t[a+1].startsWith("/>")?" ":"";i+=o===rt?l+nl:p>=0?(s.push(d),l.slice(0,p)+lr+l.slice(p)+ge+h):l+ge+(p===-2?a:h)}return[kr(t,i+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let _n=class Fa{constructor({strings:e,_$litType$:n},s){let r;this.parts=[];let i=0,o=0;const a=e.length-1,l=this.parts,[d,c]=il(e,n);if(this.el=Fa.createElement(d,s),Te.currentNode=this.el.content,n===2||n===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Te.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(lr)){const u=c[o++],h=r.getAttribute(p).split(ge),f=/([.?@])?(.*)/.exec(u);l.push({type:1,index:i,name:f[2],strings:h,ctor:f[1]==="."?al:f[1]==="?"?ll:f[1]==="@"?cl:Ot}),r.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:i}),r.removeAttribute(p));if(fr.test(r.tagName)){const p=r.textContent.split(ge),u=p.length-1;if(u>0){r.textContent=Rt?Rt.emptyScript:"";for(let h=0;h<u;h++)r.append(p[h],nt()),Te.nextNode(),l.push({type:2,index:++i});r.append(p[u],nt())}}}else if(r.nodeType===8)if(r.data===cr)l.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(ge,p+1))!==-1;)l.push({type:7,index:i}),p+=ge.length-1}i++}}static createElement(e,n){const s=Se.createElement("template");return s.innerHTML=e,s}};function He(t,e,n=t,s){if(e===K)return e;let r=s!==void 0?n._$Co?.[s]:n._$Cl;const i=st(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=r:n._$Cl=r),r!==void 0&&(e=He(t,r._$AS(t,e.values),r,s)),e}let ol=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,r=(e?.creationScope??Se).importNode(n,!0);Te.currentNode=r;let i=Te.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new _t(i,i.nextSibling,this,e):l.type===1?d=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(d=new dl(i,this,e)),this._$AV.push(d),l=s[++a]}o!==l?.index&&(i=Te.nextNode(),o++)}return Te.currentNode=Se,r}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 Wa{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=r,this._$Cv=r?.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=He(this,e,n),st(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==K&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):sl(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!==k&&st(this._$AH)?this._$AA.nextSibling.data=e:this.T(Se.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=_n.createElement(kr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(n);else{const i=new ol(r,this),o=i.u(this.options);i.p(n),this.T(o),this._$AH=i}}_$AC(e){let n=mr.get(e.strings);return n===void 0&&mr.set(e.strings,n=new _n(e)),n}k(e){En(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of e)r===n.length?n.push(s=new Wa(this.O(nt()),this.O(nt()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=or(e).nextSibling;or(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Ot{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,r,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,n=this,s,r){const i=this.strings;let o=!1;if(i===void 0)e=He(this,e,n,0),o=!st(e)||e!==this._$AH&&e!==K,o&&(this._$AH=e);else{const a=e;let l,d;for(e=i[0],l=0;l<i.length-1;l++)d=He(this,a[s+l],n,l),d===K&&(d=this._$AH[l]),o||=!st(d)||d!==this._$AH[l],d===k?e=k:e!==k&&(e+=(d??"")+i[l+1]),this._$AH[l]=d}o&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let al=class extends Ot{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},ll=class extends Ot{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},cl=class extends Ot{constructor(e,n,s,r,i){super(e,n,s,r,i),this.type=5}_$AI(e,n=this){if((e=He(this,e,n,0)??k)===K)return;const s=this._$AH,r=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==k&&(s===k||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class dl{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){He(this,e)}}const pl={I:_t},hl=Cn.litHtmlPolyfillSupport;hl?.(_n,_t),(Cn.litHtmlVersions??=[]).push("3.3.3");const ul=(t,e,n)=>{const s=n?.renderBefore??e;let r=s._$litPart$;if(r===void 0){const i=n?.renderBefore??null;s._$litPart$=r=new _t(e.insertBefore(nt(),i),i,void 0,n??{})}return r._$AI(t),r},On=globalThis;let me=class extends Be{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=ul(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}};me._$litElement$=!0,me.finalized=!0,On.litElementHydrateSupport?.({LitElement:me});const fl=On.litElementPolyfillSupport;fl?.({LitElement:me}),(On.litElementVersions??=[]).push("4.2.2");const ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},it=t=>(...e)=>({_$litDirective$:t,values:e});let Lt=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:gl}=pl,br=t=>t,ml=t=>t.strings===void 0,vr=()=>document.createComment(""),ot=(t,e,n)=>{const s=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(n===void 0){const i=s.insertBefore(vr(),r),o=s.insertBefore(vr(),r);n=new gl(i,o,t,t.options)}else{const i=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(i!==r||a){let l=n._$AA;for(;l!==i;){const d=br(l).nextSibling;br(s).insertBefore(l,r),l=d}}}return n},Ce=(t,e,n=t)=>(t._$AI(e,n),t),kl={},Ln=(t,e=kl)=>t._$AH=e,bl=t=>t._$AH,Pn=t=>{t._$AR(),t._$AA.remove()},zn=it(class extends Lt{constructor(t){if(super(t),t.type!==ke.PROPERTY&&t.type!==ke.ATTRIBUTE&&t.type!==ke.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ml(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===K||e===k)return e;const n=t.element,s=t.name;if(t.type===ke.PROPERTY){if(e===n[s])return K}else if(t.type===ke.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return K}else if(t.type===ke.ATTRIBUTE&&n.getAttribute(s)===e+"")return K;return Ln(t),e}});class Pt extends Lt{constructor(e){if(super(e),this.it=k,e.type!==ke.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===K)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Pt.directiveName="unsafeHTML",Pt.resultType=1;const xr=it(Pt),zt=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},Mn=["en","ja"],yr="en",wr=t=>Mn.some(e=>e===t),Mt=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return wr(e)?e:yr},$r=t=>Mt(zt(t)),In="dpk-locale-change",Sr=t=>typeof t=="string"&&wr(t)?t:null,vl=t=>t.preference??t.authored,xl=(t,e)=>t===e?null:t,It=t=>e=>e==="ja"?t.ja:t.en;class Nn{#e;#t;#n=yr;constructor(e,n=()=>{}){this.#e=e,this.#t=n,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=$r(this.#e),document.addEventListener(In,this.#r)}hostDisconnected(){document.removeEventListener(In,this.#r)}#r=()=>{const e=$r(this.#e);e!==this.#n&&(this.#n=e,this.#t(),this.#e.requestUpdate())}}const yl={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)"]},Ar=t=>tr(Object.entries(yl).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
4
+ `)),Nt=fe`
5
5
  :host {
6
6
  /* Browsers without light-dark() stay light. */
7
- ${br(t=>t)}
7
+ ${Ar(t=>t)}
8
8
  --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
9
  --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
10
  --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
@@ -42,7 +42,7 @@ const At=globalThis,vn=At.ShadowRoot&&(At.ShadyCSS===void 0||At.ShadyCSS.nativeS
42
42
 
43
43
  @supports (color: light-dark(#000, #fff)) {
44
44
  :host {
45
- ${br((t,e)=>`light-dark(${t}, ${e})`)}
45
+ ${Ar((t,e)=>`light-dark(${t}, ${e})`)}
46
46
  }
47
47
  }
48
48
 
@@ -95,7 +95,7 @@ const At=globalThis,vn=At.ShadowRoot&&(At.ShadyCSS===void 0||At.ShadyCSS.nativeS
95
95
  transition-duration: 1ms !important;
96
96
  }
97
97
  }
98
- `,Pn=ue`
98
+ `,Dn=fe`
99
99
  .dpk-btn {
100
100
  display: inline-flex;
101
101
  align-items: center;
@@ -328,7 +328,7 @@ const At=globalThis,vn=At.ShadowRoot&&(At.ShadyCSS===void 0||At.ShadyCSS.nativeS
328
328
  min-height: 64px;
329
329
  line-height: 1.55;
330
330
  }
331
- `,rl=ue`
331
+ `,wl=fe`
332
332
  .comment-pop {
333
333
  box-sizing: border-box;
334
334
  overflow: auto;
@@ -447,7 +447,7 @@ const At=globalThis,vn=At.ShadowRoot&&(At.ShadyCSS===void 0||At.ShadyCSS.nativeS
447
447
  align-items: center;
448
448
  justify-content: flex-end;
449
449
  }
450
- `,vr=ue`
450
+ `,Tr=fe`
451
451
  .dpk-prose {
452
452
  overflow-wrap: anywhere;
453
453
  }
@@ -554,14 +554,14 @@ const At=globalThis,vn=At.ShadowRoot&&(At.ShadyCSS===void 0||At.ShadyCSS.nativeS
554
554
  .dpk-prose img {
555
555
  max-width: 100%;
556
556
  }
557
- `,Ee=(t,e)=>t instanceof e?t:null;function zn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Re=zn();function xr(t){Re=t}var _e={exec:()=>null};function Ue(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),r=e[s];return r||(r=t(s),e[s]=r),r}}function w(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(M.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,e)};return s}var il=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),M={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:Ue(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ue(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:</?(?:${at})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}>`))},ol=/^(?:[ \t]*(?:\n|$))+/,al=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ll=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ot=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,yr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wr=w(yr).replace(/bull/g,Mn).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(),dl=w(yr).replace(/bull/g,Mn).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(),In=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,pl=/^[^\n]+/,Nn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hl=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Nn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ul=w(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Mn).getRegex(),at="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",Dn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fl=w("^ {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",Dn).replace("tag",at).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$r=t=>w(In).replace("hr",ot).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",at).getRegex(),gl=$r(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ml=$r(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),kl=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ml).getRegex(),jn={blockquote:kl,code:al,def:hl,fences:ll,heading:cl,hr:ot,html:fl,lheading:wr,list:ul,newline:ol,paragraph:gl,table:_e,text:pl},Sr=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ot).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",at).getRegex(),bl={...jn,lheading:dl,table:Sr,paragraph:w(In).replace("hr",ot).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sr).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",at).getRegex()},vl={...jn,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Dn).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:_e,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(In).replace("hr",ot).replace("heading",` *#{1,6} *[^
558
- ]`).replace("lheading",wr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ar=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,wl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ie=/[\p{P}\p{S}]/u,Fe=/[\s\p{P}\p{S}]/u,lt=/[^\s\p{P}\p{S}]/u,$l=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Fe).getRegex(),Sl=/[\p{Pi}\p{Ps}"']/u,Cr=/(?!~)[\p{P}\p{S}]/u,Al=/(?!~)[\s\p{P}\p{S}]/u,Cl=/(?:[^\s\p{P}\p{S}]|~)/u,Tl=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",il?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Tr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,El=w(Tr,"u").replace(/punct/g,ie).getRegex(),Rl=w(Tr,"u").replace(/punct/g,Cr).getRegex(),_l=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ol=w(_l,"u").replace(/openQuote/g,Sl).replace(/punct/g,ie).getRegex(),Er="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ll=w(Er,"gu").replace(/notPunctSpace/g,lt).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),Pl=w(Er,"gu").replace(/notPunctSpace/g,Cl).replace(/punctSpace/g,Al).replace(/punct/g,Cr).getRegex(),zl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ml=w(zl,"gu").replace(/notPunctSpace/g,lt).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),Il=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lt).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),Nl="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Dl=w(Nl,"gu").replace(/notPunctSpace/g,lt).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),jl=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ie).getRegex(),ql="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Bl=w(ql,"gu").replace(/notPunctSpace/g,lt).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),Hl=w(/\\(punct)/,"gu").replace(/punct/g,ie).getRegex(),Ul=w(/^<(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(),Fl=w(Dn).replace("(?:-->|$)","-->").getRegex(),Wl=w("^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",Fl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Rr=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,It=w(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Rr).getRegex(),Gl=w(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",It).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vl=w(/^!?\[(label)\]\[(ref)\]/).replace("label",It).replace("ref",Nn).getRegex(),Kl=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Nn).getRegex(),_r=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Ql=w(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Rr).getRegex(),Zl=w("reflink|nolink(?!\\()","g").replace("reflink",w(/^!?\[(label)\]\[(ref)\]/).replace("label",Ql).replace("ref",_r).getRegex()).replace("nolink",w(/^!?\[(ref)\](?:\[\])?/).replace("ref",_r).getRegex()).getRegex(),Or=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Yl=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Jl=w(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Yl).getRegex(),qn={_backpedal:_e,anyPunctuation:Hl,autolink:Ul,blockSkip:Tl,br:Ar,code:yl,del:_e,delLDelim:_e,delRDelim:_e,emStrongLDelim:El,emStrongRDelimAst:Ll,emStrongRDelimUnd:Il,escape:xl,link:Gl,nolink:Kl,punctuation:$l,reflink:Vl,reflinkSearch:Zl,tag:Wl,text:wl,url:_e},Xl={...qn,emStrongLDelim:Ol,emStrongRDelimAst:Ml,emStrongRDelimUnd:Dl,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",It).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",It).getRegex()},Bn={...qn,emStrongRDelimAst:Pl,emStrongLDelim:Rl,delLDelim:jl,delRDelim:Bl,url:w(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Jl).replace("protocol",Or).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:w(/^(?:[^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",Or).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},ec={...Bn,br:w(Ar).replace("{2,}","*").getRegex(),text:w(Bn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Nt={normal:jn,gfm:bl,pedantic:vl},ct={normal:qn,gfm:Bn,breaks:ec,pedantic:Xl},tc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Lr=t=>tc[t];function W(t,e){if(e){if(M.escapeTest.test(t))return t.replace(M.escapeReplace,Lr)}else if(M.escapeTestNoEncode.test(t))return t.replace(M.escapeReplaceNoEncode,Lr);return t}function nc(t){return t.replace(M.numericCharacterReference,(e,n,s)=>{let r=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function Pr(t){try{t=encodeURI(t).replace(M.percentDecode,"%")}catch{return null}return t}function zr(t,e){let n=t.replace(M.findPipe,(i,o,a)=>{let l=!1,d=o;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),s=n.split(M.splitPipe),r=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(;r<s.length;r++)s[r]=s[r].trim().replace(M.slashPipe,"|");return s}function ke(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function Mr(t){let e=t.split(`
559
- `),n=e.length-1;for(;n>=0&&M.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
560
- `)}function Dt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Ir(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 Nr(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=r,n++;return s}function Dr(t,e,n,s,r){let i=e.href,o=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let d=s.state.linkEmitted,c=s.state.inRawBlock;s.state.linkEmitted=!1;let p=s.inlineTokens(a),u=s.state.linkEmitted;if(s.state.linkEmitted=d,s.state.inLink=!1,!l){if(u){s.state.inRawBlock=c;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:i,title:o,text:a,tokens:p}}function sc(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
557
+ `,Ee=(t,e)=>t instanceof e?t:null;function jn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Re=jn();function Cr(t){Re=t}var _e={exec:()=>null};function Ue(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),r=e[s];return r||(r=t(s),e[s]=r),r}}function w(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(N.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,e)};return s}var $l=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ue(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:</?(?:${lt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}>`))},Sl=/^(?:[ \t]*(?:\n|$))+/,Al=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Tl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,at=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Cl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Er=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rr=w(Er).replace(/bull/g,qn).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(),El=w(Er).replace(/bull/g,qn).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(),Bn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Rl=/^[^\n]+/,Hn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,_l=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ol=w(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,qn).getRegex(),lt="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",Un=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ll=w("^ {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",Un).replace("tag",lt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_r=t=>w(Bn).replace("hr",at).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",lt).getRegex(),Pl=_r(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),zl=_r(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ml=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",zl).getRegex(),Fn={blockquote:Ml,code:Al,def:_l,fences:Tl,heading:Cl,hr:at,html:Ll,lheading:Rr,list:Ol,newline:Sl,paragraph:Pl,table:_e,text:Rl},Or=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",at).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",lt).getRegex(),Il={...Fn,lheading:El,table:Or,paragraph:w(Bn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Or).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",lt).getRegex()},Nl={...Fn,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Un).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:_e,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(Bn).replace("hr",at).replace("heading",` *#{1,6} *[^
558
+ ]`).replace("lheading",Rr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Dl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lr=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ql=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ie=/[\p{P}\p{S}]/u,Fe=/[\s\p{P}\p{S}]/u,ct=/[^\s\p{P}\p{S}]/u,Bl=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Fe).getRegex(),Hl=/[\p{Pi}\p{Ps}"']/u,Pr=/(?!~)[\p{P}\p{S}]/u,Ul=/(?!~)[\s\p{P}\p{S}]/u,Fl=/(?:[^\s\p{P}\p{S}]|~)/u,Wl=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$l?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),zr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Gl=w(zr,"u").replace(/punct/g,ie).getRegex(),Vl=w(zr,"u").replace(/punct/g,Pr).getRegex(),Kl=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Ql=w(Kl,"u").replace(/openQuote/g,Hl).replace(/punct/g,ie).getRegex(),Mr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Zl=w(Mr,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),Yl=w(Mr,"gu").replace(/notPunctSpace/g,Fl).replace(/punctSpace/g,Ul).replace(/punct/g,Pr).getRegex(),Jl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Xl=w(Jl,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),ec=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),tc="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",nc=w(tc,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),sc=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ie).getRegex(),rc="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ic=w(rc,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ie).getRegex(),oc=w(/\\(punct)/,"gu").replace(/punct/g,ie).getRegex(),ac=w(/^<(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(),lc=w(Un).replace("(?:-->|$)","-->").getRegex(),cc=w("^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",lc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ir=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Dt=w(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Ir).getRegex(),dc=w(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Dt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pc=w(/^!?\[(label)\]\[(ref)\]/).replace("label",Dt).replace("ref",Hn).getRegex(),hc=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hn).getRegex(),Nr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,uc=w(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Ir).getRegex(),fc=w("reflink|nolink(?!\\()","g").replace("reflink",w(/^!?\[(label)\]\[(ref)\]/).replace("label",uc).replace("ref",Nr).getRegex()).replace("nolink",w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Nr).getRegex()).getRegex(),Dr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gc=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,mc=w(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,gc).getRegex(),Wn={_backpedal:_e,anyPunctuation:oc,autolink:ac,blockSkip:Wl,br:Lr,code:jl,del:_e,delLDelim:_e,delRDelim:_e,emStrongLDelim:Gl,emStrongRDelimAst:Zl,emStrongRDelimUnd:ec,escape:Dl,link:dc,nolink:hc,punctuation:Bl,reflink:pc,reflinkSearch:fc,tag:cc,text:ql,url:_e},kc={...Wn,emStrongLDelim:Ql,emStrongRDelimAst:Xl,emStrongRDelimUnd:nc,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",Dt).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dt).getRegex()},Gn={...Wn,emStrongRDelimAst:Yl,emStrongLDelim:Vl,delLDelim:sc,delRDelim:ic,url:w(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",mc).replace("protocol",Dr).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:w(/^(?:[^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",Dr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},bc={...Gn,br:w(Lr).replace("{2,}","*").getRegex(),text:w(Gn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jt={normal:Fn,gfm:Il,pedantic:Nl},dt={normal:Wn,gfm:Gn,breaks:bc,pedantic:kc},vc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},jr=t=>vc[t];function W(t,e){if(e){if(N.escapeTest.test(t))return t.replace(N.escapeReplace,jr)}else if(N.escapeTestNoEncode.test(t))return t.replace(N.escapeReplaceNoEncode,jr);return t}function xc(t){return t.replace(N.numericCharacterReference,(e,n,s)=>{let r=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function qr(t){try{t=encodeURI(t).replace(N.percentDecode,"%")}catch{return null}return t}function Br(t,e){let n=t.replace(N.findPipe,(i,o,a)=>{let l=!1,d=o;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),s=n.split(N.splitPipe),r=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(;r<s.length;r++)s[r]=s[r].trim().replace(N.slashPipe,"|");return s}function be(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function Hr(t){let e=t.split(`
559
+ `),n=e.length-1;for(;n>=0&&N.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
560
+ `)}function qt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Ur(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 Fr(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=r,n++;return s}function Wr(t,e,n,s,r){let i=e.href,o=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let d=s.state.linkEmitted,c=s.state.inRawBlock;s.state.linkEmitted=!1;let p=s.inlineTokens(a),u=s.state.linkEmitted;if(s.state.linkEmitted=d,s.state.inLink=!1,!l){if(u){s.state.inRawBlock=c;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:i,title:o,text:a,tokens:p}}function yc(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
561
561
  `).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[a]=o;return i.slice(Math.min(a.length,r.length))}).join(`
562
- `)}function jr(t,e,n,s){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=s.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(n+r),o=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(o){if(o[0].length>e.length-r)return!0;r+=o[0].length-1}}return!1}var jt=class{options;rules;lexer;constructor(t){this.options=t||Re}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]:Mr(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=sc(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=ke(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:ke(e[0],`
563
- `),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:ke(e[0],`
564
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ke(e[0],`
562
+ `)}function Gr(t,e,n,s){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=s.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(n+r),o=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(o){if(o[0].length>e.length-r)return!0;r+=o[0].length-1}}return!1}var Bt=class{options;rules;lexer;constructor(t){this.options=t||Re}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]:Hr(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=yc(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=be(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:be(e[0],`
563
+ `),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:be(e[0],`
564
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=be(e[0],`
565
565
  `).split(`
566
566
  `),s="",r="",i=[];for(;n.length>0;){let o=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),o=!0;else if(!o)a.push(n[l]);else break;n=n.slice(l);let d=a.join(`
567
567
  `),c=d.replace(this.rules.other.blockquoteSetextReplace,`
@@ -570,25 +570,25 @@ ${d}`:d,r=r?`${r}
570
570
  ${c}`:c;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=p,n.length===0)break;let u=i.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let h=u,f=n.join(`
571
571
  `),g=h.raw+`
572
572
  `+f.replace(this.rules.other.blockquoteSetextReplace2,""),b=this.blockquote(g);i[i.length-1]=b;let x=g.substring(b.raw.length).replace(/^\n/,""),S=x?x.split(`
573
- `).length:0,A=S?n.slice(0,-S):n;A.length>0&&(s=`${s}
574
- ${A.join(`
573
+ `).length:0,T=S?n.slice(0,-S):n;T.length>0&&(s=`${s}
574
+ ${T.join(`
575
575
  `)}`),r=r.substring(0,r.length-h.text.length)+b.text;break}else if(u?.type==="list"){let h=u,f=h.raw+`
576
576
  `+n.join(`
577
577
  `),g=this.list(f);i[i.length-1]=g,s=s.substring(0,s.length-u.raw.length)+g.raw,r=r.substring(0,r.length-h.raw.length)+g.raw,n=f.substring(i.at(-1).raw.length).split(`
578
578
  `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,r={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 i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,d="",c="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let p=e[2].split(`
579
- `,1)[0],u=e[1].length,h=this.options.pedantic?Nr(p,u):p.replace(this.rules.other.leadingSpaceTab,x=>Nr(x,u)),f=t.split(`
579
+ `,1)[0],u=e[1].length,h=this.options.pedantic?Fr(p,u):p.replace(this.rules.other.leadingSpaceTab,x=>Fr(x,u)),f=t.split(`
580
580
  `,1)[0],g=!h.trim(),b=0;if(this.options.pedantic?(b=2,c=h.trimStart()):g?b=u+1:(b=h.search(this.rules.other.nonSpaceChar),b=b>4?1:b,c=h.slice(b),b+=u),g&&this.rules.other.blankLine.test(f)&&(d+=f+`
581
- `,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),A=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),H=this.rules.other.htmlBeginRegex(b),L=this.rules.other.blockquoteBeginRegex(b);for(;t;){let V=t.split(`
582
- `,1)[0],q;if(f=V,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),q=f):q=f.replace(this.rules.other.leadingSpaceTab,re=>re.replace(this.rules.other.tabCharGlobal," ")),A.test(f)||_.test(f)||H.test(f)||L.test(f)||x.test(f)||S.test(f))break;if(q.search(this.rules.other.nonSpaceChar)>=b||!f.trim())c+=`
583
- `+q.slice(b);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(h)||_.test(h)||S.test(h))break;c+=`
581
+ `,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),T=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),H=this.rules.other.htmlBeginRegex(b),P=this.rules.other.blockquoteBeginRegex(b);for(;t;){let V=t.split(`
582
+ `,1)[0],q;if(f=V,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),q=f):q=f.replace(this.rules.other.leadingSpaceTab,re=>re.replace(this.rules.other.tabCharGlobal," ")),T.test(f)||_.test(f)||H.test(f)||P.test(f)||x.test(f)||S.test(f))break;if(q.search(this.rules.other.nonSpaceChar)>=b||!f.trim())c+=`
583
+ `+q.slice(b);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(h)||_.test(h)||S.test(h))break;c+=`
584
584
  `+f}g=!f.trim(),d+=V+`
585
- `,t=t.substring(V.length+1),h=q.slice(b)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),r.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=d}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let d=l.tokens.filter(p=>p.type==="space"),c=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=c}for(let l of r.items){let d=l.tokens[0];if(l.task&&(d?.type==="text"||d?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let p={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=p.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let d of l.tokens)d.type==="text"&&(d.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Mr(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])&&Ir(e[2],"()")!==-1)return;let n=Dt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:ke(e[0],`
586
- `),href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=zr(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
587
- `):[],i={type:"table",raw:ke(e[0],`
588
- `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of r)i.rows.push(zr(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:ke(e[0],`
585
+ `,t=t.substring(V.length+1),h=q.slice(b)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),r.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=d}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let d=l.tokens.filter(p=>p.type==="space"),c=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=c}for(let l of r.items){let d=l.tokens[0];if(l.task&&(d?.type==="text"||d?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let p={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=p.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let d of l.tokens)d.type==="text"&&(d.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Hr(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])&&Ur(e[2],"()")!==-1)return;let n=qt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:be(e[0],`
586
+ `),href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Br(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
587
+ `):[],i={type:"table",raw:be(e[0],`
588
+ `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of r)i.rows.push(Br(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:be(e[0],`
589
589
  `),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)===`
590
- `?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&&jr(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=ke(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=Ir(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 r=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),Dr(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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&&jr(t,n[1],s,this.rules))return;let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Dt(r)];if(!i){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Dr(n,i,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 r=[...s[0]].length-1,i,o,a=r,l=0,d=s[0][0],c=n===d,p=d==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+r);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(r%3&&!((r+o)%3)){l+=o;continue}if(c)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let u=[...s[0]][0].length,h=t.slice(0,r+s.index+u+o);if(Math.min(r,o)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let f=h.slice(2,-2);return{type:"strong",raw:h,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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(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 r=[...s[0]].length-1,i,o,a=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(s=l.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(o=[...i].length,o!==r))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let d=[...s[0]][0].length,c=t.slice(0,r+s.index+d+o),p=c.slice(r,-r);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}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 r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==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]:nc(e[0]),escaped:n}}}},Z=class Bs{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Re,this.options.tokenizer=this.options.tokenizer||new jt,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:M,block:Nt.normal,inline:ct.normal};this.options.pedantic?(n.block=Nt.pedantic,n.inline=ct.pedantic):this.options.gfm&&(n.block=Nt.gfm,this.options.breaks?n.inline=ct.breaks:n.inline=ct.gfm),this.tokenizer.rules=n}static get rules(){return{block:Nt,inline:ct}}static lex(e,n){return new Bs(n).lex(e)}static lexInline(e,n){return new Bs(n).inlineTokens(e)}lex(e){e=e.replace(M.carriageReturn,`
591
- `),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(M.tabCharGlobal," ").replace(M.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
590
+ `?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&&Gr(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=be(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=Ur(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 r=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),Wr(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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&&Gr(t,n[1],s,this.rules))return;let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[qt(r)];if(!i){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Wr(n,i,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 r=[...s[0]].length-1,i,o,a=r,l=0,d=s[0][0],c=n===d,p=d==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+r);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(r%3&&!((r+o)%3)){l+=o;continue}if(c)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let u=[...s[0]][0].length,h=t.slice(0,r+s.index+u+o);if(Math.min(r,o)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let f=h.slice(2,-2);return{type:"strong",raw:h,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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(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 r=[...s[0]].length-1,i,o,a=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(s=l.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(o=[...i].length,o!==r))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let d=[...s[0]][0].length,c=t.slice(0,r+s.index+d+o),p=c.slice(r,-r);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}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 r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==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]:xc(e[0]),escaped:n}}}},Y=class Ks{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Re,this.options.tokenizer=this.options.tokenizer||new Bt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:N,block:jt.normal,inline:dt.normal};this.options.pedantic?(n.block=jt.pedantic,n.inline=dt.pedantic):this.options.gfm&&(n.block=jt.gfm,this.options.breaks?n.inline=dt.breaks:n.inline=dt.gfm),this.tokenizer.rules=n}static get rules(){return{block:jt,inline:dt}}static lex(e,n){return new Ks(n).lex(e)}static lexInline(e,n){return new Ks(n).inlineTokens(e)}lex(e){e=e.replace(N.carriageReturn,`
591
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(N.tabCharGlobal," ").replace(N.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
592
592
  `:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
593
593
  `)?"":`
594
594
  `)+i.raw,a.text+=`
@@ -601,7 +601,7 @@ ${A.join(`
601
601
  `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
602
602
  `)?"":`
603
603
  `)+i.raw,a.text+=`
604
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);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 r=s[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Dt(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-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=d=>{let c=d.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Dt(d.slice(c+1,-1))))return d;if(c>1&&d.charAt(0)!=="!"){let p=d.slice(1,c-1);if(this.linkInText(p))return"["+p.replace(a,l)+"]["+"a".repeat(d.length-c-2)+"]"}return"["+"a".repeat(d.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,d)=>{let c=d?d.length:0;return a.slice(0,c)+"["+"a".repeat(a.length-c-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,i="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let a;if(this.options.extensions?.inline?.some(d=>(a=d.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 d=n.at(-1);a.type==="text"&&d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){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,i)){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 d=1/0,c=e.slice(1),p;this.options.extensions.startInline.forEach(u=>{p=u.call({lexer:this},c),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(l=e.substring(0,d+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),r=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=a.raw,d.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)}},qt=class{options;parser;constructor(t){this.options=t||Re}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(M.notSpaceStart)?.[0],r=t?t.replace(M.endingNewline,"")+`
604
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);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 r=s[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,qt(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-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=d=>{let c=d.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,qt(d.slice(c+1,-1))))return d;if(c>1&&d.charAt(0)!=="!"){let p=d.slice(1,c-1);if(this.linkInText(p))return"["+p.replace(a,l)+"]["+"a".repeat(d.length-c-2)+"]"}return"["+"a".repeat(d.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,d)=>{let c=d?d.length:0;return a.slice(0,c)+"["+"a".repeat(a.length-c-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,i="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let a;if(this.options.extensions?.inline?.some(d=>(a=d.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 d=n.at(-1);a.type==="text"&&d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){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,i)){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 d=1/0,c=e.slice(1),p;this.options.extensions.startInline.forEach(u=>{p=u.call({lexer:this},c),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(l=e.substring(0,d+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),r=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=a.raw,d.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)}},Ht=class{options;parser;constructor(t){this.options=t||Re}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(N.notSpaceStart)?.[0],r=t?t.replace(N.endingNewline,"")+`
605
605
  `:"";return s?'<pre><code class="language-'+W(s)+'">'+(n?r:W(r,!0))+`</code></pre>
606
606
  `:"<pre><code>"+(n?r:W(r,!0))+`</code></pre>
607
607
  `}blockquote({tokens:t}){return`<blockquote>
@@ -619,8 +619,8 @@ ${this.parser.parse(t)}</blockquote>
619
619
  `}tablerow({text:t}){return`<tr>
620
620
  ${t}</tr>
621
621
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
622
- `}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>${W(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:r}){let i=r?W(n,!0):this.parser.parseInline(s),o=Pr(t);if(o===null)return i;t=W(o,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+W(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Pr(t);if(r===null)return W(n);t=r;let i=`<img src="${W(t)}" alt="${W(n)}"`;return e&&(i+=` title="${W(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:W(t.text)}},Hn=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}},Y=class Hs{options;renderer;textRenderer;constructor(e){this.options=e||Re,this.options.renderer=this.options.renderer||new qt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Hn}static parse(e,n){return new Hs(n).parse(e)}static parseInline(e,n){return new Hs(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let o=r,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 i=r;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let o='Token with "'+i.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 r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let o=i;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}},dt=class{options;block;constructor(t){this.options=t||Re}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?Z.lex:Z.lexInline}provideParser(t=this.block){return t?Y.parse:Y.parseInline}},qr=class{defaults=zn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=qt;TextRenderer=Hn;Lexer=Z;Tokenizer=jt;Hooks=dt;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 r=s;for(let i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let o=r[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new qt(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],l=r[o];r[o]=(...d)=>{let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new jt(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],l=r[o];r[o]=(...d)=>{let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new dt;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],l=r[o];dt.passThroughHooks.has(i)?r[o]=d=>{if(this.defaults.async&&dt.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await a.call(r,d);return l.call(r,p)})();let c=a.call(r,d);return l.call(r,c)}:r[o]=(...d)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(r,d);return p===!1&&(p=await l.apply(r,d)),p})();let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Z.lex(t,e??this.defaults)}parser(t,e){return Y.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(t):t?Z.lex:Z.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser(t):t?Y.parse:Y.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer(t):t?Z.lex:Z.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(t):t?Y.parse:Y.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
623
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+W(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Oe=new qr;function E(t,e){return Oe.parse(t,e)}E.options=E.setOptions=function(t){return Oe.setOptions(t),E.defaults=Oe.defaults,xr(E.defaults),E},E.getDefaults=zn,E.defaults=Re;function rc(...t){return Oe.use(...t),E.defaults=Oe.defaults,xr(E.defaults),E}E.use=rc,E.walkTokens=function(t,e){return Oe.walkTokens(t,e)},E.parseInline=Oe.parseInline,E.Parser=Y,E.parser=Y.parse,E.Renderer=qt,E.TextRenderer=Hn,E.Lexer=Z,E.lexer=Z.lex,E.Tokenizer=jt,E.Hooks=dt,E.parse=E,E.options,E.setOptions,E.walkTokens,E.parseInline,Y.parse,Z.lex;const ic={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Le=t=>t.replace(/[&<>"']/g,e=>ic[e]??e),oc=new Set(["http","https","mailto"]),Br=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||oc.has(n.toLowerCase())},ac=t=>/^https?:/i.test(t.trim()),lc=new qr({gfm:!0,breaks:!0,renderer:{html({text:t}){return Le(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!Br(t))return s;const r=e?` title="${Le(e)}"`:"",i=ac(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Le(t)}"${r}${i}>${s}</a>`},image({href:t,title:e,text:n}){if(!Br(t))return Le(n);const s=e?` title="${Le(e)}"`:"";return`<img src="${Le(t)}" alt="${Le(n)}"${s}>`}}}),Hr=t=>lc.parse(t,{async:!1}),cc=zt({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 Ur extends ge{static{this.styles=[Mt,vr,ue`
622
+ `}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>${W(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:r}){let i=r?W(n,!0):this.parser.parseInline(s),o=qr(t);if(o===null)return i;t=W(o,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+W(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=qr(t);if(r===null)return W(n);t=r;let i=`<img src="${W(t)}" alt="${W(n)}"`;return e&&(i+=` title="${W(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:W(t.text)}},Vn=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}},J=class Qs{options;renderer;textRenderer;constructor(e){this.options=e||Re,this.options.renderer=this.options.renderer||new Ht,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vn}static parse(e,n){return new Qs(n).parse(e)}static parseInline(e,n){return new Qs(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let o=r,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 i=r;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let o='Token with "'+i.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 r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let o=i;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}},pt=class{options;block;constructor(t){this.options=t||Re}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?Y.lex:Y.lexInline}provideParser(t=this.block){return t?J.parse:J.parseInline}},Vr=class{defaults=jn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=J;Renderer=Ht;TextRenderer=Vn;Lexer=Y;Tokenizer=Bt;Hooks=pt;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 r=s;for(let i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let o=r[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new Ht(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],l=r[o];r[o]=(...d)=>{let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Bt(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],l=r[o];r[o]=(...d)=>{let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new pt;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],l=r[o];pt.passThroughHooks.has(i)?r[o]=d=>{if(this.defaults.async&&pt.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await a.call(r,d);return l.call(r,p)})();let c=a.call(r,d);return l.call(r,c)}:r[o]=(...d)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(r,d);return p===!1&&(p=await l.apply(r,d)),p})();let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Y.lex(t,e??this.defaults)}parser(t,e){return J.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(t):t?Y.lex:Y.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser(t):t?J.parse:J.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer(t):t?Y.lex:Y.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(t):t?J.parse:J.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
623
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+W(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Oe=new Vr;function E(t,e){return Oe.parse(t,e)}E.options=E.setOptions=function(t){return Oe.setOptions(t),E.defaults=Oe.defaults,Cr(E.defaults),E},E.getDefaults=jn,E.defaults=Re;function wc(...t){return Oe.use(...t),E.defaults=Oe.defaults,Cr(E.defaults),E}E.use=wc,E.walkTokens=function(t,e){return Oe.walkTokens(t,e)},E.parseInline=Oe.parseInline,E.Parser=J,E.parser=J.parse,E.Renderer=Ht,E.TextRenderer=Vn,E.Lexer=Y,E.lexer=Y.lex,E.Tokenizer=Bt,E.Hooks=pt,E.parse=E,E.options,E.setOptions,E.walkTokens,E.parseInline,J.parse,Y.lex;const $c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Le=t=>t.replace(/[&<>"']/g,e=>$c[e]??e),Sc=new Set(["http","https","mailto"]),Kr=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||Sc.has(n.toLowerCase())},Ac=t=>/^https?:/i.test(t.trim()),Tc=new Vr({gfm:!0,breaks:!0,renderer:{html({text:t}){return Le(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!Kr(t))return s;const r=e?` title="${Le(e)}"`:"",i=Ac(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Le(t)}"${r}${i}>${s}</a>`},image({href:t,title:e,text:n}){if(!Kr(t))return Le(n);const s=e?` title="${Le(e)}"`:"";return`<img src="${Le(t)}" alt="${Le(n)}"${s}>`}}}),Qr=t=>Tc.parse(t,{async:!1}),Cc=It({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 Zr extends me{static{this.styles=[Nt,Tr,fe`
624
624
  /* One atomic box in both states, so the text can be edited where it sits:
625
625
  while editing, the text stays (hidden) underneath and keeps sizing the
626
626
  box, and the field lies over it. Starting an edit moves nothing; the
@@ -750,7 +750,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
750
750
  background: transparent;
751
751
  box-shadow: none;
752
752
  }
753
- `]}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="";#t=0;#n=new Ln(this);connectedCallback(){super.connectedCallback(),this.#t+=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=cc(this.#n.locale),n=this.placeholder||e.unset,{editing:s}=this,r=s?this.#e:this.value,i=r===""?n:s&&r.endsWith(`
753
+ `]}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="";#t=0;#n=new Nn(this);connectedCallback(){super.connectedCallback(),this.#t+=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=Cc(this.#n.locale),n=this.placeholder||e.unset,{editing:s}=this,r=s?this.#e:this.value,i=r===""?n:s&&r.endsWith(`
754
754
  `)?`${r}\u200B`:r;return this.markdown&&!s&&r!==""?m`<span class="box"
755
755
  ><div
756
756
  class="view dpk-prose"
@@ -761,7 +761,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
761
761
  @click=${this.#s}
762
762
  @keydown=${this.#i}
763
763
  >
764
- ${ur(Hr(r))}
764
+ ${xr(Qr(r))}
765
765
  </div></span
766
766
  >`:m`<span class="box"
767
767
  ><span
@@ -778,7 +778,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
778
778
  >`}#r(e,n){return this.multiline||this.wrap?m`<textarea
779
779
  class="field"
780
780
  rows="1"
781
- .value=${Rn(this.#e)}
781
+ .value=${zn(this.#e)}
782
782
  placeholder=${n}
783
783
  aria-label=${e}
784
784
  @input=${this.#o}
@@ -786,27 +786,27 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
786
786
  @blur=${this.#l}
787
787
  ></textarea>`:m`<input
788
788
  class="field"
789
- .value=${Rn(this.#e)}
789
+ .value=${zn(this.#e)}
790
790
  placeholder=${n}
791
791
  aria-label=${e}
792
792
  @input=${this.#o}
793
793
  @keydown=${this.#a}
794
794
  @blur=${this.#l}
795
- />`}#s=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=Ee(e.target,HTMLInputElement)??Ee(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#a=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())}};#l=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#t,{selectionStart:r,selectionEnd:i}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#t?(n.focus(),n.setSelectionRange(r,i)):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 dc=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Ur)},pc={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Un(t){return pc}let hc;function uc(t){return hc?.get(t)}let fc;function gc(t){return fc?.get(t)}let mc;function kc(t,e){return mc?.get(t)?.get(e)}function We(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,r){const i=r&&"input"in r?r.input:n.value,o=r?.expected??t.expects??null,a=r?.received??We(i),l={kind:t.kind,type:t.type,input:i,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},d=t.kind==="schema",c=r?.message??t.message??kc(t.reference,l.lang)??(d?gc(l.lang):null)??s.message??uc(l.lang);c!==void 0&&(l.message=typeof c=="function"?c(l):c),d&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function bc(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function vc(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Fn(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function I(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Un())},t}function xc(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 yc=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const wc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,$c=/^\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 Fr(t,e){return{kind:"validation",type:"check",reference:Fr,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 Wr(t){return{kind:"validation",type:"finite",reference:Wr,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 Gr(t,e){const n=We(t);return{kind:"validation",type:"includes",reference:Gr,async:!1,expects:n,requirement:t,message:e,"~run"(s,r){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,r,{received:`!${n}`}),s}}}function Vr(t){return{kind:"validation",type:"integer",reference:Vr,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 Kr(t){return{kind:"validation",type:"iso_date",reference:Kr,async:!1,expects:null,requirement:wc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"date",e,n),e}}}function Qr(t){return{kind:"validation",type:"iso_timestamp",reference:Qr,async:!1,expects:null,requirement:$c,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"timestamp",e,n),e}}}function $(t,e){return{kind:"validation",type:"min_length",reference:$,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 Zr(t,e){return{kind:"validation",type:"min_value",reference:Zr,async:!1,expects:`>=${t instanceof Date?t.toJSON():We(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():We(n.value)}),n}}}function be(t,e){return{kind:"validation",type:"regex",reference:be,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 Wn(){return{kind:"transformation",type:"trim",reference:Wn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Yr(t){return{kind:"validation",type:"url",reference:Yr,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 Jr={abortEarly:!0};function Xr(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Bt(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Sc(t,e){return!t["~run"]({value:e},Jr).issues}function j(t,e){return I({kind:"schema",type:"array",reference:j,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const r=n.value;if(Array.isArray(r)){n.typed=!0,n.value=[];for(let i=0;i<r.length;i++){const o=r[i],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:r,key:i,value:o};for(const d of a.issues)d.path?d.path.unshift(l):d.path=[l],n.issues?.push(d);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 Gn(t){return I({kind:"schema",type:"boolean",reference:Gn,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function U(t,e){return I({kind:"schema",type:"exact_optional",reference:U,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function ei(t){return I({kind:"schema",type:"lazy",reference:ei,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function G(t,e){return I({kind:"schema",type:"literal",reference:G,expects:We(t),async:!1,literal:t,message:e,"~run"(n,s){return bc(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function ti(t,e){return I({kind:"schema",type:"nullable",reference:ti,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=Bt(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function ni(t){return I({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 O(t,e){return I({kind:"schema",type:"object",reference:O,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=i in r?r[i]:Bt(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=Xr(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function N(t,e){return I({kind:"schema",type:"optional",reference:N,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=Bt(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Ht(t,e){return I({kind:"schema",type:"picklist",reference:Ht,expects:Fn(t.map(We),"|"),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 Ge(t,e,n){return I({kind:"schema",type:"record",reference:Ge,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const o in i)if(vc(i,o)){const a=i[o],l=this.key["~run"]({value:o},r);if(l.issues){const c={type:"object",origin:"key",input:i,key:o,value:a};for(const p of l.issues)p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),r.abortEarly){s.typed=!1;break}}const d=this.value["~run"]({value:a},r);if(d.issues){const c={type:"object",origin:"value",input:i,key:o,value:a};for(const p of d.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=d.issues),r.abortEarly){s.typed=!1;break}}(!l.typed||!d.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=d.value)}}else R(this,"type",s,r);return s}})}function P(t,e){return I({kind:"schema",type:"strict_object",reference:P,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=i in r?r[i]:Bt(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=Xr(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){R(this,"key",n,s,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else R(this,"type",n,s);return n}})}function v(t){return I({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 si(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 Vn(t,e){return I({kind:"schema",type:"union",reference:Vn,expects:Fn(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let r,i,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)i?i.push(l):i=[l];else{r=l;break}else o?o.push(l):o=[l]}if(r)return r;if(i){if(i.length===1)return i[0];R(this,"type",n,s,{issues:si(i)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:si(o)})}return n}})}function ve(){return I({kind:"schema",type:"unknown",reference:ve,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Ut(t,e,n){return I({kind:"schema",type:"variant",reference:Ut,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){let o,a=0,l=this.key,d=[];const c=(p,u)=>{for(const h of p.options){if(h.type==="variant")c(h,new Set(u).add(h.key));else{let f=!0,g=0;for(const b of u){const x=h.entries[b];if(b in i?x["~run"]({typed:!1,value:i[b]},Jr).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==b&&(a<g||a===g&&b in i&&!(l in i))&&(a=g,l=b,d=[]),l===b&&d.push(h.entries[b].expects);break}g++}if(f){const b=h["~run"]({value:i},r);(!o||!o.typed&&b.typed)&&(o=b)}}if(o&&!o.issues)break}};if(c(this,new Set([this.key])),o)return o;R(this,"type",s,r,{input:i[l],expected:Fn(d,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else R(this,"type",s,r);return s}})}function Ft(t,e,n){const s=t["~run"]({value:e},Un());if(s.issues)throw new yc(s.issues);return s.value}function y(...t){return I({...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},Un());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Ac(t){let e="";for(const n of t){e&&(e+=`
796
- `),e+=`\xD7 ${n.message}`;const s=xc(n);s&&(e+=`
797
- \u2192 at ${s}`)}return e}const Wt=O({type:y(v(),$(1)),id:y(v(),$(1))}),Gt=y(v(),$(1),be(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Cc=(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},Pe=O({id:y(v(),$(1)),type:y(v(),$(1)),target:Wt,payload:ve(),note:U(v()),createdAt:y(v(),$(1))}),Tc=(t,e,n,s={})=>{const r=O({id:y(v(),$(1)),type:G(t),target:Wt,payload:n,note:U(v()),createdAt:y(v(),$(1))}),i=o=>{const a=C(Pe,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:r,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:i,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Ec=(t,e)=>{const n=Vt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Rc=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},Vt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,_c=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Oc=O({id:y(v(),$(1))}),Lc=t=>{const e=C(Oc,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},D=t=>`${t.type}:${t.id}`,pt=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Kn=(t,e)=>typeof t=="string"?pt(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Pc=(t,e)=>t.type===e.type&&t.id===e.id,ri=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},zc=(t,e)=>{const n=ri(t),s=new Set(e);if(!s.has(n))return n;for(let r=2;r<1e3;r+=1){const i=`${n}-${r}`;if(!s.has(i))return i}return`${n}-${Math.random().toString(36).slice(2,8)}`},ii=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},B="comment",ze=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},oi=O({type:y(v(),$(1)),target:Vn([y(v(),$(1)),Wt]),payload:N(ve()),note:U(v()),id:U(y(v(),$(1))),createdAt:U(y(v(),$(1)))}),Mc=(t,e)=>{const n=C(oi,t);if(!n.success)return{ok:!1,issue:ze(n.issues)};const s=n.output,r=Kn(s.target,e.targetType),i={id:s.id??ii(),type:s.type,target:r,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,i);if(!o.success)return{ok:!1,issue:ze(o.issues)};const a=C(Pe,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:ze(a.issues)}},Qn=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${D(t.target)}`,ai=(t,e,n)=>{const s=Qn(e,n);if(s===null)return[...t,e];const r=t.at(-1);return!r||Qn(r,n)!==s||!Ic(r,e)?[...t,e]:[...t.slice(0,-1),e]},Ic=(t,e)=>Pc(t.target,e.target),Zn=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),li=O({id:y(v(),$(1)),type:G(B),target:O({type:y(v(),$(1)),id:y(v(),$(1))}),payload:O({body:y(v(),$(1))}),note:U(v()),createdAt:y(v(),$(1))}),Yn={schema:li,mode:"append",targetType:"page"},Nc=O({body:v()}),ht=t=>{const e=C(Nc,t.payload);return e.success?e.output.body:""},Jn="element",ci=y(v(),be(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),di=Ge(v(),ve()),Dc=O({type:G(Jn),id:y(v(),be(/^[^/]+\/.+/,"component references start with a provider id"))}),jc=O({id:y(v(),$(1)),type:ci,target:Dc,payload:di,note:U(v()),createdAt:y(v(),$(1))}),qc={schema:jc,mode:"sequence",targetType:Jn},Bc=P({type:ci,target:y(v(),be(/^element:[^/]+\/.+/)),payload:N(di,{})}),pi=P({id:y(v(),$(1)),title:y(v(),$(1)),summary:U(v()),tone:U(Ht(["create","update","delete","move","meta"])),stale:U(Ht(["unsupported-action-type","target-missing","constraint-violated"]))}),Xn=t=>{if(t.type!==Jn)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ee=t=>t.type!==B&&Xn(t.target)!==null,Hc=(t,e)=>t.filter(n=>ee(n)&&Xn(n.target)===e),hi=(t,e)=>{const n=new Map(t.flatMap(s=>ee(s)?[[s.id,Xn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(r=>n.get(r.id)===s.id?[[r.id,r]]:[])))},ui="data-dpk-grill",oe="grill",Kt="answer",es="data-grill-questions",ut={questions:[],rounds:[]},Uc=P({id:Gt,label:y(v(),$(1))}),fi=P({id:Gt,ref:N(y(v(),$(1))),title:y(v(),$(1)),description:N(v()),note:N(v()),options:N(j(Uc),[]),freeText:N(Gn(),!0)}),gi=Ut("kind",[P({kind:G("option"),optionId:y(v(),$(1))}),P({kind:G("free"),text:v()})]),mi=Ut("kind",[...gi.options,P({kind:G("clear")})]),Fc=P({...fi.entries,answer:N(gi)}),Wc=P({label:N(y(v(),$(1))),questions:j(Fc)}),Gc=P({questions:j(fi),history:N(j(Wc),[])}),ki=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const r=new Set;for(const i of n.options){if(r.has(i.id))throw new Error(`duplicate option id: ${i.id} in question ${n.id}`);r.add(i.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},bi=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),Vc=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...bi(t),answer:e}},Kc=t=>{const e=Ft(Gc,t);return{questions:ki(e.questions).map(bi),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:ki(n.questions).map(Vc)}))}},Ve=(t,e)=>t.questions.find(n=>n.id===e),ts=(t,e)=>{const n=Ve(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},Qt=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Zt=(t,e)=>Qt(t,e)!=="",Qc=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},vi=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Zt(n,e[n.id])).length}),Zc=(t,e,n)=>{const s=t.questions,r=s.findIndex(o=>o.id===n);return(r===-1?s:[...s.slice(r+1),...s.slice(0,r)]).find(o=>!Zt(o,e[o.id]))?.id??null},Yc=O({id:y(v(),$(1)),type:G(Kt),target:O({type:G(oe),id:Gt}),payload:mi,note:U(v()),createdAt:y(v(),$(1))}),Jc={schema:Yc,mode:"patch",targetType:oe},J=t=>t.type===Kt&&t.target.type===oe,Xc=(t,e)=>({type:Kt,target:{type:oe,id:t},payload:e}),xi=t=>{const e=C(mi,t.payload);return e.success?e.output:null},ed=(t,e)=>[...t.filter(n=>!(J(n)&&n.target.id===e.target.id)),e],yi=(t,e,n)=>{const s=Ve(t,n.target.id),r=xi(n);if(!s||!r)return null;const i=e[s.id];if(r.kind==="clear"){if(i===void 0)return e;const o={...e};return delete o[s.id],o}return r.kind==="option"&&!s.options.some(o=>o.id===r.optionId)||r.kind==="free"&&!s.freeText?null:i?.kind==="option"&&r.kind==="option"&&i.optionId===r.optionId||i?.kind==="free"&&r.kind==="free"&&i.text===r.text?e:{...e,[s.id]:r}},ns=Object.freeze({}),Yt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return ns;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[r,i]of n)r.length>0&&i.length>0&&(s[r]=i);return s},Ke=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[s];r!=null&&r!==""&&e.set(s,r)}const n=e.toString();return n.length===0?"":`#${n}`},ss=(t,e,n=[])=>{const s={...t},r=Object.keys(e).map(i=>n.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of n.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete s[i];for(const[i,o]of Object.entries(e))o==null||o===""?delete s[i]:s[i]=o;return s},td=(t,e="json")=>`\`\`\`${e}
795
+ />`}#s=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=Ee(e.target,HTMLInputElement)??Ee(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#a=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.#d())}};#l=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#t,{selectionStart:r,selectionEnd:i}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#t?(n.focus(),n.setSelectionRange(r,i)):this.#d())})};#d=()=>{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 Ec=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Zr)},Rc={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Kn(t){return Rc}let _c;function Oc(t){return _c?.get(t)}let Lc;function Pc(t){return Lc?.get(t)}let zc;function Mc(t,e){return zc?.get(t)?.get(e)}function We(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,r){const i=r&&"input"in r?r.input:n.value,o=r?.expected??t.expects??null,a=r?.received??We(i),l={kind:t.kind,type:t.type,input:i,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},d=t.kind==="schema",c=r?.message??t.message??Mc(t.reference,l.lang)??(d?Pc(l.lang):null)??s.message??Oc(l.lang);c!==void 0&&(l.message=typeof c=="function"?c(l):c),d&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function Ic(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Nc(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Qn(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function M(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Kn())},t}function Dc(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 jc=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const qc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Bc=/^\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 Yr(t,e){return{kind:"validation",type:"check",reference:Yr,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 Jr(t){return{kind:"validation",type:"finite",reference:Jr,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 Xr(t,e){const n=We(t);return{kind:"validation",type:"includes",reference:Xr,async:!1,expects:n,requirement:t,message:e,"~run"(s,r){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,r,{received:`!${n}`}),s}}}function ei(t){return{kind:"validation",type:"integer",reference:ei,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 ti(t){return{kind:"validation",type:"iso_date",reference:ti,async:!1,expects:null,requirement:qc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"date",e,n),e}}}function ni(t){return{kind:"validation",type:"iso_timestamp",reference:ni,async:!1,expects:null,requirement:Bc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"timestamp",e,n),e}}}function $(t,e){return{kind:"validation",type:"min_length",reference:$,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 si(t,e){return{kind:"validation",type:"min_value",reference:si,async:!1,expects:`>=${t instanceof Date?t.toJSON():We(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():We(n.value)}),n}}}function oe(t,e){return{kind:"validation",type:"regex",reference:oe,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 Zn(){return{kind:"transformation",type:"trim",reference:Zn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function ri(t){return{kind:"validation",type:"url",reference:ri,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 ii={abortEarly:!0};function oi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Ut(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Hc(t,e){return!t["~run"]({value:e},ii).issues}function ai(){return M({kind:"schema",type:"any",reference:ai,expects:"any",async:!1,"~run"(t){return t.typed=!0,t}})}function j(t,e){return M({kind:"schema",type:"array",reference:j,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const r=n.value;if(Array.isArray(r)){n.typed=!0,n.value=[];for(let i=0;i<r.length;i++){const o=r[i],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:r,key:i,value:o};for(const d of a.issues)d.path?d.path.unshift(l):d.path=[l],n.issues?.push(d);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 Yn(t){return M({kind:"schema",type:"boolean",reference:Yn,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function U(t,e){return M({kind:"schema",type:"exact_optional",reference:U,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function li(t){return M({kind:"schema",type:"lazy",reference:li,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function G(t,e){return M({kind:"schema",type:"literal",reference:G,expects:We(t),async:!1,literal:t,message:e,"~run"(n,s){return Ic(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function ci(t,e){return M({kind:"schema",type:"nullable",reference:ci,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=Ut(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function di(t){return M({kind:"schema",type:"number",reference:di,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 O(t,e){return M({kind:"schema",type:"object",reference:O,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=i in r?r[i]:Ut(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=oi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function D(t,e){return M({kind:"schema",type:"optional",reference:D,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=Ut(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Ft(t,e){return M({kind:"schema",type:"picklist",reference:Ft,expects:Qn(t.map(We),"|"),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 Ge(t,e,n){return M({kind:"schema",type:"record",reference:Ge,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const o in i)if(Nc(i,o)){const a=i[o],l=this.key["~run"]({value:o},r);if(l.issues){const c={type:"object",origin:"key",input:i,key:o,value:a};for(const p of l.issues)p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),r.abortEarly){s.typed=!1;break}}const d=this.value["~run"]({value:a},r);if(d.issues){const c={type:"object",origin:"value",input:i,key:o,value:a};for(const p of d.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=d.issues),r.abortEarly){s.typed=!1;break}}(!l.typed||!d.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=d.value)}}else R(this,"type",s,r);return s}})}function z(t,e){return M({kind:"schema",type:"strict_object",reference:z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=i in r?r[i]:Ut(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=oi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){R(this,"key",n,s,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else R(this,"type",n,s);return n}})}function v(t){return M({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 pi(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 Jn(t,e){return M({kind:"schema",type:"union",reference:Jn,expects:Qn(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let r,i,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)i?i.push(l):i=[l];else{r=l;break}else o?o.push(l):o=[l]}if(r)return r;if(i){if(i.length===1)return i[0];R(this,"type",n,s,{issues:pi(i)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:pi(o)})}return n}})}function ve(){return M({kind:"schema",type:"unknown",reference:ve,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Wt(t,e,n){return M({kind:"schema",type:"variant",reference:Wt,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){let o,a=0,l=this.key,d=[];const c=(p,u)=>{for(const h of p.options){if(h.type==="variant")c(h,new Set(u).add(h.key));else{let f=!0,g=0;for(const b of u){const x=h.entries[b];if(b in i?x["~run"]({typed:!1,value:i[b]},ii).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==b&&(a<g||a===g&&b in i&&!(l in i))&&(a=g,l=b,d=[]),l===b&&d.push(h.entries[b].expects);break}g++}if(f){const b=h["~run"]({value:i},r);(!o||!o.typed&&b.typed)&&(o=b)}}if(o&&!o.issues)break}};if(c(this,new Set([this.key])),o)return o;R(this,"type",s,r,{input:i[l],expected:Qn(d,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else R(this,"type",s,r);return s}})}function Gt(t,e,n){const s=t["~run"]({value:e},Kn());if(s.issues)throw new jc(s.issues);return s.value}function y(...t){return M({...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},Kn());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Uc(t){let e="";for(const n of t){e&&(e+=`
796
+ `),e+=`\xD7 ${n.message}`;const s=Dc(n);s&&(e+=`
797
+ \u2192 at ${s}`)}return e}const Vt=O({type:y(v(),$(1)),id:y(v(),$(1))}),Kt=y(v(),$(1),oe(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Fc=(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},Pe=O({id:y(v(),$(1)),type:y(v(),$(1)),target:Vt,payload:ve(),note:U(v()),createdAt:y(v(),$(1))}),Wc=(t,e,n,s={})=>{const r=O({id:y(v(),$(1)),type:G(t),target:Vt,payload:n,note:U(v()),createdAt:y(v(),$(1))}),i=o=>{const a=C(Pe,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:r,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:i,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Gc=(t,e)=>{const n=ht(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Vc=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},ht=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Kc=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Qc=O({id:y(v(),$(1))}),Zc=t=>{const e=C(Qc,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},I=t=>`${t.type}:${t.id}`,ut=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Qt=(t,e)=>typeof t=="string"?ut(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Yc=(t,e)=>t.type===e.type&&t.id===e.id,hi=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Jc=(t,e)=>{const n=hi(t),s=new Set(e);if(!s.has(n))return n;for(let r=2;r<1e3;r+=1){const i=`${n}-${r}`;if(!s.has(i))return i}return`${n}-${Math.random().toString(36).slice(2,8)}`},ui=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},B="comment",ze=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},fi=O({type:y(v(),$(1)),target:Jn([y(v(),$(1)),Vt]),payload:D(ve()),note:U(v()),id:U(y(v(),$(1))),createdAt:U(y(v(),$(1)))}),Xc=(t,e)=>{const n=C(fi,t);if(!n.success)return{ok:!1,issue:ze(n.issues)};const s=n.output,r=Qt(s.target,e.targetType),i={id:s.id??ui(),type:s.type,target:r,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,i);if(!o.success)return{ok:!1,issue:ze(o.issues)};const a=C(Pe,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:ze(a.issues)}},Xn=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${I(t.target)}`,gi=(t,e,n)=>{const s=Xn(e,n);if(s===null)return[...t,e];const r=t.at(-1);return!r||Xn(r,n)!==s||!ed(r,e)?[...t,e]:[...t.slice(0,-1),e]},ed=(t,e)=>Yc(t.target,e.target),es=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),mi=O({id:y(v(),$(1)),type:G(B),target:O({type:y(v(),$(1)),id:y(v(),$(1))}),payload:O({body:y(v(),$(1))}),note:U(v()),createdAt:y(v(),$(1))}),ts={schema:mi,mode:"append",targetType:"page"},td=O({body:v()}),ft=t=>{const e=C(td,t.payload);return e.success?e.output.body:""},ns="element",ki=y(v(),oe(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),bi=Ge(v(),ve()),nd=O({type:G(ns),id:y(v(),oe(/^[^/]+\/.+/,"component references start with a provider id"))}),sd=O({id:y(v(),$(1)),type:ki,target:nd,payload:bi,note:U(v()),createdAt:y(v(),$(1))}),rd={schema:sd,mode:"sequence",targetType:ns},id=z({type:ki,target:y(v(),oe(/^element:[^/]+\/.+/)),payload:D(bi,{})}),vi=z({id:y(v(),$(1)),title:y(v(),$(1)),summary:U(v()),tone:U(Ft(["create","update","delete","move","meta"])),stale:U(Ft(["unsupported-action-type","target-missing","constraint-violated"]))}),ss=t=>{if(t.type!==ns)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},te=t=>t.type!==B&&ss(t.target)!==null,od=(t,e)=>t.filter(n=>te(n)&&ss(n.target)===e),xi=(t,e)=>{const n=new Map(t.flatMap(s=>te(s)?[[s.id,ss(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(r=>n.get(r.id)===s.id?[[r.id,r]]:[])))},yi="data-dpk-grill",ae="grill",Zt="answer",rs="data-grill-questions",Ve={questions:[],rounds:[]},ad=z({id:Kt,label:y(v(),$(1))}),wi=z({id:Kt,ref:D(y(v(),$(1))),title:y(v(),$(1)),description:D(v()),note:D(v()),options:D(j(ad),[]),freeText:D(Yn(),!0)}),$i=Wt("kind",[z({kind:G("option"),optionId:y(v(),$(1))}),z({kind:G("free"),text:v()})]),Si=Wt("kind",[...$i.options,z({kind:G("clear")})]),ld=z({...wi.entries,answer:D($i)}),cd=z({label:D(y(v(),$(1))),questions:j(ld)}),dd=z({questions:j(wi),history:D(j(cd),[])}),Ai=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const r=new Set;for(const i of n.options){if(r.has(i.id))throw new Error(`duplicate option id: ${i.id} in question ${n.id}`);r.add(i.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},Ti=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),pd=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...Ti(t),answer:e}},hd=t=>{const e=Gt(dd,t);return{questions:Ai(e.questions).map(Ti),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:Ai(n.questions).map(pd)}))}},Ke=(t,e)=>t.questions.find(n=>n.id===e),is=(t,e)=>{const n=Ke(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},Yt=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Jt=(t,e)=>Yt(t,e)!=="",ud=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},Ci=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Jt(n,e[n.id])).length}),fd=(t,e,n)=>{const s=t.questions,r=s.findIndex(o=>o.id===n);return(r===-1?s:[...s.slice(r+1),...s.slice(0,r)]).find(o=>!Jt(o,e[o.id]))?.id??null},gd=O({id:y(v(),$(1)),type:G(Zt),target:O({type:G(ae),id:Kt}),payload:Si,note:U(v()),createdAt:y(v(),$(1))}),md={schema:gd,mode:"patch",targetType:ae},Q=t=>t.type===Zt&&t.target.type===ae,kd=(t,e)=>({type:Zt,target:{type:ae,id:t},payload:e}),Ei=t=>{const e=C(Si,t.payload);return e.success?e.output:null},bd=(t,e)=>[...t.filter(n=>!(Q(n)&&n.target.id===e.target.id)),e],Ri=(t,e,n)=>{const s=Ke(t,n.target.id),r=Ei(n);if(!s||!r)return null;const i=e[s.id];if(r.kind==="clear"){if(i===void 0)return e;const o={...e};return delete o[s.id],o}return r.kind==="option"&&!s.options.some(o=>o.id===r.optionId)||r.kind==="free"&&!s.freeText?null:i?.kind==="option"&&r.kind==="option"&&i.optionId===r.optionId||i?.kind==="free"&&r.kind==="free"&&i.text===r.text?e:{...e,[s.id]:r}},gt=Object.freeze({}),Xt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return gt;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[r,i]of n)r.length>0&&i.length>0&&(s[r]=i);return s},Qe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[s];r!=null&&r!==""&&e.set(s,r)}const n=e.toString();return n.length===0?"":`#${n}`},en=(t,e,n=[])=>{const s={...t},r=Object.keys(e).map(i=>n.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of n.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete s[i];for(const[i,o]of Object.entries(e))o==null||o===""?delete s[i]:s[i]=o;return s},vd=(t,e="json")=>`\`\`\`${e}
798
798
  ${t}
799
- \`\`\``,nd=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),rs=(t,e,n)=>{const{actions:s,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!i.has(p.id)),a=o.filter(p=>p.type===B),l=o.filter(p=>p.type!==B&&!J(p)),d=t.grill.questions.filter(p=>Zt(p,t.answers[p.id])),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: \`${Ke(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`+(d.length>0?`, ${d.length} answer(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(ee)&&(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,u]of a.entries()){const h=e.describe(u,r,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${D(u.target)}\``),c.push(` > ${ht(u).replace(/\n/g,`
800
- > `)}`)}c.push("")}if(d.length>0){c.push(`## Answers (${d.length})`),c.push(""),c.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),c.push("");for(const[p,u]of d.entries()){const h=t.answers[u.id],f=h?.kind==="option"?` (option \`${h.optionId}\`)`:"";c.push(`${p+1}. **${ts(t.grill,u.id)}** \u2014 \`grill:${u.id}\``),c.push(` > ${Qt(u,h).replace(/\n/g,`
801
- > `)}${f}`)}c.push("")}if(l.length>0){c.push(`## Requested changes (${l.length})`),c.push("");for(const[p,u]of l.entries()){const h=e.describe(u,r,t.base),f=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${f}`),c.push(` target: \`${D(u.target)}\` (${u.target.type})`),c.push(` \`\`\`json
802
- ${nd(u).replace(/\n/g,`
799
+ \`\`\``,xd=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),tn=(t,e,n)=>{const{actions:s,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!i.has(p.id)),a=o.filter(p=>p.type===B),l=o.filter(p=>p.type!==B&&!Q(p)),d=t.grill.questions.filter(p=>Jt(p,t.answers[p.id])),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: \`${Qe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`+(d.length>0?`, ${d.length} answer(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(te)&&(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,u]of a.entries()){const h=e.describe(u,r,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${I(u.target)}\``),c.push(` > ${ft(u).replace(/\n/g,`
800
+ > `)}`)}c.push("")}if(d.length>0){c.push(`## Answers (${d.length})`),c.push(""),c.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),c.push("");for(const[p,u]of d.entries()){const h=t.answers[u.id],f=h?.kind==="option"?` (option \`${h.optionId}\`)`:"";c.push(`${p+1}. **${is(t.grill,u.id)}** \u2014 \`grill:${u.id}\``),c.push(` > ${Yt(u,h).replace(/\n/g,`
801
+ > `)}${f}`)}c.push("")}if(l.length>0){c.push(`## Requested changes (${l.length})`),c.push("");for(const[p,u]of l.entries()){const h=e.describe(u,r,t.base),f=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${f}`),c.push(` target: \`${I(u.target)}\` (${u.target.type})`),c.push(` \`\`\`json
802
+ ${xd(u).replace(/\n/g,`
803
803
  `)}
804
- \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&d.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:u,reason:h}]of t.stale.entries()){const f=e.describe(u,r,t.base),g=u.type===B?ht(u):f.title;c.push(`${p+1}. \`${u.type}\` on \`${D(u.target)}\` (${h}) \u2014 ${g}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(td(Zn(s))),c.push(""),c.join(`
805
- `)},te="0.1.0",is=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()}},wi=zt({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to close",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u3059\u3079\u3066\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u9589\u3058\u308B",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),sd=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),$i=t=>t.kind==="explicit"?{kind:t.resume}:t,Si=(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:$i(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:$i(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}}}},rd=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},id=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},od={en:"English",ja:"\u65E5\u672C\u8A9E"},z=zt({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",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",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round."},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",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",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}}),ad=4096,ld="reviews",Ai="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.",cd=t=>new TextEncoder().encode(t).length,dd=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),pd=t=>{const e=`${Ai}
804
+ \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&d.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:u,reason:h}]of t.stale.entries()){const f=e.describe(u,r,t.base),g=u.type===B?ft(u):f.title;c.push(`${p+1}. \`${u.type}\` on \`${I(u.target)}\` (${h}) \u2014 ${g}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(vd(es(s))),c.push(""),c.join(`
805
+ `)},X="0.2.0",os=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()}},_i=It({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to close",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u3059\u3079\u3066\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u9589\u3058\u308B",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),yd=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Oi=t=>t.kind==="explicit"?{kind:t.resume}:t,Li=(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:Oi(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:Oi(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}}}},wd=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},$d=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Sd={en:"English",ja:"\u65E5\u672C\u8A9E"},L=It({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",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",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round."},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",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",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}}),Ad=4096,Td="reviews",Pi="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.",Cd=t=>new TextEncoder().encode(t).length,Ed=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),Rd=t=>{const e=`${Pi}
806
806
 
807
- ${dd(t)}`;return cd(e)<=ad?e:null},hd=t=>`${Ai}
807
+ ${Ed(t)}`;return Cd(e)<=Ad?e:null},_d=t=>`${Pi}
808
808
 
809
- 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).`,ud={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},fd=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?ud[e]:void 0)??"error"},gd={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Ci=(t,e)=>z(e)[gd[t]],Ti=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ei=(t,e)=>{const{definition:n,state:s,navigation:r,derivation:i}=t,o=wi(t.locale),a=n.currentTarget?.(s,r)??null,l=e.attachment,d=l.kind==="explicit"?n.commentTargets(s,r).find(g=>g.value===l.ref):null,c=l.kind==="explicit"?{ref:l.ref,label:d?Ti(d):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Ti(a)}:{ref:`page:${n.name}`,label:o.wholePage},p=new Map(i.stale.map(g=>[g.action.id,g.reason])),u=t.section??"all",f=i.actions.filter(g=>!J(g)||p.has(g.id)).map(g=>{const b=n.describe(g,s,i.base),x=g.type===B;return{kind:x?"comments":"changes",id:g.id,title:x?o.comment:b.title,targetLabel:b.targetLabel,tone:x?"comment":b.tone,text:{kind:x?"comment":"summary",body:x?ht(g):b.summary??""},code:x?null:n.serialize(g),stale:p.get(g.id)??null,edit:!x||t.editable!==!0?{kind:"none"}:e.editing?.id===g.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}});return{body:e.body,target:c,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,section:u,composer:u!=="changes",groups:["comments","changes"].filter(g=>u==="all"||u===g).map(g=>({kind:g,items:f.filter(b=>b.kind===g)})),hasDraft:i.actions.length>0,issues:t.issues.map(g=>`${g.path?`${g.path}: `:""}${g.message}`),send:t.sendable!==!0?"hidden":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Ci(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},md=[Mt,Pn,ue`
809
+ 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).`,Od={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Ld=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Od[e]:void 0)??"error"},Pd={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},zi=(t,e)=>L(e)[Pd[t]],Mi=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ii=(t,e)=>{const{definition:n,state:s,navigation:r,derivation:i}=t,o=_i(t.locale),a=n.currentTarget?.(s,r)??null,l=e.attachment,d=l.kind==="explicit"?n.commentTargets(s,r).find(g=>g.value===l.ref):null,c=l.kind==="explicit"?{ref:l.ref,label:d?Mi(d):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Mi(a)}:{ref:`page:${n.name}`,label:o.wholePage},p=new Map(i.stale.map(g=>[g.action.id,g.reason])),u=t.section??"all",f=i.actions.filter(g=>!Q(g)||p.has(g.id)).map(g=>{const b=n.describe(g,s,i.base),x=g.type===B;return{kind:x?"comments":"changes",id:g.id,title:x?o.comment:b.title,targetLabel:b.targetLabel,tone:x?"comment":b.tone,text:{kind:x?"comment":"summary",body:x?ft(g):b.summary??""},code:x?null:n.serialize(g),stale:p.get(g.id)??null,edit:!x||t.editable!==!0?{kind:"none"}:e.editing?.id===g.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}});return{body:e.body,target:c,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,section:u,composer:u!=="changes",groups:["comments","changes"].filter(g=>u==="all"||u===g).map(g=>({kind:g,items:f.filter(b=>b.kind===g)})),hasDraft:i.actions.length>0,issues:t.issues.map(g=>`${g.path?`${g.path}: `:""}${g.message}`),send:t.sendable!==!0?"hidden":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?zi(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},zd=[Nt,Dn,fe`
810
810
  :host {
811
811
  display: flex;
812
812
  flex-direction: column;
@@ -1220,7 +1220,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1220
1220
  letter-spacing: 0.04em;
1221
1221
  color: var(--dpk-green);
1222
1222
  }
1223
- `],Ri=(t,e,n)=>{const s=new Map;for(let r=e;r<=n;r++)s.set(t[r],r);return s},Me=rt(class extends _t{constructor(t){if(super(t),t.type!==me.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 r=[],i=[];let o=0;for(const a of t)r[o]=s?s(a,o):o,i[o]=n(a,o),o++;return{values:i,keys:r}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const r=el(t),{values:i,keys:o}=this.dt(e,n,s);if(!Array.isArray(r))return this.ut=o,i;const a=this.ut??=[],l=[];let d,c,p=0,u=r.length-1,h=0,f=i.length-1;for(;p<=u&&h<=f;)if(r[p]===null)p++;else if(r[u]===null)u--;else if(a[p]===o[h])l[h]=Te(r[p],i[h]),p++,h++;else if(a[u]===o[f])l[f]=Te(r[u],i[f]),u--,f--;else if(a[p]===o[f])l[f]=Te(r[p],i[f]),it(t,l[f+1],r[p]),p++,f--;else if(a[u]===o[h])l[h]=Te(r[u],i[h]),it(t,r[p],r[u]),u--,h++;else if(d===void 0&&(d=Ri(o,h,f),c=Ri(a,p,u)),d.has(a[p]))if(d.has(a[u])){const g=c.get(o[h]),b=g!==void 0?r[g]:null;if(b===null){const x=it(t,r[p]);Te(x,i[h]),l[h]=x}else l[h]=Te(b,i[h]),it(t,r[p],b),r[g]=null;h++}else En(r[u]),u--;else En(r[p]),p++;for(;h<=f;){const g=it(t,l[f+1]);Te(g,i[h]),l[h++]=g}for(;p<=u;){const g=r[p++];g!==null&&En(g)}return this.ut=o,Tn(t,l),K}});class os extends Ot{}os.directiveName="unsafeSVG",os.resultType=2;const kd=rt(os),_i=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Oi=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Li=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],Pi=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],bd=[["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"}]],vd=[["path",{d:"M20 6 9 17l-5-5"}]],zi=[["path",{d:"m6 9 6 6 6-6"}]],xd=[["path",{d:"m15 18-6-6 6-6"}]],yd=[["path",{d:"m9 18 6-6-6-6"}]],Mi=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],wd=[["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"}]],$d=[["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"}]],Sd=[["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"}]],Ad=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Cd=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],Td=[["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"}]],Ed=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Rd=[["path",{d:"M5 12h14"}]],_d=[["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"}]],Od=[["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"}]],Ld=[["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"}]],Pd=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],zd=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],Md=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],Id=[["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"}]],Nd=[["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"}]],Dd=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],jd=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),qd=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,r])=>` ${s}="${jd(String(r))}"`).join("")}></${e}>`).join(""),T=t=>{const e=qd(t);return()=>m`<svg
1223
+ `],Ni=(t,e,n)=>{const s=new Map;for(let r=e;r<=n;r++)s.set(t[r],r);return s},Me=it(class extends Lt{constructor(t){if(super(t),t.type!==ke.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 r=[],i=[];let o=0;for(const a of t)r[o]=s?s(a,o):o,i[o]=n(a,o),o++;return{values:i,keys:r}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const r=bl(t),{values:i,keys:o}=this.dt(e,n,s);if(!Array.isArray(r))return this.ut=o,i;const a=this.ut??=[],l=[];let d,c,p=0,u=r.length-1,h=0,f=i.length-1;for(;p<=u&&h<=f;)if(r[p]===null)p++;else if(r[u]===null)u--;else if(a[p]===o[h])l[h]=Ce(r[p],i[h]),p++,h++;else if(a[u]===o[f])l[f]=Ce(r[u],i[f]),u--,f--;else if(a[p]===o[f])l[f]=Ce(r[p],i[f]),ot(t,l[f+1],r[p]),p++,f--;else if(a[u]===o[h])l[h]=Ce(r[u],i[h]),ot(t,r[p],r[u]),u--,h++;else if(d===void 0&&(d=Ni(o,h,f),c=Ni(a,p,u)),d.has(a[p]))if(d.has(a[u])){const g=c.get(o[h]),b=g!==void 0?r[g]:null;if(b===null){const x=ot(t,r[p]);Ce(x,i[h]),l[h]=x}else l[h]=Ce(b,i[h]),ot(t,r[p],b),r[g]=null;h++}else Pn(r[u]),u--;else Pn(r[p]),p++;for(;h<=f;){const g=ot(t,l[f+1]);Ce(g,i[h]),l[h++]=g}for(;p<=u;){const g=r[p++];g!==null&&Pn(g)}return this.ut=o,Ln(t,l),K}});class as extends Pt{}as.directiveName="unsafeSVG",as.resultType=2;const Md=it(as),Di=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],ji=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],qi=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],Bi=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],Id=[["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"}]],Nd=[["path",{d:"M20 6 9 17l-5-5"}]],Hi=[["path",{d:"m6 9 6 6 6-6"}]],Dd=[["path",{d:"m15 18-6-6 6-6"}]],jd=[["path",{d:"m9 18 6-6-6-6"}]],Ui=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],qd=[["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"}]],Bd=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"}]],Hd=[["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"}]],Ud=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]],Fd=[["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"}]],Wd=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Gd=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],Vd=[["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"}]],Kd=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Qd=[["path",{d:"M5 12h14"}]],Zd=[["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"}]],Yd=[["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"}]],Jd=[["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"}]],Xd=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],ep=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],tp=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],np=[["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"}]],sp=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],rp=[["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"}]],ip=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],op=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),ap=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,r])=>` ${s}="${op(String(r))}"`).join("")}></${e}>`).join(""),A=t=>{const e=ap(t);return()=>m`<svg
1224
1224
  viewBox="0 0 24 24"
1225
1225
  fill="none"
1226
1226
  stroke="currentColor"
@@ -1230,16 +1230,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1230
1230
  aria-hidden="true"
1231
1231
  focusable="false"
1232
1232
  >
1233
- ${kd(e)}
1234
- </svg>`},Jt=T(Dd),Ii=T(Nd),as=T(Ld),Xt=T(Td),Bd=T(Cd),Hd=T(zd),Ud=T(Mi),Fd=T(Md),Ni=T(Sd),Wd=T(wd),Di=T(vd),ji=T(Pd),Gd=T(Rd),Vd=T($d),qi=T(Od),Kd=T(Pi),Qd=T(_i);T(Oi),T(Li);const Bi=T(xd),ft=T(yd),Zd=T(zi),Yd=T(Ad),Jd=T(Ed),Xd=T(Id),ep=T(_d),Hi=T(bd),tp=t=>{switch(t){case"comment":return Xt();case"create":return ji();case"update":return as();case"delete":return Ii();case"move":return qi();default:return Ni()}},np=(t,e,n,s=!1)=>m`
1235
- ${s?k:m`<header><h2>${sp(t,e.section)}</h2></header>`}
1233
+ ${Md(e)}
1234
+ </svg>`},nn=A(ip),Fi=A(rp),ls=A(Jd),sn=A(Vd),lp=A(Gd),cp=A(ep),dp=A(Ui),pp=A(tp),Wi=A(Fd),hp=A(qd),Gi=A(Nd),Vi=A(Xd),up=A(Qd),fp=A(Hd),Ki=A(Yd),gp=A(Bi),mp=A(Di);A(ji),A(qi);const Qi=A(Dd),mt=A(jd),kp=A(Hi),bp=A(Wd),vp=A(Kd),xp=A(np),yp=A(Zd),Zi=A(Id),wp=A(Ud),$p=A(Bd),Sp=A(sp),Ap=t=>{switch(t){case"comment":return sn();case"create":return Vi();case"update":return ls();case"delete":return Fi();case"move":return Ki();default:return Wi()}},Tp=(t,e,n,s=!1)=>m`
1235
+ ${s?k:m`<header><h2>${Cp(t,e.section)}</h2></header>`}
1236
1236
  ${e.issues.length>0?m`<div class="issues" role="alert">
1237
1237
  <strong>${t.rejected}</strong>
1238
1238
  <ul>
1239
1239
  ${e.issues.map(r=>m`<li>${r}</li>`)}
1240
1240
  </ul>
1241
1241
  </div>`:k}
1242
- ${e.composer?rp(t,e,n):k} ${ip(t,e,n)}
1242
+ ${e.composer?Ep(t,e,n):k} ${Rp(t,e,n)}
1243
1243
  <footer>
1244
1244
  ${s||e.send==="hidden"?k:m`<button
1245
1245
  class="dpk-btn dpk-btn--accent"
@@ -1270,7 +1270,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1270
1270
  </div>
1271
1271
  ${e.flash?m`<span class="flash" role="status">${e.flash}</span>`:k}
1272
1272
  </footer>
1273
- `,sp=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,rp=(t,e,n)=>m`
1273
+ `,Cp=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,Ep=(t,e,n)=>m`
1274
1274
  <div class="composer">
1275
1275
  <textarea
1276
1276
  class="dpk-textarea"
@@ -1282,7 +1282,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1282
1282
  ></textarea>
1283
1283
  ${e.attachment.kind==="explicit"?m`<div class="row">
1284
1284
  <button class="chip" type="button" aria-label=${t.detach} @click=${()=>n({kind:"clear-target"})}>
1285
- ${e.target.label} ${Jt()}
1285
+ ${e.target.label} ${nn()}
1286
1286
  </button>
1287
1287
  </div>`:e.attachment.kind==="checkbox"?m`<div class="row">
1288
1288
  <label class="attach">
@@ -1306,28 +1306,28 @@ The brief is too long for a comment, so it is stored in this artifact's database
1306
1306
  </button>
1307
1307
  </div>
1308
1308
  </div>
1309
- `,ls=(t,e)=>m`<div class="empty">
1309
+ `,cs=(t,e)=>m`<div class="empty">
1310
1310
  <div class="empty-box">
1311
- ${Xt()}
1311
+ ${sn()}
1312
1312
  <p>${t}</p>
1313
1313
  <p class="empty-hint">${e}</p>
1314
1314
  </div>
1315
- </div>`,Ui=(t,e,n)=>m`<ul
1315
+ </div>`,Yi=(t,e,n)=>m`<ul
1316
1316
  class="list"
1317
1317
  >
1318
- ${Me(e,s=>s.id,s=>op(t,s,n))}
1319
- </ul>`,ip=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?m`<div class="groups">${Ui(t,s.items,n)}</div>`:s.kind==="changes"?ls(t.emptyChanges,t.emptyChangesHint):ls(t.emptyComments,t.emptyCommentsHint):e.groups.every(r=>r.items.length===0)?ls(t.empty,t.emptyHint):m`<div class="groups">
1318
+ ${Me(e,s=>s.id,s=>_p(t,s,n))}
1319
+ </ul>`,Rp=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?m`<div class="groups">${Yi(t,s.items,n)}</div>`:s.kind==="changes"?cs(t.emptyChanges,t.emptyChangesHint):cs(t.emptyComments,t.emptyCommentsHint):e.groups.every(r=>r.items.length===0)?cs(t.empty,t.emptyHint):m`<div class="groups">
1320
1320
  ${e.groups.filter(r=>r.items.length>0).map(r=>m`<section class="group" data-kind=${r.kind}>
1321
1321
  <h3 class="group-head">
1322
1322
  ${r.kind==="changes"?t.changesHeading:t.commentsHeading}
1323
1323
  <span class="group-count">${r.items.length}</span>
1324
1324
  </h3>
1325
- ${Ui(t,r.items,n)}
1325
+ ${Yi(t,r.items,n)}
1326
1326
  </section>`)}
1327
- </div>`},op=(t,e,n)=>m`
1327
+ </div>`},_p=(t,e,n)=>m`
1328
1328
  <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
1329
1329
  <div class="item-head">
1330
- <span class="item-icon">${tp(e.tone)}</span>
1330
+ <span class="item-icon">${Ap(e.tone)}</span>
1331
1331
  <span class="item-title">${e.title}</span>
1332
1332
  ${e.stale?m`<span class="stale-badge">${e.stale}</span>`:k}
1333
1333
  ${e.edit.kind==="available"?m`<button
@@ -1337,7 +1337,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1337
1337
  title=${t.editComment}
1338
1338
  @click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
1339
1339
  >
1340
- ${as()}
1340
+ ${ls()}
1341
1341
  </button>`:k}
1342
1342
  <button
1343
1343
  class="dpk-icon-btn"
@@ -1345,14 +1345,14 @@ The brief is too long for a comment, so it is stored in this artifact's database
1345
1345
  aria-label=${t.deleteAction}
1346
1346
  @click=${()=>n({kind:"delete",id:e.id})}
1347
1347
  >
1348
- ${Jt()}
1348
+ ${nn()}
1349
1349
  </button>
1350
1350
  </div>
1351
1351
  <div class="item-target">${e.targetLabel}</div>
1352
- ${e.edit.kind==="editing"?ap(t,e.edit,n):e.text.kind==="comment"?m`<p class="item-body">${e.text.body}</p>`:e.text.body?m`<div class="item-summary">${e.text.body}</div>`:k}
1352
+ ${e.edit.kind==="editing"?Op(t,e.edit,n):e.text.kind==="comment"?m`<p class="item-body">${e.text.body}</p>`:e.text.body?m`<div class="item-summary">${e.text.body}</div>`:k}
1353
1353
  ${e.code===null?k:m`<code class="item-code">${e.code}</code>`}
1354
1354
  </li>
1355
- `,ap=(t,e,n)=>m`
1355
+ `,Op=(t,e,n)=>m`
1356
1356
  <div class="item-editor">
1357
1357
  <textarea
1358
1358
  class="dpk-textarea"
@@ -1381,8 +1381,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1381
1381
  </button>
1382
1382
  </div>
1383
1383
  </div>
1384
- `,lp=t=>t==="changes"||t==="comments"?t:"all";class Fi extends ge{static{this.styles=md}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},section:{type:String}}}#e=sd();#t=null;#n=new Ln(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Si(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.#t;n&&(this.#t=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.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.#n.locale,section:lp(this.section)}}render(){const e=this.#r();return e?np(wi(this.#n.locale),Ei(e,this.#e),this.#i,this.embedded):k}#s(e){this.#e=Si(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.#a();return;case"send":this.#o();return;case"edit-start":this.#t={kind:"editor",id:e.id},this.#s(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#t={kind:"edit-button",id:n.id}),this.#s(e);return}case"edit-save":{const n=id(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#t={kind:"edit-button",id:n.id},this.#s({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=rd(this.#e,Ei(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#s({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#r();if(!e)return;this.#s({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??rs({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,te),r=await is(s);this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:r})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:!1})}}}const cp=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Fi)},Qe=Math.min,ae=Math.max,en=Math.round,tn=Math.floor,le=t=>({x:t,y:t}),dp={left:"right",right:"left",bottom:"top",top:"bottom"};function pp(t,e,n){return ae(t,Qe(e,n))}function gt(t,e){return typeof t=="function"?t(e):t}function Ie(t){return t.split("-")[0]}function mt(t){return t.split("-")[1]}function Wi(t){return t==="x"?"y":"x"}function Gi(t){return t==="y"?"height":"width"}function ce(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Vi(t){return Wi(ce(t))}function hp(t,e,n){n===void 0&&(n=!1);const s=mt(t),r=Vi(t),i=Gi(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=nn(o)),[o,nn(o)]}function up(t){const e=nn(t);return[cs(t),e,cs(e)]}function cs(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ki=["left","right"],Qi=["right","left"],fp=["top","bottom"],gp=["bottom","top"];function mp(t,e,n){switch(t){case"top":case"bottom":return n?e?Qi:Ki:e?Ki:Qi;case"left":case"right":return e?fp:gp;default:return[]}}function kp(t,e,n,s){const r=mt(t);let i=mp(Ie(t),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),e&&(i=i.concat(i.map(cs)))),i}function nn(t){const e=Ie(t);return dp[e]+t.slice(e.length)}function bp(t){var e,n,s,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(r=t.left)!=null?r:0}}function vp(t){return typeof t!="number"?bp(t):{top:t,right:t,bottom:t,left:t}}function sn(t){const{x:e,y:n,width:s,height:r}=t;return{width:s,height:r,top:n,left:e,right:e+s,bottom:n+r,x:e,y:n}}function Zi(t,e,n){let{reference:s,floating:r}=t;const i=ce(e),o=Vi(e),a=Gi(o),l=Ie(e),d=i==="y",c=s.x+s.width/2-r.width/2,p=s.y+s.height/2-r.height/2,u=s[a]/2-r[a]/2;let h;switch(l){case"top":h={x:c,y:s.y-r.height};break;case"bottom":h={x:c,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:p};break;case"left":h={x:s.x-r.width,y:p};break;default:h={x:s.x,y:s.y}}const f=mt(e);return f&&(h[o]+=u*(f==="end"?1:-1)*(n&&d?-1:1)),h}async function xp(t,e){var n;e===void 0&&(e={});const{x:s,y:r,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=gt(e,t),f=vp(h),b=a[u?p==="floating"?"reference":"floating":p],x=sn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),S=p==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(A))&&await(i.getScale==null?void 0:i.getScale(A))||{x:1,y:1},H=sn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:A,strategy:l}):S);return{top:(x.top-H.top+f.top)/_.y,bottom:(H.bottom-x.bottom+f.bottom)/_.y,left:(x.left-H.left+f.left)/_.x,right:(H.right-x.right+f.right)/_.x}}const yp=50,wp=async(t,e,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:xp},l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:p}=Zi(d,s,l),u=s,h=0;const f={};for(let g=0;g<i.length;g++){const b=i[g];if(!b)continue;const{name:x,fn:S}=b,{x:A,y:_,data:H,reset:L}=await S({x:c,y:p,initialPlacement:s,placement:u,strategy:r,middlewareData:f,rects:d,platform:a,elements:{reference:t,floating:e}});c=A??c,p=_??p,f[x]={...f[x],...H},L&&h<yp&&(h++,typeof L=="object"&&(L.placement&&(u=L.placement),L.rects&&(d=L.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:r}):L.rects),{x:c,y:p}=Zi(d,u,l)),g=-1)}return{x:c,y:p,placement:u,strategy:r,middlewareData:f}},$p=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=gt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Ie(r),S=ce(a),A=Ie(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),H=u||(A||!g?[nn(a)]:up(a)),L=f!=="none";!u&&L&&H.push(...kp(a,g,f,_));const V=[a,...H],q=await l.detectOverflow(e,b),re=[];let X=((s=i.flip)==null?void 0:s.overflows)||[];if(c&&re.push(q[x]),p){const we=hp(r,o,_);re.push(q[we[0]],q[we[1]])}if(X=[...X,{placement:r,overflows:re}],!re.every(we=>we<=0)){var Us,Fs;const we=(((Us=i.flip)==null?void 0:Us.index)||0)+1,bn=V[we];if(bn&&(!(p==="alignment"?S!==ce(bn):!1)||X.every(Q=>ce(Q.placement)===S?Q.overflows[0]>0:!0)))return{data:{index:we,overflows:X},reset:{placement:bn}};let Xe=(Fs=X.filter($e=>$e.overflows[0]<=0).sort(($e,Q)=>$e.overflows[1]-Q.overflows[1])[0])==null?void 0:Fs.placement;if(!Xe)switch(h){case"bestFit":{var Ws;const $e=(Ws=X.filter(Q=>{if(L){const he=ce(Q.placement);return he===S||he==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(he=>he>0).reduce((he,Ea)=>he+Ea,0)]).sort((Q,he)=>Q[1]-he[1])[0])==null?void 0:Ws[0];$e&&(Xe=$e);break}case"initialPlacement":Xe=a;break}if(r!==Xe)return{reset:{placement:Xe}}}return{}}}},Sp=new Set(["left","top"]);async function Ap(t,e){const{placement:n,platform:s,elements:r}=t,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Ie(n),a=mt(n),l=ce(n)==="y",d=Sp.has(o)?-1:1,c=i&&l?-1:1,p=gt(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*c,y:u*d}:{x:u*d,y:h*c}}const Cp=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:r,y:i,placement:o,middlewareData:a}=e,l=await Ap(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:o}}}}},Tp=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:A,y:_}=S;return{x:A,y:_}}},...d}=gt(t,e),c={x:n,y:s},p=await i.detectOverflow(e,d),u=ce(r),h=Wi(u);let f=c[h],g=c[u];const b=(S,A)=>pp(A+p[S==="y"?"top":"left"],A,A-p[S==="y"?"bottom":"right"]);o&&(f=b(h,f)),a&&(g=b(u,g));const x=l.fn({...e,[h]:f,[u]:g});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[h]:o,[u]:a}}}}}},Ep=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:r,elements:i}=e,{apply:o=()=>{},...a}=gt(t,e),l=await r.detectOverflow(e,a),d=Ie(n),c=mt(n),p=ce(n)==="y",{width:u,height:h}=s.floating;let f,g;d==="top"||d==="bottom"?(f=d,g=c===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=d,f=c==="end"?"top":"bottom");const b=h-l.top-l.bottom,x=u-l.left-l.right,S=Qe(h-l[f],b),A=Qe(u-l[g],x),_=e.middlewareData.shift,H=!_;let L=S,V=A;_!=null&&_.enabled.x&&(V=x),_!=null&&_.enabled.y&&(L=b),H&&!c&&(p?V=u-2*ae(l.left,l.right):L=h-2*ae(l.top,l.bottom)),await o({...e,availableWidth:V,availableHeight:L});const q=await r.getDimensions(i.floating);return u!==q.width||h!==q.height?{reset:{rects:!0}}:{}}}};function rn(){return typeof window<"u"}function Ze(t){return Yi(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function de(t){var e;return(e=(Yi(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Yi(t){return rn()?t instanceof Node||t instanceof F(t).Node:!1}function ne(t){return rn()?t instanceof Element||t instanceof F(t).Element:!1}function xe(t){return rn()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function Ji(t){return!rn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function on(t){const{overflow:e,overflowX:n,overflowY:s,display:r}=se(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&r!=="inline"&&r!=="contents"}function Rp(t){return/^(table|td|th)$/.test(Ze(t))}function an(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const _p=/transform|translate|scale|rotate|perspective|filter/,Op=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let ds;function ps(t){const e=ne(t)?se(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!hs()&&(Ne(e.backdropFilter)||Ne(e.filter))||_p.test(e.willChange||"")||Op.test(e.contain||"")}function Lp(t){let e=De(t);for(;xe(e)&&!kt(e);){if(ps(e))return e;if(an(e))return null;e=De(e)}return null}function hs(){return ds==null&&(ds=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ds}function kt(t){return/^(html|body|#document)$/.test(Ze(t))}function se(t){return F(t).getComputedStyle(t)}function ln(t){return ne(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function De(t){if(Ze(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ji(t)&&t.host||de(t);return Ji(e)?e.host:e}function Xi(t){const e=De(t);return kt(e)?(t.ownerDocument||t).body:xe(e)&&on(e)?e:Xi(e)}function bt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Xi(t),i=r===((s=t.ownerDocument)==null?void 0:s.body),o=F(r);if(i){const a=us(o);return e.concat(o,o.visualViewport||[],on(r)?r:[],a&&n?bt(a):[])}else return e.concat(r,bt(r,[],n))}function us(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function eo(t){const e=se(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=xe(t),i=r?t.offsetWidth:n,o=r?t.offsetHeight:s,a=en(n)!==i||en(s)!==o;return a&&(n=i,s=o),{width:n,height:s,$:a}}function fs(t){return ne(t)?t:t.contextElement}function Ye(t){const e=fs(t);if(!xe(e))return le(1);const n=e.getBoundingClientRect(),{width:s,height:r,$:i}=eo(e);let o=(i?en(n.width):n.width)/s,a=(i?en(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Pp=le(0);function to(t){const e=F(t);return!hs()||!e.visualViewport?Pp:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function zp(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===F(t)}function je(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=fs(t);let o=le(1);e&&(s?ne(s)&&(o=Ye(s)):o=Ye(t));const a=zp(i,n,s)?to(i):le(0);let l=(r.left+a.x)/o.x,d=(r.top+a.y)/o.y,c=r.width/o.x,p=r.height/o.y;if(i&&s){const u=F(i),h=ne(s)?F(s):s;let f=u,g=us(f);for(;g&&h!==f;){const b=Ye(g),x=g.getBoundingClientRect(),S=se(g),A=x.left+(g.clientLeft+parseFloat(S.paddingLeft))*b.x,_=x.top+(g.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,d*=b.y,c*=b.x,p*=b.y,l+=A,d+=_,f=F(g),g=us(f)}}return sn({width:c,height:p,x:l,y:d})}function cn(t,e){const n=ln(t).scrollLeft;return e?e.left+n:je(de(t)).left+n}function no(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-cn(t,n),r=n.top+e.scrollTop;return{x:s,y:r}}function Mp(t){let{elements:e,rect:n,offsetParent:s,strategy:r}=t;const i=r==="fixed",o=de(s),a=e?an(e.floating):!1;if(s===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},d=le(1);const c=le(0),p=xe(s);if((p||!i)&&((Ze(s)!=="body"||on(o))&&(l=ln(s)),p)){const h=je(s);d=Ye(s),c.x=h.x+s.clientLeft,c.y=h.y+s.clientTop}const u=o&&!p&&!i?no(o,l):le(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:n.y*d.y-l.scrollTop*d.y+c.y+u.y}}function Ip(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Np(t){const e=ln(t),n=t.ownerDocument.body,s=ae(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=ae(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+cn(t);const o=-e.scrollTop;return se(n).direction==="rtl"&&(i+=ae(t.clientWidth,n.clientWidth)-s),{width:s,height:r,x:i,y:o}}const Dp=25;function jp(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",r=F(t),i=de(t),o=r.visualViewport;let a=i.clientWidth,l=i.clientHeight,d=0,c=0;if(o){const u=!hs()||e==="fixed";s?u||(d=-o.offsetLeft,c=-o.offsetTop):(a=o.width,l=o.height,u&&(d=o.offsetLeft,c=o.offsetTop))}if(cn(i)<=0){const u=i.ownerDocument,h=u.body,f=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-g),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=Dp&&(a-=x)}return{width:a,height:l,x:d,y:c}}function qp(t,e){const n=je(t,!0,e==="fixed"),s=n.top+t.clientTop,r=n.left+t.clientLeft,i=Ye(t),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,d=s*i.y;return{width:o,height:a,x:l,y:d}}function so(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=jp(t,n,e);else if(e==="document")s=Np(de(t));else if(ne(e))s=qp(e,n);else{const r=to(t);s={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return sn(s)}function Bp(t,e){const n=e.get(t);if(n)return n;let s=bt(t,[],!1).filter(a=>ne(a)&&Ze(a)!=="body"),r=null;const i=se(t).position==="fixed";let o=i?De(t):t;for(;ne(o)&&!kt(o);){const a=se(o),l=ps(o),d=r?r.position:i?"fixed":"";!l&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(p=>p!==o):r=a,o=De(o)}return e.set(t,s),s}function Hp(t){let{element:e,boundary:n,rootBoundary:s,strategy:r}=t;const o=[...n==="clippingAncestors"?an(e)?[]:Bp(e,this._c):[].concat(n),s],a=so(e,o[0],r);let l=a.top,d=a.right,c=a.bottom,p=a.left;for(let u=1;u<o.length;u++){const h=so(e,o[u],r);l=ae(h.top,l),d=Qe(h.right,d),c=Qe(h.bottom,c),p=ae(h.left,p)}return{width:d-p,height:c-l,x:p,y:l}}function Up(t){const{width:e,height:n}=eo(t);return{width:e,height:n}}function Fp(t,e,n){const s=xe(e),r=de(e),i=n==="fixed",o=je(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=le(0);if((s||!i)&&((Ze(e)!=="body"||on(r))&&(a=ln(e)),s)){const u=je(e,!0,i,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}!s&&r&&(l.x=cn(r));const d=r&&!s&&!i?no(r,a):le(0),c=o.left+a.scrollLeft-l.x-d.x,p=o.top+a.scrollTop-l.y-d.y;return{x:c,y:p,width:o.width,height:o.height}}function gs(t){return se(t).position==="static"}function ro(t,e){if(!xe(t)||se(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return de(t)===n&&(n=n.ownerDocument.body),n}function io(t,e){const n=F(t);if(an(t))return n;if(!xe(t)){let r=De(t);for(;r&&!kt(r);){if(ne(r)&&!gs(r))return r;r=De(r)}return n}let s=ro(t,e);for(;s&&Rp(s)&&gs(s);)s=ro(s,e);return s&&kt(s)&&gs(s)&&!ps(s)?n:s||Lp(t)||n}const Wp=async function(t){const e=this.getOffsetParent||io,n=this.getDimensions,s=await n(t.floating);return{reference:Fp(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Gp(t){return se(t).direction==="rtl"}const Vp={convertOffsetParentRelativeRectToViewportRelativeRect:Mp,getDocumentElement:de,getClippingRect:Hp,getOffsetParent:io,getElementRects:Wp,getClientRects:Ip,getDimensions:Up,getScale:Ye,isElement:ne,isRTL:Gp};function oo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Kp(t,e,n){let s=null,r;const i=de(t);function o(){var c;clearTimeout(r),(c=s)==null||c.disconnect(),s=null}function a(c,p){c===void 0&&(c=!1),p===void 0&&(p=1),o();const u=t.getBoundingClientRect(),{left:h,top:f,width:g,height:b}=u;if(c||e(),!g||!b)return;const x=tn(f),S=tn(i.clientWidth-(h+g)),A=tn(i.clientHeight-(f+b)),_=tn(h),L={rootMargin:-x+"px "+-S+"px "+-A+"px "+-_+"px",threshold:ae(0,Qe(1,p))||1};let V=!0;function q(re){const X=re[0].intersectionRatio;if(!oo(u,t.getBoundingClientRect()))return a();if(X!==p){if(!V)return a();X?a(!1,X):r=setTimeout(()=>{a(!1,1e-7)},1e3)}V=!1}try{s=new IntersectionObserver(q,{...L,root:i.ownerDocument})}catch{s=new IntersectionObserver(q,L)}s.observe(t)}const l=F(t),d=()=>a(n);return l.addEventListener("resize",d),a(!0),()=>{l.removeEventListener("resize",d),o()}}function Qp(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=fs(t),c=r||i?[...d?bt(d):[],...e?bt(e):[]]:[];c.forEach(x=>{r&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const p=d&&a?Kp(d,n,i):null;let u=-1,h=null;o&&(h=new ResizeObserver(x=>{let[S]=x;S&&S.target===d&&h&&e&&(h.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var A;(A=h)==null||A.observe(e)})),n()}),d&&!l&&h.observe(d),e&&h.observe(e));let f,g=l?je(t):null;l&&b();function b(){const x=je(t);g&&!oo(g,x)&&n(),g=x,f=requestAnimationFrame(b)}return n(),()=>{var x;c.forEach(S=>{r&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),p?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Zp=Cp,Yp=Tp,Jp=$p,Xp=Ep,eh=(t,e,n)=>{const s=new Map,r=n??{},i={...Vp,...r.platform,_c:s};return wp(t,e,{...r,platform:i})},th=(t,e)=>({top:e,bottom:e,right:t}),ao=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let r=!0,i=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=Qp(o,t,()=>{const d=++i;eh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Zp(8),Jp({padding:8,fallbackAxisSideDirection:"end"}),Yp({padding:8}),Xp({padding:8,apply:({availableWidth:c,availableHeight:p})=>{!r||d!==i||(t.style.width=`${Math.max(0,Math.min(n.width,c))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,p))}px`)}})]}).then(({x:c,y:p})=>{!r||d!==i||!t.isConnected||(t.style.left=`${c}px`,t.style.top=`${p}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{r=!1,l()}},lo=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class co{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,s,r){this.#t.get(e)?.(),this.#t.set(e,ao(e,n,s,r))}}function ms(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}const po=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},vt="dpk-version",ho="version",nh=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,dn=t=>nh.test(t),sh="https://cdn.jsdelivr.net/npm/dev-process-kit@",uo="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",ks=t=>{const e=new URLSearchParams(t),n=e.get(vt)??e.get(ho);return n!==null&&dn(n)?n:null},rh=(t,e)=>{const n=ks(t);return n===null||n===e?null:n},ih=(t,e)=>{if(!dn(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`${sh}${t}/dist/${e}`},oh=(t,e)=>{const n=new URL(t);return n.searchParams.delete(ho),e===null?n.searchParams.delete(vt):n.searchParams.set(vt,e),n.href},ah=O({tags:N(Ge(v(),ve()),{}),versions:j(O({version:v()}))}),lh=t=>{const e=Ft(ah,t),n=e.tags.latest;return{latest:typeof n=="string"&&dn(n)?n:null,versions:e.versions.map(s=>s.version).filter(dn)}},fo=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(r=>({value:r,label:r===s&&r!==t.current?t.text.latest(r):r}))]}};let pn;const go=()=>(pn??=fetch(uo).then(async t=>{if(!t.ok)throw new Error(`${uo} answered ${t.status}`);return lh(await t.json())}),pn.catch(()=>{pn=void 0}),pn),mo=t=>{location.assign(oh(location.href,t))},ch=t=>import(t),dh=({entry:t,templates:e,register:n,importModule:s=ch})=>{const r=()=>{n(),po(te,e,vt)},i=typeof location>"u"?null:rh(location.search,te);if(i===null){r();return}s(ih(i,t)).then(()=>{ph()||uh(i)},o=>{console.error(`dev-process-kit@${i} could not be loaded; running ${te}`,o),r()})},ph=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},bs="dpk-version-fallback",hh=`
1385
- .${bs} {
1384
+ `,Lp=t=>t==="changes"||t==="comments"?t:"all";class Ji extends me{static{this.styles=zd}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},section:{type:String}}}#e=yd();#t=null;#n=new Nn(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Li(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.#t;n&&(this.#t=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.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.#n.locale,section:Lp(this.section)}}render(){const e=this.#r();return e?Tp(_i(this.#n.locale),Ii(e,this.#e),this.#i,this.embedded):k}#s(e){this.#e=Li(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.#a();return;case"send":this.#o();return;case"edit-start":this.#t={kind:"editor",id:e.id},this.#s(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#t={kind:"edit-button",id:n.id}),this.#s(e);return}case"edit-save":{const n=$d(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#t={kind:"edit-button",id:n.id},this.#s({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=wd(this.#e,Ii(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#s({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#r();if(!e)return;this.#s({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??tn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),r=await os(s);this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:r})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:!1})}}}const Pp=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Ji)},Ze=Math.min,le=Math.max,rn=Math.round,on=Math.floor,ce=t=>({x:t,y:t}),zp={left:"right",right:"left",bottom:"top",top:"bottom"};function Mp(t,e,n){return le(t,Ze(e,n))}function kt(t,e){return typeof t=="function"?t(e):t}function Ie(t){return t.split("-")[0]}function bt(t){return t.split("-")[1]}function Xi(t){return t==="x"?"y":"x"}function eo(t){return t==="y"?"height":"width"}function de(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function to(t){return Xi(de(t))}function Ip(t,e,n){n===void 0&&(n=!1);const s=bt(t),r=to(t),i=eo(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=an(o)),[o,an(o)]}function Np(t){const e=an(t);return[ds(t),e,ds(e)]}function ds(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const no=["left","right"],so=["right","left"],Dp=["top","bottom"],jp=["bottom","top"];function qp(t,e,n){switch(t){case"top":case"bottom":return n?e?so:no:e?no:so;case"left":case"right":return e?Dp:jp;default:return[]}}function Bp(t,e,n,s){const r=bt(t);let i=qp(Ie(t),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),e&&(i=i.concat(i.map(ds)))),i}function an(t){const e=Ie(t);return zp[e]+t.slice(e.length)}function Hp(t){var e,n,s,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(r=t.left)!=null?r:0}}function Up(t){return typeof t!="number"?Hp(t):{top:t,right:t,bottom:t,left:t}}function ln(t){const{x:e,y:n,width:s,height:r}=t;return{width:s,height:r,top:n,left:e,right:e+s,bottom:n+r,x:e,y:n}}function ro(t,e,n){let{reference:s,floating:r}=t;const i=de(e),o=to(e),a=eo(o),l=Ie(e),d=i==="y",c=s.x+s.width/2-r.width/2,p=s.y+s.height/2-r.height/2,u=s[a]/2-r[a]/2;let h;switch(l){case"top":h={x:c,y:s.y-r.height};break;case"bottom":h={x:c,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:p};break;case"left":h={x:s.x-r.width,y:p};break;default:h={x:s.x,y:s.y}}const f=bt(e);return f&&(h[o]+=u*(f==="end"?1:-1)*(n&&d?-1:1)),h}async function Fp(t,e){var n;e===void 0&&(e={});const{x:s,y:r,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=kt(e,t),f=Up(h),b=a[u?p==="floating"?"reference":"floating":p],x=ln(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),S=p==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},H=ln(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:T,strategy:l}):S);return{top:(x.top-H.top+f.top)/_.y,bottom:(H.bottom-x.bottom+f.bottom)/_.y,left:(x.left-H.left+f.left)/_.x,right:(H.right-x.right+f.right)/_.x}}const Wp=50,Gp=async(t,e,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:Fp},l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:p}=ro(d,s,l),u=s,h=0;const f={};for(let g=0;g<i.length;g++){const b=i[g];if(!b)continue;const{name:x,fn:S}=b,{x:T,y:_,data:H,reset:P}=await S({x:c,y:p,initialPlacement:s,placement:u,strategy:r,middlewareData:f,rects:d,platform:a,elements:{reference:t,floating:e}});c=T??c,p=_??p,f[x]={...f[x],...H},P&&h<Wp&&(h++,typeof P=="object"&&(P.placement&&(u=P.placement),P.rects&&(d=P.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:r}):P.rects),{x:c,y:p}=ro(d,u,l)),g=-1)}return{x:c,y:p,placement:u,strategy:r,middlewareData:f}},Vp=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=kt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Ie(r),S=de(a),T=Ie(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),H=u||(T||!g?[an(a)]:Np(a)),P=f!=="none";!u&&P&&H.push(...Bp(a,g,f,_));const V=[a,...H],q=await l.detectOverflow(e,b),re=[];let ee=((s=i.flip)==null?void 0:s.overflows)||[];if(c&&re.push(q[x]),p){const we=Ip(r,o,_);re.push(q[we[0]],q[we[1]])}if(ee=[...ee,{placement:r,overflows:re}],!re.every(we=>we<=0)){var Zs,Ys;const we=(((Zs=i.flip)==null?void 0:Zs.index)||0)+1,$n=V[we];if($n&&(!(p==="alignment"?S!==de($n):!1)||ee.every(Z=>de(Z.placement)===S?Z.overflows[0]>0:!0)))return{data:{index:we,overflows:ee},reset:{placement:$n}};let et=(Ys=ee.filter($e=>$e.overflows[0]<=0).sort(($e,Z)=>$e.overflows[1]-Z.overflows[1])[0])==null?void 0:Ys.placement;if(!et)switch(h){case"bestFit":{var Js;const $e=(Js=ee.filter(Z=>{if(P){const ue=de(Z.placement);return ue===S||ue==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ue=>ue>0).reduce((ue,Ga)=>ue+Ga,0)]).sort((Z,ue)=>Z[1]-ue[1])[0])==null?void 0:Js[0];$e&&(et=$e);break}case"initialPlacement":et=a;break}if(r!==et)return{reset:{placement:et}}}return{}}}},Kp=new Set(["left","top"]);async function Qp(t,e){const{placement:n,platform:s,elements:r}=t,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Ie(n),a=bt(n),l=de(n)==="y",d=Kp.has(o)?-1:1,c=i&&l?-1:1,p=kt(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*c,y:u*d}:{x:u*d,y:h*c}}const Zp=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:r,y:i,placement:o,middlewareData:a}=e,l=await Qp(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:o}}}}},Yp=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:T,y:_}=S;return{x:T,y:_}}},...d}=kt(t,e),c={x:n,y:s},p=await i.detectOverflow(e,d),u=de(r),h=Xi(u);let f=c[h],g=c[u];const b=(S,T)=>Mp(T+p[S==="y"?"top":"left"],T,T-p[S==="y"?"bottom":"right"]);o&&(f=b(h,f)),a&&(g=b(u,g));const x=l.fn({...e,[h]:f,[u]:g});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[h]:o,[u]:a}}}}}},Jp=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:r,elements:i}=e,{apply:o=()=>{},...a}=kt(t,e),l=await r.detectOverflow(e,a),d=Ie(n),c=bt(n),p=de(n)==="y",{width:u,height:h}=s.floating;let f,g;d==="top"||d==="bottom"?(f=d,g=c===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=d,f=c==="end"?"top":"bottom");const b=h-l.top-l.bottom,x=u-l.left-l.right,S=Ze(h-l[f],b),T=Ze(u-l[g],x),_=e.middlewareData.shift,H=!_;let P=S,V=T;_!=null&&_.enabled.x&&(V=x),_!=null&&_.enabled.y&&(P=b),H&&!c&&(p?V=u-2*le(l.left,l.right):P=h-2*le(l.top,l.bottom)),await o({...e,availableWidth:V,availableHeight:P});const q=await r.getDimensions(i.floating);return u!==q.width||h!==q.height?{reset:{rects:!0}}:{}}}};function cn(){return typeof window<"u"}function Ye(t){return io(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pe(t){var e;return(e=(io(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function io(t){return cn()?t instanceof Node||t instanceof F(t).Node:!1}function ne(t){return cn()?t instanceof Element||t instanceof F(t).Element:!1}function xe(t){return cn()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function oo(t){return!cn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function dn(t){const{overflow:e,overflowX:n,overflowY:s,display:r}=se(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&r!=="inline"&&r!=="contents"}function Xp(t){return/^(table|td|th)$/.test(Ye(t))}function pn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const eh=/transform|translate|scale|rotate|perspective|filter/,th=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let ps;function hs(t){const e=ne(t)?se(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!us()&&(Ne(e.backdropFilter)||Ne(e.filter))||eh.test(e.willChange||"")||th.test(e.contain||"")}function nh(t){let e=De(t);for(;xe(e)&&!vt(e);){if(hs(e))return e;if(pn(e))return null;e=De(e)}return null}function us(){return ps==null&&(ps=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ps}function vt(t){return/^(html|body|#document)$/.test(Ye(t))}function se(t){return F(t).getComputedStyle(t)}function hn(t){return ne(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function De(t){if(Ye(t)==="html")return t;const e=t.assignedSlot||t.parentNode||oo(t)&&t.host||pe(t);return oo(e)?e.host:e}function ao(t){const e=De(t);return vt(e)?(t.ownerDocument||t).body:xe(e)&&dn(e)?e:ao(e)}function xt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ao(t),i=r===((s=t.ownerDocument)==null?void 0:s.body),o=F(r);if(i){const a=fs(o);return e.concat(o,o.visualViewport||[],dn(r)?r:[],a&&n?xt(a):[])}else return e.concat(r,xt(r,[],n))}function fs(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function lo(t){const e=se(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=xe(t),i=r?t.offsetWidth:n,o=r?t.offsetHeight:s,a=rn(n)!==i||rn(s)!==o;return a&&(n=i,s=o),{width:n,height:s,$:a}}function gs(t){return ne(t)?t:t.contextElement}function Je(t){const e=gs(t);if(!xe(e))return ce(1);const n=e.getBoundingClientRect(),{width:s,height:r,$:i}=lo(e);let o=(i?rn(n.width):n.width)/s,a=(i?rn(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const sh=ce(0);function co(t){const e=F(t);return!us()||!e.visualViewport?sh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function rh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===F(t)}function je(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=gs(t);let o=ce(1);e&&(s?ne(s)&&(o=Je(s)):o=Je(t));const a=rh(i,n,s)?co(i):ce(0);let l=(r.left+a.x)/o.x,d=(r.top+a.y)/o.y,c=r.width/o.x,p=r.height/o.y;if(i&&s){const u=F(i),h=ne(s)?F(s):s;let f=u,g=fs(f);for(;g&&h!==f;){const b=Je(g),x=g.getBoundingClientRect(),S=se(g),T=x.left+(g.clientLeft+parseFloat(S.paddingLeft))*b.x,_=x.top+(g.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,d*=b.y,c*=b.x,p*=b.y,l+=T,d+=_,f=F(g),g=fs(f)}}return ln({width:c,height:p,x:l,y:d})}function un(t,e){const n=hn(t).scrollLeft;return e?e.left+n:je(pe(t)).left+n}function po(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-un(t,n),r=n.top+e.scrollTop;return{x:s,y:r}}function ih(t){let{elements:e,rect:n,offsetParent:s,strategy:r}=t;const i=r==="fixed",o=pe(s),a=e?pn(e.floating):!1;if(s===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},d=ce(1);const c=ce(0),p=xe(s);if((p||!i)&&((Ye(s)!=="body"||dn(o))&&(l=hn(s)),p)){const h=je(s);d=Je(s),c.x=h.x+s.clientLeft,c.y=h.y+s.clientTop}const u=o&&!p&&!i?po(o,l):ce(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:n.y*d.y-l.scrollTop*d.y+c.y+u.y}}function oh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ah(t){const e=hn(t),n=t.ownerDocument.body,s=le(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=le(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+un(t);const o=-e.scrollTop;return se(n).direction==="rtl"&&(i+=le(t.clientWidth,n.clientWidth)-s),{width:s,height:r,x:i,y:o}}const lh=25;function ch(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",r=F(t),i=pe(t),o=r.visualViewport;let a=i.clientWidth,l=i.clientHeight,d=0,c=0;if(o){const u=!us()||e==="fixed";s?u||(d=-o.offsetLeft,c=-o.offsetTop):(a=o.width,l=o.height,u&&(d=o.offsetLeft,c=o.offsetTop))}if(un(i)<=0){const u=i.ownerDocument,h=u.body,f=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-g),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=lh&&(a-=x)}return{width:a,height:l,x:d,y:c}}function dh(t,e){const n=je(t,!0,e==="fixed"),s=n.top+t.clientTop,r=n.left+t.clientLeft,i=Je(t),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,d=s*i.y;return{width:o,height:a,x:l,y:d}}function ho(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=ch(t,n,e);else if(e==="document")s=ah(pe(t));else if(ne(e))s=dh(e,n);else{const r=co(t);s={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ln(s)}function ph(t,e){const n=e.get(t);if(n)return n;let s=xt(t,[],!1).filter(a=>ne(a)&&Ye(a)!=="body"),r=null;const i=se(t).position==="fixed";let o=i?De(t):t;for(;ne(o)&&!vt(o);){const a=se(o),l=hs(o),d=r?r.position:i?"fixed":"";!l&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(p=>p!==o):r=a,o=De(o)}return e.set(t,s),s}function hh(t){let{element:e,boundary:n,rootBoundary:s,strategy:r}=t;const o=[...n==="clippingAncestors"?pn(e)?[]:ph(e,this._c):[].concat(n),s],a=ho(e,o[0],r);let l=a.top,d=a.right,c=a.bottom,p=a.left;for(let u=1;u<o.length;u++){const h=ho(e,o[u],r);l=le(h.top,l),d=Ze(h.right,d),c=Ze(h.bottom,c),p=le(h.left,p)}return{width:d-p,height:c-l,x:p,y:l}}function uh(t){const{width:e,height:n}=lo(t);return{width:e,height:n}}function fh(t,e,n){const s=xe(e),r=pe(e),i=n==="fixed",o=je(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=ce(0);if((s||!i)&&((Ye(e)!=="body"||dn(r))&&(a=hn(e)),s)){const u=je(e,!0,i,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}!s&&r&&(l.x=un(r));const d=r&&!s&&!i?po(r,a):ce(0),c=o.left+a.scrollLeft-l.x-d.x,p=o.top+a.scrollTop-l.y-d.y;return{x:c,y:p,width:o.width,height:o.height}}function ms(t){return se(t).position==="static"}function uo(t,e){if(!xe(t)||se(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pe(t)===n&&(n=n.ownerDocument.body),n}function fo(t,e){const n=F(t);if(pn(t))return n;if(!xe(t)){let r=De(t);for(;r&&!vt(r);){if(ne(r)&&!ms(r))return r;r=De(r)}return n}let s=uo(t,e);for(;s&&Xp(s)&&ms(s);)s=uo(s,e);return s&&vt(s)&&ms(s)&&!hs(s)?n:s||nh(t)||n}const gh=async function(t){const e=this.getOffsetParent||fo,n=this.getDimensions,s=await n(t.floating);return{reference:fh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function mh(t){return se(t).direction==="rtl"}const kh={convertOffsetParentRelativeRectToViewportRelativeRect:ih,getDocumentElement:pe,getClippingRect:hh,getOffsetParent:fo,getElementRects:gh,getClientRects:oh,getDimensions:uh,getScale:Je,isElement:ne,isRTL:mh};function go(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function bh(t,e,n){let s=null,r;const i=pe(t);function o(){var c;clearTimeout(r),(c=s)==null||c.disconnect(),s=null}function a(c,p){c===void 0&&(c=!1),p===void 0&&(p=1),o();const u=t.getBoundingClientRect(),{left:h,top:f,width:g,height:b}=u;if(c||e(),!g||!b)return;const x=on(f),S=on(i.clientWidth-(h+g)),T=on(i.clientHeight-(f+b)),_=on(h),P={rootMargin:-x+"px "+-S+"px "+-T+"px "+-_+"px",threshold:le(0,Ze(1,p))||1};let V=!0;function q(re){const ee=re[0].intersectionRatio;if(!go(u,t.getBoundingClientRect()))return a();if(ee!==p){if(!V)return a();ee?a(!1,ee):r=setTimeout(()=>{a(!1,1e-7)},1e3)}V=!1}try{s=new IntersectionObserver(q,{...P,root:i.ownerDocument})}catch{s=new IntersectionObserver(q,P)}s.observe(t)}const l=F(t),d=()=>a(n);return l.addEventListener("resize",d),a(!0),()=>{l.removeEventListener("resize",d),o()}}function vh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=gs(t),c=r||i?[...d?xt(d):[],...e?xt(e):[]]:[];c.forEach(x=>{r&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const p=d&&a?bh(d,n,i):null;let u=-1,h=null;o&&(h=new ResizeObserver(x=>{let[S]=x;S&&S.target===d&&h&&e&&(h.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var T;(T=h)==null||T.observe(e)})),n()}),d&&!l&&h.observe(d),e&&h.observe(e));let f,g=l?je(t):null;l&&b();function b(){const x=je(t);g&&!go(g,x)&&n(),g=x,f=requestAnimationFrame(b)}return n(),()=>{var x;c.forEach(S=>{r&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),p?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const xh=Zp,yh=Yp,wh=Vp,$h=Jp,Sh=(t,e,n)=>{const s=new Map,r=n??{},i={...kh,...r.platform,_c:s};return Gp(t,e,{...r,platform:i})},Ah=(t,e)=>({top:e,bottom:e,right:t}),mo=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let r=!0,i=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=vh(o,t,()=>{const d=++i;Sh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[xh(8),wh({padding:8,fallbackAxisSideDirection:"end"}),yh({padding:8}),$h({padding:8,apply:({availableWidth:c,availableHeight:p})=>{!r||d!==i||(t.style.width=`${Math.max(0,Math.min(n.width,c))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,p))}px`)}})]}).then(({x:c,y:p})=>{!r||d!==i||!t.isConnected||(t.style.left=`${c}px`,t.style.top=`${p}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{r=!1,l()}},ko=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class bo{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,s,r){this.#t.get(e)?.(),this.#t.set(e,mo(e,n,s,r))}}function ks(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}class vo{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#t,!0),document.addEventListener("keydown",this.#n)}hostDisconnected(){document.removeEventListener("pointerdown",this.#t,!0),document.removeEventListener("keydown",this.#n)}#t=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#n=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const 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}},bs=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=xo(t.scrollTop,yo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},wo=(t,e,n=0)=>{const s=t.getBoundingClientRect(),r=e.getBoundingClientRect();t.scrollLeft=xo(t.scrollLeft,yo(s.left+t.clientLeft,t.clientWidth,n),{top:r.left,bottom:r.right})},$o=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},yt="dpk-version",So="version",Th=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,fn=t=>Th.test(t),Ch="https://cdn.jsdelivr.net/npm/dev-process-kit@",Ao="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",vs=t=>{const e=new URLSearchParams(t),n=e.get(yt)??e.get(So);return n!==null&&fn(n)?n:null},Eh=(t,e)=>{const n=vs(t);return n===null||n===e?null:n},Rh=(t,e)=>{if(!fn(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`${Ch}${t}/dist/${e}`},_h=(t,e)=>{const n=new URL(t);return n.searchParams.delete(So),e===null?n.searchParams.delete(yt):n.searchParams.set(yt,e),n.href},Oh=O({tags:D(Ge(v(),ve()),{}),versions:j(O({version:v()}))}),Lh=t=>{const e=Gt(Oh,t),n=e.tags.latest;return{latest:typeof n=="string"&&fn(n)?n:null,versions:e.versions.map(s=>s.version).filter(fn)}},To=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(r=>({value:r,label:r===s&&r!==t.current?t.text.latest(r):r}))]}};let gn;const Co=()=>(gn??=fetch(Ao).then(async t=>{if(!t.ok)throw new Error(`${Ao} answered ${t.status}`);return Lh(await t.json())}),gn.catch(()=>{gn=void 0}),gn),Eo=t=>{location.assign(_h(location.href,t))},Ph=t=>import(t),zh=({entry:t,templates:e,register:n,importModule:s=Ph})=>{const r=()=>{n(),$o(X,e,yt)},i=typeof location>"u"?null:Eh(location.search,X);if(i===null){r();return}s(Rh(i,t)).then(()=>{Mh()||Nh(i)},o=>{console.error(`dev-process-kit@${i} could not be loaded; running ${X}`,o),r()})},Mh=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},xs="dpk-version-fallback",Ih=`
1385
+ .${xs} {
1386
1386
  flex: none;
1387
1387
  height: 24px;
1388
1388
  margin-left: auto;
@@ -1400,26 +1400,26 @@ The brief is too long for a comment, so it is stored in this artifact's database
1400
1400
  letter-spacing: 0.02em;
1401
1401
  cursor: pointer;
1402
1402
  }
1403
- `,uh=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${bs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:hh}));for(const n of e)n.append(fh(n,t))}},fh=(t,e)=>{const n=z(Pt(Lt(t))),s=document.createElement("select");s.className=bs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const r=o=>{const a=fo({current:e,requested:ks(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},i=()=>{go().then(r,o=>console.warn(o))};return s.addEventListener("pointerenter",i,{once:!0}),s.addEventListener("focus",i,{once:!0}),s.addEventListener("change",()=>mo(s.value===""?null:s.value)),r(null),s};class ko{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#t,!0),document.addEventListener("keydown",this.#n)}hostDisconnected(){document.removeEventListener("pointerdown",this.#t,!0),document.removeEventListener("keydown",this.#n)}#t=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#n=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const gh=O({value:v()}),mh=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(gh,e.detail);n.success&&t(n.output.value)},vs=t=>e=>{const n=Ee(e.target,HTMLSelectElement);n!==null&&t(n.value)},kh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.value,n)},bh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.checked)},bo=(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),vo=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},xs=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=bo(t.scrollTop,vo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},xo=(t,e,n=0)=>{const s=t.getBoundingClientRect(),r=e.getBoundingClientRect();t.scrollLeft=bo(t.scrollLeft,vo(s.left+t.clientLeft,t.clientWidth,n),{top:r.left,bottom:r.right})},yo="data-dpk-changes",vh=/^[^:\s]+:\S+$/,xh=P({id:N(y(v(),$(1))),title:y(v(),$(1)),body:N(v()),target:N(y(v(),be(vh,'target must be written "type:id"'))),navigate:N(y(v(),Gr("=",'navigate must be written "key=value"')))}),yh=j(xh),wh=y(v(),$(1)),wo=P({revision:wh,changes:yh}),$h=P({revisions:y(j(wo),$(1,"list at least one version"))}),Sh=(t,e)=>JSON.stringify([t,e]),xt=t=>[...t.earlier,t.latest],Ah=t=>{const e=t.changes.map((s,r)=>{const i=s.id??String(r);return{key:Sh(t.revision,i),id:i,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}},Ch=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?$h:wo,t);if(!n.success)return{ok:!1,error:Ac(n.issues)};const s=n.output,r="revisions"in s?s.revisions:[s],i=[];for(const a of r){if(i.some(d=>d.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=Ah(a);if(typeof l=="string")return{ok:!1,error:l};i.push(l)}const o=i.pop();return o?{ok:!0,log:{earlier:i,latest:o}}:{ok:!1,error:"list at least one version"}},Th=P({v:G(1),revision:v(),seen:j(v())}),Eh=P({v:G(2),since:v(),seen:Ge(v(),j(v()))}),$o=t=>{const e=C(Eh,t);if(e.success)return e.output;const n=C(Th,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},ys={open:!1,fresh:new Set},So=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),ws=(t,e)=>xt(t).flatMap(n=>n.entries.filter(So(e))),Ao=t=>t.target!==null||t.navigate!==null,Rh=(t,e)=>{const n=xt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),r=e===null?[t.latest]:n.slice(Math.max(0,s)),i=new Set(r.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(r.map(o=>o.revision)),seen:i,toasts:t.latest.entries.filter(o=>!i.has(o.key)).map(o=>o.key),list:ys}},$s=(t,e)=>new Set([...t.seen,...e]),_h=(t,e,n)=>{switch(n.kind){case"open-list":{const s=ws(t,e),r=new Set(s.map(o=>o.key)),i=s.filter(o=>!Ao(o)).map(o=>o.key);return{...e,seen:$s(e,i),toasts:[],list:{open:!0,fresh:r}}}case"close-list":return{...e,list:ys};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:$s(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:ys};case"read-all":return{...e,seen:$s(e,ws(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Oh=(t,e)=>ws(t,e).length,Lh=(t,e)=>{const n=xt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(So(e))),r=s===-1?n.length-1:s,i=n.slice(r).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[r]?.revision??t.latest.revision,seen:Object.fromEntries(i)}},Ph=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?Yt(t.navigate):t.target!==null?e(pt(t.target)):null,target:t.target},Co=3,zh=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Ao(e),fresh:t.list.fresh.has(e.key)}),Mh=(t,e)=>{const n=xt(t).map(i=>({revision:i.revision,latest:i===t.latest,cards:i.entries.map(zh(e))})).reverse(),s=new Map(n.flatMap(i=>i.cards.map(o=>[o.key,o]))),r=e.toasts.flatMap(i=>{const o=s.get(i);return o?[o]:[]});return{unread:Oh(t,e),open:e.list.open,groups:n,toasts:r.slice(0,Co),waiting:Math.max(0,r.length-Co)}},yt=t=>t==="light"||t==="dark"?t:null,To=t=>t.authored??t.environment,Eo=t=>t.preference??To(t),Ih=t=>{const e=Eo(t)==="dark"?"light":"dark";return e===To(t)?null:e},Ro=j(P({value:y(v(),be(/^element:.+/)),label:y(v(),$(1)),group:U(v())})),Nh=O({targets:Ro,providers:j(O({id:y(v(),$(1)),results:j(pi)}))}),Dh=P({target:y(v(),be(/^element:.+/)),body:y(v(),Wn(),$(1))}),_o=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,jh=(t,e,n)=>{const s=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||s.has(D(i)),commentTargets:(r,i)=>{const o=t.commentTargets(r,i),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(r,i,o)=>{if(ee(r)){const d=n.get(r.id),c=s.get(D(r.target));return{title:d?.title??r.type,...d?.summary===void 0?{}:{summary:d.summary},tone:d?.tone??"update",targetLabel:c?_o(c):r.target.id}}const a=t.describe(r,i,o),l=r.type==="comment"&&!t.hasTarget(i,r.target)?s.get(D(r.target)):void 0;return l===void 0?a:{...a,targetLabel:_o(l)}},serialize:r=>ee(r)?`${r.type} ${D(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},Oo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Lo(t){return typeof Oo.Buffer<"u"&&Oo.Buffer.isBuffer(t)}function Po(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 zo(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Mo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const qh="[object RegExp]",Bh="[object String]",Hh="[object Number]",Uh="[object Boolean]",Fh="[object Symbol]",Wh="[object Date]",Gh="[object Map]",Vh="[object Set]",Kh="[object Array]",Qh="[object Function]",Zh="[object ArrayBuffer]",Ss="[object Object]",Yh="[object Error]",Jh="[object DataView]",Xh="[object Uint8Array]",eu="[object Uint8ClampedArray]",tu="[object Uint16Array]",nu="[object Uint32Array]",su="[object BigUint64Array]",ru="[object Int8Array]",iu="[object Int16Array]",ou="[object Int32Array]",au="[object BigInt64Array]",lu="[object Float32Array]",cu="[object Float64Array]";function du(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function pu(t,e,n){return wt(t,e,void 0,void 0,void 0,void 0,n)}function wt(t,e,n,s,r,i,o){const a=o(t,e,n,s,r,i);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 $t(t,e,i,o)}return $t(t,e,i,o)}function $t(t,e,n,s){if(Object.is(t,e))return!0;let r=Mo(t),i=Mo(e);if(r==="[object Arguments]"&&(r=Ss),i==="[object Arguments]"&&(i=Ss),r!==i)return!1;switch(r){case Bh:return t.toString()===e.toString();case Hh:return du(t.valueOf(),e.valueOf());case Uh:case Wh:case Fh:return Object.is(t.valueOf(),e.valueOf());case qh:return t.source===e.source&&t.flags===e.flags;case Qh: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(r){case Gh:if(t.size!==e.size)return!1;for(const[l,d]of t.entries())if(!e.has(l)||!wt(d,e.get(l),l,t,e,n,s))return!1;return!0;case Vh:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),d=Array.from(e.values());for(let c=0;c<l.length;c++){const p=l[c],u=d.findIndex(h=>wt(p,h,void 0,t,e,n,s));if(u===-1)return!1;d.splice(u,1)}return!0}case Kh:case Xh:case eu:case tu:case nu:case su:case ru:case iu:case ou:case au:case lu:case cu:if(Lo(t)!==Lo(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!wt(t[l],e[l],l,t,e,n,s))return!1;return!0;case Zh:return t.byteLength!==e.byteLength?!1:$t(new Uint8Array(t),new Uint8Array(e),n,s);case Jh:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:$t(new Uint8Array(t),new Uint8Array(e),n,s);case Yh:return t.name===e.name&&t.message===e.message;case Ss:{if(!($t(t.constructor,e.constructor,n,s)||Po(t)&&Po(e)))return!1;const l=[...Object.keys(t),...zo(t)],d=[...Object.keys(e),...zo(e)];if(l.length!==d.length)return!1;for(let c=0;c<l.length;c++){const p=l[c],u=t[p];if(!Object.hasOwn(e,p))return!1;const h=e[p];if(!wt(u,h,p,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function hu(){}function hn(t,e){return pu(t,e,hu)}const Io="page",No=t=>D(t),Do=(t,e,n,s=new Map,r=ut)=>{let i=e,o={};const a=[],l=[],d=[],c=[],p=new Map;for(const h of n){if(h.type===B)continue;if(ee(h)){const b=s.get(h.id);b===void 0||b.stale!==void 0?l.push({action:h,reason:b?.stale??"target-missing"}):a.push(h);continue}if(J(h)){const b=yi(r,o,h);b===null?l.push({action:h,reason:Ve(r,h.target.id)?"constraint-violated":"target-missing"}):b===o?d.push(h):(o=b,a.push(h));continue}const f=Vt(t.actions,h.type);if(!f){l.push({action:h,reason:"unsupported-action-type"});continue}const g=t.apply(i,h);if(g===null){l.push({action:h,reason:t.hasTarget(i,h.target)?"constraint-violated":"target-missing"});continue}if(f.mode!=="append"&&As(t,i,g)){d.push(h);continue}i=g,a.push(h)}for(const h of n){if(h.type!==B)continue;if(h.target.type!==Io&&!t.hasTarget(i,h.target)){l.push({action:h,reason:"target-missing"});continue}c.push(h);const f=No(h.target);p.set(f,[...p.get(f)??[],h])}const u=new Map(n.map((h,f)=>[h.id,f]));return l.sort((h,f)=>(u.get(h.action.id)??0)-(u.get(f.action.id)??0)),{base:e,state:i,actions:n,applied:a,stale:l,obsolete:d,comments:c,commentsByTarget:p,grill:r,answers:o}},As=(t,e,n)=>e===n?!0:t.canonicalState===void 0?hn(e,n):hn(t.canonicalState(e),t.canonicalState(n)),jo=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},uu=(t,e,n,s)=>{let r=e;const i=s??qo(r).map(o=>o.id);for(const o of[...i].reverse())r=fu(t,r,n,o,s!==void 0)??r;return r},qo=t=>t.applied.filter(e=>!ee(e)&&!J(e)),fu=(t,e,n,s,r)=>{const i=qo(e),o=i.findIndex(u=>u.id===s),a=i[o];if(a===void 0)return null;const l=i.slice(0,o),d=[...r?gu(t,e.base,i,o):[],...mu(t,l,a)],c=new Set,p=d.filter(u=>{const h=u.join(" ");return c.has(h)?!1:(c.add(h),!0)}).sort((u,h)=>h.length-u.length);for(const u of p){const h=ku(t,e,n,u);if(h!==null)return h}return null},gu=(t,e,n,s)=>{const r=[];let i=e;for(const o of n.slice(0,s+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,a)=>As(t,o,i)?[n.slice(a,s+1).map(l=>l.id)]:[])},mu=(t,e,n)=>{const s=Bo(n),r=e.filter(l=>Bo(l).some(d=>s.includes(d))),i=Ho(t,n),o=r.filter(l=>Ho(t,l)===i),a=l=>l.map((d,c)=>[...l.slice(c).map(p=>p.id),n.id]);return[...a(r),...a(o),...r.map(l=>[l.id,n.id]),...r.map(l=>[l.id])]},Bo=t=>{const e=t.target.type===Io?[]: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]},Ho=(t,e)=>Vt(t.actions,e.type)?.mode,ku=(t,e,n,s)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(s);for(;;){const o=n(e.actions.filter(l=>!i.has(l.id))),a=o.stale.filter(l=>!r.has(l.action.id)).map(l=>l.action);if(a.length===0)return As(t,o.state,e.state)?o:null;if(a.some(l=>l.type===B||ee(l)||J(l)))return null;for(const l of a)i.add(l.id)}},bu=(t,e,n)=>{const s=xi(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const r=Ve(e,n.target.id)?.options.find(i=>i.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(r?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},vu=(t,e)=>{const{grill:n}=e,s=z(e.locale);return{...t,hasTarget:(r,i)=>i.type===oe?Ve(n,i.id)!==void 0:t.hasTarget(r,i),commentTargets:(r,i)=>[...t.commentTargets(r,i),...n.questions.map(o=>({value:D({type:oe,id:o.id}),label:ts(n,o.id),group:s.grillGroup}))],describe:(r,i,o)=>{const a=ts(n,r.target.id);if(J(r)){const{title:d,summary:c,tone:p}=bu(s,n,r);return{title:d,tone:p,targetLabel:a,...c===void 0?{}:{summary:c}}}const l=t.describe(r,i,o);return r.target.type===oe?{...l,targetLabel:a}:l},serialize:r=>J(r)?`${r.type} ${D(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},xu=O({v:G(1),template:y(v(),$(1)),actions:j(ve())});class Cs{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const r=C(xu,JSON.parse(s));return!r.success||r.output.template!==n?[]:r.output.actions.flatMap(i=>{const o=C(Pe,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const r={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class Ts{constructor(){this.store=new Map}load(e,n){return new Cs({getItem:s=>this.store.get(s)??null,setItem:(s,r)=>{this.store.set(s,r)},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 Es=()=>{try{if(typeof localStorage<"u")return new Cs(localStorage)}catch{}return new Ts},un=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,yu=j(ve());class Uo{#e;#t;#n={targets:[],providers:[]};#r;#s=new Map;#i;#o;#a;#l;#c;#d=new Set;#g=[];#b=0;constructor(e){this.#e=e.definition,this.#r=e.grill??{grill:ut,locale:"en"},this.#t=this.#v(),this.#i=e.base,this.#c=e.storageKey??un(e.definition.name),this.#l=e.storage===void 0?Es():e.storage;const n=e.initialActions??this.#l?.load(this.#c,this.definition.name)??[];this.#o=Go(this.definition,n),this.#a=this.#p(this.#o),this.#h()&&this.#A()}get definition(){return this.#t}setComponentSnapshot(e){const n=Ft(Nh,e);if(!hn(n,this.#n)){this.#n=n,this.#m(),this.#a=this.#p(this.#o);for(const s of this.#d)s()}}setTemplate(e){this.#e=e,this.#m(),this.#a=this.#p(this.#o);for(const n of this.#d)n()}setGrill(e){this.#r=e,this.#m(),this.#a=this.#p(this.#o);for(const n of this.#d)n()}#m(){this.#s=hi(this.#o,this.#n.providers),this.#t=this.#v()}#v(){return vu(jh(this.#e,this.#n.targets,this.#s),this.#r)}#p(e){return Do(this.definition,this.#i,e,hi(e,this.#n.providers),this.#r.grill)}get base(){return this.#i}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#g}get prunedCount(){return this.#b}descriptorFor(e,n){return Fo(this.definition,e,n)}dispatch(e){const n=this.#$(e,this.#a.state);if(!n.ok)return this.#u([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#k(Wo(this.#o,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#u([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(yu,e);if(!n.success)return this.#u([ze(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let r=this.#o,i=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const d=this.#$(l,i);if(!d.ok)return this.#u([d.issue]);const c=d.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#u([{path:"type",message:"unknown action type"}]);if((J(c)?yi(this.#r.grill,o,c)===null?null:i:c.type==="comment"||ee(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#u([{path:"target",message:"batch action is not applicable"}]);r=Wo(r,c,p);const h=this.#p(r);i=h.state,o=h.answers,a.push(c.id)}return this.#k(r,a),{ok:!0,ids:a}}#$(e,n){const s=C(oi,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const r=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Kn(s.output.target,"page"):s.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const i=Mc(s.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(n,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#u(e){return this.#g=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==B)return this.#u([{path:"id",message:`no comment "${e}" in the draft`}]);if(ht(s)===n)return{ok:!0,id:e};const r=C(Yn.schema,{...s,payload:{body:n}});if(!r.success)return this.#u([ze(r.issues)]);const i=C(Pe,r.output);if(!i.success)return this.#u([ze(i.issues)]);const o=i.output;return this.#k(this.#o.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#k(n)}clearActions(){this.#o.length>0&&this.#k([])}replaceActions(e){this.#k(Go(this.definition,e))}setBase(e){this.#i=e,this.#k(this.#o)}subscribe(e){return this.#d.add(e),()=>{this.#d.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#k(e,n){this.#g=[],this.#o=e,this.#m(),this.#a=this.#p(this.#o),this.#h(n),this.#A();for(const s of this.#d)s()}#h(e){const n=this.#x(),s=uu(this.definition,this.#a,r=>this.#p(r),e);return s===this.#a?n:(this.#b+=this.#o.length-s.actions.length,this.#o=[...s.actions],this.#m(),this.#a=this.#p(this.#o),this.#x(),!0)}#x(){return this.#a.obsolete.length===0?!1:(this.#b+=this.#a.obsolete.length,this.#o=jo(this.#a),this.#m(),this.#a=this.#p(this.#o),!0)}#A(){this.#l?.save(this.#c,this.definition.name,this.#o)}}const Fo=(t,e,n)=>e==="comment"?Yn:e===Kt?Jc:n!==void 0&&ee({type:e,target:n})?qc:Vt(t.actions,e),Wo=(t,e,n)=>J(e)?ed(t,e):ai(t,e,n),Go=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const r=s.output,i=Fo(t,r.type,r.target);if(!i)return[];const o=C(i.schema,r);if(!o.success)return[];const a=C(Pe,o.output);return a.success?[a.output]:[]}),wu=()=>({status:{kind:"idle"},request:0}),$u=(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}},Su=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=z(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"?Ci(s.reason,t.locale):null}},Vo=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},Au=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:D(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)}},Cu=(t,e)=>{const n=()=>Vo(t);return{version:te,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,r)=>t.dispatch({type:B,target:s,payload:{body:r}}),editComment:(s,r)=>t.editComment(s,r),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,r)=>t.navigate(s,r),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(te),exportBrief:()=>rs(n(),t.controller().definition,te),subscribe:s=>t.subscribe(s)}},Rs=(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{}}}),pe=t=>{const e=new Map;return Rs({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Je=t=>{try{if(typeof localStorage<"u")return Rs(localStorage,t)}catch{}return pe(t)},Tu=t=>{try{if(typeof sessionStorage<"u")return Rs(sessionStorage,t)}catch{}return pe(t)},Eu=8e3,Ru=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(yo);class _u{#e;#t;#n=null;#r=null;#s=null;#i=null;#o="";#a=null;#l=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get view(){return this.#n&&this.#s?Mh(this.#n,this.#s):null}get error(){return this.#r}hostConnected(){!this.#g()&&!this.#b()&&this.#p(),document.addEventListener("pointerdown",this.#h,!0),document.addEventListener("keydown",this.#x)}hostUpdate(){!this.#g()&&this.#b()&&this.#$()}hostDisconnected(){this.#$(),document.removeEventListener("pointerdown",this.#h,!0),document.removeEventListener("keydown",this.#x);for(const e of this.#l.values())e.handle!==null&&clearTimeout(e.handle);this.#l.clear()}send(e){!this.#n||!this.#s||(this.#s=_h(this.#n,this.#s,e),this.#m(),this.#u(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#s?.list.open?"close-list":"open-list"})}show(e){const n=this.#n?xt(this.#n).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#t.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const r of this.#l.values())r.handle!==null&&clearTimeout(r.handle),r.handle=null,r.remaining=Math.max(0,r.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#l)this.#k(n,s)}#d(){return`${this.#t.storageKey()}:seen-changes`}#g(){return this.#n!==null||this.#r!==null}#b(){const e=[...this.#e.children].find(Ru);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(r){return this.#v(r instanceof Error?r.message:String(r))}const s=Ch(n);return s.ok?(this.#n=s.log,this.#i=this.#t.persist()?Je($o):pe($o),this.#s=Rh(s.log,this.#i.read(this.#d())),this.#m(),this.#u(),this.#e.requestUpdate(),!0):this.#v(s.error)}#m(){if(!this.#n||!this.#s)return;const e=Lh(this.#n,this.#s),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#d(),e))}#v(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#p(){this.#a=new MutationObserver(()=>{(this.#g()||this.#b())&&this.#$()}),this.#a.observe(this.#e,{childList:!0})}#$(){this.#a?.disconnect(),this.#a=null}#u(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#l)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#l.delete(n));for(const n of e){if(this.#l.has(n))continue;const s={handle:null,deadline:0,remaining:Eu};this.#l.set(n,s),this.#c.size===0&&this.#k(n,s)}}#k(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#h=e=>{!this.#s?.list.open||this.#t.inside(e.composedPath())||this.send({kind:"close-list"})};#x=e=>{e.key!=="Escape"||!this.#s?.list.open||this.send({kind:"close-list"})}}const fn="dpk-changes",Ou=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return m`<button
1403
+ `,Nh=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${xs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:Ih}));for(const n of e)n.append(Dh(n,t))}},Dh=(t,e)=>{const n=L(Mt(zt(t))),s=document.createElement("select");s.className=xs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const r=o=>{const a=To({current:e,requested:vs(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},i=()=>{Co().then(r,o=>console.warn(o))};return s.addEventListener("pointerenter",i,{once:!0}),s.addEventListener("focus",i,{once:!0}),s.addEventListener("change",()=>Eo(s.value===""?null:s.value)),r(null),s},jh=O({value:v()}),qh=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(jh,e.detail);n.success&&t(n.output.value)},ys=t=>e=>{const n=Ee(e.target,HTMLSelectElement);n!==null&&t(n.value)},Bh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.value,n)},Hh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.checked)},Ro="data-dpk-changes",Uh=/^[^:\s]+:\S+$/,Fh=z({id:D(y(v(),$(1))),title:y(v(),$(1)),body:D(v()),target:D(y(v(),oe(Uh,'target must be written "type:id"'))),navigate:D(y(v(),Xr("=",'navigate must be written "key=value"')))}),Wh=j(Fh),Gh=y(v(),$(1)),_o=z({revision:Gh,changes:Wh}),Vh=z({revisions:y(j(_o),$(1,"list at least one version"))}),Kh=(t,e)=>JSON.stringify([t,e]),wt=t=>[...t.earlier,t.latest],Qh=t=>{const e=t.changes.map((s,r)=>{const i=s.id??String(r);return{key:Kh(t.revision,i),id:i,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}},Zh=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?Vh:_o,t);if(!n.success)return{ok:!1,error:Uc(n.issues)};const s=n.output,r="revisions"in s?s.revisions:[s],i=[];for(const a of r){if(i.some(d=>d.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=Qh(a);if(typeof l=="string")return{ok:!1,error:l};i.push(l)}const o=i.pop();return o?{ok:!0,log:{earlier:i,latest:o}}:{ok:!1,error:"list at least one version"}},Yh=z({v:G(1),revision:v(),seen:j(v())}),Jh=z({v:G(2),since:v(),seen:Ge(v(),j(v()))}),Oo=t=>{const e=C(Jh,t);if(e.success)return e.output;const n=C(Yh,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},ws={open:!1,fresh:new Set},Lo=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),$s=(t,e)=>wt(t).flatMap(n=>n.entries.filter(Lo(e))),Po=t=>t.target!==null||t.navigate!==null,Xh=(t,e)=>{const n=wt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),r=e===null?[t.latest]:n.slice(Math.max(0,s)),i=new Set(r.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(r.map(o=>o.revision)),seen:i,toasts:t.latest.entries.filter(o=>!i.has(o.key)).map(o=>o.key),list:ws}},Ss=(t,e)=>new Set([...t.seen,...e]),eu=(t,e,n)=>{switch(n.kind){case"open-list":{const s=$s(t,e),r=new Set(s.map(o=>o.key)),i=s.filter(o=>!Po(o)).map(o=>o.key);return{...e,seen:Ss(e,i),toasts:[],list:{open:!0,fresh:r}}}case"close-list":return{...e,list:ws};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ss(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:ws};case"read-all":return{...e,seen:Ss(e,$s(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},tu=(t,e)=>$s(t,e).length,nu=(t,e)=>{const n=wt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Lo(e))),r=s===-1?n.length-1:s,i=n.slice(r).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[r]?.revision??t.latest.revision,seen:Object.fromEntries(i)}},su=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?Xt(t.navigate):t.target!==null?e(ut(t.target)):null,target:t.target},zo=3,ru=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Po(e),fresh:t.list.fresh.has(e.key)}),iu=(t,e)=>{const n=wt(t).map(i=>({revision:i.revision,latest:i===t.latest,cards:i.entries.map(ru(e))})).reverse(),s=new Map(n.flatMap(i=>i.cards.map(o=>[o.key,o]))),r=e.toasts.flatMap(i=>{const o=s.get(i);return o?[o]:[]});return{unread:tu(t,e),open:e.list.open,groups:n,toasts:r.slice(0,zo),waiting:Math.max(0,r.length-zo)}},$t=t=>t==="light"||t==="dark"?t:null,Mo=t=>t.authored??t.environment,Io=t=>t.preference??Mo(t),ou=t=>{const e=Io(t)==="dark"?"light":"dark";return e===Mo(t)?null:e},No=j(z({value:y(v(),oe(/^element:.+/)),label:y(v(),$(1)),group:U(v())})),au=O({targets:No,providers:j(O({id:y(v(),$(1)),results:j(vi)}))}),lu=z({target:y(v(),oe(/^element:.+/)),body:y(v(),Zn(),$(1))}),Do=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,cu=(t,e,n)=>{const s=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||s.has(I(i)),commentTargets:(r,i)=>{const o=t.commentTargets(r,i),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(r,i,o)=>{if(te(r)){const d=n.get(r.id),c=s.get(I(r.target));return{title:d?.title??r.type,...d?.summary===void 0?{}:{summary:d.summary},tone:d?.tone??"update",targetLabel:c?Do(c):r.target.id}}const a=t.describe(r,i,o),l=r.type==="comment"&&!t.hasTarget(i,r.target)?s.get(I(r.target)):void 0;return l===void 0?a:{...a,targetLabel:Do(l)}},serialize:r=>te(r)?`${r.type} ${I(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},jo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function qo(t){return typeof jo.Buffer<"u"&&jo.Buffer.isBuffer(t)}function Bo(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 Ho(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Uo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const du="[object RegExp]",pu="[object String]",hu="[object Number]",uu="[object Boolean]",fu="[object Symbol]",gu="[object Date]",mu="[object Map]",ku="[object Set]",bu="[object Array]",vu="[object Function]",xu="[object ArrayBuffer]",As="[object Object]",yu="[object Error]",wu="[object DataView]",$u="[object Uint8Array]",Su="[object Uint8ClampedArray]",Au="[object Uint16Array]",Tu="[object Uint32Array]",Cu="[object BigUint64Array]",Eu="[object Int8Array]",Ru="[object Int16Array]",_u="[object Int32Array]",Ou="[object BigInt64Array]",Lu="[object Float32Array]",Pu="[object Float64Array]";function zu(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Mu(t,e,n){return St(t,e,void 0,void 0,void 0,void 0,n)}function St(t,e,n,s,r,i,o){const a=o(t,e,n,s,r,i);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 At(t,e,i,o)}return At(t,e,i,o)}function At(t,e,n,s){if(Object.is(t,e))return!0;let r=Uo(t),i=Uo(e);if(r==="[object Arguments]"&&(r=As),i==="[object Arguments]"&&(i=As),r!==i)return!1;switch(r){case pu:return t.toString()===e.toString();case hu:return zu(t.valueOf(),e.valueOf());case uu:case gu:case fu:return Object.is(t.valueOf(),e.valueOf());case du:return t.source===e.source&&t.flags===e.flags;case vu:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(r){case mu:if(t.size!==e.size)return!1;for(const[l,d]of t.entries())if(!e.has(l)||!St(d,e.get(l),l,t,e,n,s))return!1;return!0;case ku:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),d=Array.from(e.values());for(let c=0;c<l.length;c++){const p=l[c],u=d.findIndex(h=>St(p,h,void 0,t,e,n,s));if(u===-1)return!1;d.splice(u,1)}return!0}case bu:case $u:case Su:case Au:case Tu:case Cu:case Eu:case Ru:case _u:case Ou:case Lu:case Pu:if(qo(t)!==qo(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!St(t[l],e[l],l,t,e,n,s))return!1;return!0;case xu:return t.byteLength!==e.byteLength?!1:At(new Uint8Array(t),new Uint8Array(e),n,s);case wu:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:At(new Uint8Array(t),new Uint8Array(e),n,s);case yu:return t.name===e.name&&t.message===e.message;case As:{if(!(At(t.constructor,e.constructor,n,s)||Bo(t)&&Bo(e)))return!1;const l=[...Object.keys(t),...Ho(t)],d=[...Object.keys(e),...Ho(e)];if(l.length!==d.length)return!1;for(let c=0;c<l.length;c++){const p=l[c],u=t[p];if(!Object.hasOwn(e,p))return!1;const h=e[p];if(!St(u,h,p,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Iu(){}function mn(t,e){return Mu(t,e,Iu)}const Ts="page",Fo=t=>I(t),Wo=(t,e,n,s=new Map,r=Ve)=>{let i=e,o={};const a=[],l=[],d=[],c=[],p=new Map;for(const h of n){if(h.type===B)continue;if(te(h)){const b=s.get(h.id);b===void 0||b.stale!==void 0?l.push({action:h,reason:b?.stale??"target-missing"}):a.push(h);continue}if(Q(h)){const b=Ri(r,o,h);b===null?l.push({action:h,reason:Ke(r,h.target.id)?"constraint-violated":"target-missing"}):b===o?d.push(h):(o=b,a.push(h));continue}const f=ht(t.actions,h.type);if(!f){l.push({action:h,reason:"unsupported-action-type"});continue}const g=t.apply(i,h);if(g===null){l.push({action:h,reason:t.hasTarget(i,h.target)?"constraint-violated":"target-missing"});continue}if(f.mode!=="append"&&Cs(t,i,g)){d.push(h);continue}i=g,a.push(h)}for(const h of n){if(h.type!==B)continue;if(!(h.target.type===Ts?t.pageTargetExists?.(i,h.target)??!0:t.hasTarget(i,h.target))){l.push({action:h,reason:"target-missing"});continue}c.push(h);const g=Fo(h.target);p.set(g,[...p.get(g)??[],h])}const u=new Map(n.map((h,f)=>[h.id,f]));return l.sort((h,f)=>(u.get(h.action.id)??0)-(u.get(f.action.id)??0)),{base:e,state:i,actions:n,applied:a,stale:l,obsolete:d,comments:c,commentsByTarget:p,grill:r,answers:o}},Cs=(t,e,n)=>e===n?!0:t.canonicalState===void 0?mn(e,n):mn(t.canonicalState(e),t.canonicalState(n)),Go=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},Nu=(t,e,n,s)=>{let r=e;const i=s??Vo(r).map(o=>o.id);for(const o of[...i].reverse())r=Du(t,r,n,o,s!==void 0)??r;return r},Vo=t=>t.applied.filter(e=>!te(e)&&!Q(e)),Du=(t,e,n,s,r)=>{const i=Vo(e),o=i.findIndex(u=>u.id===s),a=i[o];if(a===void 0)return null;const l=i.slice(0,o),d=[...r?ju(t,e.base,i,o):[],...qu(t,l,a)],c=new Set,p=d.filter(u=>{const h=u.join(" ");return c.has(h)?!1:(c.add(h),!0)}).sort((u,h)=>h.length-u.length);for(const u of p){const h=Bu(t,e,n,u);if(h!==null)return h}return null},ju=(t,e,n,s)=>{const r=[];let i=e;for(const o of n.slice(0,s+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,a)=>Cs(t,o,i)?[n.slice(a,s+1).map(l=>l.id)]:[])},qu=(t,e,n)=>{const s=Ko(n),r=e.filter(l=>Ko(l).some(d=>s.includes(d))),i=Qo(t,n),o=r.filter(l=>Qo(t,l)===i),a=l=>l.map((d,c)=>[...l.slice(c).map(p=>p.id),n.id]);return[...a(r),...a(o),...r.map(l=>[l.id,n.id]),...r.map(l=>[l.id])]},Ko=t=>{const e=t.target.type===Ts?[]: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]},Qo=(t,e)=>ht(t.actions,e.type)?.mode,Bu=(t,e,n,s)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(s);for(;;){const o=n(e.actions.filter(l=>!i.has(l.id))),a=o.stale.filter(l=>!r.has(l.action.id)).map(l=>l.action);if(a.length===0)return Cs(t,o.state,e.state)?o:null;if(a.some(l=>l.type===B||te(l)||Q(l)))return null;for(const l of a)i.add(l.id)}},Hu=(t,e,n)=>{const s=Ei(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const r=Ke(e,n.target.id)?.options.find(i=>i.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(r?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},Uu=(t,e)=>{const{grill:n}=e,s=L(e.locale);return{...t,hasTarget:(r,i)=>i.type===ae?Ke(n,i.id)!==void 0:t.hasTarget(r,i),commentTargets:(r,i)=>[...t.commentTargets(r,i),...n.questions.map(o=>({value:I({type:ae,id:o.id}),label:is(n,o.id),group:s.grillGroup}))],describe:(r,i,o)=>{const a=is(n,r.target.id);if(Q(r)){const{title:d,summary:c,tone:p}=Hu(s,n,r);return{title:d,tone:p,targetLabel:a,...c===void 0?{}:{summary:c}}}const l=t.describe(r,i,o);return r.target.type===ae?{...l,targetLabel:a}:l},serialize:r=>Q(r)?`${r.type} ${I(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},Fu=O({v:G(1),template:y(v(),$(1)),actions:j(ve())});class Es{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const r=C(Fu,JSON.parse(s));return!r.success||r.output.template!==n?[]:r.output.actions.flatMap(i=>{const o=C(Pe,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const r={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class Rs{constructor(){this.store=new Map}load(e,n){return new Es({getItem:s=>this.store.get(s)??null,setItem:(s,r)=>{this.store.set(s,r)},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 _s=()=>{try{if(typeof localStorage<"u")return new Es(localStorage)}catch{}return new Rs},kn=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Wu=j(ve());class Zo{#e;#t;#n={targets:[],providers:[]};#r;#s=new Map;#i;#o;#a;#l;#d;#p=new Set;#m=[];#y=0;constructor(e){this.#e=e.definition,this.#r=e.grill??{grill:Ve,locale:"en"},this.#t=this.#v(),this.#i=e.base,this.#d=e.storageKey??kn(e.definition.name),this.#l=e.storage===void 0?_s():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=Xo(this.definition,n),this.#a=this.#h(this.#o),this.#u()&&this.#E()}get definition(){return this.#t}setComponentSnapshot(e){const n=Gt(au,e);if(!mn(n,this.#n)){this.#n=n,this.#k(),this.#a=this.#h(this.#o);for(const s of this.#p)s()}}setTemplate(e){this.#e=e,this.#k(),this.#a=this.#h(this.#o);for(const n of this.#p)n()}setGrill(e){this.#r=e,this.#k(),this.#a=this.#h(this.#o);for(const n of this.#p)n()}#k(){this.#s=xi(this.#o,this.#n.providers),this.#t=this.#v()}#v(){return Uu(cu(this.#e,this.#n.targets,this.#s),this.#r)}#h(e){return Wo(this.definition,this.#i,e,xi(e,this.#n.providers),this.#r.grill)}get base(){return this.#i}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#m}get prunedCount(){return this.#y}descriptorFor(e,n){return Yo(this.definition,e,n)}dispatch(e){const n=this.#A(e,this.#a.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#b(Jo(this.#o,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(Wu,e);if(!n.success)return this.#g([ze(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let r=this.#o,i=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const d=this.#A(l,i);if(!d.ok)return this.#g([d.issue]);const c=d.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((Q(c)?Ri(this.#r.grill,o,c)===null?null:i:c.type==="comment"||te(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);r=Jo(r,c,p);const h=this.#h(r);i=h.state,o=h.answers,a.push(c.id)}return this.#b(r,a),{ok:!0,ids:a}}#A(e,n){const s=C(fi,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const r=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Qt(s.output.target,"page"):s.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const i=Xc(s.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(n,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#g(e){return this.#m=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==B)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(ft(s)===n)return{ok:!0,id:e};const r=C(ts.schema,{...s,payload:{body:n}});if(!r.success)return this.#g([ze(r.issues)]);const i=C(Pe,r.output);if(!i.success)return this.#g([ze(i.issues)]);const o=i.output;return this.#b(this.#o.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#b(n)}clearActions(){this.#o.length>0&&this.#b([])}replaceActions(e){this.#b(Xo(this.definition,e))}setBase(e){this.#i=e,this.#b(this.#o)}subscribe(e){return this.#p.add(e),()=>{this.#p.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#b(e,n){this.#m=[],this.#o=e,this.#k(),this.#a=this.#h(this.#o),this.#u(n),this.#E();for(const s of this.#p)s()}#u(e){const n=this.#w(),s=Nu(this.definition,this.#a,r=>this.#h(r),e);return s===this.#a?n:(this.#y+=this.#o.length-s.actions.length,this.#o=[...s.actions],this.#k(),this.#a=this.#h(this.#o),this.#w(),!0)}#w(){return this.#a.obsolete.length===0?!1:(this.#y+=this.#a.obsolete.length,this.#o=Go(this.#a),this.#k(),this.#a=this.#h(this.#o),!0)}#E(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const Yo=(t,e,n)=>e==="comment"?ts:e===Zt?md:n!==void 0&&te({type:e,target:n})?rd:t.actionFor?t.actionFor(e,n):ht(t.actions,e),Jo=(t,e,n)=>Q(e)?bd(t,e):gi(t,e,n),Xo=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const r=s.output,i=Yo(t,r.type,r.target);if(!i)return[];const o=C(i.schema,r);if(!o.success)return[];const a=C(Pe,o.output);return a.success?[a.output]:[]}),Gu=()=>({status:{kind:"idle"},request:0}),Vu=(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}},Ku=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=L(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"?zi(s.reason,t.locale):null}},Os="@",Ls=Object.freeze({type:Ts,id:"page"}),Ps=/^[A-Za-z0-9_-]+$/,ea=t=>t.type===Ls.type&&t.id===Ls.id,ta=t=>{const e=t.id.lastIndexOf(Os);if(e<0)return null;const n=t.id.slice(e+1);return Ps.test(n)?{board:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},na=(t,e)=>({type:t.type,id:`${t.id}${Os}${e}`}),Qu=(t,e,n)=>{if(ea(t))return t;const s=ta(t);return s!==null&&n.has(s.board)?t:na(t,e)},Zu=(t,e)=>`${t}${Os}${e}`,Yu="dpk-page",sa="board",ra="data-dpk-draft-board",zs=Symbol.for("dev-process-kit.board-host"),ia=t=>{if(t.parentElement?.localName!==Yu)return null;const e=t.getAttribute(sa);return e!==null&&Ps.test(e)?e:null},Ju=t=>{const e=t.parentElement;if(e===null||!(zs in e))return null;const n=e[zs];return Xu(n)?n:null},Xu=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,oa="board",bn=t=>`${t}.`,Ms=(t,e)=>{const n=bn(e),s={};for(const[r,i]of Object.entries(t))r.startsWith(n)&&(s[r.slice(n.length)]=i);return s},ef=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${bn(t)}${n}`,s])),tf=(t,e,n,s,r=[])=>{const i={},o={};for(const[c,p]of Object.entries(n)){const u=c.indexOf(".");c===oa||u>0&&s.has(c.slice(0,u))?i[c]=p:o[c]=p}if(Object.keys(o).length===0)return i;const a=Ms(t,e),l=en(a,o,r),d={...i};for(const c of Object.keys(a))Object.hasOwn(l,c)||(d[`${bn(e)}${c}`]=null);for(const[c,p]of Object.entries(l))d[`${bn(e)}${c}`]=p;return d},aa=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},nf=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:I(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)}},sf=(t,e)=>{const n=()=>aa(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,r)=>t.dispatch({type:B,target:s,payload:{body:r}}),editComment:(s,r)=>t.editComment(s,r),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,r)=>t.navigate(s,r),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>t.brief?.(n())??tn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},Is=(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{}}}),he=t=>{const e=new Map;return Is({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Xe=t=>{try{if(typeof localStorage<"u")return Is(localStorage,t)}catch{}return he(t)},rf=t=>{try{if(typeof sessionStorage<"u")return Is(sessionStorage,t)}catch{}return he(t)},of=8e3,af=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Ro);class lf{#e;#t;#n=null;#r=null;#s=null;#i=null;#o="";#a=null;#l=new Map;#d=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get view(){return this.#n&&this.#s?iu(this.#n,this.#s):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#y()&&this.#h(),document.addEventListener("pointerdown",this.#u,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#y()&&this.#A()}hostDisconnected(){this.#A(),document.removeEventListener("pointerdown",this.#u,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#l.values())e.handle!==null&&clearTimeout(e.handle);this.#l.clear()}send(e){!this.#n||!this.#s||(this.#s=eu(this.#n,this.#s,e),this.#k(),this.#g(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#s?.list.open?"close-list":"open-list"})}show(e){const n=this.#n?wt(this.#n).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#t.show(n))}pause(e){const n=this.#d.size>0;if(this.#d.add(e),n)return;const s=Date.now();for(const r of this.#l.values())r.handle!==null&&clearTimeout(r.handle),r.handle=null,r.remaining=Math.max(0,r.deadline-s)}resume(e){if(!(!this.#d.delete(e)||this.#d.size>0))for(const[n,s]of this.#l)this.#b(n,s)}#p(){return`${this.#t.storageKey()}:seen-changes`}#m(){return this.#n!==null||this.#r!==null}#y(){const e=[...this.#e.children].find(af);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(r){return this.#v(r instanceof Error?r.message:String(r))}const s=Zh(n);return s.ok?(this.#n=s.log,this.#i=this.#t.persist()?Xe(Oo):he(Oo),this.#s=Xh(s.log,this.#i.read(this.#p())),this.#k(),this.#g(),this.#e.requestUpdate(),!0):this.#v(s.error)}#k(){if(!this.#n||!this.#s)return;const e=nu(this.#n,this.#s),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#p(),e))}#v(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#h(){this.#a=new MutationObserver(()=>{(this.#m()||this.#y())&&this.#A()}),this.#a.observe(this.#e,{childList:!0})}#A(){this.#a?.disconnect(),this.#a=null}#g(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#l)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#l.delete(n));for(const n of e){if(this.#l.has(n))continue;const s={handle:null,deadline:0,remaining:of};this.#l.set(n,s),this.#d.size===0&&this.#b(n,s)}}#b(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#u=e=>{!this.#s?.list.open||this.#t.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#s?.list.open||this.send({kind:"close-list"})}}const vn="dpk-changes",cf=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return m`<button
1404
1404
  class="dpk-bell"
1405
1405
  type="button"
1406
- aria-controls=${fn}
1406
+ aria-controls=${vn}
1407
1407
  aria-expanded=${t.open?"true":"false"}
1408
1408
  aria-label=${s}
1409
1409
  title=${s}
1410
1410
  @click=${n.toggleList}
1411
1411
  >
1412
- ${Hi()} ${t.unread>0?m`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:k}
1413
- </button>`},Ko=(t,e,n)=>t.jumpable?m`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1412
+ ${Zi()} ${t.unread>0?m`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:k}
1413
+ </button>`},la=(t,e,n)=>t.jumpable?m`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1414
1414
  ${e.changesShow}
1415
- </button>`:k,Qo=(t,e,n,s)=>s==="list"||t.unread>0?m`<button
1415
+ </button>`:k,ca=(t,e,n,s)=>s==="list"||t.unread>0?m`<button
1416
1416
  class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
1417
1417
  type="button"
1418
1418
  aria-disabled=${t.unread>0?"false":"true"}
1419
1419
  @click=${n.readAll}
1420
1420
  >
1421
1421
  ${e.changesReadAll}
1422
- </button>`:k,Lu=(t,e,n)=>m`<section class="dpk-changes-group" data-revision=${t.revision}>
1422
+ </button>`:k,df=(t,e,n)=>m`<section class="dpk-changes-group" data-revision=${t.revision}>
1423
1423
  <h3 class="dpk-changes-revision">
1424
1424
  <span>${t.revision}</span>
1425
1425
  ${t.latest?m`<span class="dpk-changes-current">${e.changesCurrent}</span>`:k}
@@ -1434,16 +1434,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1434
1434
  <p class="dpk-change-title">
1435
1435
  ${s.fresh?m`<span class="dpk-change-new">${e.changesNew}</span>`:k} ${s.title}
1436
1436
  </p>
1437
- ${s.body===null?k:m`<p class="dpk-change-body">${s.body}</p>`} ${Ko(s,e,n)}
1437
+ ${s.body===null?k:m`<p class="dpk-change-body">${s.body}</p>`} ${la(s,e,n)}
1438
1438
  </li>`)}
1439
1439
  </ol>
1440
- </section>`,Pu=(t,e,n)=>t.open?m`<div id=${fn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1440
+ </section>`,pf=(t,e,n)=>t.open?m`<div id=${vn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1441
1441
  <div class="dpk-changes-head">
1442
1442
  <h2 class="dpk-changes-title">${e.changesTitle}</h2>
1443
- ${Qo(t,e,n,"list")}
1443
+ ${ca(t,e,n,"list")}
1444
1444
  </div>
1445
- ${Me(t.groups,s=>s.revision,s=>Lu(s,e,n))}
1446
- </div>`:k,zu=(t,e,n)=>m`<section
1445
+ ${Me(t.groups,s=>s.revision,s=>df(s,e,n))}
1446
+ </div>`:k,hf=(t,e,n)=>m`<section
1447
1447
  class="dpk-toasts"
1448
1448
  aria-live="polite"
1449
1449
  aria-label=${e.changes}
@@ -1453,12 +1453,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
1453
1453
  @focusout=${()=>n.resume("focus")}
1454
1454
  >
1455
1455
  ${Me(t.toasts,s=>s.key,s=>m`<div class="dpk-toast" data-key=${s.id}>
1456
- <span class="dpk-toast-icon" aria-hidden="true">${Hi()}</span>
1456
+ <span class="dpk-toast-icon" aria-hidden="true">${Zi()}</span>
1457
1457
  <div class="dpk-toast-text">
1458
1458
  <p class="dpk-change-title">${s.title}</p>
1459
1459
  ${s.body===null?k:m`<p class="dpk-change-body">${s.body}</p>`}
1460
1460
  </div>
1461
- ${Ko(s,e,n)}
1461
+ ${la(s,e,n)}
1462
1462
  <button
1463
1463
  class="dpk-toast-close"
1464
1464
  type="button"
@@ -1466,16 +1466,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1466
1466
  title=${e.changesDismiss}
1467
1467
  @click=${()=>n.dismiss(s.key)}
1468
1468
  >
1469
- ${Jt()}
1469
+ ${nn()}
1470
1470
  </button>
1471
1471
  </div>`)}
1472
1472
  ${t.toasts.length+t.waiting>1?m`<div class="dpk-toast-actions">
1473
1473
  ${t.waiting>0?m`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1474
1474
  ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1475
1475
  </button>`:k}
1476
- ${Qo(t,e,n,"toasts")}
1476
+ ${ca(t,e,n,"toasts")}
1477
1477
  </div>`:k}
1478
- </section>`,_s=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),Mu=t=>_s(t,["use"]),Iu=t=>_s(t,["anchorFor","canSendToClaude","sendToClaude"]),Nu=t=>_s(t,["collection"]),Zo=async(t,e)=>{try{return await t.use(e)}catch{return null}},Du=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:r}){let i=pd(n);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(ld).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),i=hd(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(o){return{ok:!1,reason:fd(o)}}}}),ju=async t=>{if(!Mu(t))return null;const[e,n]=await Promise.all([Zo(t,"comments"),Zo(t,"db")]);return Iu(e)?Du(e,Nu(n)?n:null):null},qu=()=>Reflect.get(globalThis,"claude");class Bu{#e;#t;#n=null;#r=!1;constructor(e,n=qu){this.#e=e,this.#t=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#n??=ju(this.#t()),this.#s(),window.addEventListener("focus",this.#s)}hostDisconnected(){window.removeEventListener("focus",this.#s)}async send(e){const n=await this.#n;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#s(),s}#s=async()=>{const e=await this.#n,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const Os="dev-process-kit:color-scheme",Hu="(prefers-color-scheme: dark)",Yo=()=>typeof matchMedia=="function"?matchMedia(Hu):null,Jo=()=>yt(document.documentElement.dataset.theme)??(Yo()?.matches===!0?"dark":"light");class Uu{#e;#t;#n=null;#r=null;#s="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t()?Je(yt):pe(yt),this.#r=this.#n.read(Os)),this.#s=Jo(),this.#i=Yo(),this.#i?.addEventListener("change",this.#l),this.#o=new MutationObserver(this.#l),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#l),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Eo(this.#a(e))}toggle(e){this.#r=Ih(this.#a(e)),this.#r===null?this.#n?.remove(Os):this.#n?.write(Os,this.#r),this.#e.requestUpdate()}#a(e){return{preference:this.#r,authored:e,environment:this.#s}}#l=()=>{const e=Jo();e!==this.#s&&(this.#s=e,this.#e.requestUpdate())}}const Fu=(t,e)=>{const n=[],s=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&n.push(i),s(i),i.shadowRoot&&s(i.shadowRoot))};return s(t),n},Xo=(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)},ea=t=>Xo(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),ta=(t,e)=>{for(const n of ea(t)){const s=Hc(e,n.id),r=Reflect.get(n,"elementActions");Array.isArray(r)&&r.length===s.length&&s.every((o,a)=>{const l=r[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Wu=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(pi,n);return s.success?[s.output]:[]}):[]},Gu=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(Ro,n.commentTargets);s.success&&e.push(...s.output)}return{targets:Xo(e,n=>n.value),providers:ea(t).map(n=>({id:n.id,results:Wu(n)}))}};function na(t){return t===null?1:t===void 0?2:0}function sa(t,e){const n=na(t),s=na(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function Vu(t,e,n){return n==="asc"?sa(t,e):sa(e,t)}function Ku(t,e,n){return t.slice().sort((s,r)=>{const i=n.length;for(let o=0;o<e.length;o++){const a=i>o?n[o]:n[i-1],l=e[o],d=typeof l=="function",c=Vu(d?l(s):s[l],d?l(r):r[l],a);if(c!==0)return c}return 0})}function ra(t,e){return Ku(t,e,["asc"])}const Qu=5,Ls=4,ia=8,Zu=(t,e)=>{const n=e.badgeHeight,s=t.target.right+ia,r=t.target.left-ia,i=[];let o=0,a=s;for(let l=t.widths.length-1;l>=0;l-=1){const d=t.widths[l]??0;a!==s&&a-d<r&&(o+=1,a=s),i[l]={x:a-d,y:t.target.top-n/2-o*(n+Ls)},a-=d+Qu}return i},oa=(t,e)=>{const n=t.map(()=>[]),s=ra(t.map((i,o)=>({group:i,index:o})).filter(({group:i})=>i.gutter),[({group:i})=>i.target.top]);let r=Number.NEGATIVE_INFINITY;for(const{group:i,index:o}of s){let a=Math.max(i.target.top,r);n[o]=i.widths.map(l=>{const d={x:e.width-l,y:a};return a+=e.badgeHeight+Ls,d}),r=a}return{points:n,bottom:r-Ls}},Yu=(t,e)=>Math.max(0,oa(t,e).bottom),Ju=(t,e)=>{const n=oa(t,e),s=Math.max(e.height,n.bottom);return t.map((r,i)=>(r.gutter?n.points[i]??[]:Zu(r,e)).map((o,a)=>({x:ms(o.x,0,Math.max(0,e.width-(r.widths[a]??0))),y:ms(o.y,0,Math.max(0,s-e.badgeHeight))})))},Xu=t=>{const e=[t];for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},ef=(t,e,n,s)=>{if(e.questions.length===0)return[];const r=new Map(e.questions.map(o=>[o.ref,o])),i=[];for(const o of Xu(t))for(const a of o.querySelectorAll(`[${es}]`)){const l=a.getAttribute(es)??"";for(const d of l.split(/\s+/)){const c=r.get(d);c&&i.push({index:i.length,target:a,questionId:c.id,ref:c.ref,title:c.title,answered:Zt(c,n[c.id]),open:c.id===s})}}return i},tf=(t,e)=>{const n=t.getRootNode(),s=n instanceof ShadowRoot?n.host:null,r=s?.shadowRoot?.querySelector(".diagram-canvas")??null;return r instanceof Element?r.getBoundingClientRect():s instanceof Element?s.getBoundingClientRect():e.getBoundingClientRect()},nf=(t,e)=>{const n=t.getBoundingClientRect(),s=t.getRootNode(),r=s instanceof ShadowRoot?s.host:null,i=new Map;for(const u of e){const h=t.querySelector(`[data-badge="${u.index}"]`);if(!h)continue;const f=i.get(u.target)??[];f.push(h),i.set(u.target,f)}const o=[];for(const[u,h]of i){const f=u.getBoundingClientRect(),g=tf(u,t),b=(f.width>0||f.height>0)&&f.bottom>n.top&&f.top<n.bottom&&f.right>n.left&&f.left<n.right&&f.bottom>g.top&&f.top<g.bottom;for(const x of h)x.dataset.visible=String(b);b&&o.push({buttons:h,group:{target:{left:f.left-n.left,top:f.top-n.top,right:f.right-n.left,bottom:f.bottom-n.top},widths:h.map(x=>x.offsetWidth),gutter:r?.contains(u)===!0}})}const a=o[0]?.buttons[0]?.offsetHeight??0,l=o.map(({group:u})=>u),d={width:t.clientWidth,height:t.clientHeight,badgeHeight:a},c=Yu(l,d);t.parentElement&&(t.parentElement.style.minHeight=c>0?`${Math.ceil(c)}px`:"");const p=Ju(l,{...d,height:Math.max(d.height,c)});o.forEach(({buttons:u},h)=>{u.forEach((f,g)=>{const b=p[h]?.[g];b&&(f.style.transform=`translate(${b.x}px, ${b.y}px)`)})})},aa={childList:!0,subtree:!0,attributes:!0,attributeFilter:[es]};class sf{#e;#t;#n=null;#r=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){document.addEventListener("scroll",this.#s,!0),window.addEventListener("resize",this.#s),this.#e.addEventListener("dpk-diagram-view",this.#s)}hostDisconnected(){document.removeEventListener("scroll",this.#s,!0),window.removeEventListener("resize",this.#s),this.#e.removeEventListener("dpk-diagram-view",this.#s),this.#n?.disconnect(),this.#n=null}hostUpdated(){if(this.#n?.disconnect(),!!this.#t.active()){this.#n??=new MutationObserver(()=>{this.#e.requestUpdate(),this.#s()}),this.#n.observe(this.#e,aa);for(const e of this.#e.querySelectorAll("*"))e.shadowRoot&&this.#n.observe(e.shadowRoot,aa);this.#s()}}#s=()=>{this.#r||!this.#t.active()||(this.#r=!0,requestAnimationFrame(()=>{this.#r=!1;const e=this.#t.layer();e&&nf(e,this.#t.bindings())}))}}const Ps=(t,e)=>e!==null&&Ve(t,e)?e:t.questions[0]?.id??null,rf=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",la=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:Qc(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),of=(t,e,n)=>{if(e.rounds.length===0)return[];const s=e.rounds.map((r,i)=>({value:String(i),label:t.grillRoundOption(r.label,r.questions.length),selected:n===i}));return[{value:"current",label:t.grillRoundOption(t.grillCurrentRound,e.questions.length),selected:n==="current"},...s.reverse()]},af=(t,e,n,s)=>{const r=vi(e,n),i=rf(e,s.round),o=of(t,e,i),a=t.grillProgress(r.answered,r.total),l=i==="current"?void 0:e.rounds[i];if(l!==void 0)return{progress:a,rounds:o,view:{kind:"past",note:t.grillPastRound(l.label),questions:l.questions.map(c=>{const p=Qt(c,c.answer);return{id:c.id,ref:c.ref,title:c.title,description:c.description,note:c.note,answered:p!=="",summary:p===""?t.grillUnanswered:p,choices:la(c,c.answer),freeText:c.answer?.kind==="free"?c.answer.text:null}})}};const d=Ps(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(c=>{const p=n[c.id],u=Qt(c,p);return{id:c.id,ref:c.ref,title:c.title,description:c.description,note:c.note,open:c.id===d,answered:u!=="",summary:u,choices:la(c,p),draft:p?.kind==="free"?p.text:"",freeSelected:p?.kind==="free",allowFreeText:c.freeText}})}}},lf=(t,e,n,s)=>m`
1478
+ </section>`,Ns=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),uf=t=>Ns(t,["use"]),ff=t=>Ns(t,["anchorFor","canSendToClaude","sendToClaude"]),gf=t=>Ns(t,["collection"]),da=async(t,e)=>{try{return await t.use(e)}catch{return null}},mf=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:r}){let i=Rd(n);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Td).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),i=_d(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(o){return{ok:!1,reason:Ld(o)}}}}),kf=async t=>{if(!uf(t))return null;const[e,n]=await Promise.all([da(t,"comments"),da(t,"db")]);return ff(e)?mf(e,gf(n)?n:null):null},bf=()=>Reflect.get(globalThis,"claude");class vf{#e;#t;#n=null;#r=!1;constructor(e,n=bf){this.#e=e,this.#t=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#n??=kf(this.#t()),this.#s(),window.addEventListener("focus",this.#s)}hostDisconnected(){window.removeEventListener("focus",this.#s)}async send(e){const n=await this.#n;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#s(),s}#s=async()=>{const e=await this.#n,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const Ds="dev-process-kit:color-scheme",xf="(prefers-color-scheme: dark)",pa=()=>typeof matchMedia=="function"?matchMedia(xf):null,ha=()=>$t(document.documentElement.dataset.theme)??(pa()?.matches===!0?"dark":"light");class yf{#e;#t;#n=null;#r=null;#s="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t()?Xe($t):he($t),this.#r=this.#n.read(Ds)),this.#s=ha(),this.#i=pa(),this.#i?.addEventListener("change",this.#l),this.#o=new MutationObserver(this.#l),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#l),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Io(this.#a(e))}toggle(e){this.#r=ou(this.#a(e)),this.#r===null?this.#n?.remove(Ds):this.#n?.write(Ds,this.#r),this.#e.requestUpdate()}#a(e){return{preference:this.#r,authored:e,environment:this.#s}}#l=()=>{const e=ha();e!==this.#s&&(this.#s=e,this.#e.requestUpdate())}}const wf=(t,e)=>{const n=[],s=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&n.push(i),s(i),i.shadowRoot&&s(i.shadowRoot))};return s(t),n},ua=(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)},fa=t=>ua(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),ga=(t,e)=>{for(const n of fa(t)){const s=od(e,n.id),r=Reflect.get(n,"elementActions");Array.isArray(r)&&r.length===s.length&&s.every((o,a)=>{const l=r[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},$f=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(vi,n);return s.success?[s.output]:[]}):[]},Sf=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(No,n.commentTargets);s.success&&e.push(...s.output)}return{targets:ua(e,n=>n.value),providers:fa(t).map(n=>({id:n.id,results:$f(n)}))}};function ma(t){return t===null?1:t===void 0?2:0}function ka(t,e){const n=ma(t),s=ma(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function Af(t,e,n){return n==="asc"?ka(t,e):ka(e,t)}function Tf(t,e,n){return t.slice().sort((s,r)=>{const i=n.length;for(let o=0;o<e.length;o++){const a=i>o?n[o]:n[i-1],l=e[o],d=typeof l=="function",c=Af(d?l(s):s[l],d?l(r):r[l],a);if(c!==0)return c}return 0})}function ba(t,e){return Tf(t,e,["asc"])}const Cf=5,js=4,va=8,Ef=(t,e)=>{const n=e.badgeHeight,s=t.target.right+va,r=t.target.left-va,i=[];let o=0,a=s;for(let l=t.widths.length-1;l>=0;l-=1){const d=t.widths[l]??0;a!==s&&a-d<r&&(o+=1,a=s),i[l]={x:a-d,y:t.target.top-n/2-o*(n+js)},a-=d+Cf}return i},xa=(t,e)=>{const n=t.map(()=>[]),s=ba(t.map((i,o)=>({group:i,index:o})).filter(({group:i})=>i.gutter),[({group:i})=>i.target.top]);let r=Number.NEGATIVE_INFINITY;for(const{group:i,index:o}of s){let a=Math.max(i.target.top,r);n[o]=i.widths.map(l=>{const d={x:e.width-l,y:a};return a+=e.badgeHeight+js,d}),r=a}return{points:n,bottom:r-js}},Rf=(t,e)=>Math.max(0,xa(t,e).bottom),_f=(t,e)=>{const n=xa(t,e),s=Math.max(e.height,n.bottom);return t.map((r,i)=>(r.gutter?n.points[i]??[]:Ef(r,e)).map((o,a)=>({x:ks(o.x,0,Math.max(0,e.width-(r.widths[a]??0))),y:ks(o.y,0,Math.max(0,s-e.badgeHeight))})))},Of=t=>{const e=[t];for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},Lf=(t,e,n,s)=>{if(e.questions.length===0)return[];const r=new Map(e.questions.map(o=>[o.ref,o])),i=[];for(const o of Of(t))for(const a of o.querySelectorAll(`[${rs}]`)){const l=a.getAttribute(rs)??"";for(const d of l.split(/\s+/)){const c=r.get(d);c&&i.push({index:i.length,target:a,questionId:c.id,ref:c.ref,title:c.title,answered:Jt(c,n[c.id]),open:c.id===s})}}return i},Pf=(t,e)=>{const n=t.getRootNode(),s=n instanceof ShadowRoot?n.host:null,r=s?.shadowRoot?.querySelector(".diagram-canvas")??null;return r instanceof Element?r.getBoundingClientRect():s instanceof Element?s.getBoundingClientRect():e.getBoundingClientRect()},zf=(t,e)=>{const n=t.getBoundingClientRect(),s=t.getRootNode(),r=s instanceof ShadowRoot?s.host:null,i=new Map;for(const u of e){const h=t.querySelector(`[data-badge="${u.index}"]`);if(!h)continue;const f=i.get(u.target)??[];f.push(h),i.set(u.target,f)}const o=[];for(const[u,h]of i){const f=u.getBoundingClientRect(),g=Pf(u,t),b=(f.width>0||f.height>0)&&f.bottom>n.top&&f.top<n.bottom&&f.right>n.left&&f.left<n.right&&f.bottom>g.top&&f.top<g.bottom;for(const x of h)x.dataset.visible=String(b);b&&o.push({buttons:h,group:{target:{left:f.left-n.left,top:f.top-n.top,right:f.right-n.left,bottom:f.bottom-n.top},widths:h.map(x=>x.offsetWidth),gutter:r?.contains(u)===!0}})}const a=o[0]?.buttons[0]?.offsetHeight??0,l=o.map(({group:u})=>u),d={width:t.clientWidth,height:t.clientHeight,badgeHeight:a},c=Rf(l,d);t.parentElement&&(t.parentElement.style.minHeight=c>0?`${Math.ceil(c)}px`:"");const p=_f(l,{...d,height:Math.max(d.height,c)});o.forEach(({buttons:u},h)=>{u.forEach((f,g)=>{const b=p[h]?.[g];b&&(f.style.transform=`translate(${b.x}px, ${b.y}px)`)})})},ya={childList:!0,subtree:!0,attributes:!0,attributeFilter:[rs]};class Mf{#e;#t;#n=null;#r=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){document.addEventListener("scroll",this.#s,!0),window.addEventListener("resize",this.#s),this.#e.addEventListener("dpk-diagram-view",this.#s)}hostDisconnected(){document.removeEventListener("scroll",this.#s,!0),window.removeEventListener("resize",this.#s),this.#e.removeEventListener("dpk-diagram-view",this.#s),this.#n?.disconnect(),this.#n=null}hostUpdated(){if(this.#n?.disconnect(),!!this.#t.active()){this.#n??=new MutationObserver(()=>{this.#e.requestUpdate(),this.#s()}),this.#n.observe(this.#e,ya);for(const e of this.#e.querySelectorAll("*"))e.shadowRoot&&this.#n.observe(e.shadowRoot,ya);this.#s()}}#s=()=>{this.#r||!this.#t.active()||(this.#r=!0,requestAnimationFrame(()=>{this.#r=!1;const e=this.#t.layer();e&&zf(e,this.#t.bindings())}))}}const qs=(t,e)=>e!==null&&Ke(t,e)?e:t.questions[0]?.id??null,If=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",wa=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:ud(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),Nf=(t,e,n)=>{if(e.rounds.length===0)return[];const s=e.rounds.map((r,i)=>({value:String(i),label:t.grillRoundOption(r.label,r.questions.length),selected:n===i}));return[{value:"current",label:t.grillRoundOption(t.grillCurrentRound,e.questions.length),selected:n==="current"},...s.reverse()]},Df=(t,e,n,s)=>{const r=Ci(e,n),i=If(e,s.round),o=Nf(t,e,i),a=t.grillProgress(r.answered,r.total),l=i==="current"?void 0:e.rounds[i];if(l!==void 0)return{progress:a,rounds:o,view:{kind:"past",note:t.grillPastRound(l.label),questions:l.questions.map(c=>{const p=Yt(c,c.answer);return{id:c.id,ref:c.ref,title:c.title,description:c.description,note:c.note,answered:p!=="",summary:p===""?t.grillUnanswered:p,choices:wa(c,c.answer),freeText:c.answer?.kind==="free"?c.answer.text:null}})}};const d=qs(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(c=>{const p=n[c.id],u=Yt(c,p);return{id:c.id,ref:c.ref,title:c.title,description:c.description,note:c.note,open:c.id===d,answered:u!=="",summary:u,choices:wa(c,p),draft:p?.kind==="free"?p.text:"",freeSelected:p?.kind==="free",allowFreeText:c.freeText}})}}},jf=(t,e,n,s)=>m`
1479
1479
  <div class="dpk-grill">
1480
1480
  <header class="dpk-grill-head">
1481
1481
  <h2>${t.grill}</h2>
@@ -1492,16 +1492,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1492
1492
  </div>`}
1493
1493
  <div class="dpk-grill-list">
1494
1494
  ${e.view.kind==="past"?m`<p class="dpk-grill-round-note">${e.view.note}</p>`:k}
1495
- ${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Me(e.view.questions,r=>r.id,r=>cf(t,r,n)):Me(e.view.questions,r=>r.id,pf)}
1495
+ ${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Me(e.view.questions,r=>r.id,r=>qf(t,r,n)):Me(e.view.questions,r=>r.id,Hf)}
1496
1496
  </div>
1497
1497
  ${s}
1498
1498
  </div>
1499
- `,cf=(t,e,n)=>m`
1499
+ `,qf=(t,e,n)=>m`
1500
1500
  <section
1501
1501
  class="dpk-grill-question"
1502
1502
  data-question=${e.id}
1503
1503
  data-answered=${String(e.answered)}
1504
- data-dpk-target=${D({type:oe,id:e.id})}
1504
+ data-dpk-target=${I({type:ae,id:e.id})}
1505
1505
  >
1506
1506
  <button
1507
1507
  class="dpk-grill-heading"
@@ -1515,13 +1515,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
1515
1515
  <strong>${e.title}</strong>
1516
1516
  ${!e.open&&e.answered?m`<span class="dpk-grill-summary">${e.summary}</span>`:k}
1517
1517
  </span>
1518
- <span class="dpk-grill-chevron" aria-hidden="true">${ft()}</span>
1518
+ <span class="dpk-grill-chevron" aria-hidden="true">${mt()}</span>
1519
1519
  </button>
1520
1520
  ${e.open?m`<div class="dpk-grill-body" id=${`dpk-grill-body-${e.id}`}>
1521
1521
  ${e.description?m`<p class="dpk-grill-description">${e.description}</p>`:k}
1522
1522
  ${e.note?m`<p class="dpk-grill-note">${e.note}</p>`:k}
1523
1523
  <div class="dpk-grill-choices" role="radiogroup" aria-label=${e.title}>
1524
- ${e.choices.map(s=>df(e.id,s,n))}
1524
+ ${e.choices.map(s=>Bf(e.id,s,n))}
1525
1525
  ${e.allowFreeText?m`<label class="dpk-grill-choice" data-free=${String(e.freeSelected)}>
1526
1526
  <input
1527
1527
  type="radio"
@@ -1552,7 +1552,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1552
1552
  </button>`:k}
1553
1553
  </div>`:k}
1554
1554
  </section>
1555
- `,df=(t,e,n)=>m`
1555
+ `,Bf=(t,e,n)=>m`
1556
1556
  <label class="dpk-grill-choice" data-choice=${e.id}>
1557
1557
  <input
1558
1558
  type="radio"
@@ -1566,7 +1566,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1566
1566
  <span>${e.label}</span>
1567
1567
  </span>
1568
1568
  </label>
1569
- `,pf=t=>m`
1569
+ `,Hf=t=>m`
1570
1570
  <details class="dpk-grill-question" data-past data-question=${t.id} data-answered=${String(t.answered)}>
1571
1571
  <summary class="dpk-grill-heading">
1572
1572
  <span class="dpk-grill-ref">${t.ref}</span>
@@ -1574,7 +1574,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1574
1574
  <strong>${t.title}</strong>
1575
1575
  <span class="dpk-grill-summary">${t.summary}</span>
1576
1576
  </span>
1577
- <span class="dpk-grill-chevron" aria-hidden="true">${ft()}</span>
1577
+ <span class="dpk-grill-chevron" aria-hidden="true">${mt()}</span>
1578
1578
  </summary>
1579
1579
  <div class="dpk-grill-body">
1580
1580
  ${t.description?m`<p class="dpk-grill-description">${t.description}</p>`:k}
@@ -1588,21 +1588,21 @@ The brief is too long for a comment, so it is stored in this artifact's database
1588
1588
  ${t.freeText===null?k:m`<p class="dpk-grill-past-choice" data-checked="true">${t.freeText}</p>`}
1589
1589
  </div>
1590
1590
  </details>
1591
- `,hf=2400;class uf{#e=wu();#t=null;#n;constructor(e){this.#n=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 is(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#s(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.#s(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=$u(this.#e,e),this.#n.requestUpdate()}#s(e){e===this.#e.request&&(this.#i(),this.#t=setTimeout(()=>{this.#t=null,this.#r({kind:"settled",request:e})},hf))}#i(){this.#t!==null&&clearTimeout(this.#t),this.#t=null}}const zs="dev-process-kit:locale";class ff{#e;#t;#n;#r=null;#s=null;#i;#o;constructor(e,n,s){this.#e=e,this.#t=n,this.#n=s,e.addController(this)}get authored(){if(this.#i===void 0)return Pt(Lt(this.#e));const e=this.#e.parentNode;return Pt(this.#i??(e===null?null:Lt(e)))}get locale(){return this.#o??this.#a()}#a(){return tl({preference:this.#s,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#t()?Je(kr):pe(kr),this.#s=this.#r.read(zs)),this.#i??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#s=nl(e,this.authored),this.#s===null?this.#r?.remove(zs):this.#r?.write(zs,this.#s),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#s??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#a();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#n(),(!s||this.#s!==null)&&document.dispatchEvent(new Event(On))}}const gf="(max-width: 760px)",mf=()=>typeof matchMedia=="function"?matchMedia(gf):null;class kf{#e;#t=null;#n=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#t=mf(),this.#n=this.#t?.matches===!0,this.#t?.addEventListener("change",this.#r)}hostDisconnected(){this.#t?.removeEventListener("change",this.#r),this.#t=null}get narrow(){return this.#n}#r=e=>{this.#n=e.matches,this.#e.requestUpdate()}}const ca=()=>Yt(typeof location>"u"?"":location.hash),bf=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Ke(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class vf{#e;#t=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,n=Ee(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#t!==n&&(this.#t=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=n.assignedElements();for(const i of r){const o=i.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;i.getAttribute("slot")!==a&&s.has(a)&&i.setAttribute("slot",a)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const da=(t,e)=>{const n=[],s=r=>{for(const i of r.querySelectorAll("*"))i.matches(e)&&n.push(i),i.shadowRoot&&s(i.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},xf=(t,e)=>{const n=[];let s=t;for(;s;){const r=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=r instanceof ShadowRoot?r.host:r,!(s instanceof Element)||s===e)break;n.push(s)}return n},pa="data-dpk-target",yf=2800,ha=48,wf=t=>t.getClientRects().length>0,ua=(t,e)=>{const n=da(t,`[${pa}]`).filter(i=>(i.getAttribute(pa)??"").split(/\s+/).includes(e)),s=da(t,"[data-dpk-comment]").filter(i=>i.getAttribute("data-dpk-comment")===e),r=[...n,...s];return r.find(wf)??r[0]??null},fa=(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},$f=(t,e)=>{for(const n of xf(e,t))fa(n,"y")&&xs(n,e,ha),fa(n,"x")&&xo(n,e,ha)},ga="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",qe={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},ma={outline:"2px solid transparent",outlineOffset:"3px"},Sf=t=>t?[{...qe},{...qe,offset:.85},{...ma}]:[{...qe,boxShadow:`0 0 0 0 ${ga}`},{...qe,boxShadow:"0 0 0 14px transparent",offset:.3},{...qe,boxShadow:`0 0 0 0 ${ga}`,offset:.31},{...qe,boxShadow:"0 0 0 14px transparent",offset:.6},{...qe,offset:.85},{...ma}],St={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},gn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},Af=t=>t?[{...St},{...St,offset:.85},{...gn}]:[{...St},{...gn,offset:.3},{...St,offset:.31},{...gn,offset:.6},{...St,offset:.61},{...gn}],Cf=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?Af(e):Sf(e),{duration:yf,easing:"ease-out"})},Tf=440,Ef=16;class Rf{#e;#t=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#r)}hostUpdated(){const e=this.#e.surface(),n=this.#e.open()&&e!==null;if(n!==(this.#t!==null)){if(n){const s=this.#e.anchor()??{top:0,bottom:0,right:window.innerWidth},r=s instanceof Element?s.getBoundingClientRect().bottom:s.bottom,i=Math.max(0,window.innerHeight-r-Ef);this.#t=ao(e,s,{width:Tf,height:i},{placement:"bottom-end"});return}this.#n(),lo(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#r),this.#n()}#n(){this.#t?.(),this.#t=null}#r=e=>{e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#e.open()||this.#e.close()}}const mn="dpk-settings",ka={width:320,height:420},_f=(t,e,n)=>m`<button
1591
+ `,Uf=2400;class Ff{#e=Gu();#t=null;#n;constructor(e){this.#n=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 os(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#s(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.#s(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=Vu(this.#e,e),this.#n.requestUpdate()}#s(e){e===this.#e.request&&(this.#i(),this.#t=setTimeout(()=>{this.#t=null,this.#r({kind:"settled",request:e})},Uf))}#i(){this.#t!==null&&clearTimeout(this.#t),this.#t=null}}const Bs="dev-process-kit:locale";class Wf{#e;#t;#n;#r=null;#s=null;#i;#o;constructor(e,n,s){this.#e=e,this.#t=n,this.#n=s,e.addController(this)}get authored(){if(this.#i===void 0)return Mt(zt(this.#e));const e=this.#e.parentNode;return Mt(this.#i??(e===null?null:zt(e)))}get locale(){return this.#o??this.#a()}#a(){return vl({preference:this.#s,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#t()?Xe(Sr):he(Sr),this.#s=this.#r.read(Bs)),this.#i??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#s=xl(e,this.authored),this.#s===null?this.#r?.remove(Bs):this.#r?.write(Bs,this.#s),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#s??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#a();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#n(),(!s||this.#s!==null)&&document.dispatchEvent(new Event(In))}}const Gf="(max-width: 760px)",Vf=()=>typeof matchMedia=="function"?matchMedia(Gf):null;class Kf{#e;#t=null;#n=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#t=Vf(),this.#n=this.#t?.matches===!0,this.#t?.addEventListener("change",this.#r)}hostDisconnected(){this.#t?.removeEventListener("change",this.#r),this.#t=null}get narrow(){return this.#n}#r=e=>{this.#n=e.matches,this.#e.requestUpdate()}}const $a=()=>Xt(typeof location>"u"?"":location.hash),Qf=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Qe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class Zf{#e;#t=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,n=Ee(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#t!==n&&(this.#t=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=n.assignedElements();for(const i of r){const o=i.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;i.getAttribute("slot")!==a&&s.has(a)&&i.setAttribute("slot",a)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const Sa=(t,e)=>{const n=[],s=r=>{for(const i of r.querySelectorAll("*"))i.matches(e)&&n.push(i),i.shadowRoot&&s(i.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},Yf=(t,e)=>{const n=[];let s=t;for(;s;){const r=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=r instanceof ShadowRoot?r.host:r,!(s instanceof Element)||s===e)break;n.push(s)}return n},Aa="data-dpk-target",Jf=2800,Ta=48,Xf=t=>t.getClientRects().length>0,Ca=(t,e)=>{const n=Sa(t,`[${Aa}]`).filter(i=>(i.getAttribute(Aa)??"").split(/\s+/).includes(e)),s=Sa(t,"[data-dpk-comment]").filter(i=>i.getAttribute("data-dpk-comment")===e),r=[...n,...s];return r.find(Xf)??r[0]??null},Ea=(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},eg=(t,e)=>{for(const n of Yf(e,t))Ea(n,"y")&&bs(n,e,Ta),Ea(n,"x")&&wo(n,e,Ta)},Ra="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",qe={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},_a={outline:"2px solid transparent",outlineOffset:"3px"},tg=t=>t?[{...qe},{...qe,offset:.85},{..._a}]:[{...qe,boxShadow:`0 0 0 0 ${Ra}`},{...qe,boxShadow:"0 0 0 14px transparent",offset:.3},{...qe,boxShadow:`0 0 0 0 ${Ra}`,offset:.31},{...qe,boxShadow:"0 0 0 14px transparent",offset:.6},{...qe,offset:.85},{..._a}],Tt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},xn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},ng=t=>t?[{...Tt},{...Tt,offset:.85},{...xn}]:[{...Tt},{...xn,offset:.3},{...Tt,offset:.31},{...xn,offset:.6},{...Tt,offset:.61},{...xn}],sg=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?ng(e):tg(e),{duration:Jf,easing:"ease-out"})},rg=440,ig=16;class og{#e;#t=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#r)}hostUpdated(){const e=this.#e.surface(),n=this.#e.open()&&e!==null;if(n!==(this.#t!==null)){if(n){const s=this.#e.anchor()??{top:0,bottom:0,right:window.innerWidth},r=s instanceof Element?s.getBoundingClientRect().bottom:s.bottom,i=Math.max(0,window.innerHeight-r-ig);this.#t=mo(e,s,{width:rg,height:i},{placement:"bottom-end"});return}this.#n(),ko(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#r),this.#n()}#n(){this.#t?.(),this.#t=null}#r=e=>{e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#e.open()||this.#e.close()}}const yn="dpk-settings",Oa="dpk-settings-anchor",La={width:320,height:420},Pa=(t,e,n)=>m`<button
1592
1592
  class="dpk-header-action dpk-settings-trigger"
1593
1593
  type="button"
1594
- aria-controls=${mn}
1594
+ aria-controls=${yn}
1595
1595
  aria-haspopup="menu"
1596
1596
  aria-expanded=${t?"true":"false"}
1597
1597
  aria-label=${e.settings}
1598
1598
  data-tooltip=${e.settings}
1599
1599
  @click=${n.toggle}
1600
1600
  >
1601
- ${Fd()}
1602
- </button>`,Of=(t,e,n)=>m`<div id=${mn} class="dpk-settings" popover="manual" role="menu" aria-label=${e.settings}>
1603
- ${t.items.map(s=>Lf(s,n))}
1601
+ ${pp()}
1602
+ </button>`,za=(t,e,n)=>m`<div id=${yn} class="dpk-settings" popover="manual" role="menu" aria-label=${e.settings}>
1603
+ ${t.items.map(s=>ag(s,n))}
1604
1604
  ${t.note===void 0?k:m`<p class="dpk-settings-note">${t.note}</p>`}
1605
- </div>`,Lf=(t,e)=>m`<button
1605
+ </div>`,ag=(t,e)=>m`<button
1606
1606
  class="dpk-settings-option"
1607
1607
  type="button"
1608
1608
  role="menuitemcheckbox"
@@ -1610,12 +1610,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
1610
1610
  aria-checked=${t.on?"true":"false"}
1611
1611
  @click=${()=>e.flip(t.toggle)}
1612
1612
  >
1613
- <span class="dpk-settings-check" aria-hidden="true">${t.on?Di():k}</span>
1613
+ <span class="dpk-settings-check" aria-hidden="true">${t.on?Gi():k}</span>
1614
1614
  <span class="dpk-settings-text">
1615
1615
  <span class="dpk-settings-name">${t.label}</span>
1616
1616
  ${t.hint===void 0?k:m`<span class="dpk-settings-hint">${t.hint}</span>`}
1617
1617
  </span>
1618
- </button>`,ye={min:180,max:560,step:16,largeStep:64},Pf={side:"left",defaultWidth:260},kn=t=>Math.round(Math.min(ye.max,Math.max(ye.min,t))),ba=t=>typeof t=="number"&&Number.isFinite(t)?kn(t):null,Ms=(t,e)=>t==="left"?e:-e,zf=(t,e)=>kn(t.startWidth+Ms(t.side,e-t.startX)),Mf=(t,e,{key:n,shiftKey:s})=>{const r=s?ye.largeStep:ye.step;switch(n){case"ArrowLeft":return kn(t+Ms(e,-r));case"ArrowRight":return kn(t+Ms(e,r));case"Home":return ye.min;case"End":return ye.max;default:return null}},va=t=>typeof t=="boolean"?t:null,If=t=>t==="left"?"right":"left",Nf=(t,e)=>e?{action:"expand",points:If(t)}:{action:"collapse",points:t},Df=t=>`dev-process-kit:sidebar-collapsed:${t}`;class jf{#e;#t;#n=null;#r="";#s=!1;#i=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Je(va):pe(va),this.#r=Df(this.#t.template()),this.#s=this.#n.read(this.#r)??!1)}get collapsed(){return this.#s}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#s=!this.#s,this.#s?this.#n?.write(this.#r,!0):this.#n?.remove(this.#r),this.#e.requestUpdate()}}const qf=t=>`dev-process-kit:sidebar-width:${t}`,Is={kind:"idle"};class Bf{constructor(e,n){this.#n=null,this.#r="",this.#s=null,this.#i=Is,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.#t.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const r=this.#i;r.kind!=="dragging"||r.pointerId!==s.pointerId||this.#a(zf(r,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const r=Mf(this.width,this.#t.layout().side,s);r!==null&&(s.preventDefault(),this.#a(r),this.#l())},dblclick:()=>{this.#a(this.#t.layout().defaultWidth),this.#l()}},this.#e=e,this.#t=n,e.addController(this)}#e;#t;#n;#r;#s;#i;hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Je(ba):pe(ba),this.#r=qf(this.#t.template()),this.#s=this.#n.read(this.#r))}hostDisconnected(){this.#i=Is}get width(){return this.#s??this.#t.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=Is,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#t.layout().defaultWidth?null:e;n!==this.#s&&(this.#s=n,this.#e.requestUpdate())}#l(){this.#s===null?this.#n?.remove(this.#r):this.#n?.write(this.#r,this.#s)}}const Hf=[Mt,Pn,ue`
1618
+ </button>`,ye={min:180,max:560,step:16,largeStep:64},lg={side:"left",defaultWidth:260},wn=t=>Math.round(Math.min(ye.max,Math.max(ye.min,t))),Ma=t=>typeof t=="number"&&Number.isFinite(t)?wn(t):null,Hs=(t,e)=>t==="left"?e:-e,cg=(t,e)=>wn(t.startWidth+Hs(t.side,e-t.startX)),dg=(t,e,{key:n,shiftKey:s})=>{const r=s?ye.largeStep:ye.step;switch(n){case"ArrowLeft":return wn(t+Hs(e,-r));case"ArrowRight":return wn(t+Hs(e,r));case"Home":return ye.min;case"End":return ye.max;default:return null}},Ia=t=>typeof t=="boolean"?t:null,pg=t=>t==="left"?"right":"left",hg=(t,e)=>e?{action:"expand",points:pg(t)}:{action:"collapse",points:t},ug=t=>`dev-process-kit:sidebar-collapsed:${t}`;class fg{#e;#t;#n=null;#r="";#s=!1;#i=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Xe(Ia):he(Ia),this.#r=ug(this.#t.template()),this.#s=this.#n.read(this.#r)??!1)}get collapsed(){return this.#s}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#s=!this.#s,this.#s?this.#n?.write(this.#r,!0):this.#n?.remove(this.#r),this.#e.requestUpdate()}}const gg=t=>`dev-process-kit:sidebar-width:${t}`,Us={kind:"idle"};class mg{constructor(e,n){this.#n=null,this.#r="",this.#s=null,this.#i=Us,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.#t.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const r=this.#i;r.kind!=="dragging"||r.pointerId!==s.pointerId||this.#a(cg(r,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const r=dg(this.width,this.#t.layout().side,s);r!==null&&(s.preventDefault(),this.#a(r),this.#l())},dblclick:()=>{this.#a(this.#t.layout().defaultWidth),this.#l()}},this.#e=e,this.#t=n,e.addController(this)}#e;#t;#n;#r;#s;#i;hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Xe(Ma):he(Ma),this.#r=gg(this.#t.template()),this.#s=this.#n.read(this.#r))}hostDisconnected(){this.#i=Us}get width(){return this.#s??this.#t.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=Us,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#t.layout().defaultWidth?null:e;n!==this.#s&&(this.#s=n,this.#e.requestUpdate())}#l(){this.#s===null?this.#n?.remove(this.#r):this.#n?.write(this.#r,this.#s)}}const Na=[Nt,Dn,fe`
1619
1619
  :host {
1620
1620
  display: block;
1621
1621
  min-height: 100%;
@@ -1628,6 +1628,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
1628
1628
  color-scheme: dark;
1629
1629
  }
1630
1630
 
1631
+ /* An inactive board of a page stays mounted, out of sight. */
1632
+ :host([hidden]) {
1633
+ display: none;
1634
+ }
1635
+
1631
1636
  .dpk-shell {
1632
1637
  display: grid;
1633
1638
  /* One column no wider than the host: a truncated title must not widen
@@ -1647,6 +1652,38 @@ The brief is too long for a comment, so it is stored in this artifact's database
1647
1652
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
1648
1653
  }
1649
1654
 
1655
+ /* A board fills the page's main column; the viewport is the page's. */
1656
+ .dpk-shell[data-board] {
1657
+ height: 100%;
1658
+ }
1659
+
1660
+ .dpk-shell[data-board] > .dpk-board-bar {
1661
+ grid-row: 1;
1662
+ }
1663
+
1664
+ .dpk-shell[data-board] > .dpk-body {
1665
+ grid-row: 2;
1666
+ }
1667
+
1668
+ .dpk-shell[data-board] > .dpk-footer {
1669
+ grid-row: 3;
1670
+ }
1671
+
1672
+ .dpk-board-bar {
1673
+ display: flex;
1674
+ flex-wrap: wrap;
1675
+ align-items: center;
1676
+ gap: 8px 14px;
1677
+ min-height: 40px;
1678
+ padding: 4px 16px;
1679
+ border-bottom: 1px solid var(--dpk-rule);
1680
+ background: var(--dpk-glass);
1681
+ }
1682
+
1683
+ .dpk-board-bar[hidden] {
1684
+ display: none;
1685
+ }
1686
+
1650
1687
  /* ------------------------------------------------------------- header */
1651
1688
 
1652
1689
  .dpk-header {
@@ -2552,7 +2589,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
2552
2589
  max-height: calc(100dvh - 120px);
2553
2590
  overflow: auto;
2554
2591
  overscroll-behavior: contain;
2555
- padding: 4px calc(16px + var(--dpk-dock-space, 0px)) 16px 16px;
2592
+ padding: 4px 16px 16px;
2593
+ /*
2594
+ * The dock floats over the bottom of what is open; showing it must not
2595
+ * resize that. Components lift the controls along their bottom edge by
2596
+ * this much instead.
2597
+ */
2598
+ --dpk-dock-overlap: var(--dpk-dock-clearance, 0px);
2556
2599
  font-size: 12.5px;
2557
2600
  line-height: 1.7;
2558
2601
  color: var(--dpk-ink-soft);
@@ -3490,18 +3533,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
3490
3533
  order: 1;
3491
3534
  }
3492
3535
  }
3493
- `],Ns="supplement",xa="memo",Uf=(t,e)=>[...t.children].filter(n=>n.getAttribute("slot")===Ns).map(n=>{const s=n.getAttribute("data-name")?.trim()??"";return{name:s===""?e:s,element:n}}),Ff=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,Wf={selected:null,open:!1},Gf=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,Vf=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),Kf=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},Qf=30,Zf=Ge(v(),O({base:v(),value:v()})),ya=t=>{const e=C(Zf,t);return e.success?e.output:null},Yf=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Jf=(t,e,n)=>{const{[e]:s,...r}=t;if(n.value===n.base)return r;const i=Object.entries({...r,[e]:n});return Object.fromEntries(i.slice(Math.max(0,i.length-Qf)))},Xf=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},eg=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},tg=new Set(["text","search","url","email","tel"]),wa=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&tg.has(t.type)?t:null,ng=(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},sg=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)}},rg=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,ig=(t,e)=>{const n=[...e];for(let s=t.parentElement;s!==null;s=s.parentElement){const r=n.filter(i=>s.contains(i));if(r.length>0)return r}return[]},og=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),Ds=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(Ds):typeof t=="object"&&t!==null?Object.values(t).flatMap(Ds):[],$a=t=>t.replace(/\s+/g," ").trim();class ag{#e;#t;#n=null;#r="";#s=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Tu(ya):pe(ya),this.#r=this.#t.storageKey()),this.#e.addEventListener("focusin",this.#l),this.#e.addEventListener("input",this.#c),this.#e.addEventListener("click",this.#a,!0)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#l),this.#e.removeEventListener("input",this.#c),this.#e.removeEventListener("click",this.#a,!0)}settle(e){const n=new Set(e.flatMap(Ds).map($a));this.#o([...this.#i].filter(s=>n.has($a(s.value))))}#o(e){for(const n of e){this.#i.delete(n);const s=this.#s.get(n);s!==void 0&&this.#g(Xf(this.#d(),s.id))}}#a=e=>{const n=rg(e);n!==null&&this.#o(ig(n,this.#i))};#l=e=>{const n=wa(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=ng(this.#e,n);if(s===null)return;const r=sg(n),i=n.value,o=Yf({...r===void 0?{}:{key:r},hosts:s,name:og(n),base:i});this.#s.set(n,{id:o,base:i});const a=eg(this.#d(),o,i);a!==null&&queueMicrotask(()=>{if(n.value===i){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#c=e=>{const n=wa(e.composedPath()[0]),s=n===null?void 0:this.#s.get(n);if(!(n===null||s===void 0)){for(const r of this.#i)r.isConnected||this.#i.delete(r);this.#i.add(n),this.#g(Jf(this.#d(),s.id,{base:s.base,value:n.value}))}};#d(){return this.#n?.read(this.#r)??{}}#g(e){Object.keys(e).length===0?this.#n?.remove(this.#r):this.#n?.write(this.#r,e)}}class lg{#e;#t;#n;#r=null;#s=!1;constructor(e,n={}){this.#e=e,this.#t=n.fetchVersions??go,this.#n=n.switchTo??mo,e.addController(this)}hostConnected(){}load(){this.#s||this.#r!==null||(this.#s=!0,this.#t().then(e=>{this.#r=e,this.#s=!1,this.#e.requestUpdate()},e=>{this.#s=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==te&&this.#n(e===""?null:e)}render(e){const n=z(e),s=fo({current:te,requested:ks(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),r=()=>this.load();return m`<span class="dpk-version"
3536
+ `],Fs="supplement",Da="memo",kg=(t,e)=>[...t.children].filter(n=>n.getAttribute("slot")===Fs).map(n=>{const s=n.getAttribute("data-name")?.trim()??"";return{name:s===""?e:s,element:n}}),bg=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,vg={selected:null,open:!1},xg=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,yg=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),wg=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},$g=30,Sg=Ge(v(),O({base:v(),value:v()})),ja=t=>{const e=C(Sg,t);return e.success?e.output:null},Ag=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Tg=(t,e,n)=>{const{[e]:s,...r}=t;if(n.value===n.base)return r;const i=Object.entries({...r,[e]:n});return Object.fromEntries(i.slice(Math.max(0,i.length-$g)))},Cg=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},Eg=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},Rg=new Set(["text","search","url","email","tel"]),qa=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Rg.has(t.type)?t:null,_g=(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},Og=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)}},Lg=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,Pg=(t,e)=>{const n=[...e];for(let s=t.parentElement;s!==null;s=s.parentElement){const r=n.filter(i=>s.contains(i));if(r.length>0)return r}return[]},zg=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),Ws=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(Ws):typeof t=="object"&&t!==null?Object.values(t).flatMap(Ws):[],Ba=t=>t.replace(/\s+/g," ").trim();class Mg{#e;#t;#n=null;#r="";#s=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?rf(ja):he(ja),this.#r=this.#t.storageKey()),this.#e.addEventListener("focusin",this.#l),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("click",this.#a,!0)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#l),this.#e.removeEventListener("input",this.#d),this.#e.removeEventListener("click",this.#a,!0)}settle(e){const n=new Set(e.flatMap(Ws).map(Ba));this.#o([...this.#i].filter(s=>n.has(Ba(s.value))))}#o(e){for(const n of e){this.#i.delete(n);const s=this.#s.get(n);s!==void 0&&this.#m(Cg(this.#p(),s.id))}}#a=e=>{const n=Lg(e);n!==null&&this.#o(Pg(n,this.#i))};#l=e=>{const n=qa(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=_g(this.#e,n);if(s===null)return;const r=Og(n),i=n.value,o=Ag({...r===void 0?{}:{key:r},hosts:s,name:zg(n),base:i});this.#s.set(n,{id:o,base:i});const a=Eg(this.#p(),o,i);a!==null&&queueMicrotask(()=>{if(n.value===i){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#d=e=>{const n=qa(e.composedPath()[0]),s=n===null?void 0:this.#s.get(n);if(!(n===null||s===void 0)){for(const r of this.#i)r.isConnected||this.#i.delete(r);this.#i.add(n),this.#m(Tg(this.#p(),s.id,{base:s.base,value:n.value}))}};#p(){return this.#n?.read(this.#r)??{}}#m(e){Object.keys(e).length===0?this.#n?.remove(this.#r):this.#n?.write(this.#r,e)}}class Ig{#e;#t;#n;#r=null;#s=!1;constructor(e,n={}){this.#e=e,this.#t=n.fetchVersions??Co,this.#n=n.switchTo??Eo,e.addController(this)}hostConnected(){}load(){this.#s||this.#r!==null||(this.#s=!0,this.#t().then(e=>{this.#r=e,this.#s=!1,this.#e.requestUpdate()},e=>{this.#s=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==X&&this.#n(e===""?null:e)}render(e){const n=L(e),s=To({current:X,requested:vs(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),r=()=>this.load();return m`<span class="dpk-version"
3494
3537
  >dev-process-kit@<select
3495
3538
  class="dpk-version-select"
3496
3539
  aria-label=${n.versionLabel}
3497
3540
  title=${n.versionLabel}
3498
3541
  @pointerenter=${r}
3499
3542
  @focus=${r}
3500
- @change=${vs(i=>this.pick(i))}
3543
+ @change=${ys(i=>this.pick(i))}
3501
3544
  >
3502
3545
  ${s.options.map(i=>m`<option value=${i.value} ?selected=${i.value===s.value}>${i.label}</option>`)}
3503
3546
  </select></span
3504
- >`}}const js=`script[type="application/json"]:not([${yo}]):not([${ui}])`,cg=`script[type="application/json"][${ui}]`,dg=30,Sa={width:360,height:480},qs="dpk-review",Aa=t=>{try{return t.matches(":popover-open")}catch{return!1}},pg=()=>new Promise(t=>requestAnimationFrame(()=>t()));class hg extends ge{static{this.styles=Hf}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=ut;#t=null;#n=null;#r="current";#s=null;#i=null;#o=[];#a={open:e=>this.#N(e),answer:(e,n)=>this.#he(e,n),next:e=>this.#V(e),pickRound:e=>{this.#r=e,this.#i=null,this.requestUpdate()}};#l=!1;#c=new vf(this);#d=Wf;#g=new Uu(this,()=>this.storage!=="off"&&this.storage!=="memory");#b=new Bu(this);#m=new uf(this);#v=new Bf(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#p=new jf(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#$=new kf(this);#u=new ag(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??un(this.definition.name)}:unsent-text`});#k=null;#h=new _u(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??un(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===fn||n.classList.contains("dpk-bell"))),show:e=>{this.#be(e)}});#x={toggleList:()=>this.#h.toggleList(),openList:()=>this.#h.send({kind:"open-list"}),show:e=>this.#h.show(e),dismiss:e=>this.#h.send({kind:"close-toast",key:e}),readAll:()=>this.#h.send({kind:"read-all"}),pause:e=>this.#h.pause(e),resume:e=>this.#h.resume(e)};#A=new co(this);#q={toggle:()=>{this.settingsOpen=!this.settingsOpen},flip:e=>{this.dispatch(e)}};constructor(){super(),this.settingsOpen=!1,new Rf(this,{surface:()=>this.renderRoot.querySelector(`#${qs}`),anchor:()=>this.renderRoot.querySelector(".dpk-header-actions"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),new sf(this,{active:()=>this.#e.questions.length>0,layer:()=>this.renderRoot.querySelector(".dpk-grill-badges"),bindings:()=>this.#o}),new ko(this,{open:()=>this.settingsOpen,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===mn||n.matches(".dpk-settings-trigger"))),ownsEscape:()=>!0,dismiss:()=>{this.settingsOpen=!1}})}#P=!1;#ie=new lg(this);#B=new ff(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>{this.#f?.setTemplate(this.definition),this.#f?.setGrill({grill:this.#e,locale:this.locale})});#z;#f;#y=ns;#M=null;#I=new Set;#R=null;#H;#C;#_;#O=[];#U;#oe=new Promise(e=>{this.#U=e});#F;get locale(){return this.#B.locale}get definition(){const e=this.locale;return this.#z?.locale!==e&&(this.#z={locale:e,value:this.definitionFor(e)}),this.#z.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#l||(this.#l=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#W(),window.addEventListener("hashchange",this.#ee),this.addEventListener("click",this.#re),this.addEventListener("dpk-comment-targets-change",this.#w),this.addEventListener("dpk-comment-request",this.#te),this.addEventListener("dpk-comment-submit",this.#ne),this.addEventListener("dpk-element-action",this.#se),this.#_??=new MutationObserver(this.#w),this.#w()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#ee),this.removeEventListener("click",this.#re),this.#C?.disconnect(),this.#_?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#w),this.removeEventListener("dpk-comment-request",this.#te),this.removeEventListener("dpk-comment-submit",this.#ne),this.removeEventListener("dpk-element-action",this.#se)}#W(e=0){if(this.#f){this.#G();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#W(e+1));return}this.#Ce()}#G(){this.#H||(this.#H=this.#f?.subscribe(()=>this.#Oe()))}willUpdate(){this.dataset.theme=this.#g.resolve(yt(this.theme))}updated(){this.#ze(),this.#Pe(),this.#ke(),this.#le(),this.#ue(),this.#P&&(this.#P=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#F??=this.#Ae(),this.#F}get controller(){if(!this.#f)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#f}get derivation(){return this.controller.derivation}get navigation(){return this.#y}dispatch(e){const n=this.controller.dispatch(e);return n.ok&&this.#u.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#S()),n}dispatchBatch(e){const n=this.controller.dispatchBatch(e);return n.ok&&this.#u.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.#S()),n}editComment(e,n){const s=this.controller.editComment(e,n);return s.ok&&this.#u.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#S()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,n={}){const s=Ke(this.#E());this.#y=ss(this.#y,e,this.definition.navigationHierarchy),this.#L(n.replace??!1);const r=Ke(this.#E());this.requestUpdate(),s!==r&&(this.#S(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#y},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#E();return Ke(this.definition.resolveNavigation(this.derivation.state,ss(n,e,this.definition.navigationHierarchy)))}requestComment(e){this.#M=typeof e=="string"?e:D(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get canSendToClaude(){return this.#b.available}sendToClaude(){return this.#b.send({brief:this.api.exportBrief(),draft:Zn(this.derivation.actions),anchor:this})}renderReviewPanel(e){return m`<dpk-component-comment-panel
3547
+ >`}}const Gs=`script[type="application/json"]:not([${Ro}]):not([${yi}])`,Ng=`script[type="application/json"][${yi}]`,Dg=30,Ha={width:360,height:480},Vs="dpk-review",Ua=t=>{try{return t.matches(":popover-open")}catch{return!1}},jg=()=>new Promise(t=>requestAnimationFrame(()=>t()));class qg extends me{static{this.styles=Na}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=Ve;#t=null;#n=null;#r="current";#s=null;#i=null;#o=[];#a={open:e=>this.#B(e),answer:(e,n)=>this.#$e(e,n),next:e=>this.#ee(e),pickRound:e=>{this.#r=e,this.#i=null,this.requestUpdate()}};#l=!1;#d=new Zf(this);#p=vg;#m=new yf(this,()=>this.storage!=="off"&&this.storage!=="memory");#y=new vf(this);#k=new Ff(this);#v=new mg(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.#U,layout:()=>this.sidebarLayout});#h=new fg(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.#U});#A=new Kf(this);#g=new Mg(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??kn(this.#U)}:unsent-text`});#b=null;#u=new lf(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??kn(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===vn||n.classList.contains("dpk-bell"))),show:e=>{this.#Re(e)}});#w={toggleList:()=>this.#u.toggleList(),openList:()=>this.#u.send({kind:"open-list"}),show:e=>this.#u.show(e),dismiss:e=>this.#u.send({kind:"close-toast",key:e}),readAll:()=>this.#u.send({kind:"read-all"}),pause:e=>this.#u.pause(e),resume:e=>this.#u.resume(e)};#E=new bo(this);#G={toggle:()=>{this.settingsOpen=!this.settingsOpen},flip:e=>{this.dispatch(e)}};constructor(){super(),this.settingsOpen=!1,new og(this,{surface:()=>this.renderRoot.querySelector(`#${Vs}`),anchor:()=>this.renderRoot.querySelector(".dpk-header-actions"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),new Mf(this,{active:()=>this.#e.questions.length>0,layer:()=>this.renderRoot.querySelector(".dpk-grill-badges"),bindings:()=>this.#o}),new vo(this,{open:()=>this.settingsOpen,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===yn||n.matches(".dpk-settings-trigger"))),ownsEscape:()=>!0,dismiss:()=>{this.settingsOpen=!1}})}#M=!1;#ge=new Ig(this);#V=new Wf(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>{this.#f?.setTemplate(this.definition),this.#f?.setGrill({grill:this.#e,locale:this.locale})});#I;#f;#$=gt;#N=null;#D=new Set;#O=null;#K;#R;#L;#P=[];#Q;#me=new Promise(e=>{this.#Q=e});#Z;#c=null;#j;get locale(){return this.#x()?.locale()??this.#V.locale}get definition(){const e=this.locale;return this.#I?.locale!==e&&(this.#I={locale:e,value:this.definitionFor(e)}),this.#I.value}connectedCallback(){this.#c=ia(this),super.connectedCallback(),this.dataset.template=this.definition.name,this.#l||(this.#l=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#q(),this.#c===null&&window.addEventListener("hashchange",this.#de),this.addEventListener("click",this.#fe),this.addEventListener("dpk-comment-targets-change",this.#S),this.addEventListener("dpk-comment-request",this.#pe),this.addEventListener("dpk-comment-submit",this.#he),this.addEventListener("dpk-element-action",this.#ue),this.#L??=new MutationObserver(this.#S),this.#S()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#de),this.removeEventListener("click",this.#fe),this.#R?.disconnect(),this.#L?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#S),this.removeEventListener("dpk-comment-request",this.#pe),this.removeEventListener("dpk-comment-submit",this.#he),this.removeEventListener("dpk-element-action",this.#ue)}#q(e=0){if(this.#f){this.#Y();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#q(e+1));return}const n=this.pendingStart();if(n!==null){n.then(()=>this.#q(e));return}this.#Ne()}#Y(){this.#K||(this.#K=this.#f?.subscribe(()=>this.#He()))}willUpdate(){const e=this.#x();this.dataset.theme=e?.theme()??this.#m.resolve($t(this.theme)),e!==null&&this.#f&&this.#j!==e.locale()&&(this.#j=e.locale(),this.#f.setTemplate(this.definition))}updated(){this.#We(),this.#Fe(),this.#Ee(),this.#ve(),this.#Se(),this.#M&&(this.#M=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#Z??=this.#Ie(),this.#Z}get controller(){if(!this.#f)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#f}get derivation(){return this.controller.derivation}get navigation(){return this.#c===null?this.#$:this.#C()}get board(){return this.#c}dispatch(e){if(this.#c!==null)return this.#F(s=>s.dispatch(this.#ie(e)));const n=this.controller.dispatch(e);return n.ok&&this.#g.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#T()),n}dispatchBatch(e){if(this.#c!==null)return this.#F(s=>s.dispatchBatch(e.map(r=>this.#ie(r))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#g.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.#T()),n}editComment(e,n){if(this.#c!==null)return this.#F(r=>r.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#g.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#T()),s}removeAction(e){this.#c!==null?this.#x()?.removeAction(e):this.controller.removeAction(e)}clearActions(){if(this.#c===null){this.controller.clearActions();return}const e=this.#x();for(const n of this.controller.actions)e?.removeAction(n.id)}navigate(e,n={}){if(this.#c!==null){this.#x()?.navigate(this.#oe(e),n);return}const s=Qe(this.#C());this.#$=en(this.#$,e,this.definition.navigationHierarchy),this.#z(n.replace??!1);const r=Qe(this.#C());this.requestUpdate(),s!==r&&(this.#T(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#$},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#x();if(n!==null)return n.hashFor(this.#oe(e));const s=this.#C();return Qe(this.definition.resolveNavigation(this.derivation.state,en(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#c!==null){this.#x()?.requestComment(I(this.#re(e,"page")));return}this.#N=typeof e=="string"?e:I(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get canSendToClaude(){return this.#y.available}sendToClaude(){return this.#y.send({brief:this.api.exportBrief(),draft:es(this.derivation.actions),anchor:this})}renderReviewPanel(e){return m`<dpk-component-comment-panel
3505
3548
  .definition=${this.controller.definition}
3506
3549
  .state=${e.state}
3507
3550
  .navigation=${e.navigation}
@@ -3509,110 +3552,116 @@ The brief is too long for a comment, so it is stored in this artifact's database
3509
3552
  .issues=${this.controller.lastIssues}
3510
3553
  .exportBrief=${()=>this.api.exportBrief()}
3511
3554
  .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
3512
- .pendingTarget=${this.#M}
3513
- .section=${this.#T==="questions"?null:this.#T}
3555
+ .pendingTarget=${this.#N}
3556
+ .section=${this.#_==="questions"?null:this.#_}
3514
3557
  .onDelete=${n=>this.removeAction(n)}
3515
3558
  .onEditComment=${(n,s)=>this.editComment(n,s)}
3516
3559
  .onClear=${()=>this.clearActions()}
3517
- .onComment=${(n,s)=>{const r=this.dispatch({type:B,target:n,payload:{body:s}});return r.ok&&(this.#M=null),r}}
3518
- ></dpk-component-comment-panel>`}renderChrome(e,n){const s=e.actions.length,r=e.actions.filter(g=>g.type===B).length,i=new Set(this.derivation.stale.map(g=>g.action.id)),o=e.actions.filter(g=>J(g)&&!i.has(g.id)).length,a=s-r-o,l=z(this.locale);this.#o=ef(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Ps(this.#e,this.#n):null);const d=n.sidebarHidden===!0||!n.sidebar&&!this.hasSidebarContent(),c=this.sidebarLayout.side,p=this.#we,u=!d&&this.#D&&(p?!this.#p.drawerOpen:this.#p.collapsed),h=d?k:this.#$e(u,p),f=this.definition.title(e.state);return m`
3560
+ .onComment=${(n,s)=>{const r=this.dispatch({type:B,target:n,payload:{body:s}});return r.ok&&(this.#N=null),r}}
3561
+ ></dpk-component-comment-panel>`}renderChrome(e,n){if(this.#c!==null)return this.#ke(n);const s=e.actions.length,r=e.actions.filter(d=>d.type===B).length,i=new Set(this.derivation.stale.map(d=>d.action.id)),o=e.actions.filter(d=>Q(d)&&!i.has(d.id)).length,a=s-r-o;this.#o=Lf(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?qs(this.#e,this.#n):null);const l=this.definition.title(e.state);return m`
3519
3562
  <div class="dpk-shell" ?data-resizing=${this.#v.dragging}>
3520
3563
  <header class="dpk-header">
3521
3564
  <span class="dpk-brand" aria-hidden="true"></span>
3522
3565
  <div class="dpk-title">
3523
- <span class="dpk-template-mark">${this.definition.label}</span>
3524
- <h1 title=${f}>${f}</h1>
3566
+ <span class="dpk-template-mark">${this.templateIdentity().label}</span>
3567
+ <h1 title=${l}>${l}</h1>
3525
3568
  </div>
3526
3569
  <div class="dpk-header-slot">
3527
3570
  ${n.header??k}
3528
3571
  <slot name="header"></slot>
3529
3572
  </div>
3530
3573
  <div class="dpk-header-meta">
3531
- ${this.#ie.render(this.locale)}
3532
- <span class="dpk-meta-name">${this.definition.name}</span>
3574
+ ${this.#ge.render(this.locale)}
3575
+ <span class="dpk-meta-name">${this.templateIdentity().name}</span>
3533
3576
  </div>
3534
3577
  <div class="dpk-header-tools">
3535
- ${this.#ge()} ${this.#xe()} ${this.#ye()}
3578
+ ${this.#Te()} ${this.#Oe()} ${this.#Le()}
3536
3579
  </div>
3537
3580
  </header>
3538
- <div class="dpk-body" data-sidebar-side=${c} ?data-sidebar-drawer=${p}>
3539
- ${c==="right"?h:k}
3540
- <aside
3541
- id="dpk-sidebar"
3542
- class="dpk-sidebar"
3543
- ?hidden=${d||u}
3544
- style=${`--dpk-sidebar-width: ${this.#v.width}px`}
3545
- >
3546
- ${n.sidebar??k}
3547
- <slot name="sidebar"></slot>
3548
- </aside>
3549
- ${c==="left"?h:k}
3550
- ${p&&!u&&!d?m`<div class="dpk-sidebar-scrim" @click=${()=>this.#p.closeDrawer()}></div>`:k}
3551
- <main class="dpk-main">
3552
- <div
3553
- class="dpk-main-body"
3554
- ?data-grill-gutter=${this.#o.some(g=>this.contains(g.target))}
3555
- >
3556
- ${this.#R?m`<div class="dpk-banner" role="alert">
3557
- <strong>${l.baseDataError}</strong>
3558
- <code>${this.#R}</code>
3559
- </div>`:k}
3560
- ${this.#t===null?k:m`<div class="dpk-banner" role="alert">
3561
- <strong>${l.grillError}</strong>
3562
- <code>${this.#t}</code>
3563
- </div>`}
3564
- ${this.#h.error===null?k:m`<div class="dpk-banner" role="alert">
3565
- <strong>${l.changesError}</strong>
3566
- <code>${this.#h.error}</code>
3567
- </div>`}
3568
- ${n.main??k}
3569
- <slot name="main"></slot>
3570
- <section class="dpk-orphans" ?hidden=${this.#c.orphans===0}>
3571
- <p class="dpk-label">previews without metadata</p>
3572
- <slot name="preview"></slot>
3573
- </section>
3574
- ${this.#fe()}
3575
- </div>
3576
- ${this.#Le(l)}
3577
- </main>
3581
+ ${this.#J(n)} ${this.#X(n)}
3582
+ ${this.#be(e,a,r)} ${this.#ye(e)}
3583
+ ${this.#_e(s)} ${this.#Ce()}
3584
+ </div>
3585
+ `}#ke(e){this.#o=[];const n=e.header!==void 0&&e.header!==k||this.querySelector(':scope > [slot="header"]')!==null;return m`
3586
+ <div class="dpk-shell" data-board ?data-resizing=${this.#v.dragging}>
3587
+ <div class="dpk-board-bar" ?hidden=${!n}>
3588
+ <div class="dpk-header-slot">
3589
+ ${e.header??k}
3590
+ <slot name="header"></slot>
3591
+ </div>
3578
3592
  </div>
3579
- ${n.footer||this.hasFooterContent()?m`<footer class="dpk-footer">
3580
- ${n.footer??k}
3581
- <slot name="footer"></slot>
3582
- </footer>`:k}
3583
- ${this.#ae(e,a,r)} ${this.#de(e)}
3584
- ${this.#ve(s)} ${this.#me()}
3593
+ ${this.#J(e)} ${this.#X(e)}
3585
3594
  </div>
3586
- `}#ae(e,n,s){const r=this.definition.settings?.(e.state),i=r!==void 0&&r.items.length>0,o=z(this.locale);return m`<div class="dpk-header-actions">
3587
- ${i?_f(this.settingsOpen,o,this.#q):k}
3588
- ${i&&this.settingsOpen?Of(r,o,this.#q):k}
3589
- ${this.#ce(n,s)}
3590
- </div>`}#le(){const e=this.renderRoot.querySelector(`#${mn}`),n=this.renderRoot.querySelector(".dpk-header-actions");!e||!n||Aa(e)||this.#A.open(e,n,{width:ka.width,height:Math.min(ka.height,window.innerHeight-96)},{placement:"bottom-end"})}#ce(e,n){const s=z(this.locale),r=(a,l,d,c)=>{const p=this.notesOpen&&this.#T===a;return m`<button
3595
+ `}#J(e){const n=L(this.locale),s=e.sidebarHidden===!0||!e.sidebar&&!this.hasSidebarContent(),r=this.sidebarLayout.side,i=this.#Pe,o=!s&&this.#H&&(i?!this.#h.drawerOpen:this.#h.collapsed),a=s?k:this.#ze(o,i);return m`<div class="dpk-body" data-sidebar-side=${r} ?data-sidebar-drawer=${i}>
3596
+ ${r==="right"?a:k}
3597
+ <aside
3598
+ id="dpk-sidebar"
3599
+ class="dpk-sidebar"
3600
+ ?hidden=${s||o}
3601
+ style=${`--dpk-sidebar-width: ${this.#v.width}px`}
3602
+ >
3603
+ ${e.sidebar??k}
3604
+ <slot name="sidebar"></slot>
3605
+ </aside>
3606
+ ${r==="left"?a:k}
3607
+ ${i&&!o&&!s?m`<div class="dpk-sidebar-scrim" @click=${()=>this.#h.closeDrawer()}></div>`:k}
3608
+ <main class="dpk-main">
3609
+ <div class="dpk-main-body" ?data-grill-gutter=${this.#o.some(l=>this.contains(l.target))}>
3610
+ ${this.#O?m`<div class="dpk-banner" role="alert">
3611
+ <strong>${n.baseDataError}</strong>
3612
+ <code>${this.#O}</code>
3613
+ </div>`:k}
3614
+ ${this.#t===null?k:m`<div class="dpk-banner" role="alert">
3615
+ <strong>${n.grillError}</strong>
3616
+ <code>${this.#t}</code>
3617
+ </div>`}
3618
+ ${this.#u.error===null?k:m`<div class="dpk-banner" role="alert">
3619
+ <strong>${n.changesError}</strong>
3620
+ <code>${this.#u.error}</code>
3621
+ </div>`}
3622
+ ${e.main??k}
3623
+ <slot name="main"></slot>
3624
+ <section class="dpk-orphans" ?hidden=${this.#d.orphans===0}>
3625
+ <p class="dpk-label">previews without metadata</p>
3626
+ <slot name="preview"></slot>
3627
+ </section>
3628
+ ${this.#Ae()}
3629
+ </div>
3630
+ ${this.#Ue(n)}
3631
+ </main>
3632
+ </div>`}#X(e){return e.footer||this.hasFooterContent()?m`<footer class="dpk-footer">
3633
+ ${e.footer??k}
3634
+ <slot name="footer"></slot>
3635
+ </footer>`:k}#be(e,n,s){const r=this.definition.settings?.(e.state),i=r!==void 0&&r.items.length>0,o=L(this.locale);return m`<div class="dpk-header-actions">
3636
+ ${i?Pa(this.settingsOpen,o,this.#G):k}
3637
+ ${i&&this.settingsOpen?za(r,o,this.#G):k}
3638
+ ${this.#xe(n,s)}
3639
+ </div>`}#ve(){const e=this.renderRoot.querySelector(`#${yn}`),n=this.renderRoot.querySelector(`.${Oa}`),s=n??this.renderRoot.querySelector(".dpk-header-actions");!e||!s||Ua(e)||this.#E.open(e,s,{width:La.width,height:Math.min(La.height,window.innerHeight-96)},{placement:n===null?"bottom-end":"bottom-start"})}#xe(e,n){const s=L(this.locale),r=(a,l,d,c)=>{const p=this.notesOpen&&this.#_===a;return m`<button
3591
3640
  class="dpk-header-action dpk-review-toggle"
3592
3641
  type="button"
3593
3642
  data-section=${a}
3594
- aria-controls=${qs}
3643
+ aria-controls=${Vs}
3595
3644
  aria-pressed=${p?"true":"false"}
3596
3645
  aria-label=${`${l} (${c??0})`}
3597
3646
  data-tooltip=${l}
3598
3647
  @click=${()=>{this.notesOpen=!p,this.reviewSection=a}}
3599
3648
  >
3600
3649
  ${d} ${c===null?k:m`<span class="dpk-review-badge">${c}</span>`}
3601
- </button>`},i=a=>a>0?String(a):null,o=vi(this.#e,this.derivation.answers);return m`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
3602
- ${r("changes",s.reviewChanges,Hd(),i(e))}
3603
- ${o.total===0?k:r("questions",s.grill,Ud(),`${o.answered}/${o.total}`)}
3604
- ${r("comments",s.reviewComments,Xt(),i(n))}
3605
- </div>`}#de(e){const n=z(this.locale),s=this.#T,r=s==="changes"?n.reviewChanges:s==="questions"?n.grill:n.reviewComments;return m`<div
3606
- id=${qs}
3650
+ </button>`},i=a=>a>0?String(a):null,o=Ci(this.#e,this.derivation.answers);return m`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
3651
+ ${r("changes",s.reviewChanges,cp(),i(e))}
3652
+ ${o.total===0?k:r("questions",s.grill,dp(),`${o.answered}/${o.total}`)}
3653
+ ${r("comments",s.reviewComments,sn(),i(n))}
3654
+ </div>`}#ye(e){const n=L(this.locale),s=this.#_,r=s==="changes"?n.reviewChanges:s==="questions"?n.grill:n.reviewComments;return m`<div
3655
+ id=${Vs}
3607
3656
  class="dpk-review"
3608
3657
  popover="manual"
3609
3658
  role="dialog"
3610
3659
  aria-label=${r}
3611
3660
  data-section=${s}
3612
3661
  >
3613
- ${s==="questions"?this.#pe(e.actions.length):k}
3662
+ ${s==="questions"?this.#we(e.actions.length):k}
3614
3663
  ${this.renderReviewPanel(e)}
3615
- </div>`}get#T(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#pe(e){const n=z(this.locale),s=af(n,this.#e,this.derivation.answers,{open:this.#n,round:this.#r}),r=this.#K(e,!1);return lf(n,s,this.#a,r?m`<footer class="dpk-grill-footer">${this.#Q(r)}</footer>`:k)}#N(e){this.notesOpen=!0,this.reviewSection="questions",this.#r="current",this.#n=e,this.#i=null,this.requestUpdate()}#he(e,n){this.dispatch(Xc(e,n)).ok&&(n.kind==="option"?this.#V(e):n.kind==="free"&&n.text===""&&(this.#s=e))}#V(e){const n=Zc(this.#e,this.derivation.answers,e);n!==null&&(this.#n=n,this.requestUpdate())}#ue(){if(!this.notesOpen||this.#T!=="questions")return;const e=this.#s;this.#s=null,e!==null&&this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus();const n=Ps(this.#e,this.#n);if(this.#r!=="current"||n===null||n===this.#i)return;this.#i=n;const s=this.renderRoot.querySelector(`.dpk-grill [data-question="${n}"]`),r=s?.closest(".dpk-grill-list");s&&r&&xs(r,s)}#fe(){if(this.#o.length===0)return k;const e=z(this.locale);return m`<div class="dpk-grill-badges">
3664
+ </div>`}get#_(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#we(e){const n=L(this.locale),s=Df(n,this.#e,this.derivation.answers,{open:this.#n,round:this.#r}),r=this.#te(e,!1);return jf(n,s,this.#a,r?m`<footer class="dpk-grill-footer">${this.#ne(r)}</footer>`:k)}#B(e){this.notesOpen=!0,this.reviewSection="questions",this.#r="current",this.#n=e,this.#i=null,this.requestUpdate()}#$e(e,n){this.dispatch(kd(e,n)).ok&&(n.kind==="option"?this.#ee(e):n.kind==="free"&&n.text===""&&(this.#s=e))}#ee(e){const n=fd(this.#e,this.derivation.answers,e);n!==null&&(this.#n=n,this.requestUpdate())}#Se(){if(!this.notesOpen||this.#_!=="questions")return;const e=this.#s;this.#s=null,e!==null&&this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus();const n=qs(this.#e,this.#n);if(this.#r!=="current"||n===null||n===this.#i)return;this.#i=n;const s=this.renderRoot.querySelector(`.dpk-grill [data-question="${n}"]`),r=s?.closest(".dpk-grill-list");s&&r&&bs(r,s)}#Ae(){if(this.#o.length===0)return k;const e=L(this.locale);return m`<div class="dpk-grill-badges">
3616
3665
  ${this.#o.map(n=>m`<button
3617
3666
  type="button"
3618
3667
  class="dpk-grill-badge"
@@ -3622,20 +3671,20 @@ The brief is too long for a comment, so it is stored in this artifact's database
3622
3671
  aria-pressed=${n.open?"true":"false"}
3623
3672
  aria-label=${e.grillOpen(`${n.ref} \xB7 ${n.title}`)}
3624
3673
  title=${`${n.ref} \xB7 ${n.title}`}
3625
- @click=${()=>this.#N(n.questionId)}
3674
+ @click=${()=>this.#B(n.questionId)}
3626
3675
  >
3627
3676
  ${n.ref}
3628
3677
  </button>`)}
3629
- </div>`}#ge(){const e=this.#h.view;if(!e)return k;const n=z(this.locale);return m`${Ou(e,n,this.#x)}
3630
- ${Pu(e,n,this.#x)}`}#me(){const e=this.#h.view;return e?zu(e,z(this.locale),this.#x):k}#ke(){const e=this.renderRoot.querySelector(`#${fn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||Aa(e)||this.#A.open(e,n,{width:Sa.width,height:Math.min(Sa.height,window.innerHeight-96)})}async#be(e){const n={};this.#k=n;const s=this.derivation.state,r=e.target===null?null:this.definition.canonicalTarget?.(s,pt(e.target))??pt(e.target),i=Ph({...e,target:r&&D(r)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!i||(i.navigate&&this.navigate(i.navigate),r===null))return;r.type===oe?this.#N(r.id):this.showTarget(r);const o=D(r);for(let a=0;a<dg;a+=1){if(await this.updateComplete,await pg(),this.#k!==n)return;const l=ua(this,o);if(!(l===null||l.getClientRects().length===0)){$f(this,l),Cf(l);return}}}showTarget(e){}#ve(e){const n=this.#K(e,this.notesOpen);if(!n)return k;const s=z(this.locale);return m`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
3631
- ${this.#Q(n)}
3632
- </div>`}#K(e,n){return Su({actions:e,railOpen:n,sendable:this.canSendToClaude,locale:this.locale},this.#m.state)}#Q(e){const n=z(this.locale);return m`${e.note?m`<p class="dpk-dock-note" role="alert">${e.note}</p>`:k}
3678
+ </div>`}#Te(){const e=this.#u.view;if(!e)return k;const n=L(this.locale);return m`${cf(e,n,this.#w)}
3679
+ ${pf(e,n,this.#w)}`}#Ce(){const e=this.#u.view;return e?hf(e,L(this.locale),this.#w):k}#Ee(){const e=this.renderRoot.querySelector(`#${vn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||Ua(e)||this.#E.open(e,n,{width:Ha.width,height:Math.min(Ha.height,window.innerHeight-96)})}async#Re(e){const n={};this.#b=n;const s=this.derivation.state,r=e.target===null?null:this.definition.canonicalTarget?.(s,ut(e.target))??ut(e.target),i=su({...e,target:r&&I(r)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!i||(i.navigate&&this.navigate(i.navigate),r===null))return;r.type===ae?this.#B(r.id):this.showTarget(r);const o=I(r);for(let a=0;a<Dg;a+=1){if(await this.updateComplete,await jg(),this.#b!==n)return;const l=Ca(this,o);if(!(l===null||l.getClientRects().length===0)){eg(this,l),sg(l);return}}}showTarget(e){}#_e(e){const n=this.#te(e,this.notesOpen);if(!n)return k;const s=L(this.locale);return m`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
3680
+ ${this.#ne(n)}
3681
+ </div>`}#te(e,n){return Ku({actions:e,railOpen:n,sendable:this.canSendToClaude,locale:this.locale},this.#k.state)}#ne(e){const n=L(this.locale);return m`${e.note?m`<p class="dpk-dock-note" role="alert">${e.note}</p>`:k}
3633
3682
  <div class="dpk-dock-actions">
3634
3683
  ${e.send?m`<button
3635
3684
  class="dpk-btn dpk-btn--accent"
3636
3685
  type="button"
3637
3686
  ?disabled=${e.send.disabled}
3638
- @click=${()=>{this.#m.send(()=>this.sendToClaude())}}
3687
+ @click=${()=>{this.#k.send(()=>this.sendToClaude())}}
3639
3688
  >
3640
3689
  ${e.send.label}
3641
3690
  </button>`:k}
@@ -3644,38 +3693,38 @@ The brief is too long for a comment, so it is stored in this artifact's database
3644
3693
  type="button"
3645
3694
  data-status=${e.copy.status}
3646
3695
  title=${n.handoffCopyTitle}
3647
- @click=${()=>{this.#m.copy(()=>this.api.exportBrief())}}
3696
+ @click=${()=>{this.#k.copy(()=>this.api.exportBrief())}}
3648
3697
  >
3649
3698
  ${e.copy.label}
3650
3699
  </button>
3651
- </div>`}#xe(){const e=this.locale,n=z(e).language;return m`<select
3700
+ </div>`}#Oe(){const e=this.locale,n=L(e).language;return m`<select
3652
3701
  class="dpk-lang-select"
3653
3702
  aria-label=${n}
3654
3703
  title=${n}
3655
- @change=${vs(s=>{const r=_n.find(i=>i===s);r!==void 0&&this.#B.pick(r)})}
3704
+ @change=${ys(s=>{const r=Mn.find(i=>i===s);r!==void 0&&this.#V.pick(r)})}
3656
3705
  >
3657
- ${_n.map(s=>m`<option value=${s} lang=${s} ?selected=${s===e}>
3658
- ${od[s]}
3706
+ ${Mn.map(s=>m`<option value=${s} lang=${s} ?selected=${s===e}>
3707
+ ${Sd[s]}
3659
3708
  </option>`)}
3660
- </select>`}#ye(){const e=this.dataset.theme==="dark",n=z(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return m`<button
3709
+ </select>`}#Le(){const e=this.dataset.theme==="dark",n=L(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return m`<button
3661
3710
  class="dpk-theme-toggle"
3662
3711
  type="button"
3663
3712
  aria-label=${s}
3664
3713
  title=${s}
3665
- @click=${()=>this.#g.toggle(yt(this.theme))}
3714
+ @click=${()=>this.#m.toggle($t(this.theme))}
3666
3715
  >
3667
- ${e?Xd():ep()}
3668
- </button>`}get#D(){return this.sidebarLayout.collapsible!==!1}get#we(){return this.#$.narrow&&this.#D&&this.sidebarLayout.narrow!=="stack"}#$e(e,n){const s=this.#D?this.#Se(e,n):k;return e||n?m`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?m`${this.#Z()}${s}`:m`${s}${this.#Z()}`}#Se(e,n){const s=z(this.locale),r=Nf(this.sidebarLayout.side,e),i=r.action==="collapse"?s.collapseSidebar:s.expandSidebar;return m`<button
3716
+ ${e?xp():yp()}
3717
+ </button>`}get#H(){return this.sidebarLayout.collapsible!==!1}get#Pe(){return this.#A.narrow&&this.#H&&this.sidebarLayout.narrow!=="stack"}#ze(e,n){const s=this.#H?this.#Me(e,n):k;return e||n?m`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?m`${this.#se()}${s}`:m`${s}${this.#se()}`}#Me(e,n){const s=L(this.locale),r=hg(this.sidebarLayout.side,e),i=r.action==="collapse"?s.collapseSidebar:s.expandSidebar;return m`<button
3669
3718
  class="dpk-sidebar-toggle"
3670
3719
  type="button"
3671
3720
  aria-controls="dpk-sidebar"
3672
3721
  aria-expanded=${e?"false":"true"}
3673
3722
  aria-label=${i}
3674
3723
  title=${i}
3675
- @click=${()=>{this.#P=!0,n?this.#p.toggleDrawer():this.#p.toggle()}}
3724
+ @click=${()=>{this.#M=!0,n?this.#h.toggleDrawer():this.#h.toggle()}}
3676
3725
  >
3677
- ${r.points==="left"?Bi():ft()}
3678
- </button>`}#Z(){const e=z(this.locale),n=this.#v.handlers;return m`<div
3726
+ ${r.points==="left"?Qi():mt()}
3727
+ </button>`}#se(){const e=L(this.locale),n=this.#v.handlers;return m`<div
3679
3728
  class="dpk-sidebar-resizer"
3680
3729
  role="separator"
3681
3730
  tabindex="0"
@@ -3691,7 +3740,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
3691
3740
  @pointercancel=${n.pointercancel}
3692
3741
  @keydown=${n.keydown}
3693
3742
  @dblclick=${n.dblclick}
3694
- ></div>`}render(){if(!this.#f)return k;const e=this.#J();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Pf}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#J()}#j(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#oe,navigation:()=>this.#E(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#I.add(e),()=>{this.#I.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)}}#Ae(){return Cu(this.#j(),this)}#Y(){return Vo(this.#j())}#J(){return Au(this.#j())}#E(){return this.definition.resolveNavigation(this.derivation.state,this.#y)}#Ce(){const e=this.#Re();this.#e=this.#X(),this.#Te(),this.#y=ca();const n=this.storageKey;this.#f=new Uo({definition:this.definition,base:e,storage:this.#Ee(),grill:{grill:this.#e,locale:this.locale},...typeof n=="string"?{storageKey:n}:{}}),this.#G(),this.#w(),this.#L(!0),this.#U?.(),this.#_e(),this.requestUpdate()}#Te(){this.querySelector(`:scope > [slot="${xa}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${xa}"; slot each piece as slot="${Ns}" data-name="\u2026" instead.`)}#Ee(){return this.storage==="off"?null:this.storage==="memory"?new Ts:Es()}#Re(){const e=this.querySelector(js);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.#R='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.#R=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#X(){const e=this.querySelector(cg);if(this.#t=null,!e?.textContent||e.textContent.trim().length===0)return ut;try{return Kc(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid questions:",n),this.#t=n instanceof Error?n.message:String(n),ut}}#_e(){this.querySelector(js)||(this.#C=new MutationObserver(()=>{const e=this.querySelector(js);if(e){this.#C?.disconnect(),this.#C=void 0,this.#e=this.#X(),this.controller.setGrill({grill:this.#e,locale:this.locale});try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#C.observe(this,{childList:!0,subtree:!0}))}#S(){const e=this.#Y();for(const n of this.#I)n(e)}#Oe(){if(!this.isConnected){this.requestUpdate(),this.#S();return}this.#L(!0),ta(this.#O,this.controller.actions),queueMicrotask(this.#w),this.requestUpdate(),this.#S(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#Y(),bubbles:!0,composed:!0}))}#L(e){const n=this.#E();this.#y=n,bf(n,e)}#ee=()=>{this.#y=ca(),this.#L(!0),this.requestUpdate(),this.#S(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#y},bubbles:!0,composed:!0}))};#w=()=>{this.#_?.disconnect(),this.#O=Fu(this,e=>{this.isConnected&&this.#_?.observe(e,{childList:!0,subtree:!0})}),this.#f&&(ta(this.#O,this.#f.actions),this.#f.setComponentSnapshot(Gu(this.#O)))};#te=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#f)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#w(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===n.target))||this.requestComment(n.target)};#ne=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#f)return;const n=C(Dh,e.detail);if(!n.success)return;this.#w();const{target:s,body:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:B,target:s,payload:{body:r}}).ok&&e.preventDefault()};#se=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#f)return;const n=C(Bc,e.detail);if(!n.success)return;this.#w();const{type:s,target:r,payload:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===r))return;this.dispatch({type:s,target:r,payload:i}).ok&&e.preventDefault()};#re=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(Yt(s.includes("=")?s:`step=${s}`));return}const r=n.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#Le(e){const n=Uf(this,e.memo),s=Gf(this.#d,n),r=i=>{this.#d=i,this.requestUpdate()};return m`<div class="dpk-supplements" ?hidden=${n.length===0} ?data-open=${s!==null}>
3743
+ ></div>`}render(){if(!this.#f)return k;const e=this.#le();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return lg}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#le()}#x(){return this.#c===null?null:Ju(this)}get#U(){return this.#c===null?this.definition.name:`${this.definition.name}@${this.#c}`}#F(e){const n=this.#x();if(n===null)return{ok:!1,issues:[{path:"board",message:"the page is not ready yet"}]};const s=e(n);return this.requestUpdate(),s}#re(e,n){const s=this.#x(),r=this.#c,i=Qt(e,n);return r===null||s===null?i:Qu(i,r,s.boardIds())}#ie(e){const n=this.controller.descriptorFor(e.type)?.targetType??"page";return{...e,target:this.#re(e.target,n)}}#oe(e){const n=this.#x(),s=this.#c;return n===null||s===null?e:tf(n.navigation(),s,e,n.boardIds(),this.definition.navigationHierarchy)}#W(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#me,navigation:()=>this.#C(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#D.add(e),()=>{this.#D.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e),brief:e=>this.buildBrief(e)}}#Ie(){return sf(this.#W(),this)}#ae(){return aa(this.#W())}#le(){return nf(this.#W())}#C(){const e=this.#x(),n=this.#c===null?this.#$:Ms(e?.navigation()??gt,this.#c);return this.#f?this.definition.resolveNavigation(this.derivation.state,n):n}#Ne(){const e=this.#qe(),n=this.#c!==null;this.#e=n?Ve:this.#ce(),this.#De(),this.#$=n?gt:$a(),this.#j=this.locale;const s=this.storageKey;this.#f=new Zo({definition:this.definition,base:e,storage:n?null:this.#je(),grill:{grill:this.#e,locale:this.locale},...typeof s=="string"?{storageKey:s}:{}}),this.#Y(),this.#S(),this.#z(!0),this.#Q?.(),this.#Be(),this.requestUpdate()}#De(){this.querySelector(`:scope > [slot="${Da}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${Da}"; slot each piece as slot="${Fs}" data-name="\u2026" instead.`)}#je(){return this.storage==="off"?null:this.storage==="memory"?new Rs:_s()}scriptOf(e){return this.querySelector(e)}pendingStart(){return null}templateIdentity(){return this.definition}buildBrief(e){return tn(e,this.controller.definition,X)}#qe(){const e=this.scriptOf(Gs);if(e===null&&this.hasAttribute(ra))return this.definition.emptyBase();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.#O='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.#O=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}#ce(){const e=this.scriptOf(Ng);if(this.#t=null,!e?.textContent||e.textContent.trim().length===0)return Ve;try{return hd(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid questions:",n),this.#t=n instanceof Error?n.message:String(n),Ve}}#Be(){this.scriptOf(Gs)||(this.#R=new MutationObserver(()=>{const e=this.scriptOf(Gs);if(e){this.#R?.disconnect(),this.#R=void 0,this.#c===null&&(this.#e=this.#ce()),this.controller.setGrill({grill:this.#e,locale:this.locale});try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#R.observe(this,{childList:!0,subtree:!0}))}#T(){const e=this.#ae();for(const n of this.#D)n(e)}#He(){if(!this.isConnected){this.requestUpdate(),this.#T();return}this.#c===null&&this.#z(!0),ga(this.#P,this.controller.actions),queueMicrotask(this.#S),this.requestUpdate(),this.#T(),this.#c===null&&this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#ae(),bubbles:!0,composed:!0}))}#z(e){if(this.#c!==null)return;const n=this.#C();this.#$=n,Qf(n,e)}#de=()=>{this.#$=$a(),this.#z(!0),this.requestUpdate(),this.#T(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#$},bubbles:!0,composed:!0}))};#S=()=>{this.#L?.disconnect(),this.#P=wf(this,e=>{this.isConnected&&this.#L?.observe(e,{childList:!0,subtree:!0})}),this.#f&&(ga(this.#P,this.#f.actions),this.#f.setComponentSnapshot(Sf(this.#P)))};#pe=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#f)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#S(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===n.target))||this.requestComment(n.target)};#he=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#f)return;const n=C(lu,e.detail);if(!n.success)return;this.#S();const{target:s,body:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:B,target:s,payload:{body:r}}).ok&&e.preventDefault()};#ue=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#f)return;const n=C(id,e.detail);if(!n.success)return;this.#S();const{type:s,target:r,payload:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===r))return;this.dispatch({type:s,target:r,payload:i}).ok&&e.preventDefault()};#fe=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(Xt(s.includes("=")?s:`step=${s}`));return}const r=n.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#Ue(e){const n=kg(this,e.memo),s=xg(this.#p,n),r=i=>{this.#p=i,this.requestUpdate()};return m`<div class="dpk-supplements" ?hidden=${n.length===0} ?data-open=${s!==null}>
3695
3744
  <div class="dpk-supplements-bar" role="group" aria-label=${e.supplements}>
3696
3745
  <button
3697
3746
  type="button"
@@ -3699,22 +3748,22 @@ The brief is too long for a comment, so it is stored in this artifact's database
3699
3748
  aria-expanded=${String(s!==null)}
3700
3749
  aria-controls="dpk-supplements-body"
3701
3750
  aria-label=${s===null?e.openSupplements:e.closeSupplements}
3702
- @click=${()=>r(Kf(this.#d,n))}
3751
+ @click=${()=>r(wg(this.#p,n))}
3703
3752
  >
3704
- ${ft()}
3753
+ ${mt()}
3705
3754
  </button>
3706
3755
  ${n.map(i=>m`<button
3707
3756
  type="button"
3708
3757
  class="dpk-supplement-tab"
3709
3758
  aria-expanded=${String(i===s)}
3710
3759
  aria-controls="dpk-supplements-body"
3711
- @click=${()=>r(Vf(this.#d,i.element))}
3760
+ @click=${()=>r(yg(this.#p,i.element))}
3712
3761
  >
3713
3762
  ${i.name}
3714
3763
  </button>`)}
3715
3764
  </div>
3716
3765
  <div class="dpk-supplements-body" id="dpk-supplements-body" ?hidden=${s===null}>
3717
- <style .textContent=${s===null?"":Ff(this,s)}></style>
3718
- <slot name=${Ns} @slotchange=${()=>this.requestUpdate()}></slot>
3766
+ <style .textContent=${s===null?"":bg(this,s)}></style>
3767
+ <slot name=${Fs} @slotchange=${()=>this.requestUpdate()}></slot>
3719
3768
  </div>
3720
- </div>`}#Pe(){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"))}#ze(){this.#c.route()}}export{vt as $,Xt as A,Vd as B,B as C,Fi as D,ns as E,te as F,Ni as G,qi as H,as as I,ji as J,Ii as K,jo as L,Ts as M,Yt as N,pt as O,Ec as P,ss as Q,Rc as R,Zn as S,hg as T,ri as U,D as V,Cs as W,Wt as X,Kn as Y,Mt as Z,po as _,Yn as a,ko as a$,zt as a0,rl as a1,ue as a2,k as a3,m as a4,Me as a5,Gd as a6,qa as a7,ms as a8,ge as a9,Vr as aA,Gt as aB,U as aC,Je as aD,pe as aE,mh as aF,vs as aG,bh as aH,hn as aI,Ee as aJ,th as aK,ua as aL,ra as aM,Fr as aN,Qr as aO,Cc as aP,Sc as aQ,Ge as aR,ur as aS,Hr as aT,T as aU,zi as aV,Oi as aW,Li as aX,Rn as aY,Bd as aZ,vr as a_,co as aa,Ln as ab,Yd as ac,Jd as ad,Ft as ae,P as af,N as ag,j as ah,v as ai,Ht as aj,y as ak,$ as al,ni as am,Ut as an,ve as ao,G as ap,Gn as aq,ft as ar,Zd as as,Vn as at,C as au,O as av,Wn as aw,ei as ax,ti as ay,Zr as az,Ur as b,lo as b0,rt as b1,_t as b2,Tn as b3,Bi as b4,Di as b5,Wd as b6,is as b7,Wr as b8,Kr as b9,Yr as ba,kh as bb,Mi as bc,xs as bd,xo as be,_i as bf,Pi as bg,Uo as c,ai as d,_c as e,rs as f,li as g,ht as h,No as i,Pn as j,ii as k,zc as l,Qn as m,Es as n,un as o,Tc as p,cp as q,dc as r,dh as s,Do as t,Pe as u,Lc as v,Ke as w,Qd as x,Kd as y,Jt as z};
3769
+ </div>`}#Fe(){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"))}#We(){this.#d.route()}}export{yt as $,nn as A,sn as B,B as C,Ji as D,gt as E,fp as F,Wi as G,Ki as H,ls as I,Vi as J,Fi as K,Go as L,Rs as M,Xt as N,ut as O,Gc as P,en as Q,Vc as R,es as S,qg as T,hi as U,I as V,Es as W,Vt as X,Qt as Y,Nt as Z,$o as _,ts as a,ji as a$,It as a0,wl as a1,fe as a2,k as a3,m as a4,Me as a5,up as a6,rl as a7,ks as a8,me as a9,wp as aA,bs as aB,li as aC,ci as aD,si as aE,ei as aF,Kt as aG,U as aH,Xe as aI,he as aJ,qh as aK,ys as aL,Hh as aM,mn as aN,Ee as aO,Ah as aP,Ca as aQ,ba as aR,Yr as aS,ni as aT,Fc as aU,Hc as aV,Ge as aW,xr as aX,Qr as aY,A as aZ,Hi as a_,bo as aa,Nn as ab,bp as ac,vp as ad,Gt as ae,z as af,D as ag,j as ah,v as ai,Ft as aj,y as ak,$ as al,di as am,Wt as an,ve as ao,G as ap,Yn as aq,mt as ar,kp as as,C as at,O as au,Zn as av,Jn as aw,vo as ax,Sp as ay,$p as az,Zr as b,qi as b0,zn as b1,lp as b2,Tr as b3,ko as b4,it as b5,Lt as b6,Ln as b7,Qi as b8,Gi as b9,sa as bA,L as bB,Oa as bC,Pa as bD,za as bE,ia as bF,hp as ba,os as bb,Jr as bc,ti as bd,ri as be,Bh as bf,Ui as bg,wo as bh,Di as bi,Bi as bj,oe as bk,Ps as bl,ta as bm,Q as bn,Ms as bo,Zu as bp,Ls as bq,ef as br,oa as bs,ea as bt,na as bu,ht as bv,ai as bw,Na as bx,zs as by,ra as bz,Zo as c,gi as d,Kc as e,tn as f,mi as g,ft as h,Fo as i,Dn as j,ui as k,Jc as l,Xn as m,_s as n,kn as o,Wc as p,Pp as q,Ec as r,zh as s,Wo as t,Pe as u,X as v,Zc as w,Qe as x,mp as y,gp as z};