@blinkk/root-cms 2.2.1-alpha.0 → 2.2.1-alpha.2

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
@@ -83,7 +83,7 @@ function convertOneOfTypes(collection) {
83
83
  // package.json
84
84
  var package_default = {
85
85
  name: "@blinkk/root-cms",
86
- version: "3.0.0",
86
+ version: "2.2.1-alpha.2",
87
87
  author: "s@blinkk.com",
88
88
  license: "MIT",
89
89
  engines: {
@@ -196,7 +196,7 @@ var package_default = {
196
196
  "@mantine/modals": "4.2.12",
197
197
  "@mantine/notifications": "4.2.12",
198
198
  "@mantine/spotlight": "4.2.12",
199
- "@preact/compat": "17.1.2",
199
+ "@preact/compat": "18.3.1",
200
200
  "@tabler/icons-preact": "2.47.0",
201
201
  "@types/body-parser": "1.19.3",
202
202
  "@types/fnv-plus": "1.3.2",
@@ -222,8 +222,8 @@ var package_default = {
222
222
  preact: "10.27.1",
223
223
  "preact-render-to-string": "6.6.1",
224
224
  "preact-router": "4.1.2",
225
- react: "npm:@preact/compat@^17.1.2",
226
- "react-dom": "npm:@preact/compat@^17.1.2",
225
+ react: "npm:@preact/compat@18.3.1",
226
+ "react-dom": "npm:@preact/compat@18.3.1",
227
227
  "react-json-view-compare": "2.0.2",
228
228
  tsup: "8.5.0",
229
229
  typescript: "5.9.2",
@@ -232,7 +232,7 @@ var package_default = {
232
232
  yjs: "13.6.27"
233
233
  },
234
234
  peerDependencies: {
235
- "@blinkk/root": "2.1.1",
235
+ "@blinkk/root": "2.2.1-alpha.2",
236
236
  "firebase-admin": ">=11",
237
237
  "firebase-functions": ">=4",
238
238
  preact: ">=10",
package/dist/plugin.js CHANGED
@@ -2428,7 +2428,7 @@ function api(server, options) {
2428
2428
  // package.json
2429
2429
  var package_default = {
2430
2430
  name: "@blinkk/root-cms",
2431
- version: "3.0.0",
2431
+ version: "2.2.1-alpha.2",
2432
2432
  author: "s@blinkk.com",
2433
2433
  license: "MIT",
2434
2434
  engines: {
@@ -2541,7 +2541,7 @@ var package_default = {
2541
2541
  "@mantine/modals": "4.2.12",
2542
2542
  "@mantine/notifications": "4.2.12",
2543
2543
  "@mantine/spotlight": "4.2.12",
2544
- "@preact/compat": "17.1.2",
2544
+ "@preact/compat": "18.3.1",
2545
2545
  "@tabler/icons-preact": "2.47.0",
2546
2546
  "@types/body-parser": "1.19.3",
2547
2547
  "@types/fnv-plus": "1.3.2",
@@ -2567,8 +2567,8 @@ var package_default = {
2567
2567
  preact: "10.27.1",
2568
2568
  "preact-render-to-string": "6.6.1",
2569
2569
  "preact-router": "4.1.2",
2570
- react: "npm:@preact/compat@^17.1.2",
2571
- "react-dom": "npm:@preact/compat@^17.1.2",
2570
+ react: "npm:@preact/compat@18.3.1",
2571
+ "react-dom": "npm:@preact/compat@18.3.1",
2572
2572
  "react-json-view-compare": "2.0.2",
2573
2573
  tsup: "8.5.0",
2574
2574
  typescript: "5.9.2",
@@ -2577,7 +2577,7 @@ var package_default = {
2577
2577
  yjs: "13.6.27"
2578
2578
  },
2579
2579
  peerDependencies: {
2580
- "@blinkk/root": "2.1.1",
2580
+ "@blinkk/root": "2.2.1-alpha.2",
2581
2581
  "firebase-admin": ">=11",
2582
2582
  "firebase-functions": ">=4",
2583
2583
  preact: ">=10",
package/dist/ui/ui.js CHANGED
@@ -60,7 +60,7 @@ Content-Type: `+c.contentType+`\r
60
60
  `));let r=[],o=t.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(let n=0;n<o.length;n++){let i=o[n];n%2&&!e.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r}we();function Fe(...t){return t.filter(e=>!!e).join(" ")||void 0}_o();_o();var TRe=0,Y1t=Array.isArray;function p(t,e,r,o,n,i){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--TRe,__i:-1,__u:0,__source:n,__self:i};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return wt.vnode&&wt.vnode(c),c}function nQ(t){let{oldCode:e,newCode:r,className:o=""}=t,n=De(()=>bM(e,r),[e,r]),i=W(null);U(()=>{if(i.current){let s=i.current.querySelector(".JsDiff__diffLine--added, .JsDiff__diffLine--removed");s&&s.scrollIntoView({behavior:"smooth",block:"center"})}},[e,r]);let a=()=>{let s=[],l=0;return n.forEach((c,u)=>{let d=c.added?"+":c.removed?"-":" ",f=c.value.split(`
61
61
  `);f.forEach((m,h)=>{(m.length>0||h<f.length-1)&&s.push(p("div",{className:Fe("JsDiff__diffLine",c.added&&"JsDiff__diffLine--added",c.removed&&"JsDiff__diffLine--removed",!c.added&&!c.removed&&"JsDiff__diffLine--unchanged"),children:[p("span",{className:"JsDiff__lineNumber",children:++l}),p("span",{className:"JsDiff__lineContent",children:[p("span",{className:"JsDiff__sign",children:d}),p("span",{children:m||" "})]})]},`${u}-${h}`))})}),s};return p("div",{className:Fe("JsDiff__container",o),children:p("div",{className:"JsDiff__content",ref:i,children:a()})})}var dee=Dp(uee(),1);var RM=dee.default;var OLe={};function MM(t,e){let r=e||OLe,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return pee(t,o,n)}function pee(t,e,r){if(PLe(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 fee(t.children,e,r)}return Array.isArray(t)?fee(t,e,r):""}function fee(t,e,r){let o=[],n=-1;for(;++n<t.length;)o[n]=pee(t[n],e,r);return o.join("")}function PLe(t){return!!(t&&typeof t=="object")}var mee=document.createElement("i");function hh(t){let e="&"+t+";";mee.innerHTML=e;let r=mee.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===e?!1:r}function ko(t,e,r,o){let n=t.length,i=0,a;if(e<0?e=-e>n?0:n+e:e=e>n?n:e,r=r>0?r:0,o.length<1e4)a=Array.from(o),a.unshift(e,r),t.splice(...a);else for(r&&t.splice(e,r);i<o.length;)a=o.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function si(t,e){return t.length>0?(ko(t,t.length,0,e),t):e}var hee={}.hasOwnProperty;function CS(t){let e={},r=-1;for(;++r<t.length;)ALe(e,t[r]);return e}function ALe(t,e){let r;for(r in e){let n=(hee.call(t,r)?t[r]:void 0)||(t[r]={}),i=e[r],a;if(i)for(a in i){hee.call(n,a)||(n[a]=[]);let s=i[a];DLe(n[a],Array.isArray(s)?s:s?[s]:[])}}}function DLe(t,e){let r=-1,o=[];for(;++r<e.length;)(e[r].add==="after"?t:o).push(e[r]);ko(t,0,0,o)}function TS(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 Hn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Fo=bu(/[A-Za-z]/),Bo=bu(/[\dA-Za-z]/),gee=bu(/[#-'*+\--9=?A-Z^-~]/);function Ef(t){return t!==null&&(t<32||t===127)}var Ab=bu(/\d/),_ee=bu(/[\dA-Fa-f]/),xee=bu(/[!-/:-@[-`{-~]/);function ke(t){return t!==null&&t<-2}function Pt(t){return t!==null&&(t<0||t===32)}function lt(t){return t===-2||t===-1||t===32}var Sf=bu(/\p{P}|\p{S}/u),rl=bu(/\s/);function bu(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function it(t,e,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,i=0;return a;function a(l){return lt(l)?(t.enter(r),s(l)):e(l)}function s(l){return lt(l)&&i++<n?(t.consume(l),s):(t.exit(r),e(l))}}var bee={tokenize:RLe};function RLe(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"),it(t,e,"linePrefix")}function n(s){return t.enter("paragraph"),i(s)}function i(s){let l=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(s)}function a(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return ke(s)?(t.consume(s),t.exit("chunkText"),i):(t.consume(s),a)}}var vee={tokenize:MLe},yee={tokenize:LLe};function MLe(t){let e=this,r=[],o=0,n,i,a;return s;function s(v){if(o<r.length){let S=r[o];return e.containerState=S[1],t.attempt(S[0].continuation,l,c)(v)}return c(v)}function l(v){if(o++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,n&&y();let S=e.events.length,N=S,I;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){I=e.events[N][1].end;break}b(o);let E=S;for(;E<e.events.length;)e.events[E][1].end=Object.assign({},I),E++;return ko(e.events,N+1,0,e.events.slice(S)),e.events.length=E,c(v)}return s(v)}function c(v){if(o===r.length){if(!n)return f(v);if(n.currentConstruct&&n.currentConstruct.concrete)return h(v);e.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(yee,u,d)(v)}function u(v){return n&&y(),b(o),f(v)}function d(v){return e.parser.lazy[e.now().line]=o!==r.length,a=e.now().offset,h(v)}function f(v){return e.containerState={},t.attempt(yee,m,h)(v)}function m(v){return o++,r.push([e.currentConstruct,e.containerState]),f(v)}function h(v){if(v===null){n&&y(),b(0),t.consume(v);return}return n=n||e.parser.flow(e.now()),t.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:n}),g(v)}function g(v){if(v===null){_(t.exit("chunkFlow"),!0),b(0),t.consume(v);return}return ke(v)?(t.consume(v),_(t.exit("chunkFlow")),o=0,e.interrupt=void 0,s):(t.consume(v),g)}function _(v,S){let N=e.sliceStream(v);if(S&&N.push(null),v.previous=i,i&&(i.next=v),i=v,n.defineSkip(v.start),n.write(N),e.parser.lazy[v.start.line]){let I=n.events.length;for(;I--;)if(n.events[I][1].start.offset<a&&(!n.events[I][1].end||n.events[I][1].end.offset>a))return;let E=e.events.length,w=E,C,T;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){if(C){T=e.events[w][1].end;break}C=!0}for(b(o),I=E;I<e.events.length;)e.events[I][1].end=Object.assign({},T),I++;ko(e.events,w+1,0,e.events.slice(E)),e.events.length=I}}function b(v){let S=r.length;for(;S-- >v;){let N=r[S];e.containerState=N[1],N[0].exit.call(e,t)}r.length=v}function y(){n.write([null]),i=void 0,n=void 0,e.containerState._closeFlow=void 0}}function LLe(t,e,r){return it(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gh(t){if(t===null||Pt(t)||rl(t))return 1;if(Sf(t))return 2}function yu(t,e,r){let o=[],n=-1;for(;++n<t.length;){let i=t[n].resolveAll;i&&!o.includes(i)&&(e=i(e,r),o.push(i))}return e}var Db={name:"attention",tokenize:BLe,resolveAll:FLe};function FLe(t,e){let r=-1,o,n,i,a,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),f=Object.assign({},t[r][1].start);Iee(d,-l),Iee(f,l),a={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:f},i={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({},a.start),end:Object.assign({},s.end)},t[o][1].end=Object.assign({},a.start),t[r][1].start=Object.assign({},s.end),c=[],t[o][1].end.offset-t[o][1].start.offset&&(c=si(c,[["enter",t[o][1],e],["exit",t[o][1],e]])),c=si(c,[["enter",n,e],["enter",a,e],["exit",a,e],["enter",i,e]]),c=si(c,yu(e.parser.constructs.insideSpan.null,t.slice(o+1,r),e)),c=si(c,[["exit",i,e],["enter",s,e],["exit",s,e],["exit",n,e]]),t[r][1].end.offset-t[r][1].start.offset?(u=2,c=si(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):u=0,ko(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 BLe(t,e){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=gh(o),i;return a;function a(l){return i=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===i)return t.consume(l),s;let c=t.exit("attentionSequence"),u=gh(l),d=!u||u===2&&n||r.includes(l),f=!n||n===2&&u||r.includes(o);return c._open=!!(i===42?d:d&&(n||!f)),c._close=!!(i===42?f:f&&(u||!d)),e(l)}}function Iee(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var LM={name:"autolink",tokenize:$Le};function $Le(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"),i}function i(m){return Fo(m)?(t.consume(m),a):m===64?r(m):c(m)}function a(m){return m===43||m===45||m===46||Bo(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||Bo(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||Ef(m)?r(m):(t.consume(m),l)}function c(m){return m===64?(t.consume(m),u):gee(m)?(t.consume(m),c):r(m)}function u(m){return Bo(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):f(m)}function f(m){if((m===45||Bo(m))&&o++<63){let h=m===45?f:d;return t.consume(m),h}return r(m)}}var ol={tokenize:zLe,partial:!0};function zLe(t,e,r){return o;function o(i){return lt(i)?it(t,n,"linePrefix")(i):n(i)}function n(i){return i===null||ke(i)?e(i):r(i)}}var kS={name:"blockQuote",tokenize:ULe,continuation:{tokenize:VLe},exit:HLe};function ULe(t,e,r){let o=this;return n;function n(a){if(a===62){let s=o.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),i}return r(a)}function i(a){return lt(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function VLe(t,e,r){let o=this;return n;function n(a){return lt(a)?it(t,i,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(kS,e,r)(a)}}function HLe(t){t.exit("blockQuote")}var NS={name:"characterEscape",tokenize:jLe};function jLe(t,e,r){return o;function o(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),n}function n(i){return xee(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(i)}}var OS={name:"characterReference",tokenize:GLe};function GLe(t,e,r){let o=this,n=0,i,a;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"),i=31,a=Bo,u(d))}function c(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=_ee,u):(t.enter("characterReferenceValue"),i=7,a=Ab,u(d))}function u(d){if(d===59&&n){let f=t.exit("characterReferenceValue");return a===Bo&&!hh(o.sliceSerialize(f))?r(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(d)&&n++<i?(t.consume(d),u):r(d)}}var wee={tokenize:qLe,partial:!0},PS={name:"codeFenced",tokenize:WLe,concrete:!0};function WLe(t,e,r){let o=this,n={tokenize:N,partial:!0},i=0,a=0,s;return l;function l(I){return c(I)}function c(I){let E=o.events[o.events.length-1];return i=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,s=I,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(I)}function u(I){return I===s?(a++,t.consume(I),u):a<3?r(I):(t.exit("codeFencedFenceSequence"),lt(I)?it(t,d,"whitespace")(I):d(I))}function d(I){return I===null||ke(I)?(t.exit("codeFencedFence"),o.interrupt?e(I):t.check(wee,g,S)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),f(I))}function f(I){return I===null||ke(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(I)):lt(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),it(t,m,"whitespace")(I)):I===96&&I===s?r(I):(t.consume(I),f)}function m(I){return I===null||ke(I)?d(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(I))}function h(I){return I===null||ke(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(I)):I===96&&I===s?r(I):(t.consume(I),h)}function g(I){return t.attempt(n,S,_)(I)}function _(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),b}function b(I){return i>0&&lt(I)?it(t,y,"linePrefix",i+1)(I):y(I)}function y(I){return I===null||ke(I)?t.check(wee,g,S)(I):(t.enter("codeFlowValue"),v(I))}function v(I){return I===null||ke(I)?(t.exit("codeFlowValue"),y(I)):(t.consume(I),v)}function S(I){return t.exit("codeFenced"),e(I)}function N(I,E,w){let C=0;return T;function T(B){return I.enter("lineEnding"),I.consume(B),I.exit("lineEnding"),A}function A(B){return I.enter("codeFencedFence"),lt(B)?it(I,R,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):R(B)}function R(B){return B===s?(I.enter("codeFencedFenceSequence"),O(B)):w(B)}function O(B){return B===s?(C++,I.consume(B),O):C>=a?(I.exit("codeFencedFenceSequence"),lt(B)?it(I,z,"whitespace")(B):z(B)):w(B)}function z(B){return B===null||ke(B)?(I.exit("codeFencedFence"),E(B)):w(B)}}}function qLe(t,e,r){let o=this;return n;function n(a){return a===null?r(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return o.parser.lazy[o.now().line]?r(a):e(a)}}var Rb={name:"codeIndented",tokenize:YLe},KLe={tokenize:XLe,partial:!0};function YLe(t,e,r){let o=this;return n;function n(c){return t.enter("codeIndented"),it(t,i,"linePrefix",5)(c)}function i(c){let u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):r(c)}function a(c){return c===null?l(c):ke(c)?t.attempt(KLe,a,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||ke(c)?(t.exit("codeFlowValue"),a(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function XLe(t,e,r){let o=this;return n;function n(a){return o.parser.lazy[o.now().line]?r(a):ke(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),n):it(t,i,"linePrefix",5)(a)}function i(a){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):ke(a)?n(a):r(a)}}var FM={name:"codeText",tokenize:ZLe,resolve:JLe,previous:QLe};function JLe(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 QLe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZLe(t,e,r){let o=this,n=0,i,a;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),l(f)}function l(f){return f===96?(t.consume(f),n++,l):(t.exit("codeTextSequence"),c(f))}function c(f){return f===null?r(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),c):f===96?(a=t.enter("codeTextSequence"),i=0,d(f)):ke(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ke(f)?(t.exit("codeTextData"),c(f)):(t.consume(f),u)}function d(f){return f===96?(t.consume(f),i++,d):i===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(a.type="codeTextData",u(f))}}var AS=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 i=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&Mb(this.left,o),i.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),Mb(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Mb(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);Mb(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Mb(this.left,r.reverse())}}};function Mb(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 DS(t){let e={},r=-1,o,n,i,a,s,l,c,u=new AS(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,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(o[0]==="enter")o[1].contentType&&(Object.assign(e,e2e(u,r)),r=e[r],c=!0);else if(o[1]._container){for(i=r,n=void 0;i--&&(a=u.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(n&&(u.get(n)[1].type="lineEndingBlank"),a[1].type="lineEnding",n=i);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 ko(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function e2e(t,e){let r=t.get(e)[1],o=t.get(e)[2],n=e-1,i=[],a=r._tokenizer||o.parser[r.contentType](r.start),s=a.events,l=[],c={},u,d,f=-1,m=r,h=0,g=0,_=[g];for(;m;){for(;t.get(++n)[1]!==m;);i.push(n),m._tokenizer||(u=o.sliceStream(m),m.next||u.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=r;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(g=f+1,_.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):_.pop(),f=_.length;f--;){let b=s.slice(_[f],_[f+1]),y=i.pop();l.push([y,y+b.length-1]),t.splice(y,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return c}var BM={tokenize:o2e,resolve:r2e},t2e={tokenize:n2e,partial:!0};function r2e(t){return DS(t),t}function o2e(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?i(s):ke(s)?t.check(t2e,a,i)(s):(t.consume(s),n)}function i(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function a(s){return t.consume(s),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function n2e(t,e,r){let o=this;return n;function n(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),it(t,i,"linePrefix")}function i(a){if(a===null||ke(a))return r(a);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(a):t.interrupt(o.parser.constructs.flow,r,e)(a)}}function RS(t,e,r,o,n,i,a,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(b){return b===60?(t.enter(o),t.enter(n),t.enter(i),t.consume(b),t.exit(i),f):b===null||b===32||b===41||Ef(b)?r(b):(t.enter(o),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),g(b))}function f(b){return b===62?(t.enter(i),t.consume(b),t.exit(i),t.exit(n),t.exit(o),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===62?(t.exit("chunkString"),t.exit(s),f(b)):b===null||b===60||ke(b)?r(b):(t.consume(b),b===92?h:m)}function h(b){return b===60||b===62||b===92?(t.consume(b),m):m(b)}function g(b){return!u&&(b===null||b===41||Pt(b))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(o),e(b)):u<c&&b===40?(t.consume(b),u++,g):b===41?(t.consume(b),u--,g):b===null||b===32||b===40||Ef(b)?r(b):(t.consume(b),b===92?_:g)}function _(b){return b===40||b===41||b===92?(t.consume(b),g):g(b)}}function MS(t,e,r,o,n,i){let a=this,s=0,l;return c;function c(m){return t.enter(o),t.enter(n),t.consume(m),t.exit(n),t.enter(i),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?r(m):m===93?(t.exit(i),t.enter(n),t.consume(m),t.exit(n),t.exit(o),e):ke(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||ke(m)||s++>999?(t.exit("chunkString"),u(m)):(t.consume(m),l||(l=!lt(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,d):d(m)}}function LS(t,e,r,o,n,i){let a;return s;function s(f){return f===34||f===39||f===40?(t.enter(o),t.enter(n),t.consume(f),t.exit(n),a=f===40?41:f,l):r(f)}function l(f){return f===a?(t.enter(n),t.consume(f),t.exit(n),t.exit(o),e):(t.enter(i),c(f))}function c(f){return f===a?(t.exit(i),l(a)):f===null?r(f):ke(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),it(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||ke(f)?(t.exit("chunkString"),c(f)):(t.consume(f),f===92?d:u)}function d(f){return f===a||f===92?(t.consume(f),u):u(f)}}function Cf(t,e){let r;return o;function o(n){return ke(n)?(t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),r=!0,o):lt(n)?it(t,o,r?"linePrefix":"lineSuffix")(n):e(n)}}var $M={name:"definition",tokenize:a2e},i2e={tokenize:s2e,partial:!0};function a2e(t,e,r){let o=this,n;return i;function i(m){return t.enter("definition"),a(m)}function a(m){return MS.call(o,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return n=Hn(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 Pt(m)?Cf(t,c)(m):c(m)}function c(m){return RS(t,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return t.attempt(i2e,d,d)(m)}function d(m){return lt(m)?it(t,f,"whitespace")(m):f(m)}function f(m){return m===null||ke(m)?(t.exit("definition"),o.parser.defined.push(n),e(m)):r(m)}}function s2e(t,e,r){return o;function o(s){return Pt(s)?Cf(t,n)(s):r(s)}function n(s){return LS(t,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return lt(s)?it(t,a,"whitespace")(s):a(s)}function a(s){return s===null||ke(s)?e(s):r(s)}}var zM={name:"hardBreakEscape",tokenize:l2e};function l2e(t,e,r){return o;function o(i){return t.enter("hardBreakEscape"),t.consume(i),n}function n(i){return ke(i)?(t.exit("hardBreakEscape"),e(i)):r(i)}}var UM={name:"headingAtx",tokenize:u2e,resolve:c2e};function c2e(t,e){let r=t.length-2,o=3,n,i;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},i={type:"chunkText",start:t[o][1].start,end:t[r][1].end,contentType:"text"},ko(t,o,r-o+1,[["enter",n,e],["enter",i,e],["exit",i,e],["exit",n,e]])),t}function u2e(t,e,r){let o=0;return n;function n(u){return t.enter("atxHeading"),i(u)}function i(u){return t.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&o++<6?(t.consume(u),a):u===null||Pt(u)?(t.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||ke(u)?(t.exit("atxHeading"),e(u)):lt(u)?it(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||Pt(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}var Eee=["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"],VM=["pre","script","style","textarea"];var HM={name:"htmlFlow",tokenize:m2e,resolveTo:p2e,concrete:!0},d2e={tokenize:g2e,partial:!0},f2e={tokenize:h2e,partial:!0};function p2e(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 m2e(t,e,r){let o=this,n,i,a,s,l;return c;function c($){return u($)}function u($){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume($),d}function d($){return $===33?(t.consume($),f):$===47?(t.consume($),i=!0,g):$===63?(t.consume($),n=3,o.interrupt?e:L):Fo($)?(t.consume($),a=String.fromCharCode($),_):r($)}function f($){return $===45?(t.consume($),n=2,m):$===91?(t.consume($),n=5,s=0,h):Fo($)?(t.consume($),n=4,o.interrupt?e:L):r($)}function m($){return $===45?(t.consume($),o.interrupt?e:L):r($)}function h($){let ge="CDATA[";return $===ge.charCodeAt(s++)?(t.consume($),s===ge.length?o.interrupt?e:R:h):r($)}function g($){return Fo($)?(t.consume($),a=String.fromCharCode($),_):r($)}function _($){if($===null||$===47||$===62||Pt($)){let ge=$===47,Ce=a.toLowerCase();return!ge&&!i&&VM.includes(Ce)?(n=1,o.interrupt?e($):R($)):Eee.includes(a.toLowerCase())?(n=6,ge?(t.consume($),b):o.interrupt?e($):R($)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r($):i?y($):v($))}return $===45||Bo($)?(t.consume($),a+=String.fromCharCode($),_):r($)}function b($){return $===62?(t.consume($),o.interrupt?e:R):r($)}function y($){return lt($)?(t.consume($),y):T($)}function v($){return $===47?(t.consume($),T):$===58||$===95||Fo($)?(t.consume($),S):lt($)?(t.consume($),v):T($)}function S($){return $===45||$===46||$===58||$===95||Bo($)?(t.consume($),S):N($)}function N($){return $===61?(t.consume($),I):lt($)?(t.consume($),N):v($)}function I($){return $===null||$===60||$===61||$===62||$===96?r($):$===34||$===39?(t.consume($),l=$,E):lt($)?(t.consume($),I):w($)}function E($){return $===l?(t.consume($),l=null,C):$===null||ke($)?r($):(t.consume($),E)}function w($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||Pt($)?N($):(t.consume($),w)}function C($){return $===47||$===62||lt($)?v($):r($)}function T($){return $===62?(t.consume($),A):r($)}function A($){return $===null||ke($)?R($):lt($)?(t.consume($),A):r($)}function R($){return $===45&&n===2?(t.consume($),V):$===60&&n===1?(t.consume($),H):$===62&&n===4?(t.consume($),ne):$===63&&n===3?(t.consume($),L):$===93&&n===5?(t.consume($),Y):ke($)&&(n===6||n===7)?(t.exit("htmlFlowData"),t.check(d2e,ae,O)($)):$===null||ke($)?(t.exit("htmlFlowData"),O($)):(t.consume($),R)}function O($){return t.check(f2e,z,ae)($)}function z($){return t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),B}function B($){return $===null||ke($)?O($):(t.enter("htmlFlowData"),R($))}function V($){return $===45?(t.consume($),L):R($)}function H($){return $===47?(t.consume($),a="",G):R($)}function G($){if($===62){let ge=a.toLowerCase();return VM.includes(ge)?(t.consume($),ne):R($)}return Fo($)&&a.length<8?(t.consume($),a+=String.fromCharCode($),G):R($)}function Y($){return $===93?(t.consume($),L):R($)}function L($){return $===62?(t.consume($),ne):$===45&&n===2?(t.consume($),L):R($)}function ne($){return $===null||ke($)?(t.exit("htmlFlowData"),ae($)):(t.consume($),ne)}function ae($){return t.exit("htmlFlow"),e($)}}function h2e(t,e,r){let o=this;return n;function n(a){return ke(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):r(a)}function i(a){return o.parser.lazy[o.now().line]?r(a):e(a)}}function g2e(t,e,r){return o;function o(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),t.attempt(ol,e,r)}}var jM={name:"htmlText",tokenize:_2e};function _2e(t,e,r){let o=this,n,i,a;return s;function s(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),l}function l(L){return L===33?(t.consume(L),c):L===47?(t.consume(L),N):L===63?(t.consume(L),v):Fo(L)?(t.consume(L),w):r(L)}function c(L){return L===45?(t.consume(L),u):L===91?(t.consume(L),i=0,h):Fo(L)?(t.consume(L),y):r(L)}function u(L){return L===45?(t.consume(L),m):r(L)}function d(L){return L===null?r(L):L===45?(t.consume(L),f):ke(L)?(a=d,H(L)):(t.consume(L),d)}function f(L){return L===45?(t.consume(L),m):d(L)}function m(L){return L===62?V(L):L===45?f(L):d(L)}function h(L){let ne="CDATA[";return L===ne.charCodeAt(i++)?(t.consume(L),i===ne.length?g:h):r(L)}function g(L){return L===null?r(L):L===93?(t.consume(L),_):ke(L)?(a=g,H(L)):(t.consume(L),g)}function _(L){return L===93?(t.consume(L),b):g(L)}function b(L){return L===62?V(L):L===93?(t.consume(L),b):g(L)}function y(L){return L===null||L===62?V(L):ke(L)?(a=y,H(L)):(t.consume(L),y)}function v(L){return L===null?r(L):L===63?(t.consume(L),S):ke(L)?(a=v,H(L)):(t.consume(L),v)}function S(L){return L===62?V(L):v(L)}function N(L){return Fo(L)?(t.consume(L),I):r(L)}function I(L){return L===45||Bo(L)?(t.consume(L),I):E(L)}function E(L){return ke(L)?(a=E,H(L)):lt(L)?(t.consume(L),E):V(L)}function w(L){return L===45||Bo(L)?(t.consume(L),w):L===47||L===62||Pt(L)?C(L):r(L)}function C(L){return L===47?(t.consume(L),V):L===58||L===95||Fo(L)?(t.consume(L),T):ke(L)?(a=C,H(L)):lt(L)?(t.consume(L),C):V(L)}function T(L){return L===45||L===46||L===58||L===95||Bo(L)?(t.consume(L),T):A(L)}function A(L){return L===61?(t.consume(L),R):ke(L)?(a=A,H(L)):lt(L)?(t.consume(L),A):C(L)}function R(L){return L===null||L===60||L===61||L===62||L===96?r(L):L===34||L===39?(t.consume(L),n=L,O):ke(L)?(a=R,H(L)):lt(L)?(t.consume(L),R):(t.consume(L),z)}function O(L){return L===n?(t.consume(L),n=void 0,B):L===null?r(L):ke(L)?(a=O,H(L)):(t.consume(L),O)}function z(L){return L===null||L===34||L===39||L===60||L===61||L===96?r(L):L===47||L===62||Pt(L)?C(L):(t.consume(L),z)}function B(L){return L===47||L===62||Pt(L)?C(L):r(L)}function V(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):r(L)}function H(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),G}function G(L){return lt(L)?it(t,Y,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):Y(L)}function Y(L){return t.enter("htmlTextData"),a(L)}}var Tf={name:"labelEnd",tokenize:w2e,resolveTo:I2e,resolveAll:v2e},x2e={tokenize:E2e},b2e={tokenize:S2e},y2e={tokenize:C2e};function v2e(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 I2e(t,e){let r=t.length,o=0,n,i,a,s;for(;r--;)if(n=t[r][1],i){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(a){if(t[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(i=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(a=r);let l={type:t[i][1].type==="labelLink"?"link":"image",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:"label",start:Object.assign({},t[i][1].start),end:Object.assign({},t[a][1].end)},u={type:"labelText",start:Object.assign({},t[i+o+2][1].end),end:Object.assign({},t[a-2][1].start)};return s=[["enter",l,e],["enter",c,e]],s=si(s,t.slice(i+1,i+o+3)),s=si(s,[["enter",u,e]]),s=si(s,yu(e.parser.constructs.insideSpan.null,t.slice(i+o+4,a-3),e)),s=si(s,[["exit",u,e],t[a-2],t[a-1],["exit",c,e]]),s=si(s,t.slice(a+1)),s=si(s,[["exit",l,e]]),ko(t,i,t.length,s),t}function w2e(t,e,r){let o=this,n=o.events.length,i,a;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){i=o.events[n][1];break}return s;function s(f){return i?i._inactive?d(f):(a=o.parser.defined.includes(Hn(o.sliceSerialize({start:i.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelEnd"),l):r(f)}function l(f){return f===40?t.attempt(x2e,u,a?u:d)(f):f===91?t.attempt(b2e,u,a?c:d)(f):a?u(f):d(f)}function c(f){return t.attempt(y2e,u,d)(f)}function u(f){return e(f)}function d(f){return i._balanced=!0,r(f)}}function E2e(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 Pt(d)?Cf(t,i)(d):i(d)}function i(d){return d===41?u(d):RS(t,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Pt(d)?Cf(t,l)(d):u(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?LS(t,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Pt(d)?Cf(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 S2e(t,e,r){let o=this;return n;function n(s){return MS.call(o,t,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return o.parser.defined.includes(Hn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(s):r(s)}function a(s){return r(s)}}function C2e(t,e,r){return o;function o(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),n}function n(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):r(i)}}var GM={name:"labelStartImage",tokenize:T2e,resolveAll:Tf.resolveAll};function T2e(t,e,r){let o=this;return n;function n(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),i}function i(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),a):r(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):e(s)}}var WM={name:"labelStartLink",tokenize:k2e,resolveAll:Tf.resolveAll};function k2e(t,e,r){let o=this;return n;function n(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(a):e(a)}}var Lb={name:"lineEnding",tokenize:N2e};function N2e(t,e){return r;function r(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),it(t,e,"linePrefix")}}var kf={name:"thematicBreak",tokenize:O2e};function O2e(t,e,r){let o=0,n;return i;function i(c){return t.enter("thematicBreak"),a(c)}function a(c){return n=c,s(c)}function s(c){return c===n?(t.enter("thematicBreakSequence"),l(c)):o>=3&&(c===null||ke(c))?(t.exit("thematicBreak"),e(c)):r(c)}function l(c){return c===n?(t.consume(c),o++,l):(t.exit("thematicBreakSequence"),lt(c)?it(t,s,"whitespace")(c):s(c))}}var jn={name:"list",tokenize:D2e,continuation:{tokenize:R2e},exit:L2e},P2e={tokenize:F2e,partial:!0},A2e={tokenize:M2e,partial:!0};function D2e(t,e,r){let o=this,n=o.events[o.events.length-1],i=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,a=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:Ab(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(kf,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 Ab(m)&&++a<10?(t.consume(m),l):(!o.interrupt||a<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(ol,o.interrupt?r:u,t.attempt(P2e,f,d))}function u(m){return o.containerState.initialBlankLine=!0,i++,f(m)}function d(m){return lt(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),f):r(m)}function f(m){return o.containerState.size=i+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function R2e(t,e,r){let o=this;return o.containerState._closeFlow=void 0,t.check(ol,n,i);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,it(t,e,"listItemIndent",o.containerState.size+1)(s)}function i(s){return o.containerState.furtherBlankLines||!lt(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,a(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(A2e,e,a)(s))}function a(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,it(t,t.attempt(jn,e,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function M2e(t,e,r){let o=this;return it(t,n,"listItemIndent",o.containerState.size+1);function n(i){let a=o.events[o.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===o.containerState.size?e(i):r(i)}}function L2e(t){t.exit(this.containerState.type)}function F2e(t,e,r){let o=this;return it(t,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(i){let a=o.events[o.events.length-1];return!lt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):r(i)}}var FS={name:"setextUnderline",tokenize:$2e,resolveTo:B2e};function B2e(t,e){let r=t.length,o,n,i;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),!i&&t[r][1].type==="definition"&&(i=r);let a={type:"setextHeading",start:Object.assign({},t[n][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[n][1].type="setextHeadingText",i?(t.splice(n,0,["enter",a,e]),t.splice(i+1,0,["exit",t[o][1],e]),t[o][1].end=Object.assign({},t[i][1].end)):t[o][1]=a,t.push(["exit",a,e]),t}function $2e(t,e,r){let o=this,n;return i;function i(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,a(c)):r(c)}function a(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===n?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),lt(c)?it(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ke(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}var See={tokenize:z2e};function z2e(t){let e=this,r=t.attempt(ol,o,t.attempt(this.parser.constructs.flowInitial,n,it(t,t.attempt(this.parser.constructs.flow,n,t.attempt(BM,n)),"linePrefix")));return r;function o(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function n(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var Cee={resolveAll:Oee()},Tee=Nee("string"),kee=Nee("text");function Nee(t){return{tokenize:e,resolveAll:Oee(t==="text"?U2e:void 0)};function e(r){let o=this,n=this.parser.constructs[t],i=r.attempt(n,a,s);return a;function a(u){return c(u)?i(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"),i(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=n[u],f=-1;if(d)for(;++f<d.length;){let m=d[f];if(!m.previous||m.previous.call(o,o.previous))return!0}return!1}}}function Oee(t){return e;function e(r,o){let n=-1,i;for(;++n<=r.length;)i===void 0?r[n]&&r[n][1].type==="data"&&(i=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==i+2&&(r[i][1].end=r[n-1][1].end,r.splice(i+2,n-i-2),n=i+2),i=void 0);return t?t(r,o):r}}function U2e(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),i=n.length,a=-1,s=0,l;for(;i--;){let c=n[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){i++;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+i,_bufferIndex:i?a:o.start._bufferIndex+a},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 Pee(t,e,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},i=[],a=[],s=[],l=!0,c={consume:S,enter:N,exit:I,attempt:C(E),check:C(w),interrupt:C(w,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:t,sliceStream:g,sliceSerialize:h,now:_,defineSkip:b,write:m},d=e.tokenize.call(u,c),f;return e.resolveAll&&i.push(e),u;function m(O){return a=si(a,O),y(),a[a.length-1]!==null?[]:(T(e,0),u.events=yu(i,u.events,u),u.events)}function h(O,z){return H2e(g(O),z)}function g(O){return V2e(a,O)}function _(){let{line:O,column:z,offset:B,_index:V,_bufferIndex:H}=o;return{line:O,column:z,offset:B,_index:V,_bufferIndex:H}}function b(O){n[O.line]=O.column,R()}function y(){let O;for(;o._index<a.length;){let z=a[o._index];if(typeof z=="string")for(O=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===O&&o._bufferIndex<z.length;)v(z.charCodeAt(o._bufferIndex));else v(z)}}function v(O){l=void 0,f=O,d=d(O)}function S(O){ke(O)?(o.line++,o.column=1,o.offset+=O===-3?2:1,R()):O!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===a[o._index].length&&(o._bufferIndex=-1,o._index++)),u.previous=O,l=!0}function N(O,z){let B=z||{};return B.type=O,B.start=_(),u.events.push(["enter",B,u]),s.push(B),B}function I(O){let z=s.pop();return z.end=_(),u.events.push(["exit",z,u]),z}function E(O,z){T(O,z.from)}function w(O,z){z.restore()}function C(O,z){return B;function B(V,H,G){let Y,L,ne,ae;return Array.isArray(V)?ge(V):"tokenize"in V?ge([V]):$(V);function $(Me){return Te;function Te(st){let Rt=st!==null&&Me[st],ut=st!==null&&Me.null,ht=[...Array.isArray(Rt)?Rt:Rt?[Rt]:[],...Array.isArray(ut)?ut:ut?[ut]:[]];return ge(ht)(st)}}function ge(Me){return Y=Me,L=0,Me.length===0?G:Ce(Me[L])}function Ce(Me){return Te;function Te(st){return ae=A(),ne=Me,Me.partial||(u.currentConstruct=Me),Me.name&&u.parser.constructs.disable.null.includes(Me.name)?Qe(st):Me.tokenize.call(z?Object.assign(Object.create(u),z):u,c,je,Qe)(st)}}function je(Me){return l=!0,O(ne,ae),H}function Qe(Me){return l=!0,ae.restore(),++L<Y.length?Ce(Y[L]):G}}}function T(O,z){O.resolveAll&&!i.includes(O)&&i.push(O),O.resolve&&ko(u.events,z,u.events.length-z,O.resolve(u.events.slice(z),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function A(){let O=_(),z=u.previous,B=u.currentConstruct,V=u.events.length,H=Array.from(s);return{restore:G,from:V};function G(){o=O,u.previous=z,u.currentConstruct=B,u.events.length=V,s=H,R()}}function R(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function V2e(t,e){let r=e.start._index,o=e.start._bufferIndex,n=e.end._index,i=e.end._bufferIndex,a;if(r===n)a=[t[r].slice(o,i)];else{if(a=t.slice(r,n),o>-1){let s=a[0];typeof s=="string"?a[0]=s.slice(o):a.shift()}i>0&&a.push(t[n].slice(0,i))}return a}function H2e(t,e){let r=-1,o=[],n;for(;++r<t.length;){let i=t[r],a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
62
62
  `;break}case-3:{a=`\r
63
- `;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&n)continue;a=" ";break}default:a=String.fromCharCode(i)}n=i===-2,o.push(a)}return o.join("")}var qM={};nr(qM,{attentionMarkers:()=>J2e,contentInitial:()=>G2e,disable:()=>Q2e,document:()=>j2e,flow:()=>q2e,flowInitial:()=>W2e,insideSpan:()=>X2e,string:()=>K2e,text:()=>Y2e});var j2e={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:kS},G2e={91:$M},W2e={[-2]:Rb,[-1]:Rb,32:Rb},q2e={35:UM,42:kf,45:[FS,kf],60:HM,61:FS,95:kf,96:PS,126:PS},K2e={38:OS,92:NS},Y2e={[-5]:Lb,[-4]:Lb,[-3]:Lb,33:GM,38:OS,42:Db,60:[LM,jM],91:WM,92:[zM,NS],93:Tf,95:Db,96:FM},X2e={null:[Db,Cee]},J2e={null:[42,95]},Q2e={null:[]};function KM(t){let r=CS([qM,...(t||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(bee),document:n(vee),flow:n(See),string:n(Tee),text:n(kee)};return o;function n(i){return a;function a(s){return Pee(o,i,s)}}}function YM(t){for(;!DS(t););return t}var Aee=/[\0\t\n\r]/g;function XM(){let t=1,e="",r=!0,o;return n;function n(i,a,s){let l=[],c,u,d,f,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),d=0,e="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(Aee.lastIndex=d,c=Aee.exec(i),f=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(f),!c){e=i.slice(d);break}if(m===10&&d===f&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<f&&(l.push(i.slice(d,f)),t+=f-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=f+1}return s&&(o&&l.push(-5),e&&l.push(e),l.push(null)),l}}var Z2e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dee(t){return t.replace(Z2e,eFe)}function eFe(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),i=n===120||n===88;return TS(r.slice(i?2:1),i?16:10)}return hh(r)||t}function _h(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Ree(t.position):"start"in t||"end"in t?Ree(t):"line"in t||"column"in t?JM(t):""}function JM(t){return Mee(t&&t.line)+":"+Mee(t&&t.column)}function Ree(t){return JM(t&&t.start)+"-"+JM(t&&t.end)}function Mee(t){return t&&typeof t=="number"?t:1}var Fee={}.hasOwnProperty;function QM(t,e,r){return typeof e!="string"&&(r=e,e=void 0),tFe(r)(YM(KM(r).document().write(XM()(t,e,!0))))}function tFe(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ut),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(Yr),blockQuote:i(st),characterEscape:C,characterReference:C,codeFenced:i(Rt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Rt,a),codeText:i(ut,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(ht),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(bt),hardBreakEscape:i(Mt),hardBreakTrailing:i(Mt),htmlFlow:i(ye,a),htmlFlowData:C,htmlText:i(ye,a),htmlTextData:C,image:i(un),label:a,link:i(Ut),listItem:i(zr),listItemValue:f,listOrdered:i(pt,d),listUnordered:i(pt),paragraph:i(Ur),reference:$,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Yr),strong:i(Po),thematicBreak:i(ie)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:Te,autolinkProtocol:Me,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:je,characterReference:Qe,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:T,codeIndented:l(b),codeText:l(B),codeTextData:T,data:T,definition:l(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(R),hardBreakTrailing:l(R),htmlFlow:l(O),htmlFlowData:T,htmlText:l(z),htmlTextData:T,image:l(H),label:Y,labelText:G,lineEnding:A,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ge,resourceDestinationString:L,resourceTitleString:ne,resource:ae,setextHeading:l(w),setextHeadingLineSequence:E,setextHeadingText:I,strong:l(),thematicBreak:l()}};Bee(e,(t||{}).mdastExtensions||[]);let r={};return o;function o(j){let Q={type:"root",children:[]},se={stack:[Q],tokenStack:[],config:e,enter:s,exit:c,buffer:a,resume:u,data:r},He=[],yt=-1;for(;++yt<j.length;)if(j[yt][1].type==="listOrdered"||j[yt][1].type==="listUnordered")if(j[yt][0]==="enter")He.push(yt);else{let Nt=He.pop();yt=n(j,Nt,yt)}for(yt=-1;++yt<j.length;){let Nt=e[j[yt][0]];Fee.call(Nt,j[yt][1].type)&&Nt[j[yt][1].type].call(Object.assign({sliceSerialize:j[yt][2].sliceSerialize},se),j[yt][1])}if(se.tokenStack.length>0){let Nt=se.tokenStack[se.tokenStack.length-1];(Nt[1]||Lee).call(se,void 0,Nt[0])}for(Q.position={start:vu(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:vu(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},yt=-1;++yt<e.transforms.length;)Q=e.transforms[yt](Q)||Q;return Q}function n(j,Q,se){let He=Q-1,yt=-1,Nt=!1,Rn,_r,kr,Kn;for(;++He<=se;){let no=j[He];switch(no[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{no[0]==="enter"?yt++:yt--,Kn=void 0;break}case"lineEndingBlank":{no[0]==="enter"&&(Rn&&!Kn&&!yt&&!kr&&(kr=He),Kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kn=void 0}if(!yt&&no[0]==="enter"&&no[1].type==="listItemPrefix"||yt===-1&&no[0]==="exit"&&(no[1].type==="listUnordered"||no[1].type==="listOrdered")){if(Rn){let dn=He;for(_r=void 0;dn--;){let fn=j[dn];if(fn[1].type==="lineEnding"||fn[1].type==="lineEndingBlank"){if(fn[0]==="exit")continue;_r&&(j[_r][1].type="lineEndingBlank",Nt=!0),fn[1].type="lineEnding",_r=dn}else if(!(fn[1].type==="linePrefix"||fn[1].type==="blockQuotePrefix"||fn[1].type==="blockQuotePrefixWhitespace"||fn[1].type==="blockQuoteMarker"||fn[1].type==="listItemIndent"))break}kr&&(!_r||kr<_r)&&(Rn._spread=!0),Rn.end=Object.assign({},_r?j[_r][1].start:no[1].end),j.splice(_r||He,0,["exit",Rn,no[2]]),He++,se++}if(no[1].type==="listItemPrefix"){let dn={type:"listItem",_spread:!1,start:Object.assign({},no[1].start),end:void 0};Rn=dn,j.splice(He,0,["enter",dn,no[2]]),He++,se++,kr=void 0,Kn=!0}}}return j[Q][1]._spread=Nt,se}function i(j,Q){return se;function se(He){s.call(this,j(He),He),Q&&Q.call(this,He)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(j,Q,se){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([Q,se]),j.position={start:vu(Q.start),end:void 0}}function l(j){return Q;function Q(se){j&&j.call(this,se),c.call(this,se)}}function c(j,Q){let se=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==j.type&&(Q?Q.call(this,j,He[0]):(He[1]||Lee).call(this,j,He[0]));else throw new Error("Cannot close `"+j.type+"` ("+_h({start:j.start,end:j.end})+"): it\u2019s not open");se.position.end=vu(j.end)}function u(){return MM(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(j){if(this.data.expectingFirstListItemValue){let Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function m(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=j}function h(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=j}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j.replace(/(\r?\n|\r)$/g,"")}function y(j){let Q=this.resume(),se=this.stack[this.stack.length-1];se.label=Q,se.identifier=Hn(this.sliceSerialize(j)).toLowerCase()}function v(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.title=j}function S(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.url=j}function N(j){let Q=this.stack[this.stack.length-1];if(!Q.depth){let se=this.sliceSerialize(j).length;Q.depth=se}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function E(j){let Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function C(j){let se=this.stack[this.stack.length-1].children,He=se[se.length-1];(!He||He.type!=="text")&&(He=Be(),He.position={start:vu(j.start),end:void 0},se.push(He)),this.stack.push(He)}function T(j){let Q=this.stack.pop();Q.value+=this.sliceSerialize(j),Q.position.end=vu(j.end)}function A(j){let Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){let se=Q.children[Q.children.length-1];se.position.end=vu(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Q.type)&&(C.call(this,j),T.call(this,j))}function R(){this.data.atHardBreak=!0}function O(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j}function z(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j}function B(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j}function V(){let j=this.stack[this.stack.length-1];if(this.data.inReference){let Q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=Q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function H(){let j=this.stack[this.stack.length-1];if(this.data.inReference){let Q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=Q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function G(j){let Q=this.sliceSerialize(j),se=this.stack[this.stack.length-2];se.label=Dee(Q),se.identifier=Hn(Q).toLowerCase()}function Y(){let j=this.stack[this.stack.length-1],Q=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){let He=j.children;se.children=He}else se.alt=Q}function L(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.url=j}function ne(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.title=j}function ae(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function ge(j){let Q=this.resume(),se=this.stack[this.stack.length-1];se.label=Q,se.identifier=Hn(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function Ce(j){this.data.characterReferenceType=j.type}function je(j){let Q=this.sliceSerialize(j),se=this.data.characterReferenceType,He;se?(He=TS(Q,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=hh(Q);let yt=this.stack[this.stack.length-1];yt.value+=He}function Qe(j){let Q=this.stack.pop();Q.position.end=vu(j.end)}function Me(j){T.call(this,j);let Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(j)}function Te(j){T.call(this,j);let Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(j)}function st(){return{type:"blockquote",children:[]}}function Rt(){return{type:"code",lang:null,meta:null,value:""}}function ut(){return{type:"inlineCode",value:""}}function ht(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bt(){return{type:"emphasis",children:[]}}function Yr(){return{type:"heading",depth:0,children:[]}}function Mt(){return{type:"break"}}function ye(){return{type:"html",value:""}}function un(){return{type:"image",title:null,url:"",alt:null}}function Ut(){return{type:"link",title:null,url:"",children:[]}}function pt(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function zr(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function Ur(){return{type:"paragraph",children:[]}}function Po(){return{type:"strong",children:[]}}function Be(){return{type:"text",value:""}}function ie(){return{type:"thematicBreak"}}}function vu(t){return{line:t.line,column:t.column,offset:t.offset}}function Bee(t,e){let r=-1;for(;++r<e.length;){let o=e[r];Array.isArray(o)?Bee(t,o):rFe(t,o)}}function rFe(t,e){let r;for(r in e)if(Fee.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 Lee(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+_h({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+_h({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+_h({start:e.start,end:e.end})+") is still open")}function ZM(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 eL(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var xh=(function(t){if(t==null)return aFe;if(typeof t=="function")return BS(t);if(typeof t=="object")return Array.isArray(t)?oFe(t):nFe(t);if(typeof t=="string")return iFe(t);throw new Error("Expected function, string, or object as test")});function oFe(t){let e=[],r=-1;for(;++r<t.length;)e[r]=xh(t[r]);return BS(o);function o(...n){let i=-1;for(;++i<e.length;)if(e[i].apply(this,n))return!0;return!1}}function nFe(t){let e=t;return BS(r);function r(o){let n=o,i;for(i in t)if(n[i]!==e[i])return!1;return!0}}function iFe(t){return BS(e);function e(r){return r&&r.type===t}}function BS(t){return e;function e(r,o,n){return!!(sFe(r)&&t.call(this,r,typeof o=="number"?o:void 0,n||void 0))}}function aFe(){return!0}function sFe(t){return t!==null&&typeof t=="object"&&"type"in t}var $ee=[],zee=!0,tL=!1,Uee="skip";function rL(t,e,r,o){let n;typeof e=="function"&&typeof r!="function"?(o=r,r=e):n=e;let i=xh(n),a=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(f,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=$ee,h,g,_;if((!e||i(l,c,u[u.length-1]||void 0))&&(m=lFe(r(l,u)),m[0]===tL))return m;if("children"in l&&l.children){let b=l;if(b.children&&m[0]!==Uee)for(g=(o?b.children.length:-1)+a,_=u.concat(b);g>-1&&g<b.children.length;){let y=b.children[g];if(h=s(y,g,_)(),h[0]===tL)return h;g=typeof h[1]=="number"?h[1]:g+a}}return m}}}function lFe(t){return Array.isArray(t)?t:typeof t=="number"?[zee,t]:t==null?$ee:[t]}function oL(t,e,r){let n=xh((r||{}).ignore||[]),i=cFe(e),a=-1;for(;++a<i.length;)rL(t,"text",s);function s(c,u){let d=-1,f;for(;++d<u.length;){let m=u[d],h=f?f.children:void 0;if(n(m,h?h.indexOf(m):void 0,f))return;f=m}if(f)return l(c,u)}function l(c,u){let d=u[u.length-1],f=i[a][0],m=i[a][1],h=0,_=d.children.indexOf(c),b=!1,y=[];f.lastIndex=0;let v=f.exec(c.value);for(;v;){let S=v.index,N={index:v.index,input:v.input,stack:[...u,c]},I=m(...v,N);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?f.lastIndex=S+1:(h!==S&&y.push({type:"text",value:c.value.slice(h,S)}),Array.isArray(I)?y.push(...I):I&&y.push(I),h=S+v[0].length,b=!0),!f.global)break;v=f.exec(c.value)}return b?(h<c.value.length&&y.push({type:"text",value:c.value.slice(h)}),d.children.splice(_,1,...y)):y=[c],_+y.length}}function cFe(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([uFe(n[0]),dFe(n[1])])}return e}function uFe(t){return typeof t=="string"?new RegExp(eL(t),"g"):t}function dFe(t){return typeof t=="function"?t:function(){return t}}function iL(){return{transforms:[_Fe],enter:{literalAutolink:fFe,literalAutolinkEmail:nL,literalAutolinkHttp:nL,literalAutolinkWww:nL},exit:{literalAutolink:gFe,literalAutolinkEmail:hFe,literalAutolinkHttp:pFe,literalAutolinkWww:mFe}}}function fFe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function nL(t){this.config.enter.autolinkProtocol.call(this,t)}function pFe(t){this.config.exit.autolinkProtocol.call(this,t)}function mFe(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 hFe(t){this.config.exit.autolinkEmail.call(this,t)}function gFe(t){this.exit(t)}function _Fe(t){oL(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xFe],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,bFe]],{ignore:["link","linkReference"]})}function xFe(t,e,r,o,n){let i="";if(!Vee(n)||(/^w/i.test(e)&&(r=e+r,e="",i="http://"),!yFe(r)))return!1;let a=vFe(r+o);if(!a[0])return!1;let s={type:"link",title:null,url:i+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function bFe(t,e,r,o){return!Vee(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function yFe(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 vFe(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=ZM(t,"("),i=ZM(t,")");for(;o!==-1&&n>i;)t+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),i++;return[t,r]}function Vee(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||rl(r)||Sf(r))&&(!e||r!==47)}PFe.peek=AFe;function aL(){return{enter:{gfmFootnoteDefinition:wFe,gfmFootnoteDefinitionLabelString:EFe,gfmFootnoteCall:TFe,gfmFootnoteCallString:kFe},exit:{gfmFootnoteDefinition:CFe,gfmFootnoteDefinitionLabelString:SFe,gfmFootnoteCall:OFe,gfmFootnoteCallString:NFe}}}function wFe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function EFe(){this.buffer()}function SFe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=Hn(this.sliceSerialize(t)).toLowerCase()}function CFe(t){this.exit(t)}function TFe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function kFe(){this.buffer()}function NFe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=Hn(this.sliceSerialize(t)).toLowerCase()}function OFe(t){this.exit(t)}function PFe(t,e,r,o){let n=r.createTracker(o),i=n.move("[^"),a=r.enter("footnoteReference"),s=r.enter("reference");return i+=n.move(r.safe(r.associationId(t),{...n.current(),before:i,after:"]"})),s(),a(),i+=n.move("]"),i}function AFe(){return"["}LFe.peek=FFe;function sL(){return{canContainEols:["delete"],enter:{strikethrough:RFe},exit:{strikethrough:MFe}}}function RFe(t){this.enter({type:"delete",children:[]},t)}function MFe(t){this.exit(t)}function LFe(t,e,r,o){let n=r.createTracker(o),i=r.enter("strikethrough"),a=n.move("~~");return a+=r.containerPhrasing(t,{...n.current(),before:a,after:"~"}),a+=n.move("~~"),i(),a}function FFe(){return"~"}function cL(){return{enter:{table:$Fe,tableData:Hee,tableHeader:Hee,tableRow:UFe},exit:{codeText:VFe,table:zFe,tableData:lL,tableHeader:lL,tableRow:lL}}}function $Fe(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 zFe(t){this.exit(t),this.data.inTable=void 0}function UFe(t){this.enter({type:"tableRow",children:[]},t)}function lL(t){this.exit(t)}function Hee(t){this.enter({type:"tableCell",children:[]},t)}function VFe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,HFe));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function HFe(t,e){return e==="|"?e:t}function uL(){return{exit:{taskListCheckValueChecked:jee,taskListCheckValueUnchecked:jee,paragraph:GFe}}}function jee(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function GFe(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,i=-1,a;for(;++i<n.length;){let s=n[i];if(s.type==="paragraph"){a=s;break}}a===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 dL(){return[iL(),aL(),sL(),cL(),uL()]}var qFe={tokenize:QFe,partial:!0},Gee={tokenize:ZFe,partial:!0},Wee={tokenize:eBe,partial:!0},qee={tokenize:tBe,partial:!0},KFe={tokenize:rBe,partial:!0},Kee={tokenize:XFe,previous:Xee},Yee={tokenize:JFe,previous:Jee},tc={tokenize:YFe,previous:Qee},nl={};function pL(){return{text:nl}}var Nf=48;for(;Nf<123;)nl[Nf]=tc,Nf++,Nf===58?Nf=65:Nf===91&&(Nf=97);nl[43]=tc;nl[45]=tc;nl[46]=tc;nl[95]=tc;nl[72]=[tc,Yee];nl[104]=[tc,Yee];nl[87]=[tc,Kee];nl[119]=[tc,Kee];function YFe(t,e,r){let o=this,n,i;return a;function a(d){return!fL(d)||!Qee.call(o,o.previous)||mL(o.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),s(d))}function s(d){return fL(d)?(t.consume(d),s):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(KFe,u,c)(d):d===45||d===95||Bo(d)?(i=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),n=!0,l}function u(d){return i&&n&&Fo(o.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function XFe(t,e,r){let o=this;return n;function n(a){return a!==87&&a!==119||!Xee.call(o,o.previous)||mL(o.events)?r(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(qFe,t.attempt(Gee,t.attempt(Wee,i),r),r)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function JFe(t,e,r){let o=this,n="",i=!1;return a;function a(d){return(d===72||d===104)&&Jee.call(o,o.previous)&&!mL(o.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),t.consume(d),s):r(d)}function s(d){if(Fo(d)&&n.length<5)return n+=String.fromCodePoint(d),t.consume(d),s;if(d===58){let f=n.toLowerCase();if(f==="http"||f==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),i?c:(i=!0,l)):r(d)}function c(d){return d===null||Ef(d)||Pt(d)||rl(d)||Sf(d)?r(d):t.attempt(Gee,t.attempt(Wee,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function QFe(t,e,r){let o=0;return n;function n(a){return(a===87||a===119)&&o<3?(o++,t.consume(a),n):a===46&&o===3?(t.consume(a),i):r(a)}function i(a){return a===null?r(a):e(a)}}function ZFe(t,e,r){let o,n,i;return a;function a(c){return c===46||c===95?t.check(qee,l,s)(c):c===null||Pt(c)||rl(c)||c!==45&&Sf(c)?l(c):(i=!0,t.consume(c),a)}function s(c){return c===95?o=!0:(n=o,o=void 0),t.consume(c),a}function l(c){return n||o||!i?r(c):e(c)}}function eBe(t,e){let r=0,o=0;return n;function n(a){return a===40?(r++,t.consume(a),n):a===41&&o<r?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(qee,e,i)(a):a===null||Pt(a)||rl(a)?e(a):(t.consume(a),n)}function i(a){return a===41&&o++,t.consume(a),n}}function tBe(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),i):s===93?(t.consume(s),n):s===60||s===null||Pt(s)||rl(s)?e(s):r(s)}function n(s){return s===null||s===40||s===91||Pt(s)||rl(s)?e(s):o(s)}function i(s){return Fo(s)?a(s):r(s)}function a(s){return s===59?(t.consume(s),o):Fo(s)?(t.consume(s),a):r(s)}}function rBe(t,e,r){return o;function o(i){return t.consume(i),n}function n(i){return Bo(i)?r(i):e(i)}}function Xee(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Pt(t)}function Jee(t){return!Fo(t)}function Qee(t){return!(t===47||fL(t))}function fL(t){return t===43||t===45||t===46||t===95||Bo(t)}function mL(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 oBe={tokenize:uBe,partial:!0};function hL(){return{document:{91:{tokenize:sBe,continuation:{tokenize:lBe},exit:cBe}},text:{91:{tokenize:aBe},93:{add:"after",tokenize:nBe,resolveTo:iBe}}}}function nBe(t,e,r){let o=this,n=o.events.length,i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a;for(;n--;){let l=o.events[n][1];if(l.type==="labelImage"){a=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(!a||!a._balanced)return r(l);let c=Hn(o.sliceSerialize({start:a.end,end:o.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function iBe(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function aBe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i=0,a;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(i>999||d===93&&!a||d===null||d===91||Pt(d))return r(d);if(d===93){t.exit("chunkString");let f=t.exit("gfmFootnoteCallString");return n.includes(Hn(o.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Pt(d)||(a=!0),i++,t.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(t.consume(d),i++,c):c(d)}}function sBe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i,a=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(a>999||h===93&&!s||h===null||h===91||Pt(h))return r(h);if(h===93){t.exit("chunkString");let g=t.exit("gfmFootnoteDefinitionLabelString");return i=Hn(o.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return Pt(h)||(s=!0),a++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,u):u(h)}function f(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),n.includes(i)||n.push(i),it(t,m,"gfmFootnoteDefinitionWhitespace")):r(h)}function m(h){return e(h)}}function lBe(t,e,r){return t.check(ol,e,t.attempt(oBe,e,r))}function cBe(t){t.exit("gfmFootnoteDefinition")}function uBe(t,e,r){let o=this;return it(t,n,"gfmFootnoteDefinitionIndent",5);function n(i){let a=o.events[o.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):r(i)}}function gL(t){let r=(t||{}).singleTilde,o={tokenize:i,resolveAll:n};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function n(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";let u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},f=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&ko(f,f.length,0,yu(m,a.slice(c+1,l),s)),ko(f,f.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),ko(a,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,s,l){let c=this.previous,u=this.events,d=0;return f;function f(h){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(h):(a.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let g=gh(c);if(h===126)return d>1?l(h):(a.consume(h),d++,m);if(d<2&&!r)return l(h);let _=a.exit("strikethroughSequenceTemporary"),b=gh(h);return _._open=!b||b===2&&!!g,_._close=!g||g===2&&!!b,s(h)}}}var $S=class{constructor(){this.map=[]}add(e,r,o){dBe(this,e,r,o)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[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 dBe(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 Zee(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 i=o.length-1;o[i]=o[i]==="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 _L(){return{flow:{null:{tokenize:fBe,resolveAll:pBe}}}}function fBe(t,e,r){let o=this,n=0,i=0,a;return s;function s(T){let A=o.events.length-1;for(;A>-1;){let z=o.events[A][1].type;if(z==="lineEnding"||z==="linePrefix")A--;else break}let R=A>-1?o.events[A][1].type:null,O=R==="tableHead"||R==="tableRow"?I:l;return O===I&&o.parser.lazy[o.now().line]?r(T):O(T)}function l(T){return t.enter("tableHead"),t.enter("tableRow"),c(T)}function c(T){return T===124||(a=!0,i+=1),u(T)}function u(T){return T===null?r(T):ke(T)?i>1?(i=0,o.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),m):r(T):lt(T)?it(t,u,"whitespace")(T):(i+=1,a&&(a=!1,n+=1),T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),a=!0,u):(t.enter("data"),d(T)))}function d(T){return T===null||T===124||Pt(T)?(t.exit("data"),u(T)):(t.consume(T),T===92?f:d)}function f(T){return T===92||T===124?(t.consume(T),d):d(T)}function m(T){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(T):(t.enter("tableDelimiterRow"),a=!1,lt(T)?it(t,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):h(T))}function h(T){return T===45||T===58?_(T):T===124?(a=!0,t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),g):N(T)}function g(T){return lt(T)?it(t,_,"whitespace")(T):_(T)}function _(T){return T===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),b):T===45?(i+=1,b(T)):T===null||ke(T)?S(T):N(T)}function b(T){return T===45?(t.enter("tableDelimiterFiller"),y(T)):N(T)}function y(T){return T===45?(t.consume(T),y):T===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),v):(t.exit("tableDelimiterFiller"),v(T))}function v(T){return lt(T)?it(t,S,"whitespace")(T):S(T)}function S(T){return T===124?h(T):T===null||ke(T)?!a||n!==i?N(T):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(T)):N(T)}function N(T){return r(T)}function I(T){return t.enter("tableRow"),E(T)}function E(T){return T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),E):T===null||ke(T)?(t.exit("tableRow"),e(T)):lt(T)?it(t,E,"whitespace")(T):(t.enter("data"),w(T))}function w(T){return T===null||T===124||Pt(T)?(t.exit("data"),E(T)):(t.consume(T),T===92?C:w)}function C(T){return T===92||T===124?(t.consume(T),w):w(T)}}function pBe(t,e){let r=-1,o=!0,n=0,i=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d,f=new $S;for(;++r<t.length;){let m=t[r],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(ete(f,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.add(r,0,[["enter",c,e]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(o=!0,d=void 0,i=[0,0,0,0],a=[0,r+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.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,a[2]===0&&(i[1]!==0&&(a[0]=a[1],d=zS(f,e,i,n,void 0,d),i=[0,0,0,0]),a[2]=r)):h.type==="tableCellDivider"&&(o?o=!1:(i[1]!==0&&(a[0]=a[1],d=zS(f,e,i,n,void 0,d)),i=a,a=[i[1],r,0,0])):h.type==="tableHead"?(s=!0,l=r):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=r,i[1]!==0?(a[0]=a[1],d=zS(f,e,i,n,r,d)):a[1]!==0&&(d=zS(f,e,a,n,r,d)),n=0):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(a[3]=r)}for(l!==0&&ete(f,e,l,c,u),f.consume(e.events),r=-1;++r<e.events.length;){let m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=Zee(e.events,r))}return t}function zS(t,e,r,o,n,i){let a=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(i.end=Object.assign({},bh(e.events,r[0])),t.add(r[0],0,[["exit",i,e]]));let l=bh(e.events,r[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",i,e]]),r[2]!==0){let c=bh(e.events,r[2]),u=bh(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 f=e.events[r[2]],m=e.events[r[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[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&&(i.end=Object.assign({},bh(e.events,n)),t.add(n,0,[["exit",i,e]]),i=void 0),i}function ete(t,e,r,o,n){let i=[],a=bh(e.events,r);n&&(n.end=Object.assign({},a),i.push(["exit",n,e])),o.end=Object.assign({},a),i.push(["exit",o,e]),t.add(r+1,0,i)}function bh(t,e){let r=t[e],o=r[0]==="enter"?"start":"end";return r[1][o]}var mBe={tokenize:hBe};function xL(){return{text:{91:mBe}}}function hBe(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"),i)}function i(l){return Pt(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):r(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return ke(l)?e(l):lt(l)?t.check({tokenize:gBe},e,r)(l):r(l)}}function gBe(t,e,r){return it(t,o,"whitespace");function o(n){return n===null?r(n):e(n)}}function tte(t){return CS([pL(),hL(),gL(t),_L(),xL()])}we();we();var rte=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],ote=[...rte,"svg"],nte=["mp4","webm"],_Be="https://lh3.googleusercontent.com/";async function Iu(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=await wBe(t),n=yh(t.name),i=e?.preserveFilename?`${o}/${t.name}`:`${o}.${n}`,a=`${r}/uploads/${i}`,s=WJ(window.firebase.storage,a),l=jJ(s,t),c=-1,u=Date.now();return await new Promise((d,f)=>{let m=setInterval(()=>{Date.now()-u>1e4&&(clearInterval(m),f(new Error("Upload stalled: no progress for 10 seconds")))},1e3);l.on("state_changed",h=>{h.bytesTransferred>0&&clearInterval(m),console.log(`uploading ${t.name}: ${h.bytesTransferred} / ${h.totalBytes} bytes`),h.bytesTransferred!==c&&(c=h.bytesTransferred,u=Date.now())},h=>{clearInterval(m),f(h)},()=>{console.log(`uploaded ${a}`),clearInterval(m),d(l.snapshot)})}),xBe(s,t,n,e)}async function xBe(t,e,r,o){let n={};n.filename=e.name,n.uploadedBy=window.firebase.user.email||"unknown",n.uploadedAt=String(Math.floor(new Date().getTime()));let i=`/${t.bucket}/${t.fullPath}`,a=`https://storage.googleapis.com${i}`;if(ote.includes(r)){let l=await vBe(e);if(n.width=l.width,n.height=l.height,!o?.disableGci&&rte.includes(r)){let c=await yBe(i);c&&(n.gcsPath=i,a=c)}n.canvasBgColor=await SBe(e)?"dark":"light"}else if(nte.includes(r)){let l=await IBe(a);n.width=l.width,n.height=l.height,console.log("video dimensions:",l)}let s=o?.cacheControl||"public, max-age=31536000";return await GJ(t,{cacheControl:s,customMetadata:EBe(n)}),console.log("updated meta data: ",n),{...n,src:a}}function yh(t){return bBe(t.split(".").at(-1)||"")}function bBe(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function yBe(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 a=await n.text();throw console.error(`failed to get gci url: ${o}`),console.error(a),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function vBe(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 IBe(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 wBe(t){let e=await t.arrayBuffer(),r=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}function EBe(t){let e={};return Object.entries(t).forEach(([r,o])=>{t[r]=String(o).trim()}),e}function bL(t){if(!t)return!1;if(US(t)||t.startsWith("data:image/"))return!0;let e=yh(t);return ote.includes(e)}function US(t){return t?t.startsWith(_Be):!1}function yL(t){if(!t)return!1;let e=yh(t);return nte.includes(e)}function ite(t){return US(t)?t.split("=")[0]+"=s0-d":t}function SBe(t){return new Promise((e,r)=>{let o=new Image,n=new FileReader;n.onload=()=>{o.src=n.result},o.onload=()=>{let i=document.createElement("canvas"),a=i.getContext("2d");i.width=o.width,i.height=o.height,a.drawImage(o,0,0,i.width,i.height);let{data:s}=a.getImageData(0,0,i.width,i.height),l=0,c=0,u=0,d=0;for(let m=0;m<s.length;m+=400)l+=s[m],c+=s[m+1],u+=s[m+2],d++;let f=.299*(l/d)+.587*(c/d)+.114*(u/d);e(f<128)},o.onerror=r,n.onerror=r,n.readAsDataURL(t)})}function VS(t){let[e,r]=M(""),o=W(null),n=W(null),[i,a]=M(null),[s,l]=M(!1),c=!e;function u(b){return b.endsWith(".jpg")?"image/jpeg":"image/png"}async function d(){if(!e)return;let b=[{type:"text",text:e}];i&&b.push({type:"image",image:{src:i.src,width:i.width,height:i.height,alt:i.filename}});let y=t.chat.addMessage({sender:"user",blocks:b});r(""),a(null),f();let v=[{text:e}];i&&v.push({media:{url:i.src,contentType:u(i.filename)}});let S=await t.chat.sendPrompt(y,v,t.options);t.onData&&S&&t.onData(S)}function f(){window.requestAnimationFrame(()=>{let b=o.current;b.style.height="auto",b.style.height=`${b.scrollHeight}px`})}function m(b){if(b.key==="Enter"&&!b.shiftKey){b.preventDefault(),d();return}}async function h(b){try{l(!0),f();let y=await Iu(b,{disableGci:!0});a({src:y.src,width:y.width,height:y.height,filename:y.filename}),l(!1)}catch{l(!1)}if(n.current){let y=n.current;y.value=""}}function g(b){let S=(b.target.files||[])[0];S&&h(S)}function _(){a(null),f()}return U(()=>{f()},[e]),p("div",{className:"AIPage__ChatBar",children:[p("div",{className:Fe("AIPage__ChatBar__prompt",(s||i)&&"AIPage__ChatBar__prompt--hasImage"),children:[p("label",{className:"AIPage__ChatBar__prompt__imageUpload",children:[p("input",{className:"AIPage__ChatBar__prompt__imageUpload__input",type:"file",accept:"image/png, image/jpeg, image/webp",onChange:g,ref:n}),p(Ne,{label:"Upload image",children:p(Je,{component:"div",className:"AIPage__ChatBar__prompt__imageUpload__icon",radius:"xl",children:p(vb,{size:18})})})]}),p("textarea",{className:"AIPage__ChatBar__prompt__textInput",ref:o,placeholder:"Enter prompt...",rows:1,onKeyDown:m,onPaste:b=>{let y=b.clipboardData?.items||[];for(let v of y)if(v.kind==="file"&&v.type.startsWith("image/")){let S=v.getAsFile();S&&h(S)}},onChange:b=>{r(b.target.value)},value:e,autofocus:!0}),(s||i)&&p("div",{className:"AIPage__ChatBar__prompt__imagePreview",children:s?p(rt,{size:"sm"}):p(Ne,{label:i.filename,transition:"pop",position:"right",withArrow:!0,children:p("button",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton",onClick:()=>_(),children:[p("img",{src:i.src,width:i.width,height:i.height,alt:"attachment"}),p("div",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton__icon",children:p(Tb,{size:24,color:"white"})})]})})}),p(Je,{className:"AIPage__ChatBar__prompt__submit",variant:"filled",color:"dark",radius:"xl",onClick:()=>d(),disabled:c,children:p(hM,{size:18})})]}),p("div",{className:"AIPage__ChatBar__disclaimer",children:"Root AI is experimental and makes mistakes. Check all info."})]})}var ate={name:"@blinkk/root-cms",version:"3.0.0",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 --legal-comments=external","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui --legal-comments=external",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":"1.18.0","@genkit-ai/core":"1.18.0","@genkit-ai/vertexai":"1.18.0","@google-cloud/firestore":"7.11.3","@hello-pangea/dnd":"18.0.1","body-parser":"1.20.2",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4",diff:"8.0.2","dts-dom":"3.7.0","fnv-plus":"1.3.1",genkit:"1.18.0",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9",zod:"3.23.8"},"//":"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.5.2","@firebase/app-types":"0.9.3","@firebase/rules-unit-testing":"5.0.0","@lexical/code":"0.33.1","@lexical/html":"0.33.1","@lexical/link":"0.33.1","@lexical/list":"0.33.1","@lexical/markdown":"0.33.1","@lexical/react":"0.33.1","@lexical/rich-text":"0.33.1","@lexical/selection":"0.33.1","@lexical/utils":"0.33.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":"24.3.1",concurrently:"7.6.0",esbuild:"0.25.9",firebase:"12.2.1","firebase-admin":"13.5.0","firebase-functions":"6.4.0","firebase-tools":"14.15.2","highlight.js":"11.6.0","json-diff-kit":"1.0.29",lexical:"0.33.1",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.27.1","preact-render-to-string":"6.6.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.5.0",typescript:"5.9.2",vite:"7.1.4",vitest:"3.2.4",yjs:"13.6.27"},peerDependencies:{"@blinkk/root":"2.1.1","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function ste(){return p("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("g",{"clip-path":"url(#clip0_1_318)",children:[p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"})]}),p("defs",{children:p("clipPath",{id:"clip0_1_318",children:p("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var rc="1.5";function $e(t){return p("div",{className:"Layout",children:[p($e.Top,{}),p($e.Side,{}),p($e.Main,{...t,children:t.children}),p($e.Bottom,{})]})}$e.Top=()=>{let t=window.__ROOT_CTX.rootConfig.projectName||window.__ROOT_CTX.rootConfig.projectId;return p("div",{className:"Layout__top",children:[p("a",{className:"Layout__top__logo",href:"/cms",children:p(ste,{})}),p("div",{className:"Layout__top__version",children:["v",ate.version]}),p("div",{className:"Layout__top__project",children:t})]})};$e.Side=()=>{let[t]=XJ(),e=t.url.replace(/\/*$/g,""),r=window.firebase.user,o=window.__ROOT_CTX.sidebar?.tools,n=window.__ROOT_CTX.experiments||{};return p("div",{className:"Layout__side",children:[p("div",{className:"Layout__side__buttons",children:[p($e.SideButton,{label:"Home",url:"/cms",active:e==="/cms",children:p(nM,{stroke:rc})}),p($e.SideButton,{label:"Content",url:"/cms/content",active:e.startsWith("/cms/content"),children:p(_f,{stroke:rc})}),p($e.SideButton,{label:"Releases",url:"/cms/releases",active:e.startsWith("/cms/releases"),children:p(dh,{stroke:rc})}),p($e.SideButton,{label:"Data",url:"/cms/data",active:e.startsWith("/cms/data"),children:p(WR,{stroke:rc})}),p($e.SideButton,{label:"Assets",url:"/cms/assets",active:e.startsWith("/cms/assets"),children:p(fS,{stroke:rc})}),p($e.SideButton,{label:"Translations",url:"/cms/translations",active:e.startsWith("/cms/translations"),children:p(_u,{stroke:rc})}),n.ai&&p($e.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:e.startsWith("/cms/ai"),children:p(bf,{stroke:rc})}),o&&p(Pe,{children:[p("div",{className:"Layout__side__divider"}),Object.entries(o).map(([i,a])=>p($e.SideButton,{className:"Layout__side__tool",label:a.label||"",url:`/cms/tools/${i}`,active:e.startsWith(`/cms/tools/${i}`),children:a.icon?p("img",{className:"Layout__side__tool__icon",src:a.icon,alt:a.label||""}):p(zR,{stroke:rc})})),p("div",{className:"Layout__side__divider"})]}),p($e.SideButton,{label:"Settings",url:"/cms/settings",active:e.startsWith("/cms/settings"),children:p(yf,{stroke:rc})})]}),p("div",{className:"Layout__side__user",children:p(Ne,{label:r.email,position:"right",withArrow:!0,children:p(Ea,{src:r.photoURL,alt:r.email,size:30,radius:"xl"})})})]})};$e.SideButton=t=>p(Ne,{className:Fe("Layout__side__button",t.className),label:t.label,position:"right",withArrow:!0,children:p("a",{className:Fe(t.active&&"active"),href:t.url,children:t.children})});$e.Main=t=>p("div",{className:"Layout__main",children:t.children});$e.Bottom=()=>p("div",{className:"Layout__bottom"});function cs(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 lte(t,e){return Math.random()*(e-t)+t}var TBe=[20,40];RM.configure({ignoreUnescapedHTML:!0});function cte(){return lte(...TBe)}function Fb(){let[t,e]=M([]),[r,o]=M(""),n=s=>{let l=0;return e(c=>{let u={sender:"bot",blocks:[{type:"pending"}],key:cs()},d=[...c,{...s,key:cs()},u];return l=d.length-1,d}),l},i=(s,l)=>{e(c=>{let u=[...c];return u[s]={...l,key:cs()},u})};return{chatId:r,messages:t,addMessage:n,updateMessage:i,sendPrompt:async(s,l,c)=>{let u="/cms/api/ai.chat";typeof window.__ROOT_CTX.experiments?.ai=="object"&&window.__ROOT_CTX.experiments.ai.endpoint&&(u=window.__ROOT_CTX.experiments.ai.endpoint);let d={prompt:l,chatId:r,options:c},f=await window.fetch(u,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});if(f.status!==200){let h=await f.text();console.error("chat failed",h);let g=["Something went wrong:","```",h,"```"].join(`
63
+ `;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&n)continue;a=" ";break}default:a=String.fromCharCode(i)}n=i===-2,o.push(a)}return o.join("")}var qM={};nr(qM,{attentionMarkers:()=>J2e,contentInitial:()=>G2e,disable:()=>Q2e,document:()=>j2e,flow:()=>q2e,flowInitial:()=>W2e,insideSpan:()=>X2e,string:()=>K2e,text:()=>Y2e});var j2e={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:kS},G2e={91:$M},W2e={[-2]:Rb,[-1]:Rb,32:Rb},q2e={35:UM,42:kf,45:[FS,kf],60:HM,61:FS,95:kf,96:PS,126:PS},K2e={38:OS,92:NS},Y2e={[-5]:Lb,[-4]:Lb,[-3]:Lb,33:GM,38:OS,42:Db,60:[LM,jM],91:WM,92:[zM,NS],93:Tf,95:Db,96:FM},X2e={null:[Db,Cee]},J2e={null:[42,95]},Q2e={null:[]};function KM(t){let r=CS([qM,...(t||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(bee),document:n(vee),flow:n(See),string:n(Tee),text:n(kee)};return o;function n(i){return a;function a(s){return Pee(o,i,s)}}}function YM(t){for(;!DS(t););return t}var Aee=/[\0\t\n\r]/g;function XM(){let t=1,e="",r=!0,o;return n;function n(i,a,s){let l=[],c,u,d,f,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),d=0,e="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(Aee.lastIndex=d,c=Aee.exec(i),f=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(f),!c){e=i.slice(d);break}if(m===10&&d===f&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<f&&(l.push(i.slice(d,f)),t+=f-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=f+1}return s&&(o&&l.push(-5),e&&l.push(e),l.push(null)),l}}var Z2e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dee(t){return t.replace(Z2e,eFe)}function eFe(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),i=n===120||n===88;return TS(r.slice(i?2:1),i?16:10)}return hh(r)||t}function _h(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Ree(t.position):"start"in t||"end"in t?Ree(t):"line"in t||"column"in t?JM(t):""}function JM(t){return Mee(t&&t.line)+":"+Mee(t&&t.column)}function Ree(t){return JM(t&&t.start)+"-"+JM(t&&t.end)}function Mee(t){return t&&typeof t=="number"?t:1}var Fee={}.hasOwnProperty;function QM(t,e,r){return typeof e!="string"&&(r=e,e=void 0),tFe(r)(YM(KM(r).document().write(XM()(t,e,!0))))}function tFe(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ut),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(Yr),blockQuote:i(st),characterEscape:C,characterReference:C,codeFenced:i(Rt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Rt,a),codeText:i(ut,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(ht),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(bt),hardBreakEscape:i(Mt),hardBreakTrailing:i(Mt),htmlFlow:i(ye,a),htmlFlowData:C,htmlText:i(ye,a),htmlTextData:C,image:i(un),label:a,link:i(Ut),listItem:i(zr),listItemValue:f,listOrdered:i(pt,d),listUnordered:i(pt),paragraph:i(Ur),reference:$,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Yr),strong:i(Po),thematicBreak:i(ie)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:Te,autolinkProtocol:Me,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:je,characterReference:Qe,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:T,codeIndented:l(b),codeText:l(B),codeTextData:T,data:T,definition:l(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(R),hardBreakTrailing:l(R),htmlFlow:l(O),htmlFlowData:T,htmlText:l(z),htmlTextData:T,image:l(H),label:Y,labelText:G,lineEnding:A,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ge,resourceDestinationString:L,resourceTitleString:ne,resource:ae,setextHeading:l(w),setextHeadingLineSequence:E,setextHeadingText:I,strong:l(),thematicBreak:l()}};Bee(e,(t||{}).mdastExtensions||[]);let r={};return o;function o(j){let Q={type:"root",children:[]},se={stack:[Q],tokenStack:[],config:e,enter:s,exit:c,buffer:a,resume:u,data:r},He=[],yt=-1;for(;++yt<j.length;)if(j[yt][1].type==="listOrdered"||j[yt][1].type==="listUnordered")if(j[yt][0]==="enter")He.push(yt);else{let Nt=He.pop();yt=n(j,Nt,yt)}for(yt=-1;++yt<j.length;){let Nt=e[j[yt][0]];Fee.call(Nt,j[yt][1].type)&&Nt[j[yt][1].type].call(Object.assign({sliceSerialize:j[yt][2].sliceSerialize},se),j[yt][1])}if(se.tokenStack.length>0){let Nt=se.tokenStack[se.tokenStack.length-1];(Nt[1]||Lee).call(se,void 0,Nt[0])}for(Q.position={start:vu(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:vu(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},yt=-1;++yt<e.transforms.length;)Q=e.transforms[yt](Q)||Q;return Q}function n(j,Q,se){let He=Q-1,yt=-1,Nt=!1,Rn,_r,kr,Kn;for(;++He<=se;){let no=j[He];switch(no[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{no[0]==="enter"?yt++:yt--,Kn=void 0;break}case"lineEndingBlank":{no[0]==="enter"&&(Rn&&!Kn&&!yt&&!kr&&(kr=He),Kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kn=void 0}if(!yt&&no[0]==="enter"&&no[1].type==="listItemPrefix"||yt===-1&&no[0]==="exit"&&(no[1].type==="listUnordered"||no[1].type==="listOrdered")){if(Rn){let dn=He;for(_r=void 0;dn--;){let fn=j[dn];if(fn[1].type==="lineEnding"||fn[1].type==="lineEndingBlank"){if(fn[0]==="exit")continue;_r&&(j[_r][1].type="lineEndingBlank",Nt=!0),fn[1].type="lineEnding",_r=dn}else if(!(fn[1].type==="linePrefix"||fn[1].type==="blockQuotePrefix"||fn[1].type==="blockQuotePrefixWhitespace"||fn[1].type==="blockQuoteMarker"||fn[1].type==="listItemIndent"))break}kr&&(!_r||kr<_r)&&(Rn._spread=!0),Rn.end=Object.assign({},_r?j[_r][1].start:no[1].end),j.splice(_r||He,0,["exit",Rn,no[2]]),He++,se++}if(no[1].type==="listItemPrefix"){let dn={type:"listItem",_spread:!1,start:Object.assign({},no[1].start),end:void 0};Rn=dn,j.splice(He,0,["enter",dn,no[2]]),He++,se++,kr=void 0,Kn=!0}}}return j[Q][1]._spread=Nt,se}function i(j,Q){return se;function se(He){s.call(this,j(He),He),Q&&Q.call(this,He)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(j,Q,se){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([Q,se]),j.position={start:vu(Q.start),end:void 0}}function l(j){return Q;function Q(se){j&&j.call(this,se),c.call(this,se)}}function c(j,Q){let se=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==j.type&&(Q?Q.call(this,j,He[0]):(He[1]||Lee).call(this,j,He[0]));else throw new Error("Cannot close `"+j.type+"` ("+_h({start:j.start,end:j.end})+"): it\u2019s not open");se.position.end=vu(j.end)}function u(){return MM(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(j){if(this.data.expectingFirstListItemValue){let Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function m(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=j}function h(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=j}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j.replace(/(\r?\n|\r)$/g,"")}function y(j){let Q=this.resume(),se=this.stack[this.stack.length-1];se.label=Q,se.identifier=Hn(this.sliceSerialize(j)).toLowerCase()}function v(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.title=j}function S(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.url=j}function N(j){let Q=this.stack[this.stack.length-1];if(!Q.depth){let se=this.sliceSerialize(j).length;Q.depth=se}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function E(j){let Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function C(j){let se=this.stack[this.stack.length-1].children,He=se[se.length-1];(!He||He.type!=="text")&&(He=Be(),He.position={start:vu(j.start),end:void 0},se.push(He)),this.stack.push(He)}function T(j){let Q=this.stack.pop();Q.value+=this.sliceSerialize(j),Q.position.end=vu(j.end)}function A(j){let Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){let se=Q.children[Q.children.length-1];se.position.end=vu(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Q.type)&&(C.call(this,j),T.call(this,j))}function R(){this.data.atHardBreak=!0}function O(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j}function z(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j}function B(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.value=j}function V(){let j=this.stack[this.stack.length-1];if(this.data.inReference){let Q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=Q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function H(){let j=this.stack[this.stack.length-1];if(this.data.inReference){let Q=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=Q,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function G(j){let Q=this.sliceSerialize(j),se=this.stack[this.stack.length-2];se.label=Dee(Q),se.identifier=Hn(Q).toLowerCase()}function Y(){let j=this.stack[this.stack.length-1],Q=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){let He=j.children;se.children=He}else se.alt=Q}function L(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.url=j}function ne(){let j=this.resume(),Q=this.stack[this.stack.length-1];Q.title=j}function ae(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function ge(j){let Q=this.resume(),se=this.stack[this.stack.length-1];se.label=Q,se.identifier=Hn(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function Ce(j){this.data.characterReferenceType=j.type}function je(j){let Q=this.sliceSerialize(j),se=this.data.characterReferenceType,He;se?(He=TS(Q,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=hh(Q);let yt=this.stack[this.stack.length-1];yt.value+=He}function Qe(j){let Q=this.stack.pop();Q.position.end=vu(j.end)}function Me(j){T.call(this,j);let Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(j)}function Te(j){T.call(this,j);let Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(j)}function st(){return{type:"blockquote",children:[]}}function Rt(){return{type:"code",lang:null,meta:null,value:""}}function ut(){return{type:"inlineCode",value:""}}function ht(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bt(){return{type:"emphasis",children:[]}}function Yr(){return{type:"heading",depth:0,children:[]}}function Mt(){return{type:"break"}}function ye(){return{type:"html",value:""}}function un(){return{type:"image",title:null,url:"",alt:null}}function Ut(){return{type:"link",title:null,url:"",children:[]}}function pt(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function zr(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function Ur(){return{type:"paragraph",children:[]}}function Po(){return{type:"strong",children:[]}}function Be(){return{type:"text",value:""}}function ie(){return{type:"thematicBreak"}}}function vu(t){return{line:t.line,column:t.column,offset:t.offset}}function Bee(t,e){let r=-1;for(;++r<e.length;){let o=e[r];Array.isArray(o)?Bee(t,o):rFe(t,o)}}function rFe(t,e){let r;for(r in e)if(Fee.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 Lee(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+_h({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+_h({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+_h({start:e.start,end:e.end})+") is still open")}function ZM(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 eL(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var xh=(function(t){if(t==null)return aFe;if(typeof t=="function")return BS(t);if(typeof t=="object")return Array.isArray(t)?oFe(t):nFe(t);if(typeof t=="string")return iFe(t);throw new Error("Expected function, string, or object as test")});function oFe(t){let e=[],r=-1;for(;++r<t.length;)e[r]=xh(t[r]);return BS(o);function o(...n){let i=-1;for(;++i<e.length;)if(e[i].apply(this,n))return!0;return!1}}function nFe(t){let e=t;return BS(r);function r(o){let n=o,i;for(i in t)if(n[i]!==e[i])return!1;return!0}}function iFe(t){return BS(e);function e(r){return r&&r.type===t}}function BS(t){return e;function e(r,o,n){return!!(sFe(r)&&t.call(this,r,typeof o=="number"?o:void 0,n||void 0))}}function aFe(){return!0}function sFe(t){return t!==null&&typeof t=="object"&&"type"in t}var $ee=[],zee=!0,tL=!1,Uee="skip";function rL(t,e,r,o){let n;typeof e=="function"&&typeof r!="function"?(o=r,r=e):n=e;let i=xh(n),a=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(f,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=$ee,h,g,_;if((!e||i(l,c,u[u.length-1]||void 0))&&(m=lFe(r(l,u)),m[0]===tL))return m;if("children"in l&&l.children){let b=l;if(b.children&&m[0]!==Uee)for(g=(o?b.children.length:-1)+a,_=u.concat(b);g>-1&&g<b.children.length;){let y=b.children[g];if(h=s(y,g,_)(),h[0]===tL)return h;g=typeof h[1]=="number"?h[1]:g+a}}return m}}}function lFe(t){return Array.isArray(t)?t:typeof t=="number"?[zee,t]:t==null?$ee:[t]}function oL(t,e,r){let n=xh((r||{}).ignore||[]),i=cFe(e),a=-1;for(;++a<i.length;)rL(t,"text",s);function s(c,u){let d=-1,f;for(;++d<u.length;){let m=u[d],h=f?f.children:void 0;if(n(m,h?h.indexOf(m):void 0,f))return;f=m}if(f)return l(c,u)}function l(c,u){let d=u[u.length-1],f=i[a][0],m=i[a][1],h=0,_=d.children.indexOf(c),b=!1,y=[];f.lastIndex=0;let v=f.exec(c.value);for(;v;){let S=v.index,N={index:v.index,input:v.input,stack:[...u,c]},I=m(...v,N);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?f.lastIndex=S+1:(h!==S&&y.push({type:"text",value:c.value.slice(h,S)}),Array.isArray(I)?y.push(...I):I&&y.push(I),h=S+v[0].length,b=!0),!f.global)break;v=f.exec(c.value)}return b?(h<c.value.length&&y.push({type:"text",value:c.value.slice(h)}),d.children.splice(_,1,...y)):y=[c],_+y.length}}function cFe(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([uFe(n[0]),dFe(n[1])])}return e}function uFe(t){return typeof t=="string"?new RegExp(eL(t),"g"):t}function dFe(t){return typeof t=="function"?t:function(){return t}}function iL(){return{transforms:[_Fe],enter:{literalAutolink:fFe,literalAutolinkEmail:nL,literalAutolinkHttp:nL,literalAutolinkWww:nL},exit:{literalAutolink:gFe,literalAutolinkEmail:hFe,literalAutolinkHttp:pFe,literalAutolinkWww:mFe}}}function fFe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function nL(t){this.config.enter.autolinkProtocol.call(this,t)}function pFe(t){this.config.exit.autolinkProtocol.call(this,t)}function mFe(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 hFe(t){this.config.exit.autolinkEmail.call(this,t)}function gFe(t){this.exit(t)}function _Fe(t){oL(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xFe],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,bFe]],{ignore:["link","linkReference"]})}function xFe(t,e,r,o,n){let i="";if(!Vee(n)||(/^w/i.test(e)&&(r=e+r,e="",i="http://"),!yFe(r)))return!1;let a=vFe(r+o);if(!a[0])return!1;let s={type:"link",title:null,url:i+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function bFe(t,e,r,o){return!Vee(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function yFe(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 vFe(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=ZM(t,"("),i=ZM(t,")");for(;o!==-1&&n>i;)t+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),i++;return[t,r]}function Vee(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||rl(r)||Sf(r))&&(!e||r!==47)}PFe.peek=AFe;function aL(){return{enter:{gfmFootnoteDefinition:wFe,gfmFootnoteDefinitionLabelString:EFe,gfmFootnoteCall:TFe,gfmFootnoteCallString:kFe},exit:{gfmFootnoteDefinition:CFe,gfmFootnoteDefinitionLabelString:SFe,gfmFootnoteCall:OFe,gfmFootnoteCallString:NFe}}}function wFe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function EFe(){this.buffer()}function SFe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=Hn(this.sliceSerialize(t)).toLowerCase()}function CFe(t){this.exit(t)}function TFe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function kFe(){this.buffer()}function NFe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=Hn(this.sliceSerialize(t)).toLowerCase()}function OFe(t){this.exit(t)}function PFe(t,e,r,o){let n=r.createTracker(o),i=n.move("[^"),a=r.enter("footnoteReference"),s=r.enter("reference");return i+=n.move(r.safe(r.associationId(t),{...n.current(),before:i,after:"]"})),s(),a(),i+=n.move("]"),i}function AFe(){return"["}LFe.peek=FFe;function sL(){return{canContainEols:["delete"],enter:{strikethrough:RFe},exit:{strikethrough:MFe}}}function RFe(t){this.enter({type:"delete",children:[]},t)}function MFe(t){this.exit(t)}function LFe(t,e,r,o){let n=r.createTracker(o),i=r.enter("strikethrough"),a=n.move("~~");return a+=r.containerPhrasing(t,{...n.current(),before:a,after:"~"}),a+=n.move("~~"),i(),a}function FFe(){return"~"}function cL(){return{enter:{table:$Fe,tableData:Hee,tableHeader:Hee,tableRow:UFe},exit:{codeText:VFe,table:zFe,tableData:lL,tableHeader:lL,tableRow:lL}}}function $Fe(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 zFe(t){this.exit(t),this.data.inTable=void 0}function UFe(t){this.enter({type:"tableRow",children:[]},t)}function lL(t){this.exit(t)}function Hee(t){this.enter({type:"tableCell",children:[]},t)}function VFe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,HFe));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function HFe(t,e){return e==="|"?e:t}function uL(){return{exit:{taskListCheckValueChecked:jee,taskListCheckValueUnchecked:jee,paragraph:GFe}}}function jee(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function GFe(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,i=-1,a;for(;++i<n.length;){let s=n[i];if(s.type==="paragraph"){a=s;break}}a===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 dL(){return[iL(),aL(),sL(),cL(),uL()]}var qFe={tokenize:QFe,partial:!0},Gee={tokenize:ZFe,partial:!0},Wee={tokenize:eBe,partial:!0},qee={tokenize:tBe,partial:!0},KFe={tokenize:rBe,partial:!0},Kee={tokenize:XFe,previous:Xee},Yee={tokenize:JFe,previous:Jee},tc={tokenize:YFe,previous:Qee},nl={};function pL(){return{text:nl}}var Nf=48;for(;Nf<123;)nl[Nf]=tc,Nf++,Nf===58?Nf=65:Nf===91&&(Nf=97);nl[43]=tc;nl[45]=tc;nl[46]=tc;nl[95]=tc;nl[72]=[tc,Yee];nl[104]=[tc,Yee];nl[87]=[tc,Kee];nl[119]=[tc,Kee];function YFe(t,e,r){let o=this,n,i;return a;function a(d){return!fL(d)||!Qee.call(o,o.previous)||mL(o.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),s(d))}function s(d){return fL(d)?(t.consume(d),s):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check(KFe,u,c)(d):d===45||d===95||Bo(d)?(i=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),n=!0,l}function u(d){return i&&n&&Fo(o.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function XFe(t,e,r){let o=this;return n;function n(a){return a!==87&&a!==119||!Xee.call(o,o.previous)||mL(o.events)?r(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(qFe,t.attempt(Gee,t.attempt(Wee,i),r),r)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function JFe(t,e,r){let o=this,n="",i=!1;return a;function a(d){return(d===72||d===104)&&Jee.call(o,o.previous)&&!mL(o.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),t.consume(d),s):r(d)}function s(d){if(Fo(d)&&n.length<5)return n+=String.fromCodePoint(d),t.consume(d),s;if(d===58){let f=n.toLowerCase();if(f==="http"||f==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),i?c:(i=!0,l)):r(d)}function c(d){return d===null||Ef(d)||Pt(d)||rl(d)||Sf(d)?r(d):t.attempt(Gee,t.attempt(Wee,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function QFe(t,e,r){let o=0;return n;function n(a){return(a===87||a===119)&&o<3?(o++,t.consume(a),n):a===46&&o===3?(t.consume(a),i):r(a)}function i(a){return a===null?r(a):e(a)}}function ZFe(t,e,r){let o,n,i;return a;function a(c){return c===46||c===95?t.check(qee,l,s)(c):c===null||Pt(c)||rl(c)||c!==45&&Sf(c)?l(c):(i=!0,t.consume(c),a)}function s(c){return c===95?o=!0:(n=o,o=void 0),t.consume(c),a}function l(c){return n||o||!i?r(c):e(c)}}function eBe(t,e){let r=0,o=0;return n;function n(a){return a===40?(r++,t.consume(a),n):a===41&&o<r?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(qee,e,i)(a):a===null||Pt(a)||rl(a)?e(a):(t.consume(a),n)}function i(a){return a===41&&o++,t.consume(a),n}}function tBe(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),i):s===93?(t.consume(s),n):s===60||s===null||Pt(s)||rl(s)?e(s):r(s)}function n(s){return s===null||s===40||s===91||Pt(s)||rl(s)?e(s):o(s)}function i(s){return Fo(s)?a(s):r(s)}function a(s){return s===59?(t.consume(s),o):Fo(s)?(t.consume(s),a):r(s)}}function rBe(t,e,r){return o;function o(i){return t.consume(i),n}function n(i){return Bo(i)?r(i):e(i)}}function Xee(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Pt(t)}function Jee(t){return!Fo(t)}function Qee(t){return!(t===47||fL(t))}function fL(t){return t===43||t===45||t===46||t===95||Bo(t)}function mL(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 oBe={tokenize:uBe,partial:!0};function hL(){return{document:{91:{tokenize:sBe,continuation:{tokenize:lBe},exit:cBe}},text:{91:{tokenize:aBe},93:{add:"after",tokenize:nBe,resolveTo:iBe}}}}function nBe(t,e,r){let o=this,n=o.events.length,i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a;for(;n--;){let l=o.events[n][1];if(l.type==="labelImage"){a=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(!a||!a._balanced)return r(l);let c=Hn(o.sliceSerialize({start:a.end,end:o.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function iBe(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function aBe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i=0,a;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(i>999||d===93&&!a||d===null||d===91||Pt(d))return r(d);if(d===93){t.exit("chunkString");let f=t.exit("gfmFootnoteCallString");return n.includes(Hn(o.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Pt(d)||(a=!0),i++,t.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(t.consume(d),i++,c):c(d)}}function sBe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i,a=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(a>999||h===93&&!s||h===null||h===91||Pt(h))return r(h);if(h===93){t.exit("chunkString");let g=t.exit("gfmFootnoteDefinitionLabelString");return i=Hn(o.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return Pt(h)||(s=!0),a++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,u):u(h)}function f(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),n.includes(i)||n.push(i),it(t,m,"gfmFootnoteDefinitionWhitespace")):r(h)}function m(h){return e(h)}}function lBe(t,e,r){return t.check(ol,e,t.attempt(oBe,e,r))}function cBe(t){t.exit("gfmFootnoteDefinition")}function uBe(t,e,r){let o=this;return it(t,n,"gfmFootnoteDefinitionIndent",5);function n(i){let a=o.events[o.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):r(i)}}function gL(t){let r=(t||{}).singleTilde,o={tokenize:i,resolveAll:n};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function n(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";let u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},f=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&ko(f,f.length,0,yu(m,a.slice(c+1,l),s)),ko(f,f.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),ko(a,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,s,l){let c=this.previous,u=this.events,d=0;return f;function f(h){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(h):(a.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let g=gh(c);if(h===126)return d>1?l(h):(a.consume(h),d++,m);if(d<2&&!r)return l(h);let _=a.exit("strikethroughSequenceTemporary"),b=gh(h);return _._open=!b||b===2&&!!g,_._close=!g||g===2&&!!b,s(h)}}}var $S=class{constructor(){this.map=[]}add(e,r,o){dBe(this,e,r,o)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[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 dBe(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 Zee(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 i=o.length-1;o[i]=o[i]==="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 _L(){return{flow:{null:{tokenize:fBe,resolveAll:pBe}}}}function fBe(t,e,r){let o=this,n=0,i=0,a;return s;function s(T){let A=o.events.length-1;for(;A>-1;){let z=o.events[A][1].type;if(z==="lineEnding"||z==="linePrefix")A--;else break}let R=A>-1?o.events[A][1].type:null,O=R==="tableHead"||R==="tableRow"?I:l;return O===I&&o.parser.lazy[o.now().line]?r(T):O(T)}function l(T){return t.enter("tableHead"),t.enter("tableRow"),c(T)}function c(T){return T===124||(a=!0,i+=1),u(T)}function u(T){return T===null?r(T):ke(T)?i>1?(i=0,o.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),m):r(T):lt(T)?it(t,u,"whitespace")(T):(i+=1,a&&(a=!1,n+=1),T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),a=!0,u):(t.enter("data"),d(T)))}function d(T){return T===null||T===124||Pt(T)?(t.exit("data"),u(T)):(t.consume(T),T===92?f:d)}function f(T){return T===92||T===124?(t.consume(T),d):d(T)}function m(T){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(T):(t.enter("tableDelimiterRow"),a=!1,lt(T)?it(t,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):h(T))}function h(T){return T===45||T===58?_(T):T===124?(a=!0,t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),g):N(T)}function g(T){return lt(T)?it(t,_,"whitespace")(T):_(T)}function _(T){return T===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),b):T===45?(i+=1,b(T)):T===null||ke(T)?S(T):N(T)}function b(T){return T===45?(t.enter("tableDelimiterFiller"),y(T)):N(T)}function y(T){return T===45?(t.consume(T),y):T===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(T),t.exit("tableDelimiterMarker"),v):(t.exit("tableDelimiterFiller"),v(T))}function v(T){return lt(T)?it(t,S,"whitespace")(T):S(T)}function S(T){return T===124?h(T):T===null||ke(T)?!a||n!==i?N(T):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(T)):N(T)}function N(T){return r(T)}function I(T){return t.enter("tableRow"),E(T)}function E(T){return T===124?(t.enter("tableCellDivider"),t.consume(T),t.exit("tableCellDivider"),E):T===null||ke(T)?(t.exit("tableRow"),e(T)):lt(T)?it(t,E,"whitespace")(T):(t.enter("data"),w(T))}function w(T){return T===null||T===124||Pt(T)?(t.exit("data"),E(T)):(t.consume(T),T===92?C:w)}function C(T){return T===92||T===124?(t.consume(T),w):w(T)}}function pBe(t,e){let r=-1,o=!0,n=0,i=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d,f=new $S;for(;++r<t.length;){let m=t[r],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(ete(f,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.add(r,0,[["enter",c,e]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(o=!0,d=void 0,i=[0,0,0,0],a=[0,r+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},f.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,a[2]===0&&(i[1]!==0&&(a[0]=a[1],d=zS(f,e,i,n,void 0,d),i=[0,0,0,0]),a[2]=r)):h.type==="tableCellDivider"&&(o?o=!1:(i[1]!==0&&(a[0]=a[1],d=zS(f,e,i,n,void 0,d)),i=a,a=[i[1],r,0,0])):h.type==="tableHead"?(s=!0,l=r):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=r,i[1]!==0?(a[0]=a[1],d=zS(f,e,i,n,r,d)):a[1]!==0&&(d=zS(f,e,a,n,r,d)),n=0):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(a[3]=r)}for(l!==0&&ete(f,e,l,c,u),f.consume(e.events),r=-1;++r<e.events.length;){let m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=Zee(e.events,r))}return t}function zS(t,e,r,o,n,i){let a=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(i.end=Object.assign({},bh(e.events,r[0])),t.add(r[0],0,[["exit",i,e]]));let l=bh(e.events,r[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",i,e]]),r[2]!==0){let c=bh(e.events,r[2]),u=bh(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 f=e.events[r[2]],m=e.events[r[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[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&&(i.end=Object.assign({},bh(e.events,n)),t.add(n,0,[["exit",i,e]]),i=void 0),i}function ete(t,e,r,o,n){let i=[],a=bh(e.events,r);n&&(n.end=Object.assign({},a),i.push(["exit",n,e])),o.end=Object.assign({},a),i.push(["exit",o,e]),t.add(r+1,0,i)}function bh(t,e){let r=t[e],o=r[0]==="enter"?"start":"end";return r[1][o]}var mBe={tokenize:hBe};function xL(){return{text:{91:mBe}}}function hBe(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"),i)}function i(l){return Pt(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):r(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return ke(l)?e(l):lt(l)?t.check({tokenize:gBe},e,r)(l):r(l)}}function gBe(t,e,r){return it(t,o,"whitespace");function o(n){return n===null?r(n):e(n)}}function tte(t){return CS([pL(),hL(),gL(t),_L(),xL()])}we();we();var rte=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],ote=[...rte,"svg"],nte=["mp4","webm"],_Be="https://lh3.googleusercontent.com/";async function Iu(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=await wBe(t),n=yh(t.name),i=e?.preserveFilename?`${o}/${t.name}`:`${o}.${n}`,a=`${r}/uploads/${i}`,s=WJ(window.firebase.storage,a),l=jJ(s,t),c=-1,u=Date.now();return await new Promise((d,f)=>{let m=setInterval(()=>{Date.now()-u>1e4&&(clearInterval(m),f(new Error("Upload stalled: no progress for 10 seconds")))},1e3);l.on("state_changed",h=>{h.bytesTransferred>0&&clearInterval(m),console.log(`uploading ${t.name}: ${h.bytesTransferred} / ${h.totalBytes} bytes`),h.bytesTransferred!==c&&(c=h.bytesTransferred,u=Date.now())},h=>{clearInterval(m),f(h)},()=>{console.log(`uploaded ${a}`),clearInterval(m),d(l.snapshot)})}),xBe(s,t,n,e)}async function xBe(t,e,r,o){let n={};n.filename=e.name,n.uploadedBy=window.firebase.user.email||"unknown",n.uploadedAt=String(Math.floor(new Date().getTime()));let i=`/${t.bucket}/${t.fullPath}`,a=`https://storage.googleapis.com${i}`;if(ote.includes(r)){let l=await vBe(e);if(n.width=l.width,n.height=l.height,!o?.disableGci&&rte.includes(r)){let c=await yBe(i);c&&(n.gcsPath=i,a=c)}n.canvasBgColor=await SBe(e)?"dark":"light"}else if(nte.includes(r)){let l=await IBe(a);n.width=l.width,n.height=l.height,console.log("video dimensions:",l)}let s=o?.cacheControl||"public, max-age=31536000";return await GJ(t,{cacheControl:s,customMetadata:EBe(n)}),console.log("updated meta data: ",n),{...n,src:a}}function yh(t){return bBe(t.split(".").at(-1)||"")}function bBe(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function yBe(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 a=await n.text();throw console.error(`failed to get gci url: ${o}`),console.error(a),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function vBe(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 IBe(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 wBe(t){let e=await t.arrayBuffer(),r=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(r)).map(i=>i.toString(16).padStart(2,"0")).join("")}function EBe(t){let e={};return Object.entries(t).forEach(([r,o])=>{t[r]=String(o).trim()}),e}function bL(t){if(!t)return!1;if(US(t)||t.startsWith("data:image/"))return!0;let e=yh(t);return ote.includes(e)}function US(t){return t?t.startsWith(_Be):!1}function yL(t){if(!t)return!1;let e=yh(t);return nte.includes(e)}function ite(t){return US(t)?t.split("=")[0]+"=s0-d":t}function SBe(t){return new Promise((e,r)=>{let o=new Image,n=new FileReader;n.onload=()=>{o.src=n.result},o.onload=()=>{let i=document.createElement("canvas"),a=i.getContext("2d");i.width=o.width,i.height=o.height,a.drawImage(o,0,0,i.width,i.height);let{data:s}=a.getImageData(0,0,i.width,i.height),l=0,c=0,u=0,d=0;for(let m=0;m<s.length;m+=400)l+=s[m],c+=s[m+1],u+=s[m+2],d++;let f=.299*(l/d)+.587*(c/d)+.114*(u/d);e(f<128)},o.onerror=r,n.onerror=r,n.readAsDataURL(t)})}function VS(t){let[e,r]=M(""),o=W(null),n=W(null),[i,a]=M(null),[s,l]=M(!1),c=!e;function u(b){return b.endsWith(".jpg")?"image/jpeg":"image/png"}async function d(){if(!e)return;let b=[{type:"text",text:e}];i&&b.push({type:"image",image:{src:i.src,width:i.width,height:i.height,alt:i.filename}});let y=t.chat.addMessage({sender:"user",blocks:b});r(""),a(null),f();let v=[{text:e}];i&&v.push({media:{url:i.src,contentType:u(i.filename)}});let S=await t.chat.sendPrompt(y,v,t.options);t.onData&&S&&t.onData(S)}function f(){window.requestAnimationFrame(()=>{let b=o.current;b.style.height="auto",b.style.height=`${b.scrollHeight}px`})}function m(b){if(b.key==="Enter"&&!b.shiftKey){b.preventDefault(),d();return}}async function h(b){try{l(!0),f();let y=await Iu(b,{disableGci:!0});a({src:y.src,width:y.width,height:y.height,filename:y.filename}),l(!1)}catch{l(!1)}if(n.current){let y=n.current;y.value=""}}function g(b){let S=(b.target.files||[])[0];S&&h(S)}function _(){a(null),f()}return U(()=>{f()},[e]),p("div",{className:"AIPage__ChatBar",children:[p("div",{className:Fe("AIPage__ChatBar__prompt",(s||i)&&"AIPage__ChatBar__prompt--hasImage"),children:[p("label",{className:"AIPage__ChatBar__prompt__imageUpload",children:[p("input",{className:"AIPage__ChatBar__prompt__imageUpload__input",type:"file",accept:"image/png, image/jpeg, image/webp",onChange:g,ref:n}),p(Ne,{label:"Upload image",children:p(Je,{component:"div",className:"AIPage__ChatBar__prompt__imageUpload__icon",radius:"xl",children:p(vb,{size:18})})})]}),p("textarea",{className:"AIPage__ChatBar__prompt__textInput",ref:o,placeholder:"Enter prompt...",rows:1,onKeyDown:m,onPaste:b=>{let y=b.clipboardData?.items||[];for(let v of y)if(v.kind==="file"&&v.type.startsWith("image/")){let S=v.getAsFile();S&&h(S)}},onChange:b=>{r(b.target.value)},value:e,autofocus:!0}),(s||i)&&p("div",{className:"AIPage__ChatBar__prompt__imagePreview",children:s?p(rt,{size:"sm"}):p(Ne,{label:i.filename,transition:"pop",position:"right",withArrow:!0,children:p("button",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton",onClick:()=>_(),children:[p("img",{src:i.src,width:i.width,height:i.height,alt:"attachment"}),p("div",{className:"AIPage__ChatBar__prompt__imagePreview__closeButton__icon",children:p(Tb,{size:24,color:"white"})})]})})}),p(Je,{className:"AIPage__ChatBar__prompt__submit",variant:"filled",color:"dark",radius:"xl",onClick:()=>d(),disabled:c,children:p(hM,{size:18})})]}),p("div",{className:"AIPage__ChatBar__disclaimer",children:"Root AI is experimental and makes mistakes. Check all info."})]})}var ate={name:"@blinkk/root-cms",version:"2.2.1-alpha.2",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 --legal-comments=external","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui --legal-comments=external",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":"1.18.0","@genkit-ai/core":"1.18.0","@genkit-ai/vertexai":"1.18.0","@google-cloud/firestore":"7.11.3","@hello-pangea/dnd":"18.0.1","body-parser":"1.20.2",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4",diff:"8.0.2","dts-dom":"3.7.0","fnv-plus":"1.3.1",genkit:"1.18.0",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9",zod:"3.23.8"},"//":"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.5.2","@firebase/app-types":"0.9.3","@firebase/rules-unit-testing":"5.0.0","@lexical/code":"0.33.1","@lexical/html":"0.33.1","@lexical/link":"0.33.1","@lexical/list":"0.33.1","@lexical/markdown":"0.33.1","@lexical/react":"0.33.1","@lexical/rich-text":"0.33.1","@lexical/selection":"0.33.1","@lexical/utils":"0.33.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":"18.3.1","@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":"24.3.1",concurrently:"7.6.0",esbuild:"0.25.9",firebase:"12.2.1","firebase-admin":"13.5.0","firebase-functions":"6.4.0","firebase-tools":"14.15.2","highlight.js":"11.6.0","json-diff-kit":"1.0.29",lexical:"0.33.1",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.27.1","preact-render-to-string":"6.6.1","preact-router":"4.1.2",react:"npm:@preact/compat@18.3.1","react-dom":"npm:@preact/compat@18.3.1","react-json-view-compare":"2.0.2",tsup:"8.5.0",typescript:"5.9.2",vite:"7.1.4",vitest:"3.2.4",yjs:"13.6.27"},peerDependencies:{"@blinkk/root":"2.2.1-alpha.2","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function ste(){return p("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("g",{"clip-path":"url(#clip0_1_318)",children:[p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"}),p("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"})]}),p("defs",{children:p("clipPath",{id:"clip0_1_318",children:p("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var rc="1.5";function $e(t){return p("div",{className:"Layout",children:[p($e.Top,{}),p($e.Side,{}),p($e.Main,{...t,children:t.children}),p($e.Bottom,{})]})}$e.Top=()=>{let t=window.__ROOT_CTX.rootConfig.projectName||window.__ROOT_CTX.rootConfig.projectId;return p("div",{className:"Layout__top",children:[p("a",{className:"Layout__top__logo",href:"/cms",children:p(ste,{})}),p("div",{className:"Layout__top__version",children:["v",ate.version]}),p("div",{className:"Layout__top__project",children:t})]})};$e.Side=()=>{let[t]=XJ(),e=t.url.replace(/\/*$/g,""),r=window.firebase.user,o=window.__ROOT_CTX.sidebar?.tools,n=window.__ROOT_CTX.experiments||{};return p("div",{className:"Layout__side",children:[p("div",{className:"Layout__side__buttons",children:[p($e.SideButton,{label:"Home",url:"/cms",active:e==="/cms",children:p(nM,{stroke:rc})}),p($e.SideButton,{label:"Content",url:"/cms/content",active:e.startsWith("/cms/content"),children:p(_f,{stroke:rc})}),p($e.SideButton,{label:"Releases",url:"/cms/releases",active:e.startsWith("/cms/releases"),children:p(dh,{stroke:rc})}),p($e.SideButton,{label:"Data",url:"/cms/data",active:e.startsWith("/cms/data"),children:p(WR,{stroke:rc})}),p($e.SideButton,{label:"Assets",url:"/cms/assets",active:e.startsWith("/cms/assets"),children:p(fS,{stroke:rc})}),p($e.SideButton,{label:"Translations",url:"/cms/translations",active:e.startsWith("/cms/translations"),children:p(_u,{stroke:rc})}),n.ai&&p($e.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:e.startsWith("/cms/ai"),children:p(bf,{stroke:rc})}),o&&p(Pe,{children:[p("div",{className:"Layout__side__divider"}),Object.entries(o).map(([i,a])=>p($e.SideButton,{className:"Layout__side__tool",label:a.label||"",url:`/cms/tools/${i}`,active:e.startsWith(`/cms/tools/${i}`),children:a.icon?p("img",{className:"Layout__side__tool__icon",src:a.icon,alt:a.label||""}):p(zR,{stroke:rc})})),p("div",{className:"Layout__side__divider"})]}),p($e.SideButton,{label:"Settings",url:"/cms/settings",active:e.startsWith("/cms/settings"),children:p(yf,{stroke:rc})})]}),p("div",{className:"Layout__side__user",children:p(Ne,{label:r.email,position:"right",withArrow:!0,children:p(Ea,{src:r.photoURL,alt:r.email,size:30,radius:"xl"})})})]})};$e.SideButton=t=>p(Ne,{className:Fe("Layout__side__button",t.className),label:t.label,position:"right",withArrow:!0,children:p("a",{className:Fe(t.active&&"active"),href:t.url,children:t.children})});$e.Main=t=>p("div",{className:"Layout__main",children:t.children});$e.Bottom=()=>p("div",{className:"Layout__bottom"});function cs(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 lte(t,e){return Math.random()*(e-t)+t}var TBe=[20,40];RM.configure({ignoreUnescapedHTML:!0});function cte(){return lte(...TBe)}function Fb(){let[t,e]=M([]),[r,o]=M(""),n=s=>{let l=0;return e(c=>{let u={sender:"bot",blocks:[{type:"pending"}],key:cs()},d=[...c,{...s,key:cs()},u];return l=d.length-1,d}),l},i=(s,l)=>{e(c=>{let u=[...c];return u[s]={...l,key:cs()},u})};return{chatId:r,messages:t,addMessage:n,updateMessage:i,sendPrompt:async(s,l,c)=>{let u="/cms/api/ai.chat";typeof window.__ROOT_CTX.experiments?.ai=="object"&&window.__ROOT_CTX.experiments.ai.endpoint&&(u=window.__ROOT_CTX.experiments.ai.endpoint);let d={prompt:l,chatId:r,options:c},f=await window.fetch(u,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});if(f.status!==200){let h=await f.text();console.error("chat failed",h);let g=["Something went wrong:","```",h,"```"].join(`
64
64
  `);return i(s,{sender:"bot",blocks:[{type:"text",text:g}]}),{message:g,data:{},error:h}}let m=await f.json();return m.success&&m.chatId?(o(m.chatId),i(s,{sender:"bot",data:m.response?.data||{},blocks:[{type:"text",text:m.response?.message||""}]}),m.response):{message:"Sorry. Something went wrong. An unknown error occurred.",data:{},error:"Unknown error"}}}}function ute(){let t=Fb(),e=window.__ROOT_CTX.experiments?.ai||!1;return p($e,{children:p("div",{className:"AIPage",children:e?p(Pe,{children:[p(vL,{chat:t,children:p("p",{children:"Chat with me about your website. Ask questions about the content and I can tell you about it."})}),p(VS,{chat:t})]}):p("div",{className:"AIPage__notEnabled",children:[p("div",{className:"AIPage__notEnabled__icon",children:p(bf,{size:36})}),p("div",{className:"AIPage__notEnabled__title",children:"Root AI is not enabled for this project."})]})})})}function vL(t){let e=t.chat.messages;return p("div",{className:"AIPage__ChatWindow",children:e.length>0?p("div",{className:"AIPage__ChatWindow__messages",children:t.chat.messages.map((r,o)=>p(kBe,{message:r},r.key||o))}):p("div",{className:"AIPage__ChatWindow__welcome",children:[p("div",{className:"AIPage__ChatWindow__welcome__icon",children:p(bf,{size:36})}),p("div",{className:"AIPage__ChatWindow__welcome__title",children:"Root AI is ready"}),t.children&&p("div",{className:"AIPage__ChatWindow__welcome__body",children:t.children})]})})}function kBe(t){let e=t.message,r=e.sender==="user"?"You":"Root AI",o=window.firebase.user,n=e.sender==="bot",i=W(null);return U(()=>{e.sender==="user"&&i.current.scrollIntoView({behavior:"smooth",block:"start"})},[]),p("div",{className:"AIPage__ChatMessage",ref:i,children:[p("div",{className:"AIPage__ChatMessage__side",children:p("div",{className:"AIPage__ChatMessage__side__avatar",children:e.sender==="user"?p(Ea,{src:o.photoURL,alt:o.email,size:28,radius:"xl"}):p(bf,{size:28})})}),p("div",{className:"AIPage__ChatMessage__main",children:[p("div",{className:"AIPage__ChatMessage__main__username",children:r}),p("div",{className:"AIPage__ChatMessage__main__blocks",children:p(NBe,{message:e,animated:n})})]})]})}function NBe(t){let e=t.message,[r,o]=M(t.animated?[]:e.blocks);function n(){if(r.length>=e.blocks.length)return;let i=[...r,e.blocks[r.length]];o(i)}return U(()=>{t.animated&&n()},[t.animated]),p("div",{className:"AIPage__ChatMessageBlocks",children:r.map((i,a)=>{let s=`${a}-${i.type}`;return i.type==="image"?p(DBe,{block:i,animated:t.animated,onAnimationComplete:()=>n()},s):i.type==="pending"?p(ABe,{block:i,animated:t.animated,onAnimationComplete:()=>n()},s):i.type==="text"?p(OBe,{block:i,animated:t.animated,onAnimationComplete:()=>n()},s):p("div",{children:["unknown block type: ",i.type]})})})}function dte(t){let[e,r]=M(t.animated?[]:t.nodes),o=e.length>=t.nodes.length,n=()=>{r(a=>a.length>=t.nodes.length?t.nodes:[...a,t.nodes[a.length]])},i=()=>{if(e.length>=t.nodes.length){t.onAnimationComplete&&t.onAnimationComplete();return}window.setTimeout(()=>n(),cte())};return U(()=>{t.animated&&n()},[]),{nodes:e,next:i,complete:o}}function OBe(t){let e=De(()=>QM(t.block.text,{extensions:[tte()],mdastExtensions:[dL()]}),[t.block.text]),{nodes:r,next:o}=dte({nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete});return p("div",{className:"AIPage__ChatMessageTextBlock",children:r.map((n,i)=>p(fte,{node:n,animated:t.animated,onAnimationComplete:o},i))})}function fte(t){let e=t.node;if(e.type==="code")return p(PBe,{text:e.value,language:e.lang,animated:t.animated,onAnimationComplete:t.onAnimationComplete});if(e.type==="heading"){let r=`h${e.depth||2}`;return p(Of,{as:r,nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete})}if(e.type==="inlineCode")return p(Of,{as:"code",nodes:[{type:"text",value:e.value}],animated:t.animated,onAnimationComplete:t.onAnimationComplete});if(e.type==="link")return p(Of,{as:"a",attrs:{href:e.url,target:"_blank"},nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete});if(e.type==="list"){let r=e.ordered?"ol":"ul";return p(Of,{as:r,nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete})}return e.type==="listItem"?p(Of,{as:"li",nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete}):e.type==="paragraph"?p(Of,{as:"p",nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete}):e.type==="strong"?p(Of,{as:"b",nodes:e.children,animated:t.animated,onAnimationComplete:t.onAnimationComplete}):e.type==="text"?p(pte,{text:e.value,animated:t.animated,onAnimationComplete:t.onAnimationComplete}):p("div",{children:JSON.stringify(t.node)})}function Of(t){let{nodes:e,next:r}=dte({nodes:t.nodes,animated:t.animated,onAnimationComplete:t.onAnimationComplete}),o=t.as;return p(o,{...t.attrs,children:e.map((n,i)=>p(fte,{node:n,animated:t.animated,onAnimationComplete:()=>r()},i))})}function pte(t){let e=t.sep||" ",r=De(()=>t.text.split(e),[t.text]),[o,n]=M(t.animated?0:r.length),i=o>=r.length;return U(()=>{if(!t.animated||o>=r.length)return;let a=window.setTimeout(()=>{n(o+1)},cte());return()=>window.clearTimeout(a)},[t.text,o]),U(()=>{i&&t.animated&&t.onAnimationComplete()},[i]),p(Pe,{children:[r.slice(0,o).join(e),!i&&p(mte,{})]})}function PBe(t){let e=W(null),[r,o]=M(!1);function n(){let s=e.current;RM.highlightElement(s),console.log("highlight:",s)}async function i(){try{await navigator.clipboard.writeText(t.text),o(!0),window.setTimeout(()=>{o(!1)},2e3)}catch(s){console.error("failed to copy to clipboard:",s)}}function a(){n(),t.onAnimationComplete()}return U(()=>{t.animated||n()},[t.animated]),p("div",{className:"AIPage__CodeBlockNode",children:[p("div",{className:"AIPage__CodeBlockNode__header",children:[t.language&&p("div",{className:"AIPage__CodeBlockNode__language",children:t.language}),p(Ne,{label:"Copy code",position:"bottom",transition:"pop",children:p(Je,{onClick:()=>i(),size:"xs",children:r?p(HR,{color:"#80868b","stroke-width":1.5,size:16}):p(pb,{color:"#80868b","stroke-width":1.5,size:16})})})]}),p("pre",{ref:e,class:`language-${t.language||"unknown"}`,children:p(pte,{text:t.text,sep:`
65
65
  `,animated:t.animated,onAnimationComplete:a})})]})}function ABe(t){return U(()=>{t.animated&&t.onAnimationComplete()},[]),p("div",{className:"AIPage__PendingMessageBlock",children:p(mte,{})})}function mte(){return p("div",{className:"AIPage__CursorDot"})}function DBe(t){let e=t.block.image;return U(()=>{t.animated&&t.onAnimationComplete()},[]),p("div",{className:"AIPage__ImageMessageBlock",children:p("img",{src:e.src,width:e.width,height:e.height,alt:e.alt})})}function hte(t){let e=Fb();return p(Pe,{children:[p(vL,{chat:e,children:t.children}),p(VS,{chat:e,options:{mode:"edit",editData:t.editModeData},onData:t.onEditModeResponse})]})}var IL="AiEditModal";function gte(){let t=Ct(),e=Vt();return{open:r=>{t.openContextModal(IL,{...e,title:r.title||"Edit with AI (Experimental)",innerProps:r,size:"calc(min(1920px, calc(100% - 96px)))",centered:!0})},close:()=>{t.closeModal(IL)}}}function HS(t){let{innerProps:e,context:r,id:o}=t,n=W(null),i=De(()=>JSON.stringify(e.data||{},null,2),[e.data]),[a,s]=M(i),l=De(()=>{if(!a)return null;try{return JSON.parse(a)}catch{return null}},[a]),c=De(()=>a!==i,[a,i]),u=Ie(()=>{l&&e.onSave&&e.onSave(l)},[l]),d=Ie(f=>{if(f?.data){let m=JSON.stringify(f.data,null,2);s(m),n.current?.click()}},[]);return p("div",{className:"AiEditModal",children:[p("div",{className:"AiEditModal__SplitPanel",children:[p("div",{className:"AiEditModal__SplitPanel__ChatPanel",children:p(hte,{editModeData:l,onEditModeResponse:d,children:[p("p",{children:"Tell me what you want to change. I can make simple text edits, replace content within a module, or answer questions about the content."}),p("p",{children:"Just enter simple instructions, or attach a screenshot and ask me to use it as reference."})]})}),p("div",{className:"AiEditModal__SplitPanel__JsonPanel",children:p(Hs,{className:"AiEditModal__Tabs",grow:!0,children:[p(Hs.Tab,{label:"JSON",icon:p(aM,{size:20}),children:p("div",{className:"AiEditModal__JsonEditor",children:p(Wc,{value:a,onChange:f=>s(f),formatOnBlur:!0,height:"100%",className:"AiEditModal__JsonInput"})})}),p(Hs.Tab,{ref:n,label:"Diff",icon:p(JR,{size:20}),children:p("div",{className:"AiEditModal__JsonDiffViewer",children:e.data&&a&&p(nQ,{oldCode:i,newCode:a})})})]})})]}),p("div",{className:"AiEditModal__buttons",children:[p(re,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>r.closeModal(o),children:"Cancel"}),p(re,{variant:"default",size:"xs",type:"button",leftIcon:p(cb,{size:16}),disabled:!c,onClick:()=>s(i),children:"Reset"}),p(re,{leftIcon:p(fb,{size:16}),variant:"filled",size:"xs",color:"green",disabled:!l||!c,onClick:u,children:"Accept changes"})]})]})}HS.id=IL;we();var RBe=/^[a-z0-9_]+(?:--?[a-z0-9_]+)*$/;function il(t,e){e||(e=RBe);let r=typeof e=="string"?new RegExp(e):e;return!!(t&&r.test(t))}function wu(t){return t.replace(/^[\s/]*/g,"").replace(/[\s/]*$/g,"").replace(/^\/+|\/+$/g,"").replaceAll("/","--")}var $o={year:31536e6,month:2628e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3};function Aa(t,e){let r=Math.abs(t-new Date().getTime());if(r<$o.second)return"just now";let o=e||{numeric:"auto"},n=new Intl.RelativeTimeFormat("en",o);return r<$o.minute?n.format(Math.round(-r/$o.second),"second"):r<$o.hour?n.format(Math.round(-r/$o.minute),"minute"):r<$o.day?n.format(Math.round(-r/$o.hour),"hour"):r<$o.week?n.format(Math.round(-r/$o.day),"day"):new Date(t).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric"})}function Bb(){return Math.floor(new Date().getTime())}function jS(t){return new Date(t.toMillis()).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function vh(){let t=s=>s<10?"0"+s:s,e=new Date,r=e.getFullYear(),o=t(e.getMonth()+1),n=t(e.getDate()),i=t(e.getHours()),a=t(e.getMinutes());return`${r}-${o}-${n}T${i}:${a}`}var _te={};async function At(t,e){let r=e?.throttle||0,o=e?.throttleId?`${t}::${e.throttleId}`:t;if(MBe(o,r))return;let n=await fetch("/cms/api/actions.log",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:t,metadata:e?.metadata||{}})});if(n.status!==200){let i=await n.text();console.error(`failed to log action "${t}":`,i);return}_te[o]=Bb()}async function xte(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=Qi(r,"Projects",e,"ActionLogs"),n=t?.limit||40,i=Math.ceil(n*1.5),a=fo(o,wi("timestamp","desc"),_J(i)),s=await Zi(a),l=[];function c(d){if(l.length===0)return!1;let f=l.at(-1);return d.action==="doc.save"&&f.action==="doc.save"&&d.by===f.by&&d.metadata.docId===f.metadata.docId&&d.timestamp.toMillis()-f.timestamp.toMillis()<60*$o.minute}let u=0;for(let d of s.docs){if(u>=n)break;let f=d.data();c(f)||(l.push(f),u+=1)}return l}function MBe(t,e){if(e===0)return!1;let r=_te[t];return r?Bb()-r<e:!1}var wL=new Map;function LBe(t){return wL.get(t)||null}async function GS(t){let e=LBe(t);if(e)return e;let r=Da(t),n=(await To(r)).data();return $b(t,n),n}function $b(t,e){wL.set(t,e)}function EL(t){wL.delete(t)}function bte(t){for(let e of t)EL(e)}function SL(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db;return Qi(e,"Projects",t,"Translations")}async function Eu(t){let e=SL(),r=t?.tags?fo(e,tb("tags","array-contains-any",t.tags)):fo(e),o=await Zi(r),n={};return o.forEach(i=>{let a=i.id;n[a]=i.data()}),n}async function yte(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=ze(r,"Projects",e,"Translations",t);return(await To(o)).data()}async function vte(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=ze(o,"Projects",r,"Translations",t),i={};for(let a in e){let s=$Be(a);s&&(i[s]=e[a])}console.log("updating translations: ",i),await Rr(n,i),At("translations.save",{metadata:{hash:t},throttle:5*$o.minute,throttleId:t})}async function WS(t){return FBe(oc(t))}async function FBe(t){let r=new TextEncoder().encode(t),o=await crypto.subtle.digest("SHA-1",r);return Array.from(new Uint8Array(o)).map(a=>a.toString(16).padStart(2,"0")).join("")}function oc(t){return String(t).trim().split(`
66
66
  `).map(r=>BBe(r)).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkk/root-cms",
3
- "version": "2.2.1-alpha.0",
3
+ "version": "2.2.1-alpha.2",
4
4
  "author": "s@blinkk.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -99,7 +99,7 @@
99
99
  "@mantine/modals": "4.2.12",
100
100
  "@mantine/notifications": "4.2.12",
101
101
  "@mantine/spotlight": "4.2.12",
102
- "@preact/compat": "17.1.2",
102
+ "@preact/compat": "18.3.1",
103
103
  "@tabler/icons-preact": "2.47.0",
104
104
  "@types/body-parser": "1.19.3",
105
105
  "@types/fnv-plus": "1.3.2",
@@ -125,18 +125,18 @@
125
125
  "preact": "10.27.1",
126
126
  "preact-render-to-string": "6.6.1",
127
127
  "preact-router": "4.1.2",
128
- "react": "npm:@preact/compat@^17.1.2",
129
- "react-dom": "npm:@preact/compat@^17.1.2",
128
+ "react": "npm:@preact/compat@18.3.1",
129
+ "react-dom": "npm:@preact/compat@18.3.1",
130
130
  "react-json-view-compare": "2.0.2",
131
131
  "tsup": "8.5.0",
132
132
  "typescript": "5.9.2",
133
133
  "vite": "7.1.4",
134
134
  "vitest": "3.2.4",
135
135
  "yjs": "13.6.27",
136
- "@blinkk/root": "2.2.1-alpha.0"
136
+ "@blinkk/root": "2.2.1-alpha.2"
137
137
  },
138
138
  "peerDependencies": {
139
- "@blinkk/root": "2.2.1-alpha.0",
139
+ "@blinkk/root": "2.2.1-alpha.2",
140
140
  "firebase-admin": ">=11",
141
141
  "firebase-functions": ">=4",
142
142
  "preact": ">=10",