bmad-kanban 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # bmad-kanban
2
2
 
3
- A read-only Kanban board for [BMAD Method](https://github.com/bmad-code-org/BMAD-METHOD) projects. It runs locally, reads your project's BMAD files, and shows stories as cards in Backlog, Ready, In progress, Review and Done columns, with optional epic swimlanes. It updates live when files change. Click a card to read its story; hover a card and click **Copy** to put its id and title (e.g. `1.2 Tax rules`) on the clipboard, ready to paste into your BMAD agent.
3
+ A read-only Kanban board for [BMAD Method](https://github.com/bmad-code-org/BMAD-METHOD) projects. It runs locally, reads your project's BMAD files, and shows stories as cards in Backlog, Ready, In progress, Review and Done columns, with optional epic swimlanes. It updates live when files change. Cards with a file icon have a story file: click one to read it; hover a card and click **Copy** to put its id and title (e.g. `1.2 Tax rules`) on the clipboard, ready to paste into your BMAD agent.
4
4
 
5
5
  It never writes to your project. Remove a project from the sidebar and only the board's own list changes; your folder is not touched.
6
6
 
@@ -146,7 +146,7 @@ export async function readBoard(root, sourceId) {
146
146
  if (t === null)
147
147
  throw new UnknownSourceError(sourceId);
148
148
  try {
149
- return await loadBoard(cfg, t);
149
+ return markNoFile(cfg, t, await loadBoard(cfg, t));
150
150
  }
151
151
  catch (e) {
152
152
  return {
@@ -169,6 +169,28 @@ function inside(root, file) {
169
169
  return false;
170
170
  }
171
171
  }
172
+ function detailFile(cfg, t, storyKey) {
173
+ return t.type === 'v6-sprint'
174
+ ? v6SprintDetailPath(cfg, storyKey)
175
+ : t.type === 'v6-spec'
176
+ ? v6SpecDetailPath(t.path, storyKey)
177
+ : v7DetailPath(t.path, storyKey);
178
+ }
179
+ /** Flag stories with nothing to read: no story/plan file and, for v7, no description in tickets.toml. */
180
+ function markNoFile(cfg, t, board) {
181
+ for (const s of board.stories) {
182
+ const file = detailFile(cfg, t, s.key);
183
+ const readable = file !== null ? inside(cfg.root, file) : t.type === 'v7' && v7EntryText(t.path, s.key) !== null;
184
+ if (!readable)
185
+ s.noFile = true;
186
+ }
187
+ for (const c of board.children ?? []) {
188
+ const ct = resolveTarget(cfg, c.sourceId);
189
+ if (ct !== null)
190
+ markNoFile(cfg, ct, c);
191
+ }
192
+ return board;
193
+ }
172
194
  export async function getStoryDetail(root, sourceId, storyKey) {
173
195
  let cfg;
174
196
  try {
@@ -180,11 +202,7 @@ export async function getStoryDetail(root, sourceId, storyKey) {
180
202
  const t = resolveTarget(cfg, sourceId);
181
203
  if (t === null)
182
204
  throw new UnknownSourceError(sourceId);
183
- const file = t.type === 'v6-sprint'
184
- ? v6SprintDetailPath(cfg, storyKey)
185
- : t.type === 'v6-spec'
186
- ? v6SpecDetailPath(t.path, storyKey)
187
- : v7DetailPath(t.path, storyKey);
205
+ const file = detailFile(cfg, t, storyKey);
188
206
  if (file === null) {
189
207
  if (t.type === 'v7') {
190
208
  const text = v7EntryText(t.path, storyKey);
@@ -0,0 +1,67 @@
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u={},d=[],f=/^m(i|n|o|s|text|space)$/,p=Array.isArray,m=d.slice,h=Object.assign;function g(e){e&&e.parentNode&&e.remove()}function _(n,r,i,a,o){var s={type:n,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o||++t,__i:-1,__u:0};return!o&&e.vnode&&e.vnode(s),s}function v(e){return e.children}function y(e,t){this.props=e,this.context=t,this.__g=0}function b(e,t){if(t==null)return e.__&&b(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:b(e)}function x(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),x(e)}function S(t){(8&t.__g||(t.__g|=8,n.push(t),i++))&&r==e.debounceRendering||((r=e.debounceRendering)||queueMicrotask)(C)}function C(){var t,o,s,c,l,u,d,f,p;try{for(o=1;n.length;)n.length>o&&n.sort(a),t=n.shift(),o=n.length,8&t.__g&&(c=void 0,l=void 0,u=(l=(s=t).__v).__e,d=[],f=[],(p=s.__P)&&((c=h({constructor:void 0},l)).__v=l.__v+1,e.vnode&&e.vnode(c),A(p,c,l,s.__n,p.namespaceURI,32&l.__u?[u]:null,d,u||b(l),32&l.__u,f),c.__v=l.__v,c.__.__k[c.__i]=c,re(d,c,f),l.__=l.__e=null,c.__e!=u&&x(c)))}finally{(i=n.length)&&(r||queueMicrotask)(C)}}function ee(e,t,n,r,i,a,o,s,c,l,f){var p,m,h,g,_,v,y=r.__k||d,b=t.length;for(c=w(n,t,y,c,b),p=0;p<b;p++)(h=n.__k[p])!=null&&(m=~h.__i&&y[h.__i]||u,h.__i=p,v=A(e,h,m,i,a,o,s,c,l,f),g=h.__e,(m.ref!=h.ref||8&m.__u)&&(m.ref&&j(m.ref,null,h,m),h.ref&&f.push(h.ref,h.__c||g,h)),_||=g,4&h.__u?(c=T(h,c,e,!m.__v),m.__e&&(m.__e=null)):typeof h.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),h.__u&=-21);return n.__e=_,c}function w(e,t,n,r,i){var a,o,s,c,l,u,d,f,m,h=n.length,g=h,y=0,x=0,S=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor==String?o=S[a]=_(null,o):p(o)?o=S[a]=_(v,{children:o}):o.constructor===void 0&&o.__b?o=S[a]=_(o.type,o.props,o.key,o.ref,o.__v):S[a]=o,c=a+y,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=E(o,n,c,g))&&(g--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=16,l==c-1?y--:l==c+1?y++:l!=c&&(l>c?y--:y++,x=1)):(~l||(i>h?y--:i<h&&y++),typeof o.type!=`function`&&(o.__u|=4))):S[a]=null;if(x){for(u=[],d=[],a=0;a<i;a++)if((o=S[a])&&16&o.__u){for(y=0,f=u.length;y<f;)u[m=y+f>>1]<o.__i?y=m+1:f=m;u[y]=o.__i,d[a]=y+1}for(y=u.length;a--;)d[a]&&(d[a]==y?y--:S[a].__u|=4)}if(g)for(a=0;a<h;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=b(s)),ae(s,s));return r}function T(e,t,n,r){var i,a,o,s;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=T(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=b(e))&&!t.parentNode&&(t=null),o=e.__e,s=t;s&&s.nodeType==8;)s=s.nextSibling;for(o!=s&&(!r&&n.moveBefore&&o.parentNode?n.moveBefore(o,t):n.insertBefore(o,t||null)),t=o;(t&&=t.nextSibling)&&t.nodeType==8&&!t.data.startsWith(`$s`););return t}function E(e,t,n,r){var i,a=e.key,o=e.type,s=t[n],c=s&&!(2&s.__u);if(s===null&&a==null||c&&a==s.key&&o==s.type)return n;if(r>+!!c){for(i=n-1;i>=0;i--)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i;for(i=n+1;i<t.length;i++)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i}return-1}function D(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function O(e,t,n,r,i){var a,o;if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||D(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||D(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)(e.__e||={})[t]=n,n&&r||(o=l[t]||(l[t]=k(t)),(e.__a||={})[t]=c,a=t!=(t=t.replace(s,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),n?e.addEventListener(t,o,a):e.removeEventListener(t,o,a));else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;return}catch{}if(typeof n==`function`)return;n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n)}}function k(t){return function(n){var r=this.__e;if(r){if(r=r[t],n[o]==null)n[o]=c++;else if(n[o]<this.__a[t])return;return r(e.event?e.event(n):n)}}}function A(t,n,r,i,a,o,s,c,l,u){var f,m,_,x,S,C,w,T,E,D,O,k,A,re,j,se,M,N,P=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=32&r.__u,f=r.__c.__z)&&(n.__u|=l,m=o=[],f.nodeType==8?c=te(f,o):o.push(f),c=o[0]||c),(f=e.__b)&&f(n);n:if(typeof P==`function`){_=s.length;try{if(T=n.props,E=(f=P.prototype)&&f.render,D=(f=P.contextType)&&i[f.__c],O=f?D?D.props.value:f.__:i,(x=r.__c)?(n.__c=x,2&x.__g&&(x.__g|=1)):(E?n.__c=x=new P(T,O):(n.__c=x=new y(T,O),x.constructor=P,x.render=oe),D&&D.sub(x),x.state||(x.state={}),x.__n=i,x.__g|=8,x.__h=[],x.__k=[]),E&&(x.__s||(x.__s=x.state),P.getDerivedStateFromProps&&(x.__s==x.state&&(x.__s=h({},x.__s)),h(x.__s,P.getDerivedStateFromProps(T,x.__s)))),S=x.props,C=x.state,x.__v=n,r.__c){if(T!==S&&E&&!P.getDerivedStateFromProps&&x.componentWillReceiveProps&&x.componentWillReceiveProps(T,O),n.__v==r.__v&&!(8&x.__g)||!(4&x.__g)&&x.shouldComponentUpdate&&!1===x.shouldComponentUpdate(T,x.__s,O)){n.__v!=r.__v&&(x.props=T,x.state=x.__s,x.__g&=-9),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),d.push.apply(x.__h,x.__k),x.__k=[],x.__h.length&&s.push(x),c=b(r);break n}x.componentWillUpdate&&x.componentWillUpdate(T,x.__s,O),E&&x.componentDidUpdate&&x.__h.push(function(){x.componentDidUpdate(S,C,w)})}else E&&!P.getDerivedStateFromProps&&x.componentWillMount&&x.componentWillMount(),E&&x.componentDidMount&&x.__h.push(x.componentDidMount);if(x.context=O,x.props=T,x.__P=t,x.__g&=-5,k=e.__r,A=0,E)x.state=x.__s,x.__g&=-9,k&&k(n),f=x.render(x.props,x.state,x.context),d.push.apply(x.__h,x.__k),x.__k=[];else do x.__g&=-9,k&&k(n),f=x.render(x.props,x.state,x.context),x.state=x.__s;while(8&x.__g&&++A<25);x.state=x.__s,x.getChildContext&&(i=h({},i,x.getChildContext())),E&&r.__c&&x.getSnapshotBeforeUpdate&&(w=x.getSnapshotBeforeUpdate(S,C)),re=f&&f.type===v&&f.key==null?f.props.children:f,T.__P&&(f=c,a=(t=T.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=t&&(r.__k.some(function(e){e&&ae(e,e)}),r.__k=null),c=r.__k?b(r,0):null),c=ee(t,p(re)?re:[re],n,r,i,a,o,s,c,l,u),T.__P&&(n.__e=null,c=f),n.__u&=-161,m&&m.some(g),x.__h.length&&s.push(x),1&x.__g&&(x.__g&=-4)}catch(t){if(s.length=_,n.__v=null,l||o){if(t.then){if(j=0,n.__u|=128|l,o){for(~(M=o.indexOf(c||void 0))||(M=o.length);(N=o[M-1])&&N.nodeType==8;)M--;for(;M<o.length;M++)if(N=o[M]){if(o[M]=null,N.nodeType==8){if(N.data.startsWith(`$s`))j++||(se=N);else if(j&&N.data.startsWith(`/$s`)&&!--j)break}else if(!j)break}}if(!se){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;se=c}(f=te(se=n.__c.__z||(n.__c.__z=se)))?(n.__e=se,c=f):n.__e=c,c&&=c.nextSibling}else o&&o.some(g)}else n.__e=r.__e;n.__k||=r.__k||[],t.then||ne(n),e.__e(t,n,r)}}else c=n.__e=ie(r.__e,n,r,i,a,o,s,l,u,t);return(f=e.diffed)&&f(n),c}function te(e,t){if(e&&e.nodeType==8&&e.data.startsWith(`$s`))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith(`$s`))n++;else if(e.data.startsWith(`/$s`)&&!--n)return e}t&&t.push(e)}}function ne(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(ne))}function re(t,n,r){for(var i=0;i<r.length;)j(r[i++],r[i++],r[i++]);e.__c&&e.__c(n,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(e){e.call(n)})}catch(t){e.__e(t,n.__v)}})}function ie(t,n,r,i,a,o,s,c,l,d){var h,_,v,y,x,S,C,w,T,E=r.props||u,D=n.props,k=n.type;if(k==`svg`?a=`http://www.w3.org/2000/svg`:k==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(h=0;h<o.length;h++)if((x=o[h])&&(k?x.localName==k:x.nodeType==3)){t=x,o[h]=null;break}}if(!t){if(w=d.ownerDocument||document,!k)return w.createTextNode(D);t=w.createElementNS(a,k,D.is&&D),c&&=(e.__m&&e.__m(n,o),!1),o=null}if(k){if(d=k==`template`?t.content:t,o=k==`textarea`&&D.defaultValue!=null?null:o&&m.call(d.childNodes),!c&&o)for(E={},h=0;h<t.attributes.length;h++)E[(x=t.attributes[h]).name]=x.value;for(h in E)x=E[h],h==`dangerouslySetInnerHTML`?v=x:h==`children`||h in D||h==`value`&&`defaultValue`in D||h==`checked`&&`defaultChecked`in D||O(t,h,null,x,a);for(h in T=1&r.__u,D)x=D[h],h==`children`?y=x:h==`dangerouslySetInnerHTML`?_=x:h==`value`?S=x:h==`checked`?C=x:c&&typeof x!=`function`||!(E[h]!==x||T&&x!=null)||O(t,h,x,E[h],a);_?(c||v&&(_.__html==v.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),n.__k=[]):(v&&(t.textContent=``),(k==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&f.test(k))&&(a=`http://www.w3.org/1999/xhtml`),ee(d,p(y)?y:[y],n,r,i,a,o,s,o?o[0]:r.__k&&b(r,0),c,l),o&&o.some(g)),c&&k!=`textarea`||(h=`value`,k==`progress`&&S==null?t.removeAttribute(h):S==null||S===t[h]&&(k!=`progress`||S)||O(t,h,S,E[h],a),h=`checked`,C!=null&&C!=t[h]&&O(t,h,C,E[h],a))}else E===D||c&&t.data==D||(t.data=D);return t}function j(t,n,r,i){try{typeof t==`function`?n?n.__x=t(n)||1:(i&&=i.__c||i.__e)&&(n=i.__x)&&(i.__x=null,typeof n==`function`?n():t(null)):t.current=n}catch(t){e.__e(t,r)}}function ae(t,n,r){var i,a,o,s;if(e.unmount&&e.unmount(t),!(i=t.ref)||i.current&&i.current!=t.__e||j(i,null,n,t),i=t.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){e.__e(t,n)}i.__P=i.__n=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&ae(i[s],n,typeof t.type!=`function`||r&&!t.props.__P);!r&&(i=t.__c)&&(i=i.__z)&&(a=te(i,o=[]))&&(i==t.__e&&o.some(g),g(a),g(i)),(i=t.__e)&&(r||g(i),i.__e&&(i.__e=null)),t.__e=t.__c=t.__=null}function oe(e,t,n){return this.constructor(e,n)}function se(t,n){var r,i,a,o;e.__&&e.__(t,n),n.nodeType==9&&(n=n.documentElement),i=(r=t&&32&t.__u)?null:n.__k,n.__k=_(v,{children:[t]}),a=[],o=[],A(n,n.__k,i||u,u,n.namespaceURI,i?null:n.firstChild?m.call(n.childNodes):null,a,i?i.__e:n.firstChild,r,o),re(a,n.__k,o),n.__k.props.children=null}e={__e:function(e,t,n,r){for(var a,o,s;t=t.__;)if((a=t.__c)&&!(1&a.__g)){a.__g|=4;try{if((s=(o=a.constructor)&&o.getDerivedStateFromError)&&a.setState(o.getDerivedStateFromError(e)),a.componentDidCatch&&(a.componentDidCatch(e,r||{}),s=1),s&&8&a.__g)return void(a.__g|=2)}catch(t){e=t}}throw i=0,e}},t=0,y.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=h({},this.state)),typeof e==`function`&&(e=e(h({},n),this.props)),e&&(h(n,e),this.__v&&(t&&this.__k.push(t),S(this)))},y.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),S(this))},y.prototype.render=v,n=[],i=0,a=function(e,t){return e.__v.__b-t.__v.__b},o=Symbol(),s=/(PointerCapture)$|Capture$/i,c=0,l={};var M,N,P,ce,le=Object.is,ue=0,de=[],fe=[],F=e,pe=F.__b,me=F.__r,he=F.diffed,I=F.__c,ge=F.unmount,L=F.__;function _e(e,t){F.__h&&F.__h(N,e,ue||t),ue=0;var n=N.__H||(N.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return ue=1,ve(ke,e)}function ve(e,t,n){var r=_e(M++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ke(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);le(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.__f)){N.__f=!0;var i=N.shouldComponentUpdate;N.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,le(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function ye(e,t){var n=_e(M++,3);!F.__s&&Oe(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,N.__H.__h.push(n))}function z(e){return ue=5,be(function(){return{current:e}},[])}function be(e,t){var n=_e(M++,7);return Oe(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function xe(e,t){return ue=8,be(function(){return e},t)}function Se(){var e;do{for(;e=fe.shift();)try{Ee(e)}catch(t){F.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=de.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ee),t.__h.some(De),t.__h=[]}catch(n){t.__h=[],F.__e(n,e.__v)}}}while(fe.length)}F.__b=function(e){N=null,pe&&pe(e)},F.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),L&&L(e,t)},F.__r=function(e){me&&me(e),M=0;var t=(N=e.__c).__H;t&&(P==N?N.__h=[]:(t.__h.some(Ee),t.__h.some(De),M=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),P=N},F.diffed=function(e){he&&he(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Te(de.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),P=N=null},F.__c=function(e,t){t.some(function(e){try{e.__h.some(Ee),e.__h=e.__h.filter(function(e){return!e.__||De(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],F.__e(n,e.__v)}}),I&&I(e,t)},F.unmount=function(e){ge&&ge(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Te(fe.push(r))}else Ee(r)}catch(e){t=e}}),r.__H=void 0,t&&F.__e(t,r.__v))};var Ce=typeof requestAnimationFrame==`function`;function we(e){var t,n=function(){clearTimeout(r),Ce&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ce&&(t=requestAnimationFrame(n))}function Te(e){e!=1&&ce==F.requestAnimationFrame||((ce=F.requestAnimationFrame)||we)(Se)}function Ee(e){var t=N,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),N=t}function De(e){var t=N;e.__c=e.__(),N=t}function Oe(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!le(t,e[n])})}function ke(e,t){return typeof t==`function`?t(e):t}var Ae=class extends Error{status;constructor(e,t){super(t),this.status=e}},B=encodeURIComponent,je={"Content-Type":`application/json`};async function Me(e,t){let n=await fetch(e,t);if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new Ae(n.status,e)}return n.status===204?void 0:await n.json()}var Ne=(e,t)=>({method:e,headers:je,body:JSON.stringify(t)}),Pe={projects:()=>Me(`/api/projects`),addProject:e=>Me(`/api/projects`,Ne(`POST`,{path:e})),removeProject:e=>Me(`/api/projects/${B(e)}`,{method:`DELETE`}),setPrefs:(e,t)=>Me(`/api/projects/${B(e)}/prefs`,Ne(`PUT`,t)),board:(e,t)=>Me(`/api/projects/${B(e)}/boards/${B(t)}`),story:(e,t,n)=>Me(`/api/projects/${B(e)}/boards/${B(t)}/stories/${B(n)}`),state:()=>Me(`/api/state`),setLastViewed:e=>Me(`/api/state`,Ne(`PUT`,{lastViewed:e}))},Fe=[`backlog`,`ready`,`in-progress`,`review`,`done`,`dropped`],Ie={backlog:`Backlog`,ready:`Ready`,"in-progress":`In progress`,review:`Review`,done:`Done`,dropped:`Dropped`},Le=()=>({backlog:[],ready:[],"in-progress":[],review:[],done:[],dropped:[]});function Re(e,t,n){let r=Le();for(let i of e)i.column===`dropped`&&!t||n!==null&&i.epicId!==n||r[i.column].push(i);return r}function ze(e,t){let n=new Set(e.epics.map(e=>e.id)),r=(e,n)=>({epic:e,done:n.filter(e=>e.column===`done`).length,total:n.filter(e=>e.column!==`dropped`).length,cells:Re(n,t,null)}),i=e.epics.map(t=>r(t,e.stories.filter(e=>e.epicId===t.id))),a=e.stories.filter(e=>e.epicId===null||!n.has(e.epicId));return a.filter(e=>t||e.column!==`dropped`).length>0&&i.push(r(null,a)),i}var Be=[`#3b82f6`,`#a855f7`,`#f59e0b`,`#10b981`,`#ef4444`,`#06b6d4`,`#ec4899`,`#84cc16`];function Ve(e){let t=Be.length;return Be[(e%t+t)%t]}function He(e){let t=e.title.trim();return t===e.key?t:`${e.id} ${t}`}var Ue=0;Array.isArray;function V(t,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l&&typeof t!=`function`)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ue,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),e.vnode&&e.vnode(u),u}function We({info:e}){let{epic:t,index:n}=e,r=t.retrospective===`done`;return V(`span`,{class:`chip`,style:{background:Ve(n)},title:`Epic ${t.id}: ${t.title}${r?` (retrospective done)`:``}`,children:[t.id,r&&V(`span`,{class:`retro`,"aria-label":`retrospective done`,children:`✓`})]})}function Ge(){return V(`svg`,{class:`card-file`,viewBox:`0 0 16 16`,width:`13`,height:`13`,role:`img`,"aria-label":`has story file`,children:[V(`title`,{children:`Has a story file`}),V(`path`,{d:`M4 1.5h5L12.5 5v9.5h-8.5z M9 1.5V5h3.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.3`,"stroke-linejoin":`round`})]})}function Ke({story:e}){let[t,n]=R(`idle`),r=z(void 0);ye(()=>()=>clearTimeout(r.current),[]);let i=async()=>{try{await navigator.clipboard.writeText(He(e)),n(`copied`)}catch{n(`failed`)}clearTimeout(r.current),r.current=setTimeout(()=>n(`idle`),1500)},a=t===`copied`?`Copied`:t===`failed`?`Copy failed`:`Copy`;return V(`button`,{type:`button`,class:`card-copy${t===`idle`?``:` ${t}`}`,onClick:i,"aria-label":`Copy title`,title:`Copy "${He(e)}"`,children:V(`span`,{"aria-live":`polite`,children:a})})}function qe(e){let{story:t,epic:n}=e,r=`card${t.column===`dropped`?` dropped`:``}${t.noFile?` no-file`:``}`,i=V(v,{children:[V(`span`,{class:`card-top`,children:[e.showEpic&&n&&V(We,{info:n}),V(`span`,{class:`card-id`,children:t.id}),!t.noFile&&V(Ge,{}),t.blocked&&V(`span`,{class:`badge blocked`,children:`blocked`}),(t.type===`spike`||t.type===`bug`)&&V(`span`,{class:`badge type-${t.type}`,children:t.type})]}),V(`span`,{class:`card-title`,children:t.title}),t.unknownStatus!==void 0&&V(`span`,{class:`badge unknown`,children:[`unknown status: `,t.unknownStatus]})]});return V(`div`,{class:`card-wrap`,children:[t.noFile?V(`div`,{class:r,children:i}):V(`button`,{type:`button`,class:r,onClick:()=>e.onOpen(t),children:i}),V(Ke,{story:t})]})}function Je(e,t){this.v=e,this.k=t}function Ye(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xe(e){if(Array.isArray(e))return e}function Ze(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Qe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $e(e,t){return Xe(e)||Ze(e,t)||et(e,t)||Qe()}function et(e,t){if(e){if(typeof e==`string`)return Ye(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ye(e,t):void 0}}function tt(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Je;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}tt.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},tt.prototype.next=function(e){return this._invoke(`next`,e)},tt.prototype.throw=function(e){return this._invoke(`throw`,e)},tt.prototype.return=function(e){return this._invoke(`return`,e)};var nt=Object.entries,rt=Object.setPrototypeOf,it=Object.isFrozen,at=Object.getPrototypeOf,H=Object.getOwnPropertyDescriptor,U=Object.freeze,W=Object.seal,ot=Object.create,st=typeof Reflect<`u`&&Reflect,ct=st.apply,lt=st.construct;U||=function(e){return e},W||=function(e){return e},ct||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},lt||=function(e){return new e(...[...arguments].slice(1))};var ut=q(Array.prototype.forEach);Array.prototype.indexOf;var dt=q(Array.prototype.lastIndexOf),ft=q(Array.prototype.pop),pt=q(Array.prototype.push),mt=q(Array.prototype.slice),ht=q(Array.prototype.splice),gt=Array.isArray,_t=Mt(Set),vt=q(Set.prototype.add),yt=q(Set.prototype.has),bt=q(String.prototype.toLowerCase),xt=q(String.prototype.toString),St=q(String.prototype.match),Ct=q(String.prototype.replace),wt=q(String.prototype.indexOf),Tt=q(String.prototype.trim),Et=q(Number.prototype.toString),Dt=q(Boolean.prototype.toString),Ot=typeof BigInt>`u`?null:q(BigInt.prototype.toString),kt=typeof Symbol>`u`?null:q(Symbol.prototype.toString),G=q(Object.prototype.hasOwnProperty),At=q(Object.prototype.toString),K=q(RegExp.prototype.test),jt=Mt(TypeError);function q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ct(e,t,n)}}function Mt(e){return function(){return lt(e,[...arguments])}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bt;if(rt&&rt(e,null),!gt(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(it(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Nt(e){for(let t=0;t<e.length;t++)G(e,t)||(e[t]=null);return e}function Y(e){let t=ot(null);for(let r of nt(e)){var n=$e(r,2);let i=n[0],a=n[1];G(e,i)&&(t[i]=gt(a)?Nt(a):a&&typeof a==`object`&&a.constructor===Object?Y(a):a)}return t}function Pt(e){switch(typeof e){case`string`:return e;case`number`:return Et(e);case`boolean`:return Dt(e);case`bigint`:return Ot?Ot(e):`0`;case`symbol`:return kt?kt(e):`Symbol()`;case`undefined`:return At(e);case`function`:case`object`:{if(e===null)return At(e);let t=e,n=Ft(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:At(e)}return At(e)}default:return At(e)}}function Ft(e,t){for(;e!==null;){let n=H(e,t);if(n){if(n.get)return q(n.get);if(typeof n.value==`function`)return q(n.value)}e=at(e)}function n(){return null}return n}function It(e,t){for(;e!==null;){let n=H(e,t);if(n)return n.get?q(n.get):null;e=at(e)}return null}function Lt(e){try{return K(e,``),!0}catch{return!1}}var Rt=U(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),zt=U(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Bt=U([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Vt=U([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ht=U(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ut=U([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Wt=U([`#text`]),Gt=U(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Kt=U(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),qt=U(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Jt=U([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Yt=W(/{{[\w\W]*|^[\w\W]*}}/g),Xt=W(/<%[\w\W]*|^[\w\W]*%>/g),Zt=W(/\${[\w\W]*/g),Qt=W(/^data-[\-\w.\u00B7-\uFFFF]+$/),$t=W(/^aria-[\-\w]+$/),en=W(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tn=W(/^(?:\w+script|data):/i),nn=W(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rn=W(/^html$/i),an=W(/^[a-z][.\w]*(-[.\w]+)+$/i),on=W(/<[/\w!]/g),sn=W(/<[/\w]/g),cn=W(/<\/no(script|embed|frames)/i),ln=W(/\/>/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},un=U(J({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),dn=function(){return typeof window>`u`?null:window},fn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},pn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},mn=function(e,t,n,r){return G(e,t)&&gt(e[t])?J(r.base?Y(r.base):{},e[t],r.transform):n},hn=function(e,t,n){let r=G(e,t)?e[t]:void 0;return r&&typeof r==`object`?Y(r):n()};function gn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dn(),t=e=>gn(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==X.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Ft(d,`cloneNode`),p=Ft(d,`remove`),m=Ft(d,`removeAttributeNode`),h=Ft(d,`nextSibling`),g=Ft(d,`childNodes`),_=Ft(d,`parentNode`),v=Ft(d,`shadowRoot`),y=Ft(d,`attributes`),b=o&&o.prototype?Ft(o.prototype,`nodeType`):null,x=o&&o.prototype?Ft(o.prototype,`nodeName`):null,S=o&&o.prototype?Ft(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},ee=function(e){return x?x(e):e.nodeName},w=It(d,`namespaceURI`),T=function(e){return w?w(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let E,D=``,O,k=!1,A=0,te=function(){if(A>0)throw jt(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ne=function(e){te(),A++;try{return E.createHTML(e)}finally{A--}},re=function(e){te(),A++;try{return E.createScriptURL(e)}finally{A--}},ie=function(){return k||=(O=fn(u,i),!0),O},j=n,ae=j.implementation,oe=j.createNodeIterator,se=j.createDocumentFragment,M=j.getElementsByTagName,N=r.importNode,P=pn();t.isSupported=typeof nt==`function`&&typeof _==`function`&&ae&&ae.createHTMLDocument!==void 0;let ce=Yt,le=Xt,ue=Zt,de=Qt,fe=$t,F=tn,pe=nn,me=an,he=en,I=null,ge=J({},[...Rt,...zt,...Bt,...Ht,...Wt]),L=null,_e=J({},[...Gt,...Kt,...qt,...Jt]),R=Object.seal(ot(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,ye=null,z=Object.seal(ot(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),be=!0,xe=!0,Se=!1,Ce=!0,we=!1,Te=!0,Ee=!1,De=!1,Oe=null,ke=null,Ae=!1,B=!1,je=!1,Me=!1,Ne=!0,Pe=!1,Fe=`user-content-`,Ie=!0,Le=!1,Re=null,ze={},Be=null,Ve=J({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),He=null,Ue=J({},[`audio`,`video`,`img`,`source`,`image`,`track`]),V=null,We=J({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ge=`http://www.w3.org/1998/Math/MathML`,Ke=`http://www.w3.org/2000/svg`,qe=`http://www.w3.org/1999/xhtml`,Je=qe,Ye=!1,Xe=null,Ze=J({},[Ge,Ke,qe],xt),Qe=U([`mi`,`mo`,`mn`,`ms`,`mtext`]),$e=J({},Qe),et=U([`annotation-xml`]),tt=J({},et),rt=J({},[`title`,`style`,`font`,`a`,`script`]),it=null,at=[`application/xhtml+xml`,`text/html`],H=null,st=null,ct=n.createElement(`form`),lt=function(e){return e instanceof RegExp||e instanceof Function},Et=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(st&&st===e)return;e&&typeof e==`object`||(e={}),e=Y(e),it=at.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,H=it===`application/xhtml+xml`?xt:bt,I=mn(e,`ALLOWED_TAGS`,ge,{transform:H}),L=mn(e,`ALLOWED_ATTR`,_e,{transform:H}),Xe=mn(e,`ALLOWED_NAMESPACES`,Ze,{transform:xt}),V=mn(e,`ADD_URI_SAFE_ATTR`,We,{transform:H,base:We}),He=mn(e,`ADD_DATA_URI_TAGS`,Ue,{transform:H,base:Ue}),Be=mn(e,`FORBID_CONTENTS`,Ve,{transform:H}),ve=mn(e,`FORBID_TAGS`,Y({}),{transform:H}),ye=mn(e,`FORBID_ATTR`,Y({}),{transform:H}),ze=G(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Y(e.USE_PROFILES):e.USE_PROFILES:!1,be=e.ALLOW_ARIA_ATTR!==!1,xe=e.ALLOW_DATA_ATTR!==!1,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=e.SAFE_FOR_TEMPLATES||!1,Te=e.SAFE_FOR_XML!==!1,Ee=e.WHOLE_DOCUMENT||!1,B=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Ne=e.SANITIZE_DOM!==!1,Pe=e.SANITIZE_NAMED_PROPS||!1,Ie=e.KEEP_CONTENT!==!1,Le=e.IN_PLACE||!1,he=Lt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:en,Je=typeof e.NAMESPACE==`string`?e.NAMESPACE:qe,$e=hn(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>J({},Qe)),tt=hn(e,`HTML_INTEGRATION_POINTS`,()=>J({},et));let t=hn(e,`CUSTOM_ELEMENT_HANDLING`,()=>ot(null));if(R=ot(null),G(t,`tagNameCheck`)&&lt(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),G(t,`attributeNameCheck`)&&lt(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),G(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),W(R),we&&(xe=!1),je&&(B=!0),ze&&(I=J({},Wt),L=ot(null),ze.html===!0&&(J(I,Rt),J(L,Gt)),ze.svg===!0&&(J(I,zt),J(L,Kt),J(L,Jt)),ze.svgFilters===!0&&(J(I,Bt),J(L,Kt),J(L,Jt)),ze.mathMl===!0&&(J(I,Ht),J(L,qt),J(L,Jt))),z.tagCheck=null,z.attributeCheck=null,G(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?z.tagCheck=e.ADD_TAGS:gt(e.ADD_TAGS)&&(I===ge&&(I=Y(I)),J(I,e.ADD_TAGS,H))),G(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?z.attributeCheck=e.ADD_ATTR:gt(e.ADD_ATTR)&&(L===_e&&(L=Y(L)),J(L,e.ADD_ATTR,H))),G(e,`ADD_FORBID_CONTENTS`)&&gt(e.ADD_FORBID_CONTENTS)&&(Be===Ve&&(Be=Y(Be)),J(Be,e.ADD_FORBID_CONTENTS,H)),Ie&&(I[`#text`]=!0),Ee&&J(I,[`html`,`head`,`body`]),I.table&&(J(I,[`tbody`]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw jt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw jt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=E;E=e.TRUSTED_TYPES_POLICY;try{D=ne(``)}catch(e){throw E=t,e}}else e.TRUSTED_TYPES_POLICY===null?(E=void 0,D=``):(E===void 0&&(E=ie()),E&&typeof D==`string`&&(D=ne(``)));U&&U(e),st=e},Dt=J({},[...zt,...Bt,...Vt]),Ot=J({},[...Ht,...Ut]),kt=function(e,t,n){return t.namespaceURI===qe?e===`svg`:t.namespaceURI===Ge?e===`svg`&&(n===`annotation-xml`||$e[n]):!!Dt[e]},At=function(e,t,n){return t.namespaceURI===qe?e===`math`:t.namespaceURI===Ke?e===`math`&&tt[n]:!!Ot[e]},q=function(e,t,n){return t.namespaceURI===Ke&&!tt[n]||t.namespaceURI===Ge&&!$e[n]?!1:!Ot[e]&&(rt[e]||!Dt[e])},Mt=function(e){let t=T(e),n=bt(ee(e)),r=_(e),i,a;return r&&C(r)===X.element?(i={namespaceURI:T(r)},a=bt(ee(r))):(i={namespaceURI:Je},a=`template`),Xe[t]?t===Ke?kt(n,i,a):t===Ge?At(n,i,a):t===qe?q(n,i,a):!!(it===`application/xhtml+xml`&&Xe[t]):!1},Nt=function(e){pt(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw jt(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_n=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},vn=function(e){Sn(e);let t=g(e);t&&ut(mt(t),e=>{try{p(e)}catch{}});let n=C(e)===X.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&_n(e,r,i)}},yn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}pt(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(B||je)try{Nt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},bn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||L[H(i)]||_n(e,r,i)}},xn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===X.element){let t=v(e);Fn(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Sn=function(e){xn(e,e=>{C(e)===X.element&&bn(e)})},Z=function(e){let t=[];return xn(e,e=>{t.push(e)},!0),t},Cn=function(e,t){let n=_t();ut(Z(e),e=>{C(e)===X.element&&vt(n,e)}),ut(t,e=>{C(e)===X.element&&!yt(n,e)&&bn(e)})},Q=function(e,n){let r=!1;return ut(t.removed,t=>{t.element&&(r||=t.element===e,Sn(t.element))}),Cn(e,n),r},wn=function(e,t){let n=Re,r=null,i=()=>(r||(r=_t(),ut(t,e=>{vt(r,e)})),r);for(let t=0;;t++){let r=Z(e),a=[e],o=!1;if(ut(r,e=>{C(e)===X.documentFragment?pt(a,e):!o&&!yt(n,e)&&(o=yt(i(),e))}),!o)return;if(t>=8)throw jt(`the tree kept changing during in-place sanitization; refusing to return it`);ut(a,(t,n)=>{Tn(t,n>0,e,i())})}},Tn=function(e,t,n,r){let i=An(e),a;for(;a=i.nextNode();)yt(r,a)&&!yt(Re,a)&&(t&&Ln(P.uponSanitizeShadowNode,a,null),Un(a,n),Xn(a,n),Fn(a.content)&&Zn(a.content))},En=function(e){Re&&vt(Re,e)},Dn=function(e,t){return Te?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},On=function(e){Te&&xn(e,e=>{let t=C(e);if(t===X.processingInstruction||t===X.comment&&K(sn,e.data)){try{p(e)}catch{}return!1}if(t===X.element){let t=e,n=H(ee(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Dn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},kn=function(e){let t=null,r=null;if(Ae)e=`<remove></remove>`+e;else{let t=St(e,/^[\r\n\t ]+/);r=t&&t[0]}it===`application/xhtml+xml`&&Je===qe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=E?ne(e):e;if(Je===qe)try{t=new l().parseFromString(i,it)}catch{}if(!t||!t.documentElement){t=ae.createDocument(Je,`template`,null);try{t.documentElement.innerHTML=Ye?D:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Je===qe?M.call(t,Ee?`html`:`body`)[0]:Ee?t.documentElement:a},An=function(e){let t=S?S(e):e.ownerDocument;return oe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},jn=function(e){return e=Ct(e,ce,` `),e=Ct(e,le,` `),e=Ct(e,ue,` `),e},Mn=function(e){Nn(e);let t=e.querySelectorAll?.call(e,`template`);t&&ut(t,e=>{Fn(e.content)&&Mn(e.content)})},Nn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=oe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=jn(r.data),r=n.nextNode()},Pn=function(e){let t=x?x(e):null;return typeof t!=`string`||H(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Fn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===X.documentFragment}catch{return!1}},In=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Ln(e,n,r){e.length!==0&&ut(e,e=>{e.call(t,n,r,st)})}let Rn=function(e,t){return!!(Te&&e.hasChildNodes()&&!In(e.firstElementChild)&&K(on,e.textContent)&&K(on,e.innerHTML)||Te&&un[t]&&C(e)===X.element&&T(e)===qe&&(In(e.firstElementChild)||typeof e.textContent==`string`&&K(on,e.textContent))||e.nodeType===X.processingInstruction||Te&&e.nodeType===X.comment&&K(sn,e.data))},zn=function(e,t){return e instanceof RegExp?K(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Bn=function(e,t,n){if(!ve[t]&&Kn(t)&&zn(R.tagNameCheck,t))return!1;if(Ie&&!Be[t]&&!Be[bt(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Nt(e),!0},Vn=function(e,t,n,r){return e.length===0?t:t===n||t===r?Y(t):t},Hn=function(e,t){return e===t||_(e)!==null?!1:(Le&&Sn(e),!0)},Un=function(e,n){if(En(e),Ln(P.beforeSanitizeElements,e,null),Hn(e,n))return!0;if(Pn(e))return Nt(e),!0;let r=H(ee(e));if(I=Vn(P.uponSanitizeElement,I,ge,Oe),Ln(P.uponSanitizeElement,e,{tagName:r,allowedTags:I}),Hn(e,n))return!0;if(Rn(e,r))return Nt(e),!0;if(ve[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!I[r]){let t=Bn(e,r,n);return t===!1&&(Ln(P.afterSanitizeElements,e,null),Hn(e,n))?!0:t}if(C(e)===X.element&&!Mt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&K(cn,e.innerHTML))return Nt(e),!0;if(we&&e.nodeType===X.text){let n=jn(e.textContent);e.textContent!==n&&(pt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ln(P.afterSanitizeElements,e,null),Hn(e,n)},Wn=function(e,t,r){if(ye[t]||Dn(t,e)||Ne&&(t===`id`||t===`name`)&&(r in n||r in ct))return!1;let i=L[t]||z.attributeCheck instanceof Function&&z.attributeCheck(t,e);return xe&&K(de,t)||be&&K(fe,t)?!0:i?V[t]||K(he,Ct(r,pe,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&wt(r,`data:`)===0&&He[e]||Se&&!K(F,Ct(r,pe,``))?!0:!r:Kn(e)&&zn(R.tagNameCheck,e)&&zn(R.attributeNameCheck,t,e)||t===`is`&&R.allowCustomizedBuiltInElements&&zn(R.tagNameCheck,r)},Gn=J({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Kn=function(e){return!Gn[bt(e)]&&K(me,e)},qn=function(e,t,n,r){if(E&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ne(r);case`TrustedScriptURL`:return re(r)}return r},Jn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Pn(e)||(Nt(e),!1)}catch{return yn(t,e),!1}},Yn=function(e,t){return Te&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:bt(e)===`attributename`&&St(t,`href`)!==null},Xn=function(e,n){if(Ln(P.beforeSanitizeAttributes,e,null),Hn(e,n))return;let r=e.attributes;if(!r||Pn(e))return;L=Vn(P.uponSanitizeAttribute,L,_e,ke);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},a=r.length,o=H(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=H(s),d=l,f=s===`value`?d:Tt(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Ln(P.uponSanitizeAttribute,e,i),f=i.attrValue,Pe&&(u===`id`||u===`name`)&&wt(f,Fe)!==0&&(yn(s,e,n),f=Fe+f,p=!0),Yn(s,f)?yn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Ce&&K(ln,f)?yn(s,e,n):(we&&(f=jn(f)),Wn(o,u,f)?(f=qn(o,u,c,f),f!==d&&Jn(e,s,c,f)&&p&&ft(t.removed)):yn(s,e,n)):yn(s,e,n))}Ln(P.afterSanitizeAttributes,e,null),Hn(e,n)},Zn=function(e){let t=null,n=An(e);for(Ln(P.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ln(P.uponSanitizeShadowNode,t,null),Un(t,e),Xn(t,e),Fn(t.content)&&Zn(t.content),C(t)===X.element){let e=v(t);Fn(e)&&(Qn(e),Zn(e))}we&&Nn(e),Ln(P.afterSanitizeShadowDOM,e,null)},Qn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Zn(e.shadow);continue}let n=e.node,r=C(n)===X.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&H(e)===`template`){let e=n.content;Fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Fn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ye=!e,Ye&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=Pt(e),typeof e!=`string`))throw jt(`dirty is not a string, aborting`);if(!t.isSupported)return e;De?(I=Oe,L=ke):Et(n),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(I=Y(I)),P.uponSanitizeAttribute.length>0&&(L=Y(L)),t.removed=[];let c=Le&&typeof e!=`string`&&In(e),l=[],u=Re;if(c){On(e);let t=ee(e);if(typeof t==`string`){let n=H(t);if(!I[n]||ve[n])throw vn(e),jt(`root node is forbidden and cannot be sanitized in-place`)}if(Pn(e))throw vn(e),jt(`root node is clobbered and cannot be sanitized in-place`);l=Z(e),Re=_t()}else if(In(e))i=kn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===X.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Qn(i);else{if(!B&&!we&&!Ee&&e.indexOf(`<`)===-1)return E&&Me?ne(e):e;if(i=kn(e),!i)return B?null:Me?D:``}i&&Ae&&Nt(i.firstChild);let d=c?e:i;try{c&&Qn(e);let t=An(d);for(;o=t.nextNode();)Un(o,d),Xn(o,d),Fn(o.content)&&Zn(o.content);c&&wn(e,l)}catch(t){throw c&&(vn(e),Q(e,l)),t}finally{Re=u}if(c){if(Q(e,l))throw jt(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return we&&Mn(e),e}if(B){if(we&&Mn(i),je)for(s=se.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=N.call(r,s,!0)),s}let f=Ee?i.outerHTML:i.innerHTML;return Ee&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&K(rn,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
+ `+f),we&&(f=jn(f)),E&&Me?ne(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Et(e),De=!0,Oe=I,ke=L},t.clearConfig=function(){st=null,De=!1,Oe=null,ke=null,E=O,D=``},t.isValidAttribute=function(e,t,n){st||Et({});let r=H(e),i=H(t);return typeof n==`string`&&(Yn(t,n)||!Ce&&K(ln,n))?!1:Wn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&G(P,e)&&pt(P[e],t)},t.removeHook=function(e,t){if(G(P,e)){if(t!==void 0){let n=dt(P[e],t);return n===-1?void 0:ht(P[e],n,1)[0]}return ft(P[e])}},t.removeHooks=function(e){G(P,e)&&(P[e]=[])},t.removeAllHooks=function(){P=pn()},t}var _n=gn();function vn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yn=vn();function bn(e){yn=e}var xn={exec:()=>null};function Sn(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Z(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Q.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Cn=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Q={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}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/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:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Sn(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Sn(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Sn(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Sn(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Sn(e=>RegExp(`^ {0,${e}}(?:</?(?:${Rn})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:Sn(e=>RegExp(`^ {0,${e}}>`))},wn=/^(?:[ \t]*(?:\n|$))+/,Tn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,En=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,On=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,An=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jn=Z(An).replace(/bull/g,kn).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(),Mn=Z(An).replace(/bull/g,kn).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(),Nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Pn=/^[^\n]+/,Fn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,In=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Fn).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ln=Z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,kn).getRegex(),Rn=`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`,zn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bn=Z(`^ {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-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,zn).replace(`tag`,Rn).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vn=e=>Z(Nn).replace(`hr`,Dn).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`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Rn).getRegex(),Hn=Vn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Un=Vn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Wn={blockquote:Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Un).getRegex(),code:Tn,def:In,fences:En,heading:On,hr:Dn,html:Bn,lheading:jn,list:Ln,newline:wn,paragraph:Hn,table:xn,text:Pn},Gn=Z(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Dn).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`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Rn).getRegex(),Kn={...Wn,lheading:Mn,table:Gn,paragraph:Z(Nn).replace(`hr`,Dn).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Gn).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Rn).getRegex()},qn={...Wn,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,zn).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:xn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(Nn).replace(`hr`,Dn).replace(`heading`,` *#{1,6} *[^
4
+ ]`).replace(`lheading`,jn).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Jn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Yn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Zn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qn=/[\p{P}\p{S}]/u,$n=/[\s\p{P}\p{S}]/u,er=/[^\s\p{P}\p{S}]/u,tr=Z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,$n).getRegex(),nr=/[\p{Pi}\p{Ps}"']/u,rr=/(?!~)[\p{P}\p{S}]/u,ir=/(?!~)[\s\p{P}\p{S}]/u,ar=/(?:[^\s\p{P}\p{S}]|~)/u,or=Z(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Cn?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),sr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,cr=Z(sr,`u`).replace(/punct/g,Qn).getRegex(),lr=Z(sr,`u`).replace(/punct/g,rr).getRegex(),ur=Z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,nr).replace(/punct/g,Qn).getRegex(),dr=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,fr=Z(dr,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,Qn).getRegex(),pr=Z(dr,`gu`).replace(/notPunctSpace/g,ar).replace(/punctSpace/g,ir).replace(/punct/g,rr).getRegex(),mr=Z(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,Qn).getRegex(),hr=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,Qn).getRegex(),gr=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,Qn).getRegex(),_r=Z(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Qn).getRegex(),vr=Z(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,Qn).getRegex(),yr=Z(/\\(punct)/,`gu`).replace(/punct/g,Qn).getRegex(),br=Z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,Qn).getRegex(),xr=Z(/^<(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(),Sr=Z(zn).replace(`(?:-->|$)`,`-->`).getRegex(),Cr=Z(`^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`,Sr).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wr=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Tr=Z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,wr).getRegex(),Er=Z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Tr).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Dr=Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Tr).replace(`ref`,Fn).getRegex(),Or=Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Fn).getRegex(),kr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Ar=Z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,wr).getRegex(),jr=Z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ar).replace(`ref`,kr).getRegex()).replace(`nolink`,Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,kr).getRegex()).getRegex(),Mr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Nr=Z(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Pr={_backpedal:xn,anyPunctuation:yr,anyPunctuationOutsideCode:br,autolink:xr,blockSkip:or,br:Xn,code:Yn,del:xn,delLDelim:xn,delRDelim:xn,emStrongLDelim:cr,emStrongRDelimAst:fr,emStrongRDelimUnd:hr,escape:Jn,link:Er,nolink:Or,punctuation:tr,reflink:Dr,reflinkSearch:jr,tag:Cr,text:Zn,url:xn},Fr={...Pr,emStrongLDelim:ur,emStrongRDelimAst:mr,emStrongRDelimUnd:gr,link:Z(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Tr).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Tr).getRegex()},Ir={...Pr,emStrongRDelimAst:pr,emStrongLDelim:lr,delLDelim:_r,delRDelim:vr,url:Z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Nr).replace(`protocol`,Mr).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:Z(/^(?:[^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`,Mr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Lr={...Ir,br:Z(Xn).replace(`{2,}`,`*`).getRegex(),text:Z(Ir.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Rr={normal:Wn,gfm:Kn,pedantic:qn},zr={normal:Pr,gfm:Ir,breaks:Lr,pedantic:Fr},Br={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Vr=e=>Br[e];function Hr(e,t){if(t){if(Q.escapeTest.test(e))return e.replace(Q.escapeReplace,Vr)}else if(Q.escapeTestNoEncode.test(e))return e.replace(Q.escapeReplaceNoEncode,Vr);return e}function Ur(e){return Q.numericCharacterReference.test(e)?e.replace(Q.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function Wr(e){try{e=encodeURI(e).replace(Q.percentDecode,`%`)}catch{return null}return e}function Gr(e,t){let n=e.replace(Q.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Q.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Q.slashPipe,`|`);return n}function Kr(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function qr(e){let t=e.split(`
5
+ `),n=t.length-1;for(;n>=0&&Q.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
6
+ `)}function Jr(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Yr(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Xr(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Zr(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Qr(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
7
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
8
+ `)}function $r(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var ei=class{options;rules;lexer;constructor(e){this.options=e||yn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:qr(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Qr(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Kr(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Kr(t[0],`
9
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Kr(t[0],`
10
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Kr(t[0],`
11
+ `).split(`
12
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
13
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
14
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
15
+ ${s}`:s,r=r?`${r}
16
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
17
+ `),o=t.raw+`
18
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
19
+ `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
20
+ ${d.join(`
21
+ `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
22
+ `+e.join(`
23
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
24
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
25
+ `,1)[0],d=t[1].length,f=this.options.pedantic?Xr(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Xr(e,d)),p=e.split(`
26
+ `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
27
+ `,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>Xr(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
28
+ `+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
29
+ `+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=qr(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Yr(t[2],`()`)!==-1)return;let e=Jr(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Kr(t[0],`
30
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Gr(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
31
+ `):[],a={type:`table`,raw:Kr(t[0],`
32
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Gr(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Kr(t[0],`
33
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
34
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&$r(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Kr(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Yr(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Zr(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&$r(e,n[1],r,this.rules))return;let i=t[Jr((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Zr(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Ur(t[0]),escaped:e}}}},ti=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yn,this.options.tokenizer=this.options.tokenizer||new ei,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 t={other:Q,block:Rr.normal,inline:zr.normal};this.options.pedantic?(t.block=Rr.pedantic,t.inline=zr.pedantic):this.options.gfm&&(t.block=Rr.gfm,t.inline=this.options.breaks?zr.breaks:zr.gfm),this.tokenizer.rules=t}static get rules(){return{block:Rr,inline:zr}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Q.carriageReturn,`
35
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Q.tabCharGlobal,` `).replace(Q.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(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
36
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
37
+ `)?``:`
38
+ `)+i.raw,n.text+=`
39
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
40
+ `)?``:`
41
+ `)+i.raw,n.text+=`
42
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
43
+ `)?``:`
44
+ `)+i.raw,r.text+=`
45
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
46
+ `)?``:`
47
+ `)+i.raw,n.text+=`
48
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Jr(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Jr(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ni=class{options;parser;constructor(e){this.options=e||yn}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Q.notSpaceStart)?.[0],i=e?e.replace(Q.endingNewline,``)+`
49
+ `:``;return r?`<pre><code class="language-`+Hr(r)+`">`+(n?i:Hr(i,!0))+`</code></pre>
50
+ `:`<pre><code>`+(n?i:Hr(i,!0))+`</code></pre>
51
+ `}blockquote({tokens:e}){return`<blockquote>
52
+ ${this.parser.parse(e)}</blockquote>
53
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
54
+ `}hr(e){return`<hr>
55
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
56
+ `+r+`</`+i+`>
57
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
58
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
59
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
60
+ <thead>
61
+ `+t+`</thead>
62
+ `+r+`</table>
63
+ `}tablerow({text:e}){return`<tr>
64
+ ${e}</tr>
65
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
66
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Hr(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Hr(n,!0):this.parser.parseInline(r),o=Wr(e);if(o===null)return a;e=Hr(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Hr(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Wr(e);if(i===null)return Hr(n);e=i;let a=`<img src="${Hr(e)}" alt="${Hr(n)}"`;return t&&(a+=` title="${Hr(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Hr(e.text)}},ri=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ii=class e{options;renderer;textRenderer;constructor(e){this.options=e||yn,this.options.renderer=this.options.renderer||new ni,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ri}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ai=class{options;block;constructor(e){this.options=e||yn}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ti.lex:ti.lexInline}provideParser(e=this.block){return e?ii.parse:ii.parseInline}};function oi(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var si=new class{defaults=vn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ii;Renderer=ni;TextRenderer=ri;Lexer=ti;Tokenizer=ei;Hooks=ai;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(oi(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)oi(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)oi(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;oi(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);oi(n,this.walkTokens(i,t))}):e.tokens&&oi(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ni(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ei(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ai;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ai.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ai.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&oi(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ti.lex(e,t??this.defaults)}parser(e,t){return ii.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?ti.lex:ti.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ii.parse:ii.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ti.lex:ti.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ii.parse:ii.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
67
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Hr(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return si.parse(e,t)}$.options=$.setOptions=function(e){return si.setOptions(e),$.defaults=si.defaults,bn($.defaults),$},$.getDefaults=vn,$.defaults=yn;function ci(...e){return si.use(...e),$.defaults=si.defaults,bn($.defaults),$}$.use=ci,$.walkTokens=function(e,t){return si.walkTokens(e,t)},$.parseInline=si.parseInline,$.Parser=ii,$.parser=ii.parse,$.Renderer=ni,$.TextRenderer=ri,$.Lexer=ti,$.lexer=ti.lex,$.Tokenizer=ei,$.Hooks=ai,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,ii.parse,ti.lex;function li(e){let t=/^\uFEFF?---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(e);return t?{frontmatter:t[1],body:e.slice(t[0].length)}:{frontmatter:null,body:e}}function ui(e){let{projectId:t,sourceId:n,story:r,onClose:i}=e,[a,o]=R(null),[s,c]=R(null),[l,u]=R(!1),d=z(null),f=z(null);ye(()=>{let e=!0;return o(null),c(null),Pe.story(t,n,r.key).then(t=>e&&o(t),t=>e&&c(t instanceof Error?t.message:String(t))),()=>{e=!1}},[t,n,r.key]),ye(()=>{let e=document.activeElement;f.current?.focus();let t=e=>{if(e.key===`Escape`)e.preventDefault(),i();else if(e.key===`Tab`&&d.current){let t=[...d.current.querySelectorAll(`button, a[href], [tabindex]:not([tabindex="-1"])`)];if(t.length===0)return;let n=t[0],r=t[t.length-1];d.current.contains(document.activeElement)?e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()):(e.preventDefault(),n.focus())}};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t),e?.focus()}},[i]);let p=async()=>{if(a?.path)try{await navigator.clipboard.writeText(a.path),u(!0),setTimeout(()=>u(!1),1500)}catch{u(!1)}},m=a?li(a.markdown):null,h=m?_n.sanitize($.parse(m.body,{async:!1})):``;return V(`div`,{class:`backdrop`,onClick:e=>e.target===e.currentTarget&&i(),children:V(`div`,{class:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`detail-title`,ref:d,children:[V(`header`,{class:`modal-head`,children:[V(`h2`,{id:`detail-title`,children:[V(`span`,{class:`card-id`,children:r.id}),` `,r.title]}),V(`button`,{type:`button`,class:`icon-btn`,ref:f,onClick:i,"aria-label":`Close`,children:`×`})]}),V(`div`,{class:`modal-path`,children:a===null?null:a.path===null?V(`span`,{class:`muted`,children:`No file yet`}):V(v,{children:[V(`code`,{title:a.path,children:a.path}),V(`button`,{type:`button`,class:`small-btn`,onClick:p,children:l?`Copied`:`Copy path`})]})}),V(`div`,{class:`modal-body`,children:[s!==null&&V(`p`,{class:`notice error`,children:s}),a===null&&s===null&&V(`p`,{class:`muted`,children:`Loading…`}),m?.frontmatter&&V(`pre`,{class:`frontmatter`,children:m.frontmatter}),a!==null&&V(`div`,{class:`markdown`,dangerouslySetInnerHTML:{__html:h}})]})]})})}var di=e=>new Map(e.epics.map((e,t)=>[e.id,{epic:e,index:t}])),fi=e=>Fe.filter(t=>e||t!==`dropped`);function pi(e){let{board:t}=e,n=Re(t.stories,e.showDropped,e.epicFilter),r=di(t);return V(`div`,{class:`columns`,children:fi(e.showDropped).map(i=>V(`section`,{class:`column col-${i}`,"aria-label":Ie[i],children:[V(`h3`,{class:`col-head`,children:[Ie[i],` · `,n[i].length]}),n[i].map(n=>V(qe,{story:n,showEpic:!0,epic:n.epicId===null?null:r.get(n.epicId)??null,onOpen:n=>e.onOpen(n,t.sourceId)},n.key))]},i))})}var mi=e=>e.sources.length>1||e.sources.some(e=>(e.children?.length??0)>0);function hi({onAdded:e}){let[t,n]=R(!1),[r,i]=R(``),[a,o]=R(null),[s,c]=R(!1),l=()=>{n(!1),i(``),o(null)};return t?V(`form`,{class:`add-form`,onSubmit:async t=>{if(t.preventDefault(),r.trim()!==``){c(!0),o(null);try{let t=await Pe.addProject(r.trim());l(),e(t)}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}}},children:[V(`label`,{for:`add-path`,class:`sr-only`,children:`Project folder path`}),V(`input`,{id:`add-path`,type:`text`,placeholder:`/path/to/project`,value:r,autoFocus:!0,onInput:e=>i(e.target.value),onKeyDown:e=>e.key===`Escape`&&l()}),V(`div`,{class:`add-actions`,children:[V(`button`,{type:`submit`,class:`small-btn primary`,disabled:s,children:`Add`}),V(`button`,{type:`button`,class:`small-btn`,onClick:l,children:`Cancel`})]}),a!==null&&V(`p`,{class:`add-error`,role:`alert`,children:a})]}):V(`button`,{type:`button`,class:`add-btn`,onClick:()=>n(!0),children:`+ Add project`})}function gi(e){let{project:t,source:n,selected:r}=e;return V(`li`,{children:[V(`button`,{type:`button`,class:`source${r===n.id?` on`:``}`,"aria-current":r===n.id?`true`:void 0,onClick:()=>e.onSelect(t.id,n.id),children:[V(`span`,{class:`source-label`,children:n.label}),V(`span`,{class:`count`,children:n.count})]}),n.children&&n.children.length>0&&V(`ul`,{class:`sources nested`,children:n.children.map(n=>V(gi,{project:t,source:n,selected:r,onSelect:e.onSelect},n.id))})]})}function _i(e){return V(`nav`,{class:`sidebar`,"aria-label":`Projects`,children:[V(`div`,{class:`sidebar-head`,children:V(`span`,{class:`brand`,children:`BMAD Kanban`})}),V(hi,{onAdded:e.onAdded}),V(`ul`,{class:`projects`,children:e.projects.map(t=>{let n=t.id===e.selectedId;return V(`li`,{class:`project${n?` on`:``}${t.missing?` missing`:``}`,children:[V(`div`,{class:`project-row`,children:[V(`button`,{type:`button`,class:`project-btn`,"aria-current":n?`true`:void 0,title:t.path,onClick:()=>e.onSelectProject(t.id),children:[V(`span`,{class:`project-name`,children:t.name}),t.tags.map(e=>V(`span`,{class:`tag`,children:e},e))]}),V(`button`,{type:`button`,class:`icon-btn remove`,"aria-label":`Remove ${t.name} from the list`,title:`Remove from list`,onClick:()=>e.onRemove(t),children:`×`})]}),t.missing&&V(`div`,{class:`project-note`,children:`folder not found`}),t.error!==void 0&&V(`div`,{class:`project-note error`,title:t.error,children:[`config error: `,t.error]}),!t.missing&&mi(t)&&V(`ul`,{class:`sources`,children:t.sources.map(r=>V(gi,{project:t,source:r,selected:n?e.sourceId:null,onSelect:e.onSelectSource},r.id))})]},t.id)})}),e.projects.length===0&&V(`p`,{class:`muted empty`,children:`No projects yet.`})]})}function vi(e){let{board:t}=e,n=fi(e.showDropped),r=ze(t,e.showDropped),i=di(t);return V(`div`,{class:`lanes`,style:{gridTemplateColumns:`minmax(140px, 180px) repeat(${n.length}, minmax(140px, 1fr))`},children:[V(`div`,{class:`lane-corner`}),n.map(e=>V(`h3`,{class:`col-head`,children:Ie[e]},e)),r.map(r=>{let a=r.epic?i.get(r.epic.id):void 0,o=r.total===0?0:Math.round(r.done/r.total*100);return[V(`div`,{class:`lane-head`,style:{borderLeftColor:a?Ve(a.index):`var(--muted)`},children:[V(`div`,{class:`lane-title`,children:r.epic?V(v,{children:[r.epic.id,` `,r.epic.title]}):`No epic`}),V(`div`,{class:`lane-meta`,children:[r.epic?.status&&V(`span`,{children:r.epic.status}),r.epic?.retrospective===`done`&&V(`span`,{class:`retro-tag`,children:`✓ retro`}),V(`span`,{children:[r.done,`/`,r.total,` done`]})]}),V(`div`,{class:`bar`,role:`progressbar`,"aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${r.done} of ${r.total} done`,children:V(`i`,{style:{width:`${o}%`}})})]},`h-${r.epic?.id??`-`}`),...n.map(n=>V(`div`,{class:`cell`,children:r.cells[n].map(n=>V(qe,{story:n,showEpic:!1,epic:a??null,onOpen:n=>e.onOpen(n,t.sourceId)},n.key))},`${r.epic?.id??`-`}-${n}`))]})]})}var yi=e=>e.flatMap(e=>[e,...yi(e.children??[])]);function bi(e,t){let n=new Set(yi(e.sources).map(e=>e.id));for(let r of[t,e.prefs?.sourceId,e.defaultSourceId])if(r&&n.has(r))return r;return e.sources[0]?.id??null}var xi=e=>e.children&&e.children.length>0?e.children:[e],Si=e=>[e,...e.children??[]].some(e=>e.stories.some(e=>e.column===`dropped`)),Ci=e=>e instanceof Error?e.message:String(e);function wi(e){let{board:t,view:n}=e,r=t=>V(v,{children:[t.notices.map((e,t)=>V(`div`,{class:`notice ${e.level}`,role:e.level===`error`?`alert`:void 0,children:e.text},t)),t.stories.length===0?V(`p`,{class:`muted empty`,children:`No stories in this board yet.`}):n===`columns`?V(pi,{board:t,showDropped:e.showDropped,epicFilter:e.epicFilter,onOpen:e.onOpen}):V(vi,{board:t,showDropped:e.showDropped,onOpen:e.onOpen})]});return!t.children||t.children.length===0?r(t):V(v,{children:[t.notices.map((e,t)=>V(`div`,{class:`notice ${e.level}`,children:e.text},t)),t.children.map(e=>V(`section`,{class:`child-board`,"aria-label":e.label,children:[V(`h2`,{class:`child-title`,children:e.label}),r(e)]},e.sourceId))]})}function Ti(){let[e,t]=R(null),[n,r]=R(null),[i,a]=R(null),[o,s]=R(null),[c,l]=R(`columns`),[u,d]=R(!1),[f,p]=R(null),[m,h]=R(null),[g,_]=R(0),[y,b]=R(null),x=z(null);x.current=i;let S=z(!1),C=e?.find(e=>e.id===i)??null,ee=xe(()=>b(null),[]),w=xe((e,t)=>{a(e.id),s(bi(e,t)),l(e.prefs?.view??`columns`),d(e.prefs?.showDropped??!1),p(null),b(null);let n=new URL(location.href);n.searchParams.set(`project`,e.id),history.replaceState(null,``,n),Pe.setLastViewed(e.id).catch(()=>{})},[]),T=xe((e,n)=>{t(t=>t&&t.map(t=>t.id===e?{...t,prefs:{...t.prefs??{view:`columns`,showDropped:!1,sourceId:null},...n}}:t)),Pe.setPrefs(e,n).catch(()=>{})},[]),E=xe(async()=>{try{let e=await Pe.projects();t(e),r(null);let n=e.find(e=>e.id===x.current);S.current&&(n?s(e=>bi(n,e)):e.length>0?w(e[0]):(a(null),s(null)))}catch(e){r(Ci(e))}},[w]);ye(()=>{(async()=>{try{let[e,n]=await Promise.all([Pe.projects(),Pe.state().catch(()=>({lastViewed:null}))]);t(e);let r=[new URLSearchParams(location.search).get(`project`),n.lastViewed].map(t=>e.find(e=>e.id===t)).find(e=>e!==void 0)??e[0];S.current=!0,r&&w(r)}catch(e){S.current=!0,r(Ci(e))}})()},[w]),ye(()=>{let e=new EventSource(`/api/events`);e.addEventListener(`change`,e=>{try{let{projectId:t}=JSON.parse(e.data);if(t!==x.current)return}catch{return}_(e=>e+1),E()}),e.addEventListener(`projects`,()=>void E());let t=!1;return e.addEventListener(`open`,()=>{t&&(_(e=>e+1),E()),t=!0}),()=>e.close()},[E]);let D=C?.missing??!1,O=i&&o?`${i}\u0000${o}`:null;ye(()=>{if(!i||!o||!O||D)return;let e=!0;return Pe.board(i,o).then(t=>e&&h({key:O,board:t,error:null}),t=>{e&&(t instanceof Ae&&t.status===410&&E(),h({key:O,board:null,error:Ci(t)}))}),()=>{e=!1}},[i,o,O,D,g,E]);let k=m!==null&&m.key===O?m:null,A=k?.board??null,te=k?.error??null,ne=t=>{let n=e?.find(e=>e.id===t);n&&t!==i&&w(n)},re=(t,n)=>{let r=e?.find(e=>e.id===t);r&&(t===i?(s(n),p(null)):w(r,n),T(t,{sourceId:n}))},ie=e=>{t(t=>t?[...t.filter(t=>t.id!==e.id),e]:[e]),w(e)},j=async e=>{if(confirm(`Remove "${e.name}" from the list? The folder is not touched.`)){try{await Pe.removeProject(e.id)}catch{}await E()}},ae=e=>{l(e),i&&T(i,{view:e})},oe=e=>{d(e),i&&T(i,{showDropped:e})},se=A?xi(A):[],M=[],N=new Set;for(let e of se)e.epics.forEach((e,t)=>{N.has(e.id)||(N.add(e.id),M.push({epic:e,index:t}))});let P=f!==null&&N.has(f)?f:null,ce=A?Si(A):!1,le=C?yi(C.sources).find(e=>e.id===o):void 0;return V(`div`,{class:`app`,children:[V(_i,{projects:e??[],selectedId:i,sourceId:o,onSelectProject:ne,onSelectSource:re,onAdded:ie,onRemove:j}),V(`main`,{class:`main`,children:[n!==null&&V(`div`,{class:`notice error`,role:`alert`,children:[`Could not reach the server: `,n]}),e!==null&&e.length===0&&V(`div`,{class:`placeholder`,children:[V(`h1`,{children:`No projects yet`}),V(`p`,{children:[`Add a BMAD project folder with “+ Add project”, or run `,V(`code`,{children:`npx bmad-kanban`}),` inside one.`]})]}),C&&V(v,{children:[V(`header`,{class:`board-head`,children:[V(`h1`,{class:`board-title`,children:[C.name,(A?.label??le?.label)&&V(`span`,{class:`board-source`,children:[` / `,A?.label??le?.label]})]}),!C.missing&&A&&V(`div`,{class:`controls`,children:[V(`div`,{class:`toggle`,role:`group`,"aria-label":`Board view`,children:[V(`button`,{type:`button`,"aria-pressed":c===`columns`,class:c===`columns`?`on`:``,onClick:()=>ae(`columns`),children:`Columns`}),V(`button`,{type:`button`,"aria-pressed":c===`swimlanes`,class:c===`swimlanes`?`on`:``,onClick:()=>ae(`swimlanes`),children:`Swimlanes`})]}),ce&&V(`label`,{class:`switch`,children:[V(`input`,{type:`checkbox`,checked:u,onChange:e=>oe(e.target.checked)}),V(`span`,{children:`Show dropped`})]})]})]}),c===`columns`&&A&&M.length>0&&V(`div`,{class:`filters`,role:`group`,"aria-label":`Filter by epic`,children:[V(`span`,{class:`filters-label`,children:`Epics:`}),V(`button`,{type:`button`,class:`filter${P===null?` on`:``}`,"aria-pressed":P===null,onClick:()=>p(null),children:`All`}),M.map(e=>V(`button`,{type:`button`,class:`filter${P===e.epic.id?` on`:``}`,"aria-pressed":P===e.epic.id,onClick:()=>p(e.epic.id),children:[V(We,{info:e}),` `,e.epic.title]},e.epic.id))]}),V(`div`,{class:`board`,children:C.missing?V(`div`,{class:`placeholder`,children:[V(`h2`,{children:`Folder not found`}),V(`p`,{children:[V(`code`,{children:C.path}),` no longer exists.`]})]}):C.error!==void 0&&C.sources.length===0?V(`div`,{class:`notice error`,children:[`Could not read this project's BMAD config: `,C.error]}):o===null?V(`p`,{class:`muted empty`,children:`No boards found in this project yet.`}):te===null?A===null?V(`p`,{class:`muted empty`,children:`Loading…`}):V(wi,{board:A,view:c,showDropped:u&&ce,epicFilter:P,onOpen:(e,t)=>b({story:e,sourceId:t})}):V(`div`,{class:`notice error`,role:`alert`,children:te})})]})]}),y&&C&&V(ui,{projectId:C.id,sourceId:y.sourceId,story:y.story,onClose:ee})]})}se(V(Ti,{}),document.getElementById(`app`));
@@ -1 +1 @@
1
- :root{--bg:#f6f7f9;--surface:#fff;--surface-2:#eef0f3;--column:#78808c1f;--text:#1c2027;--muted:#6b7280;--border:#d9dde3;--accent:#4a7cff;--accent-text:#fff;--accent-soft:#4a7cff24;--danger:#dc2626;--danger-soft:#dc26261f;--warn:#b45309;--warn-soft:#f59e0b29;--info-soft:#4a7cff1f;--shadow:0 1px 2px #0f172a14;--backdrop:#0f172a73;color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.4}@media (prefers-color-scheme:dark){:root{--bg:#14161a;--surface:#1f2228;--surface-2:#262a31;--column:#a0a8b41a;--text:#e6e8eb;--muted:#9aa1ac;--border:#353a43;--accent:#6b93ff;--accent-soft:#6b93ff2e;--danger:#f87171;--danger-soft:#f8717129;--warn:#fbbf24;--warn-soft:#fbbf2424;--info-soft:#6b93ff24;--shadow:0 1px 2px #0006;--backdrop:#0009}}*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:var(--bg);color:var(--text);overflow-x:hidden}button{font:inherit;color:inherit;cursor:pointer}button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}.muted{color:var(--muted)}.sr-only{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.app{height:100vh;display:flex}.sidebar{background:var(--surface);border-right:1px solid var(--border);flex:none;width:250px;padding:12px 10px;overflow-y:auto}.sidebar-head{justify-content:space-between;align-items:center;padding:0 4px 10px;display:flex}.brand{font-size:15px;font-weight:700}.add-btn{text-align:left;border:1px dashed var(--border);width:100%;color:var(--muted);background:0 0;border-radius:6px;margin-bottom:10px;padding:6px 8px}.add-btn:hover{color:var(--text);border-color:var(--muted)}.add-form{margin-bottom:10px}.add-form input{border:1px solid var(--border);background:var(--bg);width:100%;color:var(--text);font:inherit;border-radius:6px;padding:6px 8px}.add-actions{gap:6px;margin-top:6px;display:flex}.add-error{color:var(--danger);word-break:break-word;margin:6px 0 0;font-size:12px}.projects,.sources{margin:0;padding:0;list-style:none}.project{margin-bottom:4px}.project-row{border-radius:6px;align-items:center;display:flex}.project-row:hover{background:var(--surface-2)}.project.on>.project-row{background:var(--accent);color:var(--accent-text)}.project-btn{text-align:left;background:0 0;border:0;flex:1;align-items:center;gap:6px;min-width:0;padding:6px 8px;display:flex}.project-name{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.tag{background:#7f7f7f38;border-radius:9px;flex:none;padding:1px 6px;font-size:10px}.project.on>.project-row .tag{background:#ffffff40}.icon-btn{color:var(--muted);background:0 0;border:0;border-radius:4px;padding:2px 8px;font-size:18px;line-height:1}.icon-btn:hover{background:var(--surface-2);color:var(--text)}.remove{opacity:0}.project-row:hover .remove,.remove:focus-visible{opacity:1}.project.on>.project-row .remove{color:var(--accent-text);opacity:.8}.project.on>.project-row .remove:hover{background:#fff3}.project.missing>.project-row{opacity:.5}.project-note{color:var(--muted);padding:0 8px 4px;font-size:11px}.project-note.error{color:var(--danger);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.sources{margin:2px 0 4px 10px}.sources.nested{border-left:1px solid var(--border);margin:0 0 0 12px;padding-left:4px}.source{text-align:left;width:100%;color:var(--muted);background:0 0;border:0;border-radius:5px;justify-content:space-between;gap:8px;padding:4px 8px;font-size:13px;display:flex}.source:hover{background:var(--surface-2);color:var(--text)}.source.on{background:var(--accent-soft);color:var(--text);font-weight:600}.source-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.count{font-variant-numeric:tabular-nums;font-size:12px}.empty{padding:12px 4px}.main{flex-direction:column;flex:1;min-width:0;display:flex;overflow:hidden}.board-head{border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;display:flex}.board-title{margin:0;font-size:17px}.board-source{color:var(--muted);font-weight:400}.controls{align-items:center;gap:14px;display:flex}.toggle{border:1px solid var(--border);border-radius:7px;display:inline-flex;overflow:hidden}.toggle button{background:0 0;border:0;padding:5px 12px}.toggle button+button{border-left:1px solid var(--border)}.toggle button.on{background:var(--accent);color:var(--accent-text)}.switch{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:6px;display:inline-flex}.switch input{accent-color:var(--accent)}.filters{border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap;align-items:center;gap:6px;padding:8px 18px;display:flex}.filters-label{color:var(--muted);font-size:12px}.filter{border:1px solid var(--border);background:0 0;border-radius:12px;align-items:center;gap:4px;padding:2px 9px;font-size:12px;display:inline-flex}.filter.on{border-color:var(--accent);background:var(--accent-soft)}.board{flex:1;padding:14px 18px 24px;overflow:auto}.placeholder{color:var(--muted);padding:40px 24px}.placeholder h1,.placeholder h2{color:var(--text)}.notice{border-left:3px solid;border-radius:6px;margin-bottom:10px;padding:8px 12px}.notice.info{background:var(--info-soft);border-color:var(--accent)}.notice.warn{background:var(--warn-soft);border-color:var(--warn)}.notice.error{background:var(--danger-soft);border-color:var(--danger)}.child-board+.child-board{margin-top:22px}.child-title{margin:0 0 8px;font-size:14px}.columns{align-items:flex-start;gap:10px;min-width:min-content;display:flex}.column{background:var(--column);border-radius:8px;flex:1 1 0;min-width:190px;min-height:120px;padding:8px}.col-head{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:0 0 8px;font-size:11px;font-weight:600}.lanes{align-items:stretch;gap:6px;min-width:min-content;display:grid}.lanes>.col-head{align-self:end;margin:0;padding:0 6px}.lane-head{background:var(--surface);border-left:4px solid;border-radius:6px;padding:6px 8px}.lane-title{font-size:13px;font-weight:600}.lane-meta{color:var(--muted);flex-wrap:wrap;gap:8px;margin-top:2px;font-size:11px;display:flex}.retro-tag{color:var(--accent);font-weight:600}.bar{background:#7f7f7f40;border-radius:3px;height:5px;margin-top:5px;overflow:hidden}.bar i{background:var(--accent);height:100%;display:block}.cell{background:var(--column);border-radius:6px;min-height:44px;padding:5px}.card{text-align:left;background:var(--surface);border:1px solid var(--border);width:100%;box-shadow:var(--shadow);border-radius:6px;flex-direction:column;gap:4px;margin-bottom:6px;padding:7px 8px;display:flex}.card-wrap{margin-bottom:6px;position:relative}.card-wrap:last-child{margin-bottom:0}.card-wrap .card{margin-bottom:0;padding-right:48px}.card-copy{color:var(--muted);background:var(--surface);border:1px solid var(--border);opacity:0;border-radius:4px;padding:1px 6px;font-size:11px;position:absolute;top:5px;right:5px}.card-wrap:hover .card-copy,.card-copy:focus-visible,.card-copy.copied,.card-copy.failed{opacity:1}.card-copy:hover,.card-copy.copied{color:var(--accent);border-color:var(--accent)}.card-copy.failed{color:#dc2626;border-color:#dc2626}@media (hover:none){.card-copy{opacity:1}}.card:last-child{margin-bottom:0}.card:hover{border-color:var(--accent)}.card.dropped{opacity:.6}.card.dropped .card-title{text-decoration:line-through}.card-top{flex-wrap:wrap;align-items:center;gap:5px;display:flex}.card-id{color:var(--muted);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600}.card-title{overflow-wrap:anywhere;font-size:13px}.chip{color:#fff;border-radius:9px;align-items:center;gap:2px;padding:1px 6px;font-size:10px;font-weight:600;display:inline-flex}.retro{font-size:9px}.badge{border-radius:9px;padding:1px 6px;font-size:10px;font-weight:600}.badge.blocked{background:var(--danger);color:#fff}.badge.type-bug{background:var(--danger-soft);color:var(--danger)}.badge.type-spike{background:var(--accent-soft);color:var(--accent)}.badge.unknown{background:var(--warn-soft);color:var(--warn);align-self:flex-start}.backdrop{background:var(--backdrop);z-index:10;justify-content:center;align-items:flex-start;padding:6vh 16px;display:flex;position:fixed;inset:0}.modal{background:var(--surface);border:1px solid var(--border);border-radius:10px;flex-direction:column;width:min(820px,100%);max-height:88vh;display:flex;box-shadow:0 12px 40px #0000004d}.modal-head{justify-content:space-between;align-items:flex-start;gap:12px;padding:14px 18px 6px;display:flex}.modal-head h2{margin:0;font-size:17px}.modal-path{border-bottom:1px solid var(--border);align-items:center;gap:8px;min-height:34px;padding:4px 18px 10px;display:flex}.modal-path code{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--muted);flex:1;overflow:hidden}.modal-body{padding:4px 18px 18px;overflow-y:auto}.small-btn{border:1px solid var(--border);background:var(--surface-2);border-radius:5px;flex:none;padding:3px 10px;font-size:12px}.small-btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.small-btn:disabled{opacity:.6;cursor:default}.markdown{overflow-wrap:anywhere}.markdown pre{background:var(--surface-2);border-radius:6px;padding:10px;overflow-x:auto}.markdown code{background:var(--surface-2);border-radius:3px;padding:1px 4px}.markdown pre code{background:0 0;padding:0}.markdown table{border-collapse:collapse}.markdown th,.markdown td{border:1px solid var(--border);padding:4px 8px}.markdown a{color:var(--accent)}.markdown blockquote{border-left:3px solid var(--border);color:var(--muted);margin:0;padding-left:12px}.frontmatter{background:var(--surface-2);color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:6px;margin:12px 0 0;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
1
+ :root{--bg:#f6f7f9;--surface:#fff;--surface-2:#eef0f3;--column:#78808c1f;--text:#1c2027;--muted:#6b7280;--border:#d9dde3;--accent:#4a7cff;--accent-text:#fff;--accent-soft:#4a7cff24;--danger:#dc2626;--danger-soft:#dc26261f;--warn:#b45309;--warn-soft:#f59e0b29;--info-soft:#4a7cff1f;--shadow:0 1px 2px #0f172a14;--backdrop:#0f172a73;color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.4}@media (prefers-color-scheme:dark){:root{--bg:#14161a;--surface:#1f2228;--surface-2:#262a31;--column:#a0a8b41a;--text:#e6e8eb;--muted:#9aa1ac;--border:#353a43;--accent:#6b93ff;--accent-soft:#6b93ff2e;--danger:#f87171;--danger-soft:#f8717129;--warn:#fbbf24;--warn-soft:#fbbf2424;--info-soft:#6b93ff24;--shadow:0 1px 2px #0006;--backdrop:#0009}}*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:var(--bg);color:var(--text);overflow-x:hidden}button{font:inherit;color:inherit;cursor:pointer}button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}.muted{color:var(--muted)}.sr-only{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.app{height:100vh;display:flex}.sidebar{background:var(--surface);border-right:1px solid var(--border);flex:none;width:250px;padding:12px 10px;overflow-y:auto}.sidebar-head{justify-content:space-between;align-items:center;padding:0 4px 10px;display:flex}.brand{font-size:15px;font-weight:700}.add-btn{text-align:left;border:1px dashed var(--border);width:100%;color:var(--muted);background:0 0;border-radius:6px;margin-bottom:10px;padding:6px 8px}.add-btn:hover{color:var(--text);border-color:var(--muted)}.add-form{margin-bottom:10px}.add-form input{border:1px solid var(--border);background:var(--bg);width:100%;color:var(--text);font:inherit;border-radius:6px;padding:6px 8px}.add-actions{gap:6px;margin-top:6px;display:flex}.add-error{color:var(--danger);word-break:break-word;margin:6px 0 0;font-size:12px}.projects,.sources{margin:0;padding:0;list-style:none}.project{margin-bottom:4px}.project-row{border-radius:6px;align-items:center;display:flex}.project-row:hover{background:var(--surface-2)}.project.on>.project-row{background:var(--accent);color:var(--accent-text)}.project-btn{text-align:left;background:0 0;border:0;flex:1;align-items:center;gap:6px;min-width:0;padding:6px 8px;display:flex}.project-name{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.tag{background:#7f7f7f38;border-radius:9px;flex:none;padding:1px 6px;font-size:10px}.project.on>.project-row .tag{background:#ffffff40}.icon-btn{color:var(--muted);background:0 0;border:0;border-radius:4px;padding:2px 8px;font-size:18px;line-height:1}.icon-btn:hover{background:var(--surface-2);color:var(--text)}.remove{opacity:0}.project-row:hover .remove,.remove:focus-visible{opacity:1}.project.on>.project-row .remove{color:var(--accent-text);opacity:.8}.project.on>.project-row .remove:hover{background:#fff3}.project.missing>.project-row{opacity:.5}.project-note{color:var(--muted);padding:0 8px 4px;font-size:11px}.project-note.error{color:var(--danger);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.sources{margin:2px 0 4px 10px}.sources.nested{border-left:1px solid var(--border);margin:0 0 0 12px;padding-left:4px}.source{text-align:left;width:100%;color:var(--muted);background:0 0;border:0;border-radius:5px;justify-content:space-between;gap:8px;padding:4px 8px;font-size:13px;display:flex}.source:hover{background:var(--surface-2);color:var(--text)}.source.on{background:var(--accent-soft);color:var(--text);font-weight:600}.source-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.count{font-variant-numeric:tabular-nums;font-size:12px}.empty{padding:12px 4px}.main{flex-direction:column;flex:1;min-width:0;display:flex;overflow:hidden}.board-head{border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;display:flex}.board-title{margin:0;font-size:17px}.board-source{color:var(--muted);font-weight:400}.controls{align-items:center;gap:14px;display:flex}.toggle{border:1px solid var(--border);border-radius:7px;display:inline-flex;overflow:hidden}.toggle button{background:0 0;border:0;padding:5px 12px}.toggle button+button{border-left:1px solid var(--border)}.toggle button.on{background:var(--accent);color:var(--accent-text)}.switch{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:6px;display:inline-flex}.switch input{accent-color:var(--accent)}.filters{border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap;align-items:center;gap:6px;padding:8px 18px;display:flex}.filters-label{color:var(--muted);font-size:12px}.filter{border:1px solid var(--border);background:0 0;border-radius:12px;align-items:center;gap:4px;padding:2px 9px;font-size:12px;display:inline-flex}.filter.on{border-color:var(--accent);background:var(--accent-soft)}.board{flex:1;padding:14px 18px 24px;overflow:auto}.placeholder{color:var(--muted);padding:40px 24px}.placeholder h1,.placeholder h2{color:var(--text)}.notice{border-left:3px solid;border-radius:6px;margin-bottom:10px;padding:8px 12px}.notice.info{background:var(--info-soft);border-color:var(--accent)}.notice.warn{background:var(--warn-soft);border-color:var(--warn)}.notice.error{background:var(--danger-soft);border-color:var(--danger)}.child-board+.child-board{margin-top:22px}.child-title{margin:0 0 8px;font-size:14px}.columns{align-items:flex-start;gap:10px;min-width:min-content;display:flex}.column{background:var(--column);border-radius:8px;flex:1 1 0;min-width:190px;min-height:120px;padding:8px}.col-head{text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:0 0 8px;font-size:11px;font-weight:600}.lanes{align-items:stretch;gap:6px;min-width:min-content;display:grid}.lanes>.col-head{align-self:end;margin:0;padding:0 6px}.lane-head{background:var(--surface);border-left:4px solid;border-radius:6px;padding:6px 8px}.lane-title{font-size:13px;font-weight:600}.lane-meta{color:var(--muted);flex-wrap:wrap;gap:8px;margin-top:2px;font-size:11px;display:flex}.retro-tag{color:var(--accent);font-weight:600}.bar{background:#7f7f7f40;border-radius:3px;height:5px;margin-top:5px;overflow:hidden}.bar i{background:var(--accent);height:100%;display:block}.cell{background:var(--column);border-radius:6px;min-height:44px;padding:5px}.card{text-align:left;background:var(--surface);border:1px solid var(--border);width:100%;box-shadow:var(--shadow);border-radius:6px;flex-direction:column;gap:4px;margin-bottom:6px;padding:7px 8px;display:flex}.card-wrap{margin-bottom:6px;position:relative}.card-wrap:last-child{margin-bottom:0}.card-wrap .card{margin-bottom:0;padding-right:48px}.card-copy{color:var(--muted);background:var(--surface);border:1px solid var(--border);opacity:0;border-radius:4px;padding:1px 6px;font-size:11px;position:absolute;top:5px;right:5px}.card-wrap:hover .card-copy,.card-copy:focus-visible,.card-copy.copied,.card-copy.failed{opacity:1}.card-copy:hover,.card-copy.copied{color:var(--accent);border-color:var(--accent)}.card-copy.failed{color:#dc2626;border-color:#dc2626}@media (hover:none){.card-copy{opacity:1}}.card:last-child{margin-bottom:0}.card:hover{border-color:var(--accent)}.card.dropped{opacity:.6}.card.no-file{cursor:default}.card.no-file:hover{border-color:var(--border)}.card-file{color:var(--accent);flex:none}.card.dropped .card-title{text-decoration:line-through}.card-top{flex-wrap:wrap;align-items:center;gap:5px;display:flex}.card-id{color:var(--muted);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600}.card-title{overflow-wrap:anywhere;font-size:13px}.chip{color:#fff;border-radius:9px;align-items:center;gap:2px;padding:1px 6px;font-size:10px;font-weight:600;display:inline-flex}.retro{font-size:9px}.badge{border-radius:9px;padding:1px 6px;font-size:10px;font-weight:600}.badge.blocked{background:var(--danger);color:#fff}.badge.type-bug{background:var(--danger-soft);color:var(--danger)}.badge.type-spike{background:var(--accent-soft);color:var(--accent)}.badge.unknown{background:var(--warn-soft);color:var(--warn);align-self:flex-start}.backdrop{background:var(--backdrop);z-index:10;justify-content:center;align-items:flex-start;padding:6vh 16px;display:flex;position:fixed;inset:0}.modal{background:var(--surface);border:1px solid var(--border);border-radius:10px;flex-direction:column;width:min(820px,100%);max-height:88vh;display:flex;box-shadow:0 12px 40px #0000004d}.modal-head{justify-content:space-between;align-items:flex-start;gap:12px;padding:14px 18px 6px;display:flex}.modal-head h2{margin:0;font-size:17px}.modal-path{border-bottom:1px solid var(--border);align-items:center;gap:8px;min-height:34px;padding:4px 18px 10px;display:flex}.modal-path code{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--muted);flex:1;overflow:hidden}.modal-body{padding:4px 18px 18px;overflow-y:auto}.small-btn{border:1px solid var(--border);background:var(--surface-2);border-radius:5px;flex:none;padding:3px 10px;font-size:12px}.small-btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.small-btn:disabled{opacity:.6;cursor:default}.markdown{overflow-wrap:anywhere}.markdown pre{background:var(--surface-2);border-radius:6px;padding:10px;overflow-x:auto}.markdown code{background:var(--surface-2);border-radius:3px;padding:1px 4px}.markdown pre code{background:0 0;padding:0}.markdown table{border-collapse:collapse}.markdown th,.markdown td{border:1px solid var(--border);padding:4px 8px}.markdown a{color:var(--accent)}.markdown blockquote{border-left:3px solid var(--border);color:var(--muted);margin:0;padding-left:12px}.frontmatter{background:var(--surface-2);color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:6px;margin:12px 0 0;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="color-scheme" content="light dark" />
7
7
  <title>BMAD Kanban</title>
8
- <script type="module" crossorigin src="/assets/index-BPhoYnBf.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-__ghbwnQ.css">
8
+ <script type="module" crossorigin src="/assets/index-CiE4J1lL.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-ivqvYtzo.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmad-kanban",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Read-only local Kanban board for BMAD Method projects (v6 and v7 layouts)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,67 +0,0 @@
1
- (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u={},d=[],f=/^m(i|n|o|s|text|space)$/,p=Array.isArray,m=d.slice,h=Object.assign;function g(e){e&&e.parentNode&&e.remove()}function _(n,r,i,a,o){var s={type:n,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o||++t,__i:-1,__u:0};return!o&&e.vnode&&e.vnode(s),s}function v(e){return e.children}function y(e,t){this.props=e,this.context=t,this.__g=0}function b(e,t){if(t==null)return e.__&&b(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:b(e)}function x(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),x(e)}function S(t){(8&t.__g||(t.__g|=8,n.push(t),i++))&&r==e.debounceRendering||((r=e.debounceRendering)||queueMicrotask)(C)}function C(){var t,o,s,c,l,u,d,f,p;try{for(o=1;n.length;)n.length>o&&n.sort(a),t=n.shift(),o=n.length,8&t.__g&&(c=void 0,l=void 0,u=(l=(s=t).__v).__e,d=[],f=[],(p=s.__P)&&((c=h({constructor:void 0},l)).__v=l.__v+1,e.vnode&&e.vnode(c),A(p,c,l,s.__n,p.namespaceURI,32&l.__u?[u]:null,d,u||b(l),32&l.__u,f),c.__v=l.__v,c.__.__k[c.__i]=c,re(d,c,f),l.__=l.__e=null,c.__e!=u&&x(c)))}finally{(i=n.length)&&(r||queueMicrotask)(C)}}function ee(e,t,n,r,i,a,o,s,c,l,f){var p,m,h,g,_,v,y=r.__k||d,b=t.length;for(c=w(n,t,y,c,b),p=0;p<b;p++)(h=n.__k[p])!=null&&(m=~h.__i&&y[h.__i]||u,h.__i=p,v=A(e,h,m,i,a,o,s,c,l,f),g=h.__e,(m.ref!=h.ref||8&m.__u)&&(m.ref&&j(m.ref,null,h,m),h.ref&&f.push(h.ref,h.__c||g,h)),_||=g,4&h.__u?(c=T(h,c,e,!m.__v),m.__e&&(m.__e=null)):typeof h.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),h.__u&=-21);return n.__e=_,c}function w(e,t,n,r,i){var a,o,s,c,l,u,d,f,m,h=n.length,g=h,y=0,x=0,S=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor==String?o=S[a]=_(null,o):p(o)?o=S[a]=_(v,{children:o}):o.constructor===void 0&&o.__b?o=S[a]=_(o.type,o.props,o.key,o.ref,o.__v):S[a]=o,c=a+y,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=E(o,n,c,g))&&(g--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=16,l==c-1?y--:l==c+1?y++:l!=c&&(l>c?y--:y++,x=1)):(~l||(i>h?y--:i<h&&y++),typeof o.type!=`function`&&(o.__u|=4))):S[a]=null;if(x){for(u=[],d=[],a=0;a<i;a++)if((o=S[a])&&16&o.__u){for(y=0,f=u.length;y<f;)u[m=y+f>>1]<o.__i?y=m+1:f=m;u[y]=o.__i,d[a]=y+1}for(y=u.length;a--;)d[a]&&(d[a]==y?y--:S[a].__u|=4)}if(g)for(a=0;a<h;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=b(s)),ae(s,s));return r}function T(e,t,n,r){var i,a,o,s;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=T(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=b(e))&&!t.parentNode&&(t=null),o=e.__e,s=t;s&&s.nodeType==8;)s=s.nextSibling;for(o!=s&&(!r&&n.moveBefore&&o.parentNode?n.moveBefore(o,t):n.insertBefore(o,t||null)),t=o;(t&&=t.nextSibling)&&t.nodeType==8&&!t.data.startsWith(`$s`););return t}function E(e,t,n,r){var i,a=e.key,o=e.type,s=t[n],c=s&&!(2&s.__u);if(s===null&&a==null||c&&a==s.key&&o==s.type)return n;if(r>+!!c){for(i=n-1;i>=0;i--)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i;for(i=n+1;i<t.length;i++)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i}return-1}function D(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function O(e,t,n,r,i){var a,o;if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||D(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||D(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)(e.__e||={})[t]=n,n&&r||(o=l[t]||(l[t]=k(t)),(e.__a||={})[t]=c,a=t!=(t=t.replace(s,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),n?e.addEventListener(t,o,a):e.removeEventListener(t,o,a));else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;return}catch{}if(typeof n==`function`)return;n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n)}}function k(t){return function(n){var r=this.__e;if(r){if(r=r[t],n[o]==null)n[o]=c++;else if(n[o]<this.__a[t])return;return r(e.event?e.event(n):n)}}}function A(t,n,r,i,a,o,s,c,l,u){var f,m,_,x,S,C,w,T,E,D,O,k,A,re,j,se,M,N,P=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=32&r.__u,f=r.__c.__z)&&(n.__u|=l,m=o=[],f.nodeType==8?c=te(f,o):o.push(f),c=o[0]||c),(f=e.__b)&&f(n);n:if(typeof P==`function`){_=s.length;try{if(T=n.props,E=(f=P.prototype)&&f.render,D=(f=P.contextType)&&i[f.__c],O=f?D?D.props.value:f.__:i,(x=r.__c)?(n.__c=x,2&x.__g&&(x.__g|=1)):(E?n.__c=x=new P(T,O):(n.__c=x=new y(T,O),x.constructor=P,x.render=oe),D&&D.sub(x),x.state||(x.state={}),x.__n=i,x.__g|=8,x.__h=[],x.__k=[]),E&&(x.__s||(x.__s=x.state),P.getDerivedStateFromProps&&(x.__s==x.state&&(x.__s=h({},x.__s)),h(x.__s,P.getDerivedStateFromProps(T,x.__s)))),S=x.props,C=x.state,x.__v=n,r.__c){if(T!==S&&E&&!P.getDerivedStateFromProps&&x.componentWillReceiveProps&&x.componentWillReceiveProps(T,O),n.__v==r.__v&&!(8&x.__g)||!(4&x.__g)&&x.shouldComponentUpdate&&!1===x.shouldComponentUpdate(T,x.__s,O)){n.__v!=r.__v&&(x.props=T,x.state=x.__s,x.__g&=-9),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),d.push.apply(x.__h,x.__k),x.__k=[],x.__h.length&&s.push(x),c=b(r);break n}x.componentWillUpdate&&x.componentWillUpdate(T,x.__s,O),E&&x.componentDidUpdate&&x.__h.push(function(){x.componentDidUpdate(S,C,w)})}else E&&!P.getDerivedStateFromProps&&x.componentWillMount&&x.componentWillMount(),E&&x.componentDidMount&&x.__h.push(x.componentDidMount);if(x.context=O,x.props=T,x.__P=t,x.__g&=-5,k=e.__r,A=0,E)x.state=x.__s,x.__g&=-9,k&&k(n),f=x.render(x.props,x.state,x.context),d.push.apply(x.__h,x.__k),x.__k=[];else do x.__g&=-9,k&&k(n),f=x.render(x.props,x.state,x.context),x.state=x.__s;while(8&x.__g&&++A<25);x.state=x.__s,x.getChildContext&&(i=h({},i,x.getChildContext())),E&&r.__c&&x.getSnapshotBeforeUpdate&&(w=x.getSnapshotBeforeUpdate(S,C)),re=f&&f.type===v&&f.key==null?f.props.children:f,T.__P&&(f=c,a=(t=T.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=t&&(r.__k.some(function(e){e&&ae(e,e)}),r.__k=null),c=r.__k?b(r,0):null),c=ee(t,p(re)?re:[re],n,r,i,a,o,s,c,l,u),T.__P&&(n.__e=null,c=f),n.__u&=-161,m&&m.some(g),x.__h.length&&s.push(x),1&x.__g&&(x.__g&=-4)}catch(t){if(s.length=_,n.__v=null,l||o){if(t.then){if(j=0,n.__u|=128|l,o){for(~(M=o.indexOf(c||void 0))||(M=o.length);(N=o[M-1])&&N.nodeType==8;)M--;for(;M<o.length;M++)if(N=o[M]){if(o[M]=null,N.nodeType==8){if(N.data.startsWith(`$s`))j++||(se=N);else if(j&&N.data.startsWith(`/$s`)&&!--j)break}else if(!j)break}}if(!se){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;se=c}(f=te(se=n.__c.__z||(n.__c.__z=se)))?(n.__e=se,c=f):n.__e=c,c&&=c.nextSibling}else o&&o.some(g)}else n.__e=r.__e;n.__k||=r.__k||[],t.then||ne(n),e.__e(t,n,r)}}else c=n.__e=ie(r.__e,n,r,i,a,o,s,l,u,t);return(f=e.diffed)&&f(n),c}function te(e,t){if(e&&e.nodeType==8&&e.data.startsWith(`$s`))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith(`$s`))n++;else if(e.data.startsWith(`/$s`)&&!--n)return e}t&&t.push(e)}}function ne(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(ne))}function re(t,n,r){for(var i=0;i<r.length;)j(r[i++],r[i++],r[i++]);e.__c&&e.__c(n,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(e){e.call(n)})}catch(t){e.__e(t,n.__v)}})}function ie(t,n,r,i,a,o,s,c,l,d){var h,_,v,y,x,S,C,w,T,E=r.props||u,D=n.props,k=n.type;if(k==`svg`?a=`http://www.w3.org/2000/svg`:k==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(h=0;h<o.length;h++)if((x=o[h])&&(k?x.localName==k:x.nodeType==3)){t=x,o[h]=null;break}}if(!t){if(w=d.ownerDocument||document,!k)return w.createTextNode(D);t=w.createElementNS(a,k,D.is&&D),c&&=(e.__m&&e.__m(n,o),!1),o=null}if(k){if(d=k==`template`?t.content:t,o=k==`textarea`&&D.defaultValue!=null?null:o&&m.call(d.childNodes),!c&&o)for(E={},h=0;h<t.attributes.length;h++)E[(x=t.attributes[h]).name]=x.value;for(h in E)x=E[h],h==`dangerouslySetInnerHTML`?v=x:h==`children`||h in D||h==`value`&&`defaultValue`in D||h==`checked`&&`defaultChecked`in D||O(t,h,null,x,a);for(h in T=1&r.__u,D)x=D[h],h==`children`?y=x:h==`dangerouslySetInnerHTML`?_=x:h==`value`?S=x:h==`checked`?C=x:c&&typeof x!=`function`||!(E[h]!==x||T&&x!=null)||O(t,h,x,E[h],a);_?(c||v&&(_.__html==v.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),n.__k=[]):(v&&(t.textContent=``),(k==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&f.test(k))&&(a=`http://www.w3.org/1999/xhtml`),ee(d,p(y)?y:[y],n,r,i,a,o,s,o?o[0]:r.__k&&b(r,0),c,l),o&&o.some(g)),c&&k!=`textarea`||(h=`value`,k==`progress`&&S==null?t.removeAttribute(h):S==null||S===t[h]&&(k!=`progress`||S)||O(t,h,S,E[h],a),h=`checked`,C!=null&&C!=t[h]&&O(t,h,C,E[h],a))}else E===D||c&&t.data==D||(t.data=D);return t}function j(t,n,r,i){try{typeof t==`function`?n?n.__x=t(n)||1:(i&&=i.__c||i.__e)&&(n=i.__x)&&(i.__x=null,typeof n==`function`?n():t(null)):t.current=n}catch(t){e.__e(t,r)}}function ae(t,n,r){var i,a,o,s;if(e.unmount&&e.unmount(t),!(i=t.ref)||i.current&&i.current!=t.__e||j(i,null,n,t),i=t.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){e.__e(t,n)}i.__P=i.__n=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&ae(i[s],n,typeof t.type!=`function`||r&&!t.props.__P);!r&&(i=t.__c)&&(i=i.__z)&&(a=te(i,o=[]))&&(i==t.__e&&o.some(g),g(a),g(i)),(i=t.__e)&&(r||g(i),i.__e&&(i.__e=null)),t.__e=t.__c=t.__=null}function oe(e,t,n){return this.constructor(e,n)}function se(t,n){var r,i,a,o;e.__&&e.__(t,n),n.nodeType==9&&(n=n.documentElement),i=(r=t&&32&t.__u)?null:n.__k,n.__k=_(v,{children:[t]}),a=[],o=[],A(n,n.__k,i||u,u,n.namespaceURI,i?null:n.firstChild?m.call(n.childNodes):null,a,i?i.__e:n.firstChild,r,o),re(a,n.__k,o),n.__k.props.children=null}e={__e:function(e,t,n,r){for(var a,o,s;t=t.__;)if((a=t.__c)&&!(1&a.__g)){a.__g|=4;try{if((s=(o=a.constructor)&&o.getDerivedStateFromError)&&a.setState(o.getDerivedStateFromError(e)),a.componentDidCatch&&(a.componentDidCatch(e,r||{}),s=1),s&&8&a.__g)return void(a.__g|=2)}catch(t){e=t}}throw i=0,e}},t=0,y.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=h({},this.state)),typeof e==`function`&&(e=e(h({},n),this.props)),e&&(h(n,e),this.__v&&(t&&this.__k.push(t),S(this)))},y.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),S(this))},y.prototype.render=v,n=[],i=0,a=function(e,t){return e.__v.__b-t.__v.__b},o=Symbol(),s=/(PointerCapture)$|Capture$/i,c=0,l={};var M,N,P,ce,le=Object.is,ue=0,de=[],fe=[],F=e,pe=F.__b,me=F.__r,he=F.diffed,I=F.__c,ge=F.unmount,L=F.__;function _e(e,t){F.__h&&F.__h(N,e,ue||t),ue=0;var n=N.__H||(N.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return ue=1,ve(Ae,e)}function ve(e,t,n){var r=_e(M++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ae(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);le(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.__f)){N.__f=!0;var i=N.shouldComponentUpdate;N.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,le(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function ye(e,t){var n=_e(M++,3);!F.__s&&ke(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,N.__H.__h.push(n))}function be(e){return ue=5,xe(function(){return{current:e}},[])}function xe(e,t){var n=_e(M++,7);return ke(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Se(e,t){return ue=8,xe(function(){return e},t)}function Ce(){var e;do{for(;e=fe.shift();)try{De(e)}catch(t){F.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=de.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(De),t.__h.some(Oe),t.__h=[]}catch(n){t.__h=[],F.__e(n,e.__v)}}}while(fe.length)}F.__b=function(e){N=null,pe&&pe(e)},F.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),L&&L(e,t)},F.__r=function(e){me&&me(e),M=0;var t=(N=e.__c).__H;t&&(P==N?N.__h=[]:(t.__h.some(De),t.__h.some(Oe),M=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),P=N},F.diffed=function(e){he&&he(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Ee(de.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),P=N=null},F.__c=function(e,t){t.some(function(e){try{e.__h.some(De),e.__h=e.__h.filter(function(e){return!e.__||Oe(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],F.__e(n,e.__v)}}),I&&I(e,t)},F.unmount=function(e){ge&&ge(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Ee(fe.push(r))}else De(r)}catch(e){t=e}}),r.__H=void 0,t&&F.__e(t,r.__v))};var we=typeof requestAnimationFrame==`function`;function Te(e){var t,n=function(){clearTimeout(r),we&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);we&&(t=requestAnimationFrame(n))}function Ee(e){e!=1&&ce==F.requestAnimationFrame||((ce=F.requestAnimationFrame)||Te)(Ce)}function De(e){var t=N,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),N=t}function Oe(e){var t=N;e.__c=e.__(),N=t}function ke(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!le(t,e[n])})}function Ae(e,t){return typeof t==`function`?t(e):t}var je=class extends Error{status;constructor(e,t){super(t),this.status=e}},Me=encodeURIComponent,Ne={"Content-Type":`application/json`};async function Pe(e,t){let n=await fetch(e,t);if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new je(n.status,e)}return n.status===204?void 0:await n.json()}var Fe=(e,t)=>({method:e,headers:Ne,body:JSON.stringify(t)}),Ie={projects:()=>Pe(`/api/projects`),addProject:e=>Pe(`/api/projects`,Fe(`POST`,{path:e})),removeProject:e=>Pe(`/api/projects/${Me(e)}`,{method:`DELETE`}),setPrefs:(e,t)=>Pe(`/api/projects/${Me(e)}/prefs`,Fe(`PUT`,t)),board:(e,t)=>Pe(`/api/projects/${Me(e)}/boards/${Me(t)}`),story:(e,t,n)=>Pe(`/api/projects/${Me(e)}/boards/${Me(t)}/stories/${Me(n)}`),state:()=>Pe(`/api/state`),setLastViewed:e=>Pe(`/api/state`,Fe(`PUT`,{lastViewed:e}))},Le=[`backlog`,`ready`,`in-progress`,`review`,`done`,`dropped`],Re={backlog:`Backlog`,ready:`Ready`,"in-progress":`In progress`,review:`Review`,done:`Done`,dropped:`Dropped`},ze=()=>({backlog:[],ready:[],"in-progress":[],review:[],done:[],dropped:[]});function Be(e,t,n){let r=ze();for(let i of e)i.column===`dropped`&&!t||n!==null&&i.epicId!==n||r[i.column].push(i);return r}function Ve(e,t){let n=new Set(e.epics.map(e=>e.id)),r=(e,n)=>({epic:e,done:n.filter(e=>e.column===`done`).length,total:n.filter(e=>e.column!==`dropped`).length,cells:Be(n,t,null)}),i=e.epics.map(t=>r(t,e.stories.filter(e=>e.epicId===t.id))),a=e.stories.filter(e=>e.epicId===null||!n.has(e.epicId));return a.filter(e=>t||e.column!==`dropped`).length>0&&i.push(r(null,a)),i}var He=[`#3b82f6`,`#a855f7`,`#f59e0b`,`#10b981`,`#ef4444`,`#06b6d4`,`#ec4899`,`#84cc16`];function Ue(e){let t=He.length;return He[(e%t+t)%t]}function We(e){let t=e.title.trim();return t===e.key?t:`${e.id} ${t}`}var Ge=0;Array.isArray;function z(t,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l&&typeof t!=`function`)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ge,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),e.vnode&&e.vnode(u),u}function Ke({info:e}){let{epic:t,index:n}=e,r=t.retrospective===`done`;return z(`span`,{class:`chip`,style:{background:Ue(n)},title:`Epic ${t.id}: ${t.title}${r?` (retrospective done)`:``}`,children:[t.id,r&&z(`span`,{class:`retro`,"aria-label":`retrospective done`,children:`✓`})]})}function qe({story:e}){let[t,n]=R(`idle`),r=be(void 0);ye(()=>()=>clearTimeout(r.current),[]);let i=async()=>{try{await navigator.clipboard.writeText(We(e)),n(`copied`)}catch{n(`failed`)}clearTimeout(r.current),r.current=setTimeout(()=>n(`idle`),1500)},a=t===`copied`?`Copied`:t===`failed`?`Copy failed`:`Copy`;return z(`button`,{type:`button`,class:`card-copy${t===`idle`?``:` ${t}`}`,onClick:i,"aria-label":`Copy title`,title:`Copy "${We(e)}"`,children:z(`span`,{"aria-live":`polite`,children:a})})}function Je(e){let{story:t,epic:n}=e;return z(`div`,{class:`card-wrap`,children:[z(`button`,{type:`button`,class:`card${t.column===`dropped`?` dropped`:``}`,onClick:()=>e.onOpen(t),children:[z(`span`,{class:`card-top`,children:[e.showEpic&&n&&z(Ke,{info:n}),z(`span`,{class:`card-id`,children:t.id}),t.blocked&&z(`span`,{class:`badge blocked`,children:`blocked`}),(t.type===`spike`||t.type===`bug`)&&z(`span`,{class:`badge type-${t.type}`,children:t.type})]}),z(`span`,{class:`card-title`,children:t.title}),t.unknownStatus!==void 0&&z(`span`,{class:`badge unknown`,children:[`unknown status: `,t.unknownStatus]})]}),z(qe,{story:t})]})}function Ye(e,t){this.v=e,this.k=t}function Xe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ze(e){if(Array.isArray(e))return e}function Qe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $e(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function et(e,t){return Ze(e)||Qe(e,t)||tt(e,t)||$e()}function tt(e,t){if(e){if(typeof e==`string`)return Xe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(e,t):void 0}}function nt(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Ye;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}nt.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},nt.prototype.next=function(e){return this._invoke(`next`,e)},nt.prototype.throw=function(e){return this._invoke(`throw`,e)},nt.prototype.return=function(e){return this._invoke(`return`,e)};var rt=Object.entries,it=Object.setPrototypeOf,at=Object.isFrozen,ot=Object.getPrototypeOf,st=Object.getOwnPropertyDescriptor,B=Object.freeze,V=Object.seal,ct=Object.create,H=typeof Reflect<`u`&&Reflect,lt=H.apply,ut=H.construct;B||=function(e){return e},V||=function(e){return e},lt||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ut||=function(e){return new e(...[...arguments].slice(1))};var dt=G(Array.prototype.forEach);Array.prototype.indexOf;var ft=G(Array.prototype.lastIndexOf),pt=G(Array.prototype.pop),mt=G(Array.prototype.push),ht=G(Array.prototype.slice),gt=G(Array.prototype.splice),_t=Array.isArray,vt=Nt(Set),yt=G(Set.prototype.add),bt=G(Set.prototype.has),xt=G(String.prototype.toLowerCase),St=G(String.prototype.toString),Ct=G(String.prototype.match),wt=G(String.prototype.replace),Tt=G(String.prototype.indexOf),Et=G(String.prototype.trim),Dt=G(Number.prototype.toString),Ot=G(Boolean.prototype.toString),kt=typeof BigInt>`u`?null:G(BigInt.prototype.toString),At=typeof Symbol>`u`?null:G(Symbol.prototype.toString),U=G(Object.prototype.hasOwnProperty),jt=G(Object.prototype.toString),W=G(RegExp.prototype.test),Mt=Nt(TypeError);function G(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return lt(e,t,n)}}function Nt(e){return function(){return ut(e,[...arguments])}}function K(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xt;if(it&&it(e,null),!_t(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(at(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Pt(e){for(let t=0;t<e.length;t++)U(e,t)||(e[t]=null);return e}function q(e){let t=ct(null);for(let r of rt(e)){var n=et(r,2);let i=n[0],a=n[1];U(e,i)&&(t[i]=_t(a)?Pt(a):a&&typeof a==`object`&&a.constructor===Object?q(a):a)}return t}function Ft(e){switch(typeof e){case`string`:return e;case`number`:return Dt(e);case`boolean`:return Ot(e);case`bigint`:return kt?kt(e):`0`;case`symbol`:return At?At(e):`Symbol()`;case`undefined`:return jt(e);case`function`:case`object`:{if(e===null)return jt(e);let t=e,n=It(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:jt(e)}return jt(e)}default:return jt(e)}}function It(e,t){for(;e!==null;){let n=st(e,t);if(n){if(n.get)return G(n.get);if(typeof n.value==`function`)return G(n.value)}e=ot(e)}function n(){return null}return n}function Lt(e,t){for(;e!==null;){let n=st(e,t);if(n)return n.get?G(n.get):null;e=ot(e)}return null}function Rt(e){try{return W(e,``),!0}catch{return!1}}var zt=B(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Bt=B(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Vt=B([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ht=B([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ut=B(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Wt=B([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Gt=B([`#text`]),Kt=B(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),qt=B(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Jt=B(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Yt=B([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Xt=V(/{{[\w\W]*|^[\w\W]*}}/g),Zt=V(/<%[\w\W]*|^[\w\W]*%>/g),Qt=V(/\${[\w\W]*/g),$t=V(/^data-[\-\w.\u00B7-\uFFFF]+$/),en=V(/^aria-[\-\w]+$/),tn=V(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nn=V(/^(?:\w+script|data):/i),rn=V(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),an=V(/^html$/i),on=V(/^[a-z][.\w]*(-[.\w]+)+$/i),sn=V(/<[/\w!]/g),cn=V(/<[/\w]/g),ln=V(/<\/no(script|embed|frames)/i),un=V(/\/>/i),J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},dn=B(K({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),fn=function(){return typeof window>`u`?null:window},pn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},mn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},hn=function(e,t,n,r){return U(e,t)&&_t(e[t])?K(r.base?q(r.base):{},e[t],r.transform):n},gn=function(e,t,n){let r=U(e,t)?e[t]:void 0;return r&&typeof r==`object`?q(r):n()};function _n(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fn(),t=e=>_n(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==J.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=It(d,`cloneNode`),p=It(d,`remove`),m=It(d,`removeAttributeNode`),h=It(d,`nextSibling`),g=It(d,`childNodes`),_=It(d,`parentNode`),v=It(d,`shadowRoot`),y=It(d,`attributes`),b=o&&o.prototype?It(o.prototype,`nodeType`):null,x=o&&o.prototype?It(o.prototype,`nodeName`):null,S=o&&o.prototype?It(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},ee=function(e){return x?x(e):e.nodeName},w=Lt(d,`namespaceURI`),T=function(e){return w?w(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let E,D=``,O,k=!1,A=0,te=function(){if(A>0)throw Mt(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ne=function(e){te(),A++;try{return E.createHTML(e)}finally{A--}},re=function(e){te(),A++;try{return E.createScriptURL(e)}finally{A--}},ie=function(){return k||=(O=pn(u,i),!0),O},j=n,ae=j.implementation,oe=j.createNodeIterator,se=j.createDocumentFragment,M=j.getElementsByTagName,N=r.importNode,P=mn();t.isSupported=typeof rt==`function`&&typeof _==`function`&&ae&&ae.createHTMLDocument!==void 0;let ce=Xt,le=Zt,ue=Qt,de=$t,fe=en,F=nn,pe=rn,me=on,he=tn,I=null,ge=K({},[...zt,...Bt,...Vt,...Ut,...Gt]),L=null,_e=K({},[...Kt,...qt,...Jt,...Yt]),R=Object.seal(ct(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,ye=null,be=Object.seal(ct(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),xe=!0,Se=!0,Ce=!1,we=!0,Te=!1,Ee=!0,De=!1,Oe=!1,ke=null,Ae=null,je=!1,Me=!1,Ne=!1,Pe=!1,Fe=!0,Ie=!1,Le=`user-content-`,Re=!0,ze=!1,Be=null,Ve={},He=null,Ue=K({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),We=null,Ge=K({},[`audio`,`video`,`img`,`source`,`image`,`track`]),z=null,Ke=K({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),qe=`http://www.w3.org/1998/Math/MathML`,Je=`http://www.w3.org/2000/svg`,Ye=`http://www.w3.org/1999/xhtml`,Xe=Ye,Ze=!1,Qe=null,$e=K({},[qe,Je,Ye],St),et=B([`mi`,`mo`,`mn`,`ms`,`mtext`]),tt=K({},et),nt=B([`annotation-xml`]),it=K({},nt),at=K({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],H=null,lt=null,ut=n.createElement(`form`),Dt=function(e){return e instanceof RegExp||e instanceof Function},Ot=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(lt&&lt===e)return;e&&typeof e==`object`||(e={}),e=q(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,H=ot===`application/xhtml+xml`?St:xt,I=hn(e,`ALLOWED_TAGS`,ge,{transform:H}),L=hn(e,`ALLOWED_ATTR`,_e,{transform:H}),Qe=hn(e,`ALLOWED_NAMESPACES`,$e,{transform:St}),z=hn(e,`ADD_URI_SAFE_ATTR`,Ke,{transform:H,base:Ke}),We=hn(e,`ADD_DATA_URI_TAGS`,Ge,{transform:H,base:Ge}),He=hn(e,`FORBID_CONTENTS`,Ue,{transform:H}),ve=hn(e,`FORBID_TAGS`,q({}),{transform:H}),ye=hn(e,`FORBID_ATTR`,q({}),{transform:H}),Ve=U(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?q(e.USE_PROFILES):e.USE_PROFILES:!1,xe=e.ALLOW_ARIA_ATTR!==!1,Se=e.ALLOW_DATA_ATTR!==!1,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,De=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,je=e.FORCE_BODY||!1,Fe=e.SANITIZE_DOM!==!1,Ie=e.SANITIZE_NAMED_PROPS||!1,Re=e.KEEP_CONTENT!==!1,ze=e.IN_PLACE||!1,he=Rt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:tn,Xe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ye,tt=gn(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>K({},et)),it=gn(e,`HTML_INTEGRATION_POINTS`,()=>K({},nt));let t=gn(e,`CUSTOM_ELEMENT_HANDLING`,()=>ct(null));if(R=ct(null),U(t,`tagNameCheck`)&&Dt(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),U(t,`attributeNameCheck`)&&Dt(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),U(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),V(R),Te&&(Se=!1),Ne&&(Me=!0),Ve&&(I=K({},Gt),L=ct(null),Ve.html===!0&&(K(I,zt),K(L,Kt)),Ve.svg===!0&&(K(I,Bt),K(L,qt),K(L,Yt)),Ve.svgFilters===!0&&(K(I,Vt),K(L,qt),K(L,Yt)),Ve.mathMl===!0&&(K(I,Ut),K(L,Jt),K(L,Yt))),be.tagCheck=null,be.attributeCheck=null,U(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?be.tagCheck=e.ADD_TAGS:_t(e.ADD_TAGS)&&(I===ge&&(I=q(I)),K(I,e.ADD_TAGS,H))),U(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?be.attributeCheck=e.ADD_ATTR:_t(e.ADD_ATTR)&&(L===_e&&(L=q(L)),K(L,e.ADD_ATTR,H))),U(e,`ADD_FORBID_CONTENTS`)&&_t(e.ADD_FORBID_CONTENTS)&&(He===Ue&&(He=q(He)),K(He,e.ADD_FORBID_CONTENTS,H)),Re&&(I[`#text`]=!0),De&&K(I,[`html`,`head`,`body`]),I.table&&(K(I,[`tbody`]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Mt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Mt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=E;E=e.TRUSTED_TYPES_POLICY;try{D=ne(``)}catch(e){throw E=t,e}}else e.TRUSTED_TYPES_POLICY===null?(E=void 0,D=``):(E===void 0&&(E=ie()),E&&typeof D==`string`&&(D=ne(``)));B&&B(e),lt=e},kt=K({},[...Bt,...Vt,...Ht]),At=K({},[...Ut,...Wt]),jt=function(e,t,n){return t.namespaceURI===Ye?e===`svg`:t.namespaceURI===qe?e===`svg`&&(n===`annotation-xml`||tt[n]):!!kt[e]},G=function(e,t,n){return t.namespaceURI===Ye?e===`math`:t.namespaceURI===Je?e===`math`&&it[n]:!!At[e]},Nt=function(e,t,n){return t.namespaceURI===Je&&!it[n]||t.namespaceURI===qe&&!tt[n]?!1:!At[e]&&(at[e]||!kt[e])},Pt=function(e){let t=T(e),n=xt(ee(e)),r=_(e),i,a;return r&&C(r)===J.element?(i={namespaceURI:T(r)},a=xt(ee(r))):(i={namespaceURI:Xe},a=`template`),Qe[t]?t===Je?jt(n,i,a):t===qe?G(n,i,a):t===Ye?Nt(n,i,a):!!(ot===`application/xhtml+xml`&&Qe[t]):!1},vn=function(e){mt(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Mt(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},bn=function(e){Y(e);let t=g(e);t&&dt(ht(t),e=>{try{p(e)}catch{}});let n=C(e)===J.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&yn(e,r,i)}},xn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}mt(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Me||Ne)try{vn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Sn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||L[H(i)]||yn(e,r,i)}},Cn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===J.element){let t=v(e);Ln(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Y=function(e){Cn(e,e=>{C(e)===J.element&&Sn(e)})},wn=function(e){let t=[];return Cn(e,e=>{t.push(e)},!0),t},X=function(e,t){let n=vt();dt(wn(e),e=>{C(e)===J.element&&yt(n,e)}),dt(t,e=>{C(e)===J.element&&!bt(n,e)&&Sn(e)})},Tn=function(e,n){let r=!1;return dt(t.removed,t=>{t.element&&(r||=t.element===e,Y(t.element))}),X(e,n),r},En=function(e,t){let n=Be,r=null,i=()=>(r||(r=vt(),dt(t,e=>{yt(r,e)})),r);for(let t=0;;t++){let r=wn(e),a=[e],o=!1;if(dt(r,e=>{C(e)===J.documentFragment?mt(a,e):!o&&!bt(n,e)&&(o=bt(i(),e))}),!o)return;if(t>=8)throw Mt(`the tree kept changing during in-place sanitization; refusing to return it`);dt(a,(t,n)=>{Dn(t,n>0,e,i())})}},Dn=function(e,t,n,r){let i=Mn(e),a;for(;a=i.nextNode();)bt(r,a)&&!bt(Be,a)&&(t&&Z(P.uponSanitizeShadowNode,a,null),Wn(a,n),Zn(a,n),Ln(a.content)&&Q(a.content))},On=function(e){Be&&yt(Be,e)},kn=function(e,t){return Ee?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},An=function(e){Ee&&Cn(e,e=>{let t=C(e);if(t===J.processingInstruction||t===J.comment&&W(cn,e.data)){try{p(e)}catch{}return!1}if(t===J.element){let t=e,n=H(ee(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&kn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},jn=function(e){let t=null,r=null;if(je)e=`<remove></remove>`+e;else{let t=Ct(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Xe===Ye&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=E?ne(e):e;if(Xe===Ye)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ae.createDocument(Xe,`template`,null);try{t.documentElement.innerHTML=Ze?D:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Xe===Ye?M.call(t,De?`html`:`body`)[0]:De?t.documentElement:a},Mn=function(e){let t=S?S(e):e.ownerDocument;return oe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nn=function(e){return e=wt(e,ce,` `),e=wt(e,le,` `),e=wt(e,ue,` `),e},Pn=function(e){Fn(e);let t=e.querySelectorAll?.call(e,`template`);t&&dt(t,e=>{Ln(e.content)&&Pn(e.content)})},Fn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=oe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nn(r.data),r=n.nextNode()},In=function(e){let t=x?x(e):null;return typeof t!=`string`||H(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Ln=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===J.documentFragment}catch{return!1}},Rn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Z(e,n,r){e.length!==0&&dt(e,e=>{e.call(t,n,r,lt)})}let zn=function(e,t){return!!(Ee&&e.hasChildNodes()&&!Rn(e.firstElementChild)&&W(sn,e.textContent)&&W(sn,e.innerHTML)||Ee&&dn[t]&&C(e)===J.element&&T(e)===Ye&&(Rn(e.firstElementChild)||typeof e.textContent==`string`&&W(sn,e.textContent))||e.nodeType===J.processingInstruction||Ee&&e.nodeType===J.comment&&W(cn,e.data))},Bn=function(e,t){return e instanceof RegExp?W(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Vn=function(e,t,n){if(!ve[t]&&qn(t)&&Bn(R.tagNameCheck,t))return!1;if(Re&&!He[t]&&!He[xt(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return vn(e),!0},Hn=function(e,t,n,r){return e.length===0?t:t===n||t===r?q(t):t},Un=function(e,t){return e===t||_(e)!==null?!1:(ze&&Y(e),!0)},Wn=function(e,n){if(On(e),Z(P.beforeSanitizeElements,e,null),Un(e,n))return!0;if(In(e))return vn(e),!0;let r=H(ee(e));if(I=Hn(P.uponSanitizeElement,I,ge,ke),Z(P.uponSanitizeElement,e,{tagName:r,allowedTags:I}),Un(e,n))return!0;if(zn(e,r))return vn(e),!0;if(ve[r]||!(be.tagCheck instanceof Function&&be.tagCheck(r))&&!I[r]){let t=Vn(e,r,n);return t===!1&&(Z(P.afterSanitizeElements,e,null),Un(e,n))?!0:t}if(C(e)===J.element&&!Pt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&W(ln,e.innerHTML))return vn(e),!0;if(Te&&e.nodeType===J.text){let n=Nn(e.textContent);e.textContent!==n&&(mt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Z(P.afterSanitizeElements,e,null),Un(e,n)},Gn=function(e,t,r){if(ye[t]||kn(t,e)||Fe&&(t===`id`||t===`name`)&&(r in n||r in ut))return!1;let i=L[t]||be.attributeCheck instanceof Function&&be.attributeCheck(t,e);return Se&&W(de,t)||xe&&W(fe,t)?!0:i?z[t]||W(he,wt(r,pe,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Tt(r,`data:`)===0&&We[e]||Ce&&!W(F,wt(r,pe,``))?!0:!r:qn(e)&&Bn(R.tagNameCheck,e)&&Bn(R.attributeNameCheck,t,e)||t===`is`&&R.allowCustomizedBuiltInElements&&Bn(R.tagNameCheck,r)},Kn=K({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),qn=function(e){return!Kn[xt(e)]&&W(me,e)},Jn=function(e,t,n,r){if(E&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ne(r);case`TrustedScriptURL`:return re(r)}return r},Yn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!In(e)||(vn(e),!1)}catch{return xn(t,e),!1}},Xn=function(e,t){return Ee&&W(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:xt(e)===`attributename`&&Ct(t,`href`)!==null},Zn=function(e,n){if(Z(P.beforeSanitizeAttributes,e,null),Un(e,n))return;let r=e.attributes;if(!r||In(e))return;L=Hn(P.uponSanitizeAttribute,L,_e,Ae);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},a=r.length,o=H(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=H(s),d=l,f=s===`value`?d:Et(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Z(P.uponSanitizeAttribute,e,i),f=i.attrValue,Ie&&(u===`id`||u===`name`)&&Tt(f,Le)!==0&&(xn(s,e,n),f=Le+f,p=!0),Xn(s,f)?xn(s,e,n):i.forceKeepAttr||(i.keepAttr?!we&&W(un,f)?xn(s,e,n):(Te&&(f=Nn(f)),Gn(o,u,f)?(f=Jn(o,u,c,f),f!==d&&Yn(e,s,c,f)&&p&&pt(t.removed)):xn(s,e,n)):xn(s,e,n))}Z(P.afterSanitizeAttributes,e,null),Un(e,n)},Q=function(e){let t=null,n=Mn(e);for(Z(P.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Z(P.uponSanitizeShadowNode,t,null),Wn(t,e),Zn(t,e),Ln(t.content)&&Q(t.content),C(t)===J.element){let e=v(t);Ln(e)&&(Qn(e),Q(e))}Te&&Fn(e),Z(P.afterSanitizeShadowDOM,e,null)},Qn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Q(e.shadow);continue}let n=e.node,r=C(n)===J.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&H(e)===`template`){let e=n.content;Ln(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Ln(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!Rn(e)&&(e=Ft(e),typeof e!=`string`))throw Mt(`dirty is not a string, aborting`);if(!t.isSupported)return e;Oe?(I=ke,L=Ae):Ot(n),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(I=q(I)),P.uponSanitizeAttribute.length>0&&(L=q(L)),t.removed=[];let c=ze&&typeof e!=`string`&&Rn(e),l=[],u=Be;if(c){An(e);let t=ee(e);if(typeof t==`string`){let n=H(t);if(!I[n]||ve[n])throw bn(e),Mt(`root node is forbidden and cannot be sanitized in-place`)}if(In(e))throw bn(e),Mt(`root node is clobbered and cannot be sanitized in-place`);l=wn(e),Be=vt()}else if(Rn(e))i=jn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===J.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Qn(i);else{if(!Me&&!Te&&!De&&e.indexOf(`<`)===-1)return E&&Pe?ne(e):e;if(i=jn(e),!i)return Me?null:Pe?D:``}i&&je&&vn(i.firstChild);let d=c?e:i;try{c&&Qn(e);let t=Mn(d);for(;o=t.nextNode();)Wn(o,d),Zn(o,d),Ln(o.content)&&Q(o.content);c&&En(e,l)}catch(t){throw c&&(bn(e),Tn(e,l)),t}finally{Be=u}if(c){if(Tn(e,l))throw Mt(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Te&&Pn(e),e}if(Me){if(Te&&Pn(i),Ne)for(s=se.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=N.call(r,s,!0)),s}let f=De?i.outerHTML:i.innerHTML;return De&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&W(an,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
- `+f),Te&&(f=Nn(f)),E&&Pe?ne(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ot(e),Oe=!0,ke=I,Ae=L},t.clearConfig=function(){lt=null,Oe=!1,ke=null,Ae=null,E=O,D=``},t.isValidAttribute=function(e,t,n){lt||Ot({});let r=H(e),i=H(t);return typeof n==`string`&&(Xn(t,n)||!we&&W(un,n))?!1:Gn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&U(P,e)&&mt(P[e],t)},t.removeHook=function(e,t){if(U(P,e)){if(t!==void 0){let n=ft(P[e],t);return n===-1?void 0:gt(P[e],n,1)[0]}return pt(P[e])}},t.removeHooks=function(e){U(P,e)&&(P[e]=[])},t.removeAllHooks=function(){P=mn()},t}var vn=_n();function yn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bn=yn();function xn(e){bn=e}var Sn={exec:()=>null};function Cn(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(X.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var wn=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),X={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}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/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:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Cn(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Cn(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Cn(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Cn(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Cn(e=>RegExp(`^ {0,${e}}(?:</?(?:${Z})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:Cn(e=>RegExp(`^ {0,${e}}>`))},Tn=/^(?:[ \t]*(?:\n|$))+/,En=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Dn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,On=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,An=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mn=Y(jn).replace(/bull/g,An).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(),Nn=Y(jn).replace(/bull/g,An).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(),Pn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Fn=/^[^\n]+/,In=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ln=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,In).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rn=Y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,An).getRegex(),Z=`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`,zn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bn=Y(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,zn).replace(`tag`,Z).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vn=e=>Y(Pn).replace(`hr`,On).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`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Z).getRegex(),Hn=Vn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Un=Vn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Wn={blockquote:Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Un).getRegex(),code:En,def:Ln,fences:Dn,heading:kn,hr:On,html:Bn,lheading:Mn,list:Rn,newline:Tn,paragraph:Hn,table:Sn,text:Fn},Gn=Y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,On).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`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Z).getRegex(),Kn={...Wn,lheading:Nn,table:Gn,paragraph:Y(Pn).replace(`hr`,On).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Gn).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Z).getRegex()},qn={...Wn,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,zn).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:Sn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(Pn).replace(`hr`,On).replace(`heading`,` *#{1,6} *[^
4
- ]`).replace(`lheading`,Mn).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Jn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Yn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Zn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Q=/[\p{P}\p{S}]/u,Qn=/[\s\p{P}\p{S}]/u,$n=/[^\s\p{P}\p{S}]/u,er=Y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Qn).getRegex(),tr=/[\p{Pi}\p{Ps}"']/u,nr=/(?!~)[\p{P}\p{S}]/u,rr=/(?!~)[\s\p{P}\p{S}]/u,ir=/(?:[^\s\p{P}\p{S}]|~)/u,ar=Y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,wn?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),or=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,sr=Y(or,`u`).replace(/punct/g,Q).getRegex(),cr=Y(or,`u`).replace(/punct/g,nr).getRegex(),lr=Y(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,tr).replace(/punct/g,Q).getRegex(),ur=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,dr=Y(ur,`gu`).replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Qn).replace(/punct/g,Q).getRegex(),fr=Y(ur,`gu`).replace(/notPunctSpace/g,ir).replace(/punctSpace/g,rr).replace(/punct/g,nr).getRegex(),pr=Y(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Qn).replace(/punct/g,Q).getRegex(),mr=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Qn).replace(/punct/g,Q).getRegex(),hr=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Qn).replace(/punct/g,Q).getRegex(),gr=Y(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Q).getRegex(),_r=Y(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,$n).replace(/punctSpace/g,Qn).replace(/punct/g,Q).getRegex(),vr=Y(/\\(punct)/,`gu`).replace(/punct/g,Q).getRegex(),yr=Y(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,Q).getRegex(),br=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xr=Y(zn).replace(`(?:-->|$)`,`-->`).getRegex(),Sr=Y(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,xr).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Cr=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,wr=Y(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Cr).getRegex(),Tr=Y(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,wr).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Er=Y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,wr).replace(`ref`,In).getRegex(),Dr=Y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,In).getRegex(),Or=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,kr=Y(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Cr).getRegex(),Ar=Y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,kr).replace(`ref`,Or).getRegex()).replace(`nolink`,Y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Or).getRegex()).getRegex(),jr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mr=Y(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),Nr={_backpedal:Sn,anyPunctuation:vr,anyPunctuationOutsideCode:yr,autolink:br,blockSkip:ar,br:Xn,code:Yn,del:Sn,delLDelim:Sn,delRDelim:Sn,emStrongLDelim:sr,emStrongRDelimAst:dr,emStrongRDelimUnd:mr,escape:Jn,link:Tr,nolink:Dr,punctuation:er,reflink:Er,reflinkSearch:Ar,tag:Sr,text:Zn,url:Sn},Pr={...Nr,emStrongLDelim:lr,emStrongRDelimAst:pr,emStrongRDelimUnd:hr,link:Y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,wr).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,wr).getRegex()},Fr={...Nr,emStrongRDelimAst:fr,emStrongLDelim:cr,delLDelim:gr,delRDelim:_r,url:Y(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Mr).replace(`protocol`,jr).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,jr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Ir={...Fr,br:Y(Xn).replace(`{2,}`,`*`).getRegex(),text:Y(Fr.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Lr={normal:Wn,gfm:Kn,pedantic:qn},Rr={normal:Nr,gfm:Fr,breaks:Ir,pedantic:Pr},zr={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Br=e=>zr[e];function Vr(e,t){if(t){if(X.escapeTest.test(e))return e.replace(X.escapeReplace,Br)}else if(X.escapeTestNoEncode.test(e))return e.replace(X.escapeReplaceNoEncode,Br);return e}function Hr(e){return X.numericCharacterReference.test(e)?e.replace(X.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function Ur(e){try{e=encodeURI(e).replace(X.percentDecode,`%`)}catch{return null}return e}function Wr(e,t){let n=e.replace(X.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(X.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(X.slashPipe,`|`);return n}function Gr(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Kr(e){let t=e.split(`
5
- `),n=t.length-1;for(;n>=0&&X.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
6
- `)}function qr(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Jr(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Yr(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Xr(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Zr(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
7
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
8
- `)}function Qr(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var $r=class{options;rules;lexer;constructor(e){this.options=e||bn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Kr(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Zr(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Gr(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Gr(t[0],`
9
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Gr(t[0],`
10
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Gr(t[0],`
11
- `).split(`
12
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
13
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
14
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
15
- ${s}`:s,r=r?`${r}
16
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
17
- `),o=t.raw+`
18
- `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
19
- `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
20
- ${d.join(`
21
- `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
22
- `+e.join(`
23
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
24
- `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
25
- `,1)[0],d=t[1].length,f=this.options.pedantic?Yr(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Yr(e,d)),p=e.split(`
26
- `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
27
- `,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>Yr(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
28
- `+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
29
- `+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Kr(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Jr(t[2],`()`)!==-1)return;let e=qr(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Gr(t[0],`
30
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Wr(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
31
- `):[],a={type:`table`,raw:Gr(t[0],`
32
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Wr(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Gr(t[0],`
33
- `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
34
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Qr(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Gr(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Jr(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Xr(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Qr(e,n[1],r,this.rules))return;let i=t[qr((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Xr(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Hr(t[0]),escaped:e}}}},ei=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||bn,this.options.tokenizer=this.options.tokenizer||new $r,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 t={other:X,block:Lr.normal,inline:Rr.normal};this.options.pedantic?(t.block=Lr.pedantic,t.inline=Rr.pedantic):this.options.gfm&&(t.block=Lr.gfm,t.inline=this.options.breaks?Rr.breaks:Rr.gfm),this.tokenizer.rules=t}static get rules(){return{block:Lr,inline:Rr}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(X.carriageReturn,`
35
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(X.tabCharGlobal,` `).replace(X.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(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
36
- `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
37
- `)?``:`
38
- `)+i.raw,n.text+=`
39
- `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
40
- `)?``:`
41
- `)+i.raw,n.text+=`
42
- `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
43
- `)?``:`
44
- `)+i.raw,r.text+=`
45
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
46
- `)?``:`
47
- `)+i.raw,n.text+=`
48
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,qr(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,qr(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ti=class{options;parser;constructor(e){this.options=e||bn}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(X.notSpaceStart)?.[0],i=e?e.replace(X.endingNewline,``)+`
49
- `:``;return r?`<pre><code class="language-`+Vr(r)+`">`+(n?i:Vr(i,!0))+`</code></pre>
50
- `:`<pre><code>`+(n?i:Vr(i,!0))+`</code></pre>
51
- `}blockquote({tokens:e}){return`<blockquote>
52
- ${this.parser.parse(e)}</blockquote>
53
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
54
- `}hr(e){return`<hr>
55
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
56
- `+r+`</`+i+`>
57
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
58
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
59
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
60
- <thead>
61
- `+t+`</thead>
62
- `+r+`</table>
63
- `}tablerow({text:e}){return`<tr>
64
- ${e}</tr>
65
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
66
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Vr(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Vr(n,!0):this.parser.parseInline(r),o=Ur(e);if(o===null)return a;e=Vr(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Vr(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ur(e);if(i===null)return Vr(n);e=i;let a=`<img src="${Vr(e)}" alt="${Vr(n)}"`;return t&&(a+=` title="${Vr(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Vr(e.text)}},ni=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ri=class e{options;renderer;textRenderer;constructor(e){this.options=e||bn,this.options.renderer=this.options.renderer||new ti,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ni}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ii=class{options;block;constructor(e){this.options=e||bn}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ei.lex:ei.lexInline}provideParser(e=this.block){return e?ri.parse:ri.parseInline}};function ai(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var oi=new class{defaults=yn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ri;Renderer=ti;TextRenderer=ni;Lexer=ei;Tokenizer=$r;Hooks=ii;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(ai(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)ai(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)ai(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;ai(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);ai(n,this.walkTokens(i,t))}):e.tokens&&ai(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ti(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $r(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ii;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ii.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ii.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&ai(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ei.lex(e,t??this.defaults)}parser(e,t){return ri.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?ei.lex:ei.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ri.parse:ri.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ei.lex:ei.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ri.parse:ri.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
67
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Vr(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return oi.parse(e,t)}$.options=$.setOptions=function(e){return oi.setOptions(e),$.defaults=oi.defaults,xn($.defaults),$},$.getDefaults=yn,$.defaults=bn;function si(...e){return oi.use(...e),$.defaults=oi.defaults,xn($.defaults),$}$.use=si,$.walkTokens=function(e,t){return oi.walkTokens(e,t)},$.parseInline=oi.parseInline,$.Parser=ri,$.parser=ri.parse,$.Renderer=ti,$.TextRenderer=ni,$.Lexer=ei,$.lexer=ei.lex,$.Tokenizer=$r,$.Hooks=ii,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,ri.parse,ei.lex;function ci(e){let t=/^\uFEFF?---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(e);return t?{frontmatter:t[1],body:e.slice(t[0].length)}:{frontmatter:null,body:e}}function li(e){let{projectId:t,sourceId:n,story:r,onClose:i}=e,[a,o]=R(null),[s,c]=R(null),[l,u]=R(!1),d=be(null),f=be(null);ye(()=>{let e=!0;return o(null),c(null),Ie.story(t,n,r.key).then(t=>e&&o(t),t=>e&&c(t instanceof Error?t.message:String(t))),()=>{e=!1}},[t,n,r.key]),ye(()=>{let e=document.activeElement;f.current?.focus();let t=e=>{if(e.key===`Escape`)e.preventDefault(),i();else if(e.key===`Tab`&&d.current){let t=[...d.current.querySelectorAll(`button, a[href], [tabindex]:not([tabindex="-1"])`)];if(t.length===0)return;let n=t[0],r=t[t.length-1];d.current.contains(document.activeElement)?e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()):(e.preventDefault(),n.focus())}};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t),e?.focus()}},[i]);let p=async()=>{if(a?.path)try{await navigator.clipboard.writeText(a.path),u(!0),setTimeout(()=>u(!1),1500)}catch{u(!1)}},m=a?ci(a.markdown):null,h=m?vn.sanitize($.parse(m.body,{async:!1})):``;return z(`div`,{class:`backdrop`,onClick:e=>e.target===e.currentTarget&&i(),children:z(`div`,{class:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`detail-title`,ref:d,children:[z(`header`,{class:`modal-head`,children:[z(`h2`,{id:`detail-title`,children:[z(`span`,{class:`card-id`,children:r.id}),` `,r.title]}),z(`button`,{type:`button`,class:`icon-btn`,ref:f,onClick:i,"aria-label":`Close`,children:`×`})]}),z(`div`,{class:`modal-path`,children:a===null?null:a.path===null?z(`span`,{class:`muted`,children:`No file yet`}):z(v,{children:[z(`code`,{title:a.path,children:a.path}),z(`button`,{type:`button`,class:`small-btn`,onClick:p,children:l?`Copied`:`Copy path`})]})}),z(`div`,{class:`modal-body`,children:[s!==null&&z(`p`,{class:`notice error`,children:s}),a===null&&s===null&&z(`p`,{class:`muted`,children:`Loading…`}),m?.frontmatter&&z(`pre`,{class:`frontmatter`,children:m.frontmatter}),a!==null&&z(`div`,{class:`markdown`,dangerouslySetInnerHTML:{__html:h}})]})]})})}var ui=e=>new Map(e.epics.map((e,t)=>[e.id,{epic:e,index:t}])),di=e=>Le.filter(t=>e||t!==`dropped`);function fi(e){let{board:t}=e,n=Be(t.stories,e.showDropped,e.epicFilter),r=ui(t);return z(`div`,{class:`columns`,children:di(e.showDropped).map(i=>z(`section`,{class:`column col-${i}`,"aria-label":Re[i],children:[z(`h3`,{class:`col-head`,children:[Re[i],` · `,n[i].length]}),n[i].map(n=>z(Je,{story:n,showEpic:!0,epic:n.epicId===null?null:r.get(n.epicId)??null,onOpen:n=>e.onOpen(n,t.sourceId)},n.key))]},i))})}var pi=e=>e.sources.length>1||e.sources.some(e=>(e.children?.length??0)>0);function mi({onAdded:e}){let[t,n]=R(!1),[r,i]=R(``),[a,o]=R(null),[s,c]=R(!1),l=()=>{n(!1),i(``),o(null)};return t?z(`form`,{class:`add-form`,onSubmit:async t=>{if(t.preventDefault(),r.trim()!==``){c(!0),o(null);try{let t=await Ie.addProject(r.trim());l(),e(t)}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}}},children:[z(`label`,{for:`add-path`,class:`sr-only`,children:`Project folder path`}),z(`input`,{id:`add-path`,type:`text`,placeholder:`/path/to/project`,value:r,autoFocus:!0,onInput:e=>i(e.target.value),onKeyDown:e=>e.key===`Escape`&&l()}),z(`div`,{class:`add-actions`,children:[z(`button`,{type:`submit`,class:`small-btn primary`,disabled:s,children:`Add`}),z(`button`,{type:`button`,class:`small-btn`,onClick:l,children:`Cancel`})]}),a!==null&&z(`p`,{class:`add-error`,role:`alert`,children:a})]}):z(`button`,{type:`button`,class:`add-btn`,onClick:()=>n(!0),children:`+ Add project`})}function hi(e){let{project:t,source:n,selected:r}=e;return z(`li`,{children:[z(`button`,{type:`button`,class:`source${r===n.id?` on`:``}`,"aria-current":r===n.id?`true`:void 0,onClick:()=>e.onSelect(t.id,n.id),children:[z(`span`,{class:`source-label`,children:n.label}),z(`span`,{class:`count`,children:n.count})]}),n.children&&n.children.length>0&&z(`ul`,{class:`sources nested`,children:n.children.map(n=>z(hi,{project:t,source:n,selected:r,onSelect:e.onSelect},n.id))})]})}function gi(e){return z(`nav`,{class:`sidebar`,"aria-label":`Projects`,children:[z(`div`,{class:`sidebar-head`,children:z(`span`,{class:`brand`,children:`BMAD Kanban`})}),z(mi,{onAdded:e.onAdded}),z(`ul`,{class:`projects`,children:e.projects.map(t=>{let n=t.id===e.selectedId;return z(`li`,{class:`project${n?` on`:``}${t.missing?` missing`:``}`,children:[z(`div`,{class:`project-row`,children:[z(`button`,{type:`button`,class:`project-btn`,"aria-current":n?`true`:void 0,title:t.path,onClick:()=>e.onSelectProject(t.id),children:[z(`span`,{class:`project-name`,children:t.name}),t.tags.map(e=>z(`span`,{class:`tag`,children:e},e))]}),z(`button`,{type:`button`,class:`icon-btn remove`,"aria-label":`Remove ${t.name} from the list`,title:`Remove from list`,onClick:()=>e.onRemove(t),children:`×`})]}),t.missing&&z(`div`,{class:`project-note`,children:`folder not found`}),t.error!==void 0&&z(`div`,{class:`project-note error`,title:t.error,children:[`config error: `,t.error]}),!t.missing&&pi(t)&&z(`ul`,{class:`sources`,children:t.sources.map(r=>z(hi,{project:t,source:r,selected:n?e.sourceId:null,onSelect:e.onSelectSource},r.id))})]},t.id)})}),e.projects.length===0&&z(`p`,{class:`muted empty`,children:`No projects yet.`})]})}function _i(e){let{board:t}=e,n=di(e.showDropped),r=Ve(t,e.showDropped),i=ui(t);return z(`div`,{class:`lanes`,style:{gridTemplateColumns:`minmax(140px, 180px) repeat(${n.length}, minmax(140px, 1fr))`},children:[z(`div`,{class:`lane-corner`}),n.map(e=>z(`h3`,{class:`col-head`,children:Re[e]},e)),r.map(r=>{let a=r.epic?i.get(r.epic.id):void 0,o=r.total===0?0:Math.round(r.done/r.total*100);return[z(`div`,{class:`lane-head`,style:{borderLeftColor:a?Ue(a.index):`var(--muted)`},children:[z(`div`,{class:`lane-title`,children:r.epic?z(v,{children:[r.epic.id,` `,r.epic.title]}):`No epic`}),z(`div`,{class:`lane-meta`,children:[r.epic?.status&&z(`span`,{children:r.epic.status}),r.epic?.retrospective===`done`&&z(`span`,{class:`retro-tag`,children:`✓ retro`}),z(`span`,{children:[r.done,`/`,r.total,` done`]})]}),z(`div`,{class:`bar`,role:`progressbar`,"aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${r.done} of ${r.total} done`,children:z(`i`,{style:{width:`${o}%`}})})]},`h-${r.epic?.id??`-`}`),...n.map(n=>z(`div`,{class:`cell`,children:r.cells[n].map(n=>z(Je,{story:n,showEpic:!1,epic:a??null,onOpen:n=>e.onOpen(n,t.sourceId)},n.key))},`${r.epic?.id??`-`}-${n}`))]})]})}var vi=e=>e.flatMap(e=>[e,...vi(e.children??[])]);function yi(e,t){let n=new Set(vi(e.sources).map(e=>e.id));for(let r of[t,e.prefs?.sourceId,e.defaultSourceId])if(r&&n.has(r))return r;return e.sources[0]?.id??null}var bi=e=>e.children&&e.children.length>0?e.children:[e],xi=e=>[e,...e.children??[]].some(e=>e.stories.some(e=>e.column===`dropped`)),Si=e=>e instanceof Error?e.message:String(e);function Ci(e){let{board:t,view:n}=e,r=t=>z(v,{children:[t.notices.map((e,t)=>z(`div`,{class:`notice ${e.level}`,role:e.level===`error`?`alert`:void 0,children:e.text},t)),t.stories.length===0?z(`p`,{class:`muted empty`,children:`No stories in this board yet.`}):n===`columns`?z(fi,{board:t,showDropped:e.showDropped,epicFilter:e.epicFilter,onOpen:e.onOpen}):z(_i,{board:t,showDropped:e.showDropped,onOpen:e.onOpen})]});return!t.children||t.children.length===0?r(t):z(v,{children:[t.notices.map((e,t)=>z(`div`,{class:`notice ${e.level}`,children:e.text},t)),t.children.map(e=>z(`section`,{class:`child-board`,"aria-label":e.label,children:[z(`h2`,{class:`child-title`,children:e.label}),r(e)]},e.sourceId))]})}function wi(){let[e,t]=R(null),[n,r]=R(null),[i,a]=R(null),[o,s]=R(null),[c,l]=R(`columns`),[u,d]=R(!1),[f,p]=R(null),[m,h]=R(null),[g,_]=R(0),[y,b]=R(null),x=be(null);x.current=i;let S=be(!1),C=e?.find(e=>e.id===i)??null,ee=Se(()=>b(null),[]),w=Se((e,t)=>{a(e.id),s(yi(e,t)),l(e.prefs?.view??`columns`),d(e.prefs?.showDropped??!1),p(null),b(null);let n=new URL(location.href);n.searchParams.set(`project`,e.id),history.replaceState(null,``,n),Ie.setLastViewed(e.id).catch(()=>{})},[]),T=Se((e,n)=>{t(t=>t&&t.map(t=>t.id===e?{...t,prefs:{...t.prefs??{view:`columns`,showDropped:!1,sourceId:null},...n}}:t)),Ie.setPrefs(e,n).catch(()=>{})},[]),E=Se(async()=>{try{let e=await Ie.projects();t(e),r(null);let n=e.find(e=>e.id===x.current);S.current&&(n?s(e=>yi(n,e)):e.length>0?w(e[0]):(a(null),s(null)))}catch(e){r(Si(e))}},[w]);ye(()=>{(async()=>{try{let[e,n]=await Promise.all([Ie.projects(),Ie.state().catch(()=>({lastViewed:null}))]);t(e);let r=[new URLSearchParams(location.search).get(`project`),n.lastViewed].map(t=>e.find(e=>e.id===t)).find(e=>e!==void 0)??e[0];S.current=!0,r&&w(r)}catch(e){S.current=!0,r(Si(e))}})()},[w]),ye(()=>{let e=new EventSource(`/api/events`);e.addEventListener(`change`,e=>{try{let{projectId:t}=JSON.parse(e.data);if(t!==x.current)return}catch{return}_(e=>e+1),E()}),e.addEventListener(`projects`,()=>void E());let t=!1;return e.addEventListener(`open`,()=>{t&&(_(e=>e+1),E()),t=!0}),()=>e.close()},[E]);let D=C?.missing??!1,O=i&&o?`${i}\u0000${o}`:null;ye(()=>{if(!i||!o||!O||D)return;let e=!0;return Ie.board(i,o).then(t=>e&&h({key:O,board:t,error:null}),t=>{e&&(t instanceof je&&t.status===410&&E(),h({key:O,board:null,error:Si(t)}))}),()=>{e=!1}},[i,o,O,D,g,E]);let k=m!==null&&m.key===O?m:null,A=k?.board??null,te=k?.error??null,ne=t=>{let n=e?.find(e=>e.id===t);n&&t!==i&&w(n)},re=(t,n)=>{let r=e?.find(e=>e.id===t);r&&(t===i?(s(n),p(null)):w(r,n),T(t,{sourceId:n}))},ie=e=>{t(t=>t?[...t.filter(t=>t.id!==e.id),e]:[e]),w(e)},j=async e=>{if(confirm(`Remove "${e.name}" from the list? The folder is not touched.`)){try{await Ie.removeProject(e.id)}catch{}await E()}},ae=e=>{l(e),i&&T(i,{view:e})},oe=e=>{d(e),i&&T(i,{showDropped:e})},se=A?bi(A):[],M=[],N=new Set;for(let e of se)e.epics.forEach((e,t)=>{N.has(e.id)||(N.add(e.id),M.push({epic:e,index:t}))});let P=f!==null&&N.has(f)?f:null,ce=A?xi(A):!1,le=C?vi(C.sources).find(e=>e.id===o):void 0;return z(`div`,{class:`app`,children:[z(gi,{projects:e??[],selectedId:i,sourceId:o,onSelectProject:ne,onSelectSource:re,onAdded:ie,onRemove:j}),z(`main`,{class:`main`,children:[n!==null&&z(`div`,{class:`notice error`,role:`alert`,children:[`Could not reach the server: `,n]}),e!==null&&e.length===0&&z(`div`,{class:`placeholder`,children:[z(`h1`,{children:`No projects yet`}),z(`p`,{children:[`Add a BMAD project folder with “+ Add project”, or run `,z(`code`,{children:`npx bmad-kanban`}),` inside one.`]})]}),C&&z(v,{children:[z(`header`,{class:`board-head`,children:[z(`h1`,{class:`board-title`,children:[C.name,(A?.label??le?.label)&&z(`span`,{class:`board-source`,children:[` / `,A?.label??le?.label]})]}),!C.missing&&A&&z(`div`,{class:`controls`,children:[z(`div`,{class:`toggle`,role:`group`,"aria-label":`Board view`,children:[z(`button`,{type:`button`,"aria-pressed":c===`columns`,class:c===`columns`?`on`:``,onClick:()=>ae(`columns`),children:`Columns`}),z(`button`,{type:`button`,"aria-pressed":c===`swimlanes`,class:c===`swimlanes`?`on`:``,onClick:()=>ae(`swimlanes`),children:`Swimlanes`})]}),ce&&z(`label`,{class:`switch`,children:[z(`input`,{type:`checkbox`,checked:u,onChange:e=>oe(e.target.checked)}),z(`span`,{children:`Show dropped`})]})]})]}),c===`columns`&&A&&M.length>0&&z(`div`,{class:`filters`,role:`group`,"aria-label":`Filter by epic`,children:[z(`span`,{class:`filters-label`,children:`Epics:`}),z(`button`,{type:`button`,class:`filter${P===null?` on`:``}`,"aria-pressed":P===null,onClick:()=>p(null),children:`All`}),M.map(e=>z(`button`,{type:`button`,class:`filter${P===e.epic.id?` on`:``}`,"aria-pressed":P===e.epic.id,onClick:()=>p(e.epic.id),children:[z(Ke,{info:e}),` `,e.epic.title]},e.epic.id))]}),z(`div`,{class:`board`,children:C.missing?z(`div`,{class:`placeholder`,children:[z(`h2`,{children:`Folder not found`}),z(`p`,{children:[z(`code`,{children:C.path}),` no longer exists.`]})]}):C.error!==void 0&&C.sources.length===0?z(`div`,{class:`notice error`,children:[`Could not read this project's BMAD config: `,C.error]}):o===null?z(`p`,{class:`muted empty`,children:`No boards found in this project yet.`}):te===null?A===null?z(`p`,{class:`muted empty`,children:`Loading…`}):z(Ci,{board:A,view:c,showDropped:u&&ce,epicFilter:P,onOpen:(e,t)=>b({story:e,sourceId:t})}):z(`div`,{class:`notice error`,role:`alert`,children:te})})]})]}),y&&C&&z(li,{projectId:C.id,sourceId:y.sourceId,story:y.story,onClose:ee})]})}se(z(wi,{}),document.getElementById(`app`));