@blinkk/root-cms 1.4.9 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.js CHANGED
@@ -7,7 +7,7 @@ import { render as renderToString } from "preact-render-to-string";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@blinkk/root-cms",
10
- version: "1.4.9",
10
+ version: "1.4.11",
11
11
  author: "s@blinkk.com",
12
12
  license: "MIT",
13
13
  engines: {
@@ -140,7 +140,7 @@ var package_default = {
140
140
  vitest: "0.34.6"
141
141
  },
142
142
  peerDependencies: {
143
- "@blinkk/root": "1.4.9",
143
+ "@blinkk/root": "1.4.11",
144
144
  "firebase-admin": ">=11",
145
145
  "firebase-functions": ">=4",
146
146
  preact: ">=10",
package/dist/ui/ui.js CHANGED
@@ -50,7 +50,7 @@ Content-Type: `+c.contentType+`\r
50
50
  `).map(d=>({level:d.match(/^\s+/)?.[0]?.length||0,type:"remove",text:d.replace(/^\s+/,"").replace(/,$/g,""),comma:d.endsWith(",")})),n=Ur(r,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split(`
51
51
  `).map(d=>({level:d.match(/^\s+/)?.[0]?.length||0,type:"add",text:d.replace(/^\s+/,"").replace(/,$/g,""),comma:d.endsWith(",")}));let c=o.length,u=n.length;o=Ot(o,Array(u).fill(0).map(()=>({...Pb}))),n=Ot(n,Array(c).fill(0).map(()=>({...Pb})),!0)}else a==="object"?([o,n]=Ab(e,r,1,this.options,this.arrayDiffFunc),o.unshift({...EU}),o.push({...SU}),n.unshift({...EU}),n.push({...SU})):a==="array"?[o,n]=this.arrayDiffFunc(e,r,"","",0,this.options):e!==r?this.options.ignoreCase?typeof e=="string"&&typeof r=="string"&&e.toLowerCase()===r.toLowerCase()&&(o=[{level:0,type:"equal",text:e}],n=[{level:0,type:"equal",text:r}]):this.options.showModifications?(o=[{level:0,type:"modify",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],n=[{level:0,type:"modify",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(o=[{level:0,type:"remove",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)},{...Pb}],n=[{...Pb},{level:0,type:"add",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(o=[{level:0,type:"equal",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],n=[{level:0,type:"equal",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]);return this.sortResultLines(o,n),this.calculateLineNumbers(o),this.calculateLineNumbers(n),this.calculateCommas(o),this.calculateCommas(n),[o,n]}constructor({detectCircular:e=!0,maxDepth:r=1/0,showModifications:o=!0,arrayDiffMethod:n="normal",ignoreCase:a=!1,ignoreCaseForKey:i=!1,recursiveEqual:s=!1,preserveKeyOrder:l,undefinedBehavior:c="stringify"}={}){this.options={detectCircular:e,maxDepth:r,showModifications:o,arrayDiffMethod:n,ignoreCase:a,ignoreCaseForKey:i,recursiveEqual:s,preserveKeyOrder:l,undefinedBehavior:c},this.arrayDiffFunc=n==="lcs"||n==="unorder-lcs"?ixe:sxe}};var Zi=t=>"hasLinesBefore"in t||"hasLinesAfter"in t,lxe=(t,e,r)=>Zi(t)?r:e*(t.end-t.start+1),UU=(t,e)=>{let r=[],o,n;if(t.length&&e.length)for(t=[...t],e=[...e],o={...t.shift()},n={...e.shift()};;){if(o.start===n.start){let a=Math.min(o.end,n.end);r.push({...o,...n,end:a}),o.start=n.start=a}else if(o.start<n.start){let a=Math.min(o.end,n.start);r.push({...n,...o,end:a}),o.start=a}else{let a=Math.min(o.start,n.end);r.push({...o,...n,end:a}),n.start=a}if(!t.length||!e.length)break;o.start===o.end&&(o={...t.shift()}),n.start===n.end&&(n={...e.shift()})}return t.length||r.push(...e.map(a=>({...a,token:o.token||"plain"}))),e.length||r.push(...t),r},cxe=(t,e,r,o,n,a,i,s,l)=>{if(!e.length)return[0,0];let c=0,u=0,d=t[r];Zi(d)?c=e[r]:c=e[r]+(o-d.start)*i;let p=t[n];return Zi(p)?u=l-e[n]-s:u=l-e[n]-(a-p.start)*i,[c,u]},uxe=cxe,dxe=(t,e,r,o,n,a)=>{if(!e.length)return[0,0,0,0];let i=0,s=0,l=0,c=0,u=0,d=t.length-1;for(;;){let h=Math.floor((u+d)/2);if(e[h]+lxe(t[h],n,a)<=r?u=h+1:d=h,u===d){i=u;break}}let p=t[i];for(Zi(p)?l=p.start:l=p.start+Math.floor((r-e[i])/n),u=0,d=t.length-1;;){let h=Math.floor((u+d+1)/2);if(e[h]>=o?d=h-1:u=h,u===d){s=u;break}}let m=t[s];return Zi(m)?c=m.end:c=m.start+Math.ceil((o-e[s])/n),[i,l,s,c]},fxe=dxe,ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.applyPatch=ta.calcPatch=DC=ta.lcs=ta.diff=ta.diff_core=void 0;function pxe(t,e){let{b:r,eq:o,stack_base:n}=t,{i:a,N:i,j:s,M:l,Z:c,stack_top:u}=t;for(;;)switch(e){case 0:{e:for(;i>0&&l>0;){r.fill(0,0,2*c);let d=i-l,p=i+l,m=p&1,h=a+i-1,g=s+l-1,_=(p+m)/2,x;t:for(let b=0;b<=_;b++){let y=2*Math.max(0,b-l)-b,I=b-2*Math.max(0,b-i);for(let w=y;w<=I;w+=2){let v=r[w-1-c*Math.floor((w-1)/c)],T=r[w+1-c*Math.floor((w+1)/c)],O=w===-b||w!==b&&v<T?T:v+1,S=O-w,C=O,F=S;for(;C<i&&F<l&&o(a+C,s+F);)C++,F++;if(r[w-c*Math.floor(w/c)]=C,m===1&&(x=d-w)>=1-b&&x<b&&C+r[c+x-c*Math.floor(x/c)]>=i)if(b>1||C!==O){n[u++]=a+C,n[u++]=i-C,n[u++]=s+F,n[u++]=l-F,i=O,l=S,c=2*(Math.min(i,l)+1);continue e}else break t}for(let w=y;w<=I;w+=2){let v=r[c+w-1-c*Math.floor((w-1)/c)],T=r[c+w+1-c*Math.floor((w+1)/c)],O=w===-b||w!==b&&v<T?T:v+1,S=O-w,C=O,F=S;for(;C<i&&F<l&&o(h-C,g-F);)C++,F++;if(r[c+w-c*Math.floor(w/c)]=C,m===0&&(x=d-w)>=-b&&x<=b&&C+r[x-c*Math.floor(x/c)]>=i)if(b>0||C!==O){n[u++]=a+i-O,n[u++]=O,n[u++]=s+l-S,n[u++]=S,i=i-C,l=l-F,c=2*(Math.min(i,l)+1);continue e}else break t}}if(i!==l){l>i?(a+=i,s+=i,l-=i,i=0):(a+=l,s+=l,i-=l,l=0);break}}if(i+l!==0)if(t.pxe===a||t.pye===s)t.pxe=a+i,t.pye=s+l;else{let d=t.pxs;if(t.oxs=t.pxs,t.oxe=t.pxe,t.oys=t.pys,t.oye=t.pye,t.pxs=a,t.pxe=a+i,t.pys=s,t.pye=s+l,d>=0)return t.i=a,t.N=i,t.j=s,t.M=l,t.Z=c,t.stack_top=u,1}}case 1:{if(u===0)return 2;l=n[--u],s=n[--u],i=n[--u],a=n[--u],c=2*(Math.min(i,l)+1),e=0}}}var mxe=class{[Symbol.iterator](){return this}next(){let{state:e,result:r}=this;if(this.c>1)return r.done=!0,r.value=void 0,r;let o=pxe(e,this.c);return this.c=o,o===1?(r.value=[e.oxs,e.oxe,e.oys,e.oye],r):e.pxs>=0?(r.value=[e.pxs,e.pxe,e.pys,e.pye],r):(r.done=!0,r.value=void 0,r)}constructor(e){this.state=e,this.c=0,this.result={value:null,done:!1}}};function GU(t,e,r,o,n){let a=(Math.min(e,o)+1)*2,i=e+o,s=new(i<256?Uint8Array:i<65536?Uint16Array:Uint32Array)(2*a);return new mxe({i:t,N:e,j:r,M:o,Z:a,b:s,eq:n,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}ta.diff_core=GU;function RC(t,e){let[r,o,n]=[0,t.length,e.length];for(;r<o&&r<n&&t[r]===e[r];)r++;if(r===o&&r===n)return[][Symbol.iterator]();for(;t[--o]===e[--n]&&o>r&&n>r;);let a=(i,s)=>t[i]===e[s];return GU(r,o+1-r,r,n+1-r,a)}ta.diff=RC;var hxe=class{[Symbol.iterator](){return this}next(){let e=this.diff.next();if(e.done){let{i:l,j:c,N:u}=this;return l<u&&(e.done=!1,e.value=[l,c,u-l],this.i=u),e}let r=e.value,o=r[0],n=r[1],a=r[3],{i,j:s}=this;return i!==o&&(r.length--,r[0]=i,r[1]=s,r[2]=o-i),this.i=n,this.j=a,e}constructor(e,r){this.diff=e,this.N=r,this.i=0,this.j=0}};function gxe(t,e){return new hxe(RC(t,e),t.length)}var DC=ta.lcs=gxe;function*_xe(t,e){let r=ArrayBuffer.isView(t)?Uint8Array.prototype.subarray:t.slice;for(let o of RC(t,e))o[2]=r.call(e,o[2],o[3]),yield o}ta.calcPatch=_xe;function*xxe(t,e){let r=0,o=ArrayBuffer.isView(t)?Uint8Array.prototype.subarray:t.slice;for(let[n,a,i]of e)r<n&&(yield o.call(t,r,n)),i.length>0&&(yield i),r=a;r<t.length&&(yield o.call(t,r))}ta.applyPatch=xxe;var VU=(t,e)=>{let r=[],o=0;for(let n of t)r.push(o),o+=n.length+e;return r.push(o-e),r},Ub=t=>t.filter(e=>e.end>e.start),bxe=(t,e,r)=>{let o=[],n=[],a=0,i=0;if(r.mode==="word"){let l=r.wordSeparator||" ",c=t.split(l),u=e.split(l),d=[...DC(c,u)],p=l.length,m=VU(c,p),h=VU(u,p);for(let[g,_,x]of d)g>a&&o.push({type:"remove",start:m[a],end:m[g]}),_>i&&n.push({type:"add",start:h[i],end:h[_]}),a=g+x,i=_+x,o.push({start:m[g],end:m[a]}),n.push({start:h[_],end:h[i]});return t.length>a&&o.push({type:"remove",start:m[a],end:t.length}),e.length>i&&n.push({type:"add",start:h[i],end:e.length}),o=Ub(o),n=Ub(n),[o,n]}let s=DC(t,e);for(let[l,c,u]of s)l>a&&o.push({type:"remove",start:a,end:l}),c>i&&n.push({type:"add",start:i,end:c}),a=l+u,i=c+u,o.push({start:l,end:a}),n.push({start:c,end:i});return t.length>a&&o.push({type:"remove",start:a,end:t.length}),e.length>i&&n.push({type:"add",start:i,end:e.length}),o=Ub(o),n=Ub(n),[o,n]},yxe=bxe,WU=(t,e,r)=>{if(!t)return[{token:"plain",start:r,end:e.length+r}];if(e==="undefined"||e==="Infinity"||e==="-Infinity"||e==="NaN"||/^\d+n$/i.test(e)||e.startsWith("Symbol(")||e.startsWith("function")||e.startsWith("("))return[{token:"invalid",start:r,end:e.length+r}];if(!Number.isNaN(Number(e)))return[{token:"number",start:r,end:e.length+r}];if(e==="true"||e==="false")return[{token:"boolean",start:r,end:e.length+r}];if(e==="null")return[{token:"null",start:r,end:e.length+r}];if(e.startsWith('"')){if(e.endsWith(": [")||e.endsWith(": {"))return[{token:"key",start:r,end:e.length-3+r},{token:"punctuation",start:e.length-3,end:e.length-2+r},{token:"plain",start:e.length-2,end:e.length-1+r},{token:"punctuation",start:e.length-1,end:e.length+r}];let o=1;for(;o<e.length&&e[o]!=='"';)e[o]==="\\"&&++o,++o;return o===e.length-1?[{token:"string",start:r,end:e.length+r}]:[{token:"key",start:r,end:o+1+r},{token:"punctuation",start:o+1,end:o+2+r},{token:"plain",start:o+2,end:o+3+r},...WU(t,e.substring(o+3),r+o+3)]}return e==="{"||e==="}"||e==="["||e==="]"?[{token:"punctuation",start:r,end:e.length+r}]:[{token:"plain",start:r,end:e.length+r}]},HU=WU,$U={threshold:8,margin:3},vxe=(t,e,r,o)=>{if(!r||o)return[{start:0,end:t.length,isEqual:!1}];let n=[];for(let c=0;c<t.length;c++)t[c].type==="equal"&&e[c].type==="equal"?n.length&&n[n.length-1].isEqual?n[n.length-1].end++:n.push({start:c,end:c+1,isEqual:!0}):n.length&&!n[n.length-1].isEqual?n[n.length-1].end++:n.push({start:c,end:c+1,isEqual:!1});let a=r===!0?$U:{...$U,...r},{threshold:i,margin:s}=a;i<s*2+1&&console.warn(`Threshold (${i}) is no more than 2 margins + 1 "expand" line (${s} * 2 + 1), it's not necessary to hide unchanged areas which have less than ${s*2+1} lines.`);let l=[];for(let c=0;c<n.length;c++){let u=n[c];if(!u.isEqual||u.end-u.start<i||u.end-u.start<=s*2+1){l.push(u);continue}c?c===n.length-1?(l.push({start:u.start,end:u.start+s,isEqual:!0}),l.push({hasLinesBefore:!1,hasLinesAfter:!0,start:u.start+s,end:t.length,isEqual:!0})):(l.push({start:u.start,end:u.start+s,isEqual:!0}),l.push({hasLinesBefore:!0,hasLinesAfter:!0,start:u.start+s,end:u.end-s,isEqual:!0}),l.push({start:u.end-s,end:u.end,isEqual:!0})):(l.push({hasLinesBefore:!0,hasLinesAfter:!1,start:0,end:u.end-s,isEqual:!0}),l.push({start:u.end-s,end:u.end,isEqual:!0}))}return l},jU=vxe,Ixe=2,qU=20,wxe={noChangeDetected:"No change detected"},Vb=t=>{let[e,r]=t.diff,o=Tt(()=>e.length===r.length&&e.every(U=>U.type==="equal")&&r.every(U=>U.type==="equal"),[e,r]),n={...wxe,...t.texts},a=t.lineNumbers?`calc(${String(e.length).length}ch + 16px)`:0,i=t.indent??Ixe,s=i==="tab"?" ":" ",l=i==="tab"?1:i,c={mode:t.inlineDiffOptions?.mode||"char",wordSeparator:t.inlineDiffOptions?.wordSeparator||""},u=t.hideUnchangedLines??!1,{scrollContainer:d="body",itemHeight:p=18,expandLineHeight:m=26}=!t.virtual||t.virtual===!0?{}:t.virtual,h=d==="body"?document.body:document.querySelector(d),g=H(e),_=H(r),x=H(jU(e,r,u,o)),b=H([]),y=H(0),I=H(null),[,w]=P({}),v=()=>{if(b.current=[],t.virtual){let U=0;for(let G of x.current)Zi(G)?(b.current.push(U),U+=m):(b.current.push(U),U+=p*(G.end-G.start));y.current=x.current.reduce((G,k)=>Zi(k)?G+m:G+(k.end-k.start)*p,0)}w({})};L(()=>{g.current=e,_.current=r,x.current=jU(e,r,u,o),v()},[u,e,r]),L(()=>{if(!t.virtual||!h)return;let U=()=>w({});return h.addEventListener("scroll",U),()=>{h.removeEventListener("scroll",U)}},[t.virtual,h]);let T=U=>G=>{let k=[...x.current],Z=k[U];k[U]={...Z,end:Math.max(Z.end-G,Z.start)},U+1<x.current.length-1&&(k[U+1]={...k[U+1],start:Math.max(Z.end-G,Z.start)}),x.current=k,v()},O=U=>G=>{let k=[...x.current],Z=k[U];k[U]={...Z,start:Math.min(Z.start+G,Z.end)},U>1&&(k[U-1]={...k[U-1],end:Math.min(Z.start+G,Z.end)}),x.current=k,v()},S=U=>()=>{let G=[...x.current],k=G[U];G[U]={...k,start:k.start,end:k.start},U+1<x.current.length-1?G[U+1]={...G[U+1],start:k.start}:G[U-1]={...G[U-1],end:k.end},x.current=G,v()},C=(U,G=[],k=!1,Z=!1)=>Q(Ae,null,G.map((te,A)=>{let ce=U.slice(te.start,te.end);if(!te.type&&!te.token)return ce;let Se=[te.type?`inline-diff-${te.type}`:"",te.token?`token ${te.token}`:""].filter(Boolean).join(" ");return Q("span",{key:`${A}-${te.type}-${ce}`,className:Se},ce)}),k&&(Z?Q("span",{className:"token punctuation"},","):",")),F=(U,G)=>{let k=g.current[U],Z=_.current[U],[te,A]=t.highlightInlineDiff&&k.type==="modify"&&Z.type==="modify"?yxe(k.text,Z.text,c):[[],[]],ce=HU(G,k.text,0),Se=HU(G,Z.text,0),Ge=UU(ce,te),et=UU(Se,A),Oe=k.type!=="equal"?t.bgColour?.[k.type]??"":"",be=Z.type!=="equal"?t.bgColour?.[Z.type]??"":"";return Q("tr",{key:U},t.lineNumbers&&Q("td",{className:`line-${k.type} line-number`,style:{backgroundColor:Oe}},k.lineNumber),Q("td",{className:`line-${k.type}`,style:{backgroundColor:Oe}},Q("pre",null,k.text&&s.repeat(k.level*l),C(k.text,Ge,k.comma,G))),t.lineNumbers&&Q("td",{className:`line-${Z.type} line-number`,style:{backgroundColor:be}},Z.lineNumber),Q("td",{className:`line-${Z.type}`,style:{backgroundColor:be}},Q("pre",null,Z.text&&s.repeat(Z.level*l),C(Z.text,et,Z.comma,G))))},N=(U,G,k,Z)=>Q(Ae,null,U&&Q("button",{onClick:()=>T(Z)(k)},"\u2B61 Show ",k," lines before"),Q("button",{onClick:()=>S(Z)()},"\u2B65 Show all unchanged lines"),G&&Q("button",{onClick:()=>O(Z)(k)},"\u2B63 Show ",k," lines after")),R=(U,G,k,Z,te)=>{let{start:A,end:ce}=U;if(A=Math.max(A,k),ce=Math.min(ce,Z),A===ce)return null;if(!Zi(U))return Array(ce-A).fill(0).map((Oe,be)=>F(A+be,te));let{hasLinesBefore:Se,hasLinesAfter:Ge}=U,et=typeof u=="boolean"?qU:u.expandMoreLinesLimit||qU;return[Q("tr",{key:`expand-line-${G}`,className:"expand-line"},Q("td",{colSpan:4,className:`${Se?"has-lines-before":""} ${Ge?"has-lines-after":""}`},typeof u!="boolean"&&u.expandLineRenderer?u.expandLineRenderer({hasLinesBefore:Se,hasLinesAfter:Ge,onExpandBefore:T(G),onExpandAfter:O(G),onExpandAll:S(G)}):N(Se,Ge,et,G)))]},z=U=>{if(o&&u)return Q("tr",{key:"message-line",className:"message-line"},Q("td",{colSpan:4},n.noChangeDetected));if(!t.virtual)return x.current.map((zt,ot)=>R(zt,ot,0,g.current.length,U));let G=h?.clientHeight??0,k=h?.scrollTop??0,Z=k+G,te=I.current,A=te?.offsetTop??0;for(;te?.offsetParent&&te?.offsetParent!==h;)te=te.offsetParent,A+=te.offsetTop;if(A>Z||A+y.current<k)return Q("tr",null,Q("td",{colSpan:4,style:{height:`${y.current}px`}}));let ce=k-A,Se=Z-A,[Ge,et,Oe,be]=fxe(x.current,b.current,ce,Se,p,m),[st,wt]=uxe(x.current,b.current,Ge,et,Oe,be,p,m,y.current),mt=x.current.slice(Ge,Oe+1);return mt.length?Q(Ae,null,Q("tr",null,Q("td",{colSpan:4,style:{height:st,padding:0}})),mt.map((zt,ot)=>R(zt,ot,et,be,U)),Q("tr",null,Q("td",{colSpan:4,style:{height:wt,padding:0}}))):Q("tr",null,Q("td",{colSpan:4,style:{height:`${y.current}px`}}))},B=()=>Q("colgroup",{className:"measure-line"},t.lineNumbers&&Q("col",{style:{width:a}}),Q("col",null),t.lineNumbers&&Q("col",{style:{width:a}}),Q("col",null)),M=["json-diff-viewer",t.virtual&&"json-diff-viewer-virtual",t.syntaxHighlight&&`json-diff-viewer-theme-${t.syntaxHighlight.theme||"monokai"}`,t.className].filter(Boolean).join(" "),V=!!t.syntaxHighlight;return Q("table",{className:M,style:t.style},B(),Q("tbody",{ref:I},z(V)))};Vb.displayName="Viewer";function Hb(t){let e=t.left,r=t.right,[o,n]=P(!1),[a,i]=P(null),[s,l]=P(null),c=XU(a?.fields||{}),u=XU(s?.fields||{}),p=new AC({}).diff(c,u),m=`/cms/compare?left=${YU(e)}&right=${YU(r)}`;async function h(){n(!0);let[g,_]=await Promise.all([OS(e.docId,e.versionId),OS(r.docId,r.versionId)]);i(g),l(_),n(!1)}return L(()=>{h()},[]),o?f(Re,{size:"md",color:"gray"}):f("div",{className:ke(t.className,"DocDiffViewer"),children:[t.showExpandButton&&f("div",{className:"DocDiffViewer__expand",children:f(X,{component:"a",variant:"default",size:"xs",compact:!0,href:m,target:"_blank",children:"Open in new tab"})}),f("div",{className:"DocDiffViewer__header",children:[f("div",{className:"DocDiffViewer__header__label",children:[t.left.docId,"@",t.left.versionId," - modified"," ",KU(a)]}),f("div",{className:"DocDiffViewer__header__label",children:[t.right.docId,"@",t.right.versionId," - modified"," ",KU(s)]})]}),f(Vb,{diff:p,syntaxHighlight:{theme:"root-cms"},lineNumbers:!0,highlightInlineDiff:!0,hideUnchangedLines:!0,inlineDiffOptions:{mode:"word",wordSeparator:" "}})]})}function KU(t){return t?.sys?.modifiedAt?Rn(t.sys.modifiedAt.toMillis()):"never"}function XU(t){return fb(t,{removeArrayKey:!0})}function YU(t){return encodeURIComponent(`${t.docId}@${t.versionId}`).replaceAll("%2F","/").replaceAll("%40","@")}var QU="PublishDocModal";function ZU(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(QU,{...r,title:`Publish ${t.docId}`,innerProps:t,size:"850px"})}}}function $b(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(""),[l,c]=P(!1),u=H(null),d=Ye(),p=xt(),m=n==="scheduled"?"Schedule":"Publish";async function h(){try{c(!0),await hz(e.docId),c(!1),pe({title:"Published!",message:`Succesfully published ${e.docId}.`,autoClose:1e4}),d.closeAll()}catch(b){console.error(b),pe({title:"Publish failed",message:`Failed to publish ${e.docId}.`,color:"red",autoClose:!1})}}async function g(){try{c(!0);let b=Math.floor(new Date(i).getTime());await gz(e.docId,b),c(!1),pe({title:"Scheduled!",message:`${e.docId} will go live ${i}.`,autoClose:1e4}),d.closeAll()}catch(b){console.error(b),pe({title:"Schedule failed",message:`Failed to schedule ${e.docId}.`,color:"red",autoClose:!1})}}function _(){d.openConfirmModal({...p,title:`${m} ${e.docId}`,children:f(Me,{size:"body-sm",weight:"semi-bold",children:["Are you sure you want to publish ",f("code",{children:e.docId}),"? The doc will go live ",n==="now"?"now":`at ${i}`,"."]}),labels:{confirm:m,cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"dark",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!0,onConfirm:()=>{n==="now"?h():n==="scheduled"&&g()}})}let x=!0;return(n==="now"||n==="scheduled"&&i)&&(x=!1),f("div",{className:"PublishDocModal",children:f("div",{className:"PublishDocModal__content",children:[f("form",{className:"PublishDocModal__form",onSubmit:b=>{b.preventDefault(),_()},children:[f("div",{className:"PublishDocModal__form__publishOptions",children:f("div",{className:"PublishDocModal__form__publishOptions__options",children:[f("label",{className:ke("PublishDocModal__form__publishOptions__option",n==="now"&&"PublishDocModal__form__publishOptions__option--selected",n&&n!=="now"&&"PublishDocModal__form__publishOptions__option--unselected"),children:[f("div",{className:"PublishDocModal__form__publishOptions__option__input",children:[f("input",{type:"radio",name:"publish-option",value:"now",checked:n==="now",onChange:()=>a("now")})," ","Now"]}),f("div",{className:"PublishDocModal__form__publishOptions__option__help",children:"Content will go live immediately."})]}),f("label",{className:ke("PublishDocModal__form__publishOptions__option",n==="scheduled"&&"PublishDocModal__form__publishOptions__option--selected",n&&n!=="scheduled"&&"PublishDocModal__form__publishOptions__option--unselected"),children:[f("div",{className:"PublishDocModal__form__publishOptions__option__input",children:[f("input",{type:"radio",name:"publish-option",value:"scheduled",checked:n==="scheduled",onChange:()=>a("scheduled")}),f("div",{children:"Scheduled"})]}),f("div",{className:"PublishDocModal__form__publishOptions__option__help",children:"Content will go live at the date and time specified below."}),f("div",{className:"PublishDocModal__form__publishOptions__option__input2",children:[f("input",{ref:u,type:"datetime-local",disabled:n!=="scheduled",value:i,min:Su(),onChange:b=>{let y=b.target;s(y.value)}}),f("div",{className:"PublishDocModal__form__publishOptions__option__input2__help",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})]})]})}),f("div",{className:"PublishDocModal__form__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",disabled:x,loading:l,type:"submit",children:m})]})]}),f(Exe,{docId:e.docId})]})})}function Exe(t){let e=t.docId,[r,o]=P(!1);function n(){o(!0)}return f("div",{className:"PublishDocModal__ShowChanges",children:f(wc,{iconPosition:"right",onChange:()=>n(),children:f(wc.Item,{label:"Show changes",children:r?f(Hb,{left:{docId:e,versionId:"published"},right:{docId:e,versionId:"draft"},showExpandButton:!0}):f(Re,{})})})})}$b.id=QU;var Ji="Releases";async function JU(t,e){if(!t)throw new Error("missing data source id");let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Ji,t);await Op(o,async a=>{if((await a.get(n)).exists())throw new Error(`release exists: ${t}`);await a.set(n,{...e,id:t,createdAt:Ut(),createdBy:window.firebase.user.email})}),Je("release.create",{metadata:{releaseId:t}})}async function e8(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db,r=nn(e,"Projects",t,Ji),o=to(r,Qn("createdAt","desc")),n=await an(o),a=[];return n.forEach(i=>{a.push(i.data())}),a}async function Tl(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,Ji,t),n=await vr(o);return n.exists()?n.data():null}async function t8(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Ji,t);await rr(n,e),Je("release.save",{metadata:{releaseId:t}})}async function r8(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,Ji,t);await A9(o),console.log(`deleted release ${t}`),Je("release.delete",{metadata:{releaseId:t}})}async function o8(t){let e=await Tl(t);if(!e)throw new Error(`release not found: ${t}`);let r=e.docIds||[];if(r.length===0)throw new Error(`no docs to publish for release: ${t}`);let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,Ji,t),i=sn(n);i.update(a,{publishedAt:Ut(),publishedBy:window.firebase.user.email,scheduledAt:zr(),scheduledBy:zr()}),await kS(r,{batch:i}),console.log(`published release: ${t}`),Je("release.publish",{metadata:{releaseId:t,docIds:r}})}async function n8(t,e){if(!await Tl(t))throw new Error(`release not found: ${t}`);typeof e=="number"&&(e=Ze.fromMillis(e));let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,Ji,t);await rr(a,{scheduledAt:e,scheduledBy:window.firebase.user.email}),Je("release.publish",{metadata:{releaseId:t,scheduledAt:e.toMillis()}})}async function a8(t){if(!await Tl(t))throw new Error(`release not found: ${t}`);let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Ji,t);await rr(n,{scheduledAt:zr(),scheduledBy:zr()}),Je("release.unschedule",{metadata:{releaseId:t}})}var i8="ScheduleReleaseModal";function s8(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(i8,{...r,title:`Schedule release: ${t.releaseId}`,innerProps:t})}}}function jb(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(!1),l=H(null),c=Ye();async function u(){s(!0),await bt(async()=>{let d=Math.floor(new Date(n).getTime());if(Math.floor(new Date().getTime())>=d)throw new Error("bad datetime, please choose a date in the future");let m=Ze.fromMillis(d);await n8(e.releaseId,d),pe({title:"Scheduled!",message:`Release ${e.releaseId} will go live ${n}.`,autoClose:1e4}),c.closeAll(),e.onScheduled&&e.onScheduled(m)}),s(!1)}return f("div",{className:"ScheduleReleaseModal",children:f("div",{className:"ScheduleReleaseModal__content",children:f("form",{className:"ScheduleReleaseModal__form",onSubmit:d=>{d.preventDefault(),u()},children:[f("div",{className:"ScheduleReleaseModal__form__description",children:"Content in the release will go live at the datetime specified below."}),f("div",{className:"ScheduleReleaseModal__form__dateInput",children:[f("input",{ref:l,type:"datetime-local",value:n,min:Su(),onChange:d=>{let p=d.target;a(p.value)}}),f("div",{className:"ScheduleReleaseModal__form__dateInput__help",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),f("div",{className:"ScheduleReleaseModal__form__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",loading:i,type:"submit",children:"Schedule"})]})]})})})}jb.id=i8;var c8="VersionHistoryModal";function u8(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(c8,{...r,innerProps:t,size:"min(calc(100% - 32px), 720px)"})}}}function qb(t){let{innerProps:e}=t,r=e.docId,[o,n]=P(!0),[a,i]=P([]),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});async function l(){n(!0);let d=await wz(r);n(!1),i(d)}async function c(d){await Ez(r,d),pe({title:"Saved!",message:`Restored ${r} to ${s.format(d.sys.modifiedAt.toDate())}.`,autoClose:5e3}),e.onRestore&&e.onRestore({version:d})}function u(d){let p=l8(r,d._versionId),m=l8(r,"draft");return`/cms/compare?left=${p}&right=${m}`}return L(()=>{l()},[]),o?f(Re,{}):f("div",{className:"VersionHistoryModal",children:[f(Te,{className:"VersionHistoryModal__title",size:"h2",children:[f(Hp,{strokeWidth:1.5}),f("span",{children:"Version history"})]}),f("div",{className:"VersionHistoryModal__docId",children:f("code",{children:r})}),a.length===0?f(Me,{className:"VersionHistoryModal__versionsEmpty",size:"body",children:[f("p",{children:"No versions found."}),f("p",{className:"VersionHistoryModal__versionsEmpty__developer",children:"For developers: Configure the Root CMS cron job to populate versions."})]}):f(kr,{className:"VersionHistoryModal__versions",children:[f("thead",{children:f("tr",{children:[f("th",{children:"modified at"}),f("th",{children:"modified by"}),f("th",{children:"actions"})]})}),f("tbody",{children:a.map((d,p)=>f("tr",{children:[f("td",{children:f(Me,{size:"body-sm",children:s.format(d.sys.modifiedAt.toDate())})}),f("td",{children:f(Me,{size:"body-sm",children:d.sys.modifiedBy})}),f("td",{children:f("div",{className:"VersionHistoryModal__versions__buttons",children:[f(X,{variant:"default",size:"xs",compact:!0,onClick:()=>c(d),children:"restore"}),f(X,{className:"VersionHistoryModal__versions__buttons__compare",component:"a",variant:"default",size:"xs",compact:!0,href:u(d),target:"_blank",rightIcon:f(xl,{size:12}),children:"compare"})]})})]}))})]})]})}function l8(t,e){return encodeURIComponent(`${t}@${e}`).replaceAll("%2F","/").replaceAll("%40","@")}qb.id=c8;var _V=Ev(gV(),1);var KC=_V.default;var kye={};function XC(t,e){let r=e||kye,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return bV(t,o,n)}function bV(t,e,r){if(Tye(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return xV(t.children,e,r)}return Array.isArray(t)?xV(t,e,r):""}function xV(t,e,r){let o=[],n=-1;for(;++n<t.length;)o[n]=bV(t[n],e,r);return o.join("")}function Tye(t){return!!(t&&typeof t=="object")}var yV=document.createElement("i");function Hu(t){let e="&"+t+";";yV.innerHTML=e;let r=yV.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===e?!1:r}function Ir(t,e,r,o){let n=t.length,a=0,i;if(e<0?e=-e>n?0:n+e:e=e>n?n:e,r=r>0?r:0,o.length<1e4)i=Array.from(o),i.unshift(e,r),t.splice(...i);else for(r&&t.splice(e,r);a<o.length;)i=o.slice(a,a+1e4),i.unshift(e,0),t.splice(...i),a+=1e4,e+=1e4}function Mo(t,e){return t.length>0?(Ir(t,t.length,0,e),t):e}var vV={}.hasOwnProperty;function oy(t){let e={},r=-1;for(;++r<t.length;)Pye(e,t[r]);return e}function Pye(t,e){let r;for(r in e){let n=(vV.call(t,r)?t[r]:void 0)||(t[r]={}),a=e[r],i;if(a)for(i in a){vV.call(n,i)||(n[i]=[]);let s=a[i];Oye(n[i],Array.isArray(s)?s:s?[s]:[])}}}function Oye(t,e){let r=-1,o=[];for(;++r<e.length;)(e[r].add==="after"?t:o).push(e[r]);Ir(t,0,0,o)}function ny(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function mo(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Pr=ts(/[A-Za-z]/),Or=ts(/[\dA-Za-z]/),IV=ts(/[#-'*+\--9=?A-Z^-~]/);function Al(t){return t!==null&&(t<32||t===127)}var em=ts(/\d/),wV=ts(/[\dA-Fa-f]/),EV=ts(/[!-/:-@[-`{-~]/);function ie(t){return t!==null&&t<-2}function Xe(t){return t!==null&&(t<0||t===32)}function Pe(t){return t===-2||t===-1||t===32}var Dl=ts(/\p{P}|\p{S}/u),Ta=ts(/\s/);function ts(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Ee(t,e,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,a=0;return i;function i(l){return Pe(l)?(t.enter(r),s(l)):e(l)}function s(l){return Pe(l)&&a++<n?(t.consume(l),s):(t.exit(r),e(l))}}var SV={tokenize:Aye};function Aye(t){let e=t.attempt(this.parser.constructs.contentInitial,o,n),r;return e;function o(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Ee(t,e,"linePrefix")}function n(s){return t.enter("paragraph"),a(s)}function a(s){let l=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,i(s)}function i(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return ie(s)?(t.consume(s),t.exit("chunkText"),a):(t.consume(s),i)}}var kV={tokenize:Dye},CV={tokenize:Rye};function Dye(t){let e=this,r=[],o=0,n,a,i;return s;function s(y){if(o<r.length){let I=r[o];return e.containerState=I[1],t.attempt(I[0].continuation,l,c)(y)}return c(y)}function l(y){if(o++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,n&&b();let I=e.events.length,w=I,v;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){v=e.events[w][1].end;break}x(o);let T=I;for(;T<e.events.length;)e.events[T][1].end=Object.assign({},v),T++;return Ir(e.events,w+1,0,e.events.slice(I)),e.events.length=T,c(y)}return s(y)}function c(y){if(o===r.length){if(!n)return p(y);if(n.currentConstruct&&n.currentConstruct.concrete)return h(y);e.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(CV,u,d)(y)}function u(y){return n&&b(),x(o),p(y)}function d(y){return e.parser.lazy[e.now().line]=o!==r.length,i=e.now().offset,h(y)}function p(y){return e.containerState={},t.attempt(CV,m,h)(y)}function m(y){return o++,r.push([e.currentConstruct,e.containerState]),p(y)}function h(y){if(y===null){n&&b(),x(0),t.consume(y);return}return n=n||e.parser.flow(e.now()),t.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:n}),g(y)}function g(y){if(y===null){_(t.exit("chunkFlow"),!0),x(0),t.consume(y);return}return ie(y)?(t.consume(y),_(t.exit("chunkFlow")),o=0,e.interrupt=void 0,s):(t.consume(y),g)}function _(y,I){let w=e.sliceStream(y);if(I&&w.push(null),y.previous=a,a&&(a.next=y),a=y,n.defineSkip(y.start),n.write(w),e.parser.lazy[y.start.line]){let v=n.events.length;for(;v--;)if(n.events[v][1].start.offset<i&&(!n.events[v][1].end||n.events[v][1].end.offset>i))return;let T=e.events.length,O=T,S,C;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(S){C=e.events[O][1].end;break}S=!0}for(x(o),v=T;v<e.events.length;)e.events[v][1].end=Object.assign({},C),v++;Ir(e.events,O+1,0,e.events.slice(T)),e.events.length=v}}function x(y){let I=r.length;for(;I-- >y;){let w=r[I];e.containerState=w[1],w[0].exit.call(e,t)}r.length=y}function b(){n.write([null]),a=void 0,n=void 0,e.containerState._closeFlow=void 0}}function Rye(t,e,r){return Ee(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $u(t){if(t===null||Xe(t)||Ta(t))return 1;if(Dl(t))return 2}function rs(t,e,r){let o=[],n=-1;for(;++n<t.length;){let a=t[n].resolveAll;a&&!o.includes(a)&&(e=a(e,r),o.push(a))}return e}var tm={name:"attention",tokenize:Mye,resolveAll:Nye};function Nye(t,e){let r=-1,o,n,a,i,s,l,c,u;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(o=r;o--;)if(t[o][0]==="exit"&&t[o][1].type==="attentionSequence"&&t[o][1]._open&&e.sliceSerialize(t[o][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[o][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[o][1].end.offset-t[o][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;l=t[o][1].end.offset-t[o][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let d=Object.assign({},t[o][1].end),p=Object.assign({},t[r][1].start);TV(d,-l),TV(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},t[o][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[r][1].start),end:p},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[o][1].end),end:Object.assign({},t[r][1].start)},n={type:l>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},s.end)},t[o][1].end=Object.assign({},i.start),t[r][1].start=Object.assign({},s.end),c=[],t[o][1].end.offset-t[o][1].start.offset&&(c=Mo(c,[["enter",t[o][1],e],["exit",t[o][1],e]])),c=Mo(c,[["enter",n,e],["enter",i,e],["exit",i,e],["enter",a,e]]),c=Mo(c,rs(e.parser.constructs.insideSpan.null,t.slice(o+1,r),e)),c=Mo(c,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",n,e]]),t[r][1].end.offset-t[r][1].start.offset?(u=2,c=Mo(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):u=0,Ir(t,o-1,r-o+3,c),r=o+c.length-u-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function Mye(t,e){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=$u(o),a;return i;function i(l){return a=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===a)return t.consume(l),s;let c=t.exit("attentionSequence"),u=$u(l),d=!u||u===2&&n||r.includes(l),p=!n||n===2&&u||r.includes(o);return c._open=!!(a===42?d:d&&(n||!p)),c._close=!!(a===42?p:p&&(u||!d)),e(l)}}function TV(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var YC={name:"autolink",tokenize:Lye};function Lye(t,e,r){let o=0;return n;function n(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(m){return Pr(m)?(t.consume(m),i):m===64?r(m):c(m)}function i(m){return m===43||m===45||m===46||Or(m)?(o=1,s(m)):c(m)}function s(m){return m===58?(t.consume(m),o=0,l):(m===43||m===45||m===46||Or(m))&&o++<32?(t.consume(m),s):(o=0,c(m))}function l(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||Al(m)?r(m):(t.consume(m),l)}function c(m){return m===64?(t.consume(m),u):IV(m)?(t.consume(m),c):r(m)}function u(m){return Or(m)?d(m):r(m)}function d(m){return m===46?(t.consume(m),o=0,u):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||Or(m))&&o++<63){let h=m===45?p:d;return t.consume(m),h}return r(m)}}var Pa={tokenize:Bye,partial:!0};function Bye(t,e,r){return o;function o(a){return Pe(a)?Ee(t,n,"linePrefix")(a):n(a)}function n(a){return a===null||ie(a)?e(a):r(a)}}var ay={name:"blockQuote",tokenize:Fye,continuation:{tokenize:zye},exit:Uye};function Fye(t,e,r){let o=this;return n;function n(i){if(i===62){let s=o.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(i),t.exit("blockQuoteMarker"),a}return r(i)}function a(i){return Pe(i)?(t.enter("blockQuotePrefixWhitespace"),t.consume(i),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(i))}}function zye(t,e,r){let o=this;return n;function n(i){return Pe(i)?Ee(t,a,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return t.attempt(ay,e,r)(i)}}function Uye(t){t.exit("blockQuote")}var iy={name:"characterEscape",tokenize:Vye};function Vye(t,e,r){return o;function o(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),n}function n(a){return EV(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(a)}}var sy={name:"characterReference",tokenize:Hye};function Hye(t,e,r){let o=this,n=0,a,i;return s;function s(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),l}function l(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),a=31,i=Or,u(d))}function c(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,i=wV,u):(t.enter("characterReferenceValue"),a=7,i=em,u(d))}function u(d){if(d===59&&n){let p=t.exit("characterReferenceValue");return i===Or&&!Hu(o.sliceSerialize(p))?r(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return i(d)&&n++<a?(t.consume(d),u):r(d)}}var PV={tokenize:jye,partial:!0},ly={name:"codeFenced",tokenize:$ye,concrete:!0};function $ye(t,e,r){let o=this,n={tokenize:w,partial:!0},a=0,i=0,s;return l;function l(v){return c(v)}function c(v){let T=o.events[o.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(v)}function u(v){return v===s?(i++,t.consume(v),u):i<3?r(v):(t.exit("codeFencedFenceSequence"),Pe(v)?Ee(t,d,"whitespace")(v):d(v))}function d(v){return v===null||ie(v)?(t.exit("codeFencedFence"),o.interrupt?e(v):t.check(PV,g,I)(v)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||ie(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(v)):Pe(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ee(t,m,"whitespace")(v)):v===96&&v===s?r(v):(t.consume(v),p)}function m(v){return v===null||ie(v)?d(v):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||ie(v)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(v)):v===96&&v===s?r(v):(t.consume(v),h)}function g(v){return t.attempt(n,I,_)(v)}function _(v){return t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),x}function x(v){return a>0&&Pe(v)?Ee(t,b,"linePrefix",a+1)(v):b(v)}function b(v){return v===null||ie(v)?t.check(PV,g,I)(v):(t.enter("codeFlowValue"),y(v))}function y(v){return v===null||ie(v)?(t.exit("codeFlowValue"),b(v)):(t.consume(v),y)}function I(v){return t.exit("codeFenced"),e(v)}function w(v,T,O){let S=0;return C;function C(B){return v.enter("lineEnding"),v.consume(B),v.exit("lineEnding"),F}function F(B){return v.enter("codeFencedFence"),Pe(B)?Ee(v,N,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B)}function N(B){return B===s?(v.enter("codeFencedFenceSequence"),R(B)):O(B)}function R(B){return B===s?(S++,v.consume(B),R):S>=i?(v.exit("codeFencedFenceSequence"),Pe(B)?Ee(v,z,"whitespace")(B):z(B)):O(B)}function z(B){return B===null||ie(B)?(v.exit("codeFencedFence"),T(B)):O(B)}}}function jye(t,e,r){let o=this;return n;function n(i){return i===null?r(i):(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),a)}function a(i){return o.parser.lazy[o.now().line]?r(i):e(i)}}var rm={name:"codeIndented",tokenize:Gye},qye={tokenize:Wye,partial:!0};function Gye(t,e,r){let o=this;return n;function n(c){return t.enter("codeIndented"),Ee(t,a,"linePrefix",5)(c)}function a(c){let u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?i(c):r(c)}function i(c){return c===null?l(c):ie(c)?t.attempt(qye,i,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||ie(c)?(t.exit("codeFlowValue"),i(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function Wye(t,e,r){let o=this;return n;function n(i){return o.parser.lazy[o.now().line]?r(i):ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n):Ee(t,a,"linePrefix",5)(i)}function a(i){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(i):ie(i)?n(i):r(i)}}var QC={name:"codeText",tokenize:Yye,resolve:Kye,previous:Xye};function Kye(t){let e=t.length-4,r=3,o,n;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(o=r;++o<e;)if(t[o][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(o=r-1,e++;++o<=e;)n===void 0?o!==e&&t[o][1].type!=="lineEnding"&&(n=o):(o===e||t[o][1].type==="lineEnding")&&(t[n][1].type="codeTextData",o!==n+2&&(t[n][1].end=t[o-1][1].end,t.splice(n+2,o-n-2),e-=o-n-2,o=n+2),n=void 0);return t}function Xye(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Yye(t,e,r){let o=this,n=0,a,i;return s;function s(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(i=t.enter("codeTextSequence"),a=0,d(p)):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||ie(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),a++,d):a===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(i.type="codeTextData",u(p))}}var cy=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){let o=r??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(e,o):e>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(e,r,o){let n=r||0;this.setCursor(Math.trunc(e));let a=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&om(this.left,o),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),om(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),om(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let r=this.left.splice(e,Number.POSITIVE_INFINITY);om(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);om(this.left,r.reverse())}}};function om(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function uy(t){let e={},r=-1,o,n,a,i,s,l,c,u=new cy(t);for(;++r<u.length;){for(;r in e;)r=e[r];if(o=u.get(r),r&&o[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(l=o[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(o[0]==="enter")o[1].contentType&&(Object.assign(e,Qye(u,r)),r=e[r],c=!0);else if(o[1]._container){for(a=r,n=void 0;a--&&(i=u.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank");)i[0]==="enter"&&(n&&(u.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=a);n&&(o[1].end=Object.assign({},u.get(n)[1].start),s=u.slice(n,r),s.unshift(o),u.splice(n,r-n+1,s))}}return Ir(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Qye(t,e){let r=t.get(e)[1],o=t.get(e)[2],n=e-1,a=[],i=r._tokenizer||o.parser[r.contentType](r.start),s=i.events,l=[],c={},u,d,p=-1,m=r,h=0,g=0,_=[g];for(;m;){for(;t.get(++n)[1]!==m;);a.push(n),m._tokenizer||(u=o.sliceStream(m),m.next||u.push(null),d&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=r;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(g=p+1,_.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):_.pop(),p=_.length;p--;){let x=s.slice(_[p],_[p+1]),b=a.pop();l.push([b,b+x.length-1]),t.splice(b,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return c}var ZC={tokenize:eve,resolve:Jye},Zye={tokenize:tve,partial:!0};function Jye(t){return uy(t),t}function eve(t,e){let r;return o;function o(s){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),n(s)}function n(s){return s===null?a(s):ie(s)?t.check(Zye,i,a)(s):(t.consume(s),n)}function a(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function i(s){return t.consume(s),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function tve(t,e,r){let o=this;return n;function n(i){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Ee(t,a,"linePrefix")}function a(i){if(i===null||ie(i))return r(i);let s=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(i):t.interrupt(o.parser.constructs.flow,r,e)(i)}}function dy(t,e,r,o,n,a,i,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(x){return x===60?(t.enter(o),t.enter(n),t.enter(a),t.consume(x),t.exit(a),p):x===null||x===32||x===41||Al(x)?r(x):(t.enter(o),t.enter(i),t.enter(s),t.enter("chunkString",{contentType:"string"}),g(x))}function p(x){return x===62?(t.enter(a),t.consume(x),t.exit(a),t.exit(n),t.exit(o),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(s),p(x)):x===null||x===60||ie(x)?r(x):(t.consume(x),x===92?h:m)}function h(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function g(x){return!u&&(x===null||x===41||Xe(x))?(t.exit("chunkString"),t.exit(s),t.exit(i),t.exit(o),e(x)):u<c&&x===40?(t.consume(x),u++,g):x===41?(t.consume(x),u--,g):x===null||x===32||x===40||Al(x)?r(x):(t.consume(x),x===92?_:g)}function _(x){return x===40||x===41||x===92?(t.consume(x),g):g(x)}}function fy(t,e,r,o,n,a){let i=this,s=0,l;return c;function c(m){return t.enter(o),t.enter(n),t.consume(m),t.exit(n),t.enter(a),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):m===93?(t.exit(a),t.enter(n),t.consume(m),t.exit(n),t.exit(o),e):ie(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ie(m)||s++>999?(t.exit("chunkString"),u(m)):(t.consume(m),l||(l=!Pe(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(t.consume(m),s++,d):d(m)}}function py(t,e,r,o,n,a){let i;return s;function s(p){return p===34||p===39||p===40?(t.enter(o),t.enter(n),t.consume(p),t.exit(n),i=p===40?41:p,l):r(p)}function l(p){return p===i?(t.enter(n),t.consume(p),t.exit(n),t.exit(o),e):(t.enter(a),c(p))}function c(p){return p===i?(t.exit(a),l(i)):p===null?r(p):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ee(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===i||p===null||ie(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?d:u)}function d(p){return p===i||p===92?(t.consume(p),u):u(p)}}function Rl(t,e){let r;return o;function o(n){return ie(n)?(t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),r=!0,o):Pe(n)?Ee(t,o,r?"linePrefix":"lineSuffix")(n):e(n)}}var JC={name:"definition",tokenize:ove},rve={tokenize:nve,partial:!0};function ove(t,e,r){let o=this,n;return a;function a(m){return t.enter("definition"),i(m)}function i(m){return fy.call(o,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return n=mo(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),l):r(m)}function l(m){return Xe(m)?Rl(t,c)(m):c(m)}function c(m){return dy(t,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return t.attempt(rve,d,d)(m)}function d(m){return Pe(m)?Ee(t,p,"whitespace")(m):p(m)}function p(m){return m===null||ie(m)?(t.exit("definition"),o.parser.defined.push(n),e(m)):r(m)}}function nve(t,e,r){return o;function o(s){return Xe(s)?Rl(t,n)(s):r(s)}function n(s){return py(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Pe(s)?Ee(t,i,"whitespace")(s):i(s)}function i(s){return s===null||ie(s)?e(s):r(s)}}var ek={name:"hardBreakEscape",tokenize:ave};function ave(t,e,r){return o;function o(a){return t.enter("hardBreakEscape"),t.consume(a),n}function n(a){return ie(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}var tk={name:"headingAtx",tokenize:sve,resolve:ive};function ive(t,e){let r=t.length-2,o=3,n,a;return t[o][1].type==="whitespace"&&(o+=2),r-2>o&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(o===r-1||r-4>o&&t[r-2][1].type==="whitespace")&&(r-=o+1===r?2:4),r>o&&(n={type:"atxHeadingText",start:t[o][1].start,end:t[r][1].end},a={type:"chunkText",start:t[o][1].start,end:t[r][1].end,contentType:"text"},Ir(t,o,r-o+1,[["enter",n,e],["enter",a,e],["exit",a,e],["exit",n,e]])),t}function sve(t,e,r){let o=0;return n;function n(u){return t.enter("atxHeading"),a(u)}function a(u){return t.enter("atxHeadingSequence"),i(u)}function i(u){return u===35&&o++<6?(t.consume(u),i):u===null||Xe(u)?(t.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||ie(u)?(t.exit("atxHeading"),e(u)):Pe(u)?Ee(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Xe(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}var OV=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rk=["pre","script","style","textarea"];var ok={name:"htmlFlow",tokenize:dve,resolveTo:uve,concrete:!0},lve={tokenize:pve,partial:!0},cve={tokenize:fve,partial:!0};function uve(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function dve(t,e,r){let o=this,n,a,i,s,l;return c;function c(A){return u(A)}function u(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),d}function d(A){return A===33?(t.consume(A),p):A===47?(t.consume(A),a=!0,g):A===63?(t.consume(A),n=3,o.interrupt?e:k):Pr(A)?(t.consume(A),i=String.fromCharCode(A),_):r(A)}function p(A){return A===45?(t.consume(A),n=2,m):A===91?(t.consume(A),n=5,s=0,h):Pr(A)?(t.consume(A),n=4,o.interrupt?e:k):r(A)}function m(A){return A===45?(t.consume(A),o.interrupt?e:k):r(A)}function h(A){let ce="CDATA[";return A===ce.charCodeAt(s++)?(t.consume(A),s===ce.length?o.interrupt?e:N:h):r(A)}function g(A){return Pr(A)?(t.consume(A),i=String.fromCharCode(A),_):r(A)}function _(A){if(A===null||A===47||A===62||Xe(A)){let ce=A===47,Se=i.toLowerCase();return!ce&&!a&&rk.includes(Se)?(n=1,o.interrupt?e(A):N(A)):OV.includes(i.toLowerCase())?(n=6,ce?(t.consume(A),x):o.interrupt?e(A):N(A)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(A):a?b(A):y(A))}return A===45||Or(A)?(t.consume(A),i+=String.fromCharCode(A),_):r(A)}function x(A){return A===62?(t.consume(A),o.interrupt?e:N):r(A)}function b(A){return Pe(A)?(t.consume(A),b):C(A)}function y(A){return A===47?(t.consume(A),C):A===58||A===95||Pr(A)?(t.consume(A),I):Pe(A)?(t.consume(A),y):C(A)}function I(A){return A===45||A===46||A===58||A===95||Or(A)?(t.consume(A),I):w(A)}function w(A){return A===61?(t.consume(A),v):Pe(A)?(t.consume(A),w):y(A)}function v(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(t.consume(A),l=A,T):Pe(A)?(t.consume(A),v):O(A)}function T(A){return A===l?(t.consume(A),l=null,S):A===null||ie(A)?r(A):(t.consume(A),T)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Xe(A)?w(A):(t.consume(A),O)}function S(A){return A===47||A===62||Pe(A)?y(A):r(A)}function C(A){return A===62?(t.consume(A),F):r(A)}function F(A){return A===null||ie(A)?N(A):Pe(A)?(t.consume(A),F):r(A)}function N(A){return A===45&&n===2?(t.consume(A),M):A===60&&n===1?(t.consume(A),V):A===62&&n===4?(t.consume(A),Z):A===63&&n===3?(t.consume(A),k):A===93&&n===5?(t.consume(A),G):ie(A)&&(n===6||n===7)?(t.exit("htmlFlowData"),t.check(lve,te,R)(A)):A===null||ie(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),N)}function R(A){return t.check(cve,z,te)(A)}function z(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),B}function B(A){return A===null||ie(A)?R(A):(t.enter("htmlFlowData"),N(A))}function M(A){return A===45?(t.consume(A),k):N(A)}function V(A){return A===47?(t.consume(A),i="",U):N(A)}function U(A){if(A===62){let ce=i.toLowerCase();return rk.includes(ce)?(t.consume(A),Z):N(A)}return Pr(A)&&i.length<8?(t.consume(A),i+=String.fromCharCode(A),U):N(A)}function G(A){return A===93?(t.consume(A),k):N(A)}function k(A){return A===62?(t.consume(A),Z):A===45&&n===2?(t.consume(A),k):N(A)}function Z(A){return A===null||ie(A)?(t.exit("htmlFlowData"),te(A)):(t.consume(A),Z)}function te(A){return t.exit("htmlFlow"),e(A)}}function fve(t,e,r){let o=this;return n;function n(i){return ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),a):r(i)}function a(i){return o.parser.lazy[o.now().line]?r(i):e(i)}}function pve(t,e,r){return o;function o(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),t.attempt(Pa,e,r)}}var nk={name:"htmlText",tokenize:mve};function mve(t,e,r){let o=this,n,a,i;return s;function s(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),c):k===47?(t.consume(k),w):k===63?(t.consume(k),y):Pr(k)?(t.consume(k),O):r(k)}function c(k){return k===45?(t.consume(k),u):k===91?(t.consume(k),a=0,h):Pr(k)?(t.consume(k),b):r(k)}function u(k){return k===45?(t.consume(k),m):r(k)}function d(k){return k===null?r(k):k===45?(t.consume(k),p):ie(k)?(i=d,V(k)):(t.consume(k),d)}function p(k){return k===45?(t.consume(k),m):d(k)}function m(k){return k===62?M(k):k===45?p(k):d(k)}function h(k){let Z="CDATA[";return k===Z.charCodeAt(a++)?(t.consume(k),a===Z.length?g:h):r(k)}function g(k){return k===null?r(k):k===93?(t.consume(k),_):ie(k)?(i=g,V(k)):(t.consume(k),g)}function _(k){return k===93?(t.consume(k),x):g(k)}function x(k){return k===62?M(k):k===93?(t.consume(k),x):g(k)}function b(k){return k===null||k===62?M(k):ie(k)?(i=b,V(k)):(t.consume(k),b)}function y(k){return k===null?r(k):k===63?(t.consume(k),I):ie(k)?(i=y,V(k)):(t.consume(k),y)}function I(k){return k===62?M(k):y(k)}function w(k){return Pr(k)?(t.consume(k),v):r(k)}function v(k){return k===45||Or(k)?(t.consume(k),v):T(k)}function T(k){return ie(k)?(i=T,V(k)):Pe(k)?(t.consume(k),T):M(k)}function O(k){return k===45||Or(k)?(t.consume(k),O):k===47||k===62||Xe(k)?S(k):r(k)}function S(k){return k===47?(t.consume(k),M):k===58||k===95||Pr(k)?(t.consume(k),C):ie(k)?(i=S,V(k)):Pe(k)?(t.consume(k),S):M(k)}function C(k){return k===45||k===46||k===58||k===95||Or(k)?(t.consume(k),C):F(k)}function F(k){return k===61?(t.consume(k),N):ie(k)?(i=F,V(k)):Pe(k)?(t.consume(k),F):S(k)}function N(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(t.consume(k),n=k,R):ie(k)?(i=N,V(k)):Pe(k)?(t.consume(k),N):(t.consume(k),z)}function R(k){return k===n?(t.consume(k),n=void 0,B):k===null?r(k):ie(k)?(i=R,V(k)):(t.consume(k),R)}function z(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||Xe(k)?S(k):(t.consume(k),z)}function B(k){return k===47||k===62||Xe(k)?S(k):r(k)}function M(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):r(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),U}function U(k){return Pe(k)?Ee(t,G,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):G(k)}function G(k){return t.enter("htmlTextData"),i(k)}}var Nl={name:"labelEnd",tokenize:yve,resolveTo:bve,resolveAll:xve},hve={tokenize:vve},gve={tokenize:Ive},_ve={tokenize:wve};function xve(t){let e=-1;for(;++e<t.length;){let r=t[e][1];(r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd")&&(t.splice(e+1,r.type==="labelImage"?4:2),r.type="data",e++)}return t}function bve(t,e){let r=t.length,o=0,n,a,i,s;for(;r--;)if(n=t[r][1],a){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(i){if(t[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(a=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(i=r);let l={type:t[a][1].type==="labelLink"?"link":"image",start:Object.assign({},t[a][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:"label",start:Object.assign({},t[a][1].start),end:Object.assign({},t[i][1].end)},u={type:"labelText",start:Object.assign({},t[a+o+2][1].end),end:Object.assign({},t[i-2][1].start)};return s=[["enter",l,e],["enter",c,e]],s=Mo(s,t.slice(a+1,a+o+3)),s=Mo(s,[["enter",u,e]]),s=Mo(s,rs(e.parser.constructs.insideSpan.null,t.slice(a+o+4,i-3),e)),s=Mo(s,[["exit",u,e],t[i-2],t[i-1],["exit",c,e]]),s=Mo(s,t.slice(i+1)),s=Mo(s,[["exit",l,e]]),Ir(t,a,t.length,s),t}function yve(t,e,r){let o=this,n=o.events.length,a,i;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){a=o.events[n][1];break}return s;function s(p){return a?a._inactive?d(p):(i=o.parser.defined.includes(mo(o.sliceSerialize({start:a.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):r(p)}function l(p){return p===40?t.attempt(hve,u,i?u:d)(p):p===91?t.attempt(gve,u,i?c:d)(p):i?u(p):d(p)}function c(p){return t.attempt(_ve,u,d)(p)}function u(p){return e(p)}function d(p){return a._balanced=!0,r(p)}}function vve(t,e,r){return o;function o(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),n}function n(d){return Xe(d)?Rl(t,a)(d):a(d)}function a(d){return d===41?u(d):dy(t,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return Xe(d)?Rl(t,l)(d):u(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?py(t,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Xe(d)?Rl(t,u)(d):u(d)}function u(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):r(d)}}function Ive(t,e,r){let o=this;return n;function n(s){return fy.call(o,t,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return o.parser.defined.includes(mo(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(s):r(s)}function i(s){return r(s)}}function wve(t,e,r){return o;function o(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),n}function n(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):r(a)}}var ak={name:"labelStartImage",tokenize:Eve,resolveAll:Nl.resolveAll};function Eve(t,e,r){let o=this;return n;function n(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),a}function a(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),i):r(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):e(s)}}var ik={name:"labelStartLink",tokenize:Sve,resolveAll:Nl.resolveAll};function Sve(t,e,r){let o=this;return n;function n(i){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(i):e(i)}}var nm={name:"lineEnding",tokenize:Cve};function Cve(t,e){return r;function r(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ee(t,e,"linePrefix")}}var Ml={name:"thematicBreak",tokenize:kve};function kve(t,e,r){let o=0,n;return a;function a(c){return t.enter("thematicBreak"),i(c)}function i(c){return n=c,s(c)}function s(c){return c===n?(t.enter("thematicBreakSequence"),l(c)):o>=3&&(c===null||ie(c))?(t.exit("thematicBreak"),e(c)):r(c)}function l(c){return c===n?(t.consume(c),o++,l):(t.exit("thematicBreakSequence"),Pe(c)?Ee(t,s,"whitespace")(c):s(c))}}var ho={name:"list",tokenize:Ove,continuation:{tokenize:Ave},exit:Rve},Tve={tokenize:Nve,partial:!0},Pve={tokenize:Dve,partial:!0};function Ove(t,e,r){let o=this,n=o.events[o.events.length-1],a=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,i=0;return s;function s(m){let h=o.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!o.containerState.marker||m===o.containerState.marker:em(m)){if(o.containerState.type||(o.containerState.type=h,t.enter(h,{_container:!0})),h==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Ml,r,c)(m):c(m);if(!o.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(m)}return r(m)}function l(m){return em(m)&&++i<10?(t.consume(m),l):(!o.interrupt||i<2)&&(o.containerState.marker?m===o.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):r(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||m,t.check(Pa,o.interrupt?r:u,t.attempt(Tve,p,d))}function u(m){return o.containerState.initialBlankLine=!0,a++,p(m)}function d(m){return Pe(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):r(m)}function p(m){return o.containerState.size=a+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function Ave(t,e,r){let o=this;return o.containerState._closeFlow=void 0,t.check(Pa,n,a);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Ee(t,e,"listItemIndent",o.containerState.size+1)(s)}function a(s){return o.containerState.furtherBlankLines||!Pe(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(Pve,e,i)(s))}function i(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Ee(t,t.attempt(ho,e,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Dve(t,e,r){let o=this;return Ee(t,n,"listItemIndent",o.containerState.size+1);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===o.containerState.size?e(a):r(a)}}function Rve(t){t.exit(this.containerState.type)}function Nve(t,e,r){let o=this;return Ee(t,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(a){let i=o.events[o.events.length-1];return!Pe(a)&&i&&i[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}var my={name:"setextUnderline",tokenize:Lve,resolveTo:Mve};function Mve(t,e){let r=t.length,o,n,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){o=r;break}t[r][1].type==="paragraph"&&(n=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);let i={type:"setextHeading",start:Object.assign({},t[n][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[n][1].type="setextHeadingText",a?(t.splice(n,0,["enter",i,e]),t.splice(a+1,0,["exit",t[o][1],e]),t[o][1].end=Object.assign({},t[a][1].end)):t[o][1]=i,t.push(["exit",i,e]),t}function Lve(t,e,r){let o=this,n;return a;function a(c){let u=o.events.length,d;for(;u--;)if(o.events[u][1].type!=="lineEnding"&&o.events[u][1].type!=="linePrefix"&&o.events[u][1].type!=="content"){d=o.events[u][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||d)?(t.enter("setextHeadingLine"),n=c,i(c)):r(c)}function i(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===n?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),Pe(c)?Ee(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ie(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}var AV={tokenize:Bve};function Bve(t){let e=this,r=t.attempt(Pa,o,t.attempt(this.parser.constructs.flowInitial,n,Ee(t,t.attempt(this.parser.constructs.flow,n,t.attempt(ZC,n)),"linePrefix")));return r;function o(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var DV={resolveAll:LV()},RV=MV("string"),NV=MV("text");function MV(t){return{tokenize:e,resolveAll:LV(t==="text"?Fve:void 0)};function e(r){let o=this,n=this.parser.constructs[t],a=r.attempt(n,i,s);return i;function i(u){return c(u)?a(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),a(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=n[u],p=-1;if(d)for(;++p<d.length;){let m=d[p];if(!m.previous||m.previous.call(o,o.previous))return!0}return!1}}}function LV(t){return e;function e(r,o){let n=-1,a;for(;++n<=r.length;)a===void 0?r[n]&&r[n][1].type==="data"&&(a=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),n=a+2),a=void 0);return t?t(r,o):r}}function Fve(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let o=t[r-1][1],n=e.sliceStream(o),a=n.length,i=-1,s=0,l;for(;a--;){let c=n[a];if(typeof c=="string"){for(i=c.length;c.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(c===-2)l=!0,s++;else if(c!==-1){a++;break}}if(s){let c={type:r===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:o.end.line,column:o.end.column-s,offset:o.end.offset-s,_index:o.start._index+a,_bufferIndex:a?i:o.start._bufferIndex+i},end:Object.assign({},o.end)};o.end=Object.assign({},c.start),o.start.offset===o.end.offset?Object.assign(o,c):(t.splice(r,0,["enter",c,e],["exit",c,e]),r+=2)}r++}return t}function BV(t,e,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},a=[],i=[],s=[],l=!0,c={consume:I,enter:w,exit:v,attempt:S(T),check:S(O),interrupt:S(O,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:t,sliceStream:g,sliceSerialize:h,now:_,defineSkip:x,write:m},d=e.tokenize.call(u,c),p;return e.resolveAll&&a.push(e),u;function m(R){return i=Mo(i,R),b(),i[i.length-1]!==null?[]:(C(e,0),u.events=rs(a,u.events,u),u.events)}function h(R,z){return Uve(g(R),z)}function g(R){return zve(i,R)}function _(){let{line:R,column:z,offset:B,_index:M,_bufferIndex:V}=o;return{line:R,column:z,offset:B,_index:M,_bufferIndex:V}}function x(R){n[R.line]=R.column,N()}function b(){let R;for(;o._index<i.length;){let z=i[o._index];if(typeof z=="string")for(R=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===R&&o._bufferIndex<z.length;)y(z.charCodeAt(o._bufferIndex));else y(z)}}function y(R){l=void 0,p=R,d=d(R)}function I(R){ie(R)?(o.line++,o.column=1,o.offset+=R===-3?2:1,N()):R!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),u.previous=R,l=!0}function w(R,z){let B=z||{};return B.type=R,B.start=_(),u.events.push(["enter",B,u]),s.push(B),B}function v(R){let z=s.pop();return z.end=_(),u.events.push(["exit",z,u]),z}function T(R,z){C(R,z.from)}function O(R,z){z.restore()}function S(R,z){return B;function B(M,V,U){let G,k,Z,te;return Array.isArray(M)?ce(M):"tokenize"in M?ce([M]):A(M);function A(Oe){return be;function be(st){let wt=st!==null&&Oe[st],mt=st!==null&&Oe.null,zt=[...Array.isArray(wt)?wt:wt?[wt]:[],...Array.isArray(mt)?mt:mt?[mt]:[]];return ce(zt)(st)}}function ce(Oe){return G=Oe,k=0,Oe.length===0?U:Se(Oe[k])}function Se(Oe){return be;function be(st){return te=F(),Z=Oe,Oe.partial||(u.currentConstruct=Oe),Oe.name&&u.parser.constructs.disable.null.includes(Oe.name)?et(st):Oe.tokenize.call(z?Object.assign(Object.create(u),z):u,c,Ge,et)(st)}}function Ge(Oe){return l=!0,R(Z,te),V}function et(Oe){return l=!0,te.restore(),++k<G.length?Se(G[k]):U}}}function C(R,z){R.resolveAll&&!a.includes(R)&&a.push(R),R.resolve&&Ir(u.events,z,u.events.length-z,R.resolve(u.events.slice(z),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function F(){let R=_(),z=u.previous,B=u.currentConstruct,M=u.events.length,V=Array.from(s);return{restore:U,from:M};function U(){o=R,u.previous=z,u.currentConstruct=B,u.events.length=M,s=V,N()}}function N(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function zve(t,e){let r=e.start._index,o=e.start._bufferIndex,n=e.end._index,a=e.end._bufferIndex,i;if(r===n)i=[t[r].slice(o,a)];else{if(i=t.slice(r,n),o>-1){let s=i[0];typeof s=="string"?i[0]=s.slice(o):i.shift()}a>0&&i.push(t[n].slice(0,a))}return i}function Uve(t,e){let r=-1,o=[],n;for(;++r<t.length;){let a=t[r],i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
52
52
  `;break}case-3:{i=`\r
53
- `;break}case-2:{i=e?" ":" ";break}case-1:{if(!e&&n)continue;i=" ";break}default:i=String.fromCharCode(a)}n=a===-2,o.push(i)}return o.join("")}var sk={};Jj(sk,{attentionMarkers:()=>Kve,contentInitial:()=>Hve,disable:()=>Xve,document:()=>Vve,flow:()=>jve,flowInitial:()=>$ve,insideSpan:()=>Wve,string:()=>qve,text:()=>Gve});var Vve={42:ho,43:ho,45:ho,48:ho,49:ho,50:ho,51:ho,52:ho,53:ho,54:ho,55:ho,56:ho,57:ho,62:ay},Hve={91:JC},$ve={[-2]:rm,[-1]:rm,32:rm},jve={35:tk,42:Ml,45:[my,Ml],60:ok,61:my,95:Ml,96:ly,126:ly},qve={38:sy,92:iy},Gve={[-5]:nm,[-4]:nm,[-3]:nm,33:ak,38:sy,42:tm,60:[YC,nk],91:ik,92:[ek,iy],93:Nl,95:tm,96:QC},Wve={null:[tm,DV]},Kve={null:[42,95]},Xve={null:[]};function lk(t){let r=oy([sk,...(t||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(SV),document:n(kV),flow:n(AV),string:n(RV),text:n(NV)};return o;function n(a){return i;function i(s){return BV(o,a,s)}}}function ck(t){for(;!uy(t););return t}var FV=/[\0\t\n\r]/g;function uk(){let t=1,e="",r=!0,o;return n;function n(a,i,s){let l=[],c,u,d,p,m;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),d=0,e="",r&&(a.charCodeAt(0)===65279&&d++,r=void 0);d<a.length;){if(FV.lastIndex=d,c=FV.exec(a),p=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(p),!c){e=a.slice(d);break}if(m===10&&d===p&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<p&&(l.push(a.slice(d,p)),t+=p-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:o=!0,t=1}d=p+1}return s&&(o&&l.push(-5),e&&l.push(e),l.push(null)),l}}var Yve=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zV(t){return t.replace(Yve,Qve)}function Qve(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),a=n===120||n===88;return ny(r.slice(a?2:1),a?16:10)}return Hu(r)||t}function ju(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?UV(t.position):"start"in t||"end"in t?UV(t):"line"in t||"column"in t?dk(t):""}function dk(t){return VV(t&&t.line)+":"+VV(t&&t.column)}function UV(t){return dk(t&&t.start)+"-"+dk(t&&t.end)}function VV(t){return t&&typeof t=="number"?t:1}var $V={}.hasOwnProperty;function fk(t,e,r){return typeof e!="string"&&(r=e,e=void 0),Zve(r)(ck(lk(r).document().write(uk()(t,e,!0))))}function Zve(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ft),autolinkProtocol:S,autolinkEmail:S,atxHeading:a(ao),blockQuote:a(st),characterEscape:S,characterReference:S,codeFenced:a(wt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(wt,i),codeText:a(mt,i),codeTextData:S,data:S,codeFlowValue:S,definition:a(zt),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(ot),hardBreakEscape:a(dt),hardBreakTrailing:a(dt),htmlFlow:a(fe,i),htmlFlowData:S,htmlText:a(fe,i),htmlTextData:S,image:a(go),label:i,link:a(ft),listItem:a(wr),listItemValue:p,listOrdered:a(Be,d),listUnordered:a(Be),paragraph:a(fr),reference:A,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(ao),strong:a(Vr),thematicBreak:a(W)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:be,autolinkProtocol:Oe,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:Ge,characterReference:et,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:C,codeIndented:l(x),codeText:l(B),codeTextData:C,data:C,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(R),htmlFlowData:C,htmlText:l(z),htmlTextData:C,image:l(V),label:G,labelText:U,lineEnding:F,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:k,resourceTitleString:Z,resource:te,setextHeading:l(O),setextHeadingLineSequence:T,setextHeadingText:v,strong:l(),thematicBreak:l()}};jV(e,(t||{}).mdastExtensions||[]);let r={};return o;function o(D){let $={type:"root",children:[]},J={stack:[$],tokenStack:[],config:e,enter:s,exit:c,buffer:i,resume:u,data:r},ye=[],je=-1;for(;++je<D.length;)if(D[je][1].type==="listOrdered"||D[je][1].type==="listUnordered")if(D[je][0]==="enter")ye.push(je);else{let nt=ye.pop();je=n(D,nt,je)}for(je=-1;++je<D.length;){let nt=e[D[je][0]];$V.call(nt,D[je][1].type)&&nt[D[je][1].type].call(Object.assign({sliceSerialize:D[je][2].sliceSerialize},J),D[je][1])}if(J.tokenStack.length>0){let nt=J.tokenStack[J.tokenStack.length-1];(nt[1]||HV).call(J,void 0,nt[0])}for($.position={start:os(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:os(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<e.transforms.length;)$=e.transforms[je]($)||$;return $}function n(D,$,J){let ye=$-1,je=-1,nt=!1,Fo,nr,Kt,hn;for(;++ye<=J;){let Hr=D[ye];switch(Hr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Hr[0]==="enter"?je++:je--,hn=void 0;break}case"lineEndingBlank":{Hr[0]==="enter"&&(Fo&&!hn&&!je&&!Kt&&(Kt=ye),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!je&&Hr[0]==="enter"&&Hr[1].type==="listItemPrefix"||je===-1&&Hr[0]==="exit"&&(Hr[1].type==="listUnordered"||Hr[1].type==="listOrdered")){if(Fo){let _o=ye;for(nr=void 0;_o--;){let xo=D[_o];if(xo[1].type==="lineEnding"||xo[1].type==="lineEndingBlank"){if(xo[0]==="exit")continue;nr&&(D[nr][1].type="lineEndingBlank",nt=!0),xo[1].type="lineEnding",nr=_o}else if(!(xo[1].type==="linePrefix"||xo[1].type==="blockQuotePrefix"||xo[1].type==="blockQuotePrefixWhitespace"||xo[1].type==="blockQuoteMarker"||xo[1].type==="listItemIndent"))break}Kt&&(!nr||Kt<nr)&&(Fo._spread=!0),Fo.end=Object.assign({},nr?D[nr][1].start:Hr[1].end),D.splice(nr||ye,0,["exit",Fo,Hr[2]]),ye++,J++}if(Hr[1].type==="listItemPrefix"){let _o={type:"listItem",_spread:!1,start:Object.assign({},Hr[1].start),end:void 0};Fo=_o,D.splice(ye,0,["enter",_o,Hr[2]]),ye++,J++,Kt=void 0,hn=!0}}}return D[$][1]._spread=nt,J}function a(D,$){return J;function J(ye){s.call(this,D(ye),ye),$&&$.call(this,ye)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(D,$,J){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([$,J]),D.position={start:os($.start),end:void 0}}function l(D){return $;function $(J){D&&D.call(this,J),c.call(this,J)}}function c(D,$){let J=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==D.type&&($?$.call(this,D,ye[0]):(ye[1]||HV).call(this,D,ye[0]));else throw new Error("Cannot close `"+D.type+"` ("+ju({start:D.start,end:D.end})+"): it\u2019s not open");J.position.end=os(D.end)}function u(){return XC(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){let $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function m(){let D=this.resume(),$=this.stack[this.stack.length-1];$.lang=D}function h(){let D=this.resume(),$=this.stack[this.stack.length-1];$.meta=D}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/(\r?\n|\r)$/g,"")}function b(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase()}function y(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function I(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function w(D){let $=this.stack[this.stack.length-1];if(!$.depth){let J=this.sliceSerialize(D).length;$.depth=J}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){let $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function S(D){let J=this.stack[this.stack.length-1].children,ye=J[J.length-1];(!ye||ye.type!=="text")&&(ye=_e(),ye.position={start:os(D.start),end:void 0},J.push(ye)),this.stack.push(ye)}function C(D){let $=this.stack.pop();$.value+=this.sliceSerialize(D),$.position.end=os(D.end)}function F(D){let $=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=$.children[$.children.length-1];J.position.end=os(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes($.type)&&(S.call(this,D),C.call(this,D))}function N(){this.data.atHardBreak=!0}function R(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function B(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function M(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function U(D){let $=this.sliceSerialize(D),J=this.stack[this.stack.length-2];J.label=zV($),J.identifier=mo($).toLowerCase()}function G(){let D=this.stack[this.stack.length-1],$=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let ye=D.children;J.children=ye}else J.alt=$}function k(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function Z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function te(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ce(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Se(D){this.data.characterReferenceType=D.type}function Ge(D){let $=this.sliceSerialize(D),J=this.data.characterReferenceType,ye;J?(ye=ny($,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Hu($);let je=this.stack[this.stack.length-1];je.value+=ye}function et(D){let $=this.stack.pop();$.position.end=os(D.end)}function Oe(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(D)}function be(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(D)}function st(){return{type:"blockquote",children:[]}}function wt(){return{type:"code",lang:null,meta:null,value:""}}function mt(){return{type:"inlineCode",value:""}}function zt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function ao(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function fe(){return{type:"html",value:""}}function go(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function Be(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function wr(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function fr(){return{type:"paragraph",children:[]}}function Vr(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function W(){return{type:"thematicBreak"}}}function os(t){return{line:t.line,column:t.column,offset:t.offset}}function jV(t,e){let r=-1;for(;++r<e.length;){let o=e[r];Array.isArray(o)?jV(t,o):Jve(t,o)}}function Jve(t,e){let r;for(r in e)if($V.call(e,r))switch(r){case"canContainEols":{let o=e[r];o&&t[r].push(...o);break}case"transforms":{let o=e[r];o&&t[r].push(...o);break}case"enter":case"exit":{let o=e[r];o&&Object.assign(t[r],o);break}}}function HV(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+ju({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+ju({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+ju({start:e.start,end:e.end})+") is still open")}function pk(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let o=0,n=r.indexOf(e);for(;n!==-1;)o++,n=r.indexOf(e,n+e.length);return o}function mk(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var qu=function(t){if(t==null)return oIe;if(typeof t=="function")return hy(t);if(typeof t=="object")return Array.isArray(t)?eIe(t):tIe(t);if(typeof t=="string")return rIe(t);throw new Error("Expected function, string, or object as test")};function eIe(t){let e=[],r=-1;for(;++r<t.length;)e[r]=qu(t[r]);return hy(o);function o(...n){let a=-1;for(;++a<e.length;)if(e[a].apply(this,n))return!0;return!1}}function tIe(t){let e=t;return hy(r);function r(o){let n=o,a;for(a in t)if(n[a]!==e[a])return!1;return!0}}function rIe(t){return hy(e);function e(r){return r&&r.type===t}}function hy(t){return e;function e(r,o,n){return!!(nIe(r)&&t.call(this,r,typeof o=="number"?o:void 0,n||void 0))}}function oIe(){return!0}function nIe(t){return t!==null&&typeof t=="object"&&"type"in t}var qV=[],GV=!0,hk=!1,WV="skip";function gk(t,e,r,o){let n;typeof e=="function"&&typeof r!="function"?(o=r,r=e):n=e;let a=qu(n),i=o?-1:1;s(t,void 0,[])();function s(l,c,u){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=qV,h,g,_;if((!e||a(l,c,u[u.length-1]||void 0))&&(m=aIe(r(l,u)),m[0]===hk))return m;if("children"in l&&l.children){let x=l;if(x.children&&m[0]!==WV)for(g=(o?x.children.length:-1)+i,_=u.concat(x);g>-1&&g<x.children.length;){let b=x.children[g];if(h=s(b,g,_)(),h[0]===hk)return h;g=typeof h[1]=="number"?h[1]:g+i}}return m}}}function aIe(t){return Array.isArray(t)?t:typeof t=="number"?[GV,t]:t==null?qV:[t]}function _k(t,e,r){let n=qu((r||{}).ignore||[]),a=iIe(e),i=-1;for(;++i<a.length;)gk(t,"text",s);function s(c,u){let d=-1,p;for(;++d<u.length;){let m=u[d],h=p?p.children:void 0;if(n(m,h?h.indexOf(m):void 0,p))return;p=m}if(p)return l(c,u)}function l(c,u){let d=u[u.length-1],p=a[i][0],m=a[i][1],h=0,_=d.children.indexOf(c),x=!1,b=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){let I=y.index,w={index:y.index,input:y.input,stack:[...u,c]},v=m(...y,w);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?p.lastIndex=I+1:(h!==I&&b.push({type:"text",value:c.value.slice(h,I)}),Array.isArray(v)?b.push(...v):v&&b.push(v),h=I+y[0].length,x=!0),!p.global)break;y=p.exec(c.value)}return x?(h<c.value.length&&b.push({type:"text",value:c.value.slice(h)}),d.children.splice(_,1,...b)):b=[c],_+b.length}}function iIe(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],o=-1;for(;++o<r.length;){let n=r[o];e.push([sIe(n[0]),lIe(n[1])])}return e}function sIe(t){return typeof t=="string"?new RegExp(mk(t),"g"):t}function lIe(t){return typeof t=="function"?t:function(){return t}}function bk(){return{transforms:[mIe],enter:{literalAutolink:cIe,literalAutolinkEmail:xk,literalAutolinkHttp:xk,literalAutolinkWww:xk},exit:{literalAutolink:pIe,literalAutolinkEmail:fIe,literalAutolinkHttp:uIe,literalAutolinkWww:dIe}}}function cIe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function xk(t){this.config.enter.autolinkProtocol.call(this,t)}function uIe(t){this.config.exit.autolinkProtocol.call(this,t)}function dIe(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function fIe(t){this.config.exit.autolinkEmail.call(this,t)}function pIe(t){this.exit(t)}function mIe(t){_k(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hIe],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,gIe]],{ignore:["link","linkReference"]})}function hIe(t,e,r,o,n){let a="";if(!KV(n)||(/^w/i.test(e)&&(r=e+r,e="",a="http://"),!_Ie(r)))return!1;let i=xIe(r+o);if(!i[0])return!1;let s={type:"link",title:null,url:a+e+i[0],children:[{type:"text",value:e+i[0]}]};return i[1]?[s,{type:"text",value:i[1]}]:s}function gIe(t,e,r,o){return!KV(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function _Ie(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function xIe(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],o=r.indexOf(")"),n=pk(t,"("),a=pk(t,")");for(;o!==-1&&n>a;)t+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),a++;return[t,r]}function KV(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Ta(r)||Dl(r))&&(!e||r!==47)}TIe.peek=PIe;function yk(){return{enter:{gfmFootnoteDefinition:yIe,gfmFootnoteDefinitionLabelString:vIe,gfmFootnoteCall:EIe,gfmFootnoteCallString:SIe},exit:{gfmFootnoteDefinition:wIe,gfmFootnoteDefinitionLabelString:IIe,gfmFootnoteCall:kIe,gfmFootnoteCallString:CIe}}}function yIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function vIe(){this.buffer()}function IIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function wIe(t){this.exit(t)}function EIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function SIe(){this.buffer()}function CIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function kIe(t){this.exit(t)}function TIe(t,e,r,o){let n=r.createTracker(o),a=n.move("[^"),i=r.enter("footnoteReference"),s=r.enter("reference");return a+=n.move(r.safe(r.associationId(t),{...n.current(),before:a,after:"]"})),s(),i(),a+=n.move("]"),a}function PIe(){return"["}RIe.peek=NIe;function vk(){return{canContainEols:["delete"],enter:{strikethrough:AIe},exit:{strikethrough:DIe}}}function AIe(t){this.enter({type:"delete",children:[]},t)}function DIe(t){this.exit(t)}function RIe(t,e,r,o){let n=r.createTracker(o),a=r.enter("strikethrough"),i=n.move("~~");return i+=r.containerPhrasing(t,{...n.current(),before:i,after:"~"}),i+=n.move("~~"),a(),i}function NIe(){return"~"}function wk(){return{enter:{table:LIe,tableData:XV,tableHeader:XV,tableRow:FIe},exit:{codeText:zIe,table:BIe,tableData:Ik,tableHeader:Ik,tableRow:Ik}}}function LIe(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function BIe(t){this.exit(t),this.data.inTable=void 0}function FIe(t){this.enter({type:"tableRow",children:[]},t)}function Ik(t){this.exit(t)}function XV(t){this.enter({type:"tableCell",children:[]},t)}function zIe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,UIe));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function UIe(t,e){return e==="|"?e:t}function Ek(){return{exit:{taskListCheckValueChecked:YV,taskListCheckValueUnchecked:YV,paragraph:HIe}}}function YV(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function HIe(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let o=r.children[0];if(o&&o.type==="text"){let n=e.children,a=-1,i;for(;++a<n.length;){let s=n[a];if(s.type==="paragraph"){i=s;break}}i===r&&(o.value=o.value.slice(1),o.value.length===0?r.children.shift():r.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,r.position.start=Object.assign({},o.position.start)))}}this.exit(t)}function Sk(){return[bk(),yk(),vk(),wk(),Ek()]}var jIe={tokenize:XIe,partial:!0},QV={tokenize:YIe,partial:!0},ZV={tokenize:QIe,partial:!0},JV={tokenize:ZIe,partial:!0},qIe={tokenize:JIe,partial:!0},eH={tokenize:WIe,previous:rH},tH={tokenize:KIe,previous:oH},ai={tokenize:GIe,previous:nH},Oa={};function kk(){return{text:Oa}}var Ll=48;for(;Ll<123;)Oa[Ll]=ai,Ll++,Ll===58?Ll=65:Ll===91&&(Ll=97);Oa[43]=ai;Oa[45]=ai;Oa[46]=ai;Oa[95]=ai;Oa[72]=[ai,tH];Oa[104]=[ai,tH];Oa[87]=[ai,eH];Oa[119]=[ai,eH];function GIe(t,e,r){let o=this,n,a;return i;function i(d){return!Ck(d)||!nH.call(o,o.previous)||Tk(o.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),s(d))}function s(d){return Ck(d)?(t.consume(d),s):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(qIe,u,c)(d):d===45||d===95||Or(d)?(a=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),n=!0,l}function u(d){return a&&n&&Pr(o.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function WIe(t,e,r){let o=this;return n;function n(i){return i!==87&&i!==119||!rH.call(o,o.previous)||Tk(o.events)?r(i):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(jIe,t.attempt(QV,t.attempt(ZV,a),r),r)(i))}function a(i){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(i)}}function KIe(t,e,r){let o=this,n="",a=!1;return i;function i(d){return(d===72||d===104)&&oH.call(o,o.previous)&&!Tk(o.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),t.consume(d),s):r(d)}function s(d){if(Pr(d)&&n.length<5)return n+=String.fromCodePoint(d),t.consume(d),s;if(d===58){let p=n.toLowerCase();if(p==="http"||p==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),a?c:(a=!0,l)):r(d)}function c(d){return d===null||Al(d)||Xe(d)||Ta(d)||Dl(d)?r(d):t.attempt(QV,t.attempt(ZV,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function XIe(t,e,r){let o=0;return n;function n(i){return(i===87||i===119)&&o<3?(o++,t.consume(i),n):i===46&&o===3?(t.consume(i),a):r(i)}function a(i){return i===null?r(i):e(i)}}function YIe(t,e,r){let o,n,a;return i;function i(c){return c===46||c===95?t.check(JV,l,s)(c):c===null||Xe(c)||Ta(c)||c!==45&&Dl(c)?l(c):(a=!0,t.consume(c),i)}function s(c){return c===95?o=!0:(n=o,o=void 0),t.consume(c),i}function l(c){return n||o||!a?r(c):e(c)}}function QIe(t,e){let r=0,o=0;return n;function n(i){return i===40?(r++,t.consume(i),n):i===41&&o<r?a(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?t.check(JV,e,a)(i):i===null||Xe(i)||Ta(i)?e(i):(t.consume(i),n)}function a(i){return i===41&&o++,t.consume(i),n}}function ZIe(t,e,r){return o;function o(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(t.consume(s),o):s===38?(t.consume(s),a):s===93?(t.consume(s),n):s===60||s===null||Xe(s)||Ta(s)?e(s):r(s)}function n(s){return s===null||s===40||s===91||Xe(s)||Ta(s)?e(s):o(s)}function a(s){return Pr(s)?i(s):r(s)}function i(s){return s===59?(t.consume(s),o):Pr(s)?(t.consume(s),i):r(s)}}function JIe(t,e,r){return o;function o(a){return t.consume(a),n}function n(a){return Or(a)?r(a):e(a)}}function rH(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Xe(t)}function oH(t){return!Pr(t)}function nH(t){return!(t===47||Ck(t))}function Ck(t){return t===43||t===45||t===46||t===95||Or(t)}function Tk(t){let e=t.length,r=!1;for(;e--;){let o=t[e][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){r=!0;break}if(o._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var ewe={tokenize:swe,partial:!0};function Pk(){return{document:{91:{tokenize:nwe,continuation:{tokenize:awe},exit:iwe}},text:{91:{tokenize:owe},93:{add:"after",tokenize:twe,resolveTo:rwe}}}}function twe(t,e,r){let o=this,n=o.events.length,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i;for(;n--;){let l=o.events[n][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return r(l);let c=mo(o.sliceSerialize({start:i.end,end:o.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function rwe(t,e){let r=t.length,o;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){o=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",a,e],["exit",a,e],["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function owe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a=0,i;return s;function s(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?r(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(d){if(a>999||d===93&&!i||d===null||d===91||Xe(d))return r(d);if(d===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return n.includes(mo(o.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Xe(d)||(i=!0),a++,t.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(t.consume(d),a++,c):c(d)}}function nwe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a,i=0,s;return l;function l(h){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):r(h)}function u(h){if(i>999||h===93&&!s||h===null||h===91||Xe(h))return r(h);if(h===93){t.exit("chunkString");let g=t.exit("gfmFootnoteDefinitionLabelString");return a=mo(o.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Xe(h)||(s=!0),i++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),i++,u):u(h)}function p(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),n.includes(a)||n.push(a),Ee(t,m,"gfmFootnoteDefinitionWhitespace")):r(h)}function m(h){return e(h)}}function awe(t,e,r){return t.check(Pa,e,t.attempt(ewe,e,r))}function iwe(t){t.exit("gfmFootnoteDefinition")}function swe(t,e,r){let o=this;return Ee(t,n,"gfmFootnoteDefinitionIndent",5);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?e(a):r(a)}}function Ok(t){let r=(t||{}).singleTilde,o={tokenize:a,resolveAll:n};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function n(i,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let c=l;for(;c--;)if(i[c][0]==="exit"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[c][1].end.offset-i[c][1].start.offset){i[l][1].type="strikethroughSequence",i[c][1].type="strikethroughSequence";let u={type:"strikethrough",start:Object.assign({},i[c][1].start),end:Object.assign({},i[l][1].end)},d={type:"strikethroughText",start:Object.assign({},i[c][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",u,s],["enter",i[c][1],s],["exit",i[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Ir(p,p.length,0,rs(m,i.slice(c+1,l),s)),Ir(p,p.length,0,[["exit",d,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",u,s]]),Ir(i,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function a(i,s,l){let c=this.previous,u=this.events,d=0;return p;function p(h){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let g=$u(c);if(h===126)return d>1?l(h):(i.consume(h),d++,m);if(d<2&&!r)return l(h);let _=i.exit("strikethroughSequenceTemporary"),x=$u(h);return _._open=!x||x===2&&!!g,_._close=!g||g===2&&!!x,s(h)}}}var gy=class{constructor(){this.map=[]}add(e,r,o){lwe(this,e,r,o)}consume(e){if(this.map.sort(function(a,i){return a[0]-i[0]}),this.map.length===0)return;let r=this.map.length,o=[];for(;r>0;)r-=1,o.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];o.push([...e]),e.length=0;let n=o.pop();for(;n;)e.push(...n),n=o.pop();this.map.length=0}};function lwe(t,e,r,o){let n=0;if(!(r===0&&o.length===0)){for(;n<t.map.length;){if(t.map[n][0]===e){t.map[n][1]+=r,t.map[n][2].push(...o);return}n+=1}t.map.push([e,r,o])}}function aH(t,e){let r=!1,o=[];for(;e<t.length;){let n=t[e];if(r){if(n[0]==="enter")n[1].type==="tableContent"&&o.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let a=o.length-1;o[a]=o[a]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return o}function Ak(){return{flow:{null:{tokenize:cwe,resolveAll:uwe}}}}function cwe(t,e,r){let o=this,n=0,a=0,i;return s;function s(C){let F=o.events.length-1;for(;F>-1;){let z=o.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}let N=F>-1?o.events[F][1].type:null,R=N==="tableHead"||N==="tableRow"?v:l;return R===v&&o.parser.lazy[o.now().line]?r(C):R(C)}function l(C){return t.enter("tableHead"),t.enter("tableRow"),c(C)}function c(C){return C===124||(i=!0,a+=1),u(C)}function u(C){return C===null?r(C):ie(C)?a>1?(a=0,o.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),m):r(C):Pe(C)?Ee(t,u,"whitespace")(C):(a+=1,i&&(i=!1,n+=1),C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),i=!0,u):(t.enter("data"),d(C)))}function d(C){return C===null||C===124||Xe(C)?(t.exit("data"),u(C)):(t.consume(C),C===92?p:d)}function p(C){return C===92||C===124?(t.consume(C),d):d(C)}function m(C){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(C):(t.enter("tableDelimiterRow"),i=!1,Pe(C)?Ee(t,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):h(C))}function h(C){return C===45||C===58?_(C):C===124?(i=!0,t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),g):w(C)}function g(C){return Pe(C)?Ee(t,_,"whitespace")(C):_(C)}function _(C){return C===58?(a+=1,i=!0,t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),x):C===45?(a+=1,x(C)):C===null||ie(C)?I(C):w(C)}function x(C){return C===45?(t.enter("tableDelimiterFiller"),b(C)):w(C)}function b(C){return C===45?(t.consume(C),b):C===58?(i=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),y):(t.exit("tableDelimiterFiller"),y(C))}function y(C){return Pe(C)?Ee(t,I,"whitespace")(C):I(C)}function I(C){return C===124?h(C):C===null||ie(C)?!i||n!==a?w(C):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(C)):w(C)}function w(C){return r(C)}function v(C){return t.enter("tableRow"),T(C)}function T(C){return C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),T):C===null||ie(C)?(t.exit("tableRow"),e(C)):Pe(C)?Ee(t,T,"whitespace")(C):(t.enter("data"),O(C))}function O(C){return C===null||C===124||Xe(C)?(t.exit("data"),T(C)):(t.consume(C),C===92?S:O)}function S(C){return C===92||C===124?(t.consume(C),O):O(C)}}function uwe(t,e){let r=-1,o=!0,n=0,a=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,c,u,d,p=new gy;for(;++r<t.length;){let m=t[r],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(iH(p,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",c,e]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(o=!0,d=void 0,a=[0,0,0,0],i=[0,r+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",u,e]])),n=h.type==="tableDelimiterRow"?2:u?3:1):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(o=!1,i[2]===0&&(a[1]!==0&&(i[0]=i[1],d=_y(p,e,a,n,void 0,d),a=[0,0,0,0]),i[2]=r)):h.type==="tableCellDivider"&&(o?o=!1:(a[1]!==0&&(i[0]=i[1],d=_y(p,e,a,n,void 0,d)),a=i,i=[a[1],r,0,0])):h.type==="tableHead"?(s=!0,l=r):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=r,a[1]!==0?(i[0]=i[1],d=_y(p,e,a,n,r,d)):i[1]!==0&&(d=_y(p,e,i,n,r,d)),n=0):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=r)}for(l!==0&&iH(p,e,l,c,u),p.consume(e.events),r=-1;++r<e.events.length;){let m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=aH(e.events,r))}return t}function _y(t,e,r,o,n,a){let i=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(a.end=Object.assign({},Gu(e.events,r[0])),t.add(r[0],0,[["exit",a,e]]));let l=Gu(e.events,r[1]);if(a={type:i,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",a,e]]),r[2]!==0){let c=Gu(e.events,r[2]),u=Gu(e.events,r[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(r[2],0,[["enter",d,e]]),o!==2){let p=e.events[r[2]],m=e.events[r[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let h=r[2]+1,g=r[3]-r[2]-1;t.add(h,g,[])}}t.add(r[3]+1,0,[["exit",d,e]])}return n!==void 0&&(a.end=Object.assign({},Gu(e.events,n)),t.add(n,0,[["exit",a,e]]),a=void 0),a}function iH(t,e,r,o,n){let a=[],i=Gu(e.events,r);n&&(n.end=Object.assign({},i),a.push(["exit",n,e])),o.end=Object.assign({},i),a.push(["exit",o,e]),t.add(r+1,0,a)}function Gu(t,e){let r=t[e],o=r[0]==="enter"?"start":"end";return r[1][o]}var dwe={tokenize:fwe};function Dk(){return{text:{91:dwe}}}function fwe(t,e,r){let o=this;return n;function n(l){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return Xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),i):r(l)}function i(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return ie(l)?e(l):Pe(l)?t.check({tokenize:pwe},e,r)(l):r(l)}}function pwe(t,e,r){return Ee(t,o,"whitespace");function o(n){return n===null?r(n):e(n)}}function sH(t){return oy([kk(),Pk(),Ok(t),Ak(),Dk()])}var lH={name:"@blinkk/root-cms",version:"1.4.9",author:"s@blinkk.com",license:"MIT",engines:{node:">=16.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"tsup-node --config=./core/tsup.config.ts","//":"NOTE: esbuild is used here because tsup doesn't currently support aliases.","build:ui":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui --watch",test:"pnpm build && firebase emulators:exec 'vitest run'","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@genkit-ai/ai":"0.5.2","@genkit-ai/core":"0.5.2","@genkit-ai/vertexai":"0.5.2","body-parser":"1.20.2",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","dts-dom":"3.7.0","fnv-plus":"1.3.1",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.2.19","@firebase/app-types":"0.9.0","@firebase/rules-unit-testing":"3.0.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@mantine/spotlight":"4.2.12","@preact/compat":"17.1.2","@tabler/icons-preact":"2.47.0","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"18.11.8",concurrently:"7.6.0",esbuild:"0.19.9",firebase:"10.5.2","firebase-admin":"11.11.1","firebase-functions":"4.8.0","firebase-tools":"12.9.1","highlight.js":"11.6.0","json-diff-kit":"1.0.29",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",preact:"10.19.3","preact-render-to-string":"6.3.1","preact-router":"4.1.2",react:"npm:@preact/compat@^17.1.2","react-dom":"npm:@preact/compat@^17.1.2","react-json-view-compare":"2.0.2",tsup:"8.0.1",typescript:"5.2.2",vite:"5.0.8",vitest:"0.34.6"},peerDependencies:{"@blinkk/root":"1.4.9","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function cH(){return f("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("g",{"clip-path":"url(#clip0_1_318)",children:[f("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),f("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),f("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),f("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),f("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),f("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),f("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),f("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),f("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),f("defs",{children:f("clipPath",{id:"clip0_1_318",children:f("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var ii="1.5";function me(t){return f("div",{className:"Layout",children:[f(me.Top,{}),f(me.Side,{}),f(me.Main,{...t,children:t.children}),f(me.Bottom,{})]})}me.Top=()=>{let t=window.__ROOT_CTX.rootConfig.projectName||window.__ROOT_CTX.rootConfig.projectId;return f("div",{className:"Layout__top",children:[f("a",{className:"Layout__top__logo",href:"/cms",children:f(cH,{})}),f("div",{className:"Layout__top__version",children:["v",lH.version]}),f("div",{className:"Layout__top__project",children:t})]})};me.Side=()=>{let[t]=sz(),e=t.url.replace(/\/*$/g,""),r=window.firebase.user,o=window.__ROOT_CTX.sidebar?.tools,n=window.__ROOT_CTX.experiments||{};return f("div",{className:"Layout__side",children:[f("div",{className:"Layout__side__buttons",children:[f(me.SideButton,{label:"Home",url:"/cms",active:e==="/cms",children:f(QS,{stroke:ii})}),f(me.SideButton,{label:"Content",url:"/cms/content",active:e.startsWith("/cms/content"),children:f(vl,{stroke:ii})}),f(me.SideButton,{label:"Releases",url:"/cms/releases",active:e.startsWith("/cms/releases"),children:f(Pu,{stroke:ii})}),f(me.SideButton,{label:"Data",url:"/cms/data",active:e.startsWith("/cms/data"),children:f(WS,{stroke:ii})}),f(me.SideButton,{label:"Assets",url:"/cms/assets",active:e.startsWith("/cms/assets"),children:f(tC,{stroke:ii})}),f(me.SideButton,{label:"Translations",url:"/cms/translations",active:e.startsWith("/cms/translations"),children:f(Ki,{stroke:ii})}),n.ai&&f(me.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:e.startsWith("/cms/ai"),children:f(wl,{stroke:ii})}),o&&f(Ae,{children:[f("div",{className:"Layout__side__divider"}),Object.entries(o).map(([a,i])=>f(me.SideButton,{className:"Layout__side__tool",label:i.label||"",url:`/cms/tools/${a}`,active:e.startsWith(`/cms/tools/${a}`),children:i.icon?f("img",{className:"Layout__side__tool__icon",src:i.icon,alt:i.label||""}):f(VS,{stroke:ii})})),f("div",{className:"Layout__side__divider"})]}),f(me.SideButton,{label:"Settings",url:"/cms/settings",active:e.startsWith("/cms/settings"),children:f(El,{stroke:ii})})]}),f("div",{className:"Layout__side__user",children:f(xe,{label:r.email,position:"right",withArrow:!0,children:f(kn,{src:r.photoURL,alt:r.email,size:30,radius:"xl"})})})]})};me.SideButton=t=>f(xe,{className:ke("Layout__side__button",t.className),label:t.label,position:"right",withArrow:!0,children:f("a",{className:ke(t.active&&"active"),href:t.url,children:t.children})});me.Main=t=>f("div",{className:"Layout__main",children:t.children});me.Bottom=()=>f("div",{className:"Layout__bottom"});var uH=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],Rk=[...uH,"svg"],Nk=["mp4","webm"],dH="https://lh3.googleusercontent.com/";async function Aa(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=await bwe(t),n=am(t.name),a=e?.preserveFilename?`${o}/${t.name}`:`${o}.${n}`,i=`${r}/uploads/${a}`,s=oz(window.firebase.storage,i);await tz(s,t),console.log(`uploaded ${i}`);let l={};l.filename=t.name,l.uploadedBy=window.firebase.user.email||"unknown",l.uploadedAt=String(Math.floor(new Date().getTime()));let c=`/${s.bucket}/${s.fullPath}`,u=`https://storage.googleapis.com${c}`;if(Rk.includes(n)){let p=await _we(t);if(l.width=p.width,l.height=p.height,!e?.disableGci&&uH.includes(n)){let m=await gwe(c);m&&(l.gcsPath=c,u=m)}}else if(Nk.includes(n)){let p=await xwe(u);l.width=p.width,l.height=p.height,console.log("video dimensions:",p)}let d=e?.cacheControl||"public, max-age=3600";return await rz(s,{cacheControl:d,customMetadata:ywe(l)}),console.log("updated meta data: ",l),{...l,src:u}}function am(t){return hwe(t.split(".").at(-1)||"")}function hwe(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function gwe(t){let e=window.__ROOT_CTX.rootConfig.gci;if(!e)return"";let r=new URLSearchParams({gcs:t}),o=`${e}/_/serving_url?${r.toString()}`,n=await window.fetch(o);if(n.status!==200){let i=await n.text();throw console.error(`failed to get gci url: ${o}`),console.error(i),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function _we(t){return new Promise((e,r)=>{let o=new FileReader;o.onload=()=>{let n=new Image;n.onload=()=>{e({width:n.width,height:n.height})},n.onerror=r,n.src=String(o.result)},o.onerror=r,o.readAsDataURL(t)})}async function xwe(t){return new Promise((e,r)=>{let o=document.createElement("video");o.addEventListener("loadedmetadata",()=>{let n={width:o.videoWidth,height:o.videoHeight};e(n),document.body.removeChild(o)},!1),o.addEventListener("error",()=>{r(new Error("Failed to load video metadata")),document.body.removeChild(o)},!1),o.className="sr-only",o.src=t,o.preload="metadata",document.body.appendChild(o)})}async function bwe(t){let e=await t.arrayBuffer(),r=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")}function ywe(t){let e={};return Object.entries(t).forEach(([r,o])=>{t[r]=String(o).trim()}),e}function ra(t){t||(t=6);let e=[],r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=r.length;for(let n=0;n<t;n++)e.push(r.charAt(Math.floor(Math.random()*o)));return e.join("")}function fH(t,e){return Math.random()*(e-t)+t}var vwe=!1,Iwe=`Lorem ipsum \u{1F955} dolor sit amet.
53
+ `;break}case-2:{i=e?" ":" ";break}case-1:{if(!e&&n)continue;i=" ";break}default:i=String.fromCharCode(a)}n=a===-2,o.push(i)}return o.join("")}var sk={};Jj(sk,{attentionMarkers:()=>Kve,contentInitial:()=>Hve,disable:()=>Xve,document:()=>Vve,flow:()=>jve,flowInitial:()=>$ve,insideSpan:()=>Wve,string:()=>qve,text:()=>Gve});var Vve={42:ho,43:ho,45:ho,48:ho,49:ho,50:ho,51:ho,52:ho,53:ho,54:ho,55:ho,56:ho,57:ho,62:ay},Hve={91:JC},$ve={[-2]:rm,[-1]:rm,32:rm},jve={35:tk,42:Ml,45:[my,Ml],60:ok,61:my,95:Ml,96:ly,126:ly},qve={38:sy,92:iy},Gve={[-5]:nm,[-4]:nm,[-3]:nm,33:ak,38:sy,42:tm,60:[YC,nk],91:ik,92:[ek,iy],93:Nl,95:tm,96:QC},Wve={null:[tm,DV]},Kve={null:[42,95]},Xve={null:[]};function lk(t){let r=oy([sk,...(t||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(SV),document:n(kV),flow:n(AV),string:n(RV),text:n(NV)};return o;function n(a){return i;function i(s){return BV(o,a,s)}}}function ck(t){for(;!uy(t););return t}var FV=/[\0\t\n\r]/g;function uk(){let t=1,e="",r=!0,o;return n;function n(a,i,s){let l=[],c,u,d,p,m;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),d=0,e="",r&&(a.charCodeAt(0)===65279&&d++,r=void 0);d<a.length;){if(FV.lastIndex=d,c=FV.exec(a),p=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(p),!c){e=a.slice(d);break}if(m===10&&d===p&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<p&&(l.push(a.slice(d,p)),t+=p-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:o=!0,t=1}d=p+1}return s&&(o&&l.push(-5),e&&l.push(e),l.push(null)),l}}var Yve=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zV(t){return t.replace(Yve,Qve)}function Qve(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),a=n===120||n===88;return ny(r.slice(a?2:1),a?16:10)}return Hu(r)||t}function ju(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?UV(t.position):"start"in t||"end"in t?UV(t):"line"in t||"column"in t?dk(t):""}function dk(t){return VV(t&&t.line)+":"+VV(t&&t.column)}function UV(t){return dk(t&&t.start)+"-"+dk(t&&t.end)}function VV(t){return t&&typeof t=="number"?t:1}var $V={}.hasOwnProperty;function fk(t,e,r){return typeof e!="string"&&(r=e,e=void 0),Zve(r)(ck(lk(r).document().write(uk()(t,e,!0))))}function Zve(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ft),autolinkProtocol:S,autolinkEmail:S,atxHeading:a(ao),blockQuote:a(st),characterEscape:S,characterReference:S,codeFenced:a(wt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(wt,i),codeText:a(mt,i),codeTextData:S,data:S,codeFlowValue:S,definition:a(zt),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(ot),hardBreakEscape:a(dt),hardBreakTrailing:a(dt),htmlFlow:a(fe,i),htmlFlowData:S,htmlText:a(fe,i),htmlTextData:S,image:a(go),label:i,link:a(ft),listItem:a(wr),listItemValue:p,listOrdered:a(Be,d),listUnordered:a(Be),paragraph:a(fr),reference:A,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(ao),strong:a(Vr),thematicBreak:a(W)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:be,autolinkProtocol:Oe,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:Ge,characterReference:et,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:C,codeIndented:l(x),codeText:l(B),codeTextData:C,data:C,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(R),htmlFlowData:C,htmlText:l(z),htmlTextData:C,image:l(V),label:G,labelText:U,lineEnding:F,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:k,resourceTitleString:Z,resource:te,setextHeading:l(O),setextHeadingLineSequence:T,setextHeadingText:v,strong:l(),thematicBreak:l()}};jV(e,(t||{}).mdastExtensions||[]);let r={};return o;function o(D){let $={type:"root",children:[]},J={stack:[$],tokenStack:[],config:e,enter:s,exit:c,buffer:i,resume:u,data:r},ye=[],je=-1;for(;++je<D.length;)if(D[je][1].type==="listOrdered"||D[je][1].type==="listUnordered")if(D[je][0]==="enter")ye.push(je);else{let nt=ye.pop();je=n(D,nt,je)}for(je=-1;++je<D.length;){let nt=e[D[je][0]];$V.call(nt,D[je][1].type)&&nt[D[je][1].type].call(Object.assign({sliceSerialize:D[je][2].sliceSerialize},J),D[je][1])}if(J.tokenStack.length>0){let nt=J.tokenStack[J.tokenStack.length-1];(nt[1]||HV).call(J,void 0,nt[0])}for($.position={start:os(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:os(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<e.transforms.length;)$=e.transforms[je]($)||$;return $}function n(D,$,J){let ye=$-1,je=-1,nt=!1,Fo,nr,Kt,hn;for(;++ye<=J;){let Hr=D[ye];switch(Hr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Hr[0]==="enter"?je++:je--,hn=void 0;break}case"lineEndingBlank":{Hr[0]==="enter"&&(Fo&&!hn&&!je&&!Kt&&(Kt=ye),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!je&&Hr[0]==="enter"&&Hr[1].type==="listItemPrefix"||je===-1&&Hr[0]==="exit"&&(Hr[1].type==="listUnordered"||Hr[1].type==="listOrdered")){if(Fo){let _o=ye;for(nr=void 0;_o--;){let xo=D[_o];if(xo[1].type==="lineEnding"||xo[1].type==="lineEndingBlank"){if(xo[0]==="exit")continue;nr&&(D[nr][1].type="lineEndingBlank",nt=!0),xo[1].type="lineEnding",nr=_o}else if(!(xo[1].type==="linePrefix"||xo[1].type==="blockQuotePrefix"||xo[1].type==="blockQuotePrefixWhitespace"||xo[1].type==="blockQuoteMarker"||xo[1].type==="listItemIndent"))break}Kt&&(!nr||Kt<nr)&&(Fo._spread=!0),Fo.end=Object.assign({},nr?D[nr][1].start:Hr[1].end),D.splice(nr||ye,0,["exit",Fo,Hr[2]]),ye++,J++}if(Hr[1].type==="listItemPrefix"){let _o={type:"listItem",_spread:!1,start:Object.assign({},Hr[1].start),end:void 0};Fo=_o,D.splice(ye,0,["enter",_o,Hr[2]]),ye++,J++,Kt=void 0,hn=!0}}}return D[$][1]._spread=nt,J}function a(D,$){return J;function J(ye){s.call(this,D(ye),ye),$&&$.call(this,ye)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(D,$,J){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([$,J]),D.position={start:os($.start),end:void 0}}function l(D){return $;function $(J){D&&D.call(this,J),c.call(this,J)}}function c(D,$){let J=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==D.type&&($?$.call(this,D,ye[0]):(ye[1]||HV).call(this,D,ye[0]));else throw new Error("Cannot close `"+D.type+"` ("+ju({start:D.start,end:D.end})+"): it\u2019s not open");J.position.end=os(D.end)}function u(){return XC(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){let $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function m(){let D=this.resume(),$=this.stack[this.stack.length-1];$.lang=D}function h(){let D=this.resume(),$=this.stack[this.stack.length-1];$.meta=D}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/(\r?\n|\r)$/g,"")}function b(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase()}function y(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function I(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function w(D){let $=this.stack[this.stack.length-1];if(!$.depth){let J=this.sliceSerialize(D).length;$.depth=J}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){let $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function S(D){let J=this.stack[this.stack.length-1].children,ye=J[J.length-1];(!ye||ye.type!=="text")&&(ye=_e(),ye.position={start:os(D.start),end:void 0},J.push(ye)),this.stack.push(ye)}function C(D){let $=this.stack.pop();$.value+=this.sliceSerialize(D),$.position.end=os(D.end)}function F(D){let $=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=$.children[$.children.length-1];J.position.end=os(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes($.type)&&(S.call(this,D),C.call(this,D))}function N(){this.data.atHardBreak=!0}function R(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function B(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function M(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function U(D){let $=this.sliceSerialize(D),J=this.stack[this.stack.length-2];J.label=zV($),J.identifier=mo($).toLowerCase()}function G(){let D=this.stack[this.stack.length-1],$=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let ye=D.children;J.children=ye}else J.alt=$}function k(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function Z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function te(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ce(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Se(D){this.data.characterReferenceType=D.type}function Ge(D){let $=this.sliceSerialize(D),J=this.data.characterReferenceType,ye;J?(ye=ny($,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Hu($);let je=this.stack[this.stack.length-1];je.value+=ye}function et(D){let $=this.stack.pop();$.position.end=os(D.end)}function Oe(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(D)}function be(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(D)}function st(){return{type:"blockquote",children:[]}}function wt(){return{type:"code",lang:null,meta:null,value:""}}function mt(){return{type:"inlineCode",value:""}}function zt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function ao(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function fe(){return{type:"html",value:""}}function go(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function Be(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function wr(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function fr(){return{type:"paragraph",children:[]}}function Vr(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function W(){return{type:"thematicBreak"}}}function os(t){return{line:t.line,column:t.column,offset:t.offset}}function jV(t,e){let r=-1;for(;++r<e.length;){let o=e[r];Array.isArray(o)?jV(t,o):Jve(t,o)}}function Jve(t,e){let r;for(r in e)if($V.call(e,r))switch(r){case"canContainEols":{let o=e[r];o&&t[r].push(...o);break}case"transforms":{let o=e[r];o&&t[r].push(...o);break}case"enter":case"exit":{let o=e[r];o&&Object.assign(t[r],o);break}}}function HV(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+ju({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+ju({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+ju({start:e.start,end:e.end})+") is still open")}function pk(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let o=0,n=r.indexOf(e);for(;n!==-1;)o++,n=r.indexOf(e,n+e.length);return o}function mk(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var qu=function(t){if(t==null)return oIe;if(typeof t=="function")return hy(t);if(typeof t=="object")return Array.isArray(t)?eIe(t):tIe(t);if(typeof t=="string")return rIe(t);throw new Error("Expected function, string, or object as test")};function eIe(t){let e=[],r=-1;for(;++r<t.length;)e[r]=qu(t[r]);return hy(o);function o(...n){let a=-1;for(;++a<e.length;)if(e[a].apply(this,n))return!0;return!1}}function tIe(t){let e=t;return hy(r);function r(o){let n=o,a;for(a in t)if(n[a]!==e[a])return!1;return!0}}function rIe(t){return hy(e);function e(r){return r&&r.type===t}}function hy(t){return e;function e(r,o,n){return!!(nIe(r)&&t.call(this,r,typeof o=="number"?o:void 0,n||void 0))}}function oIe(){return!0}function nIe(t){return t!==null&&typeof t=="object"&&"type"in t}var qV=[],GV=!0,hk=!1,WV="skip";function gk(t,e,r,o){let n;typeof e=="function"&&typeof r!="function"?(o=r,r=e):n=e;let a=qu(n),i=o?-1:1;s(t,void 0,[])();function s(l,c,u){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=qV,h,g,_;if((!e||a(l,c,u[u.length-1]||void 0))&&(m=aIe(r(l,u)),m[0]===hk))return m;if("children"in l&&l.children){let x=l;if(x.children&&m[0]!==WV)for(g=(o?x.children.length:-1)+i,_=u.concat(x);g>-1&&g<x.children.length;){let b=x.children[g];if(h=s(b,g,_)(),h[0]===hk)return h;g=typeof h[1]=="number"?h[1]:g+i}}return m}}}function aIe(t){return Array.isArray(t)?t:typeof t=="number"?[GV,t]:t==null?qV:[t]}function _k(t,e,r){let n=qu((r||{}).ignore||[]),a=iIe(e),i=-1;for(;++i<a.length;)gk(t,"text",s);function s(c,u){let d=-1,p;for(;++d<u.length;){let m=u[d],h=p?p.children:void 0;if(n(m,h?h.indexOf(m):void 0,p))return;p=m}if(p)return l(c,u)}function l(c,u){let d=u[u.length-1],p=a[i][0],m=a[i][1],h=0,_=d.children.indexOf(c),x=!1,b=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){let I=y.index,w={index:y.index,input:y.input,stack:[...u,c]},v=m(...y,w);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?p.lastIndex=I+1:(h!==I&&b.push({type:"text",value:c.value.slice(h,I)}),Array.isArray(v)?b.push(...v):v&&b.push(v),h=I+y[0].length,x=!0),!p.global)break;y=p.exec(c.value)}return x?(h<c.value.length&&b.push({type:"text",value:c.value.slice(h)}),d.children.splice(_,1,...b)):b=[c],_+b.length}}function iIe(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],o=-1;for(;++o<r.length;){let n=r[o];e.push([sIe(n[0]),lIe(n[1])])}return e}function sIe(t){return typeof t=="string"?new RegExp(mk(t),"g"):t}function lIe(t){return typeof t=="function"?t:function(){return t}}function bk(){return{transforms:[mIe],enter:{literalAutolink:cIe,literalAutolinkEmail:xk,literalAutolinkHttp:xk,literalAutolinkWww:xk},exit:{literalAutolink:pIe,literalAutolinkEmail:fIe,literalAutolinkHttp:uIe,literalAutolinkWww:dIe}}}function cIe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function xk(t){this.config.enter.autolinkProtocol.call(this,t)}function uIe(t){this.config.exit.autolinkProtocol.call(this,t)}function dIe(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function fIe(t){this.config.exit.autolinkEmail.call(this,t)}function pIe(t){this.exit(t)}function mIe(t){_k(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hIe],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,gIe]],{ignore:["link","linkReference"]})}function hIe(t,e,r,o,n){let a="";if(!KV(n)||(/^w/i.test(e)&&(r=e+r,e="",a="http://"),!_Ie(r)))return!1;let i=xIe(r+o);if(!i[0])return!1;let s={type:"link",title:null,url:a+e+i[0],children:[{type:"text",value:e+i[0]}]};return i[1]?[s,{type:"text",value:i[1]}]:s}function gIe(t,e,r,o){return!KV(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function _Ie(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function xIe(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],o=r.indexOf(")"),n=pk(t,"("),a=pk(t,")");for(;o!==-1&&n>a;)t+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),a++;return[t,r]}function KV(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Ta(r)||Dl(r))&&(!e||r!==47)}TIe.peek=PIe;function yk(){return{enter:{gfmFootnoteDefinition:yIe,gfmFootnoteDefinitionLabelString:vIe,gfmFootnoteCall:EIe,gfmFootnoteCallString:SIe},exit:{gfmFootnoteDefinition:wIe,gfmFootnoteDefinitionLabelString:IIe,gfmFootnoteCall:kIe,gfmFootnoteCallString:CIe}}}function yIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function vIe(){this.buffer()}function IIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function wIe(t){this.exit(t)}function EIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function SIe(){this.buffer()}function CIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function kIe(t){this.exit(t)}function TIe(t,e,r,o){let n=r.createTracker(o),a=n.move("[^"),i=r.enter("footnoteReference"),s=r.enter("reference");return a+=n.move(r.safe(r.associationId(t),{...n.current(),before:a,after:"]"})),s(),i(),a+=n.move("]"),a}function PIe(){return"["}RIe.peek=NIe;function vk(){return{canContainEols:["delete"],enter:{strikethrough:AIe},exit:{strikethrough:DIe}}}function AIe(t){this.enter({type:"delete",children:[]},t)}function DIe(t){this.exit(t)}function RIe(t,e,r,o){let n=r.createTracker(o),a=r.enter("strikethrough"),i=n.move("~~");return i+=r.containerPhrasing(t,{...n.current(),before:i,after:"~"}),i+=n.move("~~"),a(),i}function NIe(){return"~"}function wk(){return{enter:{table:LIe,tableData:XV,tableHeader:XV,tableRow:FIe},exit:{codeText:zIe,table:BIe,tableData:Ik,tableHeader:Ik,tableRow:Ik}}}function LIe(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function BIe(t){this.exit(t),this.data.inTable=void 0}function FIe(t){this.enter({type:"tableRow",children:[]},t)}function Ik(t){this.exit(t)}function XV(t){this.enter({type:"tableCell",children:[]},t)}function zIe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,UIe));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function UIe(t,e){return e==="|"?e:t}function Ek(){return{exit:{taskListCheckValueChecked:YV,taskListCheckValueUnchecked:YV,paragraph:HIe}}}function YV(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function HIe(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let o=r.children[0];if(o&&o.type==="text"){let n=e.children,a=-1,i;for(;++a<n.length;){let s=n[a];if(s.type==="paragraph"){i=s;break}}i===r&&(o.value=o.value.slice(1),o.value.length===0?r.children.shift():r.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,r.position.start=Object.assign({},o.position.start)))}}this.exit(t)}function Sk(){return[bk(),yk(),vk(),wk(),Ek()]}var jIe={tokenize:XIe,partial:!0},QV={tokenize:YIe,partial:!0},ZV={tokenize:QIe,partial:!0},JV={tokenize:ZIe,partial:!0},qIe={tokenize:JIe,partial:!0},eH={tokenize:WIe,previous:rH},tH={tokenize:KIe,previous:oH},ai={tokenize:GIe,previous:nH},Oa={};function kk(){return{text:Oa}}var Ll=48;for(;Ll<123;)Oa[Ll]=ai,Ll++,Ll===58?Ll=65:Ll===91&&(Ll=97);Oa[43]=ai;Oa[45]=ai;Oa[46]=ai;Oa[95]=ai;Oa[72]=[ai,tH];Oa[104]=[ai,tH];Oa[87]=[ai,eH];Oa[119]=[ai,eH];function GIe(t,e,r){let o=this,n,a;return i;function i(d){return!Ck(d)||!nH.call(o,o.previous)||Tk(o.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),s(d))}function s(d){return Ck(d)?(t.consume(d),s):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(qIe,u,c)(d):d===45||d===95||Or(d)?(a=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),n=!0,l}function u(d){return a&&n&&Pr(o.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function WIe(t,e,r){let o=this;return n;function n(i){return i!==87&&i!==119||!rH.call(o,o.previous)||Tk(o.events)?r(i):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(jIe,t.attempt(QV,t.attempt(ZV,a),r),r)(i))}function a(i){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(i)}}function KIe(t,e,r){let o=this,n="",a=!1;return i;function i(d){return(d===72||d===104)&&oH.call(o,o.previous)&&!Tk(o.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),t.consume(d),s):r(d)}function s(d){if(Pr(d)&&n.length<5)return n+=String.fromCodePoint(d),t.consume(d),s;if(d===58){let p=n.toLowerCase();if(p==="http"||p==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),a?c:(a=!0,l)):r(d)}function c(d){return d===null||Al(d)||Xe(d)||Ta(d)||Dl(d)?r(d):t.attempt(QV,t.attempt(ZV,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function XIe(t,e,r){let o=0;return n;function n(i){return(i===87||i===119)&&o<3?(o++,t.consume(i),n):i===46&&o===3?(t.consume(i),a):r(i)}function a(i){return i===null?r(i):e(i)}}function YIe(t,e,r){let o,n,a;return i;function i(c){return c===46||c===95?t.check(JV,l,s)(c):c===null||Xe(c)||Ta(c)||c!==45&&Dl(c)?l(c):(a=!0,t.consume(c),i)}function s(c){return c===95?o=!0:(n=o,o=void 0),t.consume(c),i}function l(c){return n||o||!a?r(c):e(c)}}function QIe(t,e){let r=0,o=0;return n;function n(i){return i===40?(r++,t.consume(i),n):i===41&&o<r?a(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?t.check(JV,e,a)(i):i===null||Xe(i)||Ta(i)?e(i):(t.consume(i),n)}function a(i){return i===41&&o++,t.consume(i),n}}function ZIe(t,e,r){return o;function o(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(t.consume(s),o):s===38?(t.consume(s),a):s===93?(t.consume(s),n):s===60||s===null||Xe(s)||Ta(s)?e(s):r(s)}function n(s){return s===null||s===40||s===91||Xe(s)||Ta(s)?e(s):o(s)}function a(s){return Pr(s)?i(s):r(s)}function i(s){return s===59?(t.consume(s),o):Pr(s)?(t.consume(s),i):r(s)}}function JIe(t,e,r){return o;function o(a){return t.consume(a),n}function n(a){return Or(a)?r(a):e(a)}}function rH(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Xe(t)}function oH(t){return!Pr(t)}function nH(t){return!(t===47||Ck(t))}function Ck(t){return t===43||t===45||t===46||t===95||Or(t)}function Tk(t){let e=t.length,r=!1;for(;e--;){let o=t[e][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){r=!0;break}if(o._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var ewe={tokenize:swe,partial:!0};function Pk(){return{document:{91:{tokenize:nwe,continuation:{tokenize:awe},exit:iwe}},text:{91:{tokenize:owe},93:{add:"after",tokenize:twe,resolveTo:rwe}}}}function twe(t,e,r){let o=this,n=o.events.length,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i;for(;n--;){let l=o.events[n][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return r(l);let c=mo(o.sliceSerialize({start:i.end,end:o.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function rwe(t,e){let r=t.length,o;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){o=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",a,e],["exit",a,e],["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function owe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a=0,i;return s;function s(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?r(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(d){if(a>999||d===93&&!i||d===null||d===91||Xe(d))return r(d);if(d===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return n.includes(mo(o.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Xe(d)||(i=!0),a++,t.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(t.consume(d),a++,c):c(d)}}function nwe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a,i=0,s;return l;function l(h){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):r(h)}function u(h){if(i>999||h===93&&!s||h===null||h===91||Xe(h))return r(h);if(h===93){t.exit("chunkString");let g=t.exit("gfmFootnoteDefinitionLabelString");return a=mo(o.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Xe(h)||(s=!0),i++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),i++,u):u(h)}function p(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),n.includes(a)||n.push(a),Ee(t,m,"gfmFootnoteDefinitionWhitespace")):r(h)}function m(h){return e(h)}}function awe(t,e,r){return t.check(Pa,e,t.attempt(ewe,e,r))}function iwe(t){t.exit("gfmFootnoteDefinition")}function swe(t,e,r){let o=this;return Ee(t,n,"gfmFootnoteDefinitionIndent",5);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?e(a):r(a)}}function Ok(t){let r=(t||{}).singleTilde,o={tokenize:a,resolveAll:n};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function n(i,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let c=l;for(;c--;)if(i[c][0]==="exit"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[c][1].end.offset-i[c][1].start.offset){i[l][1].type="strikethroughSequence",i[c][1].type="strikethroughSequence";let u={type:"strikethrough",start:Object.assign({},i[c][1].start),end:Object.assign({},i[l][1].end)},d={type:"strikethroughText",start:Object.assign({},i[c][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",u,s],["enter",i[c][1],s],["exit",i[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Ir(p,p.length,0,rs(m,i.slice(c+1,l),s)),Ir(p,p.length,0,[["exit",d,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",u,s]]),Ir(i,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function a(i,s,l){let c=this.previous,u=this.events,d=0;return p;function p(h){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let g=$u(c);if(h===126)return d>1?l(h):(i.consume(h),d++,m);if(d<2&&!r)return l(h);let _=i.exit("strikethroughSequenceTemporary"),x=$u(h);return _._open=!x||x===2&&!!g,_._close=!g||g===2&&!!x,s(h)}}}var gy=class{constructor(){this.map=[]}add(e,r,o){lwe(this,e,r,o)}consume(e){if(this.map.sort(function(a,i){return a[0]-i[0]}),this.map.length===0)return;let r=this.map.length,o=[];for(;r>0;)r-=1,o.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];o.push([...e]),e.length=0;let n=o.pop();for(;n;)e.push(...n),n=o.pop();this.map.length=0}};function lwe(t,e,r,o){let n=0;if(!(r===0&&o.length===0)){for(;n<t.map.length;){if(t.map[n][0]===e){t.map[n][1]+=r,t.map[n][2].push(...o);return}n+=1}t.map.push([e,r,o])}}function aH(t,e){let r=!1,o=[];for(;e<t.length;){let n=t[e];if(r){if(n[0]==="enter")n[1].type==="tableContent"&&o.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let a=o.length-1;o[a]=o[a]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return o}function Ak(){return{flow:{null:{tokenize:cwe,resolveAll:uwe}}}}function cwe(t,e,r){let o=this,n=0,a=0,i;return s;function s(C){let F=o.events.length-1;for(;F>-1;){let z=o.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}let N=F>-1?o.events[F][1].type:null,R=N==="tableHead"||N==="tableRow"?v:l;return R===v&&o.parser.lazy[o.now().line]?r(C):R(C)}function l(C){return t.enter("tableHead"),t.enter("tableRow"),c(C)}function c(C){return C===124||(i=!0,a+=1),u(C)}function u(C){return C===null?r(C):ie(C)?a>1?(a=0,o.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),m):r(C):Pe(C)?Ee(t,u,"whitespace")(C):(a+=1,i&&(i=!1,n+=1),C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),i=!0,u):(t.enter("data"),d(C)))}function d(C){return C===null||C===124||Xe(C)?(t.exit("data"),u(C)):(t.consume(C),C===92?p:d)}function p(C){return C===92||C===124?(t.consume(C),d):d(C)}function m(C){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(C):(t.enter("tableDelimiterRow"),i=!1,Pe(C)?Ee(t,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):h(C))}function h(C){return C===45||C===58?_(C):C===124?(i=!0,t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),g):w(C)}function g(C){return Pe(C)?Ee(t,_,"whitespace")(C):_(C)}function _(C){return C===58?(a+=1,i=!0,t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),x):C===45?(a+=1,x(C)):C===null||ie(C)?I(C):w(C)}function x(C){return C===45?(t.enter("tableDelimiterFiller"),b(C)):w(C)}function b(C){return C===45?(t.consume(C),b):C===58?(i=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),y):(t.exit("tableDelimiterFiller"),y(C))}function y(C){return Pe(C)?Ee(t,I,"whitespace")(C):I(C)}function I(C){return C===124?h(C):C===null||ie(C)?!i||n!==a?w(C):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(C)):w(C)}function w(C){return r(C)}function v(C){return t.enter("tableRow"),T(C)}function T(C){return C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),T):C===null||ie(C)?(t.exit("tableRow"),e(C)):Pe(C)?Ee(t,T,"whitespace")(C):(t.enter("data"),O(C))}function O(C){return C===null||C===124||Xe(C)?(t.exit("data"),T(C)):(t.consume(C),C===92?S:O)}function S(C){return C===92||C===124?(t.consume(C),O):O(C)}}function uwe(t,e){let r=-1,o=!0,n=0,a=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,c,u,d,p=new gy;for(;++r<t.length;){let m=t[r],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(iH(p,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",c,e]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(o=!0,d=void 0,a=[0,0,0,0],i=[0,r+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",u,e]])),n=h.type==="tableDelimiterRow"?2:u?3:1):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(o=!1,i[2]===0&&(a[1]!==0&&(i[0]=i[1],d=_y(p,e,a,n,void 0,d),a=[0,0,0,0]),i[2]=r)):h.type==="tableCellDivider"&&(o?o=!1:(a[1]!==0&&(i[0]=i[1],d=_y(p,e,a,n,void 0,d)),a=i,i=[a[1],r,0,0])):h.type==="tableHead"?(s=!0,l=r):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=r,a[1]!==0?(i[0]=i[1],d=_y(p,e,a,n,r,d)):i[1]!==0&&(d=_y(p,e,i,n,r,d)),n=0):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=r)}for(l!==0&&iH(p,e,l,c,u),p.consume(e.events),r=-1;++r<e.events.length;){let m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=aH(e.events,r))}return t}function _y(t,e,r,o,n,a){let i=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(a.end=Object.assign({},Gu(e.events,r[0])),t.add(r[0],0,[["exit",a,e]]));let l=Gu(e.events,r[1]);if(a={type:i,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",a,e]]),r[2]!==0){let c=Gu(e.events,r[2]),u=Gu(e.events,r[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(r[2],0,[["enter",d,e]]),o!==2){let p=e.events[r[2]],m=e.events[r[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let h=r[2]+1,g=r[3]-r[2]-1;t.add(h,g,[])}}t.add(r[3]+1,0,[["exit",d,e]])}return n!==void 0&&(a.end=Object.assign({},Gu(e.events,n)),t.add(n,0,[["exit",a,e]]),a=void 0),a}function iH(t,e,r,o,n){let a=[],i=Gu(e.events,r);n&&(n.end=Object.assign({},i),a.push(["exit",n,e])),o.end=Object.assign({},i),a.push(["exit",o,e]),t.add(r+1,0,a)}function Gu(t,e){let r=t[e],o=r[0]==="enter"?"start":"end";return r[1][o]}var dwe={tokenize:fwe};function Dk(){return{text:{91:dwe}}}function fwe(t,e,r){let o=this;return n;function n(l){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return Xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),i):r(l)}function i(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return ie(l)?e(l):Pe(l)?t.check({tokenize:pwe},e,r)(l):r(l)}}function pwe(t,e,r){return Ee(t,o,"whitespace");function o(n){return n===null?r(n):e(n)}}function sH(t){return oy([kk(),Pk(),Ok(t),Ak(),Dk()])}var lH={name:"@blinkk/root-cms",version:"1.4.11",author:"s@blinkk.com",license:"MIT",engines:{node:">=16.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"tsup-node --config=./core/tsup.config.ts","//":"NOTE: esbuild is used here because tsup doesn't currently support aliases.","build:ui":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui --watch",test:"pnpm build && firebase emulators:exec 'vitest run'","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@genkit-ai/ai":"0.5.2","@genkit-ai/core":"0.5.2","@genkit-ai/vertexai":"0.5.2","body-parser":"1.20.2",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","dts-dom":"3.7.0","fnv-plus":"1.3.1",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.2.19","@firebase/app-types":"0.9.0","@firebase/rules-unit-testing":"3.0.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@mantine/spotlight":"4.2.12","@preact/compat":"17.1.2","@tabler/icons-preact":"2.47.0","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"18.11.8",concurrently:"7.6.0",esbuild:"0.19.9",firebase:"10.5.2","firebase-admin":"11.11.1","firebase-functions":"4.8.0","firebase-tools":"12.9.1","highlight.js":"11.6.0","json-diff-kit":"1.0.29",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",preact:"10.19.3","preact-render-to-string":"6.3.1","preact-router":"4.1.2",react:"npm:@preact/compat@^17.1.2","react-dom":"npm:@preact/compat@^17.1.2","react-json-view-compare":"2.0.2",tsup:"8.0.1",typescript:"5.2.2",vite:"5.0.8",vitest:"0.34.6"},peerDependencies:{"@blinkk/root":"1.4.11","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function cH(){return f("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("g",{"clip-path":"url(#clip0_1_318)",children:[f("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),f("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),f("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),f("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),f("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),f("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),f("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),f("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),f("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),f("defs",{children:f("clipPath",{id:"clip0_1_318",children:f("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var ii="1.5";function me(t){return f("div",{className:"Layout",children:[f(me.Top,{}),f(me.Side,{}),f(me.Main,{...t,children:t.children}),f(me.Bottom,{})]})}me.Top=()=>{let t=window.__ROOT_CTX.rootConfig.projectName||window.__ROOT_CTX.rootConfig.projectId;return f("div",{className:"Layout__top",children:[f("a",{className:"Layout__top__logo",href:"/cms",children:f(cH,{})}),f("div",{className:"Layout__top__version",children:["v",lH.version]}),f("div",{className:"Layout__top__project",children:t})]})};me.Side=()=>{let[t]=sz(),e=t.url.replace(/\/*$/g,""),r=window.firebase.user,o=window.__ROOT_CTX.sidebar?.tools,n=window.__ROOT_CTX.experiments||{};return f("div",{className:"Layout__side",children:[f("div",{className:"Layout__side__buttons",children:[f(me.SideButton,{label:"Home",url:"/cms",active:e==="/cms",children:f(QS,{stroke:ii})}),f(me.SideButton,{label:"Content",url:"/cms/content",active:e.startsWith("/cms/content"),children:f(vl,{stroke:ii})}),f(me.SideButton,{label:"Releases",url:"/cms/releases",active:e.startsWith("/cms/releases"),children:f(Pu,{stroke:ii})}),f(me.SideButton,{label:"Data",url:"/cms/data",active:e.startsWith("/cms/data"),children:f(WS,{stroke:ii})}),f(me.SideButton,{label:"Assets",url:"/cms/assets",active:e.startsWith("/cms/assets"),children:f(tC,{stroke:ii})}),f(me.SideButton,{label:"Translations",url:"/cms/translations",active:e.startsWith("/cms/translations"),children:f(Ki,{stroke:ii})}),n.ai&&f(me.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:e.startsWith("/cms/ai"),children:f(wl,{stroke:ii})}),o&&f(Ae,{children:[f("div",{className:"Layout__side__divider"}),Object.entries(o).map(([a,i])=>f(me.SideButton,{className:"Layout__side__tool",label:i.label||"",url:`/cms/tools/${a}`,active:e.startsWith(`/cms/tools/${a}`),children:i.icon?f("img",{className:"Layout__side__tool__icon",src:i.icon,alt:i.label||""}):f(VS,{stroke:ii})})),f("div",{className:"Layout__side__divider"})]}),f(me.SideButton,{label:"Settings",url:"/cms/settings",active:e.startsWith("/cms/settings"),children:f(El,{stroke:ii})})]}),f("div",{className:"Layout__side__user",children:f(xe,{label:r.email,position:"right",withArrow:!0,children:f(kn,{src:r.photoURL,alt:r.email,size:30,radius:"xl"})})})]})};me.SideButton=t=>f(xe,{className:ke("Layout__side__button",t.className),label:t.label,position:"right",withArrow:!0,children:f("a",{className:ke(t.active&&"active"),href:t.url,children:t.children})});me.Main=t=>f("div",{className:"Layout__main",children:t.children});me.Bottom=()=>f("div",{className:"Layout__bottom"});var uH=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],Rk=[...uH,"svg"],Nk=["mp4","webm"],dH="https://lh3.googleusercontent.com/";async function Aa(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=await bwe(t),n=am(t.name),a=e?.preserveFilename?`${o}/${t.name}`:`${o}.${n}`,i=`${r}/uploads/${a}`,s=oz(window.firebase.storage,i);await tz(s,t),console.log(`uploaded ${i}`);let l={};l.filename=t.name,l.uploadedBy=window.firebase.user.email||"unknown",l.uploadedAt=String(Math.floor(new Date().getTime()));let c=`/${s.bucket}/${s.fullPath}`,u=`https://storage.googleapis.com${c}`;if(Rk.includes(n)){let p=await _we(t);if(l.width=p.width,l.height=p.height,!e?.disableGci&&uH.includes(n)){let m=await gwe(c);m&&(l.gcsPath=c,u=m)}}else if(Nk.includes(n)){let p=await xwe(u);l.width=p.width,l.height=p.height,console.log("video dimensions:",p)}let d=e?.cacheControl||"public, max-age=31536000";return await rz(s,{cacheControl:d,customMetadata:ywe(l)}),console.log("updated meta data: ",l),{...l,src:u}}function am(t){return hwe(t.split(".").at(-1)||"")}function hwe(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function gwe(t){let e=window.__ROOT_CTX.rootConfig.gci;if(!e)return"";let r=new URLSearchParams({gcs:t}),o=`${e}/_/serving_url?${r.toString()}`,n=await window.fetch(o);if(n.status!==200){let i=await n.text();throw console.error(`failed to get gci url: ${o}`),console.error(i),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function _we(t){return new Promise((e,r)=>{let o=new FileReader;o.onload=()=>{let n=new Image;n.onload=()=>{e({width:n.width,height:n.height})},n.onerror=r,n.src=String(o.result)},o.onerror=r,o.readAsDataURL(t)})}async function xwe(t){return new Promise((e,r)=>{let o=document.createElement("video");o.addEventListener("loadedmetadata",()=>{let n={width:o.videoWidth,height:o.videoHeight};e(n),document.body.removeChild(o)},!1),o.addEventListener("error",()=>{r(new Error("Failed to load video metadata")),document.body.removeChild(o)},!1),o.className="sr-only",o.src=t,o.preload="metadata",document.body.appendChild(o)})}async function bwe(t){let e=await t.arrayBuffer(),r=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")}function ywe(t){let e={};return Object.entries(t).forEach(([r,o])=>{t[r]=String(o).trim()}),e}function ra(t){t||(t=6);let e=[],r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=r.length;for(let n=0;n<t;n++)e.push(r.charAt(Math.floor(Math.random()*o)));return e.join("")}function fH(t,e){return Math.random()*(e-t)+t}var vwe=!1,Iwe=`Lorem ipsum \u{1F955} dolor sit amet.
54
54
 
55
55
  \`\`\`jsx
56
56
  import React, { useState, useEffect } from 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkk/root-cms",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "author": "s@blinkk.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -117,10 +117,10 @@
117
117
  "typescript": "5.2.2",
118
118
  "vite": "5.0.8",
119
119
  "vitest": "0.34.6",
120
- "@blinkk/root": "1.4.9"
120
+ "@blinkk/root": "1.4.11"
121
121
  },
122
122
  "peerDependencies": {
123
- "@blinkk/root": "1.4.9",
123
+ "@blinkk/root": "1.4.11",
124
124
  "firebase-admin": ">=11",
125
125
  "firebase-functions": ">=4",
126
126
  "preact": ">=10",