@evoscientist/webui 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/build-manifest.json +3 -3
  3. package/dist/.next/server/app/_global-error.html +1 -1
  4. package/dist/.next/server/app/_global-error.rsc +1 -1
  5. package/dist/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/dist/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/dist/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/dist/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/dist/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/dist/.next/server/app/_not-found.html +1 -1
  12. package/dist/.next/server/app/_not-found.rsc +2 -2
  13. package/dist/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/dist/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/dist/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  16. package/dist/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/dist/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/dist/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/dist/.next/server/app/api/memory/route.js.nft.json +1 -1
  20. package/dist/.next/server/app/api/skills/catalog/route.js.nft.json +1 -1
  21. package/dist/.next/server/app/api/skills/detail/route.js.nft.json +1 -1
  22. package/dist/.next/server/app/api/skills/install/route.js.nft.json +1 -1
  23. package/dist/.next/server/app/api/skills/route.js.nft.json +1 -1
  24. package/dist/.next/server/app/index.html +1 -1
  25. package/dist/.next/server/app/index.rsc +3 -3
  26. package/dist/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  27. package/dist/.next/server/app/index.segments/_full.segment.rsc +3 -3
  28. package/dist/.next/server/app/index.segments/_head.segment.rsc +1 -1
  29. package/dist/.next/server/app/index.segments/_index.segment.rsc +2 -2
  30. package/dist/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  31. package/dist/.next/server/app/page.js.nft.json +1 -1
  32. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/chunks/ssr/{[root-of-the-server]__0gfl1g9._.js → [root-of-the-server]__0b6vgqe._.js} +2 -2
  34. package/dist/.next/server/chunks/ssr/[root-of-the-server]__0wd7vkh._.js +3 -3
  35. package/dist/.next/server/chunks/ssr/{node_modules_0b17xg9._.js → node_modules_01rikmh._.js} +1 -1
  36. package/dist/.next/server/chunks/ssr/{node_modules_09u7lgw._.js → node_modules_065l4iy._.js} +2 -2
  37. package/dist/.next/server/chunks/ssr/{node_modules_0fjp2ui._.js → node_modules_08162tp._.js} +2 -2
  38. package/dist/.next/server/chunks/ssr/{node_modules_0wi5.rq._.js → node_modules_0ah~knk._.js} +1 -1
  39. package/dist/.next/server/chunks/ssr/{node_modules_12izlv7._.js → node_modules_0b-ug_w._.js} +2 -2
  40. package/dist/.next/server/chunks/ssr/{node_modules_0lpa3sh._.js → node_modules_0brzhdh._.js} +1 -1
  41. package/dist/.next/server/chunks/ssr/{node_modules_08wcy6-._.js → node_modules_0bwpohl._.js} +2 -2
  42. package/dist/.next/server/chunks/ssr/{node_modules_0mdmjxs._.js → node_modules_0cypane._.js} +1 -1
  43. package/dist/.next/server/chunks/ssr/{node_modules_0jr~cq1._.js → node_modules_0d-j~9d._.js} +2 -2
  44. package/dist/.next/server/chunks/ssr/{node_modules_0~jxo63._.js → node_modules_0gp5td~._.js} +1 -1
  45. package/dist/.next/server/chunks/ssr/{node_modules_0ha~o5b._.js → node_modules_0jorezf._.js} +1 -1
  46. package/dist/.next/server/chunks/ssr/{node_modules_0emcflw._.js → node_modules_0oc64pl._.js} +1 -1
  47. package/dist/.next/server/chunks/ssr/{node_modules_11qpyyq._.js → node_modules_0p_d9sv._.js} +1 -1
  48. package/dist/.next/server/chunks/ssr/{node_modules_0rxg5wj._.js → node_modules_0rasyft._.js} +1 -1
  49. package/dist/.next/server/chunks/ssr/{node_modules_0~~sdsc._.js → node_modules_0teiba3._.js} +1 -1
  50. package/dist/.next/server/chunks/ssr/{node_modules_0sl08k7._.js → node_modules_0thgw_9._.js} +1 -1
  51. package/dist/.next/server/chunks/ssr/{node_modules_0_~5hzh._.js → node_modules_0t~3b10._.js} +1 -1
  52. package/dist/.next/server/chunks/ssr/{node_modules_0ur.y6r._.js → node_modules_0t~g1wl._.js} +1 -1
  53. package/dist/.next/server/chunks/ssr/{node_modules_0wga9~n._.js → node_modules_0xnaj4v._.js} +1 -1
  54. package/dist/.next/server/chunks/ssr/{node_modules_0v-gb~r._.js → node_modules_0y82m9p._.js} +1 -1
  55. package/dist/.next/server/chunks/ssr/{node_modules_0nm.6-e._.js → node_modules_0z1.5t6._.js} +1 -1
  56. package/dist/.next/server/chunks/ssr/{node_modules_11l3~_d._.js → node_modules_0~sa.s3._.js} +1 -1
  57. package/dist/.next/server/chunks/ssr/{node_modules_08awyag._.js → node_modules_10yi8mp._.js} +2 -2
  58. package/dist/.next/server/chunks/ssr/{node_modules_0qj09k6._.js → node_modules_11icb6j._.js} +1 -1
  59. package/dist/.next/server/chunks/ssr/{node_modules_112a8iv._.js → node_modules_122m_q8._.js} +2 -2
  60. package/dist/.next/server/chunks/ssr/{node_modules_0wb0aq~._.js → node_modules_12a.2or._.js} +1 -1
  61. package/dist/.next/server/chunks/ssr/{node_modules_0med9xv._.js → node_modules_13pqli3._.js} +1 -1
  62. package/dist/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_0sw73sk._.js → node_modules_katex_dist_katex_mjs_11o42y2._.js} +1 -1
  63. package/dist/.next/server/middleware-build-manifest.js +3 -3
  64. package/dist/.next/server/pages/404.html +1 -1
  65. package/dist/.next/server/pages/500.html +1 -1
  66. package/dist/.next/static/chunks/{0tezgsg3ayha4.js → 0brg73hy_5skv.js} +21 -21
  67. package/dist/.next/static/chunks/0e3jlx5dj8._a.css +3 -0
  68. package/dist/package.json +1 -1
  69. package/package.json +1 -1
  70. package/dist/.next/static/chunks/008-yie~ateir.css +0 -3
  71. /package/dist/.next/static/{VzgsTZuv-70A4ldXGMI5P → 4lVPeAZfBlcZYCWkC5Xhd}/_buildManifest.js +0 -0
  72. /package/dist/.next/static/{VzgsTZuv-70A4ldXGMI5P → 4lVPeAZfBlcZYCWkC5Xhd}/_clientMiddlewareManifest.js +0 -0
  73. /package/dist/.next/static/{VzgsTZuv-70A4ldXGMI5P → 4lVPeAZfBlcZYCWkC5Xhd}/_ssgManifest.js +0 -0
@@ -158,11 +158,11 @@ data: ${JSON.stringify(b)}
158
158
  `));a.enqueue(f.encode("event: end\n\n")),a.close()}}),oJ.fromReadableStream(g)}async *_streamEventsV2(a,b,c){let d,e=new pg({...c,autoClose:!1}),f=oE(b),g=f.runId??tj();f.runId=g;let h=f.callbacks;if(void 0===h)f.callbacks=[e];else if(Array.isArray(h))f.callbacks=h.concat(e);else{let a=h.copy();a.addHandler(e,!0),f.callbacks=a}let i=new AbortController,j=this,k=async function(){let c,d=null;try{b?.signal?"any"in AbortSignal?c=AbortSignal.any([i.signal,b.signal]):(c=b.signal,d=()=>{i.abort()},b.signal.addEventListener("abort",d,{once:!0})):c=i.signal;let h=await j.stream(a,{...f,signal:c});for await(let a of e.tapOutputIterable(g,h))if(i.signal.aborted)break}finally{await e.finish(),c&&d&&c.removeEventListener("abort",d)}}(),l=!1;try{for await(let b of e){if(!l){b.data.input=a,l=!0,d=b.run_id,yield b;continue}b.run_id===d&&b.event.endsWith("_end")&&b.data?.input&&delete b.data.input,yield b}}finally{i.abort(),await k}}async *_streamEventsV1(a,b,c){let d,e=!1,f=oE(b),g=f.tags??[],h=f.metadata??{},i=f.runName??this.getName(),j=new pa({...c,autoClose:!1,_schemaFormat:"streaming_events"}),k=new pt({...c});for await(let b of this._streamLog(a,j,f)){if(void 0===(d=d?d.concat(b):o6.fromRunLogPatch(b)).state)throw Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!e){e=!0;let b={...d.state},c={run_id:b.id,event:`on_${b.type}_start`,name:i,tags:g,metadata:h,data:{input:a}};k.includeEvent(c,b.type)&&(yield c)}for(let a of[...new Set(b.ops.filter(a=>a.path.startsWith("/logs/")).map(a=>a.path.split("/")[2]))]){let b,c={},e=d.state.logs[a];if("start"==(b=void 0===e.end_time?e.streamed_output.length>0?"stream":"start":"end"))void 0!==e.inputs&&(c.input=e.inputs);else if("end"===b)void 0!==e.inputs&&(c.input=e.inputs),c.output=e.final_output;else if("stream"===b){let a=e.streamed_output.length;if(1!==a)throw Error(`Expected exactly one chunk of streamed output, got ${a} instead. Encountered in: "${e.name}"`);c={chunk:e.streamed_output[0]},e.streamed_output=[]}yield{event:`on_${e.type}_${b}`,name:e.name,run_id:e.id,tags:e.tags,metadata:e.metadata,data:c}}let{state:c}=d;if(c.streamed_output.length>0){let a=c.streamed_output.length;if(1!==a)throw Error(`Expected exactly one chunk of streamed output, got ${a} instead. Encountered in: "${c.name}"`);let b={chunk:c.streamed_output[0]};c.streamed_output=[];let d={event:`on_${c.type}_stream`,run_id:c.id,tags:g,metadata:h,name:i,data:b};k.includeEvent(d,c.type)&&(yield d)}}let l=d?.state;if(void 0!==l){let a={event:`on_${l.type}_end`,name:i,run_id:l.id,tags:g,metadata:h,data:{output:l.final_output}};k.includeEvent(a,l.type)&&(yield a)}}static isRunnable(a){return ps(a)}withListeners({onStart:a,onEnd:b,onError:c}){return new tu({bound:this,config:{},configFactories:[d=>({callbacks:[new pr({config:d,onStart:a,onEnd:b,onError:c})]})]})}asTool(a){var b,c,d,e,f;let g,h;return b=this,g=(c=a).name??b.getName(),h=c.description??(ql(d=c.schema)?qk.get(d)?.description:qm(d)||"description"in d&&"string"==typeof d.description?d.description:void 0),new tE(!(!(f=e=c.schema)||"object"!=typeof f||Array.isArray(f))&&(ql(f)||qm(f))&&(qm(e)?"ZodString"===e._def.typeName:!!ql(e)&&"string"===e._zod.def.type)?{name:g,description:h,schema:tr.object({input:tr.string()}).transform(a=>a.input),bound:b}:{name:g,description:h,schema:c.schema,bound:b})}},tu=class a extends tt{static lc_name(){return"RunnableBinding"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;bound;config;kwargs;configFactories;constructor(a){super(a),this.bound=a.bound,this.kwargs=a.kwargs,this.config=a.config,this.configFactories=a.configFactories}getName(a){return this.bound.getName(a)}async _mergeConfig(...a){let b=oC(this.config,...a);return oC(b,...this.configFactories?await Promise.all(this.configFactories.map(async a=>await a(b))):[])}withConfig(a){return new this.constructor({bound:this.bound,kwargs:this.kwargs,config:{...this.config,...a}})}withRetry(a){return new tv({bound:this.bound,kwargs:this.kwargs,config:this.config,maxAttemptNumber:a?.stopAfterAttempt,...a})}async invoke(a,b){return this.bound.invoke(a,await this._mergeConfig(b,this.kwargs))}async batch(a,b,c){let d=Array.isArray(b)?await Promise.all(b.map(async a=>this._mergeConfig(oE(a),this.kwargs))):await this._mergeConfig(oE(b),this.kwargs);return this.bound.batch(a,d,c)}_concatOutputChunks(a,b){return this.bound._concatOutputChunks(a,b)}async *_streamIterator(a,b){yield*this.bound._streamIterator(a,await this._mergeConfig(oE(b),this.kwargs))}async stream(a,b){return this.bound.stream(a,await this._mergeConfig(oE(b),this.kwargs))}async *transform(a,b){yield*this.bound.transform(a,await this._mergeConfig(oE(b),this.kwargs))}streamEvents(a,b,c){let d=this,e=async function*(){yield*d.bound.streamEvents(a,{...await d._mergeConfig(oE(b),d.kwargs),version:b.version},c)};return oJ.fromAsyncGenerator(e())}static isRunnableBinding(a){return a.bound&&tt.isRunnable(a.bound)}withListeners({onStart:b,onEnd:c,onError:d}){return new a({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[a=>({callbacks:[new pr({config:a,onStart:b,onEnd:c,onError:d})]})]})}},tv=class extends tu{static lc_name(){return"RunnableRetry"}lc_namespace=["langchain_core","runnables"];maxAttemptNumber=3;onFailedAttempt=()=>{};constructor(a){super(a),this.maxAttemptNumber=a.maxAttemptNumber??this.maxAttemptNumber,this.onFailedAttempt=a.onFailedAttempt??this.onFailedAttempt}_patchConfigForRetry(a,b,c){let d=a>1?`retry:attempt:${a}`:void 0;return oF(b,{callbacks:c?.getChild(d)})}async _invoke(a,b,c){return pn(d=>super.invoke(a,this._patchConfigForRetry(d,b,c)),{onFailedAttempt:({error:b})=>this.onFailedAttempt(b,a),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}async invoke(a,b){return this._callWithConfig(this._invoke.bind(this),a,b)}async _batch(a,b,c,d){let e={};try{await pn(async f=>{let g,h=a.map((a,b)=>b).filter(a=>void 0===e[a.toString()]||e[a.toString()]instanceof Error),i=h.map(b=>a[b]),j=h.map(a=>this._patchConfigForRetry(f,b?.[a],c?.[a])),k=await super.batch(i,j,{...d,returnExceptions:!0});for(let a=0;a<k.length;a+=1){let b=k[a],c=h[a];b instanceof Error&&void 0===g&&((g=b).input=i[a]),e[c.toString()]=b}if(g)throw g;return k},{onFailedAttempt:({error:a})=>this.onFailedAttempt(a,a.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(a){if(d?.returnExceptions!==!0)throw a}return Object.keys(e).sort((a,b)=>parseInt(a,10)-parseInt(b,10)).map(a=>e[parseInt(a,10)])}async batch(a,b,c){return this._batchWithConfig(this._batch.bind(this),a,b,c)}},tw=class a extends tt{static lc_name(){return"RunnableSequence"}first;middle=[];last;omitSequenceTags=!1;lc_serializable=!0;lc_namespace=["langchain_core","runnables"];constructor(a){super(a),this.first=a.first,this.middle=a.middle??this.middle,this.last=a.last,this.name=a.name,this.omitSequenceTags=a.omitSequenceTags??this.omitSequenceTags}get steps(){return[this.first,...this.middle,this.last]}async invoke(a,b){let c,d=oE(b),e=await oB(d),f=await e?.handleChainStart(this.toJSON(),ts(a,"input"),d.runId,void 0,void 0,void 0,d?.runName);delete d.runId;let g=a;try{let a=[this.first,...this.middle];for(let c=0;c<a.length;c+=1){let e=a[c].invoke(g,oF(d,{callbacks:f?.getChild(this.omitSequenceTags?void 0:`seq:step:${c+1}`)}));g=await oH(e,b?.signal)}if(b?.signal?.aborted)throw oI(b.signal);c=await this.last.invoke(g,oF(d,{callbacks:f?.getChild(this.omitSequenceTags?void 0:`seq:step:${this.steps.length}`)}))}catch(a){throw await f?.handleChainError(a),a}return await f?.handleChainEnd(ts(c,"output")),c}async batch(a,b,c){let d=this._getOptionsList(b??{},a.length),e=await Promise.all(d.map(oB)),f=await Promise.all(e.map(async(b,c)=>{let e=await b?.handleChainStart(this.toJSON(),ts(a[c],"input"),d[c].runId,void 0,void 0,void 0,d[c].runName);return delete d[c].runId,e})),g=a;try{for(let a=0;a<this.steps.length;a+=1){let b=this.steps[a].batch(g,f.map((b,c)=>{let e=b?.getChild(this.omitSequenceTags?void 0:`seq:step:${a+1}`);return oF(d[c],{callbacks:e})}),c);g=await oH(b,d[0]?.signal)}}catch(a){throw await Promise.all(f.map(b=>b?.handleChainError(a))),a}return await Promise.all(f.map(a=>a?.handleChainEnd(ts(g,"output")))),g}_concatOutputChunks(a,b){return this.last._concatOutputChunks(a,b)}async *_streamIterator(a,b){let c,d=await oB(b),{runId:e,...f}=b??{},g=await d?.handleChainStart(this.toJSON(),ts(a,"input"),e,void 0,void 0,void 0,f?.runName),h=[this.first,...this.middle,this.last],i=!0;async function*j(){yield a}try{let a=h[0].transform(j(),oF(f,{callbacks:g?.getChild(this.omitSequenceTags?void 0:"seq:step:1")}));for(let b=1;b<h.length;b+=1){let c=h[b];a=await c.transform(a,oF(f,{callbacks:g?.getChild(this.omitSequenceTags?void 0:`seq:step:${b+1}`)}))}for await(let d of a)if(b?.signal?.throwIfAborted(),yield d,i)if(void 0===c)c=d;else try{c=this._concatOutputChunks(c,d)}catch{c=void 0,i=!1}}catch(a){throw await g?.handleChainError(a),a}await g?.handleChainEnd(ts(c,"output"))}getGraph(a){let b=new tk,c=null;return this.steps.forEach((d,e)=>{let f=d.getGraph(a);0!==e&&f.trimFirstNode(),e!==this.steps.length-1&&f.trimLastNode(),b.extend(f);let g=f.firstNode();if(!g)throw Error(`Runnable ${d} has no first node`);c&&b.addEdge(c,g),c=f.lastNode()}),b}pipe(b){return new a(a.isRunnableSequence(b)?{first:this.first,middle:this.middle.concat([this.last,b.first,...b.middle]),last:b.last,name:this.name??b.name}:{first:this.first,middle:[...this.middle,this.last],last:tB(b),name:this.name})}static isRunnableSequence(a){return Array.isArray(a.middle)&&tt.isRunnable(a)}static from([b,...c],d){let e={};return"string"==typeof d?e.name=d:void 0!==d&&(e=d),new a({...e,first:tB(b),middle:c.slice(0,-1).map(tB),last:tB(c[c.length-1])})}},tx=class a extends tt{static lc_name(){return"RunnableMap"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;steps;getStepsKeys(){return Object.keys(this.steps)}constructor(a){for(const[b,c]of(super(a),this.steps={},Object.entries(a.steps)))this.steps[b]=tB(c)}static from(b){return new a({steps:b})}async invoke(a,b){let c=oE(b),d=await oB(c),e=await d?.handleChainStart(this.toJSON(),{input:a},c.runId,void 0,void 0,void 0,c?.runName);delete c.runId;let f={};try{let d=Object.entries(this.steps).map(async([b,d])=>{f[b]=await d.invoke(a,oF(c,{callbacks:e?.getChild(`map:key:${b}`)}))});await oH(Promise.all(d),b?.signal)}catch(a){throw await e?.handleChainError(a),a}return await e?.handleChainEnd(f),f}async *_transform(a,b,c){let d={...this.steps},e=oK(a,Object.keys(d).length),f=new Map(Object.entries(d).map(([a,d],f)=>{let g=d.transform(e[f],oF(c,{callbacks:b?.getChild(`map:key:${a}`)}));return[a,g.next().then(b=>({key:a,gen:g,result:b}))]}));for(;f.size;){let a=Promise.race(f.values()),{key:b,result:d,gen:e}=await oH(a,c?.signal);f.delete(b),d.done||(yield{[b]:d.value},f.set(b,e.next().then(a=>({key:b,gen:e,result:a}))))}}transform(a,b){return this._transformStreamWithConfig(a,this._transform.bind(this),b)}async stream(a,b){async function*c(){yield a}let d=oE(b),e=new oM({generator:this.transform(c(),d),config:d});return await e.setup,oJ.fromAsyncGenerator(e)}},ty=class a extends tt{lc_serializable=!1;lc_namespace=["langchain_core","runnables"];func;constructor(a){if(super(a),!oi(a.func))throw Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=a.func}async invoke(a,b){let[c]=this._getOptionsList(b??{},1),d=await oB(c);return oH(this.func(oF(c,{callbacks:d}),a),c?.signal)}async *_streamIterator(a,b){let[c]=this._getOptionsList(b??{},1),d=await this.invoke(a,b);if(to(d)){for await(let a of d)c?.signal?.throwIfAborted(),yield a;return}if(null!=d&&"object"==typeof d&&"next"in d&&"function"==typeof d.next){for(;;){c?.signal?.throwIfAborted();let a=d.next();if(a.done)break;yield a.value}return}yield d}static from(b){return new a({func:b})}},tz=class a extends tt{static lc_name(){return"RunnableLambda"}lc_namespace=["langchain_core","runnables"];func;constructor(a){if(oi(a.func))return ty.from(a.func);super(a),function(a){if(oi(a))throw Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}(a.func),this.func=a.func}static from(b){return new a({func:b})}async _invoke(a,b,c){return new Promise((d,e)=>{let f=oF(b,{callbacks:c?.getChild(),recursionLimit:(b?.recursionLimit??25)-1});oA.runWithConfig(oG(f),async()=>{try{let c=await this.func(a,{...f});if(c&&tt.isRunnable(c)){if(b?.recursionLimit===0)throw Error("Recursion limit reached.");c=await c.invoke(a,{...f,recursionLimit:(f.recursionLimit??25)-1})}else if(to(c)){let a;for await(let d of tq(f,c))if(b?.signal?.throwIfAborted(),void 0===a)a=d;else try{a=this._concatOutputChunks(a,d)}catch{a=d}c=a}else if(tn(c)){let a;for(let d of tp(f,c))if(b?.signal?.throwIfAborted(),void 0===a)a=d;else try{a=this._concatOutputChunks(a,d)}catch{a=d}c=a}d(c)}catch(a){e(a)}})})}async invoke(a,b){return this._callWithConfig(this._invoke.bind(this),a,b)}async *_transform(a,b,c){let d;for await(let b of a)if(void 0===d)d=b;else try{d=this._concatOutputChunks(d,b)}catch{d=b}let e=oF(c,{callbacks:b?.getChild(),recursionLimit:(c?.recursionLimit??25)-1}),f=await new Promise((a,b)=>{oA.runWithConfig(oG(e),async()=>{try{let b=await this.func(d,{...e,config:e});a(b)}catch(a){b(a)}})});if(f&&tt.isRunnable(f)){if(c?.recursionLimit===0)throw Error("Recursion limit reached.");for await(let a of(await f.stream(d,e)))yield a}else if(to(f))for await(let a of tq(e,f))c?.signal?.throwIfAborted(),yield a;else if(tn(f))for(let a of tp(e,f))c?.signal?.throwIfAborted(),yield a;else yield f}transform(a,b){return this._transformStreamWithConfig(a,this._transform.bind(this),b)}async stream(a,b){async function*c(){yield a}let d=oE(b),e=new oM({generator:this.transform(c(),d),config:d});return await e.setup,oJ.fromAsyncGenerator(e)}},tA=class extends tt{static lc_name(){return"RunnableWithFallbacks"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;runnable;fallbacks;constructor(a){super(a),this.runnable=a.runnable,this.fallbacks=a.fallbacks}*runnables(){for(let a of(yield this.runnable,this.fallbacks))yield a}async invoke(a,b){let c=oE(b),d=await oB(c),{runId:e,...f}=c,g=await d?.handleChainStart(this.toJSON(),ts(a,"input"),e,void 0,void 0,void 0,f?.runName),h=oF(f,{callbacks:g?.getChild()});return await oA.runWithConfig(h,async()=>{let b;for(let d of this.runnables()){c?.signal?.throwIfAborted();try{let b=await d.invoke(a,h);return await g?.handleChainEnd(ts(b,"output")),b}catch(a){void 0===b&&(b=a)}}if(void 0===b)throw Error("No error stored at end of fallback.");throw await g?.handleChainError(b),b})}async *_streamIterator(a,b){let c,d,e,f=oE(b),g=await oB(f),{runId:h,...i}=f,j=await g?.handleChainStart(this.toJSON(),ts(a,"input"),h,void 0,void 0,void 0,i?.runName);for(let b of this.runnables()){f?.signal?.throwIfAborted();let e=oF(i,{callbacks:j?.getChild()});try{let c=await b.stream(a,e);d=tq(e,c);break}catch(a){void 0===c&&(c=a)}}if(void 0===d){let a=c??Error("No error stored at end of fallback.");throw await j?.handleChainError(a),a}try{for await(let a of d){yield a;try{e=void 0===e?e:this._concatOutputChunks(e,a)}catch{e=void 0}}}catch(a){throw await j?.handleChainError(a),a}await j?.handleChainEnd(ts(e,"output"))}async batch(a,b,c){let d;if(c?.returnExceptions)throw Error("Not implemented.");let e=this._getOptionsList(b??{},a.length),f=await Promise.all(e.map(a=>oB(a))),g=await Promise.all(f.map(async(b,c)=>{let d=await b?.handleChainStart(this.toJSON(),ts(a[c],"input"),e[c].runId,void 0,void 0,void 0,e[c].runName);return delete e[c].runId,d}));for(let b of this.runnables()){e[0].signal?.throwIfAborted();try{let d=await b.batch(a,g.map((a,b)=>oF(e[b],{callbacks:a?.getChild()})),c);return await Promise.all(g.map((a,b)=>a?.handleChainEnd(ts(d[b],"output")))),d}catch(a){void 0===d&&(d=a)}}if(!d)throw Error("No error stored at end of fallbacks.");throw await Promise.all(g.map(a=>a?.handleChainError(d))),d}};function tB(a){if("function"==typeof a)return new tz({func:a});if(tt.isRunnable(a))return a;if(Array.isArray(a)||"object"!=typeof a)throw Error(`Expected a Runnable, function or object.
159
159
  Instead got an unsupported type.`);{let b={};for(let[c,d]of Object.entries(a))b[c]=tB(d);return new tx({steps:b})}}var tC=class extends tt{static lc_name(){return"RunnableAssign"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;mapper;constructor(a){a instanceof tx&&(a={mapper:a}),super(a),this.mapper=a.mapper}async invoke(a,b){let c=await this.mapper.invoke(a,b);return{...a,...c}}async *_transform(a,b,c){let d=this.mapper.getStepsKeys(),[e,f]=oK(a),g=this.mapper.transform(f,oF(c,{callbacks:b?.getChild()})),h=g.next();for await(let a of e){if("object"!=typeof a||Array.isArray(a))throw Error(`RunnableAssign can only be used with objects as input, got ${typeof a}`);let b=Object.fromEntries(Object.entries(a).filter(([a])=>!d.includes(a)));Object.keys(b).length>0&&(yield b)}for await(let a of(yield(await h).value,g))yield a}transform(a,b){return this._transformStreamWithConfig(a,this._transform.bind(this),b)}async stream(a,b){async function*c(){yield a}let d=oE(b),e=new oM({generator:this.transform(c(),d),config:d});return await e.setup,oJ.fromAsyncGenerator(e)}},tD=class extends tt{static lc_name(){return"RunnablePick"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;keys;constructor(a){("string"==typeof a||Array.isArray(a))&&(a={keys:a}),super(a),this.keys=a.keys}async _pick(a){if("string"==typeof this.keys)return a[this.keys];{let b=this.keys.map(b=>[b,a[b]]).filter(a=>void 0!==a[1]);return 0===b.length?void 0:Object.fromEntries(b)}}async invoke(a,b){return this._callWithConfig(this._pick.bind(this),a,b)}async *_transform(a){for await(let b of a){let a=await this._pick(b);void 0!==a&&(yield a)}}transform(a,b){return this._transformStreamWithConfig(a,this._transform.bind(this),b)}async stream(a,b){async function*c(){yield a}let d=oE(b),e=new oM({generator:this.transform(c(),d),config:d});return await e.setup,oJ.fromAsyncGenerator(e)}},tE=class extends tu{name;description;schema;constructor(a){super({bound:tw.from([tz.from(async a=>{let b;if(kY(a))try{b=await qn(this.schema,a.args)}catch{throw new kZ("Received tool input did not match expected schema",JSON.stringify(a.args))}else b=a;return b}).withConfig({runName:`${a.name}:parse_input`}),a.bound]).withConfig({runName:a.name}),config:a.config??{}}),this.name=a.name,this.description=a.description,this.schema=a.schema}static lc_name(){return"RunnableToolLike"}};let tF=(a,b)=>{let c=[...new Set(b?.map(a=>{if("string"==typeof a)return a;let b=new a({});if(!("getType"in b)||"function"!=typeof b.getType)throw Error("Invalid type provided.");return b.getType()}))],d=a.getType();return c.some(a=>a===d)};function tG(a,b){return Array.isArray(a)?tH(a,b):tz.from(b=>tH(b,a))}function tH(a,b={}){let{includeNames:c,excludeNames:d,includeTypes:e,excludeTypes:f,includeIds:g,excludeIds:h}=b,i=[];for(let b of a)if(!(d&&b.name&&d.includes(b.name))){if(f&&tF(b,f))continue;if(h&&b.id&&h.includes(b.id))continue;e||g||c?c&&b.name&&c.some(a=>a===b.name)||e&&tF(b,e)?i.push(b):g&&b.id&&g.some(a=>a===b.id)&&i.push(b):i.push(b)}return i}function tI(a){return Array.isArray(a)?tJ(a):tz.from(tJ)}function tJ(a){if(!a.length)return[];let b=[];for(let c of a){let a=b.pop();if(a)if("tool"===c.getType()||c.getType()!==a.getType())b.push(a,c);else{let d=lj(a),e=lj(c),f=d.concat(e);"string"==typeof d.content&&"string"==typeof e.content&&(f.content=`${d.content}
160
160
  ${e.content}`),b.push(function(a){let b,c=a.getType(),d=Object.fromEntries(Object.entries(a).filter(([a])=>!["type","tool_call_chunks"].includes(a)&&!a.startsWith("lc_")));if(c in tO&&(b=tP(c,d)),!b)throw Error(`Unrecognized message chunk class ${c}. Supported classes are ${Object.keys(tO)}`);return b}(f))}else b.push(c)}return b}function tK(a,b){if(!Array.isArray(a))return tz.from(b=>tL(b,a)).withConfig({runName:"trim_messages"});if(!b)throw Error("Options parameter is required when providing messages.");return tL(a,b)}async function tL(a,b){let c,{maxTokens:d,tokenCounter:e,strategy:f="last",allowPartial:g=!1,endOn:h,startOn:i,includeSystem:j=!1,textSplitter:k}=b;if(i&&"first"===f)throw Error("`startOn` should only be specified if `strategy` is 'last'.");if(j&&"first"===f)throw Error("`includeSystem` should only be specified if `strategy` is 'last'.");c="getNumTokens"in e?async a=>(await Promise.all(a.map(a=>e.getNumTokens(a.content)))).reduce((a,b)=>a+b,0):async a=>e(a);let l=tQ;if(k&&(l="splitText"in k?k.splitText:async a=>k(a)),"first"===f)return tM(a,{maxTokens:d,tokenCounter:c,textSplitter:l,partialStrategy:g?"first":void 0,endOn:h});if("last"===f)return tN(a,{maxTokens:d,tokenCounter:c,textSplitter:l,allowPartial:g,includeSystem:j,startOn:i,endOn:h});throw Error(`Unrecognized strategy: '${f}'. Must be one of 'first' or 'last'.`)}async function tM(a,b){let{maxTokens:c,tokenCounter:d,textSplitter:e,partialStrategy:f,endOn:g}=b,h=[...a],i=0;for(let a=0;a<h.length;a+=1){let b=a>0?h.slice(0,-a):h;if(await d(b)<=c){i=h.length-a;break}}if(i<h.length&&f){let a=!1;if(Array.isArray(h[i].content)){let b=h[i];if("string"==typeof b.content)throw Error("Expected content to be an array.");let e=b.content.length,g="last"===f?[...b.content].reverse():b.content;for(let j=1;j<=e;j+=1){let e="first"===f?g.slice(0,j):g.slice(-j),k=Object.fromEntries(Object.entries(b).filter(([a])=>"type"!==a&&!a.startsWith("lc_"))),l=tP(b.getType(),{...k,content:e}),m=[...h.slice(0,i),l];if(await d(m)<=c)h=m,i+=1,a=!0;else break}a&&"last"===f&&(b.content=[...g].reverse())}if(!a){let a,b=h[i];if(Array.isArray(b.content)&&b.content.some(a=>"string"==typeof a||"text"===a.type)){let c=b.content.find(a=>"text"===a.type&&a.text);a=c?.text}else"string"==typeof b.content&&(a=b.content);if(a){let g=await e(a),j=g.length;"last"===f&&g.reverse();for(let a=0;a<j-1;a+=1)if(g.pop(),b.content=g.join(""),await d([...h.slice(0,i),b])<=c){"last"===f&&(b.content=[...g].reverse().join("")),h=[...h.slice(0,i),b],i+=1;break}}}}if(g){let a=Array.isArray(g)?g:[g];for(;i>0&&!tF(h[i-1],a);)i-=1}return h.slice(0,i)}async function tN(a,b){let{allowPartial:c=!1,includeSystem:d=!1,endOn:e,startOn:f,...g}=b,h=a.map(a=>{let b=Object.fromEntries(Object.entries(a).filter(([a])=>"type"!==a&&!a.startsWith("lc_")));return tP(a.getType(),b,kv(a))});if(e){let a=Array.isArray(e)?e:[e];for(;h.length>0&&!tF(h[h.length-1],a);)h=h.slice(0,-1)}let i=d&&h[0]?.getType()==="system",j=i?h.slice(0,1).concat(h.slice(1).reverse()):h.reverse();return(j=await tM(j,{...g,partialStrategy:c?"last":void 0,endOn:f}),i)?[j[0],...j.slice(1).reverse()]:j.reverse()}let tO={human:{message:kN,messageChunk:kO},ai:{message:k7,messageChunk:la},system:{message:kS,messageChunk:kT},developer:{message:kS,messageChunk:kT},tool:{message:kA,messageChunk:kB},function:{message:kJ,messageChunk:kK},generic:{message:kF,messageChunk:kG},remove:{message:kR,messageChunk:kR}};function tP(a,b,c){let d,e;switch(a){case"human":c?d=new kO(b):e=new kN(b);break;case"ai":if(c){let a={...b};"tool_calls"in a&&(a={...a,tool_call_chunks:a.tool_calls?.map(a=>({...a,type:"tool_call_chunk",index:void 0,args:JSON.stringify(a.args)}))}),d=new la(a)}else e=new k7(b);break;case"system":c?d=new kT(b):e=new kS(b);break;case"developer":c?d=new kT({...b,additional_kwargs:{...b.additional_kwargs,__openai_role__:"developer"}}):e=new kS({...b,additional_kwargs:{...b.additional_kwargs,__openai_role__:"developer"}});break;case"tool":if("tool_call_id"in b)c?d=new kB(b):e=new kA(b);else throw Error("Can not convert ToolMessage to ToolMessageChunk if 'tool_call_id' field is not defined.");break;case"function":if(c)d=new kK(b);else{if(!b.name)throw Error("FunctionMessage must have a 'name' field");e=new kJ(b)}break;case"generic":if("role"in b)c?d=new kG(b):e=new kF(b);else throw Error("Can not convert ChatMessage to ChatMessageChunk if 'role' field is not defined.");break;default:throw Error(`Unrecognized message type ${a}`)}if(c&&d)return d;if(e)return e;throw Error(`Unrecognized message type ${a}`)}function tQ(a){let b=a.split("\n");return Promise.resolve([...b.slice(0,-1).map(a=>`${a}
161
- `),b[b.length-1]])}let tR=["text","reasoning","tool_call","tool_call_chunk","invalid_tool_call","server_tool_call","server_tool_call_chunk","server_tool_call_result","image","video","audio","text-plain","file"];jO({},{AIMessage:()=>k7,AIMessageChunk:()=>la,BaseMessage:()=>km,BaseMessageChunk:()=>ks,ChatMessage:()=>kF,ChatMessageChunk:()=>kG,DEFAULT_MERGE_IGNORE_KEYS:()=>ko,FunctionMessage:()=>kJ,FunctionMessageChunk:()=>kK,HumanMessage:()=>kN,HumanMessageChunk:()=>kO,KNOWN_BLOCK_TYPES:()=>tR,RemoveMessage:()=>kR,SystemMessage:()=>kS,SystemMessageChunk:()=>kT,ToolMessage:()=>kA,ToolMessageChunk:()=>kB,_isMessageFieldWithRole:()=>kt,_mergeDicts:()=>kp,_mergeLists:()=>kq,_mergeObj:()=>kr,_mergeStatus:()=>kl,coerceMessageLikeToMessage:()=>le,collapseToolCallChunks:()=>lk,convertToChunk:()=>lj,convertToOpenAIImageBlock:()=>jU,convertToProviderContentBlock:()=>jX,defaultTextSplitter:()=>tQ,defaultToolCallParser:()=>kC,filterMessages:()=>tG,getBufferString:()=>lf,iife:()=>lb,isAIMessage:()=>k8,isAIMessageChunk:()=>k9,isBase64ContentBlock:()=>jR,isBaseMessage:()=>ku,isBaseMessageChunk:()=>kv,isChatMessage:()=>kH,isChatMessageChunk:()=>kI,isDataContentBlock:()=>jP,isDirectToolOutput:()=>kz,isFunctionMessage:()=>kL,isFunctionMessageChunk:()=>kM,isHumanMessage:()=>kP,isHumanMessageChunk:()=>kQ,isIDContentBlock:()=>jT,isMessage:()=>jY,isOpenAIToolCallArray:()=>kn,isPlainTextContentBlock:()=>jS,isSystemMessage:()=>kU,isSystemMessageChunk:()=>kV,isToolMessage:()=>kD,isToolMessageChunk:()=>kE,isURLContentBlock:()=>jQ,mapChatMessagesToStoredMessages:()=>li,mapStoredMessageToChatMessage:()=>lg,mapStoredMessagesToChatMessages:()=>lh,mergeContent:()=>kk,mergeMessageRuns:()=>tI,mergeResponseMetadata:()=>kw,mergeUsageMetadata:()=>ky,parseBase64DataUrl:()=>jW,parseMimeType:()=>jV,trimMessages:()=>tK});var tS=class{chunks={};constructor(){this.chunks={}}add(a,b){a.type.endsWith("MessageChunk")&&(a.type=a.type.slice(0,-12).toLowerCase());let c="remove"===a.type&&null!=a.id?new kR({...a,id:a.id}):le(a),d=function(a){try{return lj(a)}catch{return null}}(c),{id:e}=d??c;if(!e)return console.warn("No message ID found for chunk, ignoring in state",a),null;if(this.chunks[e]??={},this.chunks[e].metadata=b??this.chunks[e].metadata,d){let a=this.chunks[e].chunk;this.chunks[e].chunk=(kv(a)?a:null)?.concat(d)??d}else this.chunks[e].chunk=c;return e}clear(){this.chunks={}}get(a,b){return null==a||null==this.chunks[a]?null:(null!=b&&(this.chunks[a].index??=b),this.chunks[a])}};let tT=a=>{let{type:b,data:c}=a.toDict();return{...c,type:b}};var tU=class extends Error{constructor(a){super(a.message),this.name=a.name??a.error??"StreamError"}static isStructuredError(a){return"object"==typeof a&&null!=a&&"message"in a}},tV=class{abortRef=new AbortController;messages;listeners=new Set;state;constructor(a){this.messages=a,this.state={isLoading:!1,values:null,error:void 0}}setState=a=>{this.state={...this.state,...a},this.notifyListeners()};notifyListeners=()=>{this.listeners.forEach(a=>a())};subscribe=a=>(this.listeners.add(a),()=>this.listeners.delete(a));getSnapshot=()=>this.state;get isLoading(){return this.state.isLoading}get values(){return this.state.values?.[0]??null}get error(){return this.state.error}setStreamValues=(a,b="stream")=>{if("function"==typeof a){let[c,d]=this.state.values??[null,"stream"],e=a(c,d);this.setState({values:null!=e?[e,b]:null})}else this.setState({values:null!=a?[a,b]:null})};getMutateFn=(a,b)=>c=>{let d={...b,...(this.state.values??[null,"stream"])[0]},e="function"==typeof c?c(d):c;this.setStreamValues({...d,...e},a)};matchEventType=(a,b,c)=>a===b||b.startsWith(`${a}|`);start=async(a,b)=>{if(!this.state.isLoading)try{let c;for await(let{event:d,data:e}of(this.setState({isLoading:!0,error:void 0}),this.abortRef=new AbortController,await a(this.abortRef.signal))){if("error"===d){c=new tU(e);break}let a=d.includes("|")?d.split("|").slice(1):void 0,f=this.getMutateFn("stream",b.initialValues);if("metadata"===d&&b.callbacks.onMetadataEvent?.(e),"events"===d&&b.callbacks.onLangChainEvent?.(e),this.matchEventType("updates",d,e)&&b.callbacks.onUpdateEvent?.(e,{namespace:a,mutate:f}),this.matchEventType("custom",d,e)&&b.callbacks.onCustomEvent?.(e,{namespace:a,mutate:f}),this.matchEventType("checkpoints",d,e)&&b.callbacks.onCheckpointEvent?.(e,{namespace:a}),this.matchEventType("tasks",d,e)&&b.callbacks.onTaskEvent?.(e,{namespace:a}),this.matchEventType("debug",d,e)&&b.callbacks.onDebugEvent?.(e,{namespace:a}),"values"===d&&("__interrupt__"in e?this.setStreamValues(a=>({...a,...e})):this.setStreamValues(e)),this.matchEventType("messages",d,e)){let[a,c]=e,d=this.messages.add(a,c);if(!d){console.warn("Failed to add message to manager, no message ID found");continue}this.setStreamValues(a=>{let c={...b.initialValues,...a},e=b.getMessages(c).slice(),{chunk:f,index:g}=this.messages.get(d,e.length)??{};return f&&null!=g?("remove"===f.getType()?e.splice(g,1):e[g]=tT(f),b.setMessages(c,e)):c})}}if(null!=c)throw c;let d=await b.onSuccess?.();void 0!==d&&this.setStreamValues(d)}catch(a){a instanceof Error&&("AbortError"===a.name||"TimeoutError"===a.name)||(console.error(a),this.setState({error:a}),await b.onError?.(a))}finally{this.setState({isLoading:!1}),this.abortRef=new AbortController,b.onFinish?.()}};stop=async(a,b)=>{this.abortRef.abort(),this.abortRef=new AbortController,b.onStop?.({mutate:this.getMutateFn("stop",a)})};clear=()=>{this.abortRef.abort(),this.abortRef=new AbortController,this.setState({error:void 0,values:null,isLoading:!1}),this.messages.clear()}};let tW=a=>{let[b,c]=(0,aB.useState)(a?.threadId??null),d=(0,aB.useRef)(a?.onThreadId);d.current=a?.onThreadId;let e=(0,aB.useCallback)(a=>{c(a),d.current?.(a)},[]);return a&&"threadId"in a?[a.threadId??null,e]:[b,e]};function tX(a,b,c){return[a["~configHash"],b,c].join(":")}var tY=a.i(254799);let tZ={randomUUID:tY.default.randomUUID},t$=new Uint8Array(256),t_=t$.length,t0=[];for(let a=0;a<256;++a)t0.push((a+256).toString(16).slice(1));let t1=function(a,b,c){if(tZ.randomUUID&&!b&&!a)return tZ.randomUUID();let d=(a=a||{}).random||(a.rng||function(){return t_>t$.length-16&&(tY.default.randomFillSync(t$),t_=0),t$.slice(t_,t_+=16)})();if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,b){c=c||0;for(let a=0;a<16;++a)b[c+a]=d[a];return b}return function(a,b=0){return t0[a[b+0]]+t0[a[b+1]]+t0[a[b+2]]+t0[a[b+3]]+"-"+t0[a[b+4]]+t0[a[b+5]]+"-"+t0[a[b+6]]+t0[a[b+7]]+"-"+t0[a[b+8]]+t0[a[b+9]]+"-"+t0[a[b+10]]+t0[a[b+11]]+t0[a[b+12]]+t0[a[b+13]]+t0[a[b+14]]+t0[a[b+15]]}(d)};function t2(a){return"string"==typeof a?a:Array.isArray(a)?a.map(a=>a&&"object"==typeof a&&"text"in a?String(a.text??""):"").join(""):""}function t3(a){return"string"==typeof a.content?a.content:Array.isArray(a.content)?a.content.filter(a=>"object"==typeof a&&null!==a&&"type"in a&&"text"===a.type||"string"==typeof a).map(a=>"string"==typeof a?a:"object"==typeof a&&null!==a&&"text"in a&&a.text||"").join(""):""}function t4(a){if("string"==typeof a)return a;if(a&&"object"==typeof a){if(a.description&&"string"==typeof a.description)return a.description;if(a.prompt&&"string"==typeof a.prompt)return a.prompt;if(a.result&&"string"==typeof a.result)return a.result}return JSON.stringify(a,null,2)}function t5(a){let b=0;for(let c of a){let a=c.content;if("string"==typeof a)b+=a.length;else if(Array.isArray(a))for(let c of a){let a=c?.text;"string"==typeof a&&(b+=a.length)}}return b}function t6(a){if(!a||"object"!=typeof a)return null;try{return JSON.stringify(a.value??null)}catch{return null}}function t7({children:a,activeAssistant:b,onHistoryRevalidate:c,thread:d}){let e=function({activeAssistant:a,onHistoryRevalidate:b,thread:c}){let[d,e]=aM("threadId"),f=d5(),[g,h]=(0,aB.useState)({}),i=function(a){let[b]=(0,aB.useState)("transport"in a);return b?function(a){let[b]=(0,aB.useState)(()=>new tS),[c]=(0,aB.useState)(()=>new tV(b));(0,aB.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot);let[d,e]=tW(a),f=(0,aB.useRef)(d);(0,aB.useEffect)(()=>{f.current!==d&&(f.current=d,c.clear())},[d,c]);let g=b=>{let c=a.messagesKey??"messages";return Array.isArray(b[c])?b[c]:[]},h=(b,c)=>{let d=a.messagesKey??"messages";return{...b,[d]:c}},i=a.initialValues??{},j=async(b,j)=>{let k,l=d;c.setStreamValues(()=>j?.optimisticValues!=null?{...i,..."function"==typeof j.optimisticValues?j.optimisticValues(i):j.optimisticValues}:{...i}),await c.start(async c=>{if(l||(f.current=l=crypto.randomUUID(),e(l)),!l)throw Error("Failed to obtain valid thread ID.");return a.transport.stream({input:b,context:j?.context,command:j?.command,signal:c,config:{...j?.config,configurable:{thread_id:l,...j?.config?.configurable}}})},{getMessages:g,setMessages:h,initialValues:{},callbacks:a,onSuccess:()=>void 0,onError(b){a.onError?.(b,k)}})};return{get values(){return c.values??{}},error:c.error,isLoading:c.isLoading,stop:()=>c.stop(i,{onStop:a.onStop}),submit:j,get interrupt(){if(null!=c.values&&"__interrupt__"in c.values&&Array.isArray(c.values.__interrupt__)){let a=c.values.__interrupt__;if(0===a.length)return{when:"breakpoint"};if(1===a.length)return a[0];return a}return},get messages(){if(!c.values)return[];return g(c.values)}}}(a):function(a){let b;(0,aB.useRef)(a.reconnectOnMount);let c=(0,aB.useMemo)(()=>null,[]),d=(0,aB.useMemo)(()=>a.client??new d2({apiUrl:a.apiUrl,apiKey:a.apiKey,callerOptions:a.callerOptions,defaultHeaders:a.defaultHeaders}),[a.client,a.apiKey,a.apiUrl,a.callerOptions,a.defaultHeaders]),[e]=(0,aB.useState)(()=>new tS),[f]=(0,aB.useState)(()=>new tV(e));(0,aB.useSyncExternalStore)(f.subscribe,f.getSnapshot,f.getSnapshot);let[g,h]=tW(a),i=(0,aB.useRef)([]),j=(0,aB.useCallback)((...a)=>{let b=i.current;for(let c of a)b.includes(c)||b.push(c)},[]),k=null!=a.onUpdateEvent,l=null!=a.onCustomEvent,m=null!=a.onLangChainEvent,n=null!=a.onDebugEvent,o=null!=a.onCheckpointEvent,p=null!=a.onTaskEvent,q=(0,aB.useMemo)(()=>{let a=[];return k&&a.push("updates"),l&&a.push("custom"),m&&a.push("events"),n&&a.push("debug"),o&&a.push("checkpoints"),p&&a.push("tasks"),a},[k,l,m,n,o,p]);(0,aB.useRef)(null).current=f.clear;let r=(0,aB.useRef)(g),s=(0,aB.useRef)(null);(0,aB.useEffect)(()=>{r.current!==g&&(r.current=g,f.clear())},[g,f]);let t="object"==typeof a.fetchStateHistory&&null!=a.fetchStateHistory?a.fetchStateHistory.limit??!1:a.fetchStateHistory??!1,u=function(a,b,c,d){let e=tX(a,b,c),[f,g]=(0,aB.useState)(()=>({key:void 0,data:void 0,error:void 0,isLoading:null!=b})),h=(0,aB.useRef)(a);h.current=a;let i=(0,aB.useRef)(d?.onError);i.current=d?.onError;let j=(0,aB.useCallback)((a,b)=>{if(d.passthrough)return Promise.resolve([]);let c=h.current,e=tX(c,a,b);return null!=a?(g(a=>a.key===e?{...a,isLoading:!0}:{key:e,data:void 0,error:void 0,isLoading:!0}),(function(a,b,c){if(c?.limit===!1)return a.threads.getState(b).then(a=>null==a.checkpoint?[]:[a]);let d="number"==typeof c?.limit?c.limit:10;return a.threads.getHistory(b,{limit:d})})(c,a,{limit:b}).then(a=>(g(b=>b.key!==e?b:{key:e,data:a,error:void 0,isLoading:!1}),a),a=>(g(b=>b.key!==e?b:{key:e,data:b.data,error:a,isLoading:!1}),i.current?.(a),Promise.reject(a)))):(g({key:e,data:void 0,error:void 0,isLoading:!1}),Promise.resolve([]))},[d.passthrough]);return(0,aB.useEffect)(()=>{(null==d.submittingRef.current||d.submittingRef.current!==b)&&j(b,c)},[j,e]),{data:f.data,error:f.error,isLoading:f.isLoading,mutate:a=>j(a??b,c)}}(d,g,t,{passthrough:null!=a.experimental_thread,submittingRef:s,onError:a.onError}),v=a.experimental_thread??u,w=b=>{let c=a.messagesKey??"messages";return Array.isArray(b[c])?b[c]:[]},x=(b,c)=>{let d=a.messagesKey??"messages";return{...b,[d]:c}},[y,z]=(0,aB.useState)(""),A=function(a,b){let{rootSequence:c,paths:d}=function(a){let b=new Set,c={};if(a.length<=1)return{rootSequence:{type:"sequence",items:a.map(a=>({type:"node",value:a,path:[]}))},paths:[]};a.forEach(a=>{let d=a.parent_checkpoint?.checkpoint_id??"$";c[d]??=[],c[d].push(a),a.checkpoint?.checkpoint_id!=null&&b.add(a.checkpoint.checkpoint_id)});let d=(...a)=>a.filter(a=>null!=a).sort((a,b)=>a.localeCompare(b)).at(-1),e=null==c.$?Object.keys(c).filter(a=>!b.has(a)).map(a=>{let b=[a],e=new Set,f=a;for(;b.length>0;){let a=b.shift();if(e.has(a))continue;e.add(a);let g=(c[a]??[]).flatMap(a=>a.checkpoint?.checkpoint_id??[]);f=d(f,...g),b.push(...g)}return{parentId:a,lastId:f}}).sort((a,b)=>a.lastId.localeCompare(b.lastId)).at(-1)?.parentId:void 0;null!=e&&(c.$=c[e]);let f={type:"sequence",items:[]},g=[{id:"$",sequence:f,path:[]}],h=[],i=new Set;for(;g.length>0;){let a,b=g.shift();if(i.has(b.id))continue;i.add(b.id);let d=c[b.id];if(null!=d&&0!==d.length)for(let c of(d.length>1&&(a={type:"fork",items:[]},b.sequence.items.push(a)),d)){let d=c.checkpoint?.checkpoint_id;if(null==d)continue;let{sequence:e}=b,{path:f}=b;null!=a&&(e={type:"sequence",items:[]},a.items.unshift(e),(f=f.slice()).push(d),h.push(f)),e.items.push({type:"node",value:c,path:f}),g.push({id:d,sequence:e,path:f})}}return{rootSequence:f,paths:h}}(b??[]),{history:e,branchByCheckpoint:f}=function(a,b,c){let d=c.split(">"),e={};for(let a of b){let b=a.at(-2)??"$";e[b]??=[],e[b].unshift(a)}let f=[],g={},h=d.slice(),i=[...a.items];for(;i.length>0;){let a=i.shift();if("node"===a.type){f.push(a.value);let b=a.value.checkpoint?.checkpoint_id;if(null==b)continue;g[b]={branch:a.path.join(">"),branchOptions:(a.path.length>0?e[a.path.at(-2)??"$"]??[]:[]).map(a=>a.join(">"))}}if("fork"===a.type){let b=h.shift(),c=null!=b?a.items.findIndex(a=>{let c=a.items.at(0);return!!c&&"node"===c.type&&c.value.checkpoint?.checkpoint_id===b}):-1,d=a.items.at(c)?.items??[];i.push(...d)}}return{history:f,branchByCheckpoint:g}}(c,d,a);return{branchTree:c,flatHistory:e,branchByCheckpoint:f,threadHead:e.at(-1)}}(y,v.data??void 0),B=A.threadHead?.values??a.initialValues??{},C=(()=>{let a=A.threadHead?.tasks?.at(-1)?.error;if(null!=a){try{let b=JSON.parse(a);if(tU.isStructuredError(b))return new tU(b);return b}catch{}return a}})(),D=(b=new Set,w(B).map((a,c)=>{let d=a.id??c,e=function(a,b){for(let c=a.length-1;c>=0;c-=1)if(b(a[c]))return a[c]}(v.data??[],a=>w(a.values).map((a,b)=>a.id??b).includes(d)),f=e?.checkpoint?.checkpoint_id,g=null!=f?A.branchByCheckpoint[f]:void 0;g?.branch?.length||(g=void 0);let h=g?.branchOptions?.flat(2).join(",");return h&&(b.has(h)&&(g=void 0),b.add(h)),{messageId:d.toString(),firstSeenState:e,branch:g?.branch,branchOptions:g?.branchOptions}})),E=async(b,e)=>{let j,k,l=e?.checkpoint?.checkpoint_id;z(null!=l?A.branchByCheckpoint[l]?.branch??"":"");let m=!0===t||"number"==typeof t,n=null!=a.onFinish||m;f.setStreamValues(()=>{let a=n?B:{...B,...f.values};return e?.optimisticValues!=null?{...a,..."function"==typeof e.optimisticValues?e.optimisticValues(a):e.optimisticValues}:{...a}});let o=g;await f.start(async f=>{if(o||(r.current=o=(await d.threads.create({threadId:e?.threadId,metadata:e?.metadata})).thread_id,s.current=o,h(o)),!o)throw Error("Failed to obtain valid thread ID.");s.current=o;let g=[...new Set([...e?.streamMode??[],...i.current,...q])],l=e?.checkpoint??(m?A.threadHead?.checkpoint:void 0)??void 0;e?.checkpoint===null&&(l=void 0),null!=l&&delete l.thread_id;let n=e?.streamResumable??!!c;return d.runs.stream(o,a.assistantId,{input:b,config:e?.config,context:e?.context,command:e?.command,interruptBefore:e?.interruptBefore,interruptAfter:e?.interruptAfter,metadata:e?.metadata,multitaskStrategy:e?.multitaskStrategy,onCompletion:e?.onCompletion,onDisconnect:e?.onDisconnect??(n?"continue":"cancel"),signal:f,checkpoint:l,streamMode:g,streamSubgraphs:e?.streamSubgraphs,streamResumable:n,durability:e?.durability,onRunCreated(b){j={run_id:b.run_id,thread_id:b.thread_id??o},c&&(k=`lg:stream:${o}`,c.setItem(k,j.run_id)),a.onCreated?.(j)}})},{getMessages:w,setMessages:x,initialValues:B,callbacks:a,async onSuccess(){if(k&&c?.removeItem(k),n){let b=await v.mutate(o),c=b?.at(0);if(c)return a.onFinish?.(c,j),null}},onError(b){a.onError?.(b,j)},onFinish(){s.current=null}})},F=async(b,e,h)=>{if(e??="-1",!g)return;let i={thread_id:g,run_id:b};await f.start(async a=>(s.current=g,d.runs.joinStream(g,b,{signal:a,lastEventId:e,streamMode:h?.streamMode})),{getMessages:w,setMessages:x,initialValues:B,callbacks:a,async onSuccess(){c?.removeItem(`lg:stream:${g}`);let b=await v.mutate(g),d=b?.at(0);d&&a.onFinish?.(d,i)},onError(b){a.onError?.(b,i)},onFinish(){s.current=null}})},G=(0,aB.useMemo)(()=>{c&&f.isLoading},[c,f.isLoading,g]),H=!!c,I=(0,aB.useRef)({threadId:g,shouldReconnect:H}),J=(0,aB.useRef)(F);J.current=F,(0,aB.useEffect)(()=>{I.current.threadId!==g&&(I.current={threadId:g,shouldReconnect:H})},[g,H]),(0,aB.useEffect)(()=>{G&&I.current.shouldReconnect&&(I.current.shouldReconnect=!1,J.current?.(G.runId))},[G]);let K=f.error??C??v.error,L=f.values??B;return{get values(){return j("values"),L},client:d,assistantId:a.assistantId,error:K,isLoading:f.isLoading,stop:()=>f.stop(B,{onStop:b=>{if(c&&g){let a=c.getItem(`lg:stream:${g}`);a&&d.runs.cancel(g,a),c.removeItem(`lg:stream:${g}`)}a.onStop?.(b)}}),submit:E,joinStream:F,branch:y,setBranch:z,get history(){if(!1===t)throw Error("`fetchStateHistory` must be set to `true` to use `history`");return A.flatHistory},isThreadLoading:v.isLoading&&null==v.data,get experimental_branchTree(){if(!1===t)throw Error("`fetchStateHistory` must be set to `true` to use `experimental_branchTree`");return A.branchTree},get interrupt(){if(null!=L&&"__interrupt__"in L&&Array.isArray(L.__interrupt__)){let a=L.__interrupt__;if(0===a.length)return{when:"breakpoint"};if(1===a.length)return a[0];return a}if(f.isLoading)return;let a=A.threadHead?.tasks?.at(-1)?.interrupts;if(null==a||0===a.length){if(!(A.threadHead?.next??[]).length||null!=K)return;return{when:"breakpoint"}}return a.at(-1)},get messages(){return j("messages-tuple","values"),w(L)},getMessagesMetadata(a,b){j("values");let c=e.get(a.id)?.metadata,d=D?.find(c=>c.messageId===(a.id??b));if(null!=c||null!=d)return{...d,streamMetadata:c}}}}(a)}({assistantId:a?.assistant_id||"",client:f??void 0,reconnectOnMount:!0,threadId:d??null,onThreadId:e,defaultHeaders:{"x-auth-scheme":"langsmith"},fetchStateHistory:!0,onFinish:b,onError:b,onCreated:b,onUpdateEvent:(a,b)=>{let c=b?.namespace;if(!c||0===c.length)return;let d=function(a){let b=[];if(!a||"object"!=typeof a)return b;for(let c of Object.values(a)){let a=c?.messages;if(Array.isArray(a))for(let c of a)if("ai"===c.type&&c.tool_calls&&c.tool_calls.length>0)for(let a of c.tool_calls)b.push({kind:"tool_call",id:a.id??"",name:a.name??"tool",args:a.args&&"object"==typeof a.args?a.args:{}});else if("ai"===c.type){let a=t2(c.content).trim();a&&b.push({kind:"text",text:a})}else"tool"===c.type&&b.push({kind:"tool_result",toolCallId:c.tool_call_id??"",name:c.name??"tool",text:t2(c.content).trim()})}return b}(a);if(0===d.length)return;let e=c.join("|");h(a=>({...a,[e]:[...a[e]??[],...d]}))},experimental_thread:c}),[j,k]=(0,aB.useState)(void 0),[l,m]=(0,aB.useState)(null),[n,o]=(0,aB.useState)(null),[p,q]=(0,aB.useState)(null),r=(0,aB.useRef)(0);(0,aB.useEffect)(()=>{let a;if(!d){k(void 0),o(null),q(null),m(null);return}if(i.isLoading){r.current+=1,k(void 0),m(null);return}let b=i.messages.length,c=++r.current,e=!1,g=0,h=async()=>{g+=1;try{let[j,l]=await Promise.all([f.threads.getState(d),f.threads.get(d)]);if(e||r.current!==c)return;let n=l.values?.messages,p=function(a){if(Array.isArray(a))for(let b=a.length-1;b>=0;b--){let c=a[b]?.interrupts;if(Array.isArray(c)&&c.length>0)return c[c.length-1]}}(j.tasks),s=Array.isArray(j.next)&&j.next.length>0,t=function(a){if(!a||"object"!=typeof a)return;let b=a.value;if(!b||"object"!=typeof b)return;let c={...b};return"action_requests"in b&&!Array.isArray(b.action_requests)&&(c.action_requests=[]),"review_configs"in b&&!Array.isArray(b.review_configs)&&(c.review_configs=[]),{...a,value:c}}(p);if(t&&function(a){if(!a||"object"!=typeof a)return!1;let b=a.value;return!!b&&"object"==typeof b&&("ask_user"===b.type||Array.isArray(b.action_requests)&&b.action_requests.length>0)}(t)){k(t),m(null),Array.isArray(n)&&(q(d),o(n));return}if(Array.isArray(n)&&n.length>b&&(q(d),o(n)),!s){k(void 0),m(t6(i.interrupt)),Array.isArray(n)&&(q(d),o(n));return}s&&g<15&&!e&&(a=setTimeout(h,1e3))}catch{!e&&r.current===c&&g<15&&(a=setTimeout(h,1e3))}};return h(),()=>{e=!0,a&&clearTimeout(a)}},[d,i.interrupt,i.isLoading,f]);let s=i.interrupt,t=s&&(null===l||t6(s)!==l)?s:p===d?j??void 0:void 0,u=n&&p===d&&(j||!i.isLoading||n.length>i.messages.length||n.length===i.messages.length&&t5(n)>t5(i.messages))?n:i.messages,v=(0,aB.useCallback)(c=>{k(void 0),o(null),q(null),m(null),r.current+=1;let d={id:t1(),type:"human",content:c};i.submit({messages:[d]},{optimisticValues:a=>({messages:[...a.messages??[],d]}),config:{...a?.config??{},recursion_limit:100},streamSubgraphs:!0,streamMode:["updates"],streamResumable:!0,onDisconnect:"continue"}),b?.()},[i,a?.config,b]),w=(0,aB.useCallback)(async a=>{d&&await f.threads.updateState(d,{values:{files:a}})},[f,d]),x=(0,aB.useCallback)(a=>{k(void 0),o(null),q(null),m(null),r.current+=1,i.submit(null,{command:{resume:a},streamSubgraphs:!0,streamMode:["updates"],streamResumable:!0,onDisconnect:"continue"}),b?.()},[i,b]),y=(0,aB.useCallback)(()=>{i.stop()},[i]);return{stream:i,todos:i.values.todos??[],files:i.values.files??{},email:i.values.email,asyncTasks:i.values.async_tasks??{},summarizationEvent:function(a){if(!a||"object"!=typeof a)return null;let b=a.summary_message,c="string"==typeof b?.content?b.content:"";if(!c)return null;let d=a.cutoff_index,e=a.file_path;return{cutoffIndex:"number"==typeof d&&d>=0?d:0,content:c,filePath:"string"==typeof e?e:null}}(i.values._summarization_event),ui:i.values.ui,setFiles:w,messages:u,isLoading:i.isLoading,isThreadLoading:i.isThreadLoading,interrupt:t,sendMessage:v,stopStream:y,resumeInterrupt:x,subAgentActivity:g}}({activeAssistant:b,onHistoryRevalidate:c,thread:d});return(0,aA.jsx)(t8.Provider,{value:e,children:a})}let t8=(0,aB.createContext)(void 0);function t9(){let a=(0,aB.useContext)(t8);if(void 0===a)throw Error("useChatContext must be used within a ChatProvider");return a}let ua=cz("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),ub=cz("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),uc=cz("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),ud=cz("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ue=cz("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),uf=cz("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),ug=cz("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),uh=cz("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ui=cz("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),uj=cz("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),uk=cz("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),ul=cz("corner-down-right",[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]),um=cz("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),un=cz("list-x",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]]),uo=cz("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),up=aB.default.memo(({subAgent:a,onClick:b,isExpanded:c=!0})=>{let d="pending"===a.status;return(0,aA.jsx)("div",{className:"w-fit max-w-[70vw] overflow-hidden rounded-lg bg-card",children:(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",onClick:b,className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left",children:[(0,aA.jsx)("span",{className:"bg-[var(--brand)]/10 flex size-5 shrink-0 items-center justify-center rounded-md text-[var(--brand)]",children:d?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(uo,{className:"size-3.5","aria-hidden":"true"})}),(0,aA.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:a.subAgentName}),(0,aA.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:"subagent"}),c?(0,aA.jsx)(is,{size:14,className:"ml-auto shrink-0 text-muted-foreground"}):(0,aA.jsx)(ir,{size:14,className:"ml-auto shrink-0 text-muted-foreground"})]})})});up.displayName="SubAgentIndicator";let uq=cz("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),ur=cz("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),us=cz("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),ut=aB.createContext(null),uu=new class{cache={};boundCache={};callbacks={};respond(a,b,c){this.cache[a]={comp:b,target:c},this.callbacks[a]?.forEach(a=>a(b,c))}getBoundStore(a){return this.boundCache[a]??={subscribe:b=>(this.callbacks[a]??=[],this.callbacks[a].push(b),()=>{this.callbacks[a]=this.callbacks[a].filter(a=>a!==b)}),getSnapshot:()=>this.cache[a]},this.boundCache[a]}};function uv({stream:a,namespace:b,message:c,meta:d,fallback:e,components:f,...g}){let h=aB.useRef(null),i=aB.useId(),j=`child-shadow-${i}`,k=aB.useMemo(()=>uu.getBoundStore(j),[j]),l=aB.useSyncExternalStore(k.subscribe,k.getSnapshot),m=f?.[c.name],n=null!=m,o=null;(a=>!!aB.isValidElement(a)||null==a||"string"==typeof a||"number"==typeof a||"bigint"==typeof a||"boolean"==typeof a||null!=a&&"object"==typeof a&&Symbol.iterator in a||null!=a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then)(e)?o=e:"object"==typeof e&&null!=e&&(o=e?.[c.name]);let p=b??a.assistantId,q=a.client["~ui"];return(aB.useEffect(()=>{n||q.getComponent(p,c.name).then(a=>{let b=h.current;if(!b)return;let c=b.shadowRoot??b.attachShadow({mode:"open"}),d=document.createRange().createContextualFragment(a.replace("{{shadowRootId}}",j));c.appendChild(d)})},[q,p,c.name,j,n]),n)?(0,aA.jsx)(ut.Provider,{value:{stream:a,meta:d},children:aB.createElement(m,c.props)}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("div",{id:j,ref:h,...g}),(0,aA.jsx)(ut.Provider,{value:{stream:a,meta:d},children:l?.target!=null?aY.createPortal(aB.createElement(l.comp,c.props),l.target):o})]})}Symbol.for("LGUI_EXT_STORE"),Symbol.for("LGUI_REQUIRE"),Symbol.for("LGUI_REQUIRE_EXTRA");let uw=aB.forwardRef(({className:a,...b},c)=>(0,aA.jsx)("textarea",{className:dd("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:c,...b}));function ux({actionRequest:a,reviewConfig:b,onResume:c,isLoading:d,onSubmitted:e}){let[f,g]=(0,aB.useState)(""),[h,i]=(0,aB.useState)(!1),[j,k]=(0,aB.useState)({}),[l,m]=(0,aB.useState)(!1),[n,o]=(0,aB.useState)(!1),p=b?.allowedDecisions??b?.allowed_decisions??["approve","reject","edit"],q=a=>{(0,aY.flushSync)(()=>{o(!0),e&&e()}),c(a)};return n?null:(0,aA.jsxs)("div",{className:"w-full rounded-md border border-border bg-muted/30 p-4",children:[(0,aA.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-foreground",children:[(0,aA.jsx)(ur,{size:16,className:"text-yellow-600 dark:text-yellow-400"}),(0,aA.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider",children:"Approval Required"})]}),a.description&&(0,aA.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:a.description}),(0,aA.jsxs)("div",{className:"mb-4 rounded-sm border border-border bg-background p-3",children:[(0,aA.jsxs)("div",{className:"mb-2",children:[(0,aA.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Tool"}),(0,aA.jsx)("p",{className:"mt-1 font-mono text-sm font-medium text-foreground",children:a.name})]}),h?(0,aA.jsxs)("div",{children:[(0,aA.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Edit Arguments"}),(0,aA.jsx)("div",{className:"mt-2 space-y-3",children:Object.entries(a.args).map(([a,b])=>(0,aA.jsxs)("div",{children:[(0,aA.jsx)("label",{className:"mb-1 block text-xs font-medium text-foreground",children:a}),(0,aA.jsx)(uw,{value:void 0!==j[a]?"string"==typeof j[a]?j[a]:JSON.stringify(j[a],null,2):"string"==typeof b?b:JSON.stringify(b,null,2),onChange:b=>((a,b)=>{try{let c=b.trim().startsWith("{")||b.trim().startsWith("[")?JSON.parse(b):b;k(b=>({...b,[a]:c}))}catch{k(c=>({...c,[a]:b}))}})(a,b.target.value),className:"font-mono text-xs",rows:"string"==typeof b&&b.length<100?2:4,disabled:d})]},a))})]}):(0,aA.jsxs)("div",{children:[(0,aA.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Arguments"}),(0,aA.jsx)("pre",{className:"mt-2 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-muted/40 p-2 font-mono text-xs text-foreground",children:JSON.stringify(a.args,null,2)})]})]}),l&&!h&&(0,aA.jsxs)("div",{className:"mb-4",children:[(0,aA.jsx)("label",{className:"mb-2 block text-xs font-medium text-foreground",children:"Rejection Message (optional)"}),(0,aA.jsx)(uw,{value:f,onChange:a=>g(a.target.value),placeholder:"Explain why you're rejecting this action…",className:"text-sm",rows:2,disabled:d})]}),(0,aA.jsx)("div",{className:"flex flex-wrap gap-2",children:h?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),k({})},disabled:d,children:"Cancel"}),(0,aA.jsxs)(dy,{type:"button",size:"sm",onClick:()=>{h&&(q({decisions:[{type:"edit",edited_action:{name:a.name,args:j}}]}),i(!1),k({}))},disabled:d,className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-600 dark:hover:bg-green-700",children:[(0,aA.jsx)(iq,{size:14}),d?"Saving…":"Save & Approve"]})]}):l?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{m(!1),g("")},disabled:d,children:"Cancel"}),(0,aA.jsx)(dy,{type:"button",variant:"destructive",size:"sm",onClick:()=>{q({decisions:[{type:"reject",message:f.trim()}]})},disabled:d,children:d?"Rejecting…":"Confirm Reject"})]}):(0,aA.jsxs)(aA.Fragment,{children:[p.includes("reject")&&(0,aA.jsxs)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{l?q({decisions:[{type:"reject",message:f.trim()}]}):m(!0)},disabled:d,className:"text-destructive hover:bg-destructive/10",children:[(0,aA.jsx)(cA,{size:14}),"Reject"]}),p.includes("edit")&&(0,aA.jsxs)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!0),k(JSON.parse(JSON.stringify(a.args))),m(!1)},disabled:d,children:[(0,aA.jsx)(fl,{size:14}),"Edit"]}),p.includes("approve")&&(0,aA.jsxs)(dy,{type:"button",size:"sm",onClick:()=>{q({decisions:[{type:"approve"}]})},disabled:d,className:dd("bg-green-600 text-white hover:bg-green-700","dark:bg-green-600 dark:hover:bg-green-700"),children:[(0,aA.jsx)(iq,{size:14}),d?"Approving…":"Approve"]})]})})]})}function uy(a,b){if("string"==typeof a)return a;if(null==a)return String(a);try{return JSON.stringify(a,null,2*!!b?.pretty)}catch{return String(a)}}uw.displayName="Textarea";let uz=aB.default.memo(({toolCall:a,uiComponent:b,stream:c,graphId:d,actionRequest:e,actionRequestKey:f,actionRequestSubmitted:g,onActionRequestSubmitted:h,reviewConfig:i,onResume:j,isLoading:k,autoApprove:l,compact:m=!1})=>{let[n,o]=(0,aB.useState)(()=>!!b||!!e&&!l),[p,q]=(0,aB.useState)({}),r=(0,aB.useMemo)(()=>e?`${a.id}:${e.name}:${uy(e.args,{pretty:!1})}`:null,[e,a.id]),s=f??r,[t,u]=(0,aB.useState)(null);(0,aB.useEffect)(()=>{s?u(a=>a&&a!==s?null:a):u(null)},[s]),(0,aB.useEffect)(()=>{b&&o(!0)},[b]);let v=(0,aB.useRef)(e);(0,aB.useEffect)(()=>{let a=!!v.current,b=!!e;!b||a||l?!b&&a&&o(!1):o(!0),v.current=e},[e,l]);let{name:w,args:x,result:y,status:z}=(0,aB.useMemo)(()=>{let b=a.args;return{name:function(a,b){if(!a)return"Unknown Tool";if("ToolSelectionResponse"===a)return"Adaptive tool selection";let c=a.toLowerCase();if("think_tool"===c)return"Reflection";if("read_file"===c||"write_file"===c||"edit_file"===c){let a,d=function(a){if(a&&"object"==typeof a)return a;if("string"==typeof a)try{let b=JSON.parse(a);if(b&&"object"==typeof b)return b}catch{}return{}}(b),e=String(d.path??d.file_path??"");if("/memories"===(a=(e||"").trim())||a.startsWith("/memories/"))return"read_file"===c?"Reading memory":"Updating memory";if("read_file"===c){let a=function(a){let b=(a||"").trim();if(!b.startsWith("/skills/"))return"";let[c]=b.slice(8).split("/");return c||""}(e);if(a)return`Skill: ${a}`}}return a}(a.name,b),args:b&&"object"==typeof b?b:{},result:a.result,status:a.status||"completed"}},[a]),A=(0,aB.useMemo)(()=>{switch(z){case"completed":return(0,aA.jsx)(uc,{});case"error":return(0,aA.jsx)(ur,{size:14,className:"text-destructive"});case"pending":return(0,aA.jsx)(fj,{size:14,className:"animate-spin"});case"interrupted":return(0,aA.jsx)(us,{size:14,className:"text-orange-500"});default:return(0,aA.jsx)(uq,{size:14,className:"text-muted-foreground"})}},[z]),B=(0,aB.useCallback)(()=>{o(a=>!a)},[]),C=(0,aB.useCallback)(a=>{q(b=>({...b,[a]:!b[a]}))},[]),D=null!=y,E=D||Object.keys(x).length>0,F=g??t===s,G=e&&j&&(!s||!F);return(0,aA.jsxs)("div",{className:dd("w-full overflow-hidden rounded-lg border-none shadow-none outline-none transition-colors duration-200 focus-within:ring-2 focus-within:ring-ring hover:bg-accent",m&&"rounded-md",n&&E&&"bg-accent"),children:[(0,aA.jsx)(dy,{variant:"ghost",size:"sm",onClick:B,className:dd("flex w-full items-center justify-between gap-2 border-none px-2 py-2 text-left shadow-none outline-none disabled:cursor-default",m&&"h-auto min-h-8 py-1.5"),disabled:!E,children:(0,aA.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-2",children:[A,(0,aA.jsx)("span",{className:dd("text-[15px] font-medium tracking-[-0.6px] text-foreground",m&&"text-xs tracking-normal"),children:w})]}),E&&(n?(0,aA.jsx)(is,{size:14,className:"shrink-0 text-muted-foreground"}):(0,aA.jsx)(ir,{size:14,className:"shrink-0 text-muted-foreground"}))]})}),n&&E&&(0,aA.jsx)("div",{className:dd("px-4 pb-4",m&&"px-2 pb-2"),children:b&&c&&d?(0,aA.jsx)("div",{className:"mt-4",children:(0,aA.jsx)(uv,{stream:c,message:b,namespace:d,meta:{status:z,args:x,result:y??"No Result Yet"}},b.id)}):G?(0,aA.jsx)("div",{className:"mt-4",children:(0,aA.jsx)(ux,{actionRequest:e,reviewConfig:i,onResume:j,isLoading:k,onSubmitted:()=>{u(s),s&&h?.(s),o(!1)}})}):(0,aA.jsxs)(aA.Fragment,{children:[Object.keys(x).length>0&&(0,aA.jsxs)("div",{className:dd("mt-4",m&&"mt-2"),children:[(0,aA.jsx)("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Arguments"}),(0,aA.jsx)("div",{className:"space-y-2",children:Object.entries(x).map(([a,b])=>{let c,d=(c=uy(b,{pretty:!1}).replace(/\s+/g," ").trim()).length>80?c.slice(0,79)+"…":c,e=uy(b,{pretty:!0}),f=d!==e,g=f&&!!p[a],h=(0,aA.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[(0,aA.jsxs)("span",{className:"shrink-0 font-mono",children:[a,":"]}),(0,aA.jsx)("span",{className:"truncate font-mono font-normal text-muted-foreground",children:d})]});return(0,aA.jsxs)("div",{className:"rounded-sm border border-border",children:[f?(0,aA.jsxs)("button",{type:"button",onClick:()=>C(a),className:"flex w-full items-center justify-between gap-2 bg-muted/30 p-2 text-left text-xs font-medium transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[h,g?(0,aA.jsx)(is,{size:12,className:"shrink-0 text-muted-foreground"}):(0,aA.jsx)(ir,{size:12,className:"shrink-0 text-muted-foreground"})]}):(0,aA.jsx)("div",{className:"flex items-center gap-2 bg-muted/30 p-2 text-xs font-medium",children:h}),g&&(0,aA.jsx)("div",{className:dd("border-t border-border bg-muted/20 p-2",m&&"p-1.5"),children:(0,aA.jsx)("pre",{className:dd("m-0 overflow-x-auto whitespace-pre-wrap break-all font-mono text-xs leading-6 text-foreground",m&&"text-[11px] leading-5"),children:e})})]},a)})})]}),D&&(0,aA.jsxs)("div",{className:dd("mt-4",m&&"mt-2"),children:[(0,aA.jsx)("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Result"}),(0,aA.jsx)("pre",{className:dd("m-0 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-muted/40 p-2 font-mono text-xs leading-7 text-foreground",m&&"p-1.5 text-[11px] leading-5"),children:uy(y,{pretty:!0})})]})]})})]})});function uA(){}function uB(){}function uC(a){let b=[],c=String(a||""),d=c.indexOf(","),e=0,f=!1;for(;!f;){-1===d&&(d=c.length,f=!0);let a=c.slice(e,d).trim();(a||!f)&&b.push(a),e=d+1,d=c.indexOf(",",e)}return b}function uD(a,b){let c=b||{};return(""===a[a.length-1]?[...a,""]:a).join((c.padRight?" ":"")+","+(!1===c.padLeft?"":" ")).trim()}uz.displayName="ToolCallBox";let uE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uF=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uG={};function uH(a,b){return((b||uG).jsx?uF:uE).test(a)}let uI=/[ \t\n\f\r]/g;function uJ(a){return""===a.replace(uI,"")}class uK{constructor(a,b){this.attribute=b,this.property=a}}uK.prototype.attribute="",uK.prototype.booleanish=!1,uK.prototype.boolean=!1,uK.prototype.commaOrSpaceSeparated=!1,uK.prototype.commaSeparated=!1,uK.prototype.defined=!1,uK.prototype.mustUseProperty=!1,uK.prototype.number=!1,uK.prototype.overloadedBoolean=!1,uK.prototype.property="",uK.prototype.spaceSeparated=!1,uK.prototype.space=void 0;let uL=0,uM=uT(),uN=uT(),uO=uT(),uP=uT(),uQ=uT(),uR=uT(),uS=uT();function uT(){return 2**++uL}a.s(["boolean",0,uM,"booleanish",0,uN,"commaOrSpaceSeparated",0,uS,"commaSeparated",0,uR,"number",0,uP,"overloadedBoolean",0,uO,"spaceSeparated",0,uQ],153427);var uU=a.i(153427);let uV=Object.keys(uU);class uW extends uK{constructor(a,b,c,d){let e=-1;if(super(a,b),function(a,b,c){c&&(a[b]=c)}(this,"space",d),"number"==typeof c)for(;++e<uV.length;){const a=uV[e];!function(a,b,c){c&&(a[b]=c)}(this,uV[e],(c&uU[a])===uU[a])}}}function uX(a){return a.toLowerCase()}uW.prototype.defined=!0;let uY=/[A-Z]/g,uZ=/-[a-z]/g,u$=/^data[-\w.:]+$/i;function u_(a,b){let c=uX(b),d=b,e=uK;if(c in a.normal)return a.property[a.normal[c]];if(c.length>4&&"data"===c.slice(0,4)&&u$.test(b)){if("-"===b.charAt(4)){let a=b.slice(5).replace(uZ,u1);d="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=b.slice(4);if(!uZ.test(a)){let c=a.replace(uY,u0);"-"!==c.charAt(0)&&(c="-"+c),b="data"+c}}e=uW}return new e(d,b)}function u0(a){return"-"+a.toLowerCase()}function u1(a){return a.charAt(1).toUpperCase()}let u2={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class u3{constructor(a,b,c){this.normal=b,this.property=a,c&&(this.space=c)}}function u4(a,b){let c={},d={};for(let b of a)Object.assign(c,b.property),Object.assign(d,b.normal);return new u3(c,d,b)}function u5(a){let b={},c={};for(let[d,e]of Object.entries(a.properties)){let f=new uW(d,a.transform(a.attributes||{},d),e,a.space);a.mustUseProperty&&a.mustUseProperty.includes(d)&&(f.mustUseProperty=!0),b[d]=f,c[uX(d)]=d,c[uX(f.attribute)]=d}return new u3(b,c,a.space)}u3.prototype.normal={},u3.prototype.property={},u3.prototype.space=void 0;let u6=u5({properties:{ariaActiveDescendant:null,ariaAtomic:uN,ariaAutoComplete:null,ariaBusy:uN,ariaChecked:uN,ariaColCount:uP,ariaColIndex:uP,ariaColSpan:uP,ariaControls:uQ,ariaCurrent:null,ariaDescribedBy:uQ,ariaDetails:null,ariaDisabled:uN,ariaDropEffect:uQ,ariaErrorMessage:null,ariaExpanded:uN,ariaFlowTo:uQ,ariaGrabbed:uN,ariaHasPopup:null,ariaHidden:uN,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uQ,ariaLevel:uP,ariaLive:null,ariaModal:uN,ariaMultiLine:uN,ariaMultiSelectable:uN,ariaOrientation:null,ariaOwns:uQ,ariaPlaceholder:null,ariaPosInSet:uP,ariaPressed:uN,ariaReadOnly:uN,ariaRelevant:null,ariaRequired:uN,ariaRoleDescription:uQ,ariaRowCount:uP,ariaRowIndex:uP,ariaRowSpan:uP,ariaSelected:uN,ariaSetSize:uP,ariaSort:null,ariaValueMax:uP,ariaValueMin:uP,ariaValueNow:uP,ariaValueText:null,role:null},transform:(a,b)=>"role"===b?b:"aria-"+b.slice(4).toLowerCase()});function u7(a,b){return b in a?a[b]:b}function u8(a,b){return u7(a,b.toLowerCase())}let u9=u5({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uR,acceptCharset:uQ,accessKey:uQ,action:null,allow:null,allowFullScreen:uM,allowPaymentRequest:uM,allowUserMedia:uM,alt:null,as:null,async:uM,autoCapitalize:null,autoComplete:uQ,autoFocus:uM,autoPlay:uM,blocking:uQ,capture:null,charSet:null,checked:uM,cite:null,className:uQ,cols:uP,colSpan:null,content:null,contentEditable:uN,controls:uM,controlsList:uQ,coords:uP|uR,crossOrigin:null,data:null,dateTime:null,decoding:null,default:uM,defer:uM,dir:null,dirName:null,disabled:uM,download:uO,draggable:uN,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:uM,formTarget:null,headers:uQ,height:uP,hidden:uO,high:uP,href:null,hrefLang:null,htmlFor:uQ,httpEquiv:uQ,id:null,imageSizes:null,imageSrcSet:null,inert:uM,inputMode:null,integrity:null,is:null,isMap:uM,itemId:null,itemProp:uQ,itemRef:uQ,itemScope:uM,itemType:uQ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:uM,low:uP,manifest:null,max:null,maxLength:uP,media:null,method:null,min:null,minLength:uP,multiple:uM,muted:uM,name:null,nonce:null,noModule:uM,noValidate:uM,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:uM,optimum:uP,pattern:null,ping:uQ,placeholder:null,playsInline:uM,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:uM,referrerPolicy:null,rel:uQ,required:uM,reversed:uM,rows:uP,rowSpan:uP,sandbox:uQ,scope:null,scoped:uM,seamless:uM,selected:uM,shadowRootClonable:uM,shadowRootDelegatesFocus:uM,shadowRootMode:null,shape:null,size:uP,sizes:null,slot:null,span:uP,spellCheck:uN,src:null,srcDoc:null,srcLang:null,srcSet:null,start:uP,step:null,style:null,tabIndex:uP,target:null,title:null,translate:null,type:null,typeMustMatch:uM,useMap:null,value:uN,width:uP,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uQ,axis:null,background:null,bgColor:null,border:uP,borderColor:null,bottomMargin:uP,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:uM,declare:uM,event:null,face:null,frame:null,frameBorder:null,hSpace:uP,leftMargin:uP,link:null,longDesc:null,lowSrc:null,marginHeight:uP,marginWidth:uP,noResize:uM,noHref:uM,noShade:uM,noWrap:uM,object:null,profile:null,prompt:null,rev:null,rightMargin:uP,rules:null,scheme:null,scrolling:uN,standby:null,summary:null,text:null,topMargin:uP,valueType:null,version:null,vAlign:null,vLink:null,vSpace:uP,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:uM,disableRemotePlayback:uM,prefix:null,property:null,results:uP,security:null,unselectable:null},space:"html",transform:u8}),va=u5({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:uS,accentHeight:uP,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:uP,amplitude:uP,arabicForm:null,ascent:uP,attributeName:null,attributeType:null,azimuth:uP,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:uP,by:null,calcMode:null,capHeight:uP,className:uQ,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:uP,diffuseConstant:uP,direction:null,display:null,dur:null,divisor:uP,dominantBaseline:null,download:uM,dx:null,dy:null,edgeMode:null,editable:null,elevation:uP,enableBackground:null,end:null,event:null,exponent:uP,externalResourcesRequired:null,fill:null,fillOpacity:uP,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uR,g2:uR,glyphName:uR,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:uP,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:uP,horizOriginX:uP,horizOriginY:uP,id:null,ideographic:uP,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:uP,k:uP,k1:uP,k2:uP,k3:uP,k4:uP,kernelMatrix:uS,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:uP,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:uP,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:uP,overlineThickness:uP,paintOrder:null,panose1:null,path:null,pathLength:uP,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uQ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:uP,pointsAtY:uP,pointsAtZ:uP,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:uS,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:uS,rev:uS,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:uS,requiredFeatures:uS,requiredFonts:uS,requiredFormats:uS,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:uP,specularExponent:uP,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:uP,strikethroughThickness:uP,string:null,stroke:null,strokeDashArray:uS,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:uP,strokeOpacity:uP,strokeWidth:null,style:null,surfaceScale:uP,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:uS,tabIndex:uP,tableValues:null,target:null,targetX:uP,targetY:uP,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:uS,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:uP,underlineThickness:uP,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:uP,values:null,vAlphabetic:uP,vMathematical:uP,vectorEffect:null,vHanging:uP,vIdeographic:uP,version:null,vertAdvY:uP,vertOriginX:uP,vertOriginY:uP,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:uP,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u7}),vb=u5({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(a,b)=>"xlink:"+b.slice(5).toLowerCase()}),vc=u5({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:u8}),vd=u5({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(a,b)=>"xml:"+b.slice(3).toLowerCase()}),ve=u4([u6,u9,vb,vc,vd],"html"),vf=u4([u6,va,vb,vc,vd],"svg");function vg(a){let b=String(a||"").trim();return b?b.split(/[ \t\n\r\f]+/g):[]}function vh(a){return a.join(" ").trim()}var vi=a.i(752540);let vj=vl("end"),vk=vl("start");function vl(a){return function(b){let c=b&&b.position&&b.position[a]||{};if("number"==typeof c.line&&c.line>0&&"number"==typeof c.column&&c.column>0)return{line:c.line,column:c.column,offset:"number"==typeof c.offset&&c.offset>-1?c.offset:void 0}}}function vm(a){let b=vk(a),c=vj(a);if(b&&c)return{start:b,end:c}}function vn(a){return a&&"object"==typeof a?"position"in a||"type"in a?vp(a.position):"start"in a||"end"in a?vp(a):"line"in a||"column"in a?vo(a):"":""}function vo(a){return vq(a&&a.line)+":"+vq(a&&a.column)}function vp(a){return vo(a&&a.start)+"-"+vo(a&&a.end)}function vq(a){return a&&"number"==typeof a?a:1}class vr extends Error{constructor(a,b,c){super(),"string"==typeof b&&(c=b,b=void 0);let d="",e={},f=!1;if(b&&(e="line"in b&&"column"in b||"start"in b&&"end"in b?{place:b}:"type"in b?{ancestors:[b],place:b.position}:{...b}),"string"==typeof a?d=a:!e.cause&&a&&(f=!0,d=a.message,e.cause=a),!e.ruleId&&!e.source&&"string"==typeof c){const a=c.indexOf(":");-1===a?e.ruleId=c:(e.source=c.slice(0,a),e.ruleId=c.slice(a+1))}if(!e.place&&e.ancestors&&e.ancestors){const a=e.ancestors[e.ancestors.length-1];a&&(e.place=a.position)}const g=e.place&&"start"in e.place?e.place.start:e.place;this.ancestors=e.ancestors||void 0,this.cause=e.cause||void 0,this.column=g?g.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=g?g.line:void 0,this.name=vn(e.place)||"1:1",this.place=e.place||void 0,this.reason=this.message,this.ruleId=e.ruleId||void 0,this.source=e.source||void 0,this.stack=f&&e.cause&&"string"==typeof e.cause.stack?e.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vr.prototype.file="",vr.prototype.name="",vr.prototype.reason="",vr.prototype.message="",vr.prototype.stack="",vr.prototype.column=void 0,vr.prototype.line=void 0,vr.prototype.ancestors=void 0,vr.prototype.cause=void 0,vr.prototype.fatal=void 0,vr.prototype.place=void 0,vr.prototype.ruleId=void 0,vr.prototype.source=void 0;let vs={}.hasOwnProperty,vt=new Map,vu=/[A-Z]/g,vv=new Set(["table","tbody","thead","tfoot","tr"]),vw=new Set(["td","th"]),vx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vy(a,b,c){var d,e,f,g,h,i,j,k,l;let m,n,o,p,q,r,s,t,u,v,w;return"element"===b.type?(d=a,e=b,f=c,n=m=d.schema,"svg"===e.tagName.toLowerCase()&&"html"===m.space&&(d.schema=vf),d.ancestors.push(e),o=vC(d,e.tagName,!1),p=function(a,b){let c,d,e={};for(d in b.properties)if("children"!==d&&vs.call(b.properties,d)){let f=function(a,b,c){let d=u_(a.schema,b);if(!(null==c||"number"==typeof c&&Number.isNaN(c))){if(Array.isArray(c)&&(c=d.commaSeparated?uD(c):vh(c)),"style"===d.property){let b="object"==typeof c?c:function(a,b){try{return(0,vi.default)(b,{reactCompat:!0})}catch(c){if(a.ignoreInvalidStyle)return{};let b=new vr("Cannot parse `style` attribute",{ancestors:a.ancestors,cause:c,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw b.file=a.filePath||void 0,b.url=vx+"#cannot-parse-style-attribute",b}}(a,String(c));return"css"===a.stylePropertyNameCase&&(b=function(a){let b,c={};for(b in a)vs.call(a,b)&&(c[function(a){let b=a.replace(vu,vE);return"ms-"===b.slice(0,3)&&(b="-"+b),b}(b)]=a[b]);return c}(b)),["style",b]}return["react"===a.elementAttributeNameCase&&d.space?u2[d.property]||d.property:d.attribute,c]}}(a,d,b.properties[d]);if(f){let[d,g]=f;a.tableCellAlignToStyle&&"align"===d&&"string"==typeof g&&vw.has(b.tagName)?c=g:e[d]=g}}return c&&((e.style||(e.style={}))["css"===a.stylePropertyNameCase?"text-align":"textAlign"]=c),e}(d,e),q=vB(d,e),vv.has(e.tagName)&&(q=q.filter(function(a){return"string"!=typeof a||!("object"==typeof a?"text"===a.type&&uJ(a.value):uJ(a))})),vz(d,p,o,e),vA(p,q),d.ancestors.pop(),d.schema=m,d.create(e,o,p,f)):"mdxFlowExpression"===b.type||"mdxTextExpression"===b.type?function(a,b){if(b.data&&b.data.estree&&a.evaluater){let c=b.data.estree.body[0];return uA("ExpressionStatement"===c.type),a.evaluater.evaluateExpression(c.expression)}vD(a,b.position)}(a,b):"mdxJsxFlowElement"===b.type||"mdxJsxTextElement"===b.type?(g=a,h=b,i=c,s=r=g.schema,"svg"===h.name&&"html"===r.space&&(g.schema=vf),g.ancestors.push(h),t=null===h.name?g.Fragment:vC(g,h.name,!0),u=function(a,b){let c={};for(let d of b.attributes)if("mdxJsxExpressionAttribute"===d.type)if(d.data&&d.data.estree&&a.evaluater){let b=d.data.estree.body[0];uA("ExpressionStatement"===b.type);let e=b.expression;uA("ObjectExpression"===e.type);let f=e.properties[0];uA("SpreadElement"===f.type),Object.assign(c,a.evaluater.evaluateExpression(f.argument))}else vD(a,b.position);else{let e,f=d.name;if(d.value&&"object"==typeof d.value)if(d.value.data&&d.value.data.estree&&a.evaluater){let b=d.value.data.estree.body[0];uA("ExpressionStatement"===b.type),e=a.evaluater.evaluateExpression(b.expression)}else vD(a,b.position);else e=null===d.value||d.value;c[f]=e}return c}(g,h),v=vB(g,h),vz(g,u,t,h),vA(u,v),g.ancestors.pop(),g.schema=r,g.create(h,t,u,i)):"mdxjsEsm"===b.type?function(a,b){if(b.data&&b.data.estree&&a.evaluater)return a.evaluater.evaluateProgram(b.data.estree);vD(a,b.position)}(a,b):"root"===b.type?(j=a,k=b,l=c,vA(w={},vB(j,k)),j.create(k,j.Fragment,w,l)):"text"===b.type?b.value:void 0}function vz(a,b,c,d){"string"!=typeof c&&c!==a.Fragment&&a.passNode&&(b.node=d)}function vA(a,b){if(b.length>0){let c=b.length>1?b:b[0];c&&(a.children=c)}}function vB(a,b){let c=[],d=-1,e=a.passKeys?new Map:vt;for(;++d<b.children.length;){let f,g=b.children[d];if(a.passKeys){let a="element"===g.type?g.tagName:"mdxJsxFlowElement"===g.type||"mdxJsxTextElement"===g.type?g.name:void 0;if(a){let b=e.get(a)||0;f=a+"-"+b,e.set(a,b+1)}}let h=vy(a,g,f);void 0!==h&&c.push(h)}return c}function vC(a,b,c){let d;if(c)if(b.includes(".")){let a,c=b.split("."),e=-1;for(;++e<c.length;){let b=uH(c[e])?{type:"Identifier",name:c[e]}:{type:"Literal",value:c[e]};a=a?{type:"MemberExpression",object:a,property:b,computed:!!(e&&"Literal"===b.type),optional:!1}:b}uA(a,"always a result"),d=a}else d=uH(b)&&!/^[a-z]/.test(b)?{type:"Identifier",name:b}:{type:"Literal",value:b};else d={type:"Literal",value:b};if("Literal"===d.type){let b=d.value;return vs.call(a.components,b)?a.components[b]:b}if(a.evaluater)return a.evaluater.evaluateExpression(d);vD(a)}function vD(a,b){let c=new vr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:a.ancestors,place:b,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw c.file=a.filePath||void 0,c.url=vx+"#cannot-handle-mdx-estrees-without-createevaluater",c}function vE(a){return"-"+a.toLowerCase()}let vF={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vG={};function vH(a,b){let c=b||vG;return vI(a,"boolean"!=typeof c.includeImageAlt||c.includeImageAlt,"boolean"!=typeof c.includeHtml||c.includeHtml)}function vI(a,b,c){var d;if((d=a)&&"object"==typeof d){if("value"in a)return"html"!==a.type||c?a.value:"";if(b&&"alt"in a&&a.alt)return a.alt;if("children"in a)return vJ(a.children,b,c)}return Array.isArray(a)?vJ(a,b,c):""}function vJ(a,b,c){let d=[],e=-1;for(;++e<a.length;)d[e]=vI(a[e],b,c);return d.join("")}function vK(a,b,c,d){let e,f=a.length,g=0;if(b=b<0?-b>f?0:f+b:b>f?f:b,c=c>0?c:0,d.length<1e4)(e=Array.from(d)).unshift(b,c),a.splice(...e);else for(c&&a.splice(b,c);g<d.length;)(e=d.slice(g,g+1e4)).unshift(b,0),a.splice(...e),g+=1e4,b+=1e4}function vL(a,b){return a.length>0?(vK(a,a.length,0,b),a):b}let vM={}.hasOwnProperty;function vN(a){let b={},c=-1;for(;++c<a.length;)!function(a,b){let c;for(c in b){let d,e=(vM.call(a,c)?a[c]:void 0)||(a[c]={}),f=b[c];if(f)for(d in f){vM.call(e,d)||(e[d]=[]);let a=f[d];!function(a,b){let c=-1,d=[];for(;++c<b.length;)("after"===b[c].add?a:d).push(b[c]);vK(a,0,0,d)}(e[d],Array.isArray(a)?a:a?[a]:[])}}}(b,a[c]);return b}let vO=v$(/[A-Za-z]/),vP=v$(/[\dA-Za-z]/),vQ=v$(/[#-'*+\--9=?A-Z^-~]/);function vR(a){return null!==a&&(a<32||127===a)}let vS=v$(/\d/),vT=v$(/[\dA-Fa-f]/),vU=v$(/[!-/:-@[-`{-~]/);function vV(a){return null!==a&&a<-2}function vW(a){return null!==a&&(a<0||32===a)}function vX(a){return -2===a||-1===a||32===a}let vY=v$(/\p{P}|\p{S}/u),vZ=v$(/\s/);function v$(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function v_(a,b,c,d){let e=d?d-1:1/0,f=0;return function(d){return vX(d)?(a.enter(c),function d(g){return vX(g)&&f++<e?(a.consume(g),d):(a.exit(c),b(g))}(d)):b(d)}}let v0={tokenize:function(a){let b,c=a.attempt(this.parser.constructs.contentInitial,function(b){return null===b?void a.consume(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),v_(a,c,"linePrefix"))},function(c){return a.enter("paragraph"),function c(d){let e=a.enter("chunkText",{contentType:"text",previous:b});return b&&(b.next=e),b=e,function b(d){if(null===d){a.exit("chunkText"),a.exit("paragraph"),a.consume(d);return}return vV(d)?(a.consume(d),a.exit("chunkText"),c):(a.consume(d),b)}(d)}(c)});return c}},v1={tokenize:function(a){let b,c,d,e=this,f=[],g=0;return h;function h(b){if(g<f.length){let c=f[g];return e.containerState=c[1],a.attempt(c[0].continuation,i,j)(b)}return j(b)}function i(a){if(g++,e.containerState._closeFlow){let c;e.containerState._closeFlow=void 0,b&&r();let d=e.events.length,f=d;for(;f--;)if("exit"===e.events[f][0]&&"chunkFlow"===e.events[f][1].type){c=e.events[f][1].end;break}q(g);let h=d;for(;h<e.events.length;)e.events[h][1].end={...c},h++;return vK(e.events,f+1,0,e.events.slice(d)),e.events.length=h,j(a)}return h(a)}function j(c){if(g===f.length){if(!b)return m(c);if(b.currentConstruct&&b.currentConstruct.concrete)return o(c);e.interrupt=!!(b.currentConstruct&&!b._gfmTableDynamicInterruptHack)}return e.containerState={},a.check(v2,k,l)(c)}function k(a){return b&&r(),q(g),m(a)}function l(a){return e.parser.lazy[e.now().line]=g!==f.length,d=e.now().offset,o(a)}function m(b){return e.containerState={},a.attempt(v2,n,o)(b)}function n(a){return g++,f.push([e.currentConstruct,e.containerState]),m(a)}function o(d){if(null===d){b&&r(),q(0),a.consume(d);return}return b=b||e.parser.flow(e.now()),a.enter("chunkFlow",{_tokenizer:b,contentType:"flow",previous:c}),function b(c){if(null===c){p(a.exit("chunkFlow"),!0),q(0),a.consume(c);return}return vV(c)?(a.consume(c),p(a.exit("chunkFlow")),g=0,e.interrupt=void 0,h):(a.consume(c),b)}(d)}function p(a,f){let h=e.sliceStream(a);if(f&&h.push(null),a.previous=c,c&&(c.next=a),c=a,b.defineSkip(a.start),b.write(h),e.parser.lazy[a.start.line]){let a,c,f=b.events.length;for(;f--;)if(b.events[f][1].start.offset<d&&(!b.events[f][1].end||b.events[f][1].end.offset>d))return;let h=e.events.length,i=h;for(;i--;)if("exit"===e.events[i][0]&&"chunkFlow"===e.events[i][1].type){if(a){c=e.events[i][1].end;break}a=!0}for(q(g),f=h;f<e.events.length;)e.events[f][1].end={...c},f++;vK(e.events,i+1,0,e.events.slice(h)),e.events.length=f}}function q(b){let c=f.length;for(;c-- >b;){let b=f[c];e.containerState=b[1],b[0].exit.call(e,a)}f.length=b}function r(){b.write([null]),c=void 0,b=void 0,e.containerState._closeFlow=void 0}}},v2={tokenize:function(a,b,c){return v_(a,a.attempt(this.parser.constructs.document,b,c),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},v3={partial:!0,tokenize:function(a,b,c){return function(b){return vX(b)?v_(a,d,"linePrefix")(b):d(b)};function d(a){return null===a||vV(a)?b(a):c(a)}}};class v4{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,b){let c=null==b?1/0:b;return c<this.left.length?this.left.slice(a,c):a>this.left.length?this.right.slice(this.right.length-c+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-c+this.left.length).reverse())}splice(a,b,c){this.setCursor(Math.trunc(a));let d=this.right.splice(this.right.length-(b||0),1/0);return c&&v5(this.left,c),d.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(a){this.setCursor(1/0),this.left.push(a)}pushMany(a){this.setCursor(1/0),v5(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),v5(this.right,a.reverse())}setCursor(a){if(a!==this.left.length&&(!(a>this.left.length)||0!==this.right.length)&&(!(a<0)||0!==this.left.length))if(a<this.left.length){let b=this.left.splice(a,1/0);v5(this.right,b.reverse())}else{let b=this.right.splice(this.left.length+this.right.length-a,1/0);v5(this.left,b.reverse())}}}function v5(a,b){let c=0;if(b.length<1e4)a.push(...b);else for(;c<b.length;)a.push(...b.slice(c,c+1e4)),c+=1e4}function v6(a){let b,c,d,e,f,g,h,i={},j=-1,k=new v4(a);for(;++j<k.length;){for(;j in i;)j=i[j];if(b=k.get(j),j&&"chunkFlow"===b[1].type&&"listItemPrefix"===k.get(j-1)[1].type&&((d=0)<(g=b[1]._tokenizer.events).length&&"lineEndingBlank"===g[d][1].type&&(d+=2),d<g.length&&"content"===g[d][1].type))for(;++d<g.length&&"content"!==g[d][1].type;)"chunkText"===g[d][1].type&&(g[d][1]._isInFirstContentOfListItem=!0,d++);if("enter"===b[0])b[1].contentType&&(Object.assign(i,function(a,b){let c,d,e=a.get(b)[1],f=a.get(b)[2],g=b-1,h=[],i=e._tokenizer;!i&&(i=f.parser[e.contentType](e.start),e._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let j=i.events,k=[],l={},m=-1,n=e,o=0,p=0,q=[0];for(;n;){for(;a.get(++g)[1]!==n;);h.push(g),!n._tokenizer&&(c=f.sliceStream(n),n.next||c.push(null),d&&i.defineSkip(n.start),n._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),n._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=n,n=n.next}for(n=e;++m<j.length;)"exit"===j[m][0]&&"enter"===j[m-1][0]&&j[m][1].type===j[m-1][1].type&&j[m][1].start.line!==j[m][1].end.line&&(p=m+1,q.push(p),n._tokenizer=void 0,n.previous=void 0,n=n.next);for(i.events=[],n?(n._tokenizer=void 0,n.previous=void 0):q.pop(),m=q.length;m--;){let b=j.slice(q[m],q[m+1]),c=h.pop();k.push([c,c+b.length-1]),a.splice(c,2,b)}for(k.reverse(),m=-1;++m<k.length;)l[o+k[m][0]]=o+k[m][1],o+=k[m][1]-k[m][0]-1;return l}(k,j)),j=i[j],h=!0);else if(b[1]._container){for(d=j,c=void 0;d--;)if("lineEnding"===(e=k.get(d))[1].type||"lineEndingBlank"===e[1].type)"enter"===e[0]&&(c&&(k.get(c)[1].type="lineEndingBlank"),e[1].type="lineEnding",c=d);else if("linePrefix"===e[1].type||"listItemIndent"===e[1].type);else break;c&&(b[1].end={...k.get(c)[1].start},(f=k.slice(c,j)).unshift(b),k.splice(c,j-c+1,f))}}return vK(a,0,1/0,k.slice(0)),!h}let v7={resolve:function(a){return v6(a),a},tokenize:function(a,b){let c;return function(b){return a.enter("content"),c=a.enter("chunkContent",{contentType:"content"}),d(b)};function d(b){return null===b?e(b):vV(b)?a.check(v8,f,e)(b):(a.consume(b),d)}function e(c){return a.exit("chunkContent"),a.exit("content"),b(c)}function f(b){return a.consume(b),a.exit("chunkContent"),c.next=a.enter("chunkContent",{contentType:"content",previous:c}),c=c.next,d}}},v8={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return a.exit("chunkContent"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),v_(a,e,"linePrefix")};function e(e){if(null===e||vV(e))return c(e);let f=d.events[d.events.length-1];return!d.parser.constructs.disable.null.includes("codeIndented")&&f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(e):a.interrupt(d.parser.constructs.flow,c,b)(e)}}},v9={tokenize:function(a){let b=this,c=a.attempt(v3,function(d){return null===d?void a.consume(d):(a.enter("lineEndingBlank"),a.consume(d),a.exit("lineEndingBlank"),b.currentConstruct=void 0,c)},a.attempt(this.parser.constructs.flowInitial,d,v_(a,a.attempt(this.parser.constructs.flow,d,a.attempt(v7,d)),"linePrefix")));return c;function d(d){return null===d?void a.consume(d):(a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),b.currentConstruct=void 0,c)}}},wa={resolveAll:we()},wb=wd("string"),wc=wd("text");function wd(a){return{resolveAll:we("text"===a?wf:void 0),tokenize:function(b){let c=this,d=this.parser.constructs[a],e=b.attempt(d,f,g);return f;function f(a){return i(a)?e(a):g(a)}function g(a){return null===a?void b.consume(a):(b.enter("data"),b.consume(a),h)}function h(a){return i(a)?(b.exit("data"),e(a)):(b.consume(a),h)}function i(a){if(null===a)return!0;let b=d[a],e=-1;if(b)for(;++e<b.length;){let a=b[e];if(!a.previous||a.previous.call(c,c.previous))return!0}return!1}}}}function we(a){return function(b,c){let d,e=-1;for(;++e<=b.length;)void 0===d?b[e]&&"data"===b[e][1].type&&(d=e,e++):b[e]&&"data"===b[e][1].type||(e!==d+2&&(b[d][1].end=b[e-1][1].end,b.splice(d+2,e-d-2),e=d+2),d=void 0);return a?a(b,c):b}}function wf(a,b){let c=0;for(;++c<=a.length;)if((c===a.length||"lineEnding"===a[c][1].type)&&"data"===a[c-1][1].type){let d,e=a[c-1][1],f=b.sliceStream(e),g=f.length,h=-1,i=0;for(;g--;){let a=f[g];if("string"==typeof a){for(h=a.length;32===a.charCodeAt(h-1);)i++,h--;if(h)break;h=-1}else if(-2===a)d=!0,i++;else if(-1===a);else{g++;break}}if(b._contentTypeTextTrailing&&c===a.length&&(i=0),i){let f={type:c===a.length||d||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:g?h:e.start._bufferIndex+h,_index:e.start._index+g,line:e.end.line,column:e.end.column-i,offset:e.end.offset-i},end:{...e.end}};e.end={...f.start},e.start.offset===e.end.offset?Object.assign(e,f):(a.splice(c,0,["enter",f,b],["exit",f,b]),c+=2)}c++}return a}function wg(a){return null===a||vW(a)||vZ(a)?1:vY(a)?2:void 0}function wh(a,b,c){let d=[],e=-1;for(;++e<a.length;){let f=a[e].resolveAll;f&&!d.includes(f)&&(b=f(b,c),d.push(f))}return b}let wi={name:"attention",resolveAll:function(a,b){let c,d,e,f,g,h,i,j,k=-1;for(;++k<a.length;)if("enter"===a[k][0]&&"attentionSequence"===a[k][1].type&&a[k][1]._close){for(c=k;c--;)if("exit"===a[c][0]&&"attentionSequence"===a[c][1].type&&a[c][1]._open&&b.sliceSerialize(a[c][1]).charCodeAt(0)===b.sliceSerialize(a[k][1]).charCodeAt(0)){if((a[c][1]._close||a[k][1]._open)&&(a[k][1].end.offset-a[k][1].start.offset)%3&&!((a[c][1].end.offset-a[c][1].start.offset+a[k][1].end.offset-a[k][1].start.offset)%3))continue;h=a[c][1].end.offset-a[c][1].start.offset>1&&a[k][1].end.offset-a[k][1].start.offset>1?2:1;let l={...a[c][1].end},m={...a[k][1].start};wj(l,-h),wj(m,h),f={type:h>1?"strongSequence":"emphasisSequence",start:l,end:{...a[c][1].end}},g={type:h>1?"strongSequence":"emphasisSequence",start:{...a[k][1].start},end:m},e={type:h>1?"strongText":"emphasisText",start:{...a[c][1].end},end:{...a[k][1].start}},d={type:h>1?"strong":"emphasis",start:{...f.start},end:{...g.end}},a[c][1].end={...f.start},a[k][1].start={...g.end},i=[],a[c][1].end.offset-a[c][1].start.offset&&(i=vL(i,[["enter",a[c][1],b],["exit",a[c][1],b]])),i=vL(i,[["enter",d,b],["enter",f,b],["exit",f,b],["enter",e,b]]),i=vL(i,wh(b.parser.constructs.insideSpan.null,a.slice(c+1,k),b)),i=vL(i,[["exit",e,b],["enter",g,b],["exit",g,b],["exit",d,b]]),a[k][1].end.offset-a[k][1].start.offset?(j=2,i=vL(i,[["enter",a[k][1],b],["exit",a[k][1],b]])):j=0,vK(a,c-1,k-c+3,i),k=c+i.length-j-2;break}}for(k=-1;++k<a.length;)"attentionSequence"===a[k][1].type&&(a[k][1].type="data");return a},tokenize:function(a,b){let c,d=this.parser.constructs.attentionMarkers.null,e=this.previous,f=wg(e);return function(g){return c=g,a.enter("attentionSequence"),function g(h){if(h===c)return a.consume(h),g;let i=a.exit("attentionSequence"),j=wg(h),k=!j||2===j&&f||d.includes(h),l=!f||2===f&&j||d.includes(e);return i._open=!!(42===c?k:k&&(f||!l)),i._close=!!(42===c?l:l&&(j||!k)),b(h)}(g)}}};function wj(a,b){a.column+=b,a.offset+=b,a._bufferIndex+=b}let wk={continuation:{tokenize:function(a,b,c){let d=this;return function(b){return vX(b)?v_(a,e,"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):e(b)};function e(d){return a.attempt(wk,b,c)(d)}}},exit:function(a){a.exit("blockQuote")},name:"blockQuote",tokenize:function(a,b,c){let d=this;return function(b){if(62===b){let c=d.containerState;return c.open||(a.enter("blockQuote",{_container:!0}),c.open=!0),a.enter("blockQuotePrefix"),a.enter("blockQuoteMarker"),a.consume(b),a.exit("blockQuoteMarker"),e}return c(b)};function e(c){return vX(c)?(a.enter("blockQuotePrefixWhitespace"),a.consume(c),a.exit("blockQuotePrefixWhitespace"),a.exit("blockQuotePrefix"),b):(a.exit("blockQuotePrefix"),b(c))}}},wl={name:"characterEscape",tokenize:function(a,b,c){return function(b){return a.enter("characterEscape"),a.enter("escapeMarker"),a.consume(b),a.exit("escapeMarker"),d};function d(d){return vU(d)?(a.enter("characterEscapeValue"),a.consume(d),a.exit("characterEscapeValue"),a.exit("characterEscape"),b):c(d)}}},wm={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},wn={}.hasOwnProperty;function wo(a){return!!wn.call(wm,a)&&wm[a]}let wp={name:"characterReference",tokenize:function(a,b,c){let d,e,f=this,g=0;return function(b){return a.enter("characterReference"),a.enter("characterReferenceMarker"),a.consume(b),a.exit("characterReferenceMarker"),h};function h(b){return 35===b?(a.enter("characterReferenceMarkerNumeric"),a.consume(b),a.exit("characterReferenceMarkerNumeric"),i):(a.enter("characterReferenceValue"),d=31,e=vP,j(b))}function i(b){return 88===b||120===b?(a.enter("characterReferenceMarkerHexadecimal"),a.consume(b),a.exit("characterReferenceMarkerHexadecimal"),a.enter("characterReferenceValue"),d=6,e=vT,j):(a.enter("characterReferenceValue"),d=7,e=vS,j(b))}function j(h){if(59===h&&g){let d=a.exit("characterReferenceValue");return e!==vP||wo(f.sliceSerialize(d))?(a.enter("characterReferenceMarker"),a.consume(h),a.exit("characterReferenceMarker"),a.exit("characterReference"),b):c(h)}return e(h)&&g++<d?(a.consume(h),j):c(h)}}},wq={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return null===b?c(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},wr={concrete:!0,name:"codeFenced",tokenize:function(a,b,c){let d,e=this,f={partial:!0,tokenize:function(a,b,c){let f=0;return function(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),g};function g(b){return a.enter("codeFencedFence"),vX(b)?v_(a,i,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):i(b)}function i(b){return b===d?(a.enter("codeFencedFenceSequence"),function b(e){return e===d?(f++,a.consume(e),b):f>=h?(a.exit("codeFencedFenceSequence"),vX(e)?v_(a,j,"whitespace")(e):j(e)):c(e)}(b)):c(b)}function j(d){return null===d||vV(d)?(a.exit("codeFencedFence"),b(d)):c(d)}}},g=0,h=0;return function(b){var f;let j;return f=b,g=(j=e.events[e.events.length-1])&&"linePrefix"===j[1].type?j[2].sliceSerialize(j[1],!0).length:0,d=f,a.enter("codeFenced"),a.enter("codeFencedFence"),a.enter("codeFencedFenceSequence"),function b(e){return e===d?(h++,a.consume(e),b):h<3?c(e):(a.exit("codeFencedFenceSequence"),vX(e)?v_(a,i,"whitespace")(e):i(e))}(f)};function i(f){return null===f||vV(f)?(a.exit("codeFencedFence"),e.interrupt?b(f):a.check(wq,k,o)(f)):(a.enter("codeFencedFenceInfo"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||vV(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),i(e)):vX(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),v_(a,j,"whitespace")(e)):96===e&&e===d?c(e):(a.consume(e),b)}(f))}function j(b){return null===b||vV(b)?i(b):(a.enter("codeFencedFenceMeta"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||vV(e)?(a.exit("chunkString"),a.exit("codeFencedFenceMeta"),i(e)):96===e&&e===d?c(e):(a.consume(e),b)}(b))}function k(b){return a.attempt(f,o,l)(b)}function l(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m}function m(b){return g>0&&vX(b)?v_(a,n,"linePrefix",g+1)(b):n(b)}function n(b){return null===b||vV(b)?a.check(wq,k,o)(b):(a.enter("codeFlowValue"),function b(c){return null===c||vV(c)?(a.exit("codeFlowValue"),n(c)):(a.consume(c),b)}(b))}function o(c){return a.exit("codeFenced"),b(c)}}},ws={name:"codeIndented",tokenize:function(a,b,c){let d=this;return function(b){return a.enter("codeIndented"),v_(a,e,"linePrefix",5)(b)};function e(b){let e=d.events[d.events.length-1];return e&&"linePrefix"===e[1].type&&e[2].sliceSerialize(e[1],!0).length>=4?function b(c){return null===c?f(c):vV(c)?a.attempt(wt,b,f)(c):(a.enter("codeFlowValue"),function c(d){return null===d||vV(d)?(a.exit("codeFlowValue"),b(d)):(a.consume(d),c)}(c))}(b):c(b)}function f(c){return a.exit("codeIndented"),b(c)}}},wt={partial:!0,tokenize:function(a,b,c){let d=this;return e;function e(b){return d.parser.lazy[d.now().line]?c(b):vV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):v_(a,f,"linePrefix",5)(b)}function f(a){let f=d.events[d.events.length-1];return f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(a):vV(a)?e(a):c(a)}}};function wu(a,b,c,d,e,f,g,h,i){let j=i||1/0,k=0;return function(b){return 60===b?(a.enter(d),a.enter(e),a.enter(f),a.consume(b),a.exit(f),l):null===b||32===b||41===b||vR(b)?c(b):(a.enter(d),a.enter(g),a.enter(h),a.enter("chunkString",{contentType:"string"}),o(b))};function l(c){return 62===c?(a.enter(f),a.consume(c),a.exit(f),a.exit(e),a.exit(d),b):(a.enter(h),a.enter("chunkString",{contentType:"string"}),m(c))}function m(b){return 62===b?(a.exit("chunkString"),a.exit(h),l(b)):null===b||60===b||vV(b)?c(b):(a.consume(b),92===b?n:m)}function n(b){return 60===b||62===b||92===b?(a.consume(b),m):m(b)}function o(e){return!k&&(null===e||41===e||vW(e))?(a.exit("chunkString"),a.exit(h),a.exit(g),a.exit(d),b(e)):k<j&&40===e?(a.consume(e),k++,o):41===e?(a.consume(e),k--,o):null===e||32===e||40===e||vR(e)?c(e):(a.consume(e),92===e?p:o)}function p(b){return 40===b||41===b||92===b?(a.consume(b),o):o(b)}}function wv(a,b,c,d,e,f){let g,h=this,i=0;return function(b){return a.enter(d),a.enter(e),a.consume(b),a.exit(e),a.enter(f),j};function j(l){return i>999||null===l||91===l||93===l&&!g||94===l&&!i&&"_hiddenFootnoteSupport"in h.parser.constructs?c(l):93===l?(a.exit(f),a.enter(e),a.consume(l),a.exit(e),a.exit(d),b):vV(l)?(a.enter("lineEnding"),a.consume(l),a.exit("lineEnding"),j):(a.enter("chunkString",{contentType:"string"}),k(l))}function k(b){return null===b||91===b||93===b||vV(b)||i++>999?(a.exit("chunkString"),j(b)):(a.consume(b),g||(g=!vX(b)),92===b?l:k)}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}}function ww(a,b,c,d,e,f){let g;return function(b){return 34===b||39===b||40===b?(a.enter(d),a.enter(e),a.consume(b),a.exit(e),g=40===b?41:b,h):c(b)};function h(c){return c===g?(a.enter(e),a.consume(c),a.exit(e),a.exit(d),b):(a.enter(f),i(c))}function i(b){return b===g?(a.exit(f),h(g)):null===b?c(b):vV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),v_(a,i,"linePrefix")):(a.enter("chunkString",{contentType:"string"}),j(b))}function j(b){return b===g||null===b||vV(b)?(a.exit("chunkString"),i(b)):(a.consume(b),92===b?k:j)}function k(b){return b===g||92===b?(a.consume(b),j):j(b)}}function wx(a,b){let c;return function d(e){return vV(e)?(a.enter("lineEnding"),a.consume(e),a.exit("lineEnding"),c=!0,d):vX(e)?v_(a,d,c?"linePrefix":"lineSuffix")(e):b(e)}}function wy(a){return a.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let wz={partial:!0,tokenize:function(a,b,c){return function(b){return vW(b)?wx(a,d)(b):c(b)};function d(b){return ww(a,e,c,"definitionTitle","definitionTitleMarker","definitionTitleString")(b)}function e(b){return vX(b)?v_(a,f,"whitespace")(b):f(b)}function f(a){return null===a||vV(a)?b(a):c(a)}}},wA=["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"],wB=["pre","script","style","textarea"],wC={partial:!0,tokenize:function(a,b,c){return function(d){return a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),a.attempt(v3,b,c)}}},wD={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return vV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):c(b)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},wE={name:"labelEnd",resolveAll:function(a){let b=-1,c=[];for(;++b<a.length;){let d=a[b][1];if(c.push(a[b]),"labelImage"===d.type||"labelLink"===d.type||"labelEnd"===d.type){let a="labelImage"===d.type?4:2;d.type="data",b+=a}}return a.length!==c.length&&vK(a,0,a.length,c),a},resolveTo:function(a,b){let c,d,e,f,g=a.length,h=0;for(;g--;)if(c=a[g][1],d){if("link"===c.type||"labelLink"===c.type&&c._inactive)break;"enter"===a[g][0]&&"labelLink"===c.type&&(c._inactive=!0)}else if(e){if("enter"===a[g][0]&&("labelImage"===c.type||"labelLink"===c.type)&&!c._balanced&&(d=g,"labelLink"!==c.type)){h=2;break}}else"labelEnd"===c.type&&(e=g);let i={type:"labelLink"===a[d][1].type?"link":"image",start:{...a[d][1].start},end:{...a[a.length-1][1].end}},j={type:"label",start:{...a[d][1].start},end:{...a[e][1].end}},k={type:"labelText",start:{...a[d+h+2][1].end},end:{...a[e-2][1].start}};return f=vL(f=[["enter",i,b],["enter",j,b]],a.slice(d+1,d+h+3)),f=vL(f,[["enter",k,b]]),f=vL(f,wh(b.parser.constructs.insideSpan.null,a.slice(d+h+4,e-3),b)),f=vL(f,[["exit",k,b],a[e-2],a[e-1],["exit",j,b]]),f=vL(f,a.slice(e+1)),f=vL(f,[["exit",i,b]]),vK(a,d,a.length,f),a},tokenize:function(a,b,c){let d,e,f=this,g=f.events.length;for(;g--;)if(("labelImage"===f.events[g][1].type||"labelLink"===f.events[g][1].type)&&!f.events[g][1]._balanced){d=f.events[g][1];break}return function(b){return d?d._inactive?k(b):(e=f.parser.defined.includes(wy(f.sliceSerialize({start:d.end,end:f.now()}))),a.enter("labelEnd"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelEnd"),h):c(b)};function h(b){return 40===b?a.attempt(wF,j,e?j:k)(b):91===b?a.attempt(wG,j,e?i:k)(b):e?j(b):k(b)}function i(b){return a.attempt(wH,j,k)(b)}function j(a){return b(a)}function k(a){return d._balanced=!0,c(a)}}},wF={tokenize:function(a,b,c){return function(b){return a.enter("resource"),a.enter("resourceMarker"),a.consume(b),a.exit("resourceMarker"),d};function d(b){return vW(b)?wx(a,e)(b):e(b)}function e(b){return 41===b?j(b):wu(a,f,g,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function f(b){return vW(b)?wx(a,h)(b):j(b)}function g(a){return c(a)}function h(b){return 34===b||39===b||40===b?ww(a,i,c,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):j(b)}function i(b){return vW(b)?wx(a,j)(b):j(b)}function j(d){return 41===d?(a.enter("resourceMarker"),a.consume(d),a.exit("resourceMarker"),a.exit("resource"),b):c(d)}}},wG={tokenize:function(a,b,c){let d=this;return function(b){return wv.call(d,a,e,f,"reference","referenceMarker","referenceString")(b)};function e(a){return d.parser.defined.includes(wy(d.sliceSerialize(d.events[d.events.length-1][1]).slice(1,-1)))?b(a):c(a)}function f(a){return c(a)}}},wH={tokenize:function(a,b,c){return function(b){return a.enter("reference"),a.enter("referenceMarker"),a.consume(b),a.exit("referenceMarker"),d};function d(d){return 93===d?(a.enter("referenceMarker"),a.consume(d),a.exit("referenceMarker"),a.exit("reference"),b):c(d)}}},wI={name:"labelStartImage",resolveAll:wE.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelImage"),a.enter("labelImageMarker"),a.consume(b),a.exit("labelImageMarker"),e};function e(b){return 91===b?(a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelImage"),f):c(b)}function f(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},wJ={name:"labelStartLink",resolveAll:wE.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelLink"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelLink"),e};function e(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},wK={name:"lineEnding",tokenize:function(a,b){return function(c){return a.enter("lineEnding"),a.consume(c),a.exit("lineEnding"),v_(a,b,"linePrefix")}}},wL={name:"thematicBreak",tokenize:function(a,b,c){let d,e=0;return function(f){var g;return a.enter("thematicBreak"),d=g=f,function f(g){return g===d?(a.enter("thematicBreakSequence"),function b(c){return c===d?(a.consume(c),e++,b):(a.exit("thematicBreakSequence"),vX(c)?v_(a,f,"whitespace")(c):f(c))}(g)):e>=3&&(null===g||vV(g))?(a.exit("thematicBreak"),b(g)):c(g)}(g)}}},wM={continuation:{tokenize:function(a,b,c){let d=this;return d.containerState._closeFlow=void 0,a.check(v3,function(c){return d.containerState.furtherBlankLines=d.containerState.furtherBlankLines||d.containerState.initialBlankLine,v_(a,b,"listItemIndent",d.containerState.size+1)(c)},function(c){return d.containerState.furtherBlankLines||!vX(c)?(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,e(c)):(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,a.attempt(wO,b,e)(c))});function e(e){return d.containerState._closeFlow=!0,d.interrupt=void 0,v_(a,a.attempt(wM,b,c),"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(e)}}},exit:function(a){a.exit(this.containerState.type)},name:"list",tokenize:function(a,b,c){let d=this,e=d.events[d.events.length-1],f=e&&"linePrefix"===e[1].type?e[2].sliceSerialize(e[1],!0).length:0,g=0;return function(b){let e=d.containerState.type||(42===b||43===b||45===b?"listUnordered":"listOrdered");if("listUnordered"===e?!d.containerState.marker||b===d.containerState.marker:vS(b)){if(d.containerState.type||(d.containerState.type=e,a.enter(e,{_container:!0})),"listUnordered"===e)return a.enter("listItemPrefix"),42===b||45===b?a.check(wL,c,h)(b):h(b);if(!d.interrupt||49===b)return a.enter("listItemPrefix"),a.enter("listItemValue"),function b(e){return vS(e)&&++g<10?(a.consume(e),b):(!d.interrupt||g<2)&&(d.containerState.marker?e===d.containerState.marker:41===e||46===e)?(a.exit("listItemValue"),h(e)):c(e)}(b)}return c(b)};function h(b){return a.enter("listItemMarker"),a.consume(b),a.exit("listItemMarker"),d.containerState.marker=d.containerState.marker||b,a.check(v3,d.interrupt?c:i,a.attempt(wN,k,j))}function i(a){return d.containerState.initialBlankLine=!0,f++,k(a)}function j(b){return vX(b)?(a.enter("listItemPrefixWhitespace"),a.consume(b),a.exit("listItemPrefixWhitespace"),k):c(b)}function k(c){return d.containerState.size=f+d.sliceSerialize(a.exit("listItemPrefix"),!0).length,b(c)}}},wN={partial:!0,tokenize:function(a,b,c){let d=this;return v_(a,function(a){let e=d.events[d.events.length-1];return!vX(a)&&e&&"listItemPrefixWhitespace"===e[1].type?b(a):c(a)},"listItemPrefixWhitespace",d.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},wO={partial:!0,tokenize:function(a,b,c){let d=this;return v_(a,function(a){let e=d.events[d.events.length-1];return e&&"listItemIndent"===e[1].type&&e[2].sliceSerialize(e[1],!0).length===d.containerState.size?b(a):c(a)},"listItemIndent",d.containerState.size+1)}},wP={name:"setextUnderline",resolveTo:function(a,b){let c,d,e,f=a.length;for(;f--;)if("enter"===a[f][0]){if("content"===a[f][1].type){c=f;break}"paragraph"===a[f][1].type&&(d=f)}else"content"===a[f][1].type&&a.splice(f,1),e||"definition"!==a[f][1].type||(e=f);let g={type:"setextHeading",start:{...a[c][1].start},end:{...a[a.length-1][1].end}};return a[d][1].type="setextHeadingText",e?(a.splice(d,0,["enter",g,b]),a.splice(e+1,0,["exit",a[c][1],b]),a[c][1].end={...a[e][1].end}):a[c][1]=g,a.push(["exit",g,b]),a},tokenize:function(a,b,c){let d,e=this;return function(b){var g;let h,i=e.events.length;for(;i--;)if("lineEnding"!==e.events[i][1].type&&"linePrefix"!==e.events[i][1].type&&"content"!==e.events[i][1].type){h="paragraph"===e.events[i][1].type;break}return!e.parser.lazy[e.now().line]&&(e.interrupt||h)?(a.enter("setextHeadingLine"),d=b,g=b,a.enter("setextHeadingLineSequence"),function b(c){return c===d?(a.consume(c),b):(a.exit("setextHeadingLineSequence"),vX(c)?v_(a,f,"lineSuffix")(c):f(c))}(g)):c(b)};function f(d){return null===d||vV(d)?(a.exit("setextHeadingLine"),b(d)):c(d)}}};a.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(a,b,c){let d,e=this;return function(b){var d;return a.enter("definition"),d=b,wv.call(e,a,f,c,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)};function f(b){return(d=wy(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)),58===b)?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),g):c(b)}function g(b){return vW(b)?wx(a,h)(b):h(b)}function h(b){return wu(a,i,c,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function i(b){return a.attempt(wz,j,j)(b)}function j(b){return vX(b)?v_(a,k,"whitespace")(b):k(b)}function k(f){return null===f||vV(f)?(a.exit("definition"),e.parser.defined.push(d),b(f)):c(f)}}}},"disable",0,{null:[]},"document",0,{42:wM,43:wM,45:wM,48:wM,49:wM,50:wM,51:wM,52:wM,53:wM,54:wM,55:wM,56:wM,57:wM,62:wk},"flow",0,{35:{name:"headingAtx",resolve:function(a,b){let c,d,e=a.length-2,f=3;return"whitespace"===a[3][1].type&&(f+=2),e-2>f&&"whitespace"===a[e][1].type&&(e-=2),"atxHeadingSequence"===a[e][1].type&&(f===e-1||e-4>f&&"whitespace"===a[e-2][1].type)&&(e-=f+1===e?2:4),e>f&&(c={type:"atxHeadingText",start:a[f][1].start,end:a[e][1].end},d={type:"chunkText",start:a[f][1].start,end:a[e][1].end,contentType:"text"},vK(a,f,e-f+1,[["enter",c,b],["enter",d,b],["exit",d,b],["exit",c,b]])),a},tokenize:function(a,b,c){let d=0;return function(e){var f;return a.enter("atxHeading"),f=e,a.enter("atxHeadingSequence"),function e(f){return 35===f&&d++<6?(a.consume(f),e):null===f||vW(f)?(a.exit("atxHeadingSequence"),function c(d){return 35===d?(a.enter("atxHeadingSequence"),function b(d){return 35===d?(a.consume(d),b):(a.exit("atxHeadingSequence"),c(d))}(d)):null===d||vV(d)?(a.exit("atxHeading"),b(d)):vX(d)?v_(a,c,"whitespace")(d):(a.enter("atxHeadingText"),function b(d){return null===d||35===d||vW(d)?(a.exit("atxHeadingText"),c(d)):(a.consume(d),b)}(d))}(f)):c(f)}(f)}}},42:wL,45:[wP,wL],60:{concrete:!0,name:"htmlFlow",resolveTo:function(a){let b=a.length;for(;b--&&("enter"!==a[b][0]||"htmlFlow"!==a[b][1].type););return b>1&&"linePrefix"===a[b-2][1].type&&(a[b][1].start=a[b-2][1].start,a[b+1][1].start=a[b-2][1].start,a.splice(b-2,2)),a},tokenize:function(a,b,c){let d,e,f,g,h,i=this;return function(b){var c;return c=b,a.enter("htmlFlow"),a.enter("htmlFlowData"),a.consume(c),j};function j(g){return 33===g?(a.consume(g),k):47===g?(a.consume(g),e=!0,n):63===g?(a.consume(g),d=3,i.interrupt?b:G):vO(g)?(a.consume(g),f=String.fromCharCode(g),o):c(g)}function k(e){return 45===e?(a.consume(e),d=2,l):91===e?(a.consume(e),d=5,g=0,m):vO(e)?(a.consume(e),d=4,i.interrupt?b:G):c(e)}function l(d){return 45===d?(a.consume(d),i.interrupt?b:G):c(d)}function m(d){let e="CDATA[";return d===e.charCodeAt(g++)?(a.consume(d),g===e.length)?i.interrupt?b:y:m:c(d)}function n(b){return vO(b)?(a.consume(b),f=String.fromCharCode(b),o):c(b)}function o(g){if(null===g||47===g||62===g||vW(g)){let h=47===g,j=f.toLowerCase();return!h&&!e&&wB.includes(j)?(d=1,i.interrupt?b(g):y(g)):wA.includes(f.toLowerCase())?(d=6,h)?(a.consume(g),p):i.interrupt?b(g):y(g):(d=7,i.interrupt&&!i.parser.lazy[i.now().line]?c(g):e?function b(c){return vX(c)?(a.consume(c),b):w(c)}(g):q(g))}return 45===g||vP(g)?(a.consume(g),f+=String.fromCharCode(g),o):c(g)}function p(d){return 62===d?(a.consume(d),i.interrupt?b:y):c(d)}function q(b){return 47===b?(a.consume(b),w):58===b||95===b||vO(b)?(a.consume(b),r):vX(b)?(a.consume(b),q):w(b)}function r(b){return 45===b||46===b||58===b||95===b||vP(b)?(a.consume(b),r):s(b)}function s(b){return 61===b?(a.consume(b),t):vX(b)?(a.consume(b),s):q(b)}function t(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),h=b,u):vX(b)?(a.consume(b),t):function b(c){return null===c||34===c||39===c||47===c||60===c||61===c||62===c||96===c||vW(c)?s(c):(a.consume(c),b)}(b)}function u(b){return b===h?(a.consume(b),h=null,v):null===b||vV(b)?c(b):(a.consume(b),u)}function v(a){return 47===a||62===a||vX(a)?q(a):c(a)}function w(b){return 62===b?(a.consume(b),x):c(b)}function x(b){return null===b||vV(b)?y(b):vX(b)?(a.consume(b),x):c(b)}function y(b){return 45===b&&2===d?(a.consume(b),C):60===b&&1===d?(a.consume(b),D):62===b&&4===d?(a.consume(b),H):63===b&&3===d?(a.consume(b),G):93===b&&5===d?(a.consume(b),F):vV(b)&&(6===d||7===d)?(a.exit("htmlFlowData"),a.check(wC,I,z)(b)):null===b||vV(b)?(a.exit("htmlFlowData"),z(b)):(a.consume(b),y)}function z(b){return a.check(wD,A,I)(b)}function A(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),B}function B(b){return null===b||vV(b)?z(b):(a.enter("htmlFlowData"),y(b))}function C(b){return 45===b?(a.consume(b),G):y(b)}function D(b){return 47===b?(a.consume(b),f="",E):y(b)}function E(b){if(62===b){let c=f.toLowerCase();return wB.includes(c)?(a.consume(b),H):y(b)}return vO(b)&&f.length<8?(a.consume(b),f+=String.fromCharCode(b),E):y(b)}function F(b){return 93===b?(a.consume(b),G):y(b)}function G(b){return 62===b?(a.consume(b),H):45===b&&2===d?(a.consume(b),G):y(b)}function H(b){return null===b||vV(b)?(a.exit("htmlFlowData"),I(b)):(a.consume(b),H)}function I(c){return a.exit("htmlFlow"),b(c)}}},61:wP,95:wL,96:wr,126:wr},"flowInitial",0,{[-2]:ws,[-1]:ws,32:ws},"insideSpan",0,{null:[wi,wa]},"string",0,{38:wp,92:wl},"text",0,{[-5]:wK,[-4]:wK,[-3]:wK,33:wI,38:wp,42:wi,60:[{name:"autolink",tokenize:function(a,b,c){let d=0;return function(b){return a.enter("autolink"),a.enter("autolinkMarker"),a.consume(b),a.exit("autolinkMarker"),a.enter("autolinkProtocol"),e};function e(b){return vO(b)?(a.consume(b),f):64===b?c(b):h(b)}function f(b){return 43===b||45===b||46===b||vP(b)?(d=1,function b(c){return 58===c?(a.consume(c),d=0,g):(43===c||45===c||46===c||vP(c))&&d++<32?(a.consume(c),b):(d=0,h(c))}(b)):h(b)}function g(d){return 62===d?(a.exit("autolinkProtocol"),a.enter("autolinkMarker"),a.consume(d),a.exit("autolinkMarker"),a.exit("autolink"),b):null===d||32===d||60===d||vR(d)?c(d):(a.consume(d),g)}function h(b){return 64===b?(a.consume(b),i):vQ(b)?(a.consume(b),h):c(b)}function i(e){return vP(e)?function e(f){return 46===f?(a.consume(f),d=0,i):62===f?(a.exit("autolinkProtocol").type="autolinkEmail",a.enter("autolinkMarker"),a.consume(f),a.exit("autolinkMarker"),a.exit("autolink"),b):function b(f){if((45===f||vP(f))&&d++<63){let c=45===f?b:e;return a.consume(f),c}return c(f)}(f)}(e):c(e)}}},{name:"htmlText",tokenize:function(a,b,c){let d,e,f,g=this;return function(b){return a.enter("htmlText"),a.enter("htmlTextData"),a.consume(b),h};function h(b){return 33===b?(a.consume(b),i):47===b?(a.consume(b),u):63===b?(a.consume(b),s):vO(b)?(a.consume(b),w):c(b)}function i(b){return 45===b?(a.consume(b),j):91===b?(a.consume(b),e=0,n):vO(b)?(a.consume(b),r):c(b)}function j(b){return 45===b?(a.consume(b),m):c(b)}function k(b){return null===b?c(b):45===b?(a.consume(b),l):vV(b)?(f=k,E(b)):(a.consume(b),k)}function l(b){return 45===b?(a.consume(b),m):k(b)}function m(a){return 62===a?D(a):45===a?l(a):k(a)}function n(b){let d="CDATA[";return b===d.charCodeAt(e++)?(a.consume(b),e===d.length?o:n):c(b)}function o(b){return null===b?c(b):93===b?(a.consume(b),p):vV(b)?(f=o,E(b)):(a.consume(b),o)}function p(b){return 93===b?(a.consume(b),q):o(b)}function q(b){return 62===b?D(b):93===b?(a.consume(b),q):o(b)}function r(b){return null===b||62===b?D(b):vV(b)?(f=r,E(b)):(a.consume(b),r)}function s(b){return null===b?c(b):63===b?(a.consume(b),t):vV(b)?(f=s,E(b)):(a.consume(b),s)}function t(a){return 62===a?D(a):s(a)}function u(b){return vO(b)?(a.consume(b),v):c(b)}function v(b){return 45===b||vP(b)?(a.consume(b),v):function b(c){return vV(c)?(f=b,E(c)):vX(c)?(a.consume(c),b):D(c)}(b)}function w(b){return 45===b||vP(b)?(a.consume(b),w):47===b||62===b||vW(b)?x(b):c(b)}function x(b){return 47===b?(a.consume(b),D):58===b||95===b||vO(b)?(a.consume(b),y):vV(b)?(f=x,E(b)):vX(b)?(a.consume(b),x):D(b)}function y(b){return 45===b||46===b||58===b||95===b||vP(b)?(a.consume(b),y):function b(c){return 61===c?(a.consume(c),z):vV(c)?(f=b,E(c)):vX(c)?(a.consume(c),b):x(c)}(b)}function z(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),d=b,A):vV(b)?(f=z,E(b)):vX(b)?(a.consume(b),z):(a.consume(b),B)}function A(b){return b===d?(a.consume(b),d=void 0,C):null===b?c(b):vV(b)?(f=A,E(b)):(a.consume(b),A)}function B(b){return null===b||34===b||39===b||60===b||61===b||96===b?c(b):47===b||62===b||vW(b)?x(b):(a.consume(b),B)}function C(a){return 47===a||62===a||vW(a)?x(a):c(a)}function D(d){return 62===d?(a.consume(d),a.exit("htmlTextData"),a.exit("htmlText"),b):c(d)}function E(b){return a.exit("htmlTextData"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),F}function F(b){return vX(b)?v_(a,G,"linePrefix",g.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):G(b)}function G(b){return a.enter("htmlTextData"),f(b)}}}],91:wJ,92:[{name:"hardBreakEscape",tokenize:function(a,b,c){return function(b){return a.enter("hardBreakEscape"),a.consume(b),d};function d(d){return vV(d)?(a.exit("hardBreakEscape"),b(d)):c(d)}}},wl],93:wE,95:wi,96:{name:"codeText",previous:function(a){return 96!==a||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(a){let b,c,d=a.length-4,e=3;if(("lineEnding"===a[3][1].type||"space"===a[e][1].type)&&("lineEnding"===a[d][1].type||"space"===a[d][1].type)){for(b=e;++b<d;)if("codeTextData"===a[b][1].type){a[e][1].type="codeTextPadding",a[d][1].type="codeTextPadding",e+=2,d-=2;break}}for(b=e-1,d++;++b<=d;)void 0===c?b!==d&&"lineEnding"!==a[b][1].type&&(c=b):(b===d||"lineEnding"===a[b][1].type)&&(a[c][1].type="codeTextData",b!==c+2&&(a[c][1].end=a[b-1][1].end,a.splice(c+2,b-c-2),d-=b-c-2,b=c+2),c=void 0);return a},tokenize:function(a,b,c){let d,e,f=0;return function(b){return a.enter("codeText"),a.enter("codeTextSequence"),function b(c){return 96===c?(a.consume(c),f++,b):(a.exit("codeTextSequence"),g(c))}(b)};function g(i){return null===i?c(i):32===i?(a.enter("space"),a.consume(i),a.exit("space"),g):96===i?(e=a.enter("codeTextSequence"),d=0,function c(g){return 96===g?(a.consume(g),d++,c):d===f?(a.exit("codeTextSequence"),a.exit("codeText"),b(g)):(e.type="codeTextData",h(g))}(i)):vV(i)?(a.enter("lineEnding"),a.consume(i),a.exit("lineEnding"),g):(a.enter("codeTextData"),h(i))}function h(b){return null===b||32===b||96===b||vV(b)?(a.exit("codeTextData"),g(b)):(a.consume(b),h)}}}}],248293);var wQ=a.i(248293);let wR=/[\0\t\n\r]/g;function wS(a,b){let c=Number.parseInt(a,b);return c<9||11===c||c>13&&c<32||c>126&&c<160||c>55295&&c<57344||c>64975&&c<65008||(65535&c)==65535||(65535&c)==65534||c>1114111?"�":String.fromCodePoint(c)}let wT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wU(a,b,c){if(b)return b;if(35===c.charCodeAt(0)){let a=c.charCodeAt(1),b=120===a||88===a;return wS(c.slice(b?2:1),b?16:10)}return wo(c)||a}let wV={}.hasOwnProperty;function wW(a){return{line:a.line,column:a.column,offset:a.offset}}function wX(a,b){if(a)throw Error("Cannot close `"+a.type+"` ("+vn({start:a.start,end:a.end})+"): a different token (`"+b.type+"`, "+vn({start:b.start,end:b.end})+") is open");throw Error("Cannot close document, a token (`"+b.type+"`, "+vn({start:b.start,end:b.end})+") is still open")}function wY(a){let b=this;b.parser=function(c){var d,e;let f,g,h,i;return"object"==typeof(d={...b.data("settings"),...a,extensions:b.data("micromarkExtensions")||[],mdastExtensions:b.data("fromMarkdownExtensions")||[]})&&(e=d,d=void 0),(function(a){let b={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(r),autolinkProtocol:j,autolinkEmail:j,atxHeading:d(o),blockQuote:d(function(){return{type:"blockquote",children:[]}}),characterEscape:j,characterReference:j,codeFenced:d(n),codeFencedFenceInfo:e,codeFencedFenceMeta:e,codeIndented:d(n,e),codeText:d(function(){return{type:"inlineCode",value:""}},e),codeTextData:j,data:j,codeFlowValue:j,definition:d(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:e,definitionLabelString:e,definitionTitleString:e,emphasis:d(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:d(p),hardBreakTrailing:d(p),htmlFlow:d(q,e),htmlFlowData:j,htmlText:d(q,e),htmlTextData:j,image:d(function(){return{type:"image",title:null,url:"",alt:null}}),label:e,link:d(r),listItem:d(function(a){return{type:"listItem",spread:a._spread,checked:null,children:[]}}),listItemValue:function(a){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(a),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:d(s,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:d(s),paragraph:d(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:e,resourceDestinationString:e,resourceTitleString:e,setextHeading:d(o),strong:d(function(){return{type:"strong",children:[]}}),thematicBreak:d(function(){return{type:"thematicBreak"}})},exit:{atxHeading:g(),atxHeadingSequence:function(a){let b=this.stack[this.stack.length-1];b.depth||(b.depth=this.sliceSerialize(a).length)},autolink:g(),autolinkEmail:function(a){k.call(this,a),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(a)},autolinkProtocol:function(a){k.call(this,a),this.stack[this.stack.length-1].url=this.sliceSerialize(a)},blockQuote:g(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(a){let b,c=this.sliceSerialize(a),d=this.data.characterReferenceType;d?(b=wS(c,"characterReferenceMarkerNumeric"===d?10:16),this.data.characterReferenceType=void 0):b=wo(c);let e=this.stack[this.stack.length-1];e.value+=b},characterReference:function(a){this.stack.pop().position.end=wW(a.end)},codeFenced:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let a=this.resume();this.stack[this.stack.length-1].lang=a},codeFencedFenceMeta:function(){let a=this.resume();this.stack[this.stack.length-1].meta=a},codeFlowValue:k,codeIndented:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/(\r?\n|\r)$/g,"")}),codeText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),codeTextData:k,data:k,definition:g(),definitionDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},definitionLabelString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=wy(this.sliceSerialize(a)).toLowerCase()},definitionTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},emphasis:g(),hardBreakEscape:g(l),hardBreakTrailing:g(l),htmlFlow:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlFlowData:k,htmlText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlTextData:k,image:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),label:function(){let a=this.stack[this.stack.length-1],b=this.resume(),c=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===c.type?c.children=a.children:c.alt=b},labelText:function(a){let b=this.sliceSerialize(a),c=this.stack[this.stack.length-2];c.label=b.replace(wT,wU),c.identifier=wy(b).toLowerCase()},lineEnding:function(a){let c=this.stack[this.stack.length-1];if(this.data.atHardBreak){c.children[c.children.length-1].position.end=wW(a.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&b.canContainEols.includes(c.type)&&(j.call(this,a),k.call(this,a))},link:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=wy(this.sliceSerialize(a)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},resourceTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},resource:function(){this.data.inReference=void 0},setextHeading:g(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(a){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(a).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:g(),thematicBreak:g()}};!function a(b,c){let d=-1;for(;++d<c.length;){let e=c[d];Array.isArray(e)?a(b,e):function(a,b){let c;for(c in b)if(wV.call(b,c))switch(c){case"canContainEols":{let d=b[c];d&&a[c].push(...d);break}case"transforms":{let d=b[c];d&&a[c].push(...d);break}case"enter":case"exit":{let d=b[c];d&&Object.assign(a[c],d)}}}(b,e)}}(b,(a||{}).mdastExtensions||[]);let c={};return function(a){let d={type:"root",children:[]},g={stack:[d],tokenStack:[],config:b,enter:f,exit:h,buffer:e,resume:i,data:c},j=[],k=-1;for(;++k<a.length;)("listOrdered"===a[k][1].type||"listUnordered"===a[k][1].type)&&("enter"===a[k][0]?j.push(k):k=function(a,b,c){let d,e,f,g,h=b-1,i=-1,j=!1;for(;++h<=c;){let b=a[h];switch(b[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===b[0]?i++:i--,g=void 0;break;case"lineEndingBlank":"enter"===b[0]&&(!d||g||i||f||(f=h),g=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:g=void 0}if(!i&&"enter"===b[0]&&"listItemPrefix"===b[1].type||-1===i&&"exit"===b[0]&&("listUnordered"===b[1].type||"listOrdered"===b[1].type)){if(d){let g=h;for(e=void 0;g--;){let b=a[g];if("lineEnding"===b[1].type||"lineEndingBlank"===b[1].type){if("exit"===b[0])continue;e&&(a[e][1].type="lineEndingBlank",j=!0),b[1].type="lineEnding",e=g}else if("linePrefix"===b[1].type||"blockQuotePrefix"===b[1].type||"blockQuotePrefixWhitespace"===b[1].type||"blockQuoteMarker"===b[1].type||"listItemIndent"===b[1].type);else break}f&&(!e||f<e)&&(d._spread=!0),d.end=Object.assign({},e?a[e][1].start:b[1].end),a.splice(e||h,0,["exit",d,b[2]]),h++,c++}if("listItemPrefix"===b[1].type){let e={type:"listItem",_spread:!1,start:Object.assign({},b[1].start),end:void 0};d=e,a.splice(h,0,["enter",e,b[2]]),h++,c++,f=void 0,g=!0}}}return a[b][1]._spread=j,c}(a,j.pop(),k));for(k=-1;++k<a.length;){let c=b[a[k][0]];wV.call(c,a[k][1].type)&&c[a[k][1].type].call(Object.assign({sliceSerialize:a[k][2].sliceSerialize},g),a[k][1])}if(g.tokenStack.length>0){let a=g.tokenStack[g.tokenStack.length-1];(a[1]||wX).call(g,void 0,a[0])}for(d.position={start:wW(a.length>0?a[0][1].start:{line:1,column:1,offset:0}),end:wW(a.length>0?a[a.length-2][1].end:{line:1,column:1,offset:0})},k=-1;++k<b.transforms.length;)d=b.transforms[k](d)||d;return d};function d(a,b){return function(c){f.call(this,a(c),c),b&&b.call(this,c)}}function e(){this.stack.push({type:"fragment",children:[]})}function f(a,b,c){this.stack[this.stack.length-1].children.push(a),this.stack.push(a),this.tokenStack.push([b,c||void 0]),a.position={start:wW(b.start),end:void 0}}function g(a){return function(b){a&&a.call(this,b),h.call(this,b)}}function h(a,b){let c=this.stack.pop(),d=this.tokenStack.pop();if(d)d[0].type!==a.type&&(b?b.call(this,a,d[0]):(d[1]||wX).call(this,a,d[0]));else throw Error("Cannot close `"+a.type+"` ("+vn({start:a.start,end:a.end})+"): it’s not open");c.position.end=wW(a.end)}function i(){return vH(this.stack.pop())}function j(a){let b=this.stack[this.stack.length-1].children,c=b[b.length-1];c&&"text"===c.type||((c={type:"text",value:""}).position={start:wW(a.start),end:void 0},b.push(c)),this.stack.push(c)}function k(a){let b=this.stack.pop();b.value+=this.sliceSerialize(a),b.position.end=wW(a.end)}function l(){this.data.atHardBreak=!0}function m(a){this.data.characterReferenceType=a.type}function n(){return{type:"code",lang:null,meta:null,value:""}}function o(){return{type:"heading",depth:0,children:[]}}function p(){return{type:"break"}}function q(){return{type:"html",value:""}}function r(){return{type:"link",title:null,url:"",children:[]}}function s(a){return{type:"list",ordered:"listOrdered"===a.type,start:null,spread:a._spread,children:[]}}})(e)(function(a){for(;!v6(a););return a}((function(a){let b={constructs:vN([wQ,...(a||{}).extensions||[]]),content:c(v0),defined:[],document:c(v1),flow:c(v9),lazy:{},string:c(wb),text:c(wc)};return b;function c(a){return function(c){return function(a,b,c){let d={_bufferIndex:-1,_index:0,line:c&&c.line||1,column:c&&c.column||1,offset:c&&c.offset||0},e={},f=[],g=[],h=[],i={attempt:o(function(a,b){p(a,b.from)}),check:o(n),consume:function(a){vV(a)?(d.line++,d.column=1,d.offset+=-3===a?2:1,q()):-1!==a&&(d.column++,d.offset++),d._bufferIndex<0?d._index++:(d._bufferIndex++,d._bufferIndex===g[d._index].length&&(d._bufferIndex=-1,d._index++)),j.previous=a},enter:function(a,b){let c=b||{};return c.type=a,c.start=m(),j.events.push(["enter",c,j]),h.push(c),c},exit:function(a){let b=h.pop();return b.end=m(),j.events.push(["exit",b,j]),b},interrupt:o(n,{interrupt:!0})},j={code:null,containerState:{},defineSkip:function(a){e[a.line]=a.column,q()},events:[],now:m,parser:a,previous:null,sliceSerialize:function(a,b){return function(a,b){let c,d=-1,e=[];for(;++d<a.length;){let f,g=a[d];if("string"==typeof g)f=g;else switch(g){case -5:f="\r";break;case -4:f="\n";break;case -3:f="\r\n";break;case -2:f=b?" ":" ";break;case -1:if(!b&&c)continue;f=" ";break;default:f=String.fromCharCode(g)}c=-2===g,e.push(f)}return e.join("")}(l(a),b)},sliceStream:l,write:function(a){return(g=vL(g,a),function(){let a;for(;d._index<g.length;){let c=g[d._index];if("string"==typeof c)for(a=d._index,d._bufferIndex<0&&(d._bufferIndex=0);d._index===a&&d._bufferIndex<c.length;){var b;b=c.charCodeAt(d._bufferIndex),k=k(b)}else k=k(c)}}(),null!==g[g.length-1])?[]:(p(b,0),j.events=wh(f,j.events,j),j.events)}},k=b.tokenize.call(j,i);return b.resolveAll&&f.push(b),j;function l(a){return function(a,b){let c,d=b.start._index,e=b.start._bufferIndex,f=b.end._index,g=b.end._bufferIndex;if(d===f)c=[a[d].slice(e,g)];else{if(c=a.slice(d,f),e>-1){let a=c[0];"string"==typeof a?c[0]=a.slice(e):c.shift()}g>0&&c.push(a[f].slice(0,g))}return c}(g,a)}function m(){let{_bufferIndex:a,_index:b,line:c,column:e,offset:f}=d;return{_bufferIndex:a,_index:b,line:c,column:e,offset:f}}function n(a,b){b.restore()}function o(a,b){return function(c,e,f){var g;let k,l,n,o;return Array.isArray(c)?p(c):"tokenize"in c?p([c]):(g=c,function(a){let b=null!==a&&g[a],c=null!==a&&g.null;return p([...Array.isArray(b)?b:b?[b]:[],...Array.isArray(c)?c:c?[c]:[]])(a)});function p(a){return(k=a,l=0,0===a.length)?f:r(a[l])}function r(a){return function(c){let e,f,g,k,l;return(e=m(),f=j.previous,g=j.currentConstruct,k=j.events.length,l=Array.from(h),o={from:k,restore:function(){d=e,j.previous=f,j.currentConstruct=g,j.events.length=k,h=l,q()}},n=a,a.partial||(j.currentConstruct=a),a.name&&j.parser.constructs.disable.null.includes(a.name))?t(c):a.tokenize.call(b?Object.assign(Object.create(j),b):j,i,s,t)(c)}}function s(b){return a(n,o),e}function t(a){return(o.restore(),++l<k.length)?r(k[l]):f}}}function p(a,b){a.resolveAll&&!f.includes(a)&&f.push(a),a.resolve&&vK(j.events,b,j.events.length-b,a.resolve(j.events.slice(b),j)),a.resolveTo&&(j.events=a.resolveTo(j.events,j))}function q(){d.line in e&&d.column<2&&(d.column=e[d.line],d.offset+=e[d.line]-1)}}(b,a,c)}}})(e).document().write((g=1,h="",i=!0,function(a,b,c){let d,e,j,k,l,m=[];for(a=h+("string"==typeof a?a.toString():new TextDecoder(b||void 0).decode(a)),j=0,h="",i&&(65279===a.charCodeAt(0)&&j++,i=void 0);j<a.length;){if(wR.lastIndex=j,k=(d=wR.exec(a))&&void 0!==d.index?d.index:a.length,l=a.charCodeAt(k),!d){h=a.slice(j);break}if(10===l&&j===k&&f)m.push(-3),f=void 0;else switch(f&&(m.push(-5),f=void 0),j<k&&(m.push(a.slice(j,k)),g+=k-j),l){case 0:m.push(65533),g++;break;case 9:for(e=4*Math.ceil(g/4),m.push(-2);g++<e;)m.push(-1);break;case 10:m.push(-4),g=1;break;default:f=!0,g=1}j=k+1}return c&&(f&&m.push(-5),h&&m.push(h),m.push(null)),m})(c,d,!0))))}}let wZ="object"==typeof self?self:globalThis,w$=(a,b)=>{switch(a){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+a)}return new wZ[a](b)},w_=a=>{var b;let c,d;return(b=new Map,c=(a,c)=>(b.set(c,a),a),d=e=>{if(b.has(e))return b.get(e);let[f,g]=a[e];switch(f){case 0:case -1:return c(g,e);case 1:{let a=c([],e);for(let b of g)a.push(d(b));return a}case 2:{let a=c({},e);for(let[b,c]of g)a[d(b)]=d(c);return a}case 3:return c(new Date(g),e);case 4:{let{source:a,flags:b}=g;return c(new RegExp(a,b),e)}case 5:{let a=c(new Map,e);for(let[b,c]of g)a.set(d(b),d(c));return a}case 6:{let a=c(new Set,e);for(let b of g)a.add(d(b));return a}case 7:{let{name:a,message:b}=g;return c(w$(a,b),e)}case 8:return c(BigInt(g),e);case"BigInt":return c(Object(BigInt(g)),e);case"ArrayBuffer":return c(new Uint8Array(g).buffer,g);case"DataView":{let{buffer:a}=new Uint8Array(g);return c(new DataView(a),g)}}return c(w$(f,g),e)})(0)},{toString:w0}={},{keys:w1}=Object,w2=a=>{let b=typeof a;if("object"!==b||!a)return[0,b];let c=w0.call(a).slice(8,-1);switch(c){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,c]}return c.includes("Array")?[1,c]:c.includes("Error")?[7,c]:[2,c]},w3=([a,b])=>0===a&&("function"===b||"symbol"===b),w4=(a,{json:b,lossy:c}={})=>{var d,e,f;let g,h,i=[];return(d=!(b||c),e=!!b,f=new Map,g=(a,b)=>{let c=i.push(a)-1;return f.set(b,c),c},h=a=>{if(f.has(a))return f.get(a);let[b,c]=w2(a);switch(b){case 0:{let e=a;switch(c){case"bigint":b=8,e=a.toString();break;case"function":case"symbol":if(d)throw TypeError("unable to serialize "+c);e=null;break;case"undefined":return g([-1],a)}return g([b,e],a)}case 1:{if(c){let b=a;return"DataView"===c?b=new Uint8Array(a.buffer):"ArrayBuffer"===c&&(b=new Uint8Array(a)),g([c,[...b]],a)}let d=[],e=g([b,d],a);for(let b of a)d.push(h(b));return e}case 2:{if(c)switch(c){case"BigInt":return g([c,a.toString()],a);case"Boolean":case"Number":case"String":return g([c,a.valueOf()],a)}if(e&&"toJSON"in a)return h(a.toJSON());let f=[],i=g([b,f],a);for(let b of w1(a))(d||!w3(w2(a[b])))&&f.push([h(b),h(a[b])]);return i}case 3:return g([b,a.toISOString()],a);case 4:{let{source:c,flags:d}=a;return g([b,{source:c,flags:d}],a)}case 5:{let c=[],e=g([b,c],a);for(let[b,e]of a)(d||!(w3(w2(b))||w3(w2(e))))&&c.push([h(b),h(e)]);return e}case 6:{let c=[],e=g([b,c],a);for(let b of a)(d||!w3(w2(b)))&&c.push(h(b));return e}}let{message:i}=a;return g([b,{name:c,message:i}],a)})(a),i},w5="function"==typeof structuredClone?(a,b)=>b&&("json"in b||"lossy"in b)?w_(w4(a,b)):structuredClone(a):(a,b)=>w_(w4(a,b));function w6(a){let b=[],c=-1,d=0,e=0;for(;++c<a.length;){let f=a.charCodeAt(c),g="";if(37===f&&vP(a.charCodeAt(c+1))&&vP(a.charCodeAt(c+2)))e=2;else if(f<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(f))||(g=String.fromCharCode(f));else if(f>55295&&f<57344){let b=a.charCodeAt(c+1);f<56320&&b>56319&&b<57344?(g=String.fromCharCode(f,b),e=1):g="�"}else g=String.fromCharCode(f);g&&(b.push(a.slice(d,c),encodeURIComponent(g)),d=c+e+1,g=""),e&&(c+=e,e=0)}return b.join("")+a.slice(d)}function w7(a,b){let c=[{type:"text",value:"↩"}];return b>1&&c.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(b)}]}),c}function w8(a,b){return"Back to reference "+(a+1)+(b>1?"-"+b:"")}let w9=function(a){var b,c;if(null==a)return xb;if("function"==typeof a)return xa(a);if("object"==typeof a){return Array.isArray(a)?function(a){let b=[],c=-1;for(;++c<a.length;)b[c]=w9(a[c]);return xa(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}(a):(b=a,xa(function(a){let c;for(c in b)if(a[c]!==b[c])return!1;return!0}))}if("string"==typeof a){return c=a,xa(function(a){return a&&a.type===c})}throw Error("Expected function, string, or object as test")};function xa(a){return function(b,c,d){return!!(function(a){return null!==a&&"object"==typeof a&&"type"in a}(b)&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function xb(){return!0}let xc=[],xd="skip";function xe(a,b,c,d){let e;"function"==typeof b&&"function"!=typeof c?(d=c,c=b):e=b;let f=w9(e),g=d?-1:1;(function a(e,h,i){let j=e&&"object"==typeof e?e:{};if("string"==typeof j.type){let a="string"==typeof j.tagName?j.tagName:"string"==typeof j.name?j.name:void 0;Object.defineProperty(k,"name",{value:"node (\x1b[33m"+e.type+(a?"<"+a+">":"")+"\x1b[39m)"})}return k;function k(){var j;let k,l,m,n=xc;if((!b||f(e,h,i[i.length-1]||void 0))&&!1===(n=Array.isArray(j=c(e,i))?j:"number"==typeof j?[!0,j]:null==j?xc:[j])[0])return n;if("children"in e&&e.children&&e.children&&n[0]!==xd)for(l=(d?e.children.length:-1)+g,m=i.concat(e);l>-1&&l<e.children.length;){if(!1===(k=a(e.children[l],l,m)())[0])return k;l="number"==typeof k[1]?k[1]:l+g}return n}})(a,void 0,[])()}function xf(a,b,c,d){let e,f,g;"function"==typeof b&&"function"!=typeof c?(f=void 0,g=b,e=c):(f=b,g=c,e=d),xe(a,f,function(a,b){let c=b[b.length-1],d=c?c.children.indexOf(a):void 0;return g(a,d,c)},e)}function xg(a,b){let c=b.referenceType,d="]";if("collapsed"===c?d+="[]":"full"===c&&(d+="["+(b.label||b.identifier)+"]"),"imageReference"===b.type)return[{type:"text",value:"!["+b.alt+d}];let e=a.all(b),f=e[0];f&&"text"===f.type?f.value="["+f.value:e.unshift({type:"text",value:"["});let g=e[e.length-1];return g&&"text"===g.type?g.value+=d:e.push({type:"text",value:d}),e}function xh(a){let b=a.spread;return null==b?a.children.length>1:b}function xi(a,b,c){let d=0,e=a.length;if(b){let b=a.codePointAt(d);for(;9===b||32===b;)d++,b=a.codePointAt(d)}if(c){let b=a.codePointAt(e-1);for(;9===b||32===b;)e--,b=a.codePointAt(e-1)}return e>d?a.slice(d,e):""}let xj={blockquote:function(a,b){let c={type:"element",tagName:"blockquote",properties:{},children:a.wrap(a.all(b),!0)};return a.patch(b,c),a.applyData(b,c)},break:function(a,b){let c={type:"element",tagName:"br",properties:{},children:[]};return a.patch(b,c),[a.applyData(b,c),{type:"text",value:"\n"}]},code:function(a,b){let c=b.value?b.value+"\n":"",d={},e=b.lang?b.lang.split(/\s+/):[];e.length>0&&(d.className=["language-"+e[0]]);let f={type:"element",tagName:"code",properties:d,children:[{type:"text",value:c}]};return b.meta&&(f.data={meta:b.meta}),a.patch(b,f),f={type:"element",tagName:"pre",properties:{},children:[f=a.applyData(b,f)]},a.patch(b,f),f},delete:function(a,b){let c={type:"element",tagName:"del",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},emphasis:function(a,b){let c={type:"element",tagName:"em",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},footnoteReference:function(a,b){let c,d="string"==typeof a.options.clobberPrefix?a.options.clobberPrefix:"user-content-",e=String(b.identifier).toUpperCase(),f=w6(e.toLowerCase()),g=a.footnoteOrder.indexOf(e),h=a.footnoteCounts.get(e);void 0===h?(h=0,a.footnoteOrder.push(e),c=a.footnoteOrder.length):c=g+1,h+=1,a.footnoteCounts.set(e,h);let i={type:"element",tagName:"a",properties:{href:"#"+d+"fn-"+f,id:d+"fnref-"+f+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};a.patch(b,i);let j={type:"element",tagName:"sup",properties:{},children:[i]};return a.patch(b,j),a.applyData(b,j)},heading:function(a,b){let c={type:"element",tagName:"h"+b.depth,properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},html:function(a,b){if(a.options.allowDangerousHtml){let c={type:"raw",value:b.value};return a.patch(b,c),a.applyData(b,c)}},imageReference:function(a,b){let c=String(b.identifier).toUpperCase(),d=a.definitionById.get(c);if(!d)return xg(a,b);let e={src:w6(d.url||""),alt:b.alt};null!==d.title&&void 0!==d.title&&(e.title=d.title);let f={type:"element",tagName:"img",properties:e,children:[]};return a.patch(b,f),a.applyData(b,f)},image:function(a,b){let c={src:w6(b.url)};null!==b.alt&&void 0!==b.alt&&(c.alt=b.alt),null!==b.title&&void 0!==b.title&&(c.title=b.title);let d={type:"element",tagName:"img",properties:c,children:[]};return a.patch(b,d),a.applyData(b,d)},inlineCode:function(a,b){let c={type:"text",value:b.value.replace(/\r?\n|\r/g," ")};a.patch(b,c);let d={type:"element",tagName:"code",properties:{},children:[c]};return a.patch(b,d),a.applyData(b,d)},linkReference:function(a,b){let c=String(b.identifier).toUpperCase(),d=a.definitionById.get(c);if(!d)return xg(a,b);let e={href:w6(d.url||"")};null!==d.title&&void 0!==d.title&&(e.title=d.title);let f={type:"element",tagName:"a",properties:e,children:a.all(b)};return a.patch(b,f),a.applyData(b,f)},link:function(a,b){let c={href:w6(b.url)};null!==b.title&&void 0!==b.title&&(c.title=b.title);let d={type:"element",tagName:"a",properties:c,children:a.all(b)};return a.patch(b,d),a.applyData(b,d)},listItem:function(a,b,c){let d=a.all(b),e=c?function(a){let b=!1;if("list"===a.type){b=a.spread||!1;let c=a.children,d=-1;for(;!b&&++d<c.length;)b=xh(c[d])}return b}(c):xh(b),f={},g=[];if("boolean"==typeof b.checked){let a,c=d[0];c&&"element"===c.type&&"p"===c.tagName?a=c:(a={type:"element",tagName:"p",properties:{},children:[]},d.unshift(a)),a.children.length>0&&a.children.unshift({type:"text",value:" "}),a.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:b.checked,disabled:!0},children:[]}),f.className=["task-list-item"]}let h=-1;for(;++h<d.length;){let a=d[h];(e||0!==h||"element"!==a.type||"p"!==a.tagName)&&g.push({type:"text",value:"\n"}),"element"!==a.type||"p"!==a.tagName||e?g.push(a):g.push(...a.children)}let i=d[d.length-1];i&&(e||"element"!==i.type||"p"!==i.tagName)&&g.push({type:"text",value:"\n"});let j={type:"element",tagName:"li",properties:f,children:g};return a.patch(b,j),a.applyData(b,j)},list:function(a,b){let c={},d=a.all(b),e=-1;for("number"==typeof b.start&&1!==b.start&&(c.start=b.start);++e<d.length;){let a=d[e];if("element"===a.type&&"li"===a.tagName&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){c.className=["contains-task-list"];break}}let f={type:"element",tagName:b.ordered?"ol":"ul",properties:c,children:a.wrap(d,!0)};return a.patch(b,f),a.applyData(b,f)},paragraph:function(a,b){let c={type:"element",tagName:"p",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},root:function(a,b){let c={type:"root",children:a.wrap(a.all(b))};return a.patch(b,c),a.applyData(b,c)},strong:function(a,b){let c={type:"element",tagName:"strong",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},table:function(a,b){let c=a.all(b),d=c.shift(),e=[];if(d){let c={type:"element",tagName:"thead",properties:{},children:a.wrap([d],!0)};a.patch(b.children[0],c),e.push(c)}if(c.length>0){let d={type:"element",tagName:"tbody",properties:{},children:a.wrap(c,!0)},f=vk(b.children[1]),g=vj(b.children[b.children.length-1]);f&&g&&(d.position={start:f,end:g}),e.push(d)}let f={type:"element",tagName:"table",properties:{},children:a.wrap(e,!0)};return a.patch(b,f),a.applyData(b,f)},tableCell:function(a,b){let c={type:"element",tagName:"td",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},tableRow:function(a,b,c){let d=c?c.children:void 0,e=0===(d?d.indexOf(b):1)?"th":"td",f=c&&"table"===c.type?c.align:void 0,g=f?f.length:b.children.length,h=-1,i=[];for(;++h<g;){let c=b.children[h],d={},g=f?f[h]:void 0;g&&(d.align=g);let j={type:"element",tagName:e,properties:d,children:[]};c&&(j.children=a.all(c),a.patch(c,j),j=a.applyData(c,j)),i.push(j)}let j={type:"element",tagName:"tr",properties:{},children:a.wrap(i,!0)};return a.patch(b,j),a.applyData(b,j)},text:function(a,b){let c={type:"text",value:function(a){let b=String(a),c=/\r?\n|\r/g,d=c.exec(b),e=0,f=[];for(;d;)f.push(xi(b.slice(e,d.index),e>0,!0),d[0]),e=d.index+d[0].length,d=c.exec(b);return f.push(xi(b.slice(e),e>0,!1)),f.join("")}(String(b.value))};return a.patch(b,c),a.applyData(b,c)},thematicBreak:function(a,b){let c={type:"element",tagName:"hr",properties:{},children:[]};return a.patch(b,c),a.applyData(b,c)},toml:xk,yaml:xk,definition:xk,footnoteDefinition:xk};function xk(){}let xl={}.hasOwnProperty,xm={};function xn(a,b){a.position&&(b.position=vm(a))}function xo(a,b){let c=b;if(a&&a.data){let b=a.data.hName,d=a.data.hChildren,e=a.data.hProperties;"string"==typeof b&&("element"===c.type?c.tagName=b:c={type:"element",tagName:b,properties:{},children:"children"in c?c.children:[c]}),"element"===c.type&&e&&Object.assign(c.properties,w5(e)),"children"in c&&c.children&&null!=d&&(c.children=d)}return c}function xp(a,b){let c=[],d=-1;for(b&&c.push({type:"text",value:"\n"});++d<a.length;)d&&c.push({type:"text",value:"\n"}),c.push(a[d]);return b&&a.length>0&&c.push({type:"text",value:"\n"}),c}function xq(a){let b=0,c=a.charCodeAt(b);for(;9===c||32===c;)b++,c=a.charCodeAt(b);return a.slice(b)}function xr(a,b){let c,d,e,f,g=(c=b||xm,d=new Map,e=new Map,f={all:function(a){let b=[];if("children"in a){let c=a.children,d=-1;for(;++d<c.length;){let e=f.one(c[d],a);if(e){if(d&&"break"===c[d-1].type&&(Array.isArray(e)||"text"!==e.type||(e.value=xq(e.value)),!Array.isArray(e)&&"element"===e.type)){let a=e.children[0];a&&"text"===a.type&&(a.value=xq(a.value))}Array.isArray(e)?b.push(...e):b.push(e)}}}return b},applyData:xo,definitionById:d,footnoteById:e,footnoteCounts:new Map,footnoteOrder:[],handlers:{...xj,...c.handlers},one:function(a,b){let c=a.type,d=f.handlers[c];if(xl.call(f.handlers,c)&&d)return d(f,a,b);if(f.options.passThrough&&f.options.passThrough.includes(c)){if("children"in a){let{children:b,...c}=a,d=w5(c);return d.children=f.all(a),d}return w5(a)}return(f.options.unknownHandler||function(a,b){let c=b.data||{},d="value"in b&&!(xl.call(c,"hProperties")||xl.call(c,"hChildren"))?{type:"text",value:b.value}:{type:"element",tagName:"div",properties:{},children:a.all(b)};return a.patch(b,d),a.applyData(b,d)})(f,a,b)},options:c,patch:xn,wrap:xp},xf(a,function(a){if("definition"===a.type||"footnoteDefinition"===a.type){let b="definition"===a.type?d:e,c=String(a.identifier).toUpperCase();b.has(c)||b.set(c,a)}}),f),h=g.one(a,void 0),i=function(a){let b="string"==typeof a.options.clobberPrefix?a.options.clobberPrefix:"user-content-",c=a.options.footnoteBackContent||w7,d=a.options.footnoteBackLabel||w8,e=a.options.footnoteLabel||"Footnotes",f=a.options.footnoteLabelTagName||"h2",g=a.options.footnoteLabelProperties||{className:["sr-only"]},h=[],i=-1;for(;++i<a.footnoteOrder.length;){let e=a.footnoteById.get(a.footnoteOrder[i]);if(!e)continue;let f=a.all(e),g=String(e.identifier).toUpperCase(),j=w6(g.toLowerCase()),k=0,l=[],m=a.footnoteCounts.get(g);for(;void 0!==m&&++k<=m;){l.length>0&&l.push({type:"text",value:" "});let a="string"==typeof c?c:c(i,k);"string"==typeof a&&(a={type:"text",value:a}),l.push({type:"element",tagName:"a",properties:{href:"#"+b+"fnref-"+j+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof d?d:d(i,k),className:["data-footnote-backref"]},children:Array.isArray(a)?a:[a]})}let n=f[f.length-1];if(n&&"element"===n.type&&"p"===n.tagName){let a=n.children[n.children.length-1];a&&"text"===a.type?a.value+=" ":n.children.push({type:"text",value:" "}),n.children.push(...l)}else f.push(...l);let o={type:"element",tagName:"li",properties:{id:b+"fn-"+j},children:a.wrap(f,!0)};a.patch(e,o),h.push(o)}if(0!==h.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:f,properties:{...w5(g),id:"footnote-label"},children:[{type:"text",value:e}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:a.wrap(h,!0)},{type:"text",value:"\n"}]}}(g),j=Array.isArray(h)?{type:"root",children:h}:h||{type:"root",children:[]};return i&&(uA("children"in j),j.children.push({type:"text",value:"\n"},i)),j}function xs(a,b){return a&&"run"in a?async function(c,d){let e=xr(c,{file:d,...b});await a.run(e,d)}:function(c,d){return xr(c,{file:d,...a||b})}}function xt(a){if(a)throw a}var xu=a.i(897599);function xv(a){if("object"!=typeof a||null===a)return!1;let b=Object.getPrototypeOf(a);return(null===b||b===Object.prototype||null===Object.getPrototypeOf(b))&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)}var xw=a.i(59639),xw=xw,xx=a.i(857764),xx=xx;function xy(a){return!!(null!==a&&"object"==typeof a&&"href"in a&&a.href&&"protocol"in a&&a.protocol&&void 0===a.auth)}let xz=["history","path","basename","stem","extname","dirname"];class xA{constructor(a){let b,c;b=a?xy(a)?{path:a}:"string"==typeof a||function(a){return!!(a&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a)}(a)?{value:a}:a:{},this.cwd="cwd"in b?"":xw.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let d=-1;for(;++d<xz.length;){const a=xz[d];a in b&&void 0!==b[a]&&null!==b[a]&&(this[a]="history"===a?[...b[a]]:b[a])}for(c in b)xz.includes(c)||(this[c]=b[c])}get basename(){return"string"==typeof this.path?mH.default.basename(this.path):void 0}set basename(a){xC(a,"basename"),xB(a,"basename"),this.path=mH.default.join(this.dirname||"",a)}get dirname(){return"string"==typeof this.path?mH.default.dirname(this.path):void 0}set dirname(a){xD(this.basename,"dirname"),this.path=mH.default.join(a||"",this.basename)}get extname(){return"string"==typeof this.path?mH.default.extname(this.path):void 0}set extname(a){if(xB(a,"extname"),xD(this.dirname,"extname"),a){if(46!==a.codePointAt(0))throw Error("`extname` must start with `.`");if(a.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=mH.default.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){xy(a)&&(a=(0,xx.fileURLToPath)(a)),xC(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return"string"==typeof this.path?mH.default.basename(this.path,this.extname):void 0}set stem(a){xC(a,"stem"),xB(a,"stem"),this.path=mH.default.join(this.dirname||"",a+(this.extname||""))}fail(a,b,c){let d=this.message(a,b,c);throw d.fatal=!0,d}info(a,b,c){let d=this.message(a,b,c);return d.fatal=void 0,d}message(a,b,c){let d=new vr(a,b,c);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(a){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(a||void 0).decode(this.value)}}function xB(a,b){if(a&&a.includes(mH.default.sep))throw Error("`"+b+"` cannot be a path: did not expect `"+mH.default.sep+"`")}function xC(a,b){if(!a)throw Error("`"+b+"` cannot be empty")}function xD(a,b){if(!a)throw Error("Setting `"+b+"` requires `path` to be set too")}let xE=function(a){let b=this.constructor.prototype,c=b[a],d=function(){return c.apply(d,arguments)};return Object.setPrototypeOf(d,b),d},xF={}.hasOwnProperty;class xG extends xE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let a=[],b={run:function(...b){let c=-1,d=b.pop();if("function"!=typeof d)throw TypeError("Expected function as last argument, not "+d);!function e(f,...g){let h=a[++c],i=-1;if(f)return void d(f);for(;++i<b.length;)(null===g[i]||void 0===g[i])&&(g[i]=b[i]);b=g,h?(function(a,b){let c;return function(...b){let f,g=a.length>b.length;g&&b.push(d);try{f=a.apply(this,b)}catch(a){if(g&&c)throw a;return d(a)}g||(f&&f.then&&"function"==typeof f.then?f.then(e,d):f instanceof Error?d(f):e(f))};function d(a,...e){c||(c=!0,b(a,...e))}function e(a){d(null,a)}})(h,e)(...g):d(null,...g)}(null,...b)},use:function(c){if("function"!=typeof c)throw TypeError("Expected `middelware` to be a function, not "+c);return a.push(c),b}};return b}()}copy(){let a=new xG,b=-1;for(;++b<this.attachers.length;){let c=this.attachers[b];a.use(...c)}return a.data((0,xu.default)(!0,{},this.namespace)),a}data(a,b){return"string"==typeof a?2==arguments.length?(xK("data",this.frozen),this.namespace[a]=b,this):xF.call(this.namespace,a)&&this.namespace[a]||void 0:a?(xK("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[a,...b]=this.attachers[this.freezeIndex];if(!1===b[0])continue;!0===b[0]&&(b[0]=void 0);let c=a.call(this,...b);"function"==typeof c&&this.transformers.use(c)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(a){this.freeze();let b=xN(a),c=this.parser||this.Parser;return xI("parse",c),c(String(b),b)}process(a,b){let c=this;return this.freeze(),xI("process",this.parser||this.Parser),xJ("process",this.compiler||this.Compiler),b?d(void 0,b):new Promise(d);function d(d,e){let f=xN(a),g=c.parse(f);function h(a,c){a||!c?e(a):d?d(c):(uA(b,"`done` is defined if `resolve` is not"),b(void 0,c))}c.run(g,f,function(a,b,d){var e,f;if(a||!b||!d)return h(a);let g=c.stringify(b,d);"string"==typeof(e=g)||(f=e)&&"object"==typeof f&&"byteLength"in f&&"byteOffset"in f?d.value=g:d.result=g,h(a,d)})}}processSync(a){let b,c=!1;return this.freeze(),xI("processSync",this.parser||this.Parser),xJ("processSync",this.compiler||this.Compiler),this.process(a,function(a,d){c=!0,xt(a),b=d}),xM("processSync","process",c),uA(b,"we either bailed on an error or have a tree"),b}run(a,b,c){xL(a),this.freeze();let d=this.transformers;return c||"function"!=typeof b||(c=b,b=void 0),c?e(void 0,c):new Promise(e);function e(e,f){uA("function"!=typeof b,"`file` can’t be a `done` anymore, we checked");let g=xN(b);d.run(a,g,function(b,d,g){let h=d||a;b?f(b):e?e(h):(uA(c,"`done` is defined if `resolve` is not"),c(void 0,h,g))})}}runSync(a,b){let c,d=!1;return this.run(a,b,function(a,b){xt(a),c=b,d=!0}),xM("runSync","run",d),uA(c,"we either bailed on an error or have a tree"),c}stringify(a,b){this.freeze();let c=xN(b),d=this.compiler||this.Compiler;return xJ("stringify",d),xL(a),d(a,c)}use(a,...b){let c=this.attachers,d=this.namespace;if(xK("use",this.frozen),null==a);else if("function"==typeof a)g(a,b);else if("object"==typeof a)Array.isArray(a)?f(a):e(a);else throw TypeError("Expected usable value, not `"+a+"`");return this;function e(a){if(!("plugins"in a)&&!("settings"in a))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(a.plugins),a.settings&&(d.settings=(0,xu.default)(!0,d.settings,a.settings))}function f(a){let b=-1;if(null==a);else if(Array.isArray(a))for(;++b<a.length;)!function(a){if("function"==typeof a)g(a,[]);else if("object"==typeof a)if(Array.isArray(a)){let[b,...c]=a;g(b,c)}else e(a);else throw TypeError("Expected usable value, not `"+a+"`")}(a[b]);else throw TypeError("Expected a list of plugins, not `"+a+"`")}function g(a,b){let d=-1,e=-1;for(;++d<c.length;)if(c[d][0]===a){e=d;break}if(-1===e)c.push([a,...b]);else if(b.length>0){let[d,...f]=b,g=c[e][1];xv(g)&&xv(d)&&(d=(0,xu.default)(!0,g,d)),c[e]=[a,d,...f]}}}}let xH=new xG().freeze();function xI(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `parser`")}function xJ(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `compiler`")}function xK(a,b){if(b)throw Error("Cannot call `"+a+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xL(a){if(!xv(a)||"string"!=typeof a.type)throw TypeError("Expected node, got `"+a+"`")}function xM(a,b,c){if(!c)throw Error("`"+a+"` finished async. Use `"+b+"` instead")}function xN(a){var b;return(b=a)&&"object"==typeof b&&"message"in b&&"messages"in b?a:new xA(a)}let xO=[],xP={allowDangerousHtml:!0},xQ=/^(https?|ircs?|mailto|xmpp)$/i,xR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xS(a){var b;let c,d,e,f,g,h=(c=(b=a).rehypePlugins||xO,d=b.remarkPlugins||xO,e=b.remarkRehypeOptions?{...b.remarkRehypeOptions,...xP}:xP,xH().use(wY).use(d).use(xs,e).use(c)),i=(f=a.children||"",g=new xA,"string"==typeof f?g.value=f:uB("Unexpected value `"+f+"` for `children` prop, expected `string`"),g);return function(a,b){let c=b.allowedElements,d=b.allowElement,e=b.components,f=b.disallowedElements,g=b.skipHtml,h=b.unwrapDisallowed,i=b.urlTransform||xT;for(let a of xR)Object.hasOwn(b,a.from)&&uB("Unexpected `"+a.from+"` prop, "+(a.to?"use `"+a.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+a.id+"> for more info)");return c&&f&&uB("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),b.className&&(a={type:"element",tagName:"div",properties:{className:b.className},children:"root"===a.type?a.children:[a]}),xf(a,function(a,b,e){if("raw"===a.type&&e&&"number"==typeof b)return g?e.children.splice(b,1):e.children[b]={type:"text",value:a.value},b;if("element"===a.type){let b;for(b in vF)if(Object.hasOwn(vF,b)&&Object.hasOwn(a.properties,b)){let c=a.properties[b],d=vF[b];(null===d||d.includes(a.tagName))&&(a.properties[b]=i(String(c||""),b,a))}}if("element"===a.type){let g=c?!c.includes(a.tagName):!!f&&f.includes(a.tagName);if(!g&&d&&"number"==typeof b&&(g=!d(a,b,e)),g&&e&&"number"==typeof b)return h&&a.children?e.children.splice(b,1,...a.children):e.children.splice(b,1),b}}),function(a,b){var c,d,e,f;let g;if(!b||void 0===b.Fragment)throw TypeError("Expected `Fragment` in options");let h=b.filePath||void 0;if(b.development){if("function"!=typeof b.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");c=h,d=b.jsxDEV,g=function(a,b,e,f){let g=Array.isArray(e.children),h=vk(a);return d(b,e,f,g,{columnNumber:h?h.column-1:void 0,fileName:c,lineNumber:h?h.line:void 0},void 0)}}else{if("function"!=typeof b.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof b.jsxs)throw TypeError("Expected `jsxs` in production options");e=b.jsx,f=b.jsxs,g=function(a,b,c,d){let g=Array.isArray(c.children)?f:e;return d?g(b,c,d):g(b,c)}}let i={Fragment:b.Fragment,ancestors:[],components:b.components||{},create:g,elementAttributeNameCase:b.elementAttributeNameCase||"react",evaluater:b.createEvaluater?b.createEvaluater():void 0,filePath:h,ignoreInvalidStyle:b.ignoreInvalidStyle||!1,passKeys:!1!==b.passKeys,passNode:b.passNode||!1,schema:"svg"===b.space?vf:ve,stylePropertyNameCase:b.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==b.tableCellAlignToStyle},j=vy(i,a,void 0);return j&&"string"!=typeof j?j:i.create(a,i.Fragment,{children:j||void 0},void 0)}(a,{Fragment:aA.Fragment,components:e,ignoreInvalidStyle:!0,jsx:aA.jsx,jsxs:aA.jsxs,passKeys:!0,passNode:!0})}(h.runSync(h.parse(i),i),a)}function xT(a){let b=a.indexOf(":"),c=a.indexOf("?"),d=a.indexOf("#"),e=a.indexOf("/");return -1===b||-1!==e&&b>e||-1!==c&&b>c||-1!==d&&b>d||xQ.test(a.slice(0,b))?a:""}function xU(a,b){let c=String(a);if("string"!=typeof b)throw TypeError("Expected character");let d=0,e=c.indexOf(b);for(;-1!==e;)d++,e=c.indexOf(b,e+b.length);return d}let xV="phrasing",xW=["autolink","link","image","label"];function xX(a){this.enter({type:"link",title:null,url:"",children:[]},a)}function xY(a){this.config.enter.autolinkProtocol.call(this,a)}function xZ(a){this.config.exit.autolinkProtocol.call(this,a)}function x$(a){this.config.exit.data.call(this,a);let b=this.stack[this.stack.length-1];uA("link"===b.type),b.url="http://"+this.sliceSerialize(a)}function x_(a){this.config.exit.autolinkEmail.call(this,a)}function x0(a){this.exit(a)}function x1(a){!function(a,b,c){let d=w9((c||{}).ignore||[]),e=function(a){let b=[];if(!Array.isArray(a))throw TypeError("Expected find and replace tuple or list of tuples");let c=!a[0]||Array.isArray(a[0])?a:[a],d=-1;for(;++d<c.length;){var e;let a=c[d];b.push(["string"==typeof(e=a[0])?RegExp(function(a){if("string"!=typeof a)throw TypeError("Expected a string");return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e,function(a){return"function"==typeof a?a:function(){return a}}(a[1])])}return b}(b),f=-1;for(;++f<e.length;)xe(a,"text",g);function g(a,b){let c,g=-1;for(;++g<b.length;){let a=b[g],e=c?c.children:void 0;if(d(a,e?e.indexOf(a):void 0,c))return;c=a}if(c)return function(a,b){let c=b[b.length-1],d=e[f][0],g=e[f][1],h=0,i=c.children.indexOf(a),j=!1,k=[];d.lastIndex=0;let l=d.exec(a.value);for(;l;){let c=l.index,e={index:l.index,input:l.input,stack:[...b,a]},f=g(...l,e);if("string"==typeof f&&(f=f.length>0?{type:"text",value:f}:void 0),!1===f?d.lastIndex=c+1:(h!==c&&k.push({type:"text",value:a.value.slice(h,c)}),Array.isArray(f)?k.push(...f):f&&k.push(f),h=c+l[0].length,j=!0),!d.global)break;l=d.exec(a.value)}return j?(h<a.value.length&&k.push({type:"text",value:a.value.slice(h)}),c.children.splice(i,1,...k)):k=[a],i+k.length}(a,b)}}(a,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,x2],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,x3]],{ignore:["link","linkReference"]})}function x2(a,b,c,d,e){let f,g="";if(!x4(e))return!1;if(/^w/i.test(b)&&(c=b+c,b="",g="http://"),(f=c.split(".")).length<2||f[f.length-1]&&(/_/.test(f[f.length-1])||!/[a-zA-Z\d]/.test(f[f.length-1]))||f[f.length-2]&&(/_/.test(f[f.length-2])||!/[a-zA-Z\d]/.test(f[f.length-2])))return!1;let h=function(a){let b=/[!"&'),.:;<>?\]}]+$/.exec(a);if(!b)return[a,void 0];a=a.slice(0,b.index);let c=b[0],d=c.indexOf(")"),e=xU(a,"("),f=xU(a,")");for(;-1!==d&&e>f;)a+=c.slice(0,d+1),d=(c=c.slice(d+1)).indexOf(")"),f++;return[a,c]}(c+d);if(!h[0])return!1;let i={type:"link",title:null,url:g+b+h[0],children:[{type:"text",value:b+h[0]}]};return h[1]?[i,{type:"text",value:h[1]}]:i}function x3(a,b,c,d){return!(!x4(d,!0)||/[-\d_]$/.test(c))&&{type:"link",title:null,url:"mailto:"+b+"@"+c,children:[{type:"text",value:b+"@"+c}]}}function x4(a,b){let c=a.input.charCodeAt(a.index-1);return(0===a.index||vZ(c)||vY(c))&&(!b||47!==c)}function x5(){this.buffer()}function x6(a){this.enter({type:"footnoteReference",identifier:"",label:""},a)}function x7(){this.buffer()}function x8(a){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},a)}function x9(a){let b=this.resume(),c=this.stack[this.stack.length-1];uA("footnoteReference"===c.type),c.identifier=wy(this.sliceSerialize(a)).toLowerCase(),c.label=b}function ya(a){this.exit(a)}function yb(a){let b=this.resume(),c=this.stack[this.stack.length-1];uA("footnoteDefinition"===c.type),c.identifier=wy(this.sliceSerialize(a)).toLowerCase(),c.label=b}function yc(a){this.exit(a)}function yd(a,b,c,d){let e=c.createTracker(d),f=e.move("[^"),g=c.enter("footnoteReference"),h=c.enter("reference");return f+=e.move(c.safe(c.associationId(a),{after:"]",before:f})),h(),g(),f+=e.move("]")}function ye(a,b,c){return 0===b?a:yf(a,b,c)}function yf(a,b,c){return(c?"":" ")+a}yd.peek=function(){return"["};let yg=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function yh(a){this.enter({type:"delete",children:[]},a)}function yi(a){this.exit(a)}function yj(a,b,c,d){let e=c.createTracker(d),f=c.enter("strikethrough"),g=e.move("~~");return g+=c.containerPhrasing(a,{...e.current(),before:g,after:"~"}),g+=e.move("~~"),f(),g}function yk(a){return a.length}function yl(a){let b="string"==typeof a?a.codePointAt(0):0;return 67===b||99===b?99:76===b||108===b?108:114*(82===b||114===b)}yj.peek=function(){return"~"};function ym(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}ym.peek=function(){return"`"};w9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let yn=function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||function(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j};function yo(a){let b=a._align;uA(b,"expected `_align` on table"),this.enter({type:"table",align:b.map(function(a){return"none"===a?null:a}),children:[]},a),this.data.inTable=!0}function yp(a){this.exit(a),this.data.inTable=void 0}function yq(a){this.enter({type:"tableRow",children:[]},a)}function yr(a){this.exit(a)}function ys(a){this.enter({type:"tableCell",children:[]},a)}function yt(a){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,yu));let c=this.stack[this.stack.length-1];uA("inlineCode"===c.type),c.value=b,this.exit(a)}function yu(a,b){return"|"===b?b:a}function yv(a){let b=this.stack[this.stack.length-2];uA("listItem"===b.type),b.checked="taskListCheckValueChecked"===a.type}function yw(a){let b=this.stack[this.stack.length-2];if(b&&"listItem"===b.type&&"boolean"==typeof b.checked){let a=this.stack[this.stack.length-1];uA("paragraph"===a.type);let c=a.children[0];if(c&&"text"===c.type){let d,e=b.children,f=-1;for(;++f<e.length;){let a=e[f];if("paragraph"===a.type){d=a;break}}d===a&&(c.value=c.value.slice(1),0===c.value.length?a.children.shift():a.position&&c.position&&"number"==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,a.position.start=Object.assign({},c.position.start)))}}this.exit(a)}function yx(a,b,c,d){let e=a.children[0],f="boolean"==typeof a.checked&&e&&"paragraph"===e.type,g="["+(a.checked?"x":" ")+"] ",h=c.createTracker(d);f&&h.move(g);let i=yn(a,b,c,{...d,...h.current()});return f&&(i=i.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(a){return a+g})),i}let yy={tokenize:function(a,b,c){let d=0;return function b(f){return(87===f||119===f)&&d<3?(d++,a.consume(f),b):46===f&&3===d?(a.consume(f),e):c(f)};function e(a){return null===a?c(a):b(a)}},partial:!0},yz={tokenize:function(a,b,c){let d,e,f;return g;function g(b){return 46===b||95===b?a.check(yB,i,h)(b):null===b||vW(b)||vZ(b)||45!==b&&vY(b)?i(b):(f=!0,a.consume(b),g)}function h(b){return 95===b?d=!0:(e=d,d=void 0),a.consume(b),g}function i(a){return e||d||!f?c(a):b(a)}},partial:!0},yA={tokenize:function(a,b){let c=0,d=0;return e;function e(g){return 40===g?(c++,a.consume(g),e):41===g&&d<c?f(g):33===g||34===g||38===g||39===g||41===g||42===g||44===g||46===g||58===g||59===g||60===g||63===g||93===g||95===g||126===g?a.check(yB,b,f)(g):null===g||vW(g)||vZ(g)?b(g):(a.consume(g),e)}function f(b){return 41===b&&d++,a.consume(b),e}},partial:!0},yB={tokenize:function(a,b,c){return d;function d(g){return 33===g||34===g||39===g||41===g||42===g||44===g||46===g||58===g||59===g||63===g||95===g||126===g?(a.consume(g),d):38===g?(a.consume(g),f):93===g?(a.consume(g),e):60===g||null===g||vW(g)||vZ(g)?b(g):c(g)}function e(a){return null===a||40===a||91===a||vW(a)||vZ(a)?b(a):d(a)}function f(b){return vO(b)?function b(e){return 59===e?(a.consume(e),d):vO(e)?(a.consume(e),b):c(e)}(b):c(b)}},partial:!0},yC={tokenize:function(a,b,c){return function(b){return a.consume(b),d};function d(a){return vP(a)?c(a):b(a)}},partial:!0},yD={name:"wwwAutolink",tokenize:function(a,b,c){let d=this;return function(b){return 87!==b&&119!==b||!yI.call(d,d.previous)||yM(d.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkWww"),a.check(yy,a.attempt(yz,a.attempt(yA,e),c),c)(b))};function e(c){return a.exit("literalAutolinkWww"),a.exit("literalAutolink"),b(c)}},previous:yI},yE={name:"protocolAutolink",tokenize:function(a,b,c){let d=this,e="",f=!1;return function(b){return(72===b||104===b)&&yJ.call(d,d.previous)&&!yM(d.events)?(a.enter("literalAutolink"),a.enter("literalAutolinkHttp"),e+=String.fromCodePoint(b),a.consume(b),g):c(b)};function g(b){if(vO(b)&&e.length<5)return e+=String.fromCodePoint(b),a.consume(b),g;if(58===b){let c=e.toLowerCase();if("http"===c||"https"===c)return a.consume(b),h}return c(b)}function h(b){return 47===b?(a.consume(b),f)?i:(f=!0,h):c(b)}function i(b){return null===b||vR(b)||vW(b)||vZ(b)||vY(b)?c(b):a.attempt(yz,a.attempt(yA,j),c)(b)}function j(c){return a.exit("literalAutolinkHttp"),a.exit("literalAutolink"),b(c)}},previous:yJ},yF={name:"emailAutolink",tokenize:function(a,b,c){let d,e,f=this;return function(b){return!yL(b)||!yK.call(f,f.previous)||yM(f.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkEmail"),function b(d){return yL(d)?(a.consume(d),b):64===d?(a.consume(d),g):c(d)}(b))};function g(b){return 46===b?a.check(yC,i,h)(b):45===b||95===b||vP(b)?(e=!0,a.consume(b),g):i(b)}function h(b){return a.consume(b),d=!0,g}function i(g){return e&&d&&vO(f.previous)?(a.exit("literalAutolinkEmail"),a.exit("literalAutolink"),b(g)):c(g)}},previous:yK},yG={},yH=48;for(;yH<123;)yG[yH]=yF,58==++yH?yH=65:91===yH&&(yH=97);function yI(a){return null===a||40===a||42===a||95===a||91===a||93===a||126===a||vW(a)}function yJ(a){return!vO(a)}function yK(a){return!(47===a||yL(a))}function yL(a){return 43===a||45===a||46===a||95===a||vP(a)}function yM(a){let b=a.length,c=!1;for(;b--;){let d=a[b][1];if(("labelLink"===d.type||"labelImage"===d.type)&&!d._balanced){c=!0;break}if(d._gfmAutolinkLiteralWalkedInto){c=!1;break}}return a.length>0&&!c&&(a[a.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),c}yG[43]=yF,yG[45]=yF,yG[46]=yF,yG[95]=yF,yG[72]=[yF,yE],yG[104]=[yF,yE],yG[87]=[yF,yD],yG[119]=[yF,yD];let yN={tokenize:function(a,b,c){let d=this;return v_(a,function(a){let e=d.events[d.events.length-1];return e&&"gfmFootnoteDefinitionIndent"===e[1].type&&4===e[2].sliceSerialize(e[1],!0).length?b(a):c(a)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function yO(a,b,c){let d,e=this,f=e.events.length,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]);for(;f--;){let a=e.events[f][1];if("labelImage"===a.type){d=a;break}if("gfmFootnoteCall"===a.type||"labelLink"===a.type||"label"===a.type||"image"===a.type||"link"===a.type)break}return function(f){if(!d||!d._balanced)return c(f);let h=wy(e.sliceSerialize({start:d.end,end:e.now()}));return 94===h.codePointAt(0)&&g.includes(h.slice(1))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(f),a.exit("gfmFootnoteCallLabelMarker"),b(f)):c(f)}}function yP(a,b){let c=a.length;for(;c--;)if("labelImage"===a[c][1].type&&"enter"===a[c][0]){a[c][1];break}a[c+1][1].type="data",a[c+3][1].type="gfmFootnoteCallLabelMarker";let d={type:"gfmFootnoteCall",start:Object.assign({},a[c+3][1].start),end:Object.assign({},a[a.length-1][1].end)},e={type:"gfmFootnoteCallMarker",start:Object.assign({},a[c+3][1].end),end:Object.assign({},a[c+3][1].end)};e.end.column++,e.end.offset++,e.end._bufferIndex++;let f={type:"gfmFootnoteCallString",start:Object.assign({},e.end),end:Object.assign({},a[a.length-1][1].start)},g={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},h=[a[c+1],a[c+2],["enter",d,b],a[c+3],a[c+4],["enter",e,b],["exit",e,b],["enter",f,b],["enter",g,b],["exit",g,b],["exit",f,b],a[a.length-2],a[a.length-1],["exit",d,b]];return a.splice(c,a.length-c+1,...h),a}function yQ(a,b,c){let d,e=this,f=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]),g=0;return function(b){return a.enter("gfmFootnoteCall"),a.enter("gfmFootnoteCallLabelMarker"),a.consume(b),a.exit("gfmFootnoteCallLabelMarker"),h};function h(b){return 94!==b?c(b):(a.enter("gfmFootnoteCallMarker"),a.consume(b),a.exit("gfmFootnoteCallMarker"),a.enter("gfmFootnoteCallString"),a.enter("chunkString").contentType="string",i)}function i(h){if(g>999||93===h&&!d||null===h||91===h||vW(h))return c(h);if(93===h){a.exit("chunkString");let d=a.exit("gfmFootnoteCallString");return f.includes(wy(e.sliceSerialize(d)))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(h),a.exit("gfmFootnoteCallLabelMarker"),a.exit("gfmFootnoteCall"),b):c(h)}return vW(h)||(d=!0),g++,a.consume(h),92===h?j:i}function j(b){return 91===b||92===b||93===b?(a.consume(b),g++,i):i(b)}}function yR(a,b,c){let d,e,f=this,g=f.parser.gfmFootnotes||(f.parser.gfmFootnotes=[]),h=0;return function(b){return a.enter("gfmFootnoteDefinition")._container=!0,a.enter("gfmFootnoteDefinitionLabel"),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),i};function i(b){return 94===b?(a.enter("gfmFootnoteDefinitionMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionMarker"),a.enter("gfmFootnoteDefinitionLabelString"),a.enter("chunkString").contentType="string",j):c(b)}function j(b){if(h>999||93===b&&!e||null===b||91===b||vW(b))return c(b);if(93===b){a.exit("chunkString");let c=a.exit("gfmFootnoteDefinitionLabelString");return d=wy(f.sliceSerialize(c)),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),a.exit("gfmFootnoteDefinitionLabel"),l}return vW(b)||(e=!0),h++,a.consume(b),92===b?k:j}function k(b){return 91===b||92===b||93===b?(a.consume(b),h++,j):j(b)}function l(b){return 58===b?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),g.includes(d)||g.push(d),v_(a,m,"gfmFootnoteDefinitionWhitespace")):c(b)}function m(a){return b(a)}}function yS(a,b,c){return a.check(v3,b,a.attempt(yN,b,c))}function yT(a){a.exit("gfmFootnoteDefinition")}class yU{constructor(){this.map=[]}add(a,b,c){!function(a,b,c,d){let e=0;if(0!==c||0!==d.length){for(;e<a.map.length;){if(a.map[e][0]===b){a.map[e][1]+=c,a.map[e][2].push(...d);return}e+=1}a.map.push([b,c,d])}}(this,a,b,c)}consume(a){if(this.map.sort(function(a,b){return a[0]-b[0]}),0===this.map.length)return;let b=this.map.length,c=[];for(;b>0;)b-=1,c.push(a.slice(this.map[b][0]+this.map[b][1]),this.map[b][2]),a.length=this.map[b][0];c.push(a.slice()),a.length=0;let d=c.pop();for(;d;){for(let b of d)a.push(b);d=c.pop()}this.map.length=0}}function yV(a,b,c){let d,e=this,f=0,g=0;return function(a){let b=e.events.length-1;for(;b>-1;){let a=e.events[b][1].type;if("lineEnding"===a||"linePrefix"===a)b--;else break}let d=b>-1?e.events[b][1].type:null,f="tableHead"===d||"tableRow"===d?s:h;return f===s&&e.parser.lazy[e.now().line]?c(a):f(a)};function h(b){var c;return a.enter("tableHead"),a.enter("tableRow"),124===(c=b)||(d=!0,g+=1),i(c)}function i(b){return null===b?c(b):vV(b)?g>1?(g=0,e.interrupt=!0,a.exit("tableRow"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),l):c(b):vX(b)?v_(a,i,"whitespace")(b):(g+=1,d&&(d=!1,f+=1),124===b)?(a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),d=!0,i):(a.enter("data"),j(b))}function j(b){return null===b||124===b||vW(b)?(a.exit("data"),i(b)):(a.consume(b),92===b?k:j)}function k(b){return 92===b||124===b?(a.consume(b),j):j(b)}function l(b){return(e.interrupt=!1,e.parser.lazy[e.now().line])?c(b):(a.enter("tableDelimiterRow"),d=!1,vX(b))?v_(a,m,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):m(b)}function m(b){return 45===b||58===b?o(b):124===b?(d=!0,a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),n):c(b)}function n(b){return vX(b)?v_(a,o,"whitespace")(b):o(b)}function o(b){return 58===b?(g+=1,d=!0,a.enter("tableDelimiterMarker"),a.consume(b),a.exit("tableDelimiterMarker"),p):45===b?(g+=1,p(b)):null===b||vV(b)?r(b):c(b)}function p(b){return 45===b?(a.enter("tableDelimiterFiller"),function b(c){return 45===c?(a.consume(c),b):58===c?(d=!0,a.exit("tableDelimiterFiller"),a.enter("tableDelimiterMarker"),a.consume(c),a.exit("tableDelimiterMarker"),q):(a.exit("tableDelimiterFiller"),q(c))}(b)):c(b)}function q(b){return vX(b)?v_(a,r,"whitespace")(b):r(b)}function r(e){if(124===e)return m(e);if(null===e||vV(e))return d&&f===g?(a.exit("tableDelimiterRow"),a.exit("tableHead"),b(e)):c(e);return c(e)}function s(b){return a.enter("tableRow"),t(b)}function t(c){return 124===c?(a.enter("tableCellDivider"),a.consume(c),a.exit("tableCellDivider"),t):null===c||vV(c)?(a.exit("tableRow"),b(c)):vX(c)?v_(a,t,"whitespace")(c):(a.enter("data"),u(c))}function u(b){return null===b||124===b||vW(b)?(a.exit("data"),t(b)):(a.consume(b),92===b?v:u)}function v(b){return 92===b||124===b?(a.consume(b),u):u(b)}}function yW(a,b){let c,d,e,f=-1,g=!0,h=0,i=[0,0,0,0],j=[0,0,0,0],k=!1,l=0,m=new yU;for(;++f<a.length;){let n=a[f],o=n[1];"enter"===n[0]?"tableHead"===o.type?(k=!1,0!==l&&(yY(m,b,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",c,b]])):"tableRow"===o.type||"tableDelimiterRow"===o.type?(g=!0,e=void 0,i=[0,0,0,0],j=[0,f+1,0,0],k&&(k=!1,d={type:"tableBody",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",d,b]])),h="tableDelimiterRow"===o.type?2:d?3:1):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)?(g=!1,0===j[2]&&(0!==i[1]&&(j[0]=j[1],e=yX(m,b,i,h,void 0,e),i=[0,0,0,0]),j[2]=f)):"tableCellDivider"===o.type&&(g?g=!1:(0!==i[1]&&(j[0]=j[1],e=yX(m,b,i,h,void 0,e)),j=[(i=j)[1],f,0,0])):"tableHead"===o.type?(k=!0,l=f):"tableRow"===o.type||"tableDelimiterRow"===o.type?(l=f,0!==i[1]?(j[0]=j[1],e=yX(m,b,i,h,f,e)):0!==j[1]&&(e=yX(m,b,j,h,f,e)),h=0):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)&&(j[3]=f)}for(0!==l&&yY(m,b,l,c,d),m.consume(b.events),f=-1;++f<b.events.length;){let a=b.events[f];"enter"===a[0]&&"table"===a[1].type&&(a[1]._align=function(a,b){let c=!1,d=[];for(;b<a.length;){let e=a[b];if(c){if("enter"===e[0])"tableContent"===e[1].type&&d.push("tableDelimiterMarker"===a[b+1][1].type?"left":"none");else if("tableContent"===e[1].type){if("tableDelimiterMarker"===a[b-1][1].type){let a=d.length-1;d[a]="left"===d[a]?"center":"right"}}else if("tableDelimiterRow"===e[1].type)break}else"enter"===e[0]&&"tableDelimiterRow"===e[1].type&&(c=!0);b+=1}return d}(b.events,f))}return a}function yX(a,b,c,d,e,f){0!==c[0]&&(f.end=Object.assign({},yZ(b.events,c[0])),a.add(c[0],0,[["exit",f,b]]));let g=yZ(b.events,c[1]);if(f={type:1===d?"tableHeader":2===d?"tableDelimiter":"tableData",start:Object.assign({},g),end:Object.assign({},g)},a.add(c[1],0,[["enter",f,b]]),0!==c[2]){let e=yZ(b.events,c[2]),f=yZ(b.events,c[3]),g={type:"tableContent",start:Object.assign({},e),end:Object.assign({},f)};if(a.add(c[2],0,[["enter",g,b]]),2!==d){let d=b.events[c[2]],e=b.events[c[3]];if(d[1].end=Object.assign({},e[1].end),d[1].type="chunkText",d[1].contentType="text",c[3]>c[2]+1){let b=c[2]+1,d=c[3]-c[2]-1;a.add(b,d,[])}}a.add(c[3]+1,0,[["exit",g,b]])}return void 0!==e&&(f.end=Object.assign({},yZ(b.events,e)),a.add(e,0,[["exit",f,b]]),f=void 0),f}function yY(a,b,c,d,e){let f=[],g=yZ(b.events,c);e&&(e.end=Object.assign({},g),f.push(["exit",e,b])),d.end=Object.assign({},g),f.push(["exit",d,b]),a.add(c+1,0,f)}function yZ(a,b){let c=a[b],d="enter"===c[0]?"start":"end";return c[1][d]}let y$={name:"tasklistCheck",tokenize:function(a,b,c){let d=this;return function(b){return null===d.previous&&d._gfmTasklistFirstContentOfListItem?(a.enter("taskListCheck"),a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),e):c(b)};function e(b){return vW(b)?(a.enter("taskListCheckValueUnchecked"),a.consume(b),a.exit("taskListCheckValueUnchecked"),f):88===b||120===b?(a.enter("taskListCheckValueChecked"),a.consume(b),a.exit("taskListCheckValueChecked"),f):c(b)}function f(b){return 93===b?(a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),a.exit("taskListCheck"),g):c(b)}function g(d){return vV(d)?b(d):vX(d)?a.check({tokenize:y_},b,c)(d):c(d)}}};function y_(a,b,c){return v_(a,function(a){return null===a?c(a):b(a)},"whitespace")}let y0={};function y1(a){let b,c,d,e=a||y0,f=this.data(),g=f.micromarkExtensions||(f.micromarkExtensions=[]),h=f.fromMarkdownExtensions||(f.fromMarkdownExtensions=[]),i=f.toMarkdownExtensions||(f.toMarkdownExtensions=[]);g.push(vN([{text:yG},{document:{91:{name:"gfmFootnoteDefinition",tokenize:yR,continuation:{tokenize:yS},exit:yT}},text:{91:{name:"gfmFootnoteCall",tokenize:yQ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yO,resolveTo:yP}}},(b=(e||{}).singleTilde,c={name:"strikethrough",tokenize:function(a,c,d){let e=this.previous,f=this.events,g=0;return function(h){return 126===e&&"characterEscape"!==f[f.length-1][1].type?d(h):(a.enter("strikethroughSequenceTemporary"),function f(h){let i=wg(e);if(126===h)return g>1?d(h):(a.consume(h),g++,f);if(g<2&&!b)return d(h);let j=a.exit("strikethroughSequenceTemporary"),k=wg(h);return j._open=!k||2===k&&!!i,j._close=!i||2===i&&!!k,c(h)}(h))}},resolveAll:function(a,b){let c=-1;for(;++c<a.length;)if("enter"===a[c][0]&&"strikethroughSequenceTemporary"===a[c][1].type&&a[c][1]._close){let d=c;for(;d--;)if("exit"===a[d][0]&&"strikethroughSequenceTemporary"===a[d][1].type&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset==a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";let e={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",e,b],["enter",a[d][1],b],["exit",a[d][1],b],["enter",f,b]],h=b.parser.constructs.insideSpan.null;h&&vK(g,g.length,0,wh(h,a.slice(d+1,c),b)),vK(g,g.length,0,[["exit",f,b],["enter",a[c][1],b],["exit",a[c][1],b],["exit",e,b]]),vK(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)"strikethroughSequenceTemporary"===a[c][1].type&&(a[c][1].type="data");return a}},null==b&&(b=!0),{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:yV,resolveAll:yW}}},{text:{91:y$}}])),h.push([{transforms:[x1],enter:{literalAutolink:xX,literalAutolinkEmail:xY,literalAutolinkHttp:xY,literalAutolinkWww:xY},exit:{literalAutolink:x0,literalAutolinkEmail:x_,literalAutolinkHttp:xZ,literalAutolinkWww:x$}},{enter:{gfmFootnoteCallString:x5,gfmFootnoteCall:x6,gfmFootnoteDefinitionLabelString:x7,gfmFootnoteDefinition:x8},exit:{gfmFootnoteCallString:x9,gfmFootnoteCall:ya,gfmFootnoteDefinitionLabelString:yb,gfmFootnoteDefinition:yc}},{canContainEols:["delete"],enter:{strikethrough:yh},exit:{strikethrough:yi}},{enter:{table:yo,tableData:ys,tableHeader:ys,tableRow:yq},exit:{codeText:yt,table:yp,tableData:yr,tableHeader:yr,tableRow:yr}},{exit:{taskListCheckValueChecked:yv,taskListCheckValueUnchecked:yv,paragraph:yw}}]),i.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xV,notInConstruct:xW},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xV,notInConstruct:xW},{character:":",before:"[ps]",after:"\\/",inConstruct:xV,notInConstruct:xW}]},(d=!1,e&&e.firstLineBlank&&(d=!0),{handlers:{footnoteDefinition:function(a,b,c,e){let f=c.createTracker(e),g=f.move("[^"),h=c.enter("footnoteDefinition"),i=c.enter("label");return g+=f.move(c.safe(c.associationId(a),{before:g,after:"]"})),i(),g+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),g+=f.move((d?"\n":" ")+c.indentLines(c.containerFlow(a,f.current()),d?yf:ye))),h(),g},footnoteReference:yd},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yg}],handlers:{delete:yj}},function(a){let b=a||{},c=b.tableCellPadding,d=b.tablePipeAlign,e=b.stringLength,f=c?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(a,b,c){let d=ym(a,b,c);return c.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d},table:function(a,b,c,d){return h(function(a,b,c){let d=a.children,e=-1,f=[],g=b.enter("table");for(;++e<d.length;)f[e]=i(d[e],b,c);return g(),f}(a,c,d),a.align)},tableCell:g,tableRow:function(a,b,c,d){let e=h([i(a,c,d)]);return e.slice(0,e.indexOf("\n"))}}};function g(a,b,c,d){let e=c.enter("tableCell"),g=c.enter("phrasing"),h=c.containerPhrasing(a,{...d,before:f,after:f});return g(),e(),h}function h(a,b){return function(a,b){let c=b||{},d=(c.align||[]).concat(),e=c.stringLength||yk,f=[],g=[],h=[],i=[],j=0,k=-1;for(;++k<a.length;){let b=[],d=[],f=-1;for(a[k].length>j&&(j=a[k].length);++f<a[k].length;){var l;let g=null==(l=a[k][f])?"":String(l);if(!1!==c.alignDelimiters){let a=e(g);d[f]=a,(void 0===i[f]||a>i[f])&&(i[f]=a)}b.push(g)}g[k]=b,h[k]=d}let m=-1;if("object"==typeof d&&"length"in d)for(;++m<j;)f[m]=yl(d[m]);else{let a=yl(d);for(;++m<j;)f[m]=a}m=-1;let n=[],o=[];for(;++m<j;){let a=f[m],b="",d="";99===a?(b=":",d=":"):108===a?b=":":114===a&&(d=":");let e=!1===c.alignDelimiters?1:Math.max(1,i[m]-b.length-d.length),g=b+"-".repeat(e)+d;!1!==c.alignDelimiters&&((e=b.length+e+d.length)>i[m]&&(i[m]=e),o[m]=e),n[m]=g}g.splice(1,0,n),h.splice(1,0,o),k=-1;let p=[];for(;++k<g.length;){let a=g[k],b=h[k];m=-1;let d=[];for(;++m<j;){let e=a[m]||"",g="",h="";if(!1!==c.alignDelimiters){let a=i[m]-(b[m]||0),c=f[m];114===c?g=" ".repeat(a):99===c?a%2?(g=" ".repeat(a/2+.5),h=" ".repeat(a/2-.5)):h=g=" ".repeat(a/2):h=" ".repeat(a)}!1===c.delimiterStart||m||d.push("|"),!1!==c.padding&&(!1!==c.alignDelimiters||""!==e)&&(!1!==c.delimiterStart||m)&&d.push(" "),!1!==c.alignDelimiters&&d.push(g),d.push(e),!1!==c.alignDelimiters&&d.push(h),!1!==c.padding&&d.push(" "),(!1!==c.delimiterEnd||m!==j-1)&&d.push("|")}p.push(!1===c.delimiterEnd?d.join("").replace(/ +$/,""):d.join(""))}return p.join("\n")}(a,{align:b,alignDelimiters:d,padding:c,stringLength:e})}function i(a,b,c){let d=a.children,e=-1,f=[],h=b.enter("tableRow");for(;++e<d.length;)f[e]=g(d[e],a,b,c);return h(),f}}(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:yx}}]})}let y2={tokenize:function(a,b,c){let d=this,e=d.events[d.events.length-1],f=e&&"linePrefix"===e[1].type?e[2].sliceSerialize(e[1],!0).length:0,g=0;return function(b){return a.enter("mathFlow"),a.enter("mathFlowFence"),a.enter("mathFlowFenceSequence"),function b(d){return 36===d?(a.consume(d),g++,b):g<2?c(d):(a.exit("mathFlowFenceSequence"),v_(a,h,"whitespace")(d))}(b)};function h(b){return null===b||vV(b)?i(b):(a.enter("mathFlowFenceMeta"),a.enter("chunkString",{contentType:"string"}),function b(d){return null===d||vV(d)?(a.exit("chunkString"),a.exit("mathFlowFenceMeta"),i(d)):36===d?c(d):(a.consume(d),b)}(b))}function i(c){return(a.exit("mathFlowFence"),d.interrupt)?b(c):a.attempt(y3,j,m)(c)}function j(b){return a.attempt({tokenize:n,partial:!0},m,k)(b)}function k(b){return(f?v_(a,l,"linePrefix",f+1):l)(b)}function l(b){return null===b?m(b):vV(b)?a.attempt(y3,j,m)(b):(a.enter("mathFlowValue"),function b(c){return null===c||vV(c)?(a.exit("mathFlowValue"),l(c)):(a.consume(c),b)}(b))}function m(c){return a.exit("mathFlow"),b(c)}function n(a,b,c){let e=0;return v_(a,function(b){return a.enter("mathFlowFence"),a.enter("mathFlowFenceSequence"),function b(d){return 36===d?(e++,a.consume(d),b):e<g?c(d):(a.exit("mathFlowFenceSequence"),v_(a,f,"whitespace")(d))}(b)},"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function f(d){return null===d||vV(d)?(a.exit("mathFlowFence"),b(d)):c(d)}}},concrete:!0,name:"mathFlow"},y3={tokenize:function(a,b,c){let d=this;return function(c){return null===c?b(c):(a.enter("lineEnding"),a.consume(c),a.exit("lineEnding"),e)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}},partial:!0};function y4(a){let b,c,d=a.length-4,e=3;if(("lineEnding"===a[3][1].type||"space"===a[e][1].type)&&("lineEnding"===a[d][1].type||"space"===a[d][1].type)){for(b=e;++b<d;)if("mathTextData"===a[b][1].type){a[d][1].type="mathTextPadding",a[e][1].type="mathTextPadding",e+=2,d-=2;break}}for(b=e-1,d++;++b<=d;)void 0===c?b!==d&&"lineEnding"!==a[b][1].type&&(c=b):(b===d||"lineEnding"===a[b][1].type)&&(a[c][1].type="mathTextData",b!==c+2&&(a[c][1].end=a[b-1][1].end,a.splice(c+2,b-c-2),d-=b-c-2,b=c+2),c=void 0);return a}function y5(a){return 36!==a||"characterEscape"===this.events[this.events.length-1][1].type}let y6={};function y7(a){let b,c=a||y6,d=this.data(),e=d.micromarkExtensions||(d.micromarkExtensions=[]),f=d.fromMarkdownExtensions||(d.fromMarkdownExtensions=[]),g=d.toMarkdownExtensions||(d.toMarkdownExtensions=[]);e.push({flow:{36:y2},text:{36:(null==(b=(c||{}).singleDollarTextMath)&&(b=!0),{tokenize:function(a,c,d){let e,f,g=0;return function(c){return a.enter("mathText"),a.enter("mathTextSequence"),function c(e){return 36===e?(a.consume(e),g++,c):g<2&&!b?d(e):(a.exit("mathTextSequence"),h(e))}(c)};function h(b){return null===b?d(b):36===b?(f=a.enter("mathTextSequence"),e=0,function b(d){return 36===d?(a.consume(d),e++,b):e===g?(a.exit("mathTextSequence"),a.exit("mathText"),c(d)):(f.type="mathTextData",i(d))}(b)):32===b?(a.enter("space"),a.consume(b),a.exit("space"),h):vV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),h):(a.enter("mathTextData"),i(b))}function i(b){return null===b||32===b||36===b||vV(b)?(a.exit("mathTextData"),h(b)):(a.consume(b),i)}},resolve:y4,previous:y5,name:"mathText"})}}),f.push(function(){return{enter:{mathFlow:function(a){this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[{type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]}]}},a)},mathFlowFenceMeta:function(){this.buffer()},mathText:function(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}},exit:{mathFlow:function(a){let b=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),c=this.stack[this.stack.length-1];uA("math"===c.type),this.exit(a),c.value=b;let d=c.data.hChildren[0];uA("element"===d.type),uA("code"===d.tagName),d.children.push({type:"text",value:b}),this.data.mathFlowInside=void 0},mathFlowFence:function(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)},mathFlowFenceMeta:function(){let a=this.resume(),b=this.stack[this.stack.length-1];uA("math"===b.type),b.meta=a},mathFlowValue:a,mathText:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];uA("inlineMath"===c.type),this.exit(a),c.value=b,c.data.hChildren.push({type:"text",value:b})},mathTextData:a}};function a(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}()),g.push(function(a){let b=(a||{}).singleDollarTextMath;return null==b&&(b=!0),c.peek=function(){return"$"},{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:"\n",inConstruct:"mathFlowMeta"},{character:"$",after:b?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:function(a,b,c,d){let e=a.value||"",f=c.createTracker(d),g="$".repeat(Math.max(function(a){let b=String(a),c=b.indexOf("$"),d=c,e=0,f=0;!1;for(;-1!==c;)c===d?++e>f&&(f=e):e=1,d=c+1,c=b.indexOf("$",d);return f}(e)+1,2)),h=c.enter("mathFlow"),i=f.move(g);if(a.meta){let b=c.enter("mathFlowMeta");i+=f.move(c.safe(a.meta,{after:"\n",before:i,encode:["$"],...f.current()})),b()}return i+=f.move("\n"),e&&(i+=f.move(e+"\n")),i+=f.move(g),h(),i},inlineMath:c}};function c(a,c,d){let e=a.value||"",f=1;for(!b&&f++;RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(e);)f++;let g="$".repeat(f);/[^ \r\n]/.test(e)&&(/^[ \r\n]/.test(e)&&/[ \r\n]$/.test(e)||/^\$|\$$/.test(e))&&(e=" "+e+" ");let h=-1;for(;++h<d.unsafe.length;){let a,b=d.unsafe[h];if(!b.atBreak)continue;let c=d.compilePattern(b);for(;a=c.exec(e);){let b=a.index;10===e.codePointAt(b)&&13===e.codePointAt(b-1)&&b--,e=e.slice(0,b)+" "+e.slice(a.index+1)}}return g+e+g}}(c))}let y8=/[#.]/g;function y9(a,b,c){let d=c?function(a){let b=new Map;for(let c of a)b.set(c.toLowerCase(),c);return b}(c):void 0;return function(c,e,...f){let g;if(null==c)g={type:"root",children:[]},f.unshift(e);else{let h=(g=function(a,b){let c,d,e=a||"",f={},g=0;for(;g<e.length;){y8.lastIndex=g;let a=y8.exec(e),b=e.slice(g,a?a.index:e.length);b&&(c?"#"===c?f.id=b:Array.isArray(f.className)?f.className.push(b):f.className=[b]:d=b,g+=b.length),a&&(c=a[0],g++)}return{type:"element",tagName:d||b||"div",properties:f,children:[]}}(c,b)).tagName.toLowerCase(),i=d?d.get(h):void 0;if(g.tagName=i||h,function(a){if(null===a||"object"!=typeof a||Array.isArray(a))return!0;if("string"!=typeof a.type)return!1;for(let b of Object.keys(a)){let c=a[b];if(c&&"object"==typeof c){if(!Array.isArray(c))return!0;for(let a of c)if("number"!=typeof a&&"string"!=typeof a)return!0}}return!!("children"in a&&Array.isArray(a.children))}(e))f.unshift(e);else for(let[b,c]of Object.entries(e))!function(a,b,c,d){let e,f=u_(a,c);if(null!=d){if("number"==typeof d){if(Number.isNaN(d))return;e=d}else e="boolean"==typeof d?d:"string"==typeof d?f.spaceSeparated?vg(d):f.commaSeparated?uC(d):f.commaOrSpaceSeparated?vg(uC(d).join(" ")):za(f,f.property,d):Array.isArray(d)?[...d]:"style"===f.property?function(a){let b=[];for(let[c,d]of Object.entries(a))b.push([c,d].join(": "));return b.join("; ")}(d):String(d);if(Array.isArray(e)){let a=[];for(let b of e)a.push(za(f,f.property,b));e=a}"className"===f.property&&Array.isArray(b.className)&&(e=b.className.concat(e)),b[f.property]=e}}(a,g.properties,b,c)}for(let a of f)!function a(b,c){if(null==c);else if("number"==typeof c||"string"==typeof c)b.push({type:"text",value:String(c)});else if(Array.isArray(c))for(let d of c)a(b,d);else if("object"==typeof c&&"type"in c)"root"===c.type?a(b,c.children):b.push(c);else throw Error("Expected node, nodes, or string, got `"+c+"`")}(g.children,a);return"element"===g.type&&"template"===g.tagName&&(g.content={type:"root",children:g.children},g.children=[]),g}}function za(a,b,c){if("string"==typeof c){if(a.number&&c&&!Number.isNaN(Number(c)))return Number(c);if((a.boolean||a.overloadedBoolean)&&(""===c||uX(c)===uX(b)))return!0}return c}let zb=y9(ve,"div"),zc=y9(vf,"g",["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]);function zd(a,b){let c=a.indexOf("\r",b),d=a.indexOf("\n",b);return -1===d?c:-1===c||c+1===d?d:c<d?c:d}let ze={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},zf={}.hasOwnProperty,zg=Object.prototype;function zh(a,b){let c=b||{};return zi({file:c.file||void 0,location:!1,schema:"svg"===c.space?vf:ve,verbose:c.verbose||!1},a)}function zi(a,b){let c;switch(b.nodeName){case"#comment":return c={type:"comment",value:b.data},zk(a,b,c),c;case"#document":case"#document-fragment":{let d="mode"in b&&("quirks"===b.mode||"limited-quirks"===b.mode);if(c={type:"root",children:zj(a,b.childNodes),data:{quirksMode:d}},a.file&&a.location){let b,d,e=String(a.file),f=(b=String(e),d=[],{toOffset:function(a){if(a&&"number"==typeof a.line&&"number"==typeof a.column&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;d.length<a.line;){let a=d[d.length-1],c=zd(b,a),e=-1===c?b.length+1:c+1;if(a===e)break;d.push(e)}let c=(a.line>1?d[a.line-2]:0)+a.column-1;if(c<d[a.line-1])return c}},toPoint:function(a){if("number"==typeof a&&a>-1&&a<=b.length){let c=0;for(;;){let e=d[c];if(void 0===e){let a=zd(b,d[c-1]);e=-1===a?b.length+1:a+1,d[c]=e}if(e>a)return{line:c+1,column:a-(c>0?d[c-1]:0)+1,offset:a};c++}}}}),g=f.toPoint(0),h=f.toPoint(e.length);uA(g,"expected `start`"),uA(h,"expected `end`"),c.position={start:g,end:h}}return c}case"#documentType":return zk(a,b,c={type:"doctype"}),c;case"#text":return c={type:"text",value:b.value},zk(a,b,c),c;default:return function(a,b){let c=a.schema;a.schema=b.namespaceURI===ze.svg?vf:ve;let d=-1,e={};for(;++d<b.attrs.length;){let a=b.attrs[d],c=(a.prefix?a.prefix+":":"")+a.name;zf.call(zg,c)||(e[c]=a.value)}let f=("svg"===a.schema.space?zc:zb)(b.tagName,e,zj(a,b.childNodes));if(zk(a,b,f),"template"===f.tagName){let c=b.sourceCodeLocation,d=c&&c.startTag&&zl(c.startTag),e=c&&c.endTag&&zl(c.endTag),g=zi(a,b.content);d&&e&&a.file&&(g.position={start:d.end,end:e.start}),f.content=g}return a.schema=c,f}(a,b)}}function zj(a,b){let c=-1,d=[];for(;++c<b.length;){let e=zi(a,b[c]);d.push(e)}return d}function zk(a,b,c){if("sourceCodeLocation"in b&&b.sourceCodeLocation&&a.file){let d=function(a,b,c){let d=zl(c);if("element"===b.type){let e=b.children[b.children.length-1];if(d&&!c.endTag&&e&&e.position&&e.position.end&&(d.end=Object.assign({},e.position.end)),a.verbose){let d,e={};if(c.attrs)for(d in c.attrs)zf.call(c.attrs,d)&&(e[u_(a.schema,d).property]=zl(c.attrs[d]));uA(c.startTag,"a start tag should exist");let f=zl(c.startTag),g=c.endTag?zl(c.endTag):void 0,h={opening:f};g&&(h.closing=g),h.properties=e,b.data={position:h}}}return d}(a,c,b.sourceCodeLocation);d&&(a.location=!0,c.position=d)}}function zl(a){let b=zm({line:a.startLine,column:a.startCol,offset:a.startOffset}),c=zm({line:a.endLine,column:a.endCol,offset:a.endOffset});return b||c?{start:b,end:c}:void 0}function zm(a){return a.line&&a.column?a:void 0}let zn={}.hasOwnProperty;function zo(a,b){let c=b||{};function d(b,...c){let e=d.invalid,f=d.handlers;if(b&&zn.call(b,a)){let c=String(b[a]);e=zn.call(f,c)?f[c]:d.unknown}if(e)return e.call(this,b,...c)}return d.handlers=c.handlers||{},d.invalid=c.invalid,d.unknown=c.unknown,d}let zp={}.hasOwnProperty,zq=zo("type",{handlers:{root:function(a,b){let c={nodeName:"#document",mode:(a.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return c.childNodes=zr(a.children,c,b),zs(a,c),c},element:function(a,b){var c,d;let e,f,g=b;"element"===a.type&&"svg"===a.tagName.toLowerCase()&&"html"===b.space&&(g=vf);let h=[];if(a.properties){for(e in a.properties)if("children"!==e&&zp.call(a.properties,e)){let b=function(a,b,c){let d=u_(a,b);if(!1===c||null==c||"number"==typeof c&&Number.isNaN(c)||!c&&d.boolean)return;Array.isArray(c)&&(c=d.commaSeparated?uD(c):vh(c));let e={name:d.attribute,value:!0===c?"":String(c)};if(d.space&&"html"!==d.space&&"svg"!==d.space){let a=e.name.indexOf(":");a<0?e.prefix="":(e.name=e.name.slice(a+1),e.prefix=d.attribute.slice(0,a)),e.namespace=ze[d.space]}return e}(g,e,a.properties[e]);b&&h.push(b)}}let i=g.space;uA(i);let j={nodeName:a.tagName,tagName:a.tagName,attrs:h,namespaceURI:ze[i],childNodes:[],parentNode:null};return j.childNodes=zr(a.children,j,g),zs(a,j),"template"===a.tagName&&a.content&&(c=a.content,d=g,(f={nodeName:"#document-fragment",childNodes:[]}).childNodes=zr(c.children,f,d),zs(c,f),j.content=f),j},text:function(a){let b={nodeName:"#text",value:a.value,parentNode:null};return zs(a,b),b},comment:function(a){let b={nodeName:"#comment",data:a.value,parentNode:null};return zs(a,b),b},doctype:function(a){let b={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return zs(a,b),b}}});function zr(a,b,c){let d=-1,e=[];if(a)for(;++d<a.length;){let f=zq(a[d],c);f.parentNode=b,e.push(f)}return e}function zs(a,b){let c=a.position;c&&c.start&&c.end&&(uA("number"==typeof c.start.offset),uA("number"==typeof c.end.offset),b.sourceCodeLocation={startLine:c.start.line,startCol:c.start.column,startOffset:c.start.offset,endLine:c.end.line,endCol:c.end.column,endOffset:c.end.offset})}let zt=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],zu=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]);(M=ak||(ak={}))[M.EOF=-1]="EOF",M[M.NULL=0]="NULL",M[M.TABULATION=9]="TABULATION",M[M.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",M[M.LINE_FEED=10]="LINE_FEED",M[M.FORM_FEED=12]="FORM_FEED",M[M.SPACE=32]="SPACE",M[M.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",M[M.QUOTATION_MARK=34]="QUOTATION_MARK",M[M.AMPERSAND=38]="AMPERSAND",M[M.APOSTROPHE=39]="APOSTROPHE",M[M.HYPHEN_MINUS=45]="HYPHEN_MINUS",M[M.SOLIDUS=47]="SOLIDUS",M[M.DIGIT_0=48]="DIGIT_0",M[M.DIGIT_9=57]="DIGIT_9",M[M.SEMICOLON=59]="SEMICOLON",M[M.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",M[M.EQUALS_SIGN=61]="EQUALS_SIGN",M[M.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",M[M.QUESTION_MARK=63]="QUESTION_MARK",M[M.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",M[M.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",M[M.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",M[M.GRAVE_ACCENT=96]="GRAVE_ACCENT",M[M.LATIN_SMALL_A=97]="LATIN_SMALL_A",M[M.LATIN_SMALL_Z=122]="LATIN_SMALL_Z";let zv="[CDATA[",zw="doctype",zx="script";function zy(a){return a>=55296&&a<=57343}function zz(a){return 32!==a&&10!==a&&13!==a&&9!==a&&12!==a&&a>=1&&a<=31||a>=127&&a<=159}function zA(a){return a>=64976&&a<=65007||zu.has(a)}(N=al||(al={})).controlCharacterInInputStream="control-character-in-input-stream",N.noncharacterInInputStream="noncharacter-in-input-stream",N.surrogateInInputStream="surrogate-in-input-stream",N.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",N.endTagWithAttributes="end-tag-with-attributes",N.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",N.unexpectedSolidusInTag="unexpected-solidus-in-tag",N.unexpectedNullCharacter="unexpected-null-character",N.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",N.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",N.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",N.missingEndTagName="missing-end-tag-name",N.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",N.unknownNamedCharacterReference="unknown-named-character-reference",N.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",N.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",N.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",N.eofBeforeTagName="eof-before-tag-name",N.eofInTag="eof-in-tag",N.missingAttributeValue="missing-attribute-value",N.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",N.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",N.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",N.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",N.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",N.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",N.missingDoctypePublicIdentifier="missing-doctype-public-identifier",N.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",N.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",N.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",N.cdataInHtmlContent="cdata-in-html-content",N.incorrectlyOpenedComment="incorrectly-opened-comment",N.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",N.eofInDoctype="eof-in-doctype",N.nestedComment="nested-comment",N.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",N.eofInComment="eof-in-comment",N.incorrectlyClosedComment="incorrectly-closed-comment",N.eofInCdata="eof-in-cdata",N.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",N.nullCharacterReference="null-character-reference",N.surrogateCharacterReference="surrogate-character-reference",N.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",N.controlCharacterReference="control-character-reference",N.noncharacterCharacterReference="noncharacter-character-reference",N.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",N.missingDoctypeName="missing-doctype-name",N.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",N.duplicateAttribute="duplicate-attribute",N.nonConformingDoctype="non-conforming-doctype",N.missingDoctype="missing-doctype",N.misplacedDoctype="misplaced-doctype",N.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",N.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",N.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",N.openElementsLeftAfterEof="open-elements-left-after-eof",N.abandonedHeadElementChild="abandoned-head-element-child",N.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",N.nestedNoscriptInHead="nested-noscript-in-head",N.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text";class zB{constructor(a){this.handler=a,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(a,b){let{line:c,col:d,offset:e}=this,f=d+b,g=e+b;return{code:a,startLine:c,endLine:c,startCol:f,endCol:f,startOffset:g,endOffset:g}}_err(a){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(a,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(a){if(this.pos!==this.html.length-1){let b=this.html.charCodeAt(this.pos+1);if(b>=56320&&b<=57343)return this.pos++,this._addGap(),(a-55296)*1024+9216+b}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ak.EOF;return this._err(al.surrogateInInputStream),a}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(a,b){this.html.length>0?this.html+=a:this.html=a,this.endOfChunkHit=!1,this.lastChunkWritten=b}insertHtmlAtCurrentPos(a){this.html=this.html.substring(0,this.pos+1)+a+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(a,b){if(this.pos+a.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(b)return this.html.startsWith(a,this.pos);for(let b=0;b<a.length;b++)if((32|this.html.charCodeAt(this.pos+b))!==a.charCodeAt(b))return!1;return!0}peek(a){let b=this.pos+a;if(b>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ak.EOF;let c=this.html.charCodeAt(b);return c===ak.CARRIAGE_RETURN?ak.LINE_FEED:c}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ak.EOF;let a=this.html.charCodeAt(this.pos);return a===ak.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ak.LINE_FEED):a===ak.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,zy(a)&&(a=this._processSurrogate(a)),null===this.handler.onParseError||a>31&&a<127||a===ak.LINE_FEED||a===ak.CARRIAGE_RETURN||a>159&&a<64976||this._checkForProblematicCharacters(a),a)}_checkForProblematicCharacters(a){zz(a)?this._err(al.controlCharacterInInputStream):zA(a)&&this._err(al.noncharacterInInputStream)}retreat(a){for(this.pos-=a;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}function zC(a,b){for(let c=a.attrs.length-1;c>=0;c--)if(a.attrs[c].name===b)return a.attrs[c].value;return null}(O=am||(am={}))[O.CHARACTER=0]="CHARACTER",O[O.NULL_CHARACTER=1]="NULL_CHARACTER",O[O.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",O[O.START_TAG=3]="START_TAG",O[O.END_TAG=4]="END_TAG",O[O.COMMENT=5]="COMMENT",O[O.DOCTYPE=6]="DOCTYPE",O[O.EOF=7]="EOF",O[O.HIBERNATION=8]="HIBERNATION",a.s(["TokenType",0,am,"getTokenAttr",0,zC],61659);let zD=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(a=>a.charCodeAt(0))),zE=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function zF(a){return a>=ao.ZERO&&a<=ao.NINE}an=String.fromCodePoint,(P=ao||(ao={}))[P.NUM=35]="NUM",P[P.SEMI=59]="SEMI",P[P.EQUALS=61]="EQUALS",P[P.ZERO=48]="ZERO",P[P.NINE=57]="NINE",P[P.LOWER_A=97]="LOWER_A",P[P.LOWER_F=102]="LOWER_F",P[P.LOWER_X=120]="LOWER_X",P[P.LOWER_Z=122]="LOWER_Z",P[P.UPPER_A=65]="UPPER_A",P[P.UPPER_F=70]="UPPER_F",P[P.UPPER_Z=90]="UPPER_Z",(Q=ap||(ap={}))[Q.VALUE_LENGTH=49152]="VALUE_LENGTH",Q[Q.BRANCH_LENGTH=16256]="BRANCH_LENGTH",Q[Q.JUMP_TABLE=127]="JUMP_TABLE",(R=aq||(aq={}))[R.EntityStart=0]="EntityStart",R[R.NumericStart=1]="NumericStart",R[R.NumericDecimal=2]="NumericDecimal",R[R.NumericHex=3]="NumericHex",R[R.NamedEntity=4]="NamedEntity",(S=ar||(ar={}))[S.Legacy=0]="Legacy",S[S.Strict=1]="Strict",S[S.Attribute=2]="Attribute";class zG{constructor(a,b,c){this.decodeTree=a,this.emitCodePoint=b,this.errors=c,this.state=aq.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ar.Strict}startEntity(a){this.decodeMode=a,this.state=aq.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(a,b){switch(this.state){case aq.EntityStart:if(a.charCodeAt(b)===ao.NUM)return this.state=aq.NumericStart,this.consumed+=1,this.stateNumericStart(a,b+1);return this.state=aq.NamedEntity,this.stateNamedEntity(a,b);case aq.NumericStart:return this.stateNumericStart(a,b);case aq.NumericDecimal:return this.stateNumericDecimal(a,b);case aq.NumericHex:return this.stateNumericHex(a,b);case aq.NamedEntity:return this.stateNamedEntity(a,b)}}stateNumericStart(a,b){return b>=a.length?-1:(32|a.charCodeAt(b))===ao.LOWER_X?(this.state=aq.NumericHex,this.consumed+=1,this.stateNumericHex(a,b+1)):(this.state=aq.NumericDecimal,this.stateNumericDecimal(a,b))}addToNumericResult(a,b,c,d){if(b!==c){let e=c-b;this.result=this.result*Math.pow(d,e)+Number.parseInt(a.substr(b,e),d),this.consumed+=e}}stateNumericHex(a,b){let c=b;for(;b<a.length;){var d;let e=a.charCodeAt(b);if(!zF(e)&&(!((d=e)>=ao.UPPER_A)||!(d<=ao.UPPER_F))&&(!(d>=ao.LOWER_A)||!(d<=ao.LOWER_F)))return this.addToNumericResult(a,c,b,16),this.emitNumericEntity(e,3);b+=1}return this.addToNumericResult(a,c,b,16),-1}stateNumericDecimal(a,b){let c=b;for(;b<a.length;){let d=a.charCodeAt(b);if(!zF(d))return this.addToNumericResult(a,c,b,10),this.emitNumericEntity(d,2);b+=1}return this.addToNumericResult(a,c,b,10),-1}emitNumericEntity(a,b){var c,d,e;if(this.consumed<=b)return null==(c=this.errors)||c.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(a===ao.SEMI)this.consumed+=1;else if(this.decodeMode===ar.Strict)return 0;return this.emitCodePoint((d=this.result)>=55296&&d<=57343||d>1114111?65533:null!=(e=zE.get(d))?e:d,this.consumed),this.errors&&(a!==ao.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(a,b){let{decodeTree:c}=this,d=c[this.treeIndex],e=(d&ap.VALUE_LENGTH)>>14;for(;b<a.length;b++,this.excess++){let f=a.charCodeAt(b);if(this.treeIndex=function(a,b,c,d){let e=(b&ap.BRANCH_LENGTH)>>7,f=b&ap.JUMP_TABLE;if(0===e)return 0!==f&&d===f?c:-1;if(f){let b=d-f;return b<0||b>=e?-1:a[c+b]-1}let g=c,h=g+e-1;for(;g<=h;){let b=g+h>>>1,c=a[b];if(c<d)g=b+1;else{if(!(c>d))return a[b+e];h=b-1}}return -1}(c,d,this.treeIndex+Math.max(1,e),f),this.treeIndex<0)return 0===this.result||this.decodeMode===ar.Attribute&&(0===e||function(a){var b;return a===ao.EQUALS||(b=a)>=ao.UPPER_A&&b<=ao.UPPER_Z||b>=ao.LOWER_A&&b<=ao.LOWER_Z||zF(b)}(f))?0:this.emitNotTerminatedNamedEntity();if(0!=(e=((d=c[this.treeIndex])&ap.VALUE_LENGTH)>>14)){if(f===ao.SEMI)return this.emitNamedEntityData(this.treeIndex,e,this.consumed+this.excess);this.decodeMode!==ar.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return -1}emitNotTerminatedNamedEntity(){var a;let{result:b,decodeTree:c}=this,d=(c[b]&ap.VALUE_LENGTH)>>14;return this.emitNamedEntityData(b,d,this.consumed),null==(a=this.errors)||a.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(a,b,c){let{decodeTree:d}=this;return this.emitCodePoint(1===b?d[a]&~ap.VALUE_LENGTH:d[a+1],c),3===b&&this.emitCodePoint(d[a+2],c),c}end(){var a;switch(this.state){case aq.NamedEntity:return 0!==this.result&&(this.decodeMode!==ar.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case aq.NumericDecimal:return this.emitNumericEntity(0,2);case aq.NumericHex:return this.emitNumericEntity(0,3);case aq.NumericStart:return null==(a=this.errors)||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case aq.EntityStart:return 0}}}(T=as||(as={})).HTML="http://www.w3.org/1999/xhtml",T.MATHML="http://www.w3.org/1998/Math/MathML",T.SVG="http://www.w3.org/2000/svg",T.XLINK="http://www.w3.org/1999/xlink",T.XML="http://www.w3.org/XML/1998/namespace",T.XMLNS="http://www.w3.org/2000/xmlns/",(U=at||(at={})).TYPE="type",U.ACTION="action",U.ENCODING="encoding",U.PROMPT="prompt",U.NAME="name",U.COLOR="color",U.FACE="face",U.SIZE="size",(V=au||(au={})).NO_QUIRKS="no-quirks",V.QUIRKS="quirks",V.LIMITED_QUIRKS="limited-quirks",(W=av||(av={})).A="a",W.ADDRESS="address",W.ANNOTATION_XML="annotation-xml",W.APPLET="applet",W.AREA="area",W.ARTICLE="article",W.ASIDE="aside",W.B="b",W.BASE="base",W.BASEFONT="basefont",W.BGSOUND="bgsound",W.BIG="big",W.BLOCKQUOTE="blockquote",W.BODY="body",W.BR="br",W.BUTTON="button",W.CAPTION="caption",W.CENTER="center",W.CODE="code",W.COL="col",W.COLGROUP="colgroup",W.DD="dd",W.DESC="desc",W.DETAILS="details",W.DIALOG="dialog",W.DIR="dir",W.DIV="div",W.DL="dl",W.DT="dt",W.EM="em",W.EMBED="embed",W.FIELDSET="fieldset",W.FIGCAPTION="figcaption",W.FIGURE="figure",W.FONT="font",W.FOOTER="footer",W.FOREIGN_OBJECT="foreignObject",W.FORM="form",W.FRAME="frame",W.FRAMESET="frameset",W.H1="h1",W.H2="h2",W.H3="h3",W.H4="h4",W.H5="h5",W.H6="h6",W.HEAD="head",W.HEADER="header",W.HGROUP="hgroup",W.HR="hr",W.HTML="html",W.I="i",W.IMG="img",W.IMAGE="image",W.INPUT="input",W.IFRAME="iframe",W.KEYGEN="keygen",W.LABEL="label",W.LI="li",W.LINK="link",W.LISTING="listing",W.MAIN="main",W.MALIGNMARK="malignmark",W.MARQUEE="marquee",W.MATH="math",W.MENU="menu",W.META="meta",W.MGLYPH="mglyph",W.MI="mi",W.MO="mo",W.MN="mn",W.MS="ms",W.MTEXT="mtext",W.NAV="nav",W.NOBR="nobr",W.NOFRAMES="noframes",W.NOEMBED="noembed",W.NOSCRIPT="noscript",W.OBJECT="object",W.OL="ol",W.OPTGROUP="optgroup",W.OPTION="option",W.P="p",W.PARAM="param",W.PLAINTEXT="plaintext",W.PRE="pre",W.RB="rb",W.RP="rp",W.RT="rt",W.RTC="rtc",W.RUBY="ruby",W.S="s",W.SCRIPT="script",W.SEARCH="search",W.SECTION="section",W.SELECT="select",W.SOURCE="source",W.SMALL="small",W.SPAN="span",W.STRIKE="strike",W.STRONG="strong",W.STYLE="style",W.SUB="sub",W.SUMMARY="summary",W.SUP="sup",W.TABLE="table",W.TBODY="tbody",W.TEMPLATE="template",W.TEXTAREA="textarea",W.TFOOT="tfoot",W.TD="td",W.TH="th",W.THEAD="thead",W.TITLE="title",W.TR="tr",W.TRACK="track",W.TT="tt",W.U="u",W.UL="ul",W.SVG="svg",W.VAR="var",W.WBR="wbr",W.XMP="xmp",(X=aw||(aw={}))[X.UNKNOWN=0]="UNKNOWN",X[X.A=1]="A",X[X.ADDRESS=2]="ADDRESS",X[X.ANNOTATION_XML=3]="ANNOTATION_XML",X[X.APPLET=4]="APPLET",X[X.AREA=5]="AREA",X[X.ARTICLE=6]="ARTICLE",X[X.ASIDE=7]="ASIDE",X[X.B=8]="B",X[X.BASE=9]="BASE",X[X.BASEFONT=10]="BASEFONT",X[X.BGSOUND=11]="BGSOUND",X[X.BIG=12]="BIG",X[X.BLOCKQUOTE=13]="BLOCKQUOTE",X[X.BODY=14]="BODY",X[X.BR=15]="BR",X[X.BUTTON=16]="BUTTON",X[X.CAPTION=17]="CAPTION",X[X.CENTER=18]="CENTER",X[X.CODE=19]="CODE",X[X.COL=20]="COL",X[X.COLGROUP=21]="COLGROUP",X[X.DD=22]="DD",X[X.DESC=23]="DESC",X[X.DETAILS=24]="DETAILS",X[X.DIALOG=25]="DIALOG",X[X.DIR=26]="DIR",X[X.DIV=27]="DIV",X[X.DL=28]="DL",X[X.DT=29]="DT",X[X.EM=30]="EM",X[X.EMBED=31]="EMBED",X[X.FIELDSET=32]="FIELDSET",X[X.FIGCAPTION=33]="FIGCAPTION",X[X.FIGURE=34]="FIGURE",X[X.FONT=35]="FONT",X[X.FOOTER=36]="FOOTER",X[X.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",X[X.FORM=38]="FORM",X[X.FRAME=39]="FRAME",X[X.FRAMESET=40]="FRAMESET",X[X.H1=41]="H1",X[X.H2=42]="H2",X[X.H3=43]="H3",X[X.H4=44]="H4",X[X.H5=45]="H5",X[X.H6=46]="H6",X[X.HEAD=47]="HEAD",X[X.HEADER=48]="HEADER",X[X.HGROUP=49]="HGROUP",X[X.HR=50]="HR",X[X.HTML=51]="HTML",X[X.I=52]="I",X[X.IMG=53]="IMG",X[X.IMAGE=54]="IMAGE",X[X.INPUT=55]="INPUT",X[X.IFRAME=56]="IFRAME",X[X.KEYGEN=57]="KEYGEN",X[X.LABEL=58]="LABEL",X[X.LI=59]="LI",X[X.LINK=60]="LINK",X[X.LISTING=61]="LISTING",X[X.MAIN=62]="MAIN",X[X.MALIGNMARK=63]="MALIGNMARK",X[X.MARQUEE=64]="MARQUEE",X[X.MATH=65]="MATH",X[X.MENU=66]="MENU",X[X.META=67]="META",X[X.MGLYPH=68]="MGLYPH",X[X.MI=69]="MI",X[X.MO=70]="MO",X[X.MN=71]="MN",X[X.MS=72]="MS",X[X.MTEXT=73]="MTEXT",X[X.NAV=74]="NAV",X[X.NOBR=75]="NOBR",X[X.NOFRAMES=76]="NOFRAMES",X[X.NOEMBED=77]="NOEMBED",X[X.NOSCRIPT=78]="NOSCRIPT",X[X.OBJECT=79]="OBJECT",X[X.OL=80]="OL",X[X.OPTGROUP=81]="OPTGROUP",X[X.OPTION=82]="OPTION",X[X.P=83]="P",X[X.PARAM=84]="PARAM",X[X.PLAINTEXT=85]="PLAINTEXT",X[X.PRE=86]="PRE",X[X.RB=87]="RB",X[X.RP=88]="RP",X[X.RT=89]="RT",X[X.RTC=90]="RTC",X[X.RUBY=91]="RUBY",X[X.S=92]="S",X[X.SCRIPT=93]="SCRIPT",X[X.SEARCH=94]="SEARCH",X[X.SECTION=95]="SECTION",X[X.SELECT=96]="SELECT",X[X.SOURCE=97]="SOURCE",X[X.SMALL=98]="SMALL",X[X.SPAN=99]="SPAN",X[X.STRIKE=100]="STRIKE",X[X.STRONG=101]="STRONG",X[X.STYLE=102]="STYLE",X[X.SUB=103]="SUB",X[X.SUMMARY=104]="SUMMARY",X[X.SUP=105]="SUP",X[X.TABLE=106]="TABLE",X[X.TBODY=107]="TBODY",X[X.TEMPLATE=108]="TEMPLATE",X[X.TEXTAREA=109]="TEXTAREA",X[X.TFOOT=110]="TFOOT",X[X.TD=111]="TD",X[X.TH=112]="TH",X[X.THEAD=113]="THEAD",X[X.TITLE=114]="TITLE",X[X.TR=115]="TR",X[X.TRACK=116]="TRACK",X[X.TT=117]="TT",X[X.U=118]="U",X[X.UL=119]="UL",X[X.SVG=120]="SVG",X[X.VAR=121]="VAR",X[X.WBR=122]="WBR",X[X.XMP=123]="XMP";let zH=new Map([[av.A,aw.A],[av.ADDRESS,aw.ADDRESS],[av.ANNOTATION_XML,aw.ANNOTATION_XML],[av.APPLET,aw.APPLET],[av.AREA,aw.AREA],[av.ARTICLE,aw.ARTICLE],[av.ASIDE,aw.ASIDE],[av.B,aw.B],[av.BASE,aw.BASE],[av.BASEFONT,aw.BASEFONT],[av.BGSOUND,aw.BGSOUND],[av.BIG,aw.BIG],[av.BLOCKQUOTE,aw.BLOCKQUOTE],[av.BODY,aw.BODY],[av.BR,aw.BR],[av.BUTTON,aw.BUTTON],[av.CAPTION,aw.CAPTION],[av.CENTER,aw.CENTER],[av.CODE,aw.CODE],[av.COL,aw.COL],[av.COLGROUP,aw.COLGROUP],[av.DD,aw.DD],[av.DESC,aw.DESC],[av.DETAILS,aw.DETAILS],[av.DIALOG,aw.DIALOG],[av.DIR,aw.DIR],[av.DIV,aw.DIV],[av.DL,aw.DL],[av.DT,aw.DT],[av.EM,aw.EM],[av.EMBED,aw.EMBED],[av.FIELDSET,aw.FIELDSET],[av.FIGCAPTION,aw.FIGCAPTION],[av.FIGURE,aw.FIGURE],[av.FONT,aw.FONT],[av.FOOTER,aw.FOOTER],[av.FOREIGN_OBJECT,aw.FOREIGN_OBJECT],[av.FORM,aw.FORM],[av.FRAME,aw.FRAME],[av.FRAMESET,aw.FRAMESET],[av.H1,aw.H1],[av.H2,aw.H2],[av.H3,aw.H3],[av.H4,aw.H4],[av.H5,aw.H5],[av.H6,aw.H6],[av.HEAD,aw.HEAD],[av.HEADER,aw.HEADER],[av.HGROUP,aw.HGROUP],[av.HR,aw.HR],[av.HTML,aw.HTML],[av.I,aw.I],[av.IMG,aw.IMG],[av.IMAGE,aw.IMAGE],[av.INPUT,aw.INPUT],[av.IFRAME,aw.IFRAME],[av.KEYGEN,aw.KEYGEN],[av.LABEL,aw.LABEL],[av.LI,aw.LI],[av.LINK,aw.LINK],[av.LISTING,aw.LISTING],[av.MAIN,aw.MAIN],[av.MALIGNMARK,aw.MALIGNMARK],[av.MARQUEE,aw.MARQUEE],[av.MATH,aw.MATH],[av.MENU,aw.MENU],[av.META,aw.META],[av.MGLYPH,aw.MGLYPH],[av.MI,aw.MI],[av.MO,aw.MO],[av.MN,aw.MN],[av.MS,aw.MS],[av.MTEXT,aw.MTEXT],[av.NAV,aw.NAV],[av.NOBR,aw.NOBR],[av.NOFRAMES,aw.NOFRAMES],[av.NOEMBED,aw.NOEMBED],[av.NOSCRIPT,aw.NOSCRIPT],[av.OBJECT,aw.OBJECT],[av.OL,aw.OL],[av.OPTGROUP,aw.OPTGROUP],[av.OPTION,aw.OPTION],[av.P,aw.P],[av.PARAM,aw.PARAM],[av.PLAINTEXT,aw.PLAINTEXT],[av.PRE,aw.PRE],[av.RB,aw.RB],[av.RP,aw.RP],[av.RT,aw.RT],[av.RTC,aw.RTC],[av.RUBY,aw.RUBY],[av.S,aw.S],[av.SCRIPT,aw.SCRIPT],[av.SEARCH,aw.SEARCH],[av.SECTION,aw.SECTION],[av.SELECT,aw.SELECT],[av.SOURCE,aw.SOURCE],[av.SMALL,aw.SMALL],[av.SPAN,aw.SPAN],[av.STRIKE,aw.STRIKE],[av.STRONG,aw.STRONG],[av.STYLE,aw.STYLE],[av.SUB,aw.SUB],[av.SUMMARY,aw.SUMMARY],[av.SUP,aw.SUP],[av.TABLE,aw.TABLE],[av.TBODY,aw.TBODY],[av.TEMPLATE,aw.TEMPLATE],[av.TEXTAREA,aw.TEXTAREA],[av.TFOOT,aw.TFOOT],[av.TD,aw.TD],[av.TH,aw.TH],[av.THEAD,aw.THEAD],[av.TITLE,aw.TITLE],[av.TR,aw.TR],[av.TRACK,aw.TRACK],[av.TT,aw.TT],[av.U,aw.U],[av.UL,aw.UL],[av.SVG,aw.SVG],[av.VAR,aw.VAR],[av.WBR,aw.WBR],[av.XMP,aw.XMP]]);function zI(a){var b;return null!=(b=zH.get(a))?b:aw.UNKNOWN}let zJ=aw,zK={[as.HTML]:new Set([zJ.ADDRESS,zJ.APPLET,zJ.AREA,zJ.ARTICLE,zJ.ASIDE,zJ.BASE,zJ.BASEFONT,zJ.BGSOUND,zJ.BLOCKQUOTE,zJ.BODY,zJ.BR,zJ.BUTTON,zJ.CAPTION,zJ.CENTER,zJ.COL,zJ.COLGROUP,zJ.DD,zJ.DETAILS,zJ.DIR,zJ.DIV,zJ.DL,zJ.DT,zJ.EMBED,zJ.FIELDSET,zJ.FIGCAPTION,zJ.FIGURE,zJ.FOOTER,zJ.FORM,zJ.FRAME,zJ.FRAMESET,zJ.H1,zJ.H2,zJ.H3,zJ.H4,zJ.H5,zJ.H6,zJ.HEAD,zJ.HEADER,zJ.HGROUP,zJ.HR,zJ.HTML,zJ.IFRAME,zJ.IMG,zJ.INPUT,zJ.LI,zJ.LINK,zJ.LISTING,zJ.MAIN,zJ.MARQUEE,zJ.MENU,zJ.META,zJ.NAV,zJ.NOEMBED,zJ.NOFRAMES,zJ.NOSCRIPT,zJ.OBJECT,zJ.OL,zJ.P,zJ.PARAM,zJ.PLAINTEXT,zJ.PRE,zJ.SCRIPT,zJ.SECTION,zJ.SELECT,zJ.SOURCE,zJ.STYLE,zJ.SUMMARY,zJ.TABLE,zJ.TBODY,zJ.TD,zJ.TEMPLATE,zJ.TEXTAREA,zJ.TFOOT,zJ.TH,zJ.THEAD,zJ.TITLE,zJ.TR,zJ.TRACK,zJ.UL,zJ.WBR,zJ.XMP]),[as.MATHML]:new Set([zJ.MI,zJ.MO,zJ.MN,zJ.MS,zJ.MTEXT,zJ.ANNOTATION_XML]),[as.SVG]:new Set([zJ.TITLE,zJ.FOREIGN_OBJECT,zJ.DESC]),[as.XLINK]:new Set,[as.XML]:new Set,[as.XMLNS]:new Set},zL=new Set([zJ.H1,zJ.H2,zJ.H3,zJ.H4,zJ.H5,zJ.H6]),zM=new Set([av.STYLE,av.SCRIPT,av.XMP,av.IFRAME,av.NOEMBED,av.NOFRAMES,av.PLAINTEXT]);a.s(["ATTRS",0,at,"DOCUMENT_MODE",0,au,"NS",0,as,"NUMBERED_HEADERS",0,zL,"SPECIAL_ELEMENTS",0,zK,"TAG_ID",0,aw,"TAG_NAMES",0,av,"getTagID",0,zI,"hasUnescapedText",0,function(a,b){return zM.has(a)||b&&a===av.NOSCRIPT}],305856),(Y=ax||(ax={}))[Y.DATA=0]="DATA",Y[Y.RCDATA=1]="RCDATA",Y[Y.RAWTEXT=2]="RAWTEXT",Y[Y.SCRIPT_DATA=3]="SCRIPT_DATA",Y[Y.PLAINTEXT=4]="PLAINTEXT",Y[Y.TAG_OPEN=5]="TAG_OPEN",Y[Y.END_TAG_OPEN=6]="END_TAG_OPEN",Y[Y.TAG_NAME=7]="TAG_NAME",Y[Y.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",Y[Y.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",Y[Y.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",Y[Y.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",Y[Y.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",Y[Y.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",Y[Y.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",Y[Y.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",Y[Y.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",Y[Y.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",Y[Y.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",Y[Y.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",Y[Y.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",Y[Y.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",Y[Y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",Y[Y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",Y[Y.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",Y[Y.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",Y[Y.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",Y[Y.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",Y[Y.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",Y[Y.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",Y[Y.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",Y[Y.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",Y[Y.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",Y[Y.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",Y[Y.BOGUS_COMMENT=40]="BOGUS_COMMENT",Y[Y.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",Y[Y.COMMENT_START=42]="COMMENT_START",Y[Y.COMMENT_START_DASH=43]="COMMENT_START_DASH",Y[Y.COMMENT=44]="COMMENT",Y[Y.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",Y[Y.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",Y[Y.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",Y[Y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",Y[Y.COMMENT_END_DASH=49]="COMMENT_END_DASH",Y[Y.COMMENT_END=50]="COMMENT_END",Y[Y.COMMENT_END_BANG=51]="COMMENT_END_BANG",Y[Y.DOCTYPE=52]="DOCTYPE",Y[Y.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",Y[Y.DOCTYPE_NAME=54]="DOCTYPE_NAME",Y[Y.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",Y[Y.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",Y[Y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",Y[Y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",Y[Y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",Y[Y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",Y[Y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",Y[Y.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",Y[Y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",Y[Y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",Y[Y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",Y[Y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",Y[Y.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",Y[Y.CDATA_SECTION=68]="CDATA_SECTION",Y[Y.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",Y[Y.CDATA_SECTION_END=70]="CDATA_SECTION_END",Y[Y.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",Y[Y.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND";let zN={DATA:ax.DATA,RCDATA:ax.RCDATA,RAWTEXT:ax.RAWTEXT,SCRIPT_DATA:ax.SCRIPT_DATA,PLAINTEXT:ax.PLAINTEXT,CDATA_SECTION:ax.CDATA_SECTION};function zO(a){return a>=ak.LATIN_CAPITAL_A&&a<=ak.LATIN_CAPITAL_Z}function zP(a){return a>=ak.LATIN_SMALL_A&&a<=ak.LATIN_SMALL_Z||zO(a)}function zQ(a){return zP(a)||a>=ak.DIGIT_0&&a<=ak.DIGIT_9}function zR(a){return a===ak.SPACE||a===ak.LINE_FEED||a===ak.TABULATION||a===ak.FORM_FEED}function zS(a){return zR(a)||a===ak.SOLIDUS||a===ak.GREATER_THAN_SIGN}class zT{constructor(a,b){this.options=a,this.handler=b,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=ax.DATA,this.returnState=ax.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new zB(b),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new zG(zD,(a,b)=>{this.preprocessor.pos=this.entityStartPos+b-1,this._flushCodePointConsumedAsCharacterReference(a)},b.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(al.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(al.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{let b=function(a){if(a===ak.NULL)return al.nullCharacterReference;if(a>1114111)return al.characterReferenceOutsideUnicodeRange;if(zy(a))return al.surrogateCharacterReference;if(zA(a))return al.noncharacterCharacterReference;if(zz(a)||a===ak.CARRIAGE_RETURN)return al.controlCharacterReference;return null}(a);b&&this._err(b,1)}}:void 0)}_err(a,b=0){var c,d;null==(d=(c=this.handler).onParseError)||d.call(c,this.preprocessor.getError(a,b))}getCurrentLocation(a){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-a,startOffset:this.preprocessor.offset-a,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let a=this._consume();this._ensureHibernation()||this._callState(a)}this.inLoop=!1}}pause(){this.paused=!0}resume(a){if(!this.paused)throw Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||null==a||a())}write(a,b,c){this.active=!0,this.preprocessor.write(a,b),this._runParsingLoop(),this.paused||null==c||c()}insertHtmlAtCurrentPos(a){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(a),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(a){this.consumedAfterSnapshot+=a;for(let b=0;b<a;b++)this.preprocessor.advance()}_consumeSequenceIfMatch(a,b){return!!this.preprocessor.startsWith(a,b)&&(this._advanceBy(a.length-1),!0)}_createStartTagToken(){this.currentToken={type:am.START_TAG,tagName:"",tagID:aw.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:am.END_TAG,tagName:"",tagID:aw.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(a){this.currentToken={type:am.COMMENT,data:"",location:this.getCurrentLocation(a)}}_createDoctypeToken(a){this.currentToken={type:am.DOCTYPE,name:a,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(a,b){this.currentCharacterToken={type:a,chars:b,location:this.currentLocation}}_createAttr(a){this.currentAttr={name:a,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var a,b;let c=this.currentToken;null===zC(c,this.currentAttr.name)?(c.attrs.push(this.currentAttr),c.location&&this.currentLocation&&((null!=(a=(b=c.location).attrs)?a:b.attrs=Object.create(null))[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue())):this._err(al.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(a){this._emitCurrentCharacterToken(a.location),this.currentToken=null,a.location&&(a.location.endLine=this.preprocessor.line,a.location.endCol=this.preprocessor.col+1,a.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let a=this.currentToken;this.prepareToken(a),a.tagID=zI(a.tagName),a.type===am.START_TAG?(this.lastStartTagName=a.tagName,this.handler.onStartTag(a)):(a.attrs.length>0&&this._err(al.endTagWithAttributes),a.selfClosing&&this._err(al.endTagWithTrailingSolidus),this.handler.onEndTag(a)),this.preprocessor.dropParsedChunk()}emitCurrentComment(a){this.prepareToken(a),this.handler.onComment(a),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(a){this.prepareToken(a),this.handler.onDoctype(a),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(a){if(this.currentCharacterToken){switch(a&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=a.startLine,this.currentCharacterToken.location.endCol=a.startCol,this.currentCharacterToken.location.endOffset=a.startOffset),this.currentCharacterToken.type){case am.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case am.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case am.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let a=this.getCurrentLocation(0);a&&(a.endLine=a.startLine,a.endCol=a.startCol,a.endOffset=a.startOffset),this._emitCurrentCharacterToken(a),this.handler.onEof({type:am.EOF,location:a}),this.active=!1}_appendCharToCurrentCharacterToken(a,b){if(this.currentCharacterToken)if(this.currentCharacterToken.type===a){this.currentCharacterToken.chars+=b;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(a,b)}_emitCodePoint(a){let b=zR(a)?am.WHITESPACE_CHARACTER:a===ak.NULL?am.NULL_CHARACTER:am.CHARACTER;this._appendCharToCurrentCharacterToken(b,String.fromCodePoint(a))}_emitChars(a){this._appendCharToCurrentCharacterToken(am.CHARACTER,a)}_startCharacterReference(){this.returnState=this.state,this.state=ax.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ar.Attribute:ar.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===ax.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===ax.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===ax.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(a){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(a):this._emitCodePoint(a)}_callState(a){switch(this.state){case ax.DATA:this._stateData(a);break;case ax.RCDATA:this._stateRcdata(a);break;case ax.RAWTEXT:this._stateRawtext(a);break;case ax.SCRIPT_DATA:this._stateScriptData(a);break;case ax.PLAINTEXT:this._statePlaintext(a);break;case ax.TAG_OPEN:this._stateTagOpen(a);break;case ax.END_TAG_OPEN:this._stateEndTagOpen(a);break;case ax.TAG_NAME:this._stateTagName(a);break;case ax.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(a);break;case ax.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(a);break;case ax.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(a);break;case ax.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(a);break;case ax.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(a);break;case ax.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(a);break;case ax.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(a);break;case ax.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(a);break;case ax.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(a);break;case ax.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(a);break;case ax.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(a);break;case ax.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(a);break;case ax.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(a);break;case ax.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(a);break;case ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(a);break;case ax.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(a);break;case ax.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(a);break;case ax.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(a);break;case ax.ATTRIBUTE_NAME:this._stateAttributeName(a);break;case ax.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(a);break;case ax.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(a);break;case ax.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(a);break;case ax.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(a);break;case ax.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(a);break;case ax.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(a);break;case ax.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(a);break;case ax.BOGUS_COMMENT:this._stateBogusComment(a);break;case ax.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(a);break;case ax.COMMENT_START:this._stateCommentStart(a);break;case ax.COMMENT_START_DASH:this._stateCommentStartDash(a);break;case ax.COMMENT:this._stateComment(a);break;case ax.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(a);break;case ax.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(a);break;case ax.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(a);break;case ax.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(a);break;case ax.COMMENT_END_DASH:this._stateCommentEndDash(a);break;case ax.COMMENT_END:this._stateCommentEnd(a);break;case ax.COMMENT_END_BANG:this._stateCommentEndBang(a);break;case ax.DOCTYPE:this._stateDoctype(a);break;case ax.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(a);break;case ax.DOCTYPE_NAME:this._stateDoctypeName(a);break;case ax.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(a);break;case ax.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(a);break;case ax.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(a);break;case ax.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(a);break;case ax.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(a);break;case ax.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(a);break;case ax.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(a);break;case ax.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(a);break;case ax.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(a);break;case ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(a);break;case ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(a);break;case ax.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(a);break;case ax.BOGUS_DOCTYPE:this._stateBogusDoctype(a);break;case ax.CDATA_SECTION:this._stateCdataSection(a);break;case ax.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(a);break;case ax.CDATA_SECTION_END:this._stateCdataSectionEnd(a);break;case ax.CHARACTER_REFERENCE:this._stateCharacterReference();break;case ax.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(a);break;default:throw Error("Unknown state")}}_stateData(a){switch(a){case ak.LESS_THAN_SIGN:this.state=ax.TAG_OPEN;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitCodePoint(a);break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateRcdata(a){switch(a){case ak.AMPERSAND:this._startCharacterReference();break;case ak.LESS_THAN_SIGN:this.state=ax.RCDATA_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateRawtext(a){switch(a){case ak.LESS_THAN_SIGN:this.state=ax.RAWTEXT_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateScriptData(a){switch(a){case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_statePlaintext(a){switch(a){case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateTagOpen(a){if(zP(a))this._createStartTagToken(),this.state=ax.TAG_NAME,this._stateTagName(a);else switch(a){case ak.EXCLAMATION_MARK:this.state=ax.MARKUP_DECLARATION_OPEN;break;case ak.SOLIDUS:this.state=ax.END_TAG_OPEN;break;case ak.QUESTION_MARK:this._err(al.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=ax.BOGUS_COMMENT,this._stateBogusComment(a);break;case ak.EOF:this._err(al.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(al.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=ax.DATA,this._stateData(a)}}_stateEndTagOpen(a){if(zP(a))this._createEndTagToken(),this.state=ax.TAG_NAME,this._stateTagName(a);else switch(a){case ak.GREATER_THAN_SIGN:this._err(al.missingEndTagName),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break;default:this._err(al.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=ax.BOGUS_COMMENT,this._stateBogusComment(a)}}_stateTagName(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_ATTRIBUTE_NAME;break;case ak.SOLIDUS:this.state=ax.SELF_CLOSING_START_TAG;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.tagName+="�";break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:b.tagName+=String.fromCodePoint(zO(a)?a+32:a)}}_stateRcdataLessThanSign(a){a===ak.SOLIDUS?this.state=ax.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=ax.RCDATA,this._stateRcdata(a))}_stateRcdataEndTagOpen(a){zP(a)?(this.state=ax.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(a)):(this._emitChars("</"),this.state=ax.RCDATA,this._stateRcdata(a))}handleSpecialEndTag(a){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();switch(this._createEndTagToken(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=ax.BEFORE_ATTRIBUTE_NAME,!1;case ak.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=ax.SELF_CLOSING_START_TAG,!1;case ak.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=ax.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.RCDATA,this._stateRcdata(a))}_stateRawtextLessThanSign(a){a===ak.SOLIDUS?this.state=ax.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=ax.RAWTEXT,this._stateRawtext(a))}_stateRawtextEndTagOpen(a){zP(a)?(this.state=ax.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(a)):(this._emitChars("</"),this.state=ax.RAWTEXT,this._stateRawtext(a))}_stateRawtextEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.RAWTEXT,this._stateRawtext(a))}_stateScriptDataLessThanSign(a){switch(a){case ak.SOLIDUS:this.state=ax.SCRIPT_DATA_END_TAG_OPEN;break;case ak.EXCLAMATION_MARK:this.state=ax.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break;default:this._emitChars("<"),this.state=ax.SCRIPT_DATA,this._stateScriptData(a)}}_stateScriptDataEndTagOpen(a){zP(a)?(this.state=ax.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(a)):(this._emitChars("</"),this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEscapeStart(a){a===ak.HYPHEN_MINUS?(this.state=ax.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEscapeStartDash(a){a===ak.HYPHEN_MINUS?(this.state=ax.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEscaped(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateScriptDataEscapedDash(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataEscapedDashDash(a){switch(a){case ak.HYPHEN_MINUS:this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case ak.GREATER_THAN_SIGN:this.state=ax.SCRIPT_DATA,this._emitChars(">");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataEscapedLessThanSign(a){a===ak.SOLIDUS?this.state=ax.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zP(a)?(this._emitChars("<"),this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(a)):(this._emitChars("<"),this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataEscapedEndTagOpen(a){zP(a)?(this.state=ax.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(a)):(this._emitChars("</"),this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataEscapedEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataDoubleEscapeStart(a){if(this.preprocessor.startsWith(zx,!1)&&zS(this.preprocessor.peek(zx.length))){this._emitCodePoint(a);for(let a=0;a<zx.length;a++)this._emitCodePoint(this._consume());this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataDoubleEscaped(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateScriptDataDoubleEscapedDash(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataDoubleEscapedDashDash(a){switch(a){case ak.HYPHEN_MINUS:this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case ak.GREATER_THAN_SIGN:this.state=ax.SCRIPT_DATA,this._emitChars(">");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataDoubleEscapedLessThanSign(a){a===ak.SOLIDUS?(this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(a))}_stateScriptDataDoubleEscapeEnd(a){if(this.preprocessor.startsWith(zx,!1)&&zS(this.preprocessor.peek(zx.length))){this._emitCodePoint(a);for(let a=0;a<zx.length;a++)this._emitCodePoint(this._consume());this.state=ax.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(a))}_stateBeforeAttributeName(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.SOLIDUS:case ak.GREATER_THAN_SIGN:case ak.EOF:this.state=ax.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(a);break;case ak.EQUALS_SIGN:this._err(al.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=ax.ATTRIBUTE_NAME;break;default:this._createAttr(""),this.state=ax.ATTRIBUTE_NAME,this._stateAttributeName(a)}}_stateAttributeName(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:case ak.SOLIDUS:case ak.GREATER_THAN_SIGN:case ak.EOF:this._leaveAttrName(),this.state=ax.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(a);break;case ak.EQUALS_SIGN:this._leaveAttrName(),this.state=ax.BEFORE_ATTRIBUTE_VALUE;break;case ak.QUOTATION_MARK:case ak.APOSTROPHE:case ak.LESS_THAN_SIGN:this._err(al.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(a);break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.name+="�";break;default:this.currentAttr.name+=String.fromCodePoint(zO(a)?a+32:a)}}_stateAfterAttributeName(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.SOLIDUS:this.state=ax.SELF_CLOSING_START_TAG;break;case ak.EQUALS_SIGN:this.state=ax.BEFORE_ATTRIBUTE_VALUE;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this._createAttr(""),this.state=ax.ATTRIBUTE_NAME,this._stateAttributeName(a)}}_stateBeforeAttributeValue(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.QUOTATION_MARK:this.state=ax.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this.state=ax.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingAttributeValue),this.state=ax.DATA,this.emitCurrentTagToken();break;default:this.state=ax.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(a)}}_stateAttributeValueDoubleQuoted(a){switch(a){case ak.QUOTATION_MARK:this.state=ax.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.value+="�";break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(a)}}_stateAttributeValueSingleQuoted(a){switch(a){case ak.APOSTROPHE:this.state=ax.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.value+="�";break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(a)}}_stateAttributeValueUnquoted(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this._leaveAttrValue(),this.state=ax.BEFORE_ATTRIBUTE_NAME;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.value+="�";break;case ak.QUOTATION_MARK:case ak.APOSTROPHE:case ak.LESS_THAN_SIGN:case ak.EQUALS_SIGN:case ak.GRAVE_ACCENT:this._err(al.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(a);break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(a)}}_stateAfterAttributeValueQuoted(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this._leaveAttrValue(),this.state=ax.BEFORE_ATTRIBUTE_NAME;break;case ak.SOLIDUS:this._leaveAttrValue(),this.state=ax.SELF_CLOSING_START_TAG;break;case ak.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this._err(al.missingWhitespaceBetweenAttributes),this.state=ax.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(a)}}_stateSelfClosingStartTag(a){switch(a){case ak.GREATER_THAN_SIGN:this.currentToken.selfClosing=!0,this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this._err(al.unexpectedSolidusInTag),this.state=ax.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(a)}}_stateBogusComment(a){let b=this.currentToken;switch(a){case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EOF:this.emitCurrentComment(b),this._emitEOFToken();break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.data+="�";break;default:b.data+=String.fromCodePoint(a)}}_stateMarkupDeclarationOpen(a){this._consumeSequenceIfMatch("--",!0)?(this._createCommentToken(3),this.state=ax.COMMENT_START):this._consumeSequenceIfMatch(zw,!1)?(this.currentLocation=this.getCurrentLocation(zw.length+1),this.state=ax.DOCTYPE):this._consumeSequenceIfMatch(zv,!0)?this.inForeignNode?this.state=ax.CDATA_SECTION:(this._err(al.cdataInHtmlContent),this._createCommentToken(zv.length+1),this.currentToken.data="[CDATA[",this.state=ax.BOGUS_COMMENT):this._ensureHibernation()||(this._err(al.incorrectlyOpenedComment),this._createCommentToken(2),this.state=ax.BOGUS_COMMENT,this._stateBogusComment(a))}_stateCommentStart(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_START_DASH;break;case ak.GREATER_THAN_SIGN:{this._err(al.abruptClosingOfEmptyComment),this.state=ax.DATA;let a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentStartDash(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_END;break;case ak.GREATER_THAN_SIGN:this._err(al.abruptClosingOfEmptyComment),this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="-",this.state=ax.COMMENT,this._stateComment(a)}}_stateComment(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_END_DASH;break;case ak.LESS_THAN_SIGN:b.data+="<",this.state=ax.COMMENT_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.data+="�";break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+=String.fromCodePoint(a)}}_stateCommentLessThanSign(a){let b=this.currentToken;switch(a){case ak.EXCLAMATION_MARK:b.data+="!",this.state=ax.COMMENT_LESS_THAN_SIGN_BANG;break;case ak.LESS_THAN_SIGN:b.data+="<";break;default:this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentLessThanSignBang(a){a===ak.HYPHEN_MINUS?this.state=ax.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=ax.COMMENT,this._stateComment(a))}_stateCommentLessThanSignBangDash(a){a===ak.HYPHEN_MINUS?this.state=ax.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=ax.COMMENT_END_DASH,this._stateCommentEndDash(a))}_stateCommentLessThanSignBangDashDash(a){a!==ak.GREATER_THAN_SIGN&&a!==ak.EOF&&this._err(al.nestedComment),this.state=ax.COMMENT_END,this._stateCommentEnd(a)}_stateCommentEndDash(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_END;break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="-",this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentEnd(a){let b=this.currentToken;switch(a){case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EXCLAMATION_MARK:this.state=ax.COMMENT_END_BANG;break;case ak.HYPHEN_MINUS:b.data+="-";break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="--",this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentEndBang(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:b.data+="--!",this.state=ax.COMMENT_END_DASH;break;case ak.GREATER_THAN_SIGN:this._err(al.incorrectlyClosedComment),this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="--!",this.state=ax.COMMENT,this._stateComment(a)}}_stateDoctype(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_DOCTYPE_NAME;break;case ak.GREATER_THAN_SIGN:this.state=ax.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(a);break;case ak.EOF:{this._err(al.eofInDoctype),this._createDoctypeToken(null);let a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(al.missingWhitespaceBeforeDoctypeName),this.state=ax.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(a)}}_stateBeforeDoctypeName(a){if(zO(a))this._createDoctypeToken(String.fromCharCode(a+32)),this.state=ax.DOCTYPE_NAME;else switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._createDoctypeToken("�"),this.state=ax.DOCTYPE_NAME;break;case ak.GREATER_THAN_SIGN:{this._err(al.missingDoctypeName),this._createDoctypeToken(null);let a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=ax.DATA;break}case ak.EOF:{this._err(al.eofInDoctype),this._createDoctypeToken(null);let a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(a)),this.state=ax.DOCTYPE_NAME}}_stateDoctypeName(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.AFTER_DOCTYPE_NAME;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.name+="�";break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.name+=String.fromCodePoint(zO(a)?a+32:a)}}_stateAfterDoctypeName(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._consumeSequenceIfMatch("public",!1)?this.state=ax.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch("system",!1)?this.state=ax.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(al.invalidCharacterSequenceAfterDoctypeName),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a))}}_stateAfterDoctypePublicKeyword(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case ak.QUOTATION_MARK:this._err(al.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this._err(al.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBeforeDoctypePublicIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.QUOTATION_MARK:b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateDoctypePublicIdentifierDoubleQuoted(a){let b=this.currentToken;switch(a){case ak.QUOTATION_MARK:this.state=ax.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.publicId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.publicId+=String.fromCodePoint(a)}}_stateDoctypePublicIdentifierSingleQuoted(a){let b=this.currentToken;switch(a){case ak.APOSTROPHE:this.state=ax.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.publicId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.publicId+=String.fromCodePoint(a)}}_stateAfterDoctypePublicIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.QUOTATION_MARK:this._err(al.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this._err(al.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBetweenDoctypePublicAndSystemIdentifiers(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.GREATER_THAN_SIGN:this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.QUOTATION_MARK:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateAfterDoctypeSystemKeyword(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case ak.QUOTATION_MARK:this._err(al.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this._err(al.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBeforeDoctypeSystemIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.QUOTATION_MARK:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateDoctypeSystemIdentifierDoubleQuoted(a){let b=this.currentToken;switch(a){case ak.QUOTATION_MARK:this.state=ax.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.systemId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.systemId+=String.fromCodePoint(a)}}_stateDoctypeSystemIdentifierSingleQuoted(a){let b=this.currentToken;switch(a){case ak.APOSTROPHE:this.state=ax.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.systemId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.systemId+=String.fromCodePoint(a)}}_stateAfterDoctypeSystemIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.GREATER_THAN_SIGN:this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBogusDoctype(a){let b=this.currentToken;switch(a){case ak.GREATER_THAN_SIGN:this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.NULL:this._err(al.unexpectedNullCharacter);break;case ak.EOF:this.emitCurrentDoctype(b),this._emitEOFToken()}}_stateCdataSection(a){switch(a){case ak.RIGHT_SQUARE_BRACKET:this.state=ax.CDATA_SECTION_BRACKET;break;case ak.EOF:this._err(al.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateCdataSectionBracket(a){a===ak.RIGHT_SQUARE_BRACKET?this.state=ax.CDATA_SECTION_END:(this._emitChars("]"),this.state=ax.CDATA_SECTION,this._stateCdataSection(a))}_stateCdataSectionEnd(a){switch(a){case ak.GREATER_THAN_SIGN:this.state=ax.DATA;break;case ak.RIGHT_SQUARE_BRACKET:this._emitChars("]");break;default:this._emitChars("]]"),this.state=ax.CDATA_SECTION,this._stateCdataSection(a)}}_stateCharacterReference(){let a=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(a<0)if(this.preprocessor.lastChunkWritten)a=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}0===a?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(ak.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&zQ(this.preprocessor.peek(1))?ax.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(a){zQ(a)?this._flushCodePointConsumedAsCharacterReference(a):(a===ak.SEMICOLON&&this._err(al.unknownNamedCharacterReference),this.state=this.returnState,this._callState(a))}}let zU=new Set([aw.DD,aw.DT,aw.LI,aw.OPTGROUP,aw.OPTION,aw.P,aw.RB,aw.RP,aw.RT,aw.RTC]),zV=new Set([...zU,aw.CAPTION,aw.COLGROUP,aw.TBODY,aw.TD,aw.TFOOT,aw.TH,aw.THEAD,aw.TR]),zW=new Set([aw.APPLET,aw.CAPTION,aw.HTML,aw.MARQUEE,aw.OBJECT,aw.TABLE,aw.TD,aw.TEMPLATE,aw.TH]),zX=new Set([...zW,aw.OL,aw.UL]),zY=new Set([...zW,aw.BUTTON]),zZ=new Set([aw.ANNOTATION_XML,aw.MI,aw.MN,aw.MO,aw.MS,aw.MTEXT]),z$=new Set([aw.DESC,aw.FOREIGN_OBJECT,aw.TITLE]),z_=new Set([aw.TR,aw.TEMPLATE,aw.HTML]),z0=new Set([aw.TBODY,aw.TFOOT,aw.THEAD,aw.TEMPLATE,aw.HTML]),z1=new Set([aw.TABLE,aw.TEMPLATE,aw.HTML]),z2=new Set([aw.TD,aw.TH]);class z3{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(a,b,c){this.treeAdapter=b,this.handler=c,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=aw.UNKNOWN,this.current=a}_indexOf(a){return this.items.lastIndexOf(a,this.stackTop)}_isInTemplate(){return this.currentTagId===aw.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===as.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(a,b){this.stackTop++,this.items[this.stackTop]=a,this.current=a,this.tagIDs[this.stackTop]=b,this.currentTagId=b,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(a,b,!0)}pop(){let a=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,!0)}replace(a,b){let c=this._indexOf(a);this.items[c]=b,c===this.stackTop&&(this.current=b)}insertAfter(a,b,c){let d=this._indexOf(a)+1;this.items.splice(d,0,b),this.tagIDs.splice(d,0,c),this.stackTop++,d===this.stackTop&&this._updateCurrentElement(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,d===this.stackTop)}popUntilTagNamePopped(a){let b=this.stackTop+1;do b=this.tagIDs.lastIndexOf(a,b-1);while(b>0&&this.treeAdapter.getNamespaceURI(this.items[b])!==as.HTML)this.shortenToLength(Math.max(b,0))}shortenToLength(a){for(;this.stackTop>=a;){let b=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(b,this.stackTop<a)}}popUntilElementPopped(a){let b=this._indexOf(a);this.shortenToLength(Math.max(b,0))}popUntilPopped(a,b){let c=this._indexOfTagNames(a,b);this.shortenToLength(Math.max(c,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(zL,as.HTML)}popUntilTableCellPopped(){this.popUntilPopped(z2,as.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(a,b){for(let c=this.stackTop;c>=0;c--)if(a.has(this.tagIDs[c])&&this.treeAdapter.getNamespaceURI(this.items[c])===b)return c;return -1}clearBackTo(a,b){let c=this._indexOfTagNames(a,b);this.shortenToLength(c+1)}clearBackToTableContext(){this.clearBackTo(z1,as.HTML)}clearBackToTableBodyContext(){this.clearBackTo(z0,as.HTML)}clearBackToTableRowContext(){this.clearBackTo(z_,as.HTML)}remove(a){let b=this._indexOf(a);b>=0&&(b===this.stackTop?this.pop():(this.items.splice(b,1),this.tagIDs.splice(b,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===aw.BODY?this.items[1]:null}contains(a){return this._indexOf(a)>-1}getCommonAncestor(a){let b=this._indexOf(a)-1;return b>=0?this.items[b]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===aw.HTML}hasInDynamicScope(a,b){for(let c=this.stackTop;c>=0;c--){let d=this.tagIDs[c];switch(this.treeAdapter.getNamespaceURI(this.items[c])){case as.HTML:if(d===a)return!0;if(b.has(d))return!1;break;case as.SVG:if(z$.has(d))return!1;break;case as.MATHML:if(zZ.has(d))return!1}}return!0}hasInScope(a){return this.hasInDynamicScope(a,zW)}hasInListItemScope(a){return this.hasInDynamicScope(a,zX)}hasInButtonScope(a){return this.hasInDynamicScope(a,zY)}hasNumberedHeaderInScope(){for(let a=this.stackTop;a>=0;a--){let b=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case as.HTML:if(zL.has(b))return!0;if(zW.has(b))return!1;break;case as.SVG:if(z$.has(b))return!1;break;case as.MATHML:if(zZ.has(b))return!1}}return!0}hasInTableScope(a){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===as.HTML)switch(this.tagIDs[b]){case a:return!0;case aw.TABLE:case aw.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===as.HTML)switch(this.tagIDs[a]){case aw.TBODY:case aw.THEAD:case aw.TFOOT:return!0;case aw.TABLE:case aw.HTML:return!1}return!0}hasInSelectScope(a){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===as.HTML)switch(this.tagIDs[b]){case a:return!0;case aw.OPTION:case aw.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&zU.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&zV.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(a){for(;void 0!==this.currentTagId&&this.currentTagId!==a&&zV.has(this.currentTagId);)this.pop()}}(Z=ay||(ay={}))[Z.Marker=0]="Marker",Z[Z.Element=1]="Element";let z4={type:ay.Marker};class z5{constructor(a){this.treeAdapter=a,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(a,b){let c=[],d=b.length,e=this.treeAdapter.getTagName(a),f=this.treeAdapter.getNamespaceURI(a);for(let a=0;a<this.entries.length;a++){let b=this.entries[a];if(b.type===ay.Marker)break;let{element:g}=b;if(this.treeAdapter.getTagName(g)===e&&this.treeAdapter.getNamespaceURI(g)===f){let b=this.treeAdapter.getAttrList(g);b.length===d&&c.push({idx:a,attrs:b})}}return c}_ensureNoahArkCondition(a){if(this.entries.length<3)return;let b=this.treeAdapter.getAttrList(a),c=this._getNoahArkConditionCandidates(a,b);if(c.length<3)return;let d=new Map(b.map(a=>[a.name,a.value])),e=0;for(let a=0;a<c.length;a++){let b=c[a];b.attrs.every(a=>d.get(a.name)===a.value)&&(e+=1)>=3&&this.entries.splice(b.idx,1)}}insertMarker(){this.entries.unshift(z4)}pushElement(a,b){this._ensureNoahArkCondition(a),this.entries.unshift({type:ay.Element,element:a,token:b})}insertElementAfterBookmark(a,b){let c=this.entries.indexOf(this.bookmark);this.entries.splice(c,0,{type:ay.Element,element:a,token:b})}removeEntry(a){let b=this.entries.indexOf(a);-1!==b&&this.entries.splice(b,1)}clearToLastMarker(){let a=this.entries.indexOf(z4);-1===a?this.entries.length=0:this.entries.splice(0,a+1)}getElementEntryInScopeWithTagName(a){let b=this.entries.find(b=>b.type===ay.Marker||this.treeAdapter.getTagName(b.element)===a);return b&&b.type===ay.Element?b:null}getElementEntry(a){return this.entries.find(b=>b.type===ay.Element&&b.element===a)}}let z6={createDocument:()=>({nodeName:"#document",mode:au.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(a,b,c)=>({nodeName:a,tagName:a,attrs:c,namespaceURI:b,childNodes:[],parentNode:null}),createCommentNode:a=>({nodeName:"#comment",data:a,parentNode:null}),createTextNode:a=>({nodeName:"#text",value:a,parentNode:null}),appendChild(a,b){a.childNodes.push(b),b.parentNode=a},insertBefore(a,b,c){let d=a.childNodes.indexOf(c);a.childNodes.splice(d,0,b),b.parentNode=a},setTemplateContent(a,b){a.content=b},getTemplateContent:a=>a.content,setDocumentType(a,b,c,d){let e=a.childNodes.find(a=>"#documentType"===a.nodeName);e?(e.name=b,e.publicId=c,e.systemId=d):z6.appendChild(a,{nodeName:"#documentType",name:b,publicId:c,systemId:d,parentNode:null})},setDocumentMode(a,b){a.mode=b},getDocumentMode:a=>a.mode,detachNode(a){if(a.parentNode){let b=a.parentNode.childNodes.indexOf(a);a.parentNode.childNodes.splice(b,1),a.parentNode=null}},insertText(a,b){if(a.childNodes.length>0){let c=a.childNodes[a.childNodes.length-1];if(z6.isTextNode(c)){c.value+=b;return}}z6.appendChild(a,z6.createTextNode(b))},insertTextBefore(a,b,c){let d=a.childNodes[a.childNodes.indexOf(c)-1];d&&z6.isTextNode(d)?d.value+=b:z6.insertBefore(a,z6.createTextNode(b),c)},adoptAttributes(a,b){let c=new Set(a.attrs.map(a=>a.name));for(let d=0;d<b.length;d++)c.has(b[d].name)||a.attrs.push(b[d])},getFirstChild:a=>a.childNodes[0],getChildNodes:a=>a.childNodes,getParentNode:a=>a.parentNode,getAttrList:a=>a.attrs,getTagName:a=>a.tagName,getNamespaceURI:a=>a.namespaceURI,getTextNodeContent:a=>a.value,getCommentNodeContent:a=>a.data,getDocumentTypeNodeName:a=>a.name,getDocumentTypeNodePublicId:a=>a.publicId,getDocumentTypeNodeSystemId:a=>a.systemId,isTextNode:a=>"#text"===a.nodeName,isCommentNode:a=>"#comment"===a.nodeName,isDocumentTypeNode:a=>"#documentType"===a.nodeName,isElementNode:a=>Object.prototype.hasOwnProperty.call(a,"tagName"),setNodeSourceCodeLocation(a,b){a.sourceCodeLocation=b},getNodeSourceCodeLocation:a=>a.sourceCodeLocation,updateNodeSourceCodeLocation(a,b){a.sourceCodeLocation={...a.sourceCodeLocation,...b}}},z7="html",z8=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],z9=[...z8,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Aa=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ab=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Ac=[...Ab,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ad(a,b){return b.some(b=>a.startsWith(b))}let Ae=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(a=>[a.toLowerCase(),a])),Af=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:as.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:as.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:as.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:as.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:as.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:as.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:as.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:as.XML}],["xml:space",{prefix:"xml",name:"space",namespace:as.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:as.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:as.XMLNS}]]),Ag=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(a=>[a.toLowerCase(),a])),Ah=new Set([aw.B,aw.BIG,aw.BLOCKQUOTE,aw.BODY,aw.BR,aw.CENTER,aw.CODE,aw.DD,aw.DIV,aw.DL,aw.DT,aw.EM,aw.EMBED,aw.H1,aw.H2,aw.H3,aw.H4,aw.H5,aw.H6,aw.HEAD,aw.HR,aw.I,aw.IMG,aw.LI,aw.LISTING,aw.MENU,aw.META,aw.NOBR,aw.OL,aw.P,aw.PRE,aw.RUBY,aw.S,aw.SMALL,aw.SPAN,aw.STRONG,aw.STRIKE,aw.SUB,aw.SUP,aw.TABLE,aw.TT,aw.U,aw.UL,aw.VAR]);function Ai(a){for(let b=0;b<a.attrs.length;b++)if("definitionurl"===a.attrs[b].name){a.attrs[b].name="definitionURL";break}}function Aj(a){for(let b=0;b<a.attrs.length;b++){let c=Ae.get(a.attrs[b].name);null!=c&&(a.attrs[b].name=c)}}function Ak(a){for(let b=0;b<a.attrs.length;b++){let c=Af.get(a.attrs[b].name);c&&(a.attrs[b].prefix=c.prefix,a.attrs[b].name=c.name,a.attrs[b].namespace=c.namespace)}}($=az||(az={}))[$.INITIAL=0]="INITIAL",$[$.BEFORE_HTML=1]="BEFORE_HTML",$[$.BEFORE_HEAD=2]="BEFORE_HEAD",$[$.IN_HEAD=3]="IN_HEAD",$[$.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",$[$.AFTER_HEAD=5]="AFTER_HEAD",$[$.IN_BODY=6]="IN_BODY",$[$.TEXT=7]="TEXT",$[$.IN_TABLE=8]="IN_TABLE",$[$.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",$[$.IN_CAPTION=10]="IN_CAPTION",$[$.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",$[$.IN_TABLE_BODY=12]="IN_TABLE_BODY",$[$.IN_ROW=13]="IN_ROW",$[$.IN_CELL=14]="IN_CELL",$[$.IN_SELECT=15]="IN_SELECT",$[$.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",$[$.IN_TEMPLATE=17]="IN_TEMPLATE",$[$.AFTER_BODY=18]="AFTER_BODY",$[$.IN_FRAMESET=19]="IN_FRAMESET",$[$.AFTER_FRAMESET=20]="AFTER_FRAMESET",$[$.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",$[$.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET";let Al={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Am=new Set([aw.TABLE,aw.TBODY,aw.TFOOT,aw.THEAD,aw.TR]),An={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:z6,onParseError:null};class Ao{constructor(a,b,c=null,d=null){this.fragmentContext=c,this.scriptHandler=d,this.currentToken=null,this.stopped=!1,this.insertionMode=az.INITIAL,this.originalInsertionMode=az.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...An,...a},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=b?b:this.treeAdapter.createDocument(),this.tokenizer=new zT(this.options,this),this.activeFormattingElements=new z5(this.treeAdapter),this.fragmentContextID=c?zI(this.treeAdapter.getTagName(c)):aw.UNKNOWN,this._setContextModes(null!=c?c:this.document,this.fragmentContextID),this.openElements=new z3(this.document,this.treeAdapter,this)}static parse(a,b){let c=new this(b);return c.tokenizer.write(a,!0),c.document}static getFragmentParser(a,b){let c={...An,...b};null!=a||(a=c.treeAdapter.createElement(av.TEMPLATE,as.HTML,[]));let d=c.treeAdapter.createElement("documentmock",as.HTML,[]),e=new this(c,d,a);return e.fragmentContextID===aw.TEMPLATE&&e.tmplInsertionModeStack.unshift(az.IN_TEMPLATE),e._initTokenizerForFragmentParsing(),e._insertFakeRootElement(),e._resetInsertionMode(),e._findFormInFragmentContext(),e}getFragment(){let a=this.treeAdapter.getFirstChild(this.document),b=this.treeAdapter.createDocumentFragment();return this._adoptNodes(a,b),b}_err(a,b,c){var d;if(!this.onParseError)return;let e=null!=(d=a.location)?d:Al,f={code:b,startLine:e.startLine,startCol:e.startCol,startOffset:e.startOffset,endLine:c?e.startLine:e.endLine,endCol:c?e.startCol:e.endCol,endOffset:c?e.startOffset:e.endOffset};this.onParseError(f)}onItemPush(a,b,c){var d,e;null==(e=(d=this.treeAdapter).onItemPush)||e.call(d,a),c&&this.openElements.stackTop>0&&this._setContextModes(a,b)}onItemPop(a,b){var c,d;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(a,this.currentToken),null==(d=(c=this.treeAdapter).onItemPop)||d.call(c,a,this.openElements.current),b){let a,b;0===this.openElements.stackTop&&this.fragmentContext?(a=this.fragmentContext,b=this.fragmentContextID):{current:a,currentTagId:b}=this.openElements,this._setContextModes(a,b)}}_setContextModes(a,b){let c=a===this.document||a&&this.treeAdapter.getNamespaceURI(a)===as.HTML;this.currentNotInHTML=!c,this.tokenizer.inForeignNode=!c&&void 0!==a&&void 0!==b&&!this._isIntegrationPoint(b,a)}_switchToTextParsing(a,b){this._insertElement(a,as.HTML),this.tokenizer.state=b,this.originalInsertionMode=this.insertionMode,this.insertionMode=az.TEXT}switchToPlaintextParsing(){this.insertionMode=az.TEXT,this.originalInsertionMode=az.IN_BODY,this.tokenizer.state=zN.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let a=this.fragmentContext;for(;a;){if(this.treeAdapter.getTagName(a)===av.FORM){this.formElement=a;break}a=this.treeAdapter.getParentNode(a)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===as.HTML)switch(this.fragmentContextID){case aw.TITLE:case aw.TEXTAREA:this.tokenizer.state=zN.RCDATA;break;case aw.STYLE:case aw.XMP:case aw.IFRAME:case aw.NOEMBED:case aw.NOFRAMES:case aw.NOSCRIPT:this.tokenizer.state=zN.RAWTEXT;break;case aw.SCRIPT:this.tokenizer.state=zN.SCRIPT_DATA;break;case aw.PLAINTEXT:this.tokenizer.state=zN.PLAINTEXT}}_setDocumentType(a){let b=a.name||"",c=a.publicId||"",d=a.systemId||"";if(this.treeAdapter.setDocumentType(this.document,b,c,d),a.location){let b=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));b&&this.treeAdapter.setNodeSourceCodeLocation(b,a.location)}}_attachElementToTree(a,b){if(this.options.sourceCodeLocationInfo){let c=b&&{...b,startTag:b};this.treeAdapter.setNodeSourceCodeLocation(a,c)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(a);else{let b=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=b?b:this.document,a)}}_appendElement(a,b){let c=this.treeAdapter.createElement(a.tagName,b,a.attrs);this._attachElementToTree(c,a.location)}_insertElement(a,b){let c=this.treeAdapter.createElement(a.tagName,b,a.attrs);this._attachElementToTree(c,a.location),this.openElements.push(c,a.tagID)}_insertFakeElement(a,b){let c=this.treeAdapter.createElement(a,as.HTML,[]);this._attachElementToTree(c,null),this.openElements.push(c,b)}_insertTemplate(a){let b=this.treeAdapter.createElement(a.tagName,as.HTML,a.attrs),c=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(b,c),this._attachElementToTree(b,a.location),this.openElements.push(b,a.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,null)}_insertFakeRootElement(){let a=this.treeAdapter.createElement(av.HTML,as.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null),this.treeAdapter.appendChild(this.openElements.current,a),this.openElements.push(a,aw.HTML)}_appendCommentNode(a,b){let c=this.treeAdapter.createCommentNode(a.data);this.treeAdapter.appendChild(b,c),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,a.location)}_insertCharacters(a){let b,c;if(this._shouldFosterParentOnInsertion()?({parent:b,beforeElement:c}=this._findFosterParentingLocation(),c?this.treeAdapter.insertTextBefore(b,a.chars,c):this.treeAdapter.insertText(b,a.chars)):(b=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(b,a.chars)),!a.location)return;let d=this.treeAdapter.getChildNodes(b),e=c?d.lastIndexOf(c):d.length,f=d[e-1];if(this.treeAdapter.getNodeSourceCodeLocation(f)){let{endLine:b,endCol:c,endOffset:d}=a.location;this.treeAdapter.updateNodeSourceCodeLocation(f,{endLine:b,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(f,a.location)}_adoptNodes(a,b){for(let c=this.treeAdapter.getFirstChild(a);c;c=this.treeAdapter.getFirstChild(a))this.treeAdapter.detachNode(c),this.treeAdapter.appendChild(b,c)}_setEndLocation(a,b){if(this.treeAdapter.getNodeSourceCodeLocation(a)&&b.location){let c=b.location,d=this.treeAdapter.getTagName(a),e=b.type===am.END_TAG&&d===b.tagName?{endTag:{...c},endLine:c.endLine,endCol:c.endCol,endOffset:c.endOffset}:{endLine:c.startLine,endCol:c.startCol,endOffset:c.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(a,e)}}shouldProcessStartTagTokenInForeignContent(a){let b,c;return!!this.currentNotInHTML&&(0===this.openElements.stackTop&&this.fragmentContext?(b=this.fragmentContext,c=this.fragmentContextID):{current:b,currentTagId:c}=this.openElements,(a.tagID!==aw.SVG||this.treeAdapter.getTagName(b)!==av.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(b)!==as.MATHML)&&(this.tokenizer.inForeignNode||(a.tagID===aw.MGLYPH||a.tagID===aw.MALIGNMARK)&&void 0!==c&&!this._isIntegrationPoint(c,b,as.HTML)))}_processToken(a){switch(a.type){case am.CHARACTER:this.onCharacter(a);break;case am.NULL_CHARACTER:this.onNullCharacter(a);break;case am.COMMENT:this.onComment(a);break;case am.DOCTYPE:this.onDoctype(a);break;case am.START_TAG:this._processStartTag(a);break;case am.END_TAG:this.onEndTag(a);break;case am.EOF:this.onEof(a);break;case am.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(a)}}_isIntegrationPoint(a,b,c){let d=this.treeAdapter.getNamespaceURI(b),e=this.treeAdapter.getAttrList(b);return(!c||c===as.HTML)&&function(a,b,c){if(b===as.MATHML&&a===aw.ANNOTATION_XML){for(let a=0;a<c.length;a++)if(c[a].name===at.ENCODING){let b=c[a].value.toLowerCase();return"text/html"===b||"application/xhtml+xml"===b}}return b===as.SVG&&(a===aw.FOREIGN_OBJECT||a===aw.DESC||a===aw.TITLE)}(a,d,e)||(!c||c===as.MATHML)&&d===as.MATHML&&(a===aw.MI||a===aw.MO||a===aw.MN||a===aw.MS||a===aw.MTEXT)}_reconstructActiveFormattingElements(){let a=this.activeFormattingElements.entries.length;if(a){let b=this.activeFormattingElements.entries.findIndex(a=>a.type===ay.Marker||this.openElements.contains(a.element)),c=-1===b?a-1:b-1;for(let a=c;a>=0;a--){let b=this.activeFormattingElements.entries[a];this._insertElement(b.token,this.treeAdapter.getNamespaceURI(b.element)),b.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=az.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(aw.P),this.openElements.popUntilTagNamePopped(aw.P)}_resetInsertionMode(){for(let a=this.openElements.stackTop;a>=0;a--)switch(0===a&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[a]){case aw.TR:this.insertionMode=az.IN_ROW;return;case aw.TBODY:case aw.THEAD:case aw.TFOOT:this.insertionMode=az.IN_TABLE_BODY;return;case aw.CAPTION:this.insertionMode=az.IN_CAPTION;return;case aw.COLGROUP:this.insertionMode=az.IN_COLUMN_GROUP;return;case aw.TABLE:this.insertionMode=az.IN_TABLE;return;case aw.BODY:this.insertionMode=az.IN_BODY;return;case aw.FRAMESET:this.insertionMode=az.IN_FRAMESET;return;case aw.SELECT:return void this._resetInsertionModeForSelect(a);case aw.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case aw.HTML:this.insertionMode=this.headElement?az.AFTER_HEAD:az.BEFORE_HEAD;return;case aw.TD:case aw.TH:if(a>0){this.insertionMode=az.IN_CELL;return}break;case aw.HEAD:if(a>0){this.insertionMode=az.IN_HEAD;return}}this.insertionMode=az.IN_BODY}_resetInsertionModeForSelect(a){if(a>0)for(let b=a-1;b>0;b--){let a=this.openElements.tagIDs[b];if(a===aw.TEMPLATE)break;if(a===aw.TABLE){this.insertionMode=az.IN_SELECT_IN_TABLE;return}}this.insertionMode=az.IN_SELECT}_isElementCausesFosterParenting(a){return Am.has(a)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let a=this.openElements.stackTop;a>=0;a--){let b=this.openElements.items[a];switch(this.openElements.tagIDs[a]){case aw.TEMPLATE:if(this.treeAdapter.getNamespaceURI(b)===as.HTML)return{parent:this.treeAdapter.getTemplateContent(b),beforeElement:null};break;case aw.TABLE:{let c=this.treeAdapter.getParentNode(b);if(c)return{parent:c,beforeElement:b};return{parent:this.openElements.items[a-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(a){let b=this._findFosterParentingLocation();b.beforeElement?this.treeAdapter.insertBefore(b.parent,a,b.beforeElement):this.treeAdapter.appendChild(b.parent,a)}_isSpecialElement(a,b){return zK[this.treeAdapter.getNamespaceURI(a)].has(b)}onCharacter(a){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){var b,c;return void(b=this,c=a,b._insertCharacters(c),b.framesetOk=!1)}switch(this.insertionMode){case az.INITIAL:As(this,a);break;case az.BEFORE_HTML:At(this,a);break;case az.BEFORE_HEAD:Au(this,a);break;case az.IN_HEAD:Ax(this,a);break;case az.IN_HEAD_NO_SCRIPT:Ay(this,a);break;case az.AFTER_HEAD:Az(this,a);break;case az.IN_BODY:case az.IN_CAPTION:case az.IN_CELL:case az.IN_TEMPLATE:AC(this,a);break;case az.TEXT:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:this._insertCharacters(a);break;case az.IN_TABLE:case az.IN_TABLE_BODY:case az.IN_ROW:AL(this,a);break;case az.IN_TABLE_TEXT:AQ(this,a);break;case az.IN_COLUMN_GROUP:AU(this,a);break;case az.AFTER_BODY:A1(this,a);break;case az.AFTER_AFTER_BODY:A2(this,a)}}onNullCharacter(a){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){var b,c;return void(b=this,(c=a).chars="�",b._insertCharacters(c))}switch(this.insertionMode){case az.INITIAL:As(this,a);break;case az.BEFORE_HTML:At(this,a);break;case az.BEFORE_HEAD:Au(this,a);break;case az.IN_HEAD:Ax(this,a);break;case az.IN_HEAD_NO_SCRIPT:Ay(this,a);break;case az.AFTER_HEAD:Az(this,a);break;case az.TEXT:this._insertCharacters(a);break;case az.IN_TABLE:case az.IN_TABLE_BODY:case az.IN_ROW:AL(this,a);break;case az.IN_COLUMN_GROUP:AU(this,a);break;case az.AFTER_BODY:A1(this,a);break;case az.AFTER_AFTER_BODY:A2(this,a)}}onComment(a){var b,c,d,e;if(this.skipNextNewLine=!1,this.currentNotInHTML)return void Aq(this,a);switch(this.insertionMode){case az.INITIAL:case az.BEFORE_HTML:case az.BEFORE_HEAD:case az.IN_HEAD:case az.IN_HEAD_NO_SCRIPT:case az.AFTER_HEAD:case az.IN_BODY:case az.IN_TABLE:case az.IN_CAPTION:case az.IN_COLUMN_GROUP:case az.IN_TABLE_BODY:case az.IN_ROW:case az.IN_CELL:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:case az.IN_TEMPLATE:case az.IN_FRAMESET:case az.AFTER_FRAMESET:Aq(this,a);break;case az.IN_TABLE_TEXT:AR(this,a);break;case az.AFTER_BODY:b=this,c=a,b._appendCommentNode(c,b.openElements.items[0]);break;case az.AFTER_AFTER_BODY:case az.AFTER_AFTER_FRAMESET:d=this,e=a,d._appendCommentNode(e,d.document)}}onDoctype(a){switch(this.skipNextNewLine=!1,this.insertionMode){case az.INITIAL:!function(a,b){a._setDocumentType(b);let c=b.forceQuirks?au.QUIRKS:function(a){if(a.name!==z7)return au.QUIRKS;let{systemId:b}=a;if(b&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===b.toLowerCase())return au.QUIRKS;let{publicId:c}=a;if(null!==c){if(c=c.toLowerCase(),Aa.has(c))return au.QUIRKS;let a=null===b?z9:z8;if(Ad(c,a))return au.QUIRKS;if(Ad(c,a=null===b?Ab:Ac))return au.LIMITED_QUIRKS}return au.NO_QUIRKS}(b);(b.name!==z7||null!==b.publicId||null!==b.systemId&&"about:legacy-compat"!==b.systemId)&&a._err(b,al.nonConformingDoctype),a.treeAdapter.setDocumentMode(a.document,c),a.insertionMode=az.BEFORE_HTML}(this,a);break;case az.BEFORE_HEAD:case az.IN_HEAD:case az.IN_HEAD_NO_SCRIPT:case az.AFTER_HEAD:this._err(a,al.misplacedDoctype);break;case az.IN_TABLE_TEXT:AR(this,a)}}onStartTag(a){this.skipNextNewLine=!1,this.currentToken=a,this._processStartTag(a),a.selfClosing&&!a.ackSelfClosing&&this._err(a,al.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(a){this.shouldProcessStartTagTokenInForeignContent(a)?function(a,b){let c;if((c=b.tagID)===aw.FONT&&b.attrs.some(({name:a})=>a===at.COLOR||a===at.SIZE||a===at.FACE)||Ah.has(c))A3(a),a._startTagOutsideForeignContent(b);else{let c=a._getAdjustedCurrentElement(),d=a.treeAdapter.getNamespaceURI(c);if(d===as.MATHML)Ai(b);else if(d===as.SVG){let a;null!=(a=Ag.get(b.tagName))&&(b.tagName=a,b.tagID=zI(b.tagName)),Aj(b)}Ak(b),b.selfClosing?a._appendElement(b,d):a._insertElement(b,d),b.ackSelfClosing=!0}}(this,a):this._startTagOutsideForeignContent(a)}_startTagOutsideForeignContent(a){switch(this.insertionMode){case az.INITIAL:As(this,a);break;case az.BEFORE_HTML:b=this,(c=a).tagID===aw.HTML?(b._insertElement(c,as.HTML),b.insertionMode=az.BEFORE_HEAD):At(b,c);break;case az.BEFORE_HEAD:var b,c,d,e,f,g,h,i,j,k,l,m,n=this,o=a;switch(o.tagID){case aw.HTML:AH(n,o);break;case aw.HEAD:n._insertElement(o,as.HTML),n.headElement=n.openElements.current,n.insertionMode=az.IN_HEAD;break;default:Au(n,o)}break;case az.IN_HEAD:Av(this,a);break;case az.IN_HEAD_NO_SCRIPT:var p=this,q=a;switch(q.tagID){case aw.HTML:AH(p,q);break;case aw.BASEFONT:case aw.BGSOUND:case aw.HEAD:case aw.LINK:case aw.META:case aw.NOFRAMES:case aw.STYLE:Av(p,q);break;case aw.NOSCRIPT:p._err(q,al.nestedNoscriptInHead);break;default:Ay(p,q)}break;case az.AFTER_HEAD:var r=this,s=a;switch(s.tagID){case aw.HTML:AH(r,s);break;case aw.BODY:r._insertElement(s,as.HTML),r.framesetOk=!1,r.insertionMode=az.IN_BODY;break;case aw.FRAMESET:r._insertElement(s,as.HTML),r.insertionMode=az.IN_FRAMESET;break;case aw.BASE:case aw.BASEFONT:case aw.BGSOUND:case aw.LINK:case aw.META:case aw.NOFRAMES:case aw.SCRIPT:case aw.STYLE:case aw.TEMPLATE:case aw.TITLE:r._err(s,al.abandonedHeadElementChild),r.openElements.push(r.headElement,aw.HEAD),Av(r,s),r.openElements.remove(r.headElement);break;case aw.HEAD:r._err(s,al.misplacedStartTagForHeadElement);break;default:Az(r,s)}break;case az.IN_BODY:AH(this,a);break;case az.IN_TABLE:AM(this,a);break;case az.IN_TABLE_TEXT:AR(this,a);break;case az.IN_CAPTION:let t;d=this,t=(e=a).tagID,AS.has(t)?d.openElements.hasInTableScope(aw.CAPTION)&&(d.openElements.generateImpliedEndTags(),d.openElements.popUntilTagNamePopped(aw.CAPTION),d.activeFormattingElements.clearToLastMarker(),d.insertionMode=az.IN_TABLE,AM(d,e)):AH(d,e);break;case az.IN_COLUMN_GROUP:AT(this,a);break;case az.IN_TABLE_BODY:AV(this,a);break;case az.IN_ROW:AX(this,a);break;case az.IN_CELL:let u;f=this,u=(g=a).tagID,AS.has(u)?(f.openElements.hasInTableScope(aw.TD)||f.openElements.hasInTableScope(aw.TH))&&(f._closeTableCell(),AX(f,g)):AH(f,g);break;case az.IN_SELECT:AZ(this,a);break;case az.IN_SELECT_IN_TABLE:let v;h=this,(v=(i=a).tagID)===aw.CAPTION||v===aw.TABLE||v===aw.TBODY||v===aw.TFOOT||v===aw.THEAD||v===aw.TR||v===aw.TD||v===aw.TH?(h.openElements.popUntilTagNamePopped(aw.SELECT),h._resetInsertionMode(),h._processStartTag(i)):AZ(h,i);break;case az.IN_TEMPLATE:var w=this,x=a;switch(x.tagID){case aw.BASE:case aw.BASEFONT:case aw.BGSOUND:case aw.LINK:case aw.META:case aw.NOFRAMES:case aw.SCRIPT:case aw.STYLE:case aw.TEMPLATE:case aw.TITLE:Av(w,x);break;case aw.CAPTION:case aw.COLGROUP:case aw.TBODY:case aw.TFOOT:case aw.THEAD:w.tmplInsertionModeStack[0]=az.IN_TABLE,w.insertionMode=az.IN_TABLE,AM(w,x);break;case aw.COL:w.tmplInsertionModeStack[0]=az.IN_COLUMN_GROUP,w.insertionMode=az.IN_COLUMN_GROUP,AT(w,x);break;case aw.TR:w.tmplInsertionModeStack[0]=az.IN_TABLE_BODY,w.insertionMode=az.IN_TABLE_BODY,AV(w,x);break;case aw.TD:case aw.TH:w.tmplInsertionModeStack[0]=az.IN_ROW,w.insertionMode=az.IN_ROW,AX(w,x);break;default:w.tmplInsertionModeStack[0]=az.IN_BODY,w.insertionMode=az.IN_BODY,AH(w,x)}break;case az.AFTER_BODY:j=this,(k=a).tagID===aw.HTML?AH(j,k):A1(j,k);break;case az.IN_FRAMESET:var y=this,z=a;switch(z.tagID){case aw.HTML:AH(y,z);break;case aw.FRAMESET:y._insertElement(z,as.HTML);break;case aw.FRAME:y._appendElement(z,as.HTML),z.ackSelfClosing=!0;break;case aw.NOFRAMES:Av(y,z)}break;case az.AFTER_FRAMESET:var A=this,B=a;switch(B.tagID){case aw.HTML:AH(A,B);break;case aw.NOFRAMES:Av(A,B)}break;case az.AFTER_AFTER_BODY:l=this,(m=a).tagID===aw.HTML?AH(l,m):A2(l,m);break;case az.AFTER_AFTER_FRAMESET:var C=this,D=a;switch(D.tagID){case aw.HTML:AH(C,D);break;case aw.NOFRAMES:Av(C,D)}}}onEndTag(a){this.skipNextNewLine=!1,this.currentToken=a,this.currentNotInHTML?function(a,b){if(b.tagID===aw.P||b.tagID===aw.BR){A3(a),a._endTagOutsideForeignContent(b);return}for(let c=a.openElements.stackTop;c>0;c--){let d=a.openElements.items[c];if(a.treeAdapter.getNamespaceURI(d)===as.HTML){a._endTagOutsideForeignContent(b);break}let e=a.treeAdapter.getTagName(d);if(e.toLowerCase()===b.tagName){b.tagName=e,a.openElements.shortenToLength(c);break}}}(this,a):this._endTagOutsideForeignContent(a)}_endTagOutsideForeignContent(a){switch(this.insertionMode){case az.INITIAL:As(this,a);break;case az.BEFORE_HTML:let b;d=this,((b=(e=a).tagID)===aw.HTML||b===aw.HEAD||b===aw.BODY||b===aw.BR)&&At(d,e);break;case az.BEFORE_HEAD:let c;f=this,(c=(g=a).tagID)===aw.HEAD||c===aw.BODY||c===aw.HTML||c===aw.BR?Au(f,g):f._err(g,al.endTagWithoutMatchingOpenElement);break;case az.IN_HEAD:var d,e,f,g,h,i,j,k,l,m,n,o,p=this,q=a;switch(q.tagID){case aw.HEAD:p.openElements.pop(),p.insertionMode=az.AFTER_HEAD;break;case aw.BODY:case aw.BR:case aw.HTML:Ax(p,q);break;case aw.TEMPLATE:Aw(p,q);break;default:p._err(q,al.endTagWithoutMatchingOpenElement)}break;case az.IN_HEAD_NO_SCRIPT:var r=this,s=a;switch(s.tagID){case aw.NOSCRIPT:r.openElements.pop(),r.insertionMode=az.IN_HEAD;break;case aw.BR:Ay(r,s);break;default:r._err(s,al.endTagWithoutMatchingOpenElement)}break;case az.AFTER_HEAD:var t=this,u=a;switch(u.tagID){case aw.BODY:case aw.HTML:case aw.BR:Az(t,u);break;case aw.TEMPLATE:Aw(t,u);break;default:t._err(u,al.endTagWithoutMatchingOpenElement)}break;case az.IN_BODY:AJ(this,a);break;case az.TEXT:h=this,a.tagID===aw.SCRIPT&&(null==(i=h.scriptHandler)||i.call(h,h.openElements.current)),h.openElements.pop(),h.insertionMode=h.originalInsertionMode;break;case az.IN_TABLE:AN(this,a);break;case az.IN_TABLE_TEXT:AR(this,a);break;case az.IN_CAPTION:var v=this,w=a;let x=w.tagID;switch(x){case aw.CAPTION:case aw.TABLE:v.openElements.hasInTableScope(aw.CAPTION)&&(v.openElements.generateImpliedEndTags(),v.openElements.popUntilTagNamePopped(aw.CAPTION),v.activeFormattingElements.clearToLastMarker(),v.insertionMode=az.IN_TABLE,x===aw.TABLE&&AN(v,w));break;case aw.BODY:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TBODY:case aw.TD:case aw.TFOOT:case aw.TH:case aw.THEAD:case aw.TR:break;default:AJ(v,w)}break;case az.IN_COLUMN_GROUP:var y=this,z=a;switch(z.tagID){case aw.COLGROUP:y.openElements.currentTagId===aw.COLGROUP&&(y.openElements.pop(),y.insertionMode=az.IN_TABLE);break;case aw.TEMPLATE:Aw(y,z);break;case aw.COL:break;default:AU(y,z)}break;case az.IN_TABLE_BODY:AW(this,a);break;case az.IN_ROW:AY(this,a);break;case az.IN_CELL:var A=this,B=a;let C=B.tagID;switch(C){case aw.TD:case aw.TH:A.openElements.hasInTableScope(C)&&(A.openElements.generateImpliedEndTags(),A.openElements.popUntilTagNamePopped(C),A.activeFormattingElements.clearToLastMarker(),A.insertionMode=az.IN_ROW);break;case aw.TABLE:case aw.TBODY:case aw.TFOOT:case aw.THEAD:case aw.TR:A.openElements.hasInTableScope(C)&&(A._closeTableCell(),AY(A,B));break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:break;default:AJ(A,B)}break;case az.IN_SELECT:A$(this,a);break;case az.IN_SELECT_IN_TABLE:let D;j=this,(D=(k=a).tagID)===aw.CAPTION||D===aw.TABLE||D===aw.TBODY||D===aw.TFOOT||D===aw.THEAD||D===aw.TR||D===aw.TD||D===aw.TH?j.openElements.hasInTableScope(D)&&(j.openElements.popUntilTagNamePopped(aw.SELECT),j._resetInsertionMode(),j.onEndTag(k)):A$(j,k);break;case az.IN_TEMPLATE:l=this,(m=a).tagID===aw.TEMPLATE&&Aw(l,m);break;case az.AFTER_BODY:A0(this,a);break;case az.IN_FRAMESET:n=this,a.tagID===aw.FRAMESET&&!n.openElements.isRootHtmlElementCurrent()&&(n.openElements.pop(),n.fragmentContext||n.openElements.currentTagId===aw.FRAMESET||(n.insertionMode=az.AFTER_FRAMESET));break;case az.AFTER_FRAMESET:o=this,a.tagID===aw.HTML&&(o.insertionMode=az.AFTER_AFTER_FRAMESET);break;case az.AFTER_AFTER_BODY:A2(this,a)}}onEof(a){switch(this.insertionMode){case az.INITIAL:As(this,a);break;case az.BEFORE_HTML:At(this,a);break;case az.BEFORE_HEAD:Au(this,a);break;case az.IN_HEAD:Ax(this,a);break;case az.IN_HEAD_NO_SCRIPT:Ay(this,a);break;case az.AFTER_HEAD:Az(this,a);break;case az.IN_BODY:case az.IN_TABLE:case az.IN_CAPTION:case az.IN_COLUMN_GROUP:case az.IN_TABLE_BODY:case az.IN_ROW:case az.IN_CELL:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:AK(this,a);break;case az.TEXT:var b,c;b=this,c=a,b._err(c,al.eofInElementThatCanContainOnlyText),b.openElements.pop(),b.insertionMode=b.originalInsertionMode,b.onEof(c);break;case az.IN_TABLE_TEXT:AR(this,a);break;case az.IN_TEMPLATE:A_(this,a);break;case az.AFTER_BODY:case az.IN_FRAMESET:case az.AFTER_FRAMESET:case az.AFTER_AFTER_BODY:case az.AFTER_AFTER_FRAMESET:Ar(this,a)}}onWhitespaceCharacter(a){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,a.chars.charCodeAt(0)===ak.LINE_FEED)){if(1===a.chars.length)return;a.chars=a.chars.substr(1)}if(this.tokenizer.inForeignNode)return void this._insertCharacters(a);switch(this.insertionMode){case az.IN_HEAD:case az.IN_HEAD_NO_SCRIPT:case az.AFTER_HEAD:case az.TEXT:case az.IN_COLUMN_GROUP:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:case az.IN_FRAMESET:case az.AFTER_FRAMESET:this._insertCharacters(a);break;case az.IN_BODY:case az.IN_CAPTION:case az.IN_CELL:case az.IN_TEMPLATE:case az.AFTER_BODY:case az.AFTER_AFTER_BODY:case az.AFTER_AFTER_FRAMESET:AB(this,a);break;case az.IN_TABLE:case az.IN_TABLE_BODY:case az.IN_ROW:AL(this,a);break;case az.IN_TABLE_TEXT:AP(this,a)}}}function Ap(a,b){for(let c=0;c<8;c++){let c=function(a,b){let c=a.activeFormattingElements.getElementEntryInScopeWithTagName(b.tagName);return c?a.openElements.contains(c.element)?a.openElements.hasInScope(b.tagID)||(c=null):(a.activeFormattingElements.removeEntry(c),c=null):AI(a,b),c}(a,b);if(!c)break;let d=function(a,b){let c=null,d=a.openElements.stackTop;for(;d>=0;d--){let e=a.openElements.items[d];if(e===b.element)break;a._isSpecialElement(e,a.openElements.tagIDs[d])&&(c=e)}return c||(a.openElements.shortenToLength(Math.max(d,0)),a.activeFormattingElements.removeEntry(b)),c}(a,c);if(!d)break;a.activeFormattingElements.bookmark=c;let e=function(a,b,c){let d=b,e=a.openElements.getCommonAncestor(b);for(let f=0,g=e;g!==c;f++,g=e){e=a.openElements.getCommonAncestor(g);let c=a.activeFormattingElements.getElementEntry(g),h=c&&f>=3;!c||h?(h&&a.activeFormattingElements.removeEntry(c),a.openElements.remove(g)):(g=function(a,b){let c=a.treeAdapter.getNamespaceURI(b.element),d=a.treeAdapter.createElement(b.token.tagName,c,b.token.attrs);return a.openElements.replace(b.element,d),b.element=d,d}(a,c),d===b&&(a.activeFormattingElements.bookmark=c),a.treeAdapter.detachNode(d),a.treeAdapter.appendChild(g,d),d=g)}return d}(a,d,c.element),f=a.openElements.getCommonAncestor(c.element);a.treeAdapter.detachNode(e),f&&function(a,b,c){let d=zI(a.treeAdapter.getTagName(b));if(a._isElementCausesFosterParenting(d))a._fosterParentElement(c);else{let e=a.treeAdapter.getNamespaceURI(b);d===aw.TEMPLATE&&e===as.HTML&&(b=a.treeAdapter.getTemplateContent(b)),a.treeAdapter.appendChild(b,c)}}(a,f,e),function(a,b,c){let d=a.treeAdapter.getNamespaceURI(c.element),{token:e}=c,f=a.treeAdapter.createElement(e.tagName,d,e.attrs);a._adoptNodes(b,f),a.treeAdapter.appendChild(b,f),a.activeFormattingElements.insertElementAfterBookmark(f,e),a.activeFormattingElements.removeEntry(c),a.openElements.remove(c.element),a.openElements.insertAfter(b,f,e.tagID)}(a,d,c)}}function Aq(a,b){a._appendCommentNode(b,a.openElements.currentTmplContentOrNode)}function Ar(a,b){if(a.stopped=!0,b.location){let c=2*!a.fragmentContext;for(let d=a.openElements.stackTop;d>=c;d--)a._setEndLocation(a.openElements.items[d],b);if(!a.fragmentContext&&a.openElements.stackTop>=0){let c=a.openElements.items[0],d=a.treeAdapter.getNodeSourceCodeLocation(c);if(d&&!d.endTag&&(a._setEndLocation(c,b),a.openElements.stackTop>=1)){let c=a.openElements.items[1],d=a.treeAdapter.getNodeSourceCodeLocation(c);d&&!d.endTag&&a._setEndLocation(c,b)}}}}function As(a,b){a._err(b,al.missingDoctype,!0),a.treeAdapter.setDocumentMode(a.document,au.QUIRKS),a.insertionMode=az.BEFORE_HTML,a._processToken(b)}function At(a,b){a._insertFakeRootElement(),a.insertionMode=az.BEFORE_HEAD,a._processToken(b)}function Au(a,b){a._insertFakeElement(av.HEAD,aw.HEAD),a.headElement=a.openElements.current,a.insertionMode=az.IN_HEAD,a._processToken(b)}function Av(a,b){switch(b.tagID){case aw.HTML:AH(a,b);break;case aw.BASE:case aw.BASEFONT:case aw.BGSOUND:case aw.LINK:case aw.META:a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.TITLE:a._switchToTextParsing(b,zN.RCDATA);break;case aw.NOSCRIPT:a.options.scriptingEnabled?a._switchToTextParsing(b,zN.RAWTEXT):(a._insertElement(b,as.HTML),a.insertionMode=az.IN_HEAD_NO_SCRIPT);break;case aw.NOFRAMES:case aw.STYLE:a._switchToTextParsing(b,zN.RAWTEXT);break;case aw.SCRIPT:a._switchToTextParsing(b,zN.SCRIPT_DATA);break;case aw.TEMPLATE:a._insertTemplate(b),a.activeFormattingElements.insertMarker(),a.framesetOk=!1,a.insertionMode=az.IN_TEMPLATE,a.tmplInsertionModeStack.unshift(az.IN_TEMPLATE);break;case aw.HEAD:a._err(b,al.misplacedStartTagForHeadElement);break;default:Ax(a,b)}}function Aw(a,b){a.openElements.tmplCount>0?(a.openElements.generateImpliedEndTagsThoroughly(),a.openElements.currentTagId!==aw.TEMPLATE&&a._err(b,al.closingOfElementWithOpenChildElements),a.openElements.popUntilTagNamePopped(aw.TEMPLATE),a.activeFormattingElements.clearToLastMarker(),a.tmplInsertionModeStack.shift(),a._resetInsertionMode()):a._err(b,al.endTagWithoutMatchingOpenElement)}function Ax(a,b){a.openElements.pop(),a.insertionMode=az.AFTER_HEAD,a._processToken(b)}function Ay(a,b){let c=b.type===am.EOF?al.openElementsLeftAfterEof:al.disallowedContentInNoscriptInHead;a._err(b,c),a.openElements.pop(),a.insertionMode=az.IN_HEAD,a._processToken(b)}function Az(a,b){a._insertFakeElement(av.BODY,aw.BODY),a.insertionMode=az.IN_BODY,AA(a,b)}function AA(a,b){switch(b.type){case am.CHARACTER:AC(a,b);break;case am.WHITESPACE_CHARACTER:AB(a,b);break;case am.COMMENT:Aq(a,b);break;case am.START_TAG:AH(a,b);break;case am.END_TAG:AJ(a,b);break;case am.EOF:AK(a,b)}}function AB(a,b){a._reconstructActiveFormattingElements(),a._insertCharacters(b)}function AC(a,b){a._reconstructActiveFormattingElements(),a._insertCharacters(b),a.framesetOk=!1}function AD(a,b){a._reconstructActiveFormattingElements(),a._appendElement(b,as.HTML),a.framesetOk=!1,b.ackSelfClosing=!0}function AE(a){let b=zC(a,at.TYPE);return null!=b&&"hidden"===b.toLowerCase()}function AF(a,b){a._switchToTextParsing(b,zN.RAWTEXT)}function AG(a,b){a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML)}function AH(a,b){switch(b.tagID){case aw.I:case aw.S:case aw.B:case aw.U:case aw.EM:case aw.TT:case aw.BIG:case aw.CODE:case aw.FONT:case aw.SMALL:case aw.STRIKE:case aw.STRONG:a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.activeFormattingElements.pushElement(a.openElements.current,b);break;case aw.A:let c;(c=a.activeFormattingElements.getElementEntryInScopeWithTagName(av.A))&&(Ap(a,b),a.openElements.remove(c.element),a.activeFormattingElements.removeEntry(c)),a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.activeFormattingElements.pushElement(a.openElements.current,b);break;case aw.H1:case aw.H2:case aw.H3:case aw.H4:case aw.H5:case aw.H6:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),void 0!==a.openElements.currentTagId&&zL.has(a.openElements.currentTagId)&&a.openElements.pop(),a._insertElement(b,as.HTML);break;case aw.P:case aw.DL:case aw.OL:case aw.UL:case aw.DIV:case aw.DIR:case aw.NAV:case aw.MAIN:case aw.MENU:case aw.ASIDE:case aw.CENTER:case aw.FIGURE:case aw.FOOTER:case aw.HEADER:case aw.HGROUP:case aw.DIALOG:case aw.DETAILS:case aw.ADDRESS:case aw.ARTICLE:case aw.SEARCH:case aw.SECTION:case aw.SUMMARY:case aw.FIELDSET:case aw.BLOCKQUOTE:case aw.FIGCAPTION:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML);break;case aw.LI:case aw.DD:case aw.DT:a.framesetOk=!1;let d=b.tagID;for(let b=a.openElements.stackTop;b>=0;b--){let c=a.openElements.tagIDs[b];if(d===aw.LI&&c===aw.LI||(d===aw.DD||d===aw.DT)&&(c===aw.DD||c===aw.DT)){a.openElements.generateImpliedEndTagsWithExclusion(c),a.openElements.popUntilTagNamePopped(c);break}if(c!==aw.ADDRESS&&c!==aw.DIV&&c!==aw.P&&a._isSpecialElement(a.openElements.items[b],c))break}a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML);break;case aw.BR:case aw.IMG:case aw.WBR:case aw.AREA:case aw.EMBED:case aw.KEYGEN:AD(a,b);break;case aw.HR:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._appendElement(b,as.HTML),a.framesetOk=!1,b.ackSelfClosing=!0;break;case aw.RB:case aw.RTC:a.openElements.hasInScope(aw.RUBY)&&a.openElements.generateImpliedEndTags(),a._insertElement(b,as.HTML);break;case aw.RT:case aw.RP:a.openElements.hasInScope(aw.RUBY)&&a.openElements.generateImpliedEndTagsWithExclusion(aw.RTC),a._insertElement(b,as.HTML);break;case aw.PRE:case aw.LISTING:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),a.skipNextNewLine=!0,a.framesetOk=!1;break;case aw.XMP:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._reconstructActiveFormattingElements(),a.framesetOk=!1,a._switchToTextParsing(b,zN.RAWTEXT);break;case aw.SVG:a._reconstructActiveFormattingElements(),Aj(b),Ak(b),b.selfClosing?a._appendElement(b,as.SVG):a._insertElement(b,as.SVG),b.ackSelfClosing=!0;break;case aw.HTML:0===a.openElements.tmplCount&&a.treeAdapter.adoptAttributes(a.openElements.items[0],b.attrs);break;case aw.BASE:case aw.LINK:case aw.META:case aw.STYLE:case aw.TITLE:case aw.SCRIPT:case aw.BGSOUND:case aw.BASEFONT:case aw.TEMPLATE:Av(a,b);break;case aw.BODY:let e;(e=a.openElements.tryPeekProperlyNestedBodyElement())&&0===a.openElements.tmplCount&&(a.framesetOk=!1,a.treeAdapter.adoptAttributes(e,b.attrs));break;case aw.FORM:let f;f=a.openElements.tmplCount>0,(!a.formElement||f)&&(a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),f||(a.formElement=a.openElements.current));break;case aw.NOBR:a._reconstructActiveFormattingElements(),a.openElements.hasInScope(aw.NOBR)&&(Ap(a,b),a._reconstructActiveFormattingElements()),a._insertElement(b,as.HTML),a.activeFormattingElements.pushElement(a.openElements.current,b);break;case aw.MATH:a._reconstructActiveFormattingElements(),Ai(b),Ak(b),b.selfClosing?a._appendElement(b,as.MATHML):a._insertElement(b,as.MATHML),b.ackSelfClosing=!0;break;case aw.TABLE:a.treeAdapter.getDocumentMode(a.document)!==au.QUIRKS&&a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),a.framesetOk=!1,a.insertionMode=az.IN_TABLE;break;case aw.INPUT:a._reconstructActiveFormattingElements(),a._appendElement(b,as.HTML),AE(b)||(a.framesetOk=!1),b.ackSelfClosing=!0;break;case aw.PARAM:case aw.TRACK:case aw.SOURCE:a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.IMAGE:b.tagName=av.IMG,b.tagID=aw.IMG,AD(a,b);break;case aw.BUTTON:a.openElements.hasInScope(aw.BUTTON)&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilTagNamePopped(aw.BUTTON)),a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.framesetOk=!1;break;case aw.APPLET:case aw.OBJECT:case aw.MARQUEE:a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.activeFormattingElements.insertMarker(),a.framesetOk=!1;break;case aw.IFRAME:a.framesetOk=!1,a._switchToTextParsing(b,zN.RAWTEXT);break;case aw.SELECT:a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.framesetOk=!1,a.insertionMode=a.insertionMode===az.IN_TABLE||a.insertionMode===az.IN_CAPTION||a.insertionMode===az.IN_TABLE_BODY||a.insertionMode===az.IN_ROW||a.insertionMode===az.IN_CELL?az.IN_SELECT_IN_TABLE:az.IN_SELECT;break;case aw.OPTION:case aw.OPTGROUP:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML);break;case aw.NOEMBED:case aw.NOFRAMES:AF(a,b);break;case aw.FRAMESET:let g;g=a.openElements.tryPeekProperlyNestedBodyElement(),a.framesetOk&&g&&(a.treeAdapter.detachNode(g),a.openElements.popAllUpToHtmlElement(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_FRAMESET);break;case aw.TEXTAREA:a._insertElement(b,as.HTML),a.skipNextNewLine=!0,a.tokenizer.state=zN.RCDATA,a.originalInsertionMode=a.insertionMode,a.framesetOk=!1,a.insertionMode=az.TEXT;break;case aw.NOSCRIPT:a.options.scriptingEnabled?AF(a,b):AG(a,b);break;case aw.PLAINTEXT:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),a.tokenizer.state=zN.PLAINTEXT;break;case aw.COL:case aw.TH:case aw.TD:case aw.TR:case aw.HEAD:case aw.FRAME:case aw.TBODY:case aw.TFOOT:case aw.THEAD:case aw.CAPTION:case aw.COLGROUP:break;default:AG(a,b)}}function AI(a,b){let c=b.tagName,d=b.tagID;for(let b=a.openElements.stackTop;b>0;b--){let e=a.openElements.items[b],f=a.openElements.tagIDs[b];if(d===f&&(d!==aw.UNKNOWN||a.treeAdapter.getTagName(e)===c)){a.openElements.generateImpliedEndTagsWithExclusion(d),a.openElements.stackTop>=b&&a.openElements.shortenToLength(b);break}if(a._isSpecialElement(e,f))break}}function AJ(a,b){switch(b.tagID){case aw.A:case aw.B:case aw.I:case aw.S:case aw.U:case aw.EM:case aw.TT:case aw.BIG:case aw.CODE:case aw.FONT:case aw.NOBR:case aw.SMALL:case aw.STRIKE:case aw.STRONG:Ap(a,b);break;case aw.P:a.openElements.hasInButtonScope(aw.P)||a._insertFakeElement(av.P,aw.P),a._closePElement();break;case aw.DL:case aw.UL:case aw.OL:case aw.DIR:case aw.DIV:case aw.NAV:case aw.PRE:case aw.MAIN:case aw.MENU:case aw.ASIDE:case aw.BUTTON:case aw.CENTER:case aw.FIGURE:case aw.FOOTER:case aw.HEADER:case aw.HGROUP:case aw.DIALOG:case aw.ADDRESS:case aw.ARTICLE:case aw.DETAILS:case aw.SEARCH:case aw.SECTION:case aw.SUMMARY:case aw.LISTING:case aw.FIELDSET:case aw.BLOCKQUOTE:case aw.FIGCAPTION:let c;c=b.tagID,a.openElements.hasInScope(c)&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilTagNamePopped(c));break;case aw.LI:a.openElements.hasInListItemScope(aw.LI)&&(a.openElements.generateImpliedEndTagsWithExclusion(aw.LI),a.openElements.popUntilTagNamePopped(aw.LI));break;case aw.DD:case aw.DT:let d;d=b.tagID,a.openElements.hasInScope(d)&&(a.openElements.generateImpliedEndTagsWithExclusion(d),a.openElements.popUntilTagNamePopped(d));break;case aw.H1:case aw.H2:case aw.H3:case aw.H4:case aw.H5:case aw.H6:a.openElements.hasNumberedHeaderInScope()&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilNumberedHeaderPopped());break;case aw.BR:a._reconstructActiveFormattingElements(),a._insertFakeElement(av.BR,aw.BR),a.openElements.pop(),a.framesetOk=!1;break;case aw.BODY:if(a.openElements.hasInScope(aw.BODY)&&(a.insertionMode=az.AFTER_BODY,a.options.sourceCodeLocationInfo)){let c=a.openElements.tryPeekProperlyNestedBodyElement();c&&a._setEndLocation(c,b)}break;case aw.HTML:a.openElements.hasInScope(aw.BODY)&&(a.insertionMode=az.AFTER_BODY,A0(a,b));break;case aw.FORM:!function(a){let b=a.openElements.tmplCount>0,{formElement:c}=a;b||(a.formElement=null),(c||b)&&a.openElements.hasInScope(aw.FORM)&&(a.openElements.generateImpliedEndTags(),b?a.openElements.popUntilTagNamePopped(aw.FORM):c&&a.openElements.remove(c))}(a);break;case aw.APPLET:case aw.OBJECT:case aw.MARQUEE:let e;e=b.tagID,a.openElements.hasInScope(e)&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilTagNamePopped(e),a.activeFormattingElements.clearToLastMarker());break;case aw.TEMPLATE:Aw(a,b);break;default:AI(a,b)}}function AK(a,b){a.tmplInsertionModeStack.length>0?A_(a,b):Ar(a,b)}function AL(a,b){if(void 0!==a.openElements.currentTagId&&Am.has(a.openElements.currentTagId))switch(a.pendingCharacterTokens.length=0,a.hasNonWhitespacePendingCharacterToken=!1,a.originalInsertionMode=a.insertionMode,a.insertionMode=az.IN_TABLE_TEXT,b.type){case am.CHARACTER:AQ(a,b);break;case am.WHITESPACE_CHARACTER:AP(a,b)}else AO(a,b)}function AM(a,b){switch(b.tagID){case aw.TD:case aw.TH:case aw.TR:a.openElements.clearBackToTableContext(),a._insertFakeElement(av.TBODY,aw.TBODY),a.insertionMode=az.IN_TABLE_BODY,AV(a,b);break;case aw.STYLE:case aw.SCRIPT:case aw.TEMPLATE:Av(a,b);break;case aw.COL:a.openElements.clearBackToTableContext(),a._insertFakeElement(av.COLGROUP,aw.COLGROUP),a.insertionMode=az.IN_COLUMN_GROUP,AT(a,b);break;case aw.FORM:a.formElement||0!==a.openElements.tmplCount||(a._insertElement(b,as.HTML),a.formElement=a.openElements.current,a.openElements.pop());break;case aw.TABLE:a.openElements.hasInTableScope(aw.TABLE)&&(a.openElements.popUntilTagNamePopped(aw.TABLE),a._resetInsertionMode(),a._processStartTag(b));break;case aw.TBODY:case aw.TFOOT:case aw.THEAD:a.openElements.clearBackToTableContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_TABLE_BODY;break;case aw.INPUT:AE(b)?a._appendElement(b,as.HTML):AO(a,b),b.ackSelfClosing=!0;break;case aw.CAPTION:a.openElements.clearBackToTableContext(),a.activeFormattingElements.insertMarker(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_CAPTION;break;case aw.COLGROUP:a.openElements.clearBackToTableContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_COLUMN_GROUP;break;default:AO(a,b)}}function AN(a,b){switch(b.tagID){case aw.TABLE:a.openElements.hasInTableScope(aw.TABLE)&&(a.openElements.popUntilTagNamePopped(aw.TABLE),a._resetInsertionMode());break;case aw.TEMPLATE:Aw(a,b);break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TBODY:case aw.TD:case aw.TFOOT:case aw.TH:case aw.THEAD:case aw.TR:break;default:AO(a,b)}}function AO(a,b){let c=a.fosterParentingEnabled;a.fosterParentingEnabled=!0,AA(a,b),a.fosterParentingEnabled=c}function AP(a,b){a.pendingCharacterTokens.push(b)}function AQ(a,b){a.pendingCharacterTokens.push(b),a.hasNonWhitespacePendingCharacterToken=!0}function AR(a,b){let c=0;if(a.hasNonWhitespacePendingCharacterToken)for(;c<a.pendingCharacterTokens.length;c++)AO(a,a.pendingCharacterTokens[c]);else for(;c<a.pendingCharacterTokens.length;c++)a._insertCharacters(a.pendingCharacterTokens[c]);a.insertionMode=a.originalInsertionMode,a._processToken(b)}let AS=new Set([aw.CAPTION,aw.COL,aw.COLGROUP,aw.TBODY,aw.TD,aw.TFOOT,aw.TH,aw.THEAD,aw.TR]);function AT(a,b){switch(b.tagID){case aw.HTML:AH(a,b);break;case aw.COL:a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.TEMPLATE:Av(a,b);break;default:AU(a,b)}}function AU(a,b){a.openElements.currentTagId===aw.COLGROUP&&(a.openElements.pop(),a.insertionMode=az.IN_TABLE,a._processToken(b))}function AV(a,b){switch(b.tagID){case aw.TR:a.openElements.clearBackToTableBodyContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_ROW;break;case aw.TH:case aw.TD:a.openElements.clearBackToTableBodyContext(),a._insertFakeElement(av.TR,aw.TR),a.insertionMode=az.IN_ROW,AX(a,b);break;case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.TBODY:case aw.TFOOT:case aw.THEAD:a.openElements.hasTableBodyContextInTableScope()&&(a.openElements.clearBackToTableBodyContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE,AM(a,b));break;default:AM(a,b)}}function AW(a,b){let c=b.tagID;switch(b.tagID){case aw.TBODY:case aw.TFOOT:case aw.THEAD:a.openElements.hasInTableScope(c)&&(a.openElements.clearBackToTableBodyContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE);break;case aw.TABLE:a.openElements.hasTableBodyContextInTableScope()&&(a.openElements.clearBackToTableBodyContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE,AN(a,b));break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TD:case aw.TH:case aw.TR:break;default:AN(a,b)}}function AX(a,b){switch(b.tagID){case aw.TH:case aw.TD:a.openElements.clearBackToTableRowContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_CELL,a.activeFormattingElements.insertMarker();break;case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.TBODY:case aw.TFOOT:case aw.THEAD:case aw.TR:a.openElements.hasInTableScope(aw.TR)&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY,AV(a,b));break;default:AM(a,b)}}function AY(a,b){switch(b.tagID){case aw.TR:a.openElements.hasInTableScope(aw.TR)&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY);break;case aw.TABLE:a.openElements.hasInTableScope(aw.TR)&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY,AW(a,b));break;case aw.TBODY:case aw.TFOOT:case aw.THEAD:(a.openElements.hasInTableScope(b.tagID)||a.openElements.hasInTableScope(aw.TR))&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY,AW(a,b));break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TD:case aw.TH:break;default:AN(a,b)}}function AZ(a,b){switch(b.tagID){case aw.HTML:AH(a,b);break;case aw.OPTION:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a._insertElement(b,as.HTML);break;case aw.OPTGROUP:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a.openElements.currentTagId===aw.OPTGROUP&&a.openElements.pop(),a._insertElement(b,as.HTML);break;case aw.HR:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a.openElements.currentTagId===aw.OPTGROUP&&a.openElements.pop(),a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.INPUT:case aw.KEYGEN:case aw.TEXTAREA:case aw.SELECT:a.openElements.hasInSelectScope(aw.SELECT)&&(a.openElements.popUntilTagNamePopped(aw.SELECT),a._resetInsertionMode(),b.tagID!==aw.SELECT&&a._processStartTag(b));break;case aw.SCRIPT:case aw.TEMPLATE:Av(a,b)}}function A$(a,b){switch(b.tagID){case aw.OPTGROUP:a.openElements.stackTop>0&&a.openElements.currentTagId===aw.OPTION&&a.openElements.tagIDs[a.openElements.stackTop-1]===aw.OPTGROUP&&a.openElements.pop(),a.openElements.currentTagId===aw.OPTGROUP&&a.openElements.pop();break;case aw.OPTION:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop();break;case aw.SELECT:a.openElements.hasInSelectScope(aw.SELECT)&&(a.openElements.popUntilTagNamePopped(aw.SELECT),a._resetInsertionMode());break;case aw.TEMPLATE:Aw(a,b)}}function A_(a,b){a.openElements.tmplCount>0?(a.openElements.popUntilTagNamePopped(aw.TEMPLATE),a.activeFormattingElements.clearToLastMarker(),a.tmplInsertionModeStack.shift(),a._resetInsertionMode(),a.onEof(b)):Ar(a,b)}function A0(a,b){var c;if(b.tagID===aw.HTML){if(a.fragmentContext||(a.insertionMode=az.AFTER_AFTER_BODY),a.options.sourceCodeLocationInfo&&a.openElements.tagIDs[0]===aw.HTML){a._setEndLocation(a.openElements.items[0],b);let d=a.openElements.items[1];!d||(null==(c=a.treeAdapter.getNodeSourceCodeLocation(d))?void 0:c.endTag)||a._setEndLocation(d,b)}}else A1(a,b)}function A1(a,b){a.insertionMode=az.IN_BODY,AA(a,b)}function A2(a,b){a.insertionMode=az.IN_BODY,AA(a,b)}function A3(a){for(;a.treeAdapter.getNamespaceURI(a.openElements.current)!==as.HTML&&void 0!==a.openElements.currentTagId&&!a._isIntegrationPoint(a.openElements.currentTagId,a.openElements.current);)a.openElements.pop()}function A4(a,b){return Ao.parse(a,b)}function A5(a,b,c){"string"==typeof a&&(c=b,b=a,a=null);let d=Ao.getFragmentParser(a,c);return d.tokenizer.write(b,!0),d.getFragment()}av.AREA,av.BASE,av.BASEFONT,av.BGSOUND,av.BR,av.COL,av.EMBED,av.FRAME,av.HR,av.IMG,av.INPUT,av.KEYGEN,av.LINK,av.META,av.PARAM,av.SOURCE,av.TRACK,av.WBR;var A6=a.i(61659),A6=A6,A7=a.i(305856),A7=A7;let A8=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,A9=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Ba={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Bb(a,b){var c;let d,e=!!((d="root"===(c=a).type?c.children[0]:c)&&("doctype"===d.type||"element"===d.type&&"html"===d.tagName.toLowerCase())),f=zo("type",{handlers:{root:Bd,element:Be,text:Bf,comment:Bh,doctype:Bg,raw:Bi},unknown:Bj}),g={parser:e?new Ao(Ba):Ao.getFragmentParser(void 0,Ba),handle(a){f(a,g)},stitches:!1,options:b||{}};f(a,g),Bk(g,vk());let h=zh(e?g.parser.document:g.parser.getFragment(),{file:g.options.file});return(g.stitches&&xf(h,"comment",function(a,b,c){if(a.value.stitch&&c&&void 0!==b)return c.children[b]=a.value.stitch,b}),"root"===h.type&&1===h.children.length&&h.children[0].type===a.type)?h.children[0]:h}function Bc(a,b){let c=-1;if(a)for(;++c<a.length;)b.handle(a[c])}function Bd(a,b){Bc(a.children,b)}function Be(a,b){(function(a,b){let c=a.tagName.toLowerCase();if(b.parser.tokenizer.state===zN.PLAINTEXT)return;Bk(b,vk(a));let d=b.parser.openElements.current,e="namespaceURI"in d?d.namespaceURI:ze.html;e===ze.html&&"svg"===c&&(e=ze.svg);let f=zq({...a,children:[]},"svg"===({space:e===ze.svg?"svg":"html"}).space?vf:ve),g={type:A6.TokenType.START_TAG,tagName:c,tagID:A7.getTagID(c),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in f?f.attrs:[],location:Bm(a)};b.parser.currentToken=g,b.parser._processToken(b.parser.currentToken),b.parser.tokenizer.lastStartTagName=c})(a,b),Bc(a.children,b),function(a,b){let c=a.tagName.toLowerCase();if(!b.parser.tokenizer.inForeignNode&&zt.includes(c)||b.parser.tokenizer.state===zN.PLAINTEXT)return;Bk(b,vj(a));let d={type:A6.TokenType.END_TAG,tagName:c,tagID:A7.getTagID(c),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Bm(a)};b.parser.currentToken=d,b.parser._processToken(b.parser.currentToken),c===b.parser.tokenizer.lastStartTagName&&(b.parser.tokenizer.state===zN.RCDATA||b.parser.tokenizer.state===zN.RAWTEXT||b.parser.tokenizer.state===zN.SCRIPT_DATA)&&(b.parser.tokenizer.state=zN.DATA)}(a,b)}function Bf(a,b){b.parser.tokenizer.state>4&&(b.parser.tokenizer.state=0);let c={type:A6.TokenType.CHARACTER,chars:a.value,location:Bm(a)};Bk(b,vk(a)),b.parser.currentToken=c,b.parser._processToken(b.parser.currentToken)}function Bg(a,b){let c={type:A6.TokenType.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Bm(a)};Bk(b,vk(a)),b.parser.currentToken=c,b.parser._processToken(b.parser.currentToken)}function Bh(a,b){let c=a.value,d={type:A6.TokenType.COMMENT,data:c,location:Bm(a)};Bk(b,vk(a)),b.parser.currentToken=d,b.parser._processToken(b.parser.currentToken)}function Bi(a,b){if(b.parser.tokenizer.preprocessor.html="",b.parser.tokenizer.preprocessor.pos=-1,b.parser.tokenizer.preprocessor.lastGapPos=-2,b.parser.tokenizer.preprocessor.gapStack=[],b.parser.tokenizer.preprocessor.skipNextNewLine=!1,b.parser.tokenizer.preprocessor.lastChunkWritten=!1,b.parser.tokenizer.preprocessor.endOfChunkHit=!1,b.parser.tokenizer.preprocessor.isEol=!1,Bl(b,vk(a)),b.parser.tokenizer.write(b.options.tagfilter?a.value.replace(A8,"&lt;$1$2"):a.value,!1),b.parser.tokenizer._runParsingLoop(),72===b.parser.tokenizer.state||78===b.parser.tokenizer.state){b.parser.tokenizer.preprocessor.lastChunkWritten=!0;let a=b.parser.tokenizer._consume();b.parser.tokenizer._callState(a)}}function Bj(a,b){if(b.options.passThrough&&b.options.passThrough.includes(a.type)){var c;let d;b.stitches=!0,d="children"in(c=a)?w5({...c,children:[]}):w5(c),"children"in a&&"children"in d&&(d.children=Bb({type:"root",children:a.children},b.options).children),Bh({type:"comment",value:{stitch:d}},b)}else{let b="";throw A9.has(a.type)&&(b=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+a.type+"` node"+b)}}function Bk(a,b){Bl(a,b);let c=a.parser.tokenizer.currentCharacterToken;c&&c.location&&(c.location.endLine=a.parser.tokenizer.preprocessor.line,c.location.endCol=a.parser.tokenizer.preprocessor.col+1,c.location.endOffset=a.parser.tokenizer.preprocessor.offset+1,a.parser.currentToken=c,a.parser._processToken(a.parser.currentToken)),a.parser.tokenizer.paused=!1,a.parser.tokenizer.inLoop=!1,a.parser.tokenizer.active=!1,a.parser.tokenizer.returnState=zN.DATA,a.parser.tokenizer.charRefCode=-1,a.parser.tokenizer.consumedAfterSnapshot=-1,a.parser.tokenizer.currentLocation=null,a.parser.tokenizer.currentCharacterToken=null,a.parser.tokenizer.currentToken=null,a.parser.tokenizer.currentAttr={name:"",value:""}}function Bl(a,b){if(b&&void 0!==b.offset){let c={startLine:b.line,startCol:b.column,startOffset:b.offset,endLine:-1,endCol:-1,endOffset:-1};a.parser.tokenizer.preprocessor.lineStartPos=-b.column+1,a.parser.tokenizer.preprocessor.droppedBufferSize=b.offset,a.parser.tokenizer.preprocessor.line=b.line,a.parser.tokenizer.currentLocation=c}}function Bm(a){let b=vk(a)||{line:void 0,column:void 0,offset:void 0},c=vj(a)||{line:void 0,column:void 0,offset:void 0};return{startLine:b.line,startCol:b.column,startOffset:b.offset,endLine:c.line,endCol:c.column,endOffset:c.offset}}function Bn(a){return function(b,c){return Bb(b,{...a,file:c})}}let Bo={abandonedHeadElementChild:{reason:"Unexpected metadata element after head",description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:"Unexpected too big numeric character reference",description:"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)"},closingOfElementWithOpenChildElements:{reason:"Unexpected closing tag with open child elements",description:"Unexpectedly closing tag. Expected other tags to be closed first",url:!1},controlCharacterInInputStream:{reason:"Unexpected control character",description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:"Unexpected control character reference",description:"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace"},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:"Unexpected duplicate attribute",description:"Unexpectedly double attribute. Expected attributes to occur only once"},endTagWithAttributes:{reason:"Unexpected attribute on closing tag",description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:"Unexpected slash at end of closing tag",description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:"Unexpected unopened end tag",description:"Unexpected end tag. Expected no end tag or another end tag",url:!1},eofBeforeTagName:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected tag name instead"},eofInCdata:{reason:"Unexpected end of file in CDATA",description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:"Unexpected end of file in comment",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:"Unexpected end of file in doctype",description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:"Unexpected end of file in element that can only contain text",description:"Unexpected end of file. Expected text or a closing tag",url:!1},eofInScriptHtmlCommentLikeText:{reason:"Unexpected end of file in comment inside script",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:"Unexpected end of file in tag",description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:"Incorrectly closed comment",description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:"Incorrectly opened comment",description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:"Invalid sequence after doctype name",description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:"Invalid first character in tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:"Misplaced doctype",description:"Unexpected doctype. Expected doctype before head",url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:"Missing attribute value",description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:"Missing doctype before other content",description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:"Missing doctype name",description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:"Missing public identifier in doctype",description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:"Missing system identifier in doctype",description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:"Missing name in end tag",description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:"Missing quote before public identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:"Missing quote before system identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:"Missing semicolon after character reference",description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:"Missing whitespace after public identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:"Missing whitespace after system identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:"Missing whitespace before doctype name",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:"Missing whitespace between attributes",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:"Missing whitespace between public and system identifiers in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:"Unexpected nested comment",description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:"Unexpected non-conforming doctype declaration",description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:"Unexpected trailing slash on start tag of non-void element",description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:"Unexpected noncharacter code point referenced by character reference",description:"Unexpected code point. Do not use noncharacters in HTML"},noncharacterInInputStream:{reason:"Unexpected noncharacter character",description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:"Unexpected NULL character referenced by character reference",description:"Unexpected code point. Do not use NULL characters in HTML"},openElementsLeftAfterEof:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected closing tag instead",url:!1},surrogateCharacterReference:{reason:"Unexpected surrogate character referenced by character reference",description:"Unexpected code point. Do not use lone surrogate characters in HTML"},surrogateInInputStream:{reason:"Unexpected surrogate character",description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:"Invalid character after system identifier in doctype",description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:"Unexpected character in attribute name",description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:"Unexpected character in unquoted attribute value",description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:"Unexpected equals sign before attribute name",description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:"Unexpected NULL character",description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:"Unexpected question mark instead of tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:"Unexpected slash in tag",description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:"Unexpected unknown named character reference",description:"Unexpected character reference. Expected known named character references"}},Bp=/-[a-z]/g,Bq=/%c(?:([-+])(\d+))?/g,Br=/%x/g,Bs={2:!0,1:!1,0:null},Bt={};function Bu(a){return a.charAt(1).toUpperCase()}let Bv=function(a,b,c){let d=w9(c);if(!a||!a.type||!a.children)throw Error("Expected parent node");if("number"==typeof b){if(b<0||b===1/0)throw Error("Expected positive finite number as index")}else if((b=a.children.indexOf(b))<0)throw Error("Expected child node or index");for(;++b<a.children.length;)if(d(a.children[b],b,a))return a.children[b]},Bw=function(a){if(null==a)return By;if("string"==typeof a){var b;return b=a,Bx(function(a){return a.tagName===b})}if("object"==typeof a){var c=a;let b=[],d=-1;for(;++d<c.length;)b[d]=Bw(c[d]);return Bx(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}if("function"==typeof a)return Bx(a);throw Error("Expected function, string, or array as `test`")};function Bx(a){return function(b,c,d){var e;return!!(null!==(e=b)&&"object"==typeof e&&"type"in e&&"tagName"in e&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function By(a){return!!(a&&"object"==typeof a&&"type"in a&&"element"===a.type&&"tagName"in a&&"string"==typeof a.tagName)}let Bz=/\n/g,BA=/[\t ]+/g,BB=Bw("br"),BC=Bw(function(a){return"td"===a.tagName||"th"===a.tagName}),BD=Bw("p"),BE=Bw("tr"),BF=Bw(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(a){return!!(a.properties||{}).hidden},function(a){return"dialog"===a.tagName&&!(a.properties||{}).open}]),BG=Bw(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function BH(a,b){let c,d=String(a.value),e=[],f=[],g=0;for(;g<=d.length;){Bz.lastIndex=g;let a=Bz.exec(d),c=a&&"index"in a?a.index:d.length;e.push(function(a,b,c){let d,e=[],f=0;for(;f<a.length;){BA.lastIndex=f;let c=BA.exec(a);d=c?c.index:a.length,f||d||!c||b||e.push(""),f!==d&&e.push(a.slice(f,d)),f=c?d+c[0].length:d}return f===d||c||e.push(""),e.join(" ")}(d.slice(g,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==g||b.breakBefore,c!==d.length||b.breakAfter)),g=c+1}let h=-1;for(;++h<e.length;)8203===e[h].charCodeAt(e[h].length-1)||h<e.length-1&&8203===e[h+1].charCodeAt(0)?(f.push(e[h]),c=void 0):e[h]?("number"==typeof c&&f.push(c),f.push(e[h]),c=0):(0===h||h===e.length-1)&&f.push(0);return f}function BI(a,b){if("element"===a.type){let c=a.properties||{};switch(a.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return c.wrap?"pre-wrap":"pre";case"td":case"th":return c.noWrap?"nowrap":b.whitespace;case"textarea":return"pre-wrap"}}return b.whitespace}var BJ=a.i(948986);let BK={},BL=[];function BM(a){let b=a||BK;return function(a,c){xe(a,"element",function(a,d){let e,f=Array.isArray(a.properties.className)?a.properties.className:BL,g=f.includes("language-math"),h=f.includes("math-display"),i=f.includes("math-inline"),j=h;if(!g&&!h&&!i)return;let k=d[d.length-1],l=a;if("code"===a.tagName&&g&&k&&"element"===k.type&&"pre"===k.tagName&&(l=k,k=d[d.length-2],j=!0),!k)return;let m=function(a,b){let c,d="children"in a?a.children:[],e=BG(a),f=BI(a,{whitespace:(b||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),g=[];("text"===a.type||"comment"===a.type)&&g.push(...BH(a,{whitespace:f,breakBefore:!0,breakAfter:!0}));let h=-1;for(;++h<d.length;)g.push(...function a(b,c,d){return"element"===b.type?function(b,c,d){let e,f,g=BI(b,d),h=b.children||[],i=-1,j=[];if(BF(b))return j;for(BB(b)||BE(b)&&Bv(c,b,BE)?f="\n":BD(b)?(e=2,f=2):BG(b)&&(e=1,f=1);++i<h.length;)j=j.concat(a(h[i],b,{whitespace:g,breakBefore:i?void 0:e,breakAfter:i<h.length-1?BB(h[i+1]):f}));return BC(b)&&Bv(c,b,BC)&&j.push(" "),e&&j.unshift(e),f&&j.push(f),j}(b,c,d):"text"===b.type?"normal"===d.whitespace?BH(b,d):[String(b.value)]:[]}(d[h],a,{whitespace:f,breakBefore:h?void 0:e,breakAfter:h<d.length-1?BB(d[h+1]):e}));let i=[];for(h=-1;++h<g.length;){let a=g[h];"number"==typeof a?void 0!==c&&a>c&&(c=a):a&&(void 0!==c&&c>-1&&i.push("\n".repeat(c)||" "),c=-1,i.push(a))}return i.join("")}(l,{whitespace:"pre"});try{e=BJ.default.renderToString(m,{...b,displayMode:j,throwOnError:!0})}catch(g){let f=g.name.toLowerCase();c.message("Could not render math with KaTeX",{ancestors:[...d,a],cause:g,place:a.position,ruleId:f,source:"rehype-katex"});try{e=BJ.default.renderToString(m,{...b,displayMode:j,strict:"ignore",throwOnError:!1})}catch{e=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(b.errorColor||"#cc0000"),title:String(g)},children:[{type:"text",value:m}]}]}}"string"==typeof e&&(e=function(a,b){let c,d,e,f,g,h=(d=(c=b||Bt).onerror,e=a instanceof xA?a:new xA(a),f=c.fragment?A5:A4,zh(f(g=String(e),{sourceCodeLocationInfo:!0,onParseError:c.onerror?function(a){let b=a.code,f=b.replace(Bp,Bu),h=c[f],i=null==h||h,j="number"==typeof i?i:+!!i;if(j){let c=Bo[f];uA(c,"expected known error from `parse5`");let g=new vr(k(c.reason),{place:{start:{line:a.startLine,column:a.startCol,offset:a.startOffset},end:{line:a.endLine,column:a.endCol,offset:a.endOffset}},ruleId:b,source:"hast-util-from-html"});e.path&&(g.file=e.path,g.name=e.path+":"+g.name),g.fatal=Bs[j],g.note=k(c.description),g.url=!1===c.url?void 0:"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-"+b,uA(d,"`internalOnerror` is not passed if `onerror` is not set"),d(g)}function k(b){return b.replace(Bq,function(b,c,d){var e;let f=(d?Number.parseInt(d,10):0)*("-"===c?-1:1);return"`"===(e=g.charAt(a.startOffset+f))?"` ` `":e}).replace(Br,function(){return"0x"+g.charCodeAt(a.startOffset).toString(16).toUpperCase()})}}:null,scriptingEnabled:!1}),{file:e,space:c.space,verbose:c.verbose}));return xf(h,function(a){delete a.position}),delete h.data,h}(e,{fragment:!0}).children);let n=k.children.indexOf(l);return k.children.splice(n,1,...e),xd})}}let BN=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],BO={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...BN,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...BN],h2:[["className","sr-only"]],img:[...BN,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...BN,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...BN],table:[...BN],ul:[...BN,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},BP={}.hasOwnProperty;function BQ(a,b){if(b&&"object"==typeof b)switch("string"==typeof b.type?b.type:""){case"comment":var c,d,e=a,f=b;if(e.schema.allowComments){let a="string"==typeof f.value?f.value:"",b=a.indexOf("-->"),c={type:"comment",value:b<0?a:a.slice(0,b)};return BU(c,f),c}return;case"doctype":var g=a,h=b;if(g.schema.allowDoctypes){let a={type:"doctype"};return BU(a,h),a}return;case"element":return function(a,b){let c="string"==typeof b.tagName?b.tagName:"";a.stack.push(c);let d=BR(a,b.children),e=function(a,b){let c,d=a.stack[a.stack.length-1],e=a.schema.attributes,f=a.schema.required,g=e&&BP.call(e,d)?e[d]:void 0,h=e&&BP.call(e,"*")?e["*"]:void 0,i=b&&"object"==typeof b?b:{},j={};for(c in i)if(BP.call(i,c)){let b=i[c],d=BS(a,BV(g,c),c,b);null==d&&(d=BS(a,BV(h,c),c,b)),null!=d&&(j[c]=d)}if(f&&BP.call(f,d)){let a=f[d];for(c in a)BP.call(a,c)&&!BP.call(j,c)&&(j[c]=a[c])}return j}(a,b.properties);a.stack.pop();let f=!1;if(c&&"*"!==c&&(!a.schema.tagNames||a.schema.tagNames.includes(c))&&(f=!0,a.schema.ancestors&&BP.call(a.schema.ancestors,c))){let b=a.schema.ancestors[c],d=-1;for(f=!1;++d<b.length;)a.stack.includes(b[d])&&(f=!0)}if(!f)return a.schema.strip&&!a.schema.strip.includes(c)?d:void 0;let g={type:"element",tagName:c,properties:e,children:d};return BU(g,b),g}(a,b);case"root":let i;return BU(i={type:"root",children:BR(a,(c=b).children)},c),i;case"text":let j;return BU(j={type:"text",value:"string"==typeof(d=b).value?d.value:""},d),j}}function BR(a,b){let c=[];if(Array.isArray(b)){let d=-1;for(;++d<b.length;){let e=BQ(a,b[d]);e&&(Array.isArray(e)?c.push(...e):c.push(e))}}return c}function BS(a,b,c,d){return b?Array.isArray(d)?function(a,b,c,d){let e=-1,f=[];for(;++e<d.length;){let g=BT(a,b,c,d[e]);("number"==typeof g||"string"==typeof g)&&f.push(g)}return f}(a,b,c,d):BT(a,b,c,d):void 0}function BT(a,b,c,d){if(("boolean"==typeof d||"number"==typeof d||"string"==typeof d)&&function(a,b,c){let d=a.schema.protocols&&BP.call(a.schema.protocols,b)?a.schema.protocols[b]:void 0;if(!d||0===d.length)return!0;let e=String(c),f=e.indexOf(":"),g=e.indexOf("?"),h=e.indexOf("#"),i=e.indexOf("/");if(f<0||i>-1&&f>i||g>-1&&f>g||h>-1&&f>h)return!0;let j=-1;for(;++j<d.length;){let a=d[j];if(f===a.length&&e.slice(0,a.length)===a)return!0}return!1}(a,c,d)){if("object"==typeof b&&b.length>1){let a=!1,c=0;for(;++c<b.length;){let e=b[c];if(e&&"object"==typeof e&&"flags"in e){if(e.test(String(d))){a=!0;break}}else if(e===d){a=!0;break}}if(!a)return}return a.schema.clobber&&a.schema.clobberPrefix&&a.schema.clobber.includes(c)?a.schema.clobberPrefix+d:d}}function BU(a,b){let c=vm(b);b.data&&(a.data=w5(b.data)),c&&(a.position=c)}function BV(a,b){let c,d=-1;if(a)for(;++d<a.length;){let e=a[d],f="string"==typeof e?e:e[0];if(f===b)return e;"data*"===f&&(c=e)}if(b.length>4&&"data"===b.slice(0,4).toLowerCase())return c}function BW(a){return function(b){let c,d;return c={type:"root",children:[]},(d=BQ({schema:a?{...BO,...a}:BO,stack:[]},b))&&(Array.isArray(d)?1===d.length?c=d[0]:c.children=d:c=d),c}}var BX=a.i(92743),BY=a.i(995051),BZ=a.i(441415),B$=a.i(577518);function B_(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function B0(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?B_(Object(c),!0).forEach(function(b){(0,BZ.default)(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):B_(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}var B1={},B2=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function B3(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function B4(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?B3(Object(c),!0).forEach(function(b){(0,BZ.default)(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):B3(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}var B5=/\n/g;function B6(a){var b,c,d,e,f=a.codeString,g=a.codeStyle,h=a.containerStyle,i=a.numberStyle,j=a.startingLineNumber;return aB.default.createElement("code",{style:Object.assign({},g,void 0===h?{float:"left",paddingRight:"10px"}:h)},(c=(b={lines:f.replace(/\n$/,"").split("\n"),style:void 0===i?{}:i,startingLineNumber:j}).lines,d=b.startingLineNumber,e=b.style,c.map(function(a,b){var c=b+d;return aB.default.createElement("span",{key:"line-".concat(b),className:"react-syntax-highlighter-line-number",style:"function"==typeof e?e(c):e},"".concat(c,"\n"))})))}function B7(a,b){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(a),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:b},children:[{type:"text",value:a}]}}function B8(a,b,c){var d={display:"inline-block",minWidth:"".concat(c.toString().length,".25em"),paddingRight:"1em",textAlign:"right",userSelect:"none"},e="function"==typeof a?a(b):a;return B4(B4({},d),e)}function B9(a){var b=a.children,c=a.lineNumber,d=a.lineNumberStyle,e=a.largestLineNumber,f=a.showInlineLineNumbers,g=a.lineProps,h=void 0===g?{}:g,i=a.className,j=void 0===i?[]:i,k=a.showLineNumbers,l=a.wrapLongLines,m=a.wrapLines,n=void 0!==m&&m?B4({},"function"==typeof h?h(c):h):{};if(n.className=n.className?[].concat((0,BY.default)(n.className.trim().split(/\s+/)),(0,BY.default)(j)):j,c&&f){var o=B8(d,c,e);b.unshift(B7(c,o))}return l&k&&(n.style=B4({display:"flex"},n.style)),{type:"element",tagName:"span",properties:n,children:b}}function Ca(a){var b=a.rows,c=a.stylesheet,d=a.useInlineStyles;return b.map(function(a,b){return function a(b){var c=b.node,d=b.stylesheet,e=b.style,f=b.useInlineStyles,g=b.key,h=c.properties,i=c.type,j=c.tagName,k=c.value;if("text"===i)return k;if(j){var l,m,n=(l=0,function(b){return l+=1,b.map(function(b,c){return a({node:b,stylesheet:d,useInlineStyles:f,key:"code-segment-".concat(l,"-").concat(c)})})});if(f){var o=Object.keys(d).reduce(function(a,b){return b.split(".").forEach(function(b){a.includes(b)||a.push(b)}),a},[]),p=h.className&&h.className.includes("token")?["token"]:[],q=h.className&&p.concat(h.className.filter(function(a){return!o.includes(a)}));m=B0(B0({},h),{},{className:q.join(" ")||void 0,style:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;return(function(a){if(0===a.length||1===a.length)return a;var b,c=a.join(".");return B1[c]||(B1[c]=0===(b=a.length)||1===b?a:2===b?[a[0],a[1],"".concat(a[0],".").concat(a[1]),"".concat(a[1],".").concat(a[0])]:3===b?[a[0],a[1],a[2],"".concat(a[0],".").concat(a[1]),"".concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[0]),"".concat(a[1],".").concat(a[2]),"".concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[1]),"".concat(a[0],".").concat(a[1],".").concat(a[2]),"".concat(a[0],".").concat(a[2],".").concat(a[1]),"".concat(a[1],".").concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[0],".").concat(a[1]),"".concat(a[2],".").concat(a[1],".").concat(a[0])]:b>=4?[a[0],a[1],a[2],a[3],"".concat(a[0],".").concat(a[1]),"".concat(a[0],".").concat(a[2]),"".concat(a[0],".").concat(a[3]),"".concat(a[1],".").concat(a[0]),"".concat(a[1],".").concat(a[2]),"".concat(a[1],".").concat(a[3]),"".concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[1]),"".concat(a[2],".").concat(a[3]),"".concat(a[3],".").concat(a[0]),"".concat(a[3],".").concat(a[1]),"".concat(a[3],".").concat(a[2]),"".concat(a[0],".").concat(a[1],".").concat(a[2]),"".concat(a[0],".").concat(a[1],".").concat(a[3]),"".concat(a[0],".").concat(a[2],".").concat(a[1]),"".concat(a[0],".").concat(a[2],".").concat(a[3]),"".concat(a[0],".").concat(a[3],".").concat(a[1]),"".concat(a[0],".").concat(a[3],".").concat(a[2]),"".concat(a[1],".").concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[0],".").concat(a[3]),"".concat(a[1],".").concat(a[2],".").concat(a[0]),"".concat(a[1],".").concat(a[2],".").concat(a[3]),"".concat(a[1],".").concat(a[3],".").concat(a[0]),"".concat(a[1],".").concat(a[3],".").concat(a[2]),"".concat(a[2],".").concat(a[0],".").concat(a[1]),"".concat(a[2],".").concat(a[0],".").concat(a[3]),"".concat(a[2],".").concat(a[1],".").concat(a[0]),"".concat(a[2],".").concat(a[1],".").concat(a[3]),"".concat(a[2],".").concat(a[3],".").concat(a[0]),"".concat(a[2],".").concat(a[3],".").concat(a[1]),"".concat(a[3],".").concat(a[0],".").concat(a[1]),"".concat(a[3],".").concat(a[0],".").concat(a[2]),"".concat(a[3],".").concat(a[1],".").concat(a[0]),"".concat(a[3],".").concat(a[1],".").concat(a[2]),"".concat(a[3],".").concat(a[2],".").concat(a[0]),"".concat(a[3],".").concat(a[2],".").concat(a[1]),"".concat(a[0],".").concat(a[1],".").concat(a[2],".").concat(a[3]),"".concat(a[0],".").concat(a[1],".").concat(a[3],".").concat(a[2]),"".concat(a[0],".").concat(a[2],".").concat(a[1],".").concat(a[3]),"".concat(a[0],".").concat(a[2],".").concat(a[3],".").concat(a[1]),"".concat(a[0],".").concat(a[3],".").concat(a[1],".").concat(a[2]),"".concat(a[0],".").concat(a[3],".").concat(a[2],".").concat(a[1]),"".concat(a[1],".").concat(a[0],".").concat(a[2],".").concat(a[3]),"".concat(a[1],".").concat(a[0],".").concat(a[3],".").concat(a[2]),"".concat(a[1],".").concat(a[2],".").concat(a[0],".").concat(a[3]),"".concat(a[1],".").concat(a[2],".").concat(a[3],".").concat(a[0]),"".concat(a[1],".").concat(a[3],".").concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[3],".").concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[0],".").concat(a[1],".").concat(a[3]),"".concat(a[2],".").concat(a[0],".").concat(a[3],".").concat(a[1]),"".concat(a[2],".").concat(a[1],".").concat(a[0],".").concat(a[3]),"".concat(a[2],".").concat(a[1],".").concat(a[3],".").concat(a[0]),"".concat(a[2],".").concat(a[3],".").concat(a[0],".").concat(a[1]),"".concat(a[2],".").concat(a[3],".").concat(a[1],".").concat(a[0]),"".concat(a[3],".").concat(a[0],".").concat(a[1],".").concat(a[2]),"".concat(a[3],".").concat(a[0],".").concat(a[2],".").concat(a[1]),"".concat(a[3],".").concat(a[1],".").concat(a[0],".").concat(a[2]),"".concat(a[3],".").concat(a[1],".").concat(a[2],".").concat(a[0]),"".concat(a[3],".").concat(a[2],".").concat(a[0],".").concat(a[1]),"".concat(a[3],".").concat(a[2],".").concat(a[1],".").concat(a[0])]:void 0),B1[c]})(a.filter(function(a){return"token"!==a})).reduce(function(a,b){return B0(B0({},a),c[b])},b)}(h.className,Object.assign({},h.style,void 0===e?{}:e),d)})}else m=B0(B0({},h),{},{className:h.className.join(" ")});var r=n(c.children);return aB.default.createElement(j,(0,B$.default)({key:g},m),r)}}({node:a,stylesheet:c,useInlineStyles:d,key:"code-segment-".concat(b)})})}function Cb(a){return a&&void 0!==a.highlightAuto}var Cc=(_=a.i(807416).default,aa={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}},function(a){var b,c,d=a.language,e=a.children,f=a.style,g=void 0===f?aa:f,h=a.customStyle,i=void 0===h?{}:h,j=a.codeTagProps,k=void 0===j?{className:d?"language-".concat(d):void 0,style:B4(B4({},g['code[class*="language-"]']),g['code[class*="language-'.concat(d,'"]')])}:j,l=a.useInlineStyles,m=void 0===l||l,n=a.showLineNumbers,o=void 0!==n&&n,p=a.showInlineLineNumbers,q=void 0===p||p,r=a.startingLineNumber,s=void 0===r?1:r,t=a.lineNumberContainerStyle,u=a.lineNumberStyle,v=void 0===u?{}:u,w=a.wrapLines,x=a.wrapLongLines,y=void 0!==x&&x,z=a.lineProps,A=a.renderer,B=a.PreTag,C=void 0===B?"pre":B,D=a.CodeTag,E=void 0===D?"code":D,F=a.code,G=void 0===F?(Array.isArray(e)?e[0]:e)||"":F,H=a.astGenerator,I=(0,BX.default)(a,B2);H=H||_;var J=o?aB.default.createElement(B6,{containerStyle:t,codeStyle:k.style||{},numberStyle:v,startingLineNumber:s,codeString:G}):null,K=g.hljs||g['pre[class*="language-"]']||{backgroundColor:"#fff"},L=Cb(H)?"hljs":"prismjs",M=m?Object.assign({},I,{style:Object.assign({},K,i)}):Object.assign({},I,{className:I.className?"".concat(L," ").concat(I.className):L,style:Object.assign({},i)});if(y?k.style=B4({whiteSpace:"pre-wrap"},k.style):k.style=B4({whiteSpace:"pre"},k.style),!H)return aB.default.createElement(C,M,J,aB.default.createElement(E,k,G));(void 0===w&&A||y)&&(w=!0),A=A||Ca;var N=[{type:"text",value:G}],O=function(a){var b=a.astGenerator,c=a.language,d=a.code,e=a.defaultCodeValue;if(Cb(b)){var f=-1!==b.listLanguages().indexOf(c);return"text"===c?{value:e,language:"text"}:f?b.highlight(c,d):b.highlightAuto(d)}try{return c&&"text"!==c?{value:b.highlight(d,c)}:{value:e}}catch(a){return{value:e}}}({astGenerator:H,language:d,code:G,defaultCodeValue:N});null===O.language&&(O.value=N);var P=s+(null!=(b=null==(c=G.match(/\n/g))?void 0:c.length)?b:0),Q=function(a,b,c,d,e,f,g,h,i){var j,k=function a(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],e=0;e<b.length;e++){var f=b[e];if("text"===f.type)d.push(B9({children:[f],className:(0,BY.default)(new Set(c))}));else if(f.children){var g=c.concat(f.properties.className);a(f.children,g).forEach(function(a){return d.push(a)})}}return d}(a.value),l=[],m=-1,n=0;function o(a,f){var j=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return b||j.length>0?function(a,f){var j=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return B9({children:a,lineNumber:f,lineNumberStyle:h,largestLineNumber:g,showInlineLineNumbers:e,lineProps:c,className:j,showLineNumbers:d,wrapLongLines:i,wrapLines:b})}(a,f,j):function(a,b){if(d&&b&&e){var c=B8(h,b,g);a.unshift(B7(b,c))}return a}(a,f)}for(;n<k.length;)!function(){var a=k[n],b=a.children[0].value;if(b.match(B5)){var c=b.split("\n");c.forEach(function(b,e){var g=d&&l.length+f,h={type:"text",value:"".concat(b,"\n")};if(0===e){var i=o(k.slice(m+1,n).concat(B9({children:[h],className:a.properties.className})),g);l.push(i)}else if(e===c.length-1){var j=k[n+1]&&k[n+1].children&&k[n+1].children[0],p={type:"text",value:"".concat(b)};if(j){var q=B9({children:[p],className:a.properties.className});k.splice(n+1,0,q)}else{var r=o([p],g,a.properties.className);l.push(r)}}else{var s=o([h],g,a.properties.className);l.push(s)}}),m=n}n++}();if(m!==k.length-1){var p=k.slice(m+1,k.length);if(p&&p.length){var q=o(p,d&&l.length+f);l.push(q)}}return b?l:(j=[]).concat.apply(j,l)}(O,w,void 0===z?{}:z,o,q,s,P,v,y);return aB.default.createElement(C,M,aB.default.createElement(E,k,!q&&J,A({rows:Q,stylesheet:g,useInlineStyles:m})))});Cc.supportedLanguages=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];let Cd={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}},Ce=cz("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);async function Cf(a){try{if("u">typeof navigator&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(a),!0}catch{}try{if("u"<typeof document)return!1;let b=document.createElement("textarea");b.value=a,b.setAttribute("readonly",""),b.style.position="fixed",b.style.top="-9999px",b.style.opacity="0",document.body.appendChild(b);try{return b.select(),b.setSelectionRange(0,a.length),document.execCommand("copy")}finally{b.remove()}}catch{return!1}}let Cg=aB.default.memo(({language:a,value:b})=>{let[c,d]=(0,aB.useState)(!1),e=(0,aB.useRef)(void 0);(0,aB.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,aB.useEffect)(()=>{d(!1),e.current&&clearTimeout(e.current)},[b]);let f=(0,aB.useCallback)(async()=>{await Cf(b)?(d(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>d(!1),2e3)):jD.toast.error("Couldn't copy to clipboard.")},[b]);return(0,aA.jsxs)("div",{className:"group relative max-w-full",children:[(0,aA.jsx)("button",{type:"button",onClick:f,"aria-label":c?"Copied":"Copy code",className:"absolute right-2 top-2 z-10 rounded-md border border-border bg-[var(--color-surface)] p-1.5 text-[var(--color-text-tertiary)] opacity-0 backdrop-blur-sm transition-opacity hover:text-[var(--color-text-primary)] focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring group-hover:opacity-100",children:c?(0,aA.jsx)(iq,{className:"h-3.5 w-3.5","aria-hidden":"true"}):(0,aA.jsx)(Ce,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),(0,aA.jsx)(Cc,{style:Cd,language:a,PreTag:"div",className:"max-w-full rounded-md text-sm",wrapLines:!0,wrapLongLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap",overflowWrap:"break-word"}},customStyle:{margin:0,maxWidth:"100%",overflowX:"auto",fontSize:"0.875rem"},children:b})]})});Cg.displayName="CodeBlock";let Ch=cz("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Ci=cz("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Cj=cz("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);var Ck=a.i(423571);let Cl=null,Cm=Promise.resolve();async function Cn(b,c,d){let e=Cm.then(async()=>{let e=await (!Cl&&(Cl=a.A(96299).then(a=>a.default)),Cl);if(e.initialize({startOnLoad:!1,theme:d,securityLevel:"strict"}),!await e.parse(c,{suppressErrors:!0}))return null;let{svg:f}=await e.render(b,c);return f});return Cm=e.catch(()=>void 0),e}let Co=aB.default.memo(({code:a,isStreaming:b=!1})=>{let c=(0,aB.useId)().replace(/:/g,""),{resolvedTheme:d}=(0,Ck.useTheme)(),e="dark"===d?"dark":"default",[f,g]=(0,aB.useState)(null);return((0,aB.useEffect)(()=>{if(b)return;let d=!1;return g(null),Cn(`mermaid-${c}`,a,e).then(a=>{d||g(a)}).catch(()=>{d||g(null)}),()=>{d=!0}},[a,c,b,e]),b)?(0,aA.jsx)("pre",{className:"my-4 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded-md bg-[var(--color-surface)] p-3 text-xs text-[var(--color-text-tertiary)]",children:(0,aA.jsx)("code",{children:a})}):f?(0,aA.jsx)(Cp,{svg:f}):(0,aA.jsx)(Cg,{language:"mermaid",value:a})});Co.displayName="MermaidDiagram";let Cp=aB.default.memo(({svg:a})=>{let[b,c]=(0,aB.useState)(!1),[d,e]=(0,aB.useState)(1),f=Math.round(100*d);return(0,aB.useEffect)(()=>{b&&e(1)},[b]),(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("button",{type:"button","aria-label":"Open diagram in full view","aria-haspopup":"dialog",onClick:()=>c(!0),className:"my-4 block max-w-full cursor-zoom-in overflow-x-auto rounded-md bg-[var(--color-surface)] p-4 text-left transition-shadow hover:ring-2 hover:ring-primary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",dangerouslySetInnerHTML:{__html:a}}),(0,aA.jsx)(de,{open:b,onOpenChange:c,children:(0,aA.jsxs)(dh,{className:"max-h-[calc(100svh-1rem)] w-[calc(100vw-1rem)] max-w-[calc(100vw-1rem)] overflow-auto p-3 sm:max-h-[92vh] sm:w-[min(1200px,95vw)] sm:max-w-[95vw] sm:p-4",children:[(0,aA.jsx)(dk,{className:"sr-only",children:"Mermaid diagram"}),(0,aA.jsx)(dl,{className:"sr-only",children:"Full-size preview of the generated Mermaid diagram."}),(0,aA.jsxs)("div",{className:"sticky top-0 z-10 -mx-1 -mt-1 mb-2 flex items-center justify-end gap-1 bg-background/95 pb-2 pr-8 backdrop-blur",children:[(0,aA.jsx)("button",{type:"button",onClick:()=>e(a=>Math.max(.75,a-.25)),disabled:d<=.75,"aria-label":"Zoom out",className:"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:(0,aA.jsx)(Cj,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("span",{className:"min-w-12 text-center text-xs font-medium tabular-nums text-muted-foreground","aria-live":"polite",children:[f,"%"]}),(0,aA.jsx)("button",{type:"button",onClick:()=>e(a=>Math.min(2.5,a+.25)),disabled:d>=2.5,"aria-label":"Zoom in",className:"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:(0,aA.jsx)(Ci,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsx)("button",{type:"button",onClick:()=>e(1),"aria-label":"Reset zoom",className:"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(Ch,{className:"size-4","aria-hidden":"true"})})]}),(0,aA.jsx)("div",{className:"min-w-full overflow-auto rounded-md bg-[var(--color-surface)] p-3",children:(0,aA.jsx)("div",{className:"[&_svg]:!h-auto [&_svg]:!w-full [&_svg]:!max-w-none",style:{width:`${f}%`},dangerouslySetInnerHTML:{__html:a}})})]})})]})});Cp.displayName="MermaidPreview";let Cq={...BO,attributes:{...BO.attributes,code:[...BO.attributes?.code||[],["className","math-inline","math-display"]]}},Cr=aB.default.memo(({content:a,className:b="",isStreaming:c=!1})=>(0,aA.jsx)("div",{className:dd("prose min-w-0 max-w-full overflow-hidden break-words text-sm leading-relaxed text-inherit [&_h1:first-child]:mt-0 [&_h1]:mb-4 [&_h1]:mt-6 [&_h1]:font-semibold [&_h2:first-child]:mt-0 [&_h2]:mb-4 [&_h2]:mt-6 [&_h2]:font-semibold [&_h3:first-child]:mt-0 [&_h3]:mb-4 [&_h3]:mt-6 [&_h3]:font-semibold [&_h4:first-child]:mt-0 [&_h4]:mb-4 [&_h4]:mt-6 [&_h4]:font-semibold [&_h5:first-child]:mt-0 [&_h5]:mb-4 [&_h5]:mt-6 [&_h5]:font-semibold [&_h6:first-child]:mt-0 [&_h6]:mb-4 [&_h6]:mt-6 [&_h6]:font-semibold [&_p:last-child]:mb-0 [&_p]:mb-4",b),children:(0,aA.jsx)(xS,{remarkPlugins:[y1,y7],rehypePlugins:[Bn,[BW,Cq],[BM,{throwOnError:!1,strict:!1}]],components:{code({inline:a,className:b,children:d,...e}){let f=/language-(\w+)/.exec(b||""),g=String(d).replace(/\n$/,"");return a||f?.[1]!=="mermaid"?!a&&f?(0,aA.jsx)(Cg,{language:f[1],value:g}):(0,aA.jsx)("code",{className:"rounded-sm bg-[var(--color-surface)] px-1 py-0.5 font-mono text-[0.9em]",...e,children:d}):(0,aA.jsx)(Co,{code:g,isStreaming:c})},pre:({children:a})=>(0,aA.jsx)("div",{className:"my-4 max-w-full overflow-hidden last:mb-0",children:a}),a:({href:a,children:b})=>(0,aA.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-primary no-underline hover:underline",children:b}),blockquote:({children:a})=>(0,aA.jsx)("blockquote",{className:"my-4 border-l-4 border-border pl-4 italic text-[var(--color-text-tertiary)]",children:a}),ul:({children:a})=>(0,aA.jsx)("ul",{className:"my-4 list-disc pl-6 [&>li:last-child]:mb-0 [&>li]:mb-1",children:a}),ol:({children:a})=>(0,aA.jsx)("ol",{className:"my-4 list-decimal pl-6 [&>li:last-child]:mb-0 [&>li]:mb-1",children:a}),details:({children:a,...b})=>(0,aA.jsx)("details",{...b,className:"my-4 rounded-md border border-border bg-[var(--color-surface)] px-3 py-2 [&[open]>summary]:mb-2",children:a}),summary:({children:a,...b})=>(0,aA.jsx)("summary",{...b,className:"cursor-pointer select-none font-medium text-[var(--color-text-primary)] hover:text-[var(--color-text-secondary)]",children:a}),table:({children:a})=>(0,aA.jsx)("div",{className:"my-4 overflow-x-auto",children:(0,aA.jsx)("table",{className:"w-full border-collapse [&_td]:border [&_td]:border-border [&_td]:p-2 [&_th]:border [&_th]:border-border [&_th]:bg-[var(--color-surface)] [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold",children:a})})},children:a})}));function Cs({steps:a,hideFinalText:b,compact:c=!1}){let d=new Map;for(let b of a)"tool_result"===b.kind&&b.toolCallId&&d.set(b.toolCallId,b.text);let e=-1;if(b){for(let b=a.length-1;b>=0;b--)if("text"===a[b].kind){e=b;break}}return(0,aA.jsx)("div",{className:dd("flex flex-col gap-1",c&&"gap-0.5"),children:a.map((a,b)=>{if(b===e)return null;if("tool_call"===a.kind){let e={id:a.id,name:a.name,args:a.args,result:d.get(a.id),status:d.has(a.id)?"completed":"pending"};return(0,aA.jsx)(uz,{toolCall:e,compact:c},a.id||`tc-${b}`)}return"text"===a.kind?(0,aA.jsx)("div",{className:dd("px-2 text-sm",c&&"px-1 text-xs"),children:(0,aA.jsx)(Cr,{content:a.text,className:c?"text-xs leading-5 [&_blockquote]:my-2 [&_blockquote]:pl-2 [&_h1]:mb-2 [&_h1]:mt-3 [&_h1]:text-base [&_h2]:mb-2 [&_h2]:mt-3 [&_h2]:text-base [&_h3]:mb-1.5 [&_h3]:mt-3 [&_h3]:text-sm [&_h4]:mb-1.5 [&_h4]:mt-3 [&_h4]:text-sm [&_ol]:my-2 [&_ol]:pl-5 [&_p]:mb-2 [&_table]:text-[11px] [&_td]:p-1.5 [&_th]:p-1.5 [&_ul]:my-2 [&_ul]:pl-5":void 0})},`txt-${b}`):null})})}function Ct(a){switch(a){case"running":case"pending":case"busy":return"running";case"success":return"success";case"error":case"timeout":return"error";case"cancelled":case"interrupted":return"cancelled";case"expired":return"expired";default:return"unknown"}}Cr.displayName="MarkdownContent";let Cu={"writing-agent":"Writing agent","data-analysis-agent":"Data analysis agent"},Cv="[Async tasks update]";function Cw(a){return`${a.task_id}:${a.run_id||"legacy"}`}function Cx(a){let b=a.trim().split(/\r?\n/);if(b[0]!==Cv||!b[1])return null;try{let a=JSON.parse(b[1]);if("string"!=typeof a.task_id||!a.task_id)return null;return{taskId:a.task_id,runId:"string"==typeof a.run_id&&a.run_id?a.run_id:void 0}}catch{return null}}function Cy(a,b){let c=Cx(a);return!!c&&c.taskId===b.task_id&&(!c.runId||c.runId===b.run_id)}function Cz(a){let b=a.liveStatus||a.status||"success";return[Cv,JSON.stringify({agent:a.agent_name,kind:"agent",...a.run_id?{run_id:a.run_id}:{},status:b,task_id:a.task_id}),"(Signal only — fetch full result via check_async_task (sub-agents) if relevant to the current step, else acknowledge & continue.)"].join("\n")}let CA={running:{dot:"bg-[var(--color-warning)]",label:"Running",pulse:!0},success:{dot:"bg-[var(--color-success)]",label:"Done",pulse:!1},error:{dot:"bg-[var(--color-error)]",label:"Error",pulse:!1},cancelled:{dot:"bg-muted-foreground",label:"Cancelled",pulse:!1},expired:{dot:"bg-muted-foreground",label:"Expired",pulse:!1},unknown:{dot:"bg-muted-foreground",label:"Unknown",pulse:!1}};function CB(a){let b=Ct(a);return"success"===b||"error"===b||"cancelled"===b}function CC(a){return a.filter(a=>"running"===Ct(a.liveStatus??a.status)).length}let CD=cz("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),CE=cz("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),CF=cz("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),CG=aB.default.memo(({message:a,toolCalls:b,isLoading:c,isStreaming:d,actionRequests:e,submittedActionRequestKeys:f,onActionRequestSubmitted:g,reviewConfigsMap:h,ui:i,stream:j,onResumeInterrupt:k,graphId:l,onEditMessage:m,autoApprove:n,subAgentSteps:o})=>{let p="human"===a.type,q=t3(a),r=q&&""!==q.trim(),s=b.length>0,t=(0,aB.useMemo)(()=>{let b=a.additional_kwargs?.reasoning_content;return"string"==typeof b&&b.trim()?b.trim():null},[a.additional_kwargs]),u=(0,aB.useMemo)(()=>b.filter(a=>"task"===a.name&&a.args.subagent_type&&""!==a.args.subagent_type&&null!==a.args.subagent_type).map(a=>{let b=a.args.subagent_type;return{id:a.id,name:a.name,subAgentName:b,input:a.args,output:a.result?{result:a.result}:void 0,status:a.status}}),[b]),v=(0,aB.useMemo)(()=>{let a=new Map;if(!e||0===e.length)return a;let c=new Map;e.forEach((a,b)=>{let d=c.get(a.name),e={actionRequest:a,actionIndex:b};d?d.push(e):c.set(a.name,[e])});let d=new Map;for(let e of b){if("interrupted"!==e.status)continue;let b=c.get(e.name);if(!b)continue;let f=d.get(e.name)??0;f<b.length&&(a.set(e.id,b[f]),d.set(e.name,f+1))}return a},[e,b]),w=(0,aB.useMemo)(()=>JSON.stringify((e??[]).map(a=>({name:a.name,args:a.args}))),[e]),x=(0,aB.useRef)({});(0,aB.useEffect)(()=>{x.current={}},[w]);let y=(0,aB.useCallback)((a,b)=>{let c=b?.decisions;if(!Array.isArray(c)||!e?.length||1===e.length||c.length===e.length)return void k?.(b);let d=c[0],f={...x.current,[a]:d};x.current=f,e.every((a,b)=>f[b])&&(x.current={},k?.({decisions:e.map((a,b)=>f[b])}))},[e,k]),[z,A]=(0,aB.useState)(!1),[B,C]=(0,aB.useState)(!1),D=(0,aB.useRef)(void 0);(0,aB.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]),(0,aB.useEffect)(()=>{C(!1),D.current&&clearTimeout(D.current)},[q]);let E=(0,aB.useCallback)(async()=>{q&&(await Cf(q)?(C(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>C(!1),2e3)):jD.toast.error("Couldn't copy to clipboard."))},[q]),[F,G]=(0,aB.useState)({}),H=(0,aB.useCallback)(a=>F[a]??!1,[F]),I=(0,aB.useCallback)(a=>{G(b=>({...b,[a]:!b[a]}))},[]);return p&&null!==Cx(q)?(0,aA.jsx)("div",{className:"flex w-full justify-center py-1.5",children:(0,aA.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/40 px-3 py-1 text-xs text-muted-foreground",children:[(0,aA.jsx)(CD,{className:"size-3 text-[var(--brand)]","aria-hidden":"true"}),"Background agent reported back"]})}):(0,aA.jsx)("div",{className:dd("group flex w-full max-w-full overflow-x-hidden",p&&"flex-row-reverse"),children:(0,aA.jsxs)("div",{className:dd("min-w-0 max-w-full",p?"max-w-[70%]":"w-full"),children:[!p&&t&&(0,aA.jsxs)("div",{className:"mt-4",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>A(a=>!a),"aria-expanded":z,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[(0,aA.jsx)(CF,{className:dd("h-3.5 w-3.5 transition-transform",z&&"rotate-90"),"aria-hidden":"true"}),(0,aA.jsx)(CE,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Thinking"]}),z&&(0,aA.jsx)("div",{className:"mt-2 whitespace-pre-wrap break-words border-l-2 border-border pl-3 text-sm leading-relaxed text-muted-foreground",children:t})]}),r&&(0,aA.jsx)("div",{className:dd("relative flex items-end gap-0"),children:(0,aA.jsx)("div",{className:dd("mt-4 overflow-hidden break-words text-sm font-normal leading-[150%]",p?"rounded-xl rounded-br-none border border-border px-3 py-2 text-foreground":"text-primary"),style:p?{backgroundColor:"var(--color-user-message-bg)"}:void 0,children:p?(0,aA.jsx)("p",{className:"m-0 whitespace-pre-wrap break-words text-sm leading-relaxed",children:q}):r?(0,aA.jsx)(Cr,{content:q,isStreaming:d}):null})}),!p&&r&&(0,aA.jsx)("div",{className:"mt-1",children:(0,aA.jsx)("button",{type:"button",onClick:E,"aria-label":B?"Copied":"Copy message",className:"inline-flex items-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:B?(0,aA.jsx)(iq,{className:"h-4 w-4","aria-hidden":"true"}):(0,aA.jsx)(Ce,{className:"h-4 w-4","aria-hidden":"true"})})}),p&&r&&(0,aA.jsxs)("div",{className:"mt-1 flex justify-end gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",children:[(0,aA.jsx)("button",{type:"button",onClick:E,"aria-label":B?"Copied":"Copy message",className:"inline-flex items-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:B?(0,aA.jsx)(iq,{className:"h-4 w-4","aria-hidden":"true"}):(0,aA.jsx)(Ce,{className:"h-4 w-4","aria-hidden":"true"})}),(0,aA.jsx)("button",{type:"button",onClick:()=>m?.(q),"aria-label":"Edit message",className:"inline-flex items-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(fl,{className:"h-4 w-4","aria-hidden":"true"})})]}),s&&(0,aA.jsx)("div",{className:"mt-4 flex w-full flex-col",children:b.map(a=>{if("task"===a.name)return null;let b=i?.find(b=>b.metadata?.tool_call_id===a.id),d=v.get(a.id),e=d?.actionRequest,m=d?a.id:void 0,o=h?.get(a.name);return(0,aA.jsx)(uz,{toolCall:a,uiComponent:b,stream:j,graphId:l,actionRequest:e,actionRequestKey:m,actionRequestSubmitted:m?f?.has(m):void 0,onActionRequestSubmitted:g,reviewConfig:o,onResume:d?a=>y(d.actionIndex,a):k,isLoading:c,autoApprove:n},a.id)})}),!p&&u.length>0&&(0,aA.jsx)("div",{className:"flex w-fit max-w-full flex-col gap-4",children:u.map(a=>(0,aA.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,aA.jsx)("div",{className:"flex items-end gap-2",children:(0,aA.jsx)("div",{className:"w-[calc(100%-100px)]",children:(0,aA.jsx)(up,{subAgent:a,onClick:()=>I(a.id),isExpanded:H(a.id)})})}),H(a.id)&&(0,aA.jsx)("div",{className:"w-full max-w-full",children:(0,aA.jsxs)("div",{className:"border-border-light rounded-md border bg-[var(--color-surface)] p-4",children:[(0,aA.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-secondary)]",children:"Input"}),(0,aA.jsx)("div",{className:"mb-4",children:(0,aA.jsx)(Cr,{content:t4(a.input)})}),(o?.[a.id]?.length??0)>0&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-secondary)]",children:"Steps"}),(0,aA.jsx)("div",{className:"mb-4",children:(0,aA.jsx)(Cs,{steps:o[a.id],hideFinalText:!!a.output})})]}),a.output&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-secondary)]",children:"Output"}),(0,aA.jsx)(Cr,{content:t4(a.output)})]})]})})]},a.id))})]})})});CG.displayName="ChatMessage";let CH=cz("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),CI=aB.default.memo(({content:a,summarizedCount:b})=>{let[c,d]=(0,aB.useState)(!1),e=function(a){if(!a)return"";let b=a.match(/<summary>\s*([\s\S]*?)\s*<\/summary>/);if(b)return b[1].trim();let c=a.match(/Here is a summary of the conversation to date:\s*([\s\S]*)$/);return c?c[1].trim():a.trim()}(a);return(0,aA.jsxs)("div",{className:"my-3 w-full",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-2",children:[(0,aA.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,aA.jsxs)("button",{type:"button",onClick:()=>d(a=>!a),"aria-expanded":c,className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/40 px-3 py-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:[(0,aA.jsx)(CH,{className:"size-3.5 text-[var(--brand)]","aria-hidden":"true"}),"Conversation compacted","number"==typeof b&&b>0&&(0,aA.jsxs)("span",{className:"text-muted-foreground/70",children:["· ",b," earlier"," ",1===b?"message":"messages"," summarized"]}),(0,aA.jsx)(CF,{className:dd("size-3.5 transition-transform",c&&"rotate-90"),"aria-hidden":"true"})]}),(0,aA.jsx)("div",{className:"h-px flex-1 bg-border"})]}),c&&(0,aA.jsx)("div",{className:"mt-2 overflow-hidden rounded-md border border-border bg-muted/20 px-4 py-3",children:(0,aA.jsx)(Cr,{content:e})})]})});CI.displayName="CompactionSummary";let CJ=aB.default.memo(function({items:a,isStreaming:b,defaultCollapsed:c,isAtBottom:d,lastMessageId:e,isLoading:f,actionRequests:g,submittedActionRequestKeys:h,onActionRequestSubmitted:i,reviewConfigsMap:j,stream:k,onResumeInterrupt:l,graphId:m,onEditMessage:n,autoApprove:o,subAgentSteps:p,ui:q,compactionAnchorId:r,summarizationEvent:s}){let t=(0,aB.useMemo)(()=>!o&&0!==g.length&&void 0!==e&&a.some(a=>a.message.id===e),[o,g.length,e,a]),[u,v]=(0,aB.useState)(()=>!c),w=(0,aB.useRef)(b);(0,aB.useEffect)(()=>{let a=w.current;w.current=b,a&&!b&&!t&&c&&d&&v(!1)},[b,t,c,d]);let x=a.reduce((a,b)=>a+b.toolCalls.length,0),y=function(a){for(let b=a.length-1;b>=0;b--){let c=a[b].toolCalls;if(c.length>0)return c[c.length-1].name||"tool"}return"action"}(a),z=b?`${x} action${1===x?"":"s"} running — ${y}`:`${x} action${1===x?"":"s"} — last: ${y}`;return(0,aA.jsxs)("div",{className:"my-2",children:[(0,aA.jsxs)("button",{type:"button","aria-expanded":u,"aria-label":`${u?"Collapse":"Expand"} ${z}`,title:z,onClick:()=>v(a=>!a),className:dd("group flex w-full items-center gap-2 rounded-md border border-border bg-[var(--color-surface)] px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,aA.jsx)(CF,{"aria-hidden":"true",className:dd("size-3.5 shrink-0 transition-transform",u&&"rotate-90")}),b&&(0,aA.jsx)(fj,{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin text-[var(--brand)]"}),(0,aA.jsx)("span",{className:"truncate",children:z})]}),(()=>{if(u||!t||void 0===e)return null;let c=a.find(a=>a.message.id===e);if(!c)return null;let d=q?.filter(a=>a.metadata?.message_id===c.message.id);return(0,aA.jsx)("div",{className:"mt-2 space-y-2 border-l-2 border-border pl-3",children:(0,aA.jsx)(CG,{message:c.message,toolCalls:c.toolCalls,isLoading:f,isStreaming:b,actionRequests:g,submittedActionRequestKeys:h,onActionRequestSubmitted:i,reviewConfigsMap:j??void 0,ui:d,stream:k,onResumeInterrupt:l,graphId:m,onEditMessage:n,autoApprove:o,subAgentSteps:p})})})(),u&&(0,aA.jsxs)("div",{className:"mt-2 space-y-2 border-l-2 border-border pl-3",children:[a.map(a=>{let c=a.message.id===e,d=q?.filter(b=>b.metadata?.message_id===a.message.id),t=r===a.message.id;return(0,aA.jsxs)(aB.default.Fragment,{children:[t&&s&&(0,aA.jsx)(CI,{content:s.content,summarizedCount:s.cutoffIndex}),(0,aA.jsx)(CG,{message:a.message,toolCalls:a.toolCalls,isLoading:f,isStreaming:b&&c,actionRequests:c?g:void 0,submittedActionRequestKeys:h,onActionRequestSubmitted:i,reviewConfigsMap:c?j??void 0:void 0,ui:d,stream:k,onResumeInterrupt:l,graphId:m,onEditMessage:n,autoApprove:o,subAgentSteps:p})]},a.message.id)}),(0,aA.jsxs)("button",{type:"button",onClick:()=>v(!1),className:"flex w-full items-center justify-center gap-1.5 rounded-md py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Collapse ${x} action${1===x?"":"s"}`,children:[(0,aA.jsx)(is,{"aria-hidden":"true",className:"size-3.5"}),"Collapse"]})]})]})}),CK=cz("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),CL="__other__";function CM({questions:a,onSubmit:b,onCancel:c,isLoading:d}){let[e,f]=(0,aB.useState)(()=>a.map(()=>"")),[g,h]=(0,aB.useState)(()=>a.map(()=>null)),i=(a,b)=>f(c=>c.map((c,d)=>d===a?b:c)),j=(a,b)=>h(c=>c.map((c,d)=>d===a?b:c)),k=a=>"text"===a.type&&!1===a.required,l=a.every((a,b)=>k(a)||""!==e[b].trim());return(0,aA.jsxs)("div",{className:"w-full rounded-lg border border-border bg-muted/30 p-4",children:[(0,aA.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-foreground",children:[(0,aA.jsx)(CK,{size:16,className:"text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider",children:"EvoScientist Needs Your Input"})]}),(0,aA.jsx)("div",{className:"space-y-5",children:a.map((a,b)=>(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("p",{className:"mb-2 text-sm font-medium text-foreground",children:[a.question,!k(a)&&(0,aA.jsx)("span",{className:"ml-1 text-destructive",children:"*"})]}),"multiple_choice"===a.type?(0,aA.jsxs)("div",{className:"flex flex-col gap-2",children:[a.choices?.map(a=>{let c=g[b]===a.value;return(0,aA.jsx)("button",{type:"button",disabled:d,onClick:()=>{j(b,a.value),i(b,a.value)},className:dd("rounded-md border px-3 py-2 text-left text-sm transition-colors",c?"border-[var(--brand-solid)] bg-[var(--brand-solid)] text-[var(--brand-foreground)]":"border-border bg-background hover:bg-accent"),children:a.value},a.value)}),(0,aA.jsx)("button",{type:"button",disabled:d,onClick:()=>{j(b,CL),i(b,"")},className:dd("rounded-md border px-3 py-2 text-left text-sm transition-colors",g[b]===CL?"border-[var(--brand)] text-foreground":"border-border bg-background hover:bg-accent"),children:"Other…"}),g[b]===CL&&(0,aA.jsx)(uw,{value:e[b],onChange:a=>i(b,a.target.value),placeholder:"Type your answer…",className:"text-sm",rows:2,disabled:d})]}):(0,aA.jsx)(uw,{value:e[b],onChange:a=>i(b,a.target.value),placeholder:k(a)?"Type your answer… (optional)":"Type your answer…",className:"text-sm",rows:2,disabled:d})]},b))}),(0,aA.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,aA.jsx)(dy,{variant:"outline",size:"sm",onClick:c,disabled:d,children:"Cancel"}),(0,aA.jsx)(dy,{size:"sm",onClick:()=>b(e),disabled:!l||d,className:"bg-[var(--brand-solid)] text-[var(--brand-foreground)] hover:opacity-90",children:d?"Submitting…":"Submit"})]})]})}let CN="__new__";function CO(a){}function CP(a){return!0===({})[a??CN]}function CQ(a,b){let c={},d=a??CN;b?c[d]=!0:delete c[d],CO(c)}function CR(a,b){let c=b?.enabled??!0,d=b?.intervalMs??3e3,e=d5(),[f,g]=(0,aB.useState)([]),[h,i]=(0,aB.useState)(!1),[j,k]=(0,aB.useState)(null),l=(0,aB.useRef)(0),m=(0,aB.useRef)(!0),n=(0,aB.useRef)(new Set);(0,aB.useEffect)(()=>{n.current.clear()},[e,a]);let o=(0,aB.useCallback)(async()=>{if(!c||!a){g([]),i(!0);return}let b=++l.current;try{let c=await e.threads.getState(a),d=function(a){if(!a||"object"!=typeof a)return[];let b=[];for(let c of Object.values(a))c&&"object"==typeof c&&"string"==typeof c.task_id&&"string"==typeof c.agent_name&&b.push({task_id:c.task_id,agent_name:c.agent_name,thread_id:"string"==typeof c.thread_id?c.thread_id:c.task_id,run_id:"string"==typeof c.run_id?c.run_id:"",status:"string"==typeof c.status?c.status:"",created_at:"string"==typeof c.created_at?c.created_at:void 0,last_updated_at:"string"==typeof c.last_updated_at?c.last_updated_at:void 0});return b.sort((a,b)=>(b.created_at??"").localeCompare(a.created_at??"")),b}(c.values?.async_tasks),f=await Promise.all(d.map(async a=>{if(!a.run_id)return{...a,liveStatus:a.status,startedAt:a.created_at};let b=`${a.thread_id}:${a.run_id}`;if(n.current.has(b))return{...a,liveStatus:"expired",startedAt:a.created_at,endedAt:a.last_updated_at??a.created_at};try{let b=await e.runs.get(a.thread_id,a.run_id),c=b.status??a.status;return{...a,liveStatus:c,startedAt:b.created_at??a.created_at,endedAt:CB(c)?b.updated_at??a.last_updated_at:void 0}}catch(c){if("object"==typeof c&&null!==c&&404===c.status)return n.current.add(b),{...a,liveStatus:"expired",startedAt:a.created_at,endedAt:a.last_updated_at??a.created_at};return{...a,liveStatus:a.status,startedAt:a.created_at}}}));if(b!==l.current||!m.current)return;g(f),k(null)}catch{b===l.current&&m.current&&k("Couldn't load background agents.")}finally{b===l.current&&m.current&&i(!0)}},[e,a,c]);return(0,aB.useEffect)(()=>{if(m.current=!0,!c)return g([]),i(!0),()=>{m.current=!1};i(!1),o();let a=setInterval(()=>{document.hidden||o()},d);return()=>{m.current=!1,clearInterval(a)}},[o,c,d]),{tasks:f,loaded:h,error:j,refresh:o}}function CS(a){}function CT(a){return!!a&&!1!==({})[a]}function CU(a,b){if(!a)return;let c={},d=c[a];c[a]={initialized:!0,keys:Array.from(new Set([...d?.keys??[],...b]))},CS(c)}function CV(a,b){if(!a)return;let c={},d=c[a];c[a]={initialized:d?.initialized??!0,keys:Array.from(new Set([...d?.keys??[],b]))},CS(c)}function CW(a){let[b,c]=(0,aB.useState)(()=>CT(a));return(0,aB.useEffect)(()=>(c(CT(a)),()=>{}),[a]),[b,(0,aB.useCallback)(b=>(function(a,b){if(!a)return;let c={};b?delete c[a]:c[a]=!1})(a,b),[a])]}let CX={damping:.7,stiffness:.05,mass:1.25},CY=1e3/60,CZ=!1;function C$(a,b){let c=(0,aB.useCallback)(b=>(c.current=b,a(b)),b);return c}globalThis.document?.addEventListener("mousedown",()=>{CZ=!0}),globalThis.document?.addEventListener("mouseup",()=>{CZ=!1}),globalThis.document?.addEventListener("click",()=>{CZ=!1});let C_=new Map;function C0(...a){let b={...CX},c=!1;for(let d of a){if("instant"===d){c=!0;continue}"object"==typeof d&&(c=!1,b.damping=d.damping??b.damping,b.stiffness=d.stiffness??b.stiffness,b.mass=d.mass??b.mass)}let d=JSON.stringify(b);return C_.has(d)||C_.set(d,Object.freeze(b)),c?"instant":C_.get(d)}let C1=cz("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),C2=cz("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),C3=iS?a=>{a()}:aB.default.startTransition,C4=jf(jm,()=>(a,b,c={})=>{let{mutate:d}=jd(),e=(0,aB.useRef)(a),f=(0,aB.useRef)(b),g=(0,aB.useRef)(c),h=(0,aB.useRef)(0),[i,j,k]=(a=>{let[,b]=(0,aB.useState)({}),c=(0,aB.useRef)(!1),d=(0,aB.useRef)(a),e=(0,aB.useRef)({data:!1,error:!1,isValidating:!1}),f=(0,aB.useCallback)(a=>{let f=!1,g=d.current;for(let b in a)Object.prototype.hasOwnProperty.call(a,b)&&g[b]!==a[b]&&(g[b]=a[b],e.current[b]&&(f=!0));f&&!c.current&&b({})},[]);return iU(()=>(c.current=!1,()=>{c.current=!0})),[d,e.current,f]})({data:iE,error:iE,isMutating:!1}),l=i.current,m=(0,aB.useCallback)(async(a,b)=>{let[c,i]=i$(e.current);if(!f.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!c)throw Error("Can’t trigger the mutation: missing key.");let j=iH(iH({populateCache:!1,throwOnError:!0},g.current),b),l=i0();h.current=l,k({isMutating:!0});try{let b=await d(c,f.current(i,{arg:a}),iH(j,{throwOnError:!0}));return h.current<=l&&(C3(()=>k({data:b,isMutating:!1,error:void 0})),null==j.onSuccess||j.onSuccess.call(j,b,c,j)),b}catch(a){if(h.current<=l&&(C3(()=>k({error:a,isMutating:!1})),null==j.onError||j.onError.call(j,a,c,j),j.throwOnError))throw a}},[]),n=(0,aB.useCallback)(()=>{h.current=i0(),k({data:iE,error:iE,isMutating:!1})},[]);return iU(()=>{e.current=a,f.current=b,g.current=c}),{trigger:m,reset:n,get data(){return j.data=!0,l.data},get error(){return j.error=!0,l.error},get isMutating(){return j.isMutating=!0,l.isMutating}}}),C5={js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",json:"json",xml:"xml",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",dockerfile:"dockerfile",makefile:"makefile"},C6=aB.default.memo(({file:a,onSaveFile:b,onClose:c,editDisabled:d})=>{let[e,f]=(0,aB.useState)(null===a),[g,h]=(0,aB.useState)(String(a?.path||"")),[i,j]=(0,aB.useState)(String(a?.content||"")),k=C4({kind:"files-update",fileName:g,fileContent:i},async({fileName:a,fileContent:c})=>{if(a&&c)return await b(a,c)},{onSuccess:()=>f(!1),onError:a=>jD.toast.error(`Failed to save file: ${a}`)});(0,aB.useEffect)(()=>{h(String(a?.path||"")),j(String(a?.content||"")),f(null===a)},[a]);let l=(0,aB.useMemo)(()=>{let a=String(g||"");return a.split(".").pop()?.toLowerCase()||""},[g]),m=(0,aB.useMemo)(()=>"md"===l||"markdown"===l,[l]),n=(0,aB.useMemo)(()=>C5[l]||"text",[l]),o=(0,aB.useCallback)(()=>{i&&Cf(i)},[i]),p=(0,aB.useCallback)(()=>{if(i&&g){let a=new Blob([i],{type:"text/plain"}),b=URL.createObjectURL(a),c=document.createElement("a");c.href=b,c.download=g,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(b)}},[i,g]),q=(0,aB.useCallback)(()=>{f(!0)},[]),r=(0,aB.useCallback)(()=>{null===a?c():(h(String(a.path)),j(String(a.content)),f(!1))},[a,c]),s=(0,aB.useMemo)(()=>""!==g.trim()&&!g.includes("/")&&!g.includes(" "),[g]);return(0,aA.jsx)(de,{open:!0,onOpenChange:c,children:(0,aA.jsxs)(dh,{"aria-describedby":void 0,className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6",children:[(0,aA.jsx)(dk,{className:"sr-only",children:a?.path||"New File"}),(0,aA.jsxs)("div",{className:"mb-4 flex items-center justify-between border-b border-border pb-4",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,aA.jsx)(C1,{className:"h-5 w-5 shrink-0 text-[var(--color-text-tertiary)]"}),e&&null===a?(0,aA.jsx)(dD,{value:g,onChange:a=>h(a.target.value),placeholder:"Enter filename…",className:"text-base font-medium","aria-invalid":!s}):(0,aA.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-primary",children:a?.path})]}),(0,aA.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:!e&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)(dy,{onClick:q,variant:"ghost",size:"sm",className:"h-8 px-2",disabled:d,children:[(0,aA.jsx)(d7,{size:16,className:"mr-1"}),"Edit"]}),(0,aA.jsxs)(dy,{onClick:o,variant:"ghost",size:"sm",className:"h-8 px-2",children:[(0,aA.jsx)(Ce,{size:16,className:"mr-1"}),"Copy"]}),(0,aA.jsxs)(dy,{onClick:p,variant:"ghost",size:"sm",className:"h-8 px-2",children:[(0,aA.jsx)(fi,{size:16,className:"mr-1"}),"Download"]})]})})]}),(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?(0,aA.jsx)(uw,{value:i,onChange:a=>j(a.target.value),placeholder:"Enter file content…",className:"h-full min-h-[400px] resize-none font-mono text-sm"}):(0,aA.jsx)(f_,{className:"h-full rounded-md bg-[var(--color-surface)]",children:(0,aA.jsx)("div",{className:"p-4",children:i?m?(0,aA.jsx)("div",{className:"rounded-md p-6",children:(0,aA.jsx)(Cr,{content:i})}):(0,aA.jsx)(Cc,{language:n,style:Cd,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem"},showLineNumbers:!0,wrapLines:!0,lineProps:{style:{whiteSpace:"pre-wrap"}},children:i}):(0,aA.jsx)("div",{className:"flex items-center justify-center p-12",children:(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"File is empty"})})})})}),e&&(0,aA.jsxs)("div",{className:"mt-4 flex justify-end gap-2 border-t border-border pt-4",children:[(0,aA.jsxs)(dy,{onClick:r,variant:"outline",size:"sm",children:[(0,aA.jsx)(cA,{size:16,className:"mr-1"}),"Cancel"]}),(0,aA.jsxs)(dy,{onClick:()=>k.trigger(),size:"sm",disabled:k.isMutating||!g.trim()||!i.trim()||!s,children:[k.isMutating?(0,aA.jsx)(fj,{size:16,className:"mr-1 animate-spin"}):(0,aA.jsx)(C2,{size:16,className:"mr-1"}),"Save"]})]})]})})});function C7({files:a,setFiles:b,editDisabled:c}){let[d,e]=(0,aB.useState)(null),f=(0,aB.useCallback)(async(c,d)=>{await b({...a,[c]:d}),e({path:c,content:d})},[a,b]);return(0,aA.jsxs)(aA.Fragment,{children:[0===Object.keys(a).length?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center p-4 text-center",children:(0,aA.jsx)("p",{className:"text-xs text-muted-foreground",children:"No files created yet"})}):(0,aA.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(256px,1fr))] gap-2",children:Object.keys(a).map(b=>{let c,d=String(b),f=a[b];if("object"==typeof f&&null!==f&&"content"in f){let a=f.content;c=Array.isArray(a)?a.join("\n"):String(a||"")}else c=String(f||"");return(0,aA.jsxs)("button",{type:"button",onClick:()=>e({path:d,content:c}),className:"cursor-pointer space-y-1 truncate rounded-md border border-border px-2 py-3 shadow-sm transition-colors",style:{backgroundColor:"var(--color-file-button)"},onMouseEnter:a=>{a.currentTarget.style.backgroundColor="var(--color-file-button-hover)"},onMouseLeave:a=>{a.currentTarget.style.backgroundColor="var(--color-file-button)"},children:[(0,aA.jsx)(C1,{size:24,className:"mx-auto text-muted-foreground"}),(0,aA.jsx)("span",{className:"mx-auto block w-full truncate break-words text-center text-sm leading-relaxed text-foreground",children:d})]},d)})}),d&&(0,aA.jsx)(C6,{file:d,onSaveFile:f,onClose:()=>e(null),editDisabled:c})]})}C6.displayName="FileViewDialog",aB.default.memo(({todos:a,files:b,setFiles:c})=>{let{isLoading:d,interrupt:e}=t9(),[f,g]=(0,aB.useState)(!1),[h,i]=(0,aB.useState)(!1),j=(0,aB.useRef)(a.length),k=(0,aB.useRef)(Object.keys(b).length);(0,aB.useEffect)(()=>{0===j.current&&a.length>0&&g(!0),j.current=a.length},[a.length]);let l=Object.keys(b).length;(0,aB.useEffect)(()=>{0===k.current&&l>0&&i(!0),k.current=l},[l]);let m=(0,aB.useCallback)(a=>{switch(a){case"completed":return(0,aA.jsx)(uc,{size:12,className:"text-[var(--color-success)]"});case"in_progress":return(0,aA.jsx)(ud,{size:12,className:"text-[var(--color-warning)]"});default:return(0,aA.jsx)(ue,{size:10,className:"text-[var(--color-text-tertiary)]"})}},[]),n=(0,aB.useMemo)(()=>({pending:a.filter(a=>"pending"===a.status),in_progress:a.filter(a=>"in_progress"===a.status),completed:a.filter(a=>"completed"===a.status)}),[a]),o={pending:"Pending",in_progress:"In Progress",completed:"Completed"};return(0,aA.jsx)("div",{className:"min-h-0 w-full flex-1",children:(0,aA.jsx)("div",{className:"font-inter flex h-full w-full flex-col p-0",children:(0,aA.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden",children:[(0,aA.jsxs)("div",{className:"flex items-center justify-between px-3 pb-1.5 pt-2",children:[(0,aA.jsx)("span",{className:"text-xs font-semibold tracking-wide text-zinc-600",children:"AGENT TASKS"}),(0,aA.jsx)("button",{onClick:()=>g(a=>!a),className:dd("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-transform duration-200 hover:bg-muted",f?"rotate-180":"rotate-0"),"aria-label":"Toggle tasks panel",children:(0,aA.jsx)(ir,{size:14})})]}),f&&(0,aA.jsx)("div",{className:"bg-muted-secondary rounded-xl px-3 pb-2",children:(0,aA.jsx)(f_,{className:"h-full",children:0===a.length?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center p-4 text-center",children:(0,aA.jsx)("p",{className:"text-xs text-muted-foreground",children:"No tasks created yet"})}):(0,aA.jsx)("div",{className:"ml-1 p-0.5",children:Object.entries(n).map(([a,b])=>(0,aA.jsxs)("div",{className:"mb-4",children:[(0,aA.jsx)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-tertiary",children:o[a]}),b.map((b,c)=>(0,aA.jsxs)("div",{className:"mb-1.5 flex items-start gap-2 rounded-sm p-1 text-sm",children:[m(b.status),(0,aA.jsx)("span",{className:"flex-1 break-words leading-relaxed text-inherit",children:b.content})]},`${a}_${b.id}_${c}`))]}))})})}),(0,aA.jsxs)("div",{className:"flex items-center justify-between px-3 pb-1.5 pt-2",children:[(0,aA.jsx)("span",{className:"text-xs font-semibold tracking-wide text-zinc-600",children:"FILE SYSTEM"}),(0,aA.jsx)("button",{onClick:()=>i(a=>!a),className:dd("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-transform duration-200 hover:bg-muted",h?"rotate-180":"rotate-0"),"aria-label":"Toggle files panel",children:(0,aA.jsx)(ir,{size:14})})]}),h&&(0,aA.jsx)(C7,{files:b,setFiles:c,editDisabled:!0===d||void 0!==e})]})})})}).displayName="TasksFilesSidebar";let C8=cz("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),C9=cz("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Da=cz("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Db=cz("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Dc=cz("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),Dd=cz("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),De={js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",sh:"bash",bash:"bash",zsh:"bash",json:"json",jsonl:"json",xml:"xml",html:"html",css:"css",scss:"scss",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",tex:"latex",bib:"latex",r:"r"},Df=new Set(["png","jpg","jpeg","gif","webp","svg","bmp"]),Dg=new Set([...Object.keys(De),"txt","md","markdown","log","csv","tsv","cfg","conf","env","gitignore"]);function Dh(a,b=!1){let c=new URLSearchParams({path:a});return b&&c.set("download","1"),`/api/workspace/file?${c.toString()}`}let Di=aB.default.memo(({path:a,size:b,onClose:c,onChanged:d})=>{let[e,f]=(0,aB.useState)(null),[g,h]=(0,aB.useState)(!1),[i,j]=(0,aB.useState)(null),[k,l]=(0,aB.useState)(!1),[m,n]=(0,aB.useState)(""),[o,p]=(0,aB.useState)(!1),[q,r]=(0,aB.useState)(null),[s,t]=(0,aB.useState)(!1),[u,v]=(0,aB.useState)(!1),[w,x]=(0,aB.useState)(null),y=(0,aB.useRef)(!0);(0,aB.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let z=a?a.split("/").pop()||a:"",A=(0,aB.useMemo)(()=>z.includes(".")?z.split(".").pop().toLowerCase():"",[z]),B=Df.has(A)?"image":"pdf"===A?"pdf":Dg.has(A)?"text":"binary",C="text"===B&&null!=b&&b>2097152;if((0,aB.useEffect)(()=>{if(!a||"text"!==B||C)return void f(null);let b=!1;return h(!0),j(null),l(!1),r(null),fetch(Dh(a)).then(async a=>{if(!a.ok){let b=await a.json().catch(()=>null);throw Error(b?.error||`Failed to load file (${a.status})`)}return a.text()}).then(a=>{b||f(a)}).catch(a=>{b||j(a.message??"Failed to load file.")}).finally(()=>{b||h(!1)}),()=>{b=!0}},[a,B,C]),!a)return null;let D="md"===A||"markdown"===A,E=De[A]||"text",F=k&&null!==e&&m!==e,G=a=>{F?x(a):"close"===a?c():l(!1)},H=async()=>{p(!0),r(null);try{let b=await fetch(Dh(a),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:m})}),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error||"Failed to save.");if(!y.current)return;f(m),l(!1),d?.()}catch(a){y.current&&r(a instanceof Error?a.message:"Failed to save.")}finally{y.current&&p(!1)}},I=async()=>{t(!0),r(null);try{let b=await fetch(Dh(a),{method:"DELETE"});if(!b.ok){let a=await b.json().catch(()=>null);throw Error(a?.error||"Failed to delete.")}d?.(),c()}catch(a){y.current&&(v(!1),r(a instanceof Error?a.message:"Failed to delete."))}finally{y.current&&t(!1)}};return(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(de,{open:!0,onOpenChange:a=>{a||G("close")},children:(0,aA.jsxs)(dh,{"aria-describedby":void 0,className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6",children:[(0,aA.jsx)(dk,{className:"sr-only",children:a}),(0,aA.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3 border-b border-border pb-4",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,aA.jsx)(C1,{className:"h-5 w-5 shrink-0 text-[var(--color-text-tertiary)]"}),(0,aA.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-primary",children:a})]}),(0,aA.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:k?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{G("cancel-edit")},disabled:o,children:[(0,aA.jsx)(Dd,{size:16,className:"mr-1"}),"Cancel"]}),(0,aA.jsxs)(dy,{size:"sm",className:"h-8 bg-[var(--brand-solid)] px-3 text-[var(--brand-foreground)] hover:opacity-90",onClick:H,disabled:o||!F,children:[o?(0,aA.jsx)(fj,{size:16,className:"mr-1 animate-spin"}):(0,aA.jsx)(C2,{size:16,className:"mr-1"}),o?"Saving…":"Save"]})]}):(0,aA.jsxs)(aA.Fragment,{children:["text"===B&&!C&&(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{n(e??""),r(null),l(!0)},disabled:g||null===e,"aria-label":"Edit file",children:[(0,aA.jsx)(fl,{size:16,className:"mr-1"}),"Edit"]}),(0,aA.jsx)("a",{href:Dh(a,!0),download:z,children:(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",asChild:!0,children:(0,aA.jsxs)("span",{children:[(0,aA.jsx)(fi,{size:16,className:"mr-1"}),"Download"]})})}),(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-destructive",onClick:()=>v(!0),disabled:s,"aria-label":"Delete file",title:"Delete file",children:s?(0,aA.jsx)(fj,{size:16,className:"animate-spin"}):(0,aA.jsx)(fq,{size:16})})]})})]}),q&&(0,aA.jsx)("p",{role:"alert",className:"mb-2 text-sm text-destructive",children:q}),(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:k?(0,aA.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),spellCheck:!1,"aria-label":"File content",className:"h-full w-full resize-none rounded-md border border-border bg-background p-4 font-mono text-sm leading-relaxed text-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",placeholder:"File is empty…"}):"image"===B?(0,aA.jsx)(f_,{className:"h-full rounded-md bg-[var(--color-surface)]",children:(0,aA.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,aA.jsx)("img",{src:Dh(a),alt:z,className:"max-h-full max-w-full object-contain"})})}):"pdf"===B?(0,aA.jsx)("iframe",{src:Dh(a),title:z,className:"h-full w-full rounded-md border border-border"}):"binary"===B||C?(0,aA.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-12 text-center",children:[(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:C?"This file is too large to preview inline.":"This file type can't be previewed."}),(0,aA.jsx)("a",{href:Dh(a,!0),download:z,children:(0,aA.jsxs)(dy,{variant:"outline",size:"sm",children:[(0,aA.jsx)(fi,{size:16,className:"mr-1"}),"Download file"]})})]}):g?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,aA.jsx)(fj,{className:"size-5 animate-spin text-muted-foreground"})}):i?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center p-12",children:(0,aA.jsx)("p",{className:"text-sm text-destructive",children:i})}):(0,aA.jsx)(f_,{className:"h-full rounded-md bg-[var(--color-surface)]",children:(0,aA.jsx)("div",{className:"p-4",children:e&&e.length>0?D?(0,aA.jsx)("div",{className:"rounded-md p-6",children:(0,aA.jsx)(Cr,{content:e})}):(0,aA.jsx)(Cc,{language:E,style:Cd,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem"},showLineNumbers:!0,wrapLines:!0,lineProps:{style:{whiteSpace:"pre-wrap"}},children:e}):(0,aA.jsx)("div",{className:"flex items-center justify-center p-12",children:(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"File is empty"})})})})})]})}),(0,aA.jsx)(de,{open:null!==w,onOpenChange:a=>{a||x(null)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Discard unsaved changes?"}),(0,aA.jsxs)(dl,{children:["Your edits to “",z,"” have not been saved."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>x(null),children:"Keep Editing"}),(0,aA.jsx)(dy,{onClick:()=>{x(null),"close"===w&&c(),"cancel-edit"===w&&l(!1)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})}),(0,aA.jsx)(de,{open:u,onOpenChange:a=>{s||v(a)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Delete file?"}),(0,aA.jsxs)(dl,{children:["“",z,"” will be permanently removed from the workspace. This can't be undone."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>v(!1),disabled:s,children:"Cancel"}),(0,aA.jsx)(dy,{onClick:I,disabled:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:s?"Deleting…":"Delete"})]})]})})]})});async function Dj(a){let b=await fetch(`/api/workspace?${new URLSearchParams({path:a})}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error||"Failed to list workspace.");return c?.entries??[]}async function Dk(){let a=await fetch("/api/workspace?recursive=1"),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error||"Failed to load workspace.");return{entries:b?.entries??[],truncated:!!b?.truncated}}Di.displayName="WorkspaceFileDialog";let Dl=[{key:"docs",label:"Papers & docs",Icon:C1,exts:["pdf","tex","bib","md","markdown","txt","docx","doc","rtf","odt"]},{key:"figures",label:"Figures",Icon:Da,exts:["png","jpg","jpeg","gif","svg","webp","bmp","tiff","tif","eps"]},{key:"data",label:"Data",Icon:Db,exts:["json","jsonl","csv","tsv","xlsx","xls","parquet","pkl","npy","npz","h5","hdf5","db","sqlite","yaml","yml","xml"]},{key:"code",label:"Code",Icon:Dc,exts:["py","ipynb","js","ts","tsx","jsx","sh","bash","r","jl","cpp","cc","c","h","hpp","java","go","rs","m","rb"]}],Dm={key:"other",label:"Other",Icon:uf},Dn={};for(let a of Dl)for(let b of a.exts)Dn[b]=a.key;function Do(){let[a,b]=(0,aB.useState)("tree"),[c,d]=(0,aB.useState)({}),[e,f]=(0,aB.useState)(new Set),[g,h]=(0,aB.useState)(new Set),[i,j]=(0,aB.useState)(!1),[k,l]=(0,aB.useState)(null),[m,n]=(0,aB.useState)(!1),[o,p]=(0,aB.useState)(!1),[q,r]=(0,aB.useState)(null),[s,t]=(0,aB.useState)(null),u=(0,aB.useCallback)(async a=>{h(b=>new Set(b).add(a));try{let b=await Dj(a);return d(c=>({...c,[a]:b})),""===a&&r(null),b}catch(b){throw""===a&&r(b instanceof Error?b.message:"Failed to load."),b}finally{h(b=>{let c=new Set(b);return c.delete(a),c})}},[]),v=(0,aB.useCallback)(async()=>{n(!0);try{let{entries:a,truncated:b}=await Dk();l(a),p(b),r(null)}catch(a){r(a instanceof Error?a.message:"Failed to load.")}finally{n(!1)}},[]);(0,aB.useEffect)(()=>{j(!0),u("").catch(()=>{}).finally(()=>j(!1))},[]),(0,aB.useEffect)(()=>{"type"!==a||null!==k||m||v()},[a]);let w=(0,aB.useCallback)(async()=>{(r(null),"type"===a)?await v():(j(!0),await Promise.allSettled(["",...e].map(a=>u(a))),j(!1))},[a,e,u,v]),x=(0,aB.useCallback)(a=>{f(b=>{let d=new Set(b);return d.has(a)?d.delete(a):(d.add(a),c[a]||u(a).catch(()=>{})),d})},[c,u]),y=(0,aB.useMemo)(()=>{let a={};for(let b of k??[]){let c=Dn[b.ext]??Dm.key;(a[c]??=[]).push(b)}for(let b of Object.values(a))b.sort((a,b)=>b.mtime-a.mtime);return a},[k]),z="type"===a?m:i,A=(a,b)=>{let d=c[a];return d?0===d.length&&0===b?(0,aA.jsx)("p",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:"No files in the workspace yet"}):d.map(a=>{let c=e.has(a.path),d=g.has(a.path);return(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>"dir"===a.type?x(a.path):t({path:a.path,size:a.size}),className:"flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm text-foreground transition-colors hover:bg-muted",style:{paddingLeft:`${14*b+4}px`},title:a.name,children:["dir"===a.type?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("span",{className:"flex size-4 shrink-0 items-center justify-center text-muted-foreground",children:d?(0,aA.jsx)(fj,{className:"size-3 animate-spin"}):c?(0,aA.jsx)(ir,{className:"size-3.5"}):(0,aA.jsx)(CF,{className:"size-3.5"})}),(0,aA.jsx)(C8,{className:"size-4 shrink-0 text-[var(--brand)]"})]}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("span",{className:"size-4 shrink-0"}),(0,aA.jsx)(C1,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,aA.jsx)("span",{className:"truncate",children:a.name})]}),"dir"===a.type&&c&&A(a.path,b+1)]},a.path)}):null};return(0,aA.jsxs)("div",{className:"flex min-h-0 flex-col",children:[(0,aA.jsxs)("div",{className:"flex items-center justify-between gap-2 pb-1.5",children:[(0,aA.jsx)("div",{className:"flex items-center gap-0.5 rounded-md bg-muted p-0.5 text-xs",children:["tree","type"].map(c=>(0,aA.jsx)("button",{type:"button",onClick:()=>b(c),className:dd("rounded px-2 py-0.5 font-medium transition-colors",a===c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),"aria-pressed":a===c,children:"tree"===c?"Tree":"By type"},c))}),(0,aA.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,aA.jsxs)("a",{href:"/api/workspace/download",download:!0,className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:"Download the whole workspace as a zip",children:[(0,aA.jsx)(fi,{className:"size-3.5"}),"All"]}),(0,aA.jsx)("button",{type:"button",onClick:w,disabled:z,className:"inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50","aria-label":"Refresh workspace",title:"Refresh",children:(0,aA.jsx)(C9,{className:dd("size-3.5",z&&"animate-spin")})})]})]}),q?(0,aA.jsx)("p",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:q}):"tree"===a?i&&!c[""]?(0,aA.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,aA.jsx)(fj,{className:"size-4 animate-spin text-muted-foreground"})}):(0,aA.jsx)("div",{className:"-mx-1",children:A("",0)}):m&&null===k?(0,aA.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,aA.jsx)(fj,{className:"size-4 animate-spin text-muted-foreground"})}):(()=>{if(!k)return null;if(0===k.length)return(0,aA.jsx)("p",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:"No files in the workspace yet"});let a=[...Dl,Dm];return(0,aA.jsxs)("div",{className:"space-y-3",children:[o&&(0,aA.jsx)("p",{className:"px-1 text-[11px] text-muted-foreground",children:"Showing the first files only — the workspace has more than the limit."}),a.map(a=>{let b=y[a.key];if(!b||0===b.length)return null;let c=a.Icon;return(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("div",{className:"mb-0.5 flex items-center gap-1.5 px-1 text-[10px] font-semibold uppercase tracking-wider text-tertiary",children:[(0,aA.jsx)(c,{className:"size-3.5"}),a.label,(0,aA.jsxs)("span",{className:"text-muted-foreground",children:["(",b.length,")"]})]}),b.map(a=>{let b=a.path.includes("/")?a.path.slice(0,a.path.lastIndexOf("/")):"";return(0,aA.jsxs)("button",{type:"button",onClick:()=>t({path:a.path,size:a.size}),className:"flex w-full items-center gap-1.5 rounded-md px-1 py-1 text-left text-sm text-foreground transition-colors hover:bg-muted",title:a.path,children:[(0,aA.jsx)(c,{className:"size-4 shrink-0 text-muted-foreground"}),(0,aA.jsx)("span",{className:"truncate",children:a.name}),b&&(0,aA.jsx)("span",{className:"ml-auto shrink-0 truncate pl-2 text-[11px] text-muted-foreground",children:b})]},a.path)})]},a.key)})]})})(),(0,aA.jsx)(Di,{path:s?.path??null,size:s?.size,onClose:()=>t(null),onChanged:w})]})}let Dp=["Survey recent papers on a topic","Design an experiment plan","Analyze workspace files"];function Dq(a,b){let c=b.length>0?`
161
+ `),b[b.length-1]])}let tR=["text","reasoning","tool_call","tool_call_chunk","invalid_tool_call","server_tool_call","server_tool_call_chunk","server_tool_call_result","image","video","audio","text-plain","file"];jO({},{AIMessage:()=>k7,AIMessageChunk:()=>la,BaseMessage:()=>km,BaseMessageChunk:()=>ks,ChatMessage:()=>kF,ChatMessageChunk:()=>kG,DEFAULT_MERGE_IGNORE_KEYS:()=>ko,FunctionMessage:()=>kJ,FunctionMessageChunk:()=>kK,HumanMessage:()=>kN,HumanMessageChunk:()=>kO,KNOWN_BLOCK_TYPES:()=>tR,RemoveMessage:()=>kR,SystemMessage:()=>kS,SystemMessageChunk:()=>kT,ToolMessage:()=>kA,ToolMessageChunk:()=>kB,_isMessageFieldWithRole:()=>kt,_mergeDicts:()=>kp,_mergeLists:()=>kq,_mergeObj:()=>kr,_mergeStatus:()=>kl,coerceMessageLikeToMessage:()=>le,collapseToolCallChunks:()=>lk,convertToChunk:()=>lj,convertToOpenAIImageBlock:()=>jU,convertToProviderContentBlock:()=>jX,defaultTextSplitter:()=>tQ,defaultToolCallParser:()=>kC,filterMessages:()=>tG,getBufferString:()=>lf,iife:()=>lb,isAIMessage:()=>k8,isAIMessageChunk:()=>k9,isBase64ContentBlock:()=>jR,isBaseMessage:()=>ku,isBaseMessageChunk:()=>kv,isChatMessage:()=>kH,isChatMessageChunk:()=>kI,isDataContentBlock:()=>jP,isDirectToolOutput:()=>kz,isFunctionMessage:()=>kL,isFunctionMessageChunk:()=>kM,isHumanMessage:()=>kP,isHumanMessageChunk:()=>kQ,isIDContentBlock:()=>jT,isMessage:()=>jY,isOpenAIToolCallArray:()=>kn,isPlainTextContentBlock:()=>jS,isSystemMessage:()=>kU,isSystemMessageChunk:()=>kV,isToolMessage:()=>kD,isToolMessageChunk:()=>kE,isURLContentBlock:()=>jQ,mapChatMessagesToStoredMessages:()=>li,mapStoredMessageToChatMessage:()=>lg,mapStoredMessagesToChatMessages:()=>lh,mergeContent:()=>kk,mergeMessageRuns:()=>tI,mergeResponseMetadata:()=>kw,mergeUsageMetadata:()=>ky,parseBase64DataUrl:()=>jW,parseMimeType:()=>jV,trimMessages:()=>tK});var tS=class{chunks={};constructor(){this.chunks={}}add(a,b){a.type.endsWith("MessageChunk")&&(a.type=a.type.slice(0,-12).toLowerCase());let c="remove"===a.type&&null!=a.id?new kR({...a,id:a.id}):le(a),d=function(a){try{return lj(a)}catch{return null}}(c),{id:e}=d??c;if(!e)return console.warn("No message ID found for chunk, ignoring in state",a),null;if(this.chunks[e]??={},this.chunks[e].metadata=b??this.chunks[e].metadata,d){let a=this.chunks[e].chunk;this.chunks[e].chunk=(kv(a)?a:null)?.concat(d)??d}else this.chunks[e].chunk=c;return e}clear(){this.chunks={}}get(a,b){return null==a||null==this.chunks[a]?null:(null!=b&&(this.chunks[a].index??=b),this.chunks[a])}};let tT=a=>{let{type:b,data:c}=a.toDict();return{...c,type:b}};var tU=class extends Error{constructor(a){super(a.message),this.name=a.name??a.error??"StreamError"}static isStructuredError(a){return"object"==typeof a&&null!=a&&"message"in a}},tV=class{abortRef=new AbortController;messages;listeners=new Set;state;constructor(a){this.messages=a,this.state={isLoading:!1,values:null,error:void 0}}setState=a=>{this.state={...this.state,...a},this.notifyListeners()};notifyListeners=()=>{this.listeners.forEach(a=>a())};subscribe=a=>(this.listeners.add(a),()=>this.listeners.delete(a));getSnapshot=()=>this.state;get isLoading(){return this.state.isLoading}get values(){return this.state.values?.[0]??null}get error(){return this.state.error}setStreamValues=(a,b="stream")=>{if("function"==typeof a){let[c,d]=this.state.values??[null,"stream"],e=a(c,d);this.setState({values:null!=e?[e,b]:null})}else this.setState({values:null!=a?[a,b]:null})};getMutateFn=(a,b)=>c=>{let d={...b,...(this.state.values??[null,"stream"])[0]},e="function"==typeof c?c(d):c;this.setStreamValues({...d,...e},a)};matchEventType=(a,b,c)=>a===b||b.startsWith(`${a}|`);start=async(a,b)=>{if(!this.state.isLoading)try{let c;for await(let{event:d,data:e}of(this.setState({isLoading:!0,error:void 0}),this.abortRef=new AbortController,await a(this.abortRef.signal))){if("error"===d){c=new tU(e);break}let a=d.includes("|")?d.split("|").slice(1):void 0,f=this.getMutateFn("stream",b.initialValues);if("metadata"===d&&b.callbacks.onMetadataEvent?.(e),"events"===d&&b.callbacks.onLangChainEvent?.(e),this.matchEventType("updates",d,e)&&b.callbacks.onUpdateEvent?.(e,{namespace:a,mutate:f}),this.matchEventType("custom",d,e)&&b.callbacks.onCustomEvent?.(e,{namespace:a,mutate:f}),this.matchEventType("checkpoints",d,e)&&b.callbacks.onCheckpointEvent?.(e,{namespace:a}),this.matchEventType("tasks",d,e)&&b.callbacks.onTaskEvent?.(e,{namespace:a}),this.matchEventType("debug",d,e)&&b.callbacks.onDebugEvent?.(e,{namespace:a}),"values"===d&&("__interrupt__"in e?this.setStreamValues(a=>({...a,...e})):this.setStreamValues(e)),this.matchEventType("messages",d,e)){let[a,c]=e,d=this.messages.add(a,c);if(!d){console.warn("Failed to add message to manager, no message ID found");continue}this.setStreamValues(a=>{let c={...b.initialValues,...a},e=b.getMessages(c).slice(),{chunk:f,index:g}=this.messages.get(d,e.length)??{};return f&&null!=g?("remove"===f.getType()?e.splice(g,1):e[g]=tT(f),b.setMessages(c,e)):c})}}if(null!=c)throw c;let d=await b.onSuccess?.();void 0!==d&&this.setStreamValues(d)}catch(a){a instanceof Error&&("AbortError"===a.name||"TimeoutError"===a.name)||(console.error(a),this.setState({error:a}),await b.onError?.(a))}finally{this.setState({isLoading:!1}),this.abortRef=new AbortController,b.onFinish?.()}};stop=async(a,b)=>{this.abortRef.abort(),this.abortRef=new AbortController,b.onStop?.({mutate:this.getMutateFn("stop",a)})};clear=()=>{this.abortRef.abort(),this.abortRef=new AbortController,this.setState({error:void 0,values:null,isLoading:!1}),this.messages.clear()}};let tW=a=>{let[b,c]=(0,aB.useState)(a?.threadId??null),d=(0,aB.useRef)(a?.onThreadId);d.current=a?.onThreadId;let e=(0,aB.useCallback)(a=>{c(a),d.current?.(a)},[]);return a&&"threadId"in a?[a.threadId??null,e]:[b,e]};function tX(a,b,c){return[a["~configHash"],b,c].join(":")}var tY=a.i(254799);let tZ={randomUUID:tY.default.randomUUID},t$=new Uint8Array(256),t_=t$.length,t0=[];for(let a=0;a<256;++a)t0.push((a+256).toString(16).slice(1));let t1=function(a,b,c){if(tZ.randomUUID&&!b&&!a)return tZ.randomUUID();let d=(a=a||{}).random||(a.rng||function(){return t_>t$.length-16&&(tY.default.randomFillSync(t$),t_=0),t$.slice(t_,t_+=16)})();if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,b){c=c||0;for(let a=0;a<16;++a)b[c+a]=d[a];return b}return function(a,b=0){return t0[a[b+0]]+t0[a[b+1]]+t0[a[b+2]]+t0[a[b+3]]+"-"+t0[a[b+4]]+t0[a[b+5]]+"-"+t0[a[b+6]]+t0[a[b+7]]+"-"+t0[a[b+8]]+t0[a[b+9]]+"-"+t0[a[b+10]]+t0[a[b+11]]+t0[a[b+12]]+t0[a[b+13]]+t0[a[b+14]]+t0[a[b+15]]}(d)};function t2(a){return"string"==typeof a?a:Array.isArray(a)?a.map(a=>a&&"object"==typeof a&&"text"in a?String(a.text??""):"").join(""):""}function t3(a){return"string"==typeof a.content?a.content:Array.isArray(a.content)?a.content.filter(a=>"object"==typeof a&&null!==a&&"type"in a&&"text"===a.type||"string"==typeof a).map(a=>"string"==typeof a?a:"object"==typeof a&&null!==a&&"text"in a&&a.text||"").join(""):""}function t4(a){if("string"==typeof a)return a;if(a&&"object"==typeof a){if(a.description&&"string"==typeof a.description)return a.description;if(a.prompt&&"string"==typeof a.prompt)return a.prompt;if(a.result&&"string"==typeof a.result)return a.result}return JSON.stringify(a,null,2)}function t5(a){let b=0;for(let c of a){let a=c.content;if("string"==typeof a)b+=a.length;else if(Array.isArray(a))for(let c of a){let a=c?.text;"string"==typeof a&&(b+=a.length)}}return b}function t6(a){if(!a||"object"!=typeof a)return null;try{return JSON.stringify(a.value??null)}catch{return null}}function t7({children:a,activeAssistant:b,onHistoryRevalidate:c,thread:d}){let e=function({activeAssistant:a,onHistoryRevalidate:b,thread:c}){let[d,e]=aM("threadId"),f=d5(),[g,h]=(0,aB.useState)({}),i=function(a){let[b]=(0,aB.useState)("transport"in a);return b?function(a){let[b]=(0,aB.useState)(()=>new tS),[c]=(0,aB.useState)(()=>new tV(b));(0,aB.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot);let[d,e]=tW(a),f=(0,aB.useRef)(d);(0,aB.useEffect)(()=>{f.current!==d&&(f.current=d,c.clear())},[d,c]);let g=b=>{let c=a.messagesKey??"messages";return Array.isArray(b[c])?b[c]:[]},h=(b,c)=>{let d=a.messagesKey??"messages";return{...b,[d]:c}},i=a.initialValues??{},j=async(b,j)=>{let k,l=d;c.setStreamValues(()=>j?.optimisticValues!=null?{...i,..."function"==typeof j.optimisticValues?j.optimisticValues(i):j.optimisticValues}:{...i}),await c.start(async c=>{if(l||(f.current=l=crypto.randomUUID(),e(l)),!l)throw Error("Failed to obtain valid thread ID.");return a.transport.stream({input:b,context:j?.context,command:j?.command,signal:c,config:{...j?.config,configurable:{thread_id:l,...j?.config?.configurable}}})},{getMessages:g,setMessages:h,initialValues:{},callbacks:a,onSuccess:()=>void 0,onError(b){a.onError?.(b,k)}})};return{get values(){return c.values??{}},error:c.error,isLoading:c.isLoading,stop:()=>c.stop(i,{onStop:a.onStop}),submit:j,get interrupt(){if(null!=c.values&&"__interrupt__"in c.values&&Array.isArray(c.values.__interrupt__)){let a=c.values.__interrupt__;if(0===a.length)return{when:"breakpoint"};if(1===a.length)return a[0];return a}return},get messages(){if(!c.values)return[];return g(c.values)}}}(a):function(a){let b;(0,aB.useRef)(a.reconnectOnMount);let c=(0,aB.useMemo)(()=>null,[]),d=(0,aB.useMemo)(()=>a.client??new d2({apiUrl:a.apiUrl,apiKey:a.apiKey,callerOptions:a.callerOptions,defaultHeaders:a.defaultHeaders}),[a.client,a.apiKey,a.apiUrl,a.callerOptions,a.defaultHeaders]),[e]=(0,aB.useState)(()=>new tS),[f]=(0,aB.useState)(()=>new tV(e));(0,aB.useSyncExternalStore)(f.subscribe,f.getSnapshot,f.getSnapshot);let[g,h]=tW(a),i=(0,aB.useRef)([]),j=(0,aB.useCallback)((...a)=>{let b=i.current;for(let c of a)b.includes(c)||b.push(c)},[]),k=null!=a.onUpdateEvent,l=null!=a.onCustomEvent,m=null!=a.onLangChainEvent,n=null!=a.onDebugEvent,o=null!=a.onCheckpointEvent,p=null!=a.onTaskEvent,q=(0,aB.useMemo)(()=>{let a=[];return k&&a.push("updates"),l&&a.push("custom"),m&&a.push("events"),n&&a.push("debug"),o&&a.push("checkpoints"),p&&a.push("tasks"),a},[k,l,m,n,o,p]);(0,aB.useRef)(null).current=f.clear;let r=(0,aB.useRef)(g),s=(0,aB.useRef)(null);(0,aB.useEffect)(()=>{r.current!==g&&(r.current=g,f.clear())},[g,f]);let t="object"==typeof a.fetchStateHistory&&null!=a.fetchStateHistory?a.fetchStateHistory.limit??!1:a.fetchStateHistory??!1,u=function(a,b,c,d){let e=tX(a,b,c),[f,g]=(0,aB.useState)(()=>({key:void 0,data:void 0,error:void 0,isLoading:null!=b})),h=(0,aB.useRef)(a);h.current=a;let i=(0,aB.useRef)(d?.onError);i.current=d?.onError;let j=(0,aB.useCallback)((a,b)=>{if(d.passthrough)return Promise.resolve([]);let c=h.current,e=tX(c,a,b);return null!=a?(g(a=>a.key===e?{...a,isLoading:!0}:{key:e,data:void 0,error:void 0,isLoading:!0}),(function(a,b,c){if(c?.limit===!1)return a.threads.getState(b).then(a=>null==a.checkpoint?[]:[a]);let d="number"==typeof c?.limit?c.limit:10;return a.threads.getHistory(b,{limit:d})})(c,a,{limit:b}).then(a=>(g(b=>b.key!==e?b:{key:e,data:a,error:void 0,isLoading:!1}),a),a=>(g(b=>b.key!==e?b:{key:e,data:b.data,error:a,isLoading:!1}),i.current?.(a),Promise.reject(a)))):(g({key:e,data:void 0,error:void 0,isLoading:!1}),Promise.resolve([]))},[d.passthrough]);return(0,aB.useEffect)(()=>{(null==d.submittingRef.current||d.submittingRef.current!==b)&&j(b,c)},[j,e]),{data:f.data,error:f.error,isLoading:f.isLoading,mutate:a=>j(a??b,c)}}(d,g,t,{passthrough:null!=a.experimental_thread,submittingRef:s,onError:a.onError}),v=a.experimental_thread??u,w=b=>{let c=a.messagesKey??"messages";return Array.isArray(b[c])?b[c]:[]},x=(b,c)=>{let d=a.messagesKey??"messages";return{...b,[d]:c}},[y,z]=(0,aB.useState)(""),A=function(a,b){let{rootSequence:c,paths:d}=function(a){let b=new Set,c={};if(a.length<=1)return{rootSequence:{type:"sequence",items:a.map(a=>({type:"node",value:a,path:[]}))},paths:[]};a.forEach(a=>{let d=a.parent_checkpoint?.checkpoint_id??"$";c[d]??=[],c[d].push(a),a.checkpoint?.checkpoint_id!=null&&b.add(a.checkpoint.checkpoint_id)});let d=(...a)=>a.filter(a=>null!=a).sort((a,b)=>a.localeCompare(b)).at(-1),e=null==c.$?Object.keys(c).filter(a=>!b.has(a)).map(a=>{let b=[a],e=new Set,f=a;for(;b.length>0;){let a=b.shift();if(e.has(a))continue;e.add(a);let g=(c[a]??[]).flatMap(a=>a.checkpoint?.checkpoint_id??[]);f=d(f,...g),b.push(...g)}return{parentId:a,lastId:f}}).sort((a,b)=>a.lastId.localeCompare(b.lastId)).at(-1)?.parentId:void 0;null!=e&&(c.$=c[e]);let f={type:"sequence",items:[]},g=[{id:"$",sequence:f,path:[]}],h=[],i=new Set;for(;g.length>0;){let a,b=g.shift();if(i.has(b.id))continue;i.add(b.id);let d=c[b.id];if(null!=d&&0!==d.length)for(let c of(d.length>1&&(a={type:"fork",items:[]},b.sequence.items.push(a)),d)){let d=c.checkpoint?.checkpoint_id;if(null==d)continue;let{sequence:e}=b,{path:f}=b;null!=a&&(e={type:"sequence",items:[]},a.items.unshift(e),(f=f.slice()).push(d),h.push(f)),e.items.push({type:"node",value:c,path:f}),g.push({id:d,sequence:e,path:f})}}return{rootSequence:f,paths:h}}(b??[]),{history:e,branchByCheckpoint:f}=function(a,b,c){let d=c.split(">"),e={};for(let a of b){let b=a.at(-2)??"$";e[b]??=[],e[b].unshift(a)}let f=[],g={},h=d.slice(),i=[...a.items];for(;i.length>0;){let a=i.shift();if("node"===a.type){f.push(a.value);let b=a.value.checkpoint?.checkpoint_id;if(null==b)continue;g[b]={branch:a.path.join(">"),branchOptions:(a.path.length>0?e[a.path.at(-2)??"$"]??[]:[]).map(a=>a.join(">"))}}if("fork"===a.type){let b=h.shift(),c=null!=b?a.items.findIndex(a=>{let c=a.items.at(0);return!!c&&"node"===c.type&&c.value.checkpoint?.checkpoint_id===b}):-1,d=a.items.at(c)?.items??[];i.push(...d)}}return{history:f,branchByCheckpoint:g}}(c,d,a);return{branchTree:c,flatHistory:e,branchByCheckpoint:f,threadHead:e.at(-1)}}(y,v.data??void 0),B=A.threadHead?.values??a.initialValues??{},C=(()=>{let a=A.threadHead?.tasks?.at(-1)?.error;if(null!=a){try{let b=JSON.parse(a);if(tU.isStructuredError(b))return new tU(b);return b}catch{}return a}})(),D=(b=new Set,w(B).map((a,c)=>{let d=a.id??c,e=function(a,b){for(let c=a.length-1;c>=0;c-=1)if(b(a[c]))return a[c]}(v.data??[],a=>w(a.values).map((a,b)=>a.id??b).includes(d)),f=e?.checkpoint?.checkpoint_id,g=null!=f?A.branchByCheckpoint[f]:void 0;g?.branch?.length||(g=void 0);let h=g?.branchOptions?.flat(2).join(",");return h&&(b.has(h)&&(g=void 0),b.add(h)),{messageId:d.toString(),firstSeenState:e,branch:g?.branch,branchOptions:g?.branchOptions}})),E=async(b,e)=>{let j,k,l=e?.checkpoint?.checkpoint_id;z(null!=l?A.branchByCheckpoint[l]?.branch??"":"");let m=!0===t||"number"==typeof t,n=null!=a.onFinish||m;f.setStreamValues(()=>{let a=n?B:{...B,...f.values};return e?.optimisticValues!=null?{...a,..."function"==typeof e.optimisticValues?e.optimisticValues(a):e.optimisticValues}:{...a}});let o=g;await f.start(async f=>{if(o||(r.current=o=(await d.threads.create({threadId:e?.threadId,metadata:e?.metadata})).thread_id,s.current=o,h(o)),!o)throw Error("Failed to obtain valid thread ID.");s.current=o;let g=[...new Set([...e?.streamMode??[],...i.current,...q])],l=e?.checkpoint??(m?A.threadHead?.checkpoint:void 0)??void 0;e?.checkpoint===null&&(l=void 0),null!=l&&delete l.thread_id;let n=e?.streamResumable??!!c;return d.runs.stream(o,a.assistantId,{input:b,config:e?.config,context:e?.context,command:e?.command,interruptBefore:e?.interruptBefore,interruptAfter:e?.interruptAfter,metadata:e?.metadata,multitaskStrategy:e?.multitaskStrategy,onCompletion:e?.onCompletion,onDisconnect:e?.onDisconnect??(n?"continue":"cancel"),signal:f,checkpoint:l,streamMode:g,streamSubgraphs:e?.streamSubgraphs,streamResumable:n,durability:e?.durability,onRunCreated(b){j={run_id:b.run_id,thread_id:b.thread_id??o},c&&(k=`lg:stream:${o}`,c.setItem(k,j.run_id)),a.onCreated?.(j)}})},{getMessages:w,setMessages:x,initialValues:B,callbacks:a,async onSuccess(){if(k&&c?.removeItem(k),n){let b=await v.mutate(o),c=b?.at(0);if(c)return a.onFinish?.(c,j),null}},onError(b){a.onError?.(b,j)},onFinish(){s.current=null}})},F=async(b,e,h)=>{if(e??="-1",!g)return;let i={thread_id:g,run_id:b};await f.start(async a=>(s.current=g,d.runs.joinStream(g,b,{signal:a,lastEventId:e,streamMode:h?.streamMode})),{getMessages:w,setMessages:x,initialValues:B,callbacks:a,async onSuccess(){c?.removeItem(`lg:stream:${g}`);let b=await v.mutate(g),d=b?.at(0);d&&a.onFinish?.(d,i)},onError(b){a.onError?.(b,i)},onFinish(){s.current=null}})},G=(0,aB.useMemo)(()=>{c&&f.isLoading},[c,f.isLoading,g]),H=!!c,I=(0,aB.useRef)({threadId:g,shouldReconnect:H}),J=(0,aB.useRef)(F);J.current=F,(0,aB.useEffect)(()=>{I.current.threadId!==g&&(I.current={threadId:g,shouldReconnect:H})},[g,H]),(0,aB.useEffect)(()=>{G&&I.current.shouldReconnect&&(I.current.shouldReconnect=!1,J.current?.(G.runId))},[G]);let K=f.error??C??v.error,L=f.values??B;return{get values(){return j("values"),L},client:d,assistantId:a.assistantId,error:K,isLoading:f.isLoading,stop:()=>f.stop(B,{onStop:b=>{if(c&&g){let a=c.getItem(`lg:stream:${g}`);a&&d.runs.cancel(g,a),c.removeItem(`lg:stream:${g}`)}a.onStop?.(b)}}),submit:E,joinStream:F,branch:y,setBranch:z,get history(){if(!1===t)throw Error("`fetchStateHistory` must be set to `true` to use `history`");return A.flatHistory},isThreadLoading:v.isLoading&&null==v.data,get experimental_branchTree(){if(!1===t)throw Error("`fetchStateHistory` must be set to `true` to use `experimental_branchTree`");return A.branchTree},get interrupt(){if(null!=L&&"__interrupt__"in L&&Array.isArray(L.__interrupt__)){let a=L.__interrupt__;if(0===a.length)return{when:"breakpoint"};if(1===a.length)return a[0];return a}if(f.isLoading)return;let a=A.threadHead?.tasks?.at(-1)?.interrupts;if(null==a||0===a.length){if(!(A.threadHead?.next??[]).length||null!=K)return;return{when:"breakpoint"}}return a.at(-1)},get messages(){return j("messages-tuple","values"),w(L)},getMessagesMetadata(a,b){j("values");let c=e.get(a.id)?.metadata,d=D?.find(c=>c.messageId===(a.id??b));if(null!=c||null!=d)return{...d,streamMetadata:c}}}}(a)}({assistantId:a?.assistant_id||"",client:f??void 0,reconnectOnMount:!0,threadId:d??null,onThreadId:e,defaultHeaders:{"x-auth-scheme":"langsmith"},fetchStateHistory:!0,onFinish:b,onError:b,onCreated:b,onUpdateEvent:(a,b)=>{let c=b?.namespace;if(!c||0===c.length)return;let d=function(a){let b=[];if(!a||"object"!=typeof a)return b;for(let c of Object.values(a)){let a=c?.messages;if(Array.isArray(a))for(let c of a)if("ai"===c.type&&c.tool_calls&&c.tool_calls.length>0)for(let a of c.tool_calls)b.push({kind:"tool_call",id:a.id??"",name:a.name??"tool",args:a.args&&"object"==typeof a.args?a.args:{}});else if("ai"===c.type){let a=t2(c.content).trim();a&&b.push({kind:"text",text:a})}else"tool"===c.type&&b.push({kind:"tool_result",toolCallId:c.tool_call_id??"",name:c.name??"tool",text:t2(c.content).trim()})}return b}(a);if(0===d.length)return;let e=c.join("|");h(a=>({...a,[e]:[...a[e]??[],...d]}))},experimental_thread:c}),[j,k]=(0,aB.useState)(void 0),[l,m]=(0,aB.useState)(null),[n,o]=(0,aB.useState)(null),[p,q]=(0,aB.useState)(null),r=(0,aB.useRef)(0);(0,aB.useEffect)(()=>{let a;if(!d){k(void 0),o(null),q(null),m(null);return}if(i.isLoading){r.current+=1,k(void 0),m(null);return}let b=i.messages.length,c=++r.current,e=!1,g=0,h=async()=>{g+=1;try{let[j,l]=await Promise.all([f.threads.getState(d),f.threads.get(d)]);if(e||r.current!==c)return;let n=l.values?.messages,p=function(a){if(Array.isArray(a))for(let b=a.length-1;b>=0;b--){let c=a[b]?.interrupts;if(Array.isArray(c)&&c.length>0)return c[c.length-1]}}(j.tasks),s=Array.isArray(j.next)&&j.next.length>0,t=function(a){if(!a||"object"!=typeof a)return;let b=a.value;if(!b||"object"!=typeof b)return;let c={...b};return"action_requests"in b&&!Array.isArray(b.action_requests)&&(c.action_requests=[]),"review_configs"in b&&!Array.isArray(b.review_configs)&&(c.review_configs=[]),{...a,value:c}}(p);if(t&&function(a){if(!a||"object"!=typeof a)return!1;let b=a.value;return!!b&&"object"==typeof b&&("ask_user"===b.type||Array.isArray(b.action_requests)&&b.action_requests.length>0)}(t)){k(t),m(null),Array.isArray(n)&&(q(d),o(n));return}if(Array.isArray(n)&&n.length>b&&(q(d),o(n)),!s){k(void 0),m(t6(i.interrupt)),Array.isArray(n)&&(q(d),o(n));return}s&&g<15&&!e&&(a=setTimeout(h,1e3))}catch{!e&&r.current===c&&g<15&&(a=setTimeout(h,1e3))}};return h(),()=>{e=!0,a&&clearTimeout(a)}},[d,i.interrupt,i.isLoading,f]);let s=i.interrupt,t=s&&(null===l||t6(s)!==l)?s:p===d?j??void 0:void 0,u=n&&p===d&&(j||!i.isLoading||n.length>i.messages.length||n.length===i.messages.length&&t5(n)>t5(i.messages))?n:i.messages,v=(0,aB.useCallback)(c=>{k(void 0),o(null),q(null),m(null),r.current+=1;let d={id:t1(),type:"human",content:c};i.submit({messages:[d]},{optimisticValues:a=>({messages:[...a.messages??[],d]}),config:{...a?.config??{},recursion_limit:100},streamSubgraphs:!0,streamMode:["updates"],streamResumable:!0,onDisconnect:"continue"}),b?.()},[i,a?.config,b]),w=(0,aB.useCallback)(async a=>{d&&await f.threads.updateState(d,{values:{files:a}})},[f,d]),x=(0,aB.useCallback)(a=>{k(void 0),o(null),q(null),m(null),r.current+=1,i.submit(null,{command:{resume:a},streamSubgraphs:!0,streamMode:["updates"],streamResumable:!0,onDisconnect:"continue"}),b?.()},[i,b]),y=(0,aB.useCallback)(()=>{i.stop()},[i]);return{stream:i,todos:i.values.todos??[],files:i.values.files??{},email:i.values.email,asyncTasks:i.values.async_tasks??{},summarizationEvent:function(a){if(!a||"object"!=typeof a)return null;let b=a.summary_message,c="string"==typeof b?.content?b.content:"";if(!c)return null;let d=a.cutoff_index,e=a.file_path;return{cutoffIndex:"number"==typeof d&&d>=0?d:0,content:c,filePath:"string"==typeof e?e:null}}(i.values._summarization_event),ui:i.values.ui,setFiles:w,messages:u,isLoading:i.isLoading,isThreadLoading:i.isThreadLoading,interrupt:t,sendMessage:v,stopStream:y,resumeInterrupt:x,subAgentActivity:g}}({activeAssistant:b,onHistoryRevalidate:c,thread:d});return(0,aA.jsx)(t8.Provider,{value:e,children:a})}let t8=(0,aB.createContext)(void 0);function t9(){let a=(0,aB.useContext)(t8);if(void 0===a)throw Error("useChatContext must be used within a ChatProvider");return a}let ua=cz("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),ub=cz("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),uc=cz("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),ud=cz("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ue=cz("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),uf=cz("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),ug=cz("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),uh=cz("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ui=cz("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),uj=cz("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),uk=cz("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),ul=cz("corner-down-right",[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]),um=cz("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),un=cz("list-x",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]]),uo=cz("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),up=aB.default.memo(({subAgent:a,onClick:b,isExpanded:c=!0})=>{let d="pending"===a.status;return(0,aA.jsx)("div",{className:"w-fit max-w-[70vw] overflow-hidden rounded-lg bg-card",children:(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",onClick:b,className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left",children:[(0,aA.jsx)("span",{className:"bg-[var(--brand)]/10 flex size-5 shrink-0 items-center justify-center rounded-md text-[var(--brand)]",children:d?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(uo,{className:"size-3.5","aria-hidden":"true"})}),(0,aA.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:a.subAgentName}),(0,aA.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:"subagent"}),c?(0,aA.jsx)(is,{size:14,className:"ml-auto shrink-0 text-muted-foreground"}):(0,aA.jsx)(ir,{size:14,className:"ml-auto shrink-0 text-muted-foreground"})]})})});up.displayName="SubAgentIndicator";let uq=cz("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),ur=cz("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),us=cz("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),ut=aB.createContext(null),uu=new class{cache={};boundCache={};callbacks={};respond(a,b,c){this.cache[a]={comp:b,target:c},this.callbacks[a]?.forEach(a=>a(b,c))}getBoundStore(a){return this.boundCache[a]??={subscribe:b=>(this.callbacks[a]??=[],this.callbacks[a].push(b),()=>{this.callbacks[a]=this.callbacks[a].filter(a=>a!==b)}),getSnapshot:()=>this.cache[a]},this.boundCache[a]}};function uv({stream:a,namespace:b,message:c,meta:d,fallback:e,components:f,...g}){let h=aB.useRef(null),i=aB.useId(),j=`child-shadow-${i}`,k=aB.useMemo(()=>uu.getBoundStore(j),[j]),l=aB.useSyncExternalStore(k.subscribe,k.getSnapshot),m=f?.[c.name],n=null!=m,o=null;(a=>!!aB.isValidElement(a)||null==a||"string"==typeof a||"number"==typeof a||"bigint"==typeof a||"boolean"==typeof a||null!=a&&"object"==typeof a&&Symbol.iterator in a||null!=a&&"object"==typeof a&&"then"in a&&"function"==typeof a.then)(e)?o=e:"object"==typeof e&&null!=e&&(o=e?.[c.name]);let p=b??a.assistantId,q=a.client["~ui"];return(aB.useEffect(()=>{n||q.getComponent(p,c.name).then(a=>{let b=h.current;if(!b)return;let c=b.shadowRoot??b.attachShadow({mode:"open"}),d=document.createRange().createContextualFragment(a.replace("{{shadowRootId}}",j));c.appendChild(d)})},[q,p,c.name,j,n]),n)?(0,aA.jsx)(ut.Provider,{value:{stream:a,meta:d},children:aB.createElement(m,c.props)}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("div",{id:j,ref:h,...g}),(0,aA.jsx)(ut.Provider,{value:{stream:a,meta:d},children:l?.target!=null?aY.createPortal(aB.createElement(l.comp,c.props),l.target):o})]})}Symbol.for("LGUI_EXT_STORE"),Symbol.for("LGUI_REQUIRE"),Symbol.for("LGUI_REQUIRE_EXTRA");let uw=aB.forwardRef(({className:a,...b},c)=>(0,aA.jsx)("textarea",{className:dd("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:c,...b}));function ux(a){if("string"==typeof a)return a;if(void 0===a)return"undefined";try{return JSON.stringify(a,null,2)??String(a)}catch{return String(a)}}function uy({actionRequest:a,reviewConfig:b,onResume:c,isLoading:d,onSubmitted:e}){let[f,g]=(0,aB.useState)(""),[h,i]=(0,aB.useState)(!1),[j,k]=(0,aB.useState)({}),[l,m]=(0,aB.useState)(!1),[n,o]=(0,aB.useState)(!1),p=(0,aB.useMemo)(()=>{var b;return(b=a.args)&&"object"==typeof b?b:{}},[a.args]),q=b?.allowedDecisions??b?.allowed_decisions??["approve","reject","edit"],r=a=>{(0,aY.flushSync)(()=>{o(!0),e&&e()}),c(a)};return n?null:(0,aA.jsxs)("div",{className:"w-full rounded-md border border-border bg-muted/30 p-4",children:[(0,aA.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-foreground",children:[(0,aA.jsx)(ur,{size:16,className:"text-yellow-600 dark:text-yellow-400","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider",children:"Approval Required"})]}),a.description&&(0,aA.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:a.description}),(0,aA.jsxs)("div",{className:"mb-4 rounded-sm border border-border bg-background p-3",children:[(0,aA.jsxs)("div",{className:"mb-2",children:[(0,aA.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Tool"}),(0,aA.jsx)("p",{className:"mt-1 font-mono text-sm font-medium text-foreground",children:a.name})]}),h?(0,aA.jsxs)("div",{children:[(0,aA.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Edit Arguments"}),(0,aA.jsx)("div",{className:"mt-2 space-y-3",children:Object.entries(p).map(([a,b])=>(0,aA.jsxs)("div",{children:[(0,aA.jsx)("label",{className:"mb-1 block text-xs font-medium text-foreground",children:a}),(0,aA.jsx)(uw,{value:void 0!==j[a]?"string"==typeof j[a]?j[a]:ux(j[a]):"string"==typeof b?b:ux(b),onChange:b=>((a,b)=>{try{let c=b.trim().startsWith("{")||b.trim().startsWith("[")?JSON.parse(b):b;k(b=>({...b,[a]:c}))}catch{k(c=>({...c,[a]:b}))}})(a,b.target.value),className:"font-mono text-xs",rows:"string"==typeof b&&b.length<100?2:4,disabled:d})]},a))})]}):(0,aA.jsxs)("div",{children:[(0,aA.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Arguments"}),(0,aA.jsx)("pre",{className:"mt-2 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-muted/40 p-2 font-mono text-xs text-foreground",children:ux(p)})]})]}),l&&!h&&(0,aA.jsxs)("div",{className:"mb-4",children:[(0,aA.jsx)("label",{className:"mb-2 block text-xs font-medium text-foreground",children:"Rejection Message (optional)"}),(0,aA.jsx)(uw,{value:f,onChange:a=>g(a.target.value),placeholder:"Explain why you're rejecting this action…",className:"text-sm",rows:2,disabled:d})]}),(0,aA.jsx)("div",{className:"flex flex-wrap gap-2",children:h?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),k({})},disabled:d,children:"Cancel"}),(0,aA.jsxs)(dy,{type:"button",size:"sm",onClick:()=>{h&&(r({decisions:[{type:"edit",edited_action:{name:a.name,args:j}}]}),i(!1),k({}))},disabled:d,className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-600 dark:hover:bg-green-700",children:[(0,aA.jsx)(iq,{size:14,"aria-hidden":"true"}),d?"Saving…":"Save & Approve"]})]}):l?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{m(!1),g("")},disabled:d,children:"Cancel"}),(0,aA.jsx)(dy,{type:"button",variant:"destructive",size:"sm",onClick:()=>{r({decisions:[{type:"reject",message:f.trim()}]})},disabled:d,children:d?"Rejecting…":"Confirm Reject"})]}):(0,aA.jsxs)(aA.Fragment,{children:[q.includes("reject")&&(0,aA.jsxs)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{l?r({decisions:[{type:"reject",message:f.trim()}]}):m(!0)},disabled:d,className:"text-destructive hover:bg-destructive/10",children:[(0,aA.jsx)(cA,{size:14,"aria-hidden":"true"}),"Reject"]}),q.includes("edit")&&(0,aA.jsxs)(dy,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!0),k(function(a){try{return JSON.parse(JSON.stringify(a))}catch{return{...a}}}(p)),m(!1)},disabled:d,children:[(0,aA.jsx)(fl,{size:14,"aria-hidden":"true"}),"Edit"]}),q.includes("approve")&&(0,aA.jsxs)(dy,{type:"button",size:"sm",onClick:()=>{r({decisions:[{type:"approve"}]})},disabled:d,className:dd("bg-green-600 text-white hover:bg-green-700","dark:bg-green-600 dark:hover:bg-green-700"),children:[(0,aA.jsx)(iq,{size:14,"aria-hidden":"true"}),d?"Approving…":"Approve"]})]})})]})}function uz(a,b){if("string"==typeof a)return a;if(null==a)return String(a);try{return JSON.stringify(a,null,2*!!b?.pretty)}catch{return String(a)}}uw.displayName="Textarea";let uA=aB.default.memo(({toolCall:a,uiComponent:b,stream:c,graphId:d,actionRequest:e,actionRequestKey:f,actionRequestSubmitted:g,onActionRequestSubmitted:h,reviewConfig:i,onResume:j,isLoading:k,autoApprove:l,compact:m=!1})=>{let[n,o]=(0,aB.useState)(()=>!!b||!!e&&!l),[p,q]=(0,aB.useState)({}),r=(0,aB.useMemo)(()=>e?`${a.id}:${e.name}:${uz(e.args,{pretty:!1})}`:null,[e,a.id]),s=f??r,[t,u]=(0,aB.useState)(null);(0,aB.useEffect)(()=>{s?u(a=>a&&a!==s?null:a):u(null)},[s]),(0,aB.useEffect)(()=>{b&&o(!0)},[b]);let v=(0,aB.useRef)(e);(0,aB.useEffect)(()=>{let a=!!v.current,b=!!e;!b||a||l?!b&&a&&o(!1):o(!0),v.current=e},[e,l]);let{name:w,args:x,result:y,status:z}=(0,aB.useMemo)(()=>{let b=a.args;return{name:function(a,b){if(!a)return"Unknown Tool";if("ToolSelectionResponse"===a)return"Adaptive tool selection";let c=a.toLowerCase();if("think_tool"===c)return"Reflection";if("read_file"===c||"write_file"===c||"edit_file"===c){let a,d=function(a){if(a&&"object"==typeof a)return a;if("string"==typeof a)try{let b=JSON.parse(a);if(b&&"object"==typeof b)return b}catch{}return{}}(b),e=String(d.path??d.file_path??"");if("/memories"===(a=(e||"").trim())||a.startsWith("/memories/"))return"read_file"===c?"Reading memory":"Updating memory";if("read_file"===c){let a=function(a){let b=(a||"").trim();if(!b.startsWith("/skills/"))return"";let[c]=b.slice(8).split("/");return c||""}(e);if(a)return`Skill: ${a}`}}return a}(a.name,b),args:b&&"object"==typeof b?b:{},result:a.result,status:a.status||"completed"}},[a]),A=(0,aB.useMemo)(()=>{switch(z){case"completed":return(0,aA.jsx)(uc,{});case"error":return(0,aA.jsx)(ur,{size:14,className:"text-destructive"});case"pending":return(0,aA.jsx)(fj,{size:14,className:"animate-spin"});case"interrupted":return(0,aA.jsx)(us,{size:14,className:"text-orange-500"});default:return(0,aA.jsx)(uq,{size:14,className:"text-muted-foreground"})}},[z]),B=(0,aB.useCallback)(()=>{o(a=>!a)},[]),C=(0,aB.useCallback)(a=>{q(b=>({...b,[a]:!b[a]}))},[]),D=null!=y,E=D||Object.keys(x).length>0,F=g??t===s,G=e&&j&&(!s||!F);return(0,aA.jsxs)("div",{className:dd("w-full overflow-hidden rounded-lg border-none shadow-none outline-none transition-colors duration-200 focus-within:ring-2 focus-within:ring-ring hover:bg-accent",m&&"rounded-md",n&&E&&"bg-accent"),children:[(0,aA.jsx)(dy,{variant:"ghost",size:"sm",onClick:B,className:dd("flex w-full items-center justify-between gap-2 border-none px-2 py-2 text-left shadow-none outline-none disabled:cursor-default",m&&"h-auto min-h-8 py-1.5"),disabled:!E,children:(0,aA.jsxs)("div",{className:"flex w-full items-center justify-between gap-2",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-2",children:[A,(0,aA.jsx)("span",{className:dd("text-[15px] font-medium tracking-[-0.6px] text-foreground",m&&"text-xs tracking-normal"),children:w})]}),E&&(n?(0,aA.jsx)(is,{size:14,className:"shrink-0 text-muted-foreground"}):(0,aA.jsx)(ir,{size:14,className:"shrink-0 text-muted-foreground"}))]})}),n&&E&&(0,aA.jsx)("div",{className:dd("px-4 pb-4",m&&"px-2 pb-2"),children:b&&c&&d?(0,aA.jsx)("div",{className:"mt-4",children:(0,aA.jsx)(uv,{stream:c,message:b,namespace:d,meta:{status:z,args:x,result:y??"No Result Yet"}},b.id)}):G?(0,aA.jsx)("div",{className:"mt-4",children:(0,aA.jsx)(uy,{actionRequest:e,reviewConfig:i,onResume:j,isLoading:k,onSubmitted:()=>{u(s),s&&h?.(s),o(!1)}})}):(0,aA.jsxs)(aA.Fragment,{children:[Object.keys(x).length>0&&(0,aA.jsxs)("div",{className:dd("mt-4",m&&"mt-2"),children:[(0,aA.jsx)("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Arguments"}),(0,aA.jsx)("div",{className:"space-y-2",children:Object.entries(x).map(([a,b])=>{let c,d=(c=uz(b,{pretty:!1}).replace(/\s+/g," ").trim()).length>80?c.slice(0,79)+"…":c,e=uz(b,{pretty:!0}),f=d!==e,g=f&&!!p[a],h=(0,aA.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[(0,aA.jsxs)("span",{className:"shrink-0 font-mono",children:[a,":"]}),(0,aA.jsx)("span",{className:"truncate font-mono font-normal text-muted-foreground",children:d})]});return(0,aA.jsxs)("div",{className:"rounded-sm border border-border",children:[f?(0,aA.jsxs)("button",{type:"button",onClick:()=>C(a),className:"flex w-full items-center justify-between gap-2 bg-muted/30 p-2 text-left text-xs font-medium transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[h,g?(0,aA.jsx)(is,{size:12,className:"shrink-0 text-muted-foreground"}):(0,aA.jsx)(ir,{size:12,className:"shrink-0 text-muted-foreground"})]}):(0,aA.jsx)("div",{className:"flex items-center gap-2 bg-muted/30 p-2 text-xs font-medium",children:h}),g&&(0,aA.jsx)("div",{className:dd("border-t border-border bg-muted/20 p-2",m&&"p-1.5"),children:(0,aA.jsx)("pre",{className:dd("m-0 overflow-x-auto whitespace-pre-wrap break-all font-mono text-xs leading-6 text-foreground",m&&"text-[11px] leading-5"),children:e})})]},a)})})]}),D&&(0,aA.jsxs)("div",{className:dd("mt-4",m&&"mt-2"),children:[(0,aA.jsx)("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Result"}),(0,aA.jsx)("pre",{className:dd("m-0 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-muted/40 p-2 font-mono text-xs leading-7 text-foreground",m&&"p-1.5 text-[11px] leading-5"),children:uz(y,{pretty:!0})})]})]})})]})});function uB(){}function uC(){}function uD(a){let b=[],c=String(a||""),d=c.indexOf(","),e=0,f=!1;for(;!f;){-1===d&&(d=c.length,f=!0);let a=c.slice(e,d).trim();(a||!f)&&b.push(a),e=d+1,d=c.indexOf(",",e)}return b}function uE(a,b){let c=b||{};return(""===a[a.length-1]?[...a,""]:a).join((c.padRight?" ":"")+","+(!1===c.padLeft?"":" ")).trim()}uA.displayName="ToolCallBox";let uF=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uG=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uH={};function uI(a,b){return((b||uH).jsx?uG:uF).test(a)}let uJ=/[ \t\n\f\r]/g;function uK(a){return""===a.replace(uJ,"")}class uL{constructor(a,b){this.attribute=b,this.property=a}}uL.prototype.attribute="",uL.prototype.booleanish=!1,uL.prototype.boolean=!1,uL.prototype.commaOrSpaceSeparated=!1,uL.prototype.commaSeparated=!1,uL.prototype.defined=!1,uL.prototype.mustUseProperty=!1,uL.prototype.number=!1,uL.prototype.overloadedBoolean=!1,uL.prototype.property="",uL.prototype.spaceSeparated=!1,uL.prototype.space=void 0;let uM=0,uN=uU(),uO=uU(),uP=uU(),uQ=uU(),uR=uU(),uS=uU(),uT=uU();function uU(){return 2**++uM}a.s(["boolean",0,uN,"booleanish",0,uO,"commaOrSpaceSeparated",0,uT,"commaSeparated",0,uS,"number",0,uQ,"overloadedBoolean",0,uP,"spaceSeparated",0,uR],153427);var uV=a.i(153427);let uW=Object.keys(uV);class uX extends uL{constructor(a,b,c,d){let e=-1;if(super(a,b),function(a,b,c){c&&(a[b]=c)}(this,"space",d),"number"==typeof c)for(;++e<uW.length;){const a=uW[e];!function(a,b,c){c&&(a[b]=c)}(this,uW[e],(c&uV[a])===uV[a])}}}function uY(a){return a.toLowerCase()}uX.prototype.defined=!0;let uZ=/[A-Z]/g,u$=/-[a-z]/g,u_=/^data[-\w.:]+$/i;function u0(a,b){let c=uY(b),d=b,e=uL;if(c in a.normal)return a.property[a.normal[c]];if(c.length>4&&"data"===c.slice(0,4)&&u_.test(b)){if("-"===b.charAt(4)){let a=b.slice(5).replace(u$,u2);d="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=b.slice(4);if(!u$.test(a)){let c=a.replace(uZ,u1);"-"!==c.charAt(0)&&(c="-"+c),b="data"+c}}e=uX}return new e(d,b)}function u1(a){return"-"+a.toLowerCase()}function u2(a){return a.charAt(1).toUpperCase()}let u3={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class u4{constructor(a,b,c){this.normal=b,this.property=a,c&&(this.space=c)}}function u5(a,b){let c={},d={};for(let b of a)Object.assign(c,b.property),Object.assign(d,b.normal);return new u4(c,d,b)}function u6(a){let b={},c={};for(let[d,e]of Object.entries(a.properties)){let f=new uX(d,a.transform(a.attributes||{},d),e,a.space);a.mustUseProperty&&a.mustUseProperty.includes(d)&&(f.mustUseProperty=!0),b[d]=f,c[uY(d)]=d,c[uY(f.attribute)]=d}return new u4(b,c,a.space)}u4.prototype.normal={},u4.prototype.property={},u4.prototype.space=void 0;let u7=u6({properties:{ariaActiveDescendant:null,ariaAtomic:uO,ariaAutoComplete:null,ariaBusy:uO,ariaChecked:uO,ariaColCount:uQ,ariaColIndex:uQ,ariaColSpan:uQ,ariaControls:uR,ariaCurrent:null,ariaDescribedBy:uR,ariaDetails:null,ariaDisabled:uO,ariaDropEffect:uR,ariaErrorMessage:null,ariaExpanded:uO,ariaFlowTo:uR,ariaGrabbed:uO,ariaHasPopup:null,ariaHidden:uO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uR,ariaLevel:uQ,ariaLive:null,ariaModal:uO,ariaMultiLine:uO,ariaMultiSelectable:uO,ariaOrientation:null,ariaOwns:uR,ariaPlaceholder:null,ariaPosInSet:uQ,ariaPressed:uO,ariaReadOnly:uO,ariaRelevant:null,ariaRequired:uO,ariaRoleDescription:uR,ariaRowCount:uQ,ariaRowIndex:uQ,ariaRowSpan:uQ,ariaSelected:uO,ariaSetSize:uQ,ariaSort:null,ariaValueMax:uQ,ariaValueMin:uQ,ariaValueNow:uQ,ariaValueText:null,role:null},transform:(a,b)=>"role"===b?b:"aria-"+b.slice(4).toLowerCase()});function u8(a,b){return b in a?a[b]:b}function u9(a,b){return u8(a,b.toLowerCase())}let va=u6({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uS,acceptCharset:uR,accessKey:uR,action:null,allow:null,allowFullScreen:uN,allowPaymentRequest:uN,allowUserMedia:uN,alt:null,as:null,async:uN,autoCapitalize:null,autoComplete:uR,autoFocus:uN,autoPlay:uN,blocking:uR,capture:null,charSet:null,checked:uN,cite:null,className:uR,cols:uQ,colSpan:null,content:null,contentEditable:uO,controls:uN,controlsList:uR,coords:uQ|uS,crossOrigin:null,data:null,dateTime:null,decoding:null,default:uN,defer:uN,dir:null,dirName:null,disabled:uN,download:uP,draggable:uO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:uN,formTarget:null,headers:uR,height:uQ,hidden:uP,high:uQ,href:null,hrefLang:null,htmlFor:uR,httpEquiv:uR,id:null,imageSizes:null,imageSrcSet:null,inert:uN,inputMode:null,integrity:null,is:null,isMap:uN,itemId:null,itemProp:uR,itemRef:uR,itemScope:uN,itemType:uR,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:uN,low:uQ,manifest:null,max:null,maxLength:uQ,media:null,method:null,min:null,minLength:uQ,multiple:uN,muted:uN,name:null,nonce:null,noModule:uN,noValidate:uN,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:uN,optimum:uQ,pattern:null,ping:uR,placeholder:null,playsInline:uN,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:uN,referrerPolicy:null,rel:uR,required:uN,reversed:uN,rows:uQ,rowSpan:uQ,sandbox:uR,scope:null,scoped:uN,seamless:uN,selected:uN,shadowRootClonable:uN,shadowRootDelegatesFocus:uN,shadowRootMode:null,shape:null,size:uQ,sizes:null,slot:null,span:uQ,spellCheck:uO,src:null,srcDoc:null,srcLang:null,srcSet:null,start:uQ,step:null,style:null,tabIndex:uQ,target:null,title:null,translate:null,type:null,typeMustMatch:uN,useMap:null,value:uO,width:uQ,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uR,axis:null,background:null,bgColor:null,border:uQ,borderColor:null,bottomMargin:uQ,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:uN,declare:uN,event:null,face:null,frame:null,frameBorder:null,hSpace:uQ,leftMargin:uQ,link:null,longDesc:null,lowSrc:null,marginHeight:uQ,marginWidth:uQ,noResize:uN,noHref:uN,noShade:uN,noWrap:uN,object:null,profile:null,prompt:null,rev:null,rightMargin:uQ,rules:null,scheme:null,scrolling:uO,standby:null,summary:null,text:null,topMargin:uQ,valueType:null,version:null,vAlign:null,vLink:null,vSpace:uQ,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:uN,disableRemotePlayback:uN,prefix:null,property:null,results:uQ,security:null,unselectable:null},space:"html",transform:u9}),vb=u6({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:uT,accentHeight:uQ,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:uQ,amplitude:uQ,arabicForm:null,ascent:uQ,attributeName:null,attributeType:null,azimuth:uQ,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:uQ,by:null,calcMode:null,capHeight:uQ,className:uR,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:uQ,diffuseConstant:uQ,direction:null,display:null,dur:null,divisor:uQ,dominantBaseline:null,download:uN,dx:null,dy:null,edgeMode:null,editable:null,elevation:uQ,enableBackground:null,end:null,event:null,exponent:uQ,externalResourcesRequired:null,fill:null,fillOpacity:uQ,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uS,g2:uS,glyphName:uS,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:uQ,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:uQ,horizOriginX:uQ,horizOriginY:uQ,id:null,ideographic:uQ,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:uQ,k:uQ,k1:uQ,k2:uQ,k3:uQ,k4:uQ,kernelMatrix:uT,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:uQ,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:uQ,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:uQ,overlineThickness:uQ,paintOrder:null,panose1:null,path:null,pathLength:uQ,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uR,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:uQ,pointsAtY:uQ,pointsAtZ:uQ,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:uT,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:uT,rev:uT,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:uT,requiredFeatures:uT,requiredFonts:uT,requiredFormats:uT,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:uQ,specularExponent:uQ,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:uQ,strikethroughThickness:uQ,string:null,stroke:null,strokeDashArray:uT,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:uQ,strokeOpacity:uQ,strokeWidth:null,style:null,surfaceScale:uQ,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:uT,tabIndex:uQ,tableValues:null,target:null,targetX:uQ,targetY:uQ,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:uT,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:uQ,underlineThickness:uQ,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:uQ,values:null,vAlphabetic:uQ,vMathematical:uQ,vectorEffect:null,vHanging:uQ,vIdeographic:uQ,version:null,vertAdvY:uQ,vertOriginX:uQ,vertOriginY:uQ,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:uQ,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u8}),vc=u6({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(a,b)=>"xlink:"+b.slice(5).toLowerCase()}),vd=u6({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:u9}),ve=u6({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(a,b)=>"xml:"+b.slice(3).toLowerCase()}),vf=u5([u7,va,vc,vd,ve],"html"),vg=u5([u7,vb,vc,vd,ve],"svg");function vh(a){let b=String(a||"").trim();return b?b.split(/[ \t\n\r\f]+/g):[]}function vi(a){return a.join(" ").trim()}var vj=a.i(752540);let vk=vm("end"),vl=vm("start");function vm(a){return function(b){let c=b&&b.position&&b.position[a]||{};if("number"==typeof c.line&&c.line>0&&"number"==typeof c.column&&c.column>0)return{line:c.line,column:c.column,offset:"number"==typeof c.offset&&c.offset>-1?c.offset:void 0}}}function vn(a){let b=vl(a),c=vk(a);if(b&&c)return{start:b,end:c}}function vo(a){return a&&"object"==typeof a?"position"in a||"type"in a?vq(a.position):"start"in a||"end"in a?vq(a):"line"in a||"column"in a?vp(a):"":""}function vp(a){return vr(a&&a.line)+":"+vr(a&&a.column)}function vq(a){return vp(a&&a.start)+"-"+vp(a&&a.end)}function vr(a){return a&&"number"==typeof a?a:1}class vs extends Error{constructor(a,b,c){super(),"string"==typeof b&&(c=b,b=void 0);let d="",e={},f=!1;if(b&&(e="line"in b&&"column"in b||"start"in b&&"end"in b?{place:b}:"type"in b?{ancestors:[b],place:b.position}:{...b}),"string"==typeof a?d=a:!e.cause&&a&&(f=!0,d=a.message,e.cause=a),!e.ruleId&&!e.source&&"string"==typeof c){const a=c.indexOf(":");-1===a?e.ruleId=c:(e.source=c.slice(0,a),e.ruleId=c.slice(a+1))}if(!e.place&&e.ancestors&&e.ancestors){const a=e.ancestors[e.ancestors.length-1];a&&(e.place=a.position)}const g=e.place&&"start"in e.place?e.place.start:e.place;this.ancestors=e.ancestors||void 0,this.cause=e.cause||void 0,this.column=g?g.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=g?g.line:void 0,this.name=vo(e.place)||"1:1",this.place=e.place||void 0,this.reason=this.message,this.ruleId=e.ruleId||void 0,this.source=e.source||void 0,this.stack=f&&e.cause&&"string"==typeof e.cause.stack?e.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vs.prototype.file="",vs.prototype.name="",vs.prototype.reason="",vs.prototype.message="",vs.prototype.stack="",vs.prototype.column=void 0,vs.prototype.line=void 0,vs.prototype.ancestors=void 0,vs.prototype.cause=void 0,vs.prototype.fatal=void 0,vs.prototype.place=void 0,vs.prototype.ruleId=void 0,vs.prototype.source=void 0;let vt={}.hasOwnProperty,vu=new Map,vv=/[A-Z]/g,vw=new Set(["table","tbody","thead","tfoot","tr"]),vx=new Set(["td","th"]),vy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vz(a,b,c){var d,e,f,g,h,i,j,k,l;let m,n,o,p,q,r,s,t,u,v,w;return"element"===b.type?(d=a,e=b,f=c,n=m=d.schema,"svg"===e.tagName.toLowerCase()&&"html"===m.space&&(d.schema=vg),d.ancestors.push(e),o=vD(d,e.tagName,!1),p=function(a,b){let c,d,e={};for(d in b.properties)if("children"!==d&&vt.call(b.properties,d)){let f=function(a,b,c){let d=u0(a.schema,b);if(!(null==c||"number"==typeof c&&Number.isNaN(c))){if(Array.isArray(c)&&(c=d.commaSeparated?uE(c):vi(c)),"style"===d.property){let b="object"==typeof c?c:function(a,b){try{return(0,vj.default)(b,{reactCompat:!0})}catch(c){if(a.ignoreInvalidStyle)return{};let b=new vs("Cannot parse `style` attribute",{ancestors:a.ancestors,cause:c,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw b.file=a.filePath||void 0,b.url=vy+"#cannot-parse-style-attribute",b}}(a,String(c));return"css"===a.stylePropertyNameCase&&(b=function(a){let b,c={};for(b in a)vt.call(a,b)&&(c[function(a){let b=a.replace(vv,vF);return"ms-"===b.slice(0,3)&&(b="-"+b),b}(b)]=a[b]);return c}(b)),["style",b]}return["react"===a.elementAttributeNameCase&&d.space?u3[d.property]||d.property:d.attribute,c]}}(a,d,b.properties[d]);if(f){let[d,g]=f;a.tableCellAlignToStyle&&"align"===d&&"string"==typeof g&&vx.has(b.tagName)?c=g:e[d]=g}}return c&&((e.style||(e.style={}))["css"===a.stylePropertyNameCase?"text-align":"textAlign"]=c),e}(d,e),q=vC(d,e),vw.has(e.tagName)&&(q=q.filter(function(a){return"string"!=typeof a||!("object"==typeof a?"text"===a.type&&uK(a.value):uK(a))})),vA(d,p,o,e),vB(p,q),d.ancestors.pop(),d.schema=m,d.create(e,o,p,f)):"mdxFlowExpression"===b.type||"mdxTextExpression"===b.type?function(a,b){if(b.data&&b.data.estree&&a.evaluater){let c=b.data.estree.body[0];return uB("ExpressionStatement"===c.type),a.evaluater.evaluateExpression(c.expression)}vE(a,b.position)}(a,b):"mdxJsxFlowElement"===b.type||"mdxJsxTextElement"===b.type?(g=a,h=b,i=c,s=r=g.schema,"svg"===h.name&&"html"===r.space&&(g.schema=vg),g.ancestors.push(h),t=null===h.name?g.Fragment:vD(g,h.name,!0),u=function(a,b){let c={};for(let d of b.attributes)if("mdxJsxExpressionAttribute"===d.type)if(d.data&&d.data.estree&&a.evaluater){let b=d.data.estree.body[0];uB("ExpressionStatement"===b.type);let e=b.expression;uB("ObjectExpression"===e.type);let f=e.properties[0];uB("SpreadElement"===f.type),Object.assign(c,a.evaluater.evaluateExpression(f.argument))}else vE(a,b.position);else{let e,f=d.name;if(d.value&&"object"==typeof d.value)if(d.value.data&&d.value.data.estree&&a.evaluater){let b=d.value.data.estree.body[0];uB("ExpressionStatement"===b.type),e=a.evaluater.evaluateExpression(b.expression)}else vE(a,b.position);else e=null===d.value||d.value;c[f]=e}return c}(g,h),v=vC(g,h),vA(g,u,t,h),vB(u,v),g.ancestors.pop(),g.schema=r,g.create(h,t,u,i)):"mdxjsEsm"===b.type?function(a,b){if(b.data&&b.data.estree&&a.evaluater)return a.evaluater.evaluateProgram(b.data.estree);vE(a,b.position)}(a,b):"root"===b.type?(j=a,k=b,l=c,vB(w={},vC(j,k)),j.create(k,j.Fragment,w,l)):"text"===b.type?b.value:void 0}function vA(a,b,c,d){"string"!=typeof c&&c!==a.Fragment&&a.passNode&&(b.node=d)}function vB(a,b){if(b.length>0){let c=b.length>1?b:b[0];c&&(a.children=c)}}function vC(a,b){let c=[],d=-1,e=a.passKeys?new Map:vu;for(;++d<b.children.length;){let f,g=b.children[d];if(a.passKeys){let a="element"===g.type?g.tagName:"mdxJsxFlowElement"===g.type||"mdxJsxTextElement"===g.type?g.name:void 0;if(a){let b=e.get(a)||0;f=a+"-"+b,e.set(a,b+1)}}let h=vz(a,g,f);void 0!==h&&c.push(h)}return c}function vD(a,b,c){let d;if(c)if(b.includes(".")){let a,c=b.split("."),e=-1;for(;++e<c.length;){let b=uI(c[e])?{type:"Identifier",name:c[e]}:{type:"Literal",value:c[e]};a=a?{type:"MemberExpression",object:a,property:b,computed:!!(e&&"Literal"===b.type),optional:!1}:b}uB(a,"always a result"),d=a}else d=uI(b)&&!/^[a-z]/.test(b)?{type:"Identifier",name:b}:{type:"Literal",value:b};else d={type:"Literal",value:b};if("Literal"===d.type){let b=d.value;return vt.call(a.components,b)?a.components[b]:b}if(a.evaluater)return a.evaluater.evaluateExpression(d);vE(a)}function vE(a,b){let c=new vs("Cannot handle MDX estrees without `createEvaluater`",{ancestors:a.ancestors,place:b,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw c.file=a.filePath||void 0,c.url=vy+"#cannot-handle-mdx-estrees-without-createevaluater",c}function vF(a){return"-"+a.toLowerCase()}let vG={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vH={};function vI(a,b){let c=b||vH;return vJ(a,"boolean"!=typeof c.includeImageAlt||c.includeImageAlt,"boolean"!=typeof c.includeHtml||c.includeHtml)}function vJ(a,b,c){var d;if((d=a)&&"object"==typeof d){if("value"in a)return"html"!==a.type||c?a.value:"";if(b&&"alt"in a&&a.alt)return a.alt;if("children"in a)return vK(a.children,b,c)}return Array.isArray(a)?vK(a,b,c):""}function vK(a,b,c){let d=[],e=-1;for(;++e<a.length;)d[e]=vJ(a[e],b,c);return d.join("")}function vL(a,b,c,d){let e,f=a.length,g=0;if(b=b<0?-b>f?0:f+b:b>f?f:b,c=c>0?c:0,d.length<1e4)(e=Array.from(d)).unshift(b,c),a.splice(...e);else for(c&&a.splice(b,c);g<d.length;)(e=d.slice(g,g+1e4)).unshift(b,0),a.splice(...e),g+=1e4,b+=1e4}function vM(a,b){return a.length>0?(vL(a,a.length,0,b),a):b}let vN={}.hasOwnProperty;function vO(a){let b={},c=-1;for(;++c<a.length;)!function(a,b){let c;for(c in b){let d,e=(vN.call(a,c)?a[c]:void 0)||(a[c]={}),f=b[c];if(f)for(d in f){vN.call(e,d)||(e[d]=[]);let a=f[d];!function(a,b){let c=-1,d=[];for(;++c<b.length;)("after"===b[c].add?a:d).push(b[c]);vL(a,0,0,d)}(e[d],Array.isArray(a)?a:a?[a]:[])}}}(b,a[c]);return b}let vP=v_(/[A-Za-z]/),vQ=v_(/[\dA-Za-z]/),vR=v_(/[#-'*+\--9=?A-Z^-~]/);function vS(a){return null!==a&&(a<32||127===a)}let vT=v_(/\d/),vU=v_(/[\dA-Fa-f]/),vV=v_(/[!-/:-@[-`{-~]/);function vW(a){return null!==a&&a<-2}function vX(a){return null!==a&&(a<0||32===a)}function vY(a){return -2===a||-1===a||32===a}let vZ=v_(/\p{P}|\p{S}/u),v$=v_(/\s/);function v_(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function v0(a,b,c,d){let e=d?d-1:1/0,f=0;return function(d){return vY(d)?(a.enter(c),function d(g){return vY(g)&&f++<e?(a.consume(g),d):(a.exit(c),b(g))}(d)):b(d)}}let v1={tokenize:function(a){let b,c=a.attempt(this.parser.constructs.contentInitial,function(b){return null===b?void a.consume(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),v0(a,c,"linePrefix"))},function(c){return a.enter("paragraph"),function c(d){let e=a.enter("chunkText",{contentType:"text",previous:b});return b&&(b.next=e),b=e,function b(d){if(null===d){a.exit("chunkText"),a.exit("paragraph"),a.consume(d);return}return vW(d)?(a.consume(d),a.exit("chunkText"),c):(a.consume(d),b)}(d)}(c)});return c}},v2={tokenize:function(a){let b,c,d,e=this,f=[],g=0;return h;function h(b){if(g<f.length){let c=f[g];return e.containerState=c[1],a.attempt(c[0].continuation,i,j)(b)}return j(b)}function i(a){if(g++,e.containerState._closeFlow){let c;e.containerState._closeFlow=void 0,b&&r();let d=e.events.length,f=d;for(;f--;)if("exit"===e.events[f][0]&&"chunkFlow"===e.events[f][1].type){c=e.events[f][1].end;break}q(g);let h=d;for(;h<e.events.length;)e.events[h][1].end={...c},h++;return vL(e.events,f+1,0,e.events.slice(d)),e.events.length=h,j(a)}return h(a)}function j(c){if(g===f.length){if(!b)return m(c);if(b.currentConstruct&&b.currentConstruct.concrete)return o(c);e.interrupt=!!(b.currentConstruct&&!b._gfmTableDynamicInterruptHack)}return e.containerState={},a.check(v3,k,l)(c)}function k(a){return b&&r(),q(g),m(a)}function l(a){return e.parser.lazy[e.now().line]=g!==f.length,d=e.now().offset,o(a)}function m(b){return e.containerState={},a.attempt(v3,n,o)(b)}function n(a){return g++,f.push([e.currentConstruct,e.containerState]),m(a)}function o(d){if(null===d){b&&r(),q(0),a.consume(d);return}return b=b||e.parser.flow(e.now()),a.enter("chunkFlow",{_tokenizer:b,contentType:"flow",previous:c}),function b(c){if(null===c){p(a.exit("chunkFlow"),!0),q(0),a.consume(c);return}return vW(c)?(a.consume(c),p(a.exit("chunkFlow")),g=0,e.interrupt=void 0,h):(a.consume(c),b)}(d)}function p(a,f){let h=e.sliceStream(a);if(f&&h.push(null),a.previous=c,c&&(c.next=a),c=a,b.defineSkip(a.start),b.write(h),e.parser.lazy[a.start.line]){let a,c,f=b.events.length;for(;f--;)if(b.events[f][1].start.offset<d&&(!b.events[f][1].end||b.events[f][1].end.offset>d))return;let h=e.events.length,i=h;for(;i--;)if("exit"===e.events[i][0]&&"chunkFlow"===e.events[i][1].type){if(a){c=e.events[i][1].end;break}a=!0}for(q(g),f=h;f<e.events.length;)e.events[f][1].end={...c},f++;vL(e.events,i+1,0,e.events.slice(h)),e.events.length=f}}function q(b){let c=f.length;for(;c-- >b;){let b=f[c];e.containerState=b[1],b[0].exit.call(e,a)}f.length=b}function r(){b.write([null]),c=void 0,b=void 0,e.containerState._closeFlow=void 0}}},v3={tokenize:function(a,b,c){return v0(a,a.attempt(this.parser.constructs.document,b,c),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},v4={partial:!0,tokenize:function(a,b,c){return function(b){return vY(b)?v0(a,d,"linePrefix")(b):d(b)};function d(a){return null===a||vW(a)?b(a):c(a)}}};class v5{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,b){let c=null==b?1/0:b;return c<this.left.length?this.left.slice(a,c):a>this.left.length?this.right.slice(this.right.length-c+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-c+this.left.length).reverse())}splice(a,b,c){this.setCursor(Math.trunc(a));let d=this.right.splice(this.right.length-(b||0),1/0);return c&&v6(this.left,c),d.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(a){this.setCursor(1/0),this.left.push(a)}pushMany(a){this.setCursor(1/0),v6(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),v6(this.right,a.reverse())}setCursor(a){if(a!==this.left.length&&(!(a>this.left.length)||0!==this.right.length)&&(!(a<0)||0!==this.left.length))if(a<this.left.length){let b=this.left.splice(a,1/0);v6(this.right,b.reverse())}else{let b=this.right.splice(this.left.length+this.right.length-a,1/0);v6(this.left,b.reverse())}}}function v6(a,b){let c=0;if(b.length<1e4)a.push(...b);else for(;c<b.length;)a.push(...b.slice(c,c+1e4)),c+=1e4}function v7(a){let b,c,d,e,f,g,h,i={},j=-1,k=new v5(a);for(;++j<k.length;){for(;j in i;)j=i[j];if(b=k.get(j),j&&"chunkFlow"===b[1].type&&"listItemPrefix"===k.get(j-1)[1].type&&((d=0)<(g=b[1]._tokenizer.events).length&&"lineEndingBlank"===g[d][1].type&&(d+=2),d<g.length&&"content"===g[d][1].type))for(;++d<g.length&&"content"!==g[d][1].type;)"chunkText"===g[d][1].type&&(g[d][1]._isInFirstContentOfListItem=!0,d++);if("enter"===b[0])b[1].contentType&&(Object.assign(i,function(a,b){let c,d,e=a.get(b)[1],f=a.get(b)[2],g=b-1,h=[],i=e._tokenizer;!i&&(i=f.parser[e.contentType](e.start),e._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let j=i.events,k=[],l={},m=-1,n=e,o=0,p=0,q=[0];for(;n;){for(;a.get(++g)[1]!==n;);h.push(g),!n._tokenizer&&(c=f.sliceStream(n),n.next||c.push(null),d&&i.defineSkip(n.start),n._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),n._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=n,n=n.next}for(n=e;++m<j.length;)"exit"===j[m][0]&&"enter"===j[m-1][0]&&j[m][1].type===j[m-1][1].type&&j[m][1].start.line!==j[m][1].end.line&&(p=m+1,q.push(p),n._tokenizer=void 0,n.previous=void 0,n=n.next);for(i.events=[],n?(n._tokenizer=void 0,n.previous=void 0):q.pop(),m=q.length;m--;){let b=j.slice(q[m],q[m+1]),c=h.pop();k.push([c,c+b.length-1]),a.splice(c,2,b)}for(k.reverse(),m=-1;++m<k.length;)l[o+k[m][0]]=o+k[m][1],o+=k[m][1]-k[m][0]-1;return l}(k,j)),j=i[j],h=!0);else if(b[1]._container){for(d=j,c=void 0;d--;)if("lineEnding"===(e=k.get(d))[1].type||"lineEndingBlank"===e[1].type)"enter"===e[0]&&(c&&(k.get(c)[1].type="lineEndingBlank"),e[1].type="lineEnding",c=d);else if("linePrefix"===e[1].type||"listItemIndent"===e[1].type);else break;c&&(b[1].end={...k.get(c)[1].start},(f=k.slice(c,j)).unshift(b),k.splice(c,j-c+1,f))}}return vL(a,0,1/0,k.slice(0)),!h}let v8={resolve:function(a){return v7(a),a},tokenize:function(a,b){let c;return function(b){return a.enter("content"),c=a.enter("chunkContent",{contentType:"content"}),d(b)};function d(b){return null===b?e(b):vW(b)?a.check(v9,f,e)(b):(a.consume(b),d)}function e(c){return a.exit("chunkContent"),a.exit("content"),b(c)}function f(b){return a.consume(b),a.exit("chunkContent"),c.next=a.enter("chunkContent",{contentType:"content",previous:c}),c=c.next,d}}},v9={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return a.exit("chunkContent"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),v0(a,e,"linePrefix")};function e(e){if(null===e||vW(e))return c(e);let f=d.events[d.events.length-1];return!d.parser.constructs.disable.null.includes("codeIndented")&&f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(e):a.interrupt(d.parser.constructs.flow,c,b)(e)}}},wa={tokenize:function(a){let b=this,c=a.attempt(v4,function(d){return null===d?void a.consume(d):(a.enter("lineEndingBlank"),a.consume(d),a.exit("lineEndingBlank"),b.currentConstruct=void 0,c)},a.attempt(this.parser.constructs.flowInitial,d,v0(a,a.attempt(this.parser.constructs.flow,d,a.attempt(v8,d)),"linePrefix")));return c;function d(d){return null===d?void a.consume(d):(a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),b.currentConstruct=void 0,c)}}},wb={resolveAll:wf()},wc=we("string"),wd=we("text");function we(a){return{resolveAll:wf("text"===a?wg:void 0),tokenize:function(b){let c=this,d=this.parser.constructs[a],e=b.attempt(d,f,g);return f;function f(a){return i(a)?e(a):g(a)}function g(a){return null===a?void b.consume(a):(b.enter("data"),b.consume(a),h)}function h(a){return i(a)?(b.exit("data"),e(a)):(b.consume(a),h)}function i(a){if(null===a)return!0;let b=d[a],e=-1;if(b)for(;++e<b.length;){let a=b[e];if(!a.previous||a.previous.call(c,c.previous))return!0}return!1}}}}function wf(a){return function(b,c){let d,e=-1;for(;++e<=b.length;)void 0===d?b[e]&&"data"===b[e][1].type&&(d=e,e++):b[e]&&"data"===b[e][1].type||(e!==d+2&&(b[d][1].end=b[e-1][1].end,b.splice(d+2,e-d-2),e=d+2),d=void 0);return a?a(b,c):b}}function wg(a,b){let c=0;for(;++c<=a.length;)if((c===a.length||"lineEnding"===a[c][1].type)&&"data"===a[c-1][1].type){let d,e=a[c-1][1],f=b.sliceStream(e),g=f.length,h=-1,i=0;for(;g--;){let a=f[g];if("string"==typeof a){for(h=a.length;32===a.charCodeAt(h-1);)i++,h--;if(h)break;h=-1}else if(-2===a)d=!0,i++;else if(-1===a);else{g++;break}}if(b._contentTypeTextTrailing&&c===a.length&&(i=0),i){let f={type:c===a.length||d||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:g?h:e.start._bufferIndex+h,_index:e.start._index+g,line:e.end.line,column:e.end.column-i,offset:e.end.offset-i},end:{...e.end}};e.end={...f.start},e.start.offset===e.end.offset?Object.assign(e,f):(a.splice(c,0,["enter",f,b],["exit",f,b]),c+=2)}c++}return a}function wh(a){return null===a||vX(a)||v$(a)?1:vZ(a)?2:void 0}function wi(a,b,c){let d=[],e=-1;for(;++e<a.length;){let f=a[e].resolveAll;f&&!d.includes(f)&&(b=f(b,c),d.push(f))}return b}let wj={name:"attention",resolveAll:function(a,b){let c,d,e,f,g,h,i,j,k=-1;for(;++k<a.length;)if("enter"===a[k][0]&&"attentionSequence"===a[k][1].type&&a[k][1]._close){for(c=k;c--;)if("exit"===a[c][0]&&"attentionSequence"===a[c][1].type&&a[c][1]._open&&b.sliceSerialize(a[c][1]).charCodeAt(0)===b.sliceSerialize(a[k][1]).charCodeAt(0)){if((a[c][1]._close||a[k][1]._open)&&(a[k][1].end.offset-a[k][1].start.offset)%3&&!((a[c][1].end.offset-a[c][1].start.offset+a[k][1].end.offset-a[k][1].start.offset)%3))continue;h=a[c][1].end.offset-a[c][1].start.offset>1&&a[k][1].end.offset-a[k][1].start.offset>1?2:1;let l={...a[c][1].end},m={...a[k][1].start};wk(l,-h),wk(m,h),f={type:h>1?"strongSequence":"emphasisSequence",start:l,end:{...a[c][1].end}},g={type:h>1?"strongSequence":"emphasisSequence",start:{...a[k][1].start},end:m},e={type:h>1?"strongText":"emphasisText",start:{...a[c][1].end},end:{...a[k][1].start}},d={type:h>1?"strong":"emphasis",start:{...f.start},end:{...g.end}},a[c][1].end={...f.start},a[k][1].start={...g.end},i=[],a[c][1].end.offset-a[c][1].start.offset&&(i=vM(i,[["enter",a[c][1],b],["exit",a[c][1],b]])),i=vM(i,[["enter",d,b],["enter",f,b],["exit",f,b],["enter",e,b]]),i=vM(i,wi(b.parser.constructs.insideSpan.null,a.slice(c+1,k),b)),i=vM(i,[["exit",e,b],["enter",g,b],["exit",g,b],["exit",d,b]]),a[k][1].end.offset-a[k][1].start.offset?(j=2,i=vM(i,[["enter",a[k][1],b],["exit",a[k][1],b]])):j=0,vL(a,c-1,k-c+3,i),k=c+i.length-j-2;break}}for(k=-1;++k<a.length;)"attentionSequence"===a[k][1].type&&(a[k][1].type="data");return a},tokenize:function(a,b){let c,d=this.parser.constructs.attentionMarkers.null,e=this.previous,f=wh(e);return function(g){return c=g,a.enter("attentionSequence"),function g(h){if(h===c)return a.consume(h),g;let i=a.exit("attentionSequence"),j=wh(h),k=!j||2===j&&f||d.includes(h),l=!f||2===f&&j||d.includes(e);return i._open=!!(42===c?k:k&&(f||!l)),i._close=!!(42===c?l:l&&(j||!k)),b(h)}(g)}}};function wk(a,b){a.column+=b,a.offset+=b,a._bufferIndex+=b}let wl={continuation:{tokenize:function(a,b,c){let d=this;return function(b){return vY(b)?v0(a,e,"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):e(b)};function e(d){return a.attempt(wl,b,c)(d)}}},exit:function(a){a.exit("blockQuote")},name:"blockQuote",tokenize:function(a,b,c){let d=this;return function(b){if(62===b){let c=d.containerState;return c.open||(a.enter("blockQuote",{_container:!0}),c.open=!0),a.enter("blockQuotePrefix"),a.enter("blockQuoteMarker"),a.consume(b),a.exit("blockQuoteMarker"),e}return c(b)};function e(c){return vY(c)?(a.enter("blockQuotePrefixWhitespace"),a.consume(c),a.exit("blockQuotePrefixWhitespace"),a.exit("blockQuotePrefix"),b):(a.exit("blockQuotePrefix"),b(c))}}},wm={name:"characterEscape",tokenize:function(a,b,c){return function(b){return a.enter("characterEscape"),a.enter("escapeMarker"),a.consume(b),a.exit("escapeMarker"),d};function d(d){return vV(d)?(a.enter("characterEscapeValue"),a.consume(d),a.exit("characterEscapeValue"),a.exit("characterEscape"),b):c(d)}}},wn={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},wo={}.hasOwnProperty;function wp(a){return!!wo.call(wn,a)&&wn[a]}let wq={name:"characterReference",tokenize:function(a,b,c){let d,e,f=this,g=0;return function(b){return a.enter("characterReference"),a.enter("characterReferenceMarker"),a.consume(b),a.exit("characterReferenceMarker"),h};function h(b){return 35===b?(a.enter("characterReferenceMarkerNumeric"),a.consume(b),a.exit("characterReferenceMarkerNumeric"),i):(a.enter("characterReferenceValue"),d=31,e=vQ,j(b))}function i(b){return 88===b||120===b?(a.enter("characterReferenceMarkerHexadecimal"),a.consume(b),a.exit("characterReferenceMarkerHexadecimal"),a.enter("characterReferenceValue"),d=6,e=vU,j):(a.enter("characterReferenceValue"),d=7,e=vT,j(b))}function j(h){if(59===h&&g){let d=a.exit("characterReferenceValue");return e!==vQ||wp(f.sliceSerialize(d))?(a.enter("characterReferenceMarker"),a.consume(h),a.exit("characterReferenceMarker"),a.exit("characterReference"),b):c(h)}return e(h)&&g++<d?(a.consume(h),j):c(h)}}},wr={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return null===b?c(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},ws={concrete:!0,name:"codeFenced",tokenize:function(a,b,c){let d,e=this,f={partial:!0,tokenize:function(a,b,c){let f=0;return function(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),g};function g(b){return a.enter("codeFencedFence"),vY(b)?v0(a,i,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):i(b)}function i(b){return b===d?(a.enter("codeFencedFenceSequence"),function b(e){return e===d?(f++,a.consume(e),b):f>=h?(a.exit("codeFencedFenceSequence"),vY(e)?v0(a,j,"whitespace")(e):j(e)):c(e)}(b)):c(b)}function j(d){return null===d||vW(d)?(a.exit("codeFencedFence"),b(d)):c(d)}}},g=0,h=0;return function(b){var f;let j;return f=b,g=(j=e.events[e.events.length-1])&&"linePrefix"===j[1].type?j[2].sliceSerialize(j[1],!0).length:0,d=f,a.enter("codeFenced"),a.enter("codeFencedFence"),a.enter("codeFencedFenceSequence"),function b(e){return e===d?(h++,a.consume(e),b):h<3?c(e):(a.exit("codeFencedFenceSequence"),vY(e)?v0(a,i,"whitespace")(e):i(e))}(f)};function i(f){return null===f||vW(f)?(a.exit("codeFencedFence"),e.interrupt?b(f):a.check(wr,k,o)(f)):(a.enter("codeFencedFenceInfo"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||vW(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),i(e)):vY(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),v0(a,j,"whitespace")(e)):96===e&&e===d?c(e):(a.consume(e),b)}(f))}function j(b){return null===b||vW(b)?i(b):(a.enter("codeFencedFenceMeta"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||vW(e)?(a.exit("chunkString"),a.exit("codeFencedFenceMeta"),i(e)):96===e&&e===d?c(e):(a.consume(e),b)}(b))}function k(b){return a.attempt(f,o,l)(b)}function l(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m}function m(b){return g>0&&vY(b)?v0(a,n,"linePrefix",g+1)(b):n(b)}function n(b){return null===b||vW(b)?a.check(wr,k,o)(b):(a.enter("codeFlowValue"),function b(c){return null===c||vW(c)?(a.exit("codeFlowValue"),n(c)):(a.consume(c),b)}(b))}function o(c){return a.exit("codeFenced"),b(c)}}},wt={name:"codeIndented",tokenize:function(a,b,c){let d=this;return function(b){return a.enter("codeIndented"),v0(a,e,"linePrefix",5)(b)};function e(b){let e=d.events[d.events.length-1];return e&&"linePrefix"===e[1].type&&e[2].sliceSerialize(e[1],!0).length>=4?function b(c){return null===c?f(c):vW(c)?a.attempt(wu,b,f)(c):(a.enter("codeFlowValue"),function c(d){return null===d||vW(d)?(a.exit("codeFlowValue"),b(d)):(a.consume(d),c)}(c))}(b):c(b)}function f(c){return a.exit("codeIndented"),b(c)}}},wu={partial:!0,tokenize:function(a,b,c){let d=this;return e;function e(b){return d.parser.lazy[d.now().line]?c(b):vW(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):v0(a,f,"linePrefix",5)(b)}function f(a){let f=d.events[d.events.length-1];return f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(a):vW(a)?e(a):c(a)}}};function wv(a,b,c,d,e,f,g,h,i){let j=i||1/0,k=0;return function(b){return 60===b?(a.enter(d),a.enter(e),a.enter(f),a.consume(b),a.exit(f),l):null===b||32===b||41===b||vS(b)?c(b):(a.enter(d),a.enter(g),a.enter(h),a.enter("chunkString",{contentType:"string"}),o(b))};function l(c){return 62===c?(a.enter(f),a.consume(c),a.exit(f),a.exit(e),a.exit(d),b):(a.enter(h),a.enter("chunkString",{contentType:"string"}),m(c))}function m(b){return 62===b?(a.exit("chunkString"),a.exit(h),l(b)):null===b||60===b||vW(b)?c(b):(a.consume(b),92===b?n:m)}function n(b){return 60===b||62===b||92===b?(a.consume(b),m):m(b)}function o(e){return!k&&(null===e||41===e||vX(e))?(a.exit("chunkString"),a.exit(h),a.exit(g),a.exit(d),b(e)):k<j&&40===e?(a.consume(e),k++,o):41===e?(a.consume(e),k--,o):null===e||32===e||40===e||vS(e)?c(e):(a.consume(e),92===e?p:o)}function p(b){return 40===b||41===b||92===b?(a.consume(b),o):o(b)}}function ww(a,b,c,d,e,f){let g,h=this,i=0;return function(b){return a.enter(d),a.enter(e),a.consume(b),a.exit(e),a.enter(f),j};function j(l){return i>999||null===l||91===l||93===l&&!g||94===l&&!i&&"_hiddenFootnoteSupport"in h.parser.constructs?c(l):93===l?(a.exit(f),a.enter(e),a.consume(l),a.exit(e),a.exit(d),b):vW(l)?(a.enter("lineEnding"),a.consume(l),a.exit("lineEnding"),j):(a.enter("chunkString",{contentType:"string"}),k(l))}function k(b){return null===b||91===b||93===b||vW(b)||i++>999?(a.exit("chunkString"),j(b)):(a.consume(b),g||(g=!vY(b)),92===b?l:k)}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}}function wx(a,b,c,d,e,f){let g;return function(b){return 34===b||39===b||40===b?(a.enter(d),a.enter(e),a.consume(b),a.exit(e),g=40===b?41:b,h):c(b)};function h(c){return c===g?(a.enter(e),a.consume(c),a.exit(e),a.exit(d),b):(a.enter(f),i(c))}function i(b){return b===g?(a.exit(f),h(g)):null===b?c(b):vW(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),v0(a,i,"linePrefix")):(a.enter("chunkString",{contentType:"string"}),j(b))}function j(b){return b===g||null===b||vW(b)?(a.exit("chunkString"),i(b)):(a.consume(b),92===b?k:j)}function k(b){return b===g||92===b?(a.consume(b),j):j(b)}}function wy(a,b){let c;return function d(e){return vW(e)?(a.enter("lineEnding"),a.consume(e),a.exit("lineEnding"),c=!0,d):vY(e)?v0(a,d,c?"linePrefix":"lineSuffix")(e):b(e)}}function wz(a){return a.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let wA={partial:!0,tokenize:function(a,b,c){return function(b){return vX(b)?wy(a,d)(b):c(b)};function d(b){return wx(a,e,c,"definitionTitle","definitionTitleMarker","definitionTitleString")(b)}function e(b){return vY(b)?v0(a,f,"whitespace")(b):f(b)}function f(a){return null===a||vW(a)?b(a):c(a)}}},wB=["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"],wC=["pre","script","style","textarea"],wD={partial:!0,tokenize:function(a,b,c){return function(d){return a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),a.attempt(v4,b,c)}}},wE={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return vW(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):c(b)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},wF={name:"labelEnd",resolveAll:function(a){let b=-1,c=[];for(;++b<a.length;){let d=a[b][1];if(c.push(a[b]),"labelImage"===d.type||"labelLink"===d.type||"labelEnd"===d.type){let a="labelImage"===d.type?4:2;d.type="data",b+=a}}return a.length!==c.length&&vL(a,0,a.length,c),a},resolveTo:function(a,b){let c,d,e,f,g=a.length,h=0;for(;g--;)if(c=a[g][1],d){if("link"===c.type||"labelLink"===c.type&&c._inactive)break;"enter"===a[g][0]&&"labelLink"===c.type&&(c._inactive=!0)}else if(e){if("enter"===a[g][0]&&("labelImage"===c.type||"labelLink"===c.type)&&!c._balanced&&(d=g,"labelLink"!==c.type)){h=2;break}}else"labelEnd"===c.type&&(e=g);let i={type:"labelLink"===a[d][1].type?"link":"image",start:{...a[d][1].start},end:{...a[a.length-1][1].end}},j={type:"label",start:{...a[d][1].start},end:{...a[e][1].end}},k={type:"labelText",start:{...a[d+h+2][1].end},end:{...a[e-2][1].start}};return f=vM(f=[["enter",i,b],["enter",j,b]],a.slice(d+1,d+h+3)),f=vM(f,[["enter",k,b]]),f=vM(f,wi(b.parser.constructs.insideSpan.null,a.slice(d+h+4,e-3),b)),f=vM(f,[["exit",k,b],a[e-2],a[e-1],["exit",j,b]]),f=vM(f,a.slice(e+1)),f=vM(f,[["exit",i,b]]),vL(a,d,a.length,f),a},tokenize:function(a,b,c){let d,e,f=this,g=f.events.length;for(;g--;)if(("labelImage"===f.events[g][1].type||"labelLink"===f.events[g][1].type)&&!f.events[g][1]._balanced){d=f.events[g][1];break}return function(b){return d?d._inactive?k(b):(e=f.parser.defined.includes(wz(f.sliceSerialize({start:d.end,end:f.now()}))),a.enter("labelEnd"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelEnd"),h):c(b)};function h(b){return 40===b?a.attempt(wG,j,e?j:k)(b):91===b?a.attempt(wH,j,e?i:k)(b):e?j(b):k(b)}function i(b){return a.attempt(wI,j,k)(b)}function j(a){return b(a)}function k(a){return d._balanced=!0,c(a)}}},wG={tokenize:function(a,b,c){return function(b){return a.enter("resource"),a.enter("resourceMarker"),a.consume(b),a.exit("resourceMarker"),d};function d(b){return vX(b)?wy(a,e)(b):e(b)}function e(b){return 41===b?j(b):wv(a,f,g,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function f(b){return vX(b)?wy(a,h)(b):j(b)}function g(a){return c(a)}function h(b){return 34===b||39===b||40===b?wx(a,i,c,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):j(b)}function i(b){return vX(b)?wy(a,j)(b):j(b)}function j(d){return 41===d?(a.enter("resourceMarker"),a.consume(d),a.exit("resourceMarker"),a.exit("resource"),b):c(d)}}},wH={tokenize:function(a,b,c){let d=this;return function(b){return ww.call(d,a,e,f,"reference","referenceMarker","referenceString")(b)};function e(a){return d.parser.defined.includes(wz(d.sliceSerialize(d.events[d.events.length-1][1]).slice(1,-1)))?b(a):c(a)}function f(a){return c(a)}}},wI={tokenize:function(a,b,c){return function(b){return a.enter("reference"),a.enter("referenceMarker"),a.consume(b),a.exit("referenceMarker"),d};function d(d){return 93===d?(a.enter("referenceMarker"),a.consume(d),a.exit("referenceMarker"),a.exit("reference"),b):c(d)}}},wJ={name:"labelStartImage",resolveAll:wF.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelImage"),a.enter("labelImageMarker"),a.consume(b),a.exit("labelImageMarker"),e};function e(b){return 91===b?(a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelImage"),f):c(b)}function f(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},wK={name:"labelStartLink",resolveAll:wF.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelLink"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelLink"),e};function e(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},wL={name:"lineEnding",tokenize:function(a,b){return function(c){return a.enter("lineEnding"),a.consume(c),a.exit("lineEnding"),v0(a,b,"linePrefix")}}},wM={name:"thematicBreak",tokenize:function(a,b,c){let d,e=0;return function(f){var g;return a.enter("thematicBreak"),d=g=f,function f(g){return g===d?(a.enter("thematicBreakSequence"),function b(c){return c===d?(a.consume(c),e++,b):(a.exit("thematicBreakSequence"),vY(c)?v0(a,f,"whitespace")(c):f(c))}(g)):e>=3&&(null===g||vW(g))?(a.exit("thematicBreak"),b(g)):c(g)}(g)}}},wN={continuation:{tokenize:function(a,b,c){let d=this;return d.containerState._closeFlow=void 0,a.check(v4,function(c){return d.containerState.furtherBlankLines=d.containerState.furtherBlankLines||d.containerState.initialBlankLine,v0(a,b,"listItemIndent",d.containerState.size+1)(c)},function(c){return d.containerState.furtherBlankLines||!vY(c)?(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,e(c)):(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,a.attempt(wP,b,e)(c))});function e(e){return d.containerState._closeFlow=!0,d.interrupt=void 0,v0(a,a.attempt(wN,b,c),"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(e)}}},exit:function(a){a.exit(this.containerState.type)},name:"list",tokenize:function(a,b,c){let d=this,e=d.events[d.events.length-1],f=e&&"linePrefix"===e[1].type?e[2].sliceSerialize(e[1],!0).length:0,g=0;return function(b){let e=d.containerState.type||(42===b||43===b||45===b?"listUnordered":"listOrdered");if("listUnordered"===e?!d.containerState.marker||b===d.containerState.marker:vT(b)){if(d.containerState.type||(d.containerState.type=e,a.enter(e,{_container:!0})),"listUnordered"===e)return a.enter("listItemPrefix"),42===b||45===b?a.check(wM,c,h)(b):h(b);if(!d.interrupt||49===b)return a.enter("listItemPrefix"),a.enter("listItemValue"),function b(e){return vT(e)&&++g<10?(a.consume(e),b):(!d.interrupt||g<2)&&(d.containerState.marker?e===d.containerState.marker:41===e||46===e)?(a.exit("listItemValue"),h(e)):c(e)}(b)}return c(b)};function h(b){return a.enter("listItemMarker"),a.consume(b),a.exit("listItemMarker"),d.containerState.marker=d.containerState.marker||b,a.check(v4,d.interrupt?c:i,a.attempt(wO,k,j))}function i(a){return d.containerState.initialBlankLine=!0,f++,k(a)}function j(b){return vY(b)?(a.enter("listItemPrefixWhitespace"),a.consume(b),a.exit("listItemPrefixWhitespace"),k):c(b)}function k(c){return d.containerState.size=f+d.sliceSerialize(a.exit("listItemPrefix"),!0).length,b(c)}}},wO={partial:!0,tokenize:function(a,b,c){let d=this;return v0(a,function(a){let e=d.events[d.events.length-1];return!vY(a)&&e&&"listItemPrefixWhitespace"===e[1].type?b(a):c(a)},"listItemPrefixWhitespace",d.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},wP={partial:!0,tokenize:function(a,b,c){let d=this;return v0(a,function(a){let e=d.events[d.events.length-1];return e&&"listItemIndent"===e[1].type&&e[2].sliceSerialize(e[1],!0).length===d.containerState.size?b(a):c(a)},"listItemIndent",d.containerState.size+1)}},wQ={name:"setextUnderline",resolveTo:function(a,b){let c,d,e,f=a.length;for(;f--;)if("enter"===a[f][0]){if("content"===a[f][1].type){c=f;break}"paragraph"===a[f][1].type&&(d=f)}else"content"===a[f][1].type&&a.splice(f,1),e||"definition"!==a[f][1].type||(e=f);let g={type:"setextHeading",start:{...a[c][1].start},end:{...a[a.length-1][1].end}};return a[d][1].type="setextHeadingText",e?(a.splice(d,0,["enter",g,b]),a.splice(e+1,0,["exit",a[c][1],b]),a[c][1].end={...a[e][1].end}):a[c][1]=g,a.push(["exit",g,b]),a},tokenize:function(a,b,c){let d,e=this;return function(b){var g;let h,i=e.events.length;for(;i--;)if("lineEnding"!==e.events[i][1].type&&"linePrefix"!==e.events[i][1].type&&"content"!==e.events[i][1].type){h="paragraph"===e.events[i][1].type;break}return!e.parser.lazy[e.now().line]&&(e.interrupt||h)?(a.enter("setextHeadingLine"),d=b,g=b,a.enter("setextHeadingLineSequence"),function b(c){return c===d?(a.consume(c),b):(a.exit("setextHeadingLineSequence"),vY(c)?v0(a,f,"lineSuffix")(c):f(c))}(g)):c(b)};function f(d){return null===d||vW(d)?(a.exit("setextHeadingLine"),b(d)):c(d)}}};a.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(a,b,c){let d,e=this;return function(b){var d;return a.enter("definition"),d=b,ww.call(e,a,f,c,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)};function f(b){return(d=wz(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)),58===b)?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),g):c(b)}function g(b){return vX(b)?wy(a,h)(b):h(b)}function h(b){return wv(a,i,c,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function i(b){return a.attempt(wA,j,j)(b)}function j(b){return vY(b)?v0(a,k,"whitespace")(b):k(b)}function k(f){return null===f||vW(f)?(a.exit("definition"),e.parser.defined.push(d),b(f)):c(f)}}}},"disable",0,{null:[]},"document",0,{42:wN,43:wN,45:wN,48:wN,49:wN,50:wN,51:wN,52:wN,53:wN,54:wN,55:wN,56:wN,57:wN,62:wl},"flow",0,{35:{name:"headingAtx",resolve:function(a,b){let c,d,e=a.length-2,f=3;return"whitespace"===a[3][1].type&&(f+=2),e-2>f&&"whitespace"===a[e][1].type&&(e-=2),"atxHeadingSequence"===a[e][1].type&&(f===e-1||e-4>f&&"whitespace"===a[e-2][1].type)&&(e-=f+1===e?2:4),e>f&&(c={type:"atxHeadingText",start:a[f][1].start,end:a[e][1].end},d={type:"chunkText",start:a[f][1].start,end:a[e][1].end,contentType:"text"},vL(a,f,e-f+1,[["enter",c,b],["enter",d,b],["exit",d,b],["exit",c,b]])),a},tokenize:function(a,b,c){let d=0;return function(e){var f;return a.enter("atxHeading"),f=e,a.enter("atxHeadingSequence"),function e(f){return 35===f&&d++<6?(a.consume(f),e):null===f||vX(f)?(a.exit("atxHeadingSequence"),function c(d){return 35===d?(a.enter("atxHeadingSequence"),function b(d){return 35===d?(a.consume(d),b):(a.exit("atxHeadingSequence"),c(d))}(d)):null===d||vW(d)?(a.exit("atxHeading"),b(d)):vY(d)?v0(a,c,"whitespace")(d):(a.enter("atxHeadingText"),function b(d){return null===d||35===d||vX(d)?(a.exit("atxHeadingText"),c(d)):(a.consume(d),b)}(d))}(f)):c(f)}(f)}}},42:wM,45:[wQ,wM],60:{concrete:!0,name:"htmlFlow",resolveTo:function(a){let b=a.length;for(;b--&&("enter"!==a[b][0]||"htmlFlow"!==a[b][1].type););return b>1&&"linePrefix"===a[b-2][1].type&&(a[b][1].start=a[b-2][1].start,a[b+1][1].start=a[b-2][1].start,a.splice(b-2,2)),a},tokenize:function(a,b,c){let d,e,f,g,h,i=this;return function(b){var c;return c=b,a.enter("htmlFlow"),a.enter("htmlFlowData"),a.consume(c),j};function j(g){return 33===g?(a.consume(g),k):47===g?(a.consume(g),e=!0,n):63===g?(a.consume(g),d=3,i.interrupt?b:G):vP(g)?(a.consume(g),f=String.fromCharCode(g),o):c(g)}function k(e){return 45===e?(a.consume(e),d=2,l):91===e?(a.consume(e),d=5,g=0,m):vP(e)?(a.consume(e),d=4,i.interrupt?b:G):c(e)}function l(d){return 45===d?(a.consume(d),i.interrupt?b:G):c(d)}function m(d){let e="CDATA[";return d===e.charCodeAt(g++)?(a.consume(d),g===e.length)?i.interrupt?b:y:m:c(d)}function n(b){return vP(b)?(a.consume(b),f=String.fromCharCode(b),o):c(b)}function o(g){if(null===g||47===g||62===g||vX(g)){let h=47===g,j=f.toLowerCase();return!h&&!e&&wC.includes(j)?(d=1,i.interrupt?b(g):y(g)):wB.includes(f.toLowerCase())?(d=6,h)?(a.consume(g),p):i.interrupt?b(g):y(g):(d=7,i.interrupt&&!i.parser.lazy[i.now().line]?c(g):e?function b(c){return vY(c)?(a.consume(c),b):w(c)}(g):q(g))}return 45===g||vQ(g)?(a.consume(g),f+=String.fromCharCode(g),o):c(g)}function p(d){return 62===d?(a.consume(d),i.interrupt?b:y):c(d)}function q(b){return 47===b?(a.consume(b),w):58===b||95===b||vP(b)?(a.consume(b),r):vY(b)?(a.consume(b),q):w(b)}function r(b){return 45===b||46===b||58===b||95===b||vQ(b)?(a.consume(b),r):s(b)}function s(b){return 61===b?(a.consume(b),t):vY(b)?(a.consume(b),s):q(b)}function t(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),h=b,u):vY(b)?(a.consume(b),t):function b(c){return null===c||34===c||39===c||47===c||60===c||61===c||62===c||96===c||vX(c)?s(c):(a.consume(c),b)}(b)}function u(b){return b===h?(a.consume(b),h=null,v):null===b||vW(b)?c(b):(a.consume(b),u)}function v(a){return 47===a||62===a||vY(a)?q(a):c(a)}function w(b){return 62===b?(a.consume(b),x):c(b)}function x(b){return null===b||vW(b)?y(b):vY(b)?(a.consume(b),x):c(b)}function y(b){return 45===b&&2===d?(a.consume(b),C):60===b&&1===d?(a.consume(b),D):62===b&&4===d?(a.consume(b),H):63===b&&3===d?(a.consume(b),G):93===b&&5===d?(a.consume(b),F):vW(b)&&(6===d||7===d)?(a.exit("htmlFlowData"),a.check(wD,I,z)(b)):null===b||vW(b)?(a.exit("htmlFlowData"),z(b)):(a.consume(b),y)}function z(b){return a.check(wE,A,I)(b)}function A(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),B}function B(b){return null===b||vW(b)?z(b):(a.enter("htmlFlowData"),y(b))}function C(b){return 45===b?(a.consume(b),G):y(b)}function D(b){return 47===b?(a.consume(b),f="",E):y(b)}function E(b){if(62===b){let c=f.toLowerCase();return wC.includes(c)?(a.consume(b),H):y(b)}return vP(b)&&f.length<8?(a.consume(b),f+=String.fromCharCode(b),E):y(b)}function F(b){return 93===b?(a.consume(b),G):y(b)}function G(b){return 62===b?(a.consume(b),H):45===b&&2===d?(a.consume(b),G):y(b)}function H(b){return null===b||vW(b)?(a.exit("htmlFlowData"),I(b)):(a.consume(b),H)}function I(c){return a.exit("htmlFlow"),b(c)}}},61:wQ,95:wM,96:ws,126:ws},"flowInitial",0,{[-2]:wt,[-1]:wt,32:wt},"insideSpan",0,{null:[wj,wb]},"string",0,{38:wq,92:wm},"text",0,{[-5]:wL,[-4]:wL,[-3]:wL,33:wJ,38:wq,42:wj,60:[{name:"autolink",tokenize:function(a,b,c){let d=0;return function(b){return a.enter("autolink"),a.enter("autolinkMarker"),a.consume(b),a.exit("autolinkMarker"),a.enter("autolinkProtocol"),e};function e(b){return vP(b)?(a.consume(b),f):64===b?c(b):h(b)}function f(b){return 43===b||45===b||46===b||vQ(b)?(d=1,function b(c){return 58===c?(a.consume(c),d=0,g):(43===c||45===c||46===c||vQ(c))&&d++<32?(a.consume(c),b):(d=0,h(c))}(b)):h(b)}function g(d){return 62===d?(a.exit("autolinkProtocol"),a.enter("autolinkMarker"),a.consume(d),a.exit("autolinkMarker"),a.exit("autolink"),b):null===d||32===d||60===d||vS(d)?c(d):(a.consume(d),g)}function h(b){return 64===b?(a.consume(b),i):vR(b)?(a.consume(b),h):c(b)}function i(e){return vQ(e)?function e(f){return 46===f?(a.consume(f),d=0,i):62===f?(a.exit("autolinkProtocol").type="autolinkEmail",a.enter("autolinkMarker"),a.consume(f),a.exit("autolinkMarker"),a.exit("autolink"),b):function b(f){if((45===f||vQ(f))&&d++<63){let c=45===f?b:e;return a.consume(f),c}return c(f)}(f)}(e):c(e)}}},{name:"htmlText",tokenize:function(a,b,c){let d,e,f,g=this;return function(b){return a.enter("htmlText"),a.enter("htmlTextData"),a.consume(b),h};function h(b){return 33===b?(a.consume(b),i):47===b?(a.consume(b),u):63===b?(a.consume(b),s):vP(b)?(a.consume(b),w):c(b)}function i(b){return 45===b?(a.consume(b),j):91===b?(a.consume(b),e=0,n):vP(b)?(a.consume(b),r):c(b)}function j(b){return 45===b?(a.consume(b),m):c(b)}function k(b){return null===b?c(b):45===b?(a.consume(b),l):vW(b)?(f=k,E(b)):(a.consume(b),k)}function l(b){return 45===b?(a.consume(b),m):k(b)}function m(a){return 62===a?D(a):45===a?l(a):k(a)}function n(b){let d="CDATA[";return b===d.charCodeAt(e++)?(a.consume(b),e===d.length?o:n):c(b)}function o(b){return null===b?c(b):93===b?(a.consume(b),p):vW(b)?(f=o,E(b)):(a.consume(b),o)}function p(b){return 93===b?(a.consume(b),q):o(b)}function q(b){return 62===b?D(b):93===b?(a.consume(b),q):o(b)}function r(b){return null===b||62===b?D(b):vW(b)?(f=r,E(b)):(a.consume(b),r)}function s(b){return null===b?c(b):63===b?(a.consume(b),t):vW(b)?(f=s,E(b)):(a.consume(b),s)}function t(a){return 62===a?D(a):s(a)}function u(b){return vP(b)?(a.consume(b),v):c(b)}function v(b){return 45===b||vQ(b)?(a.consume(b),v):function b(c){return vW(c)?(f=b,E(c)):vY(c)?(a.consume(c),b):D(c)}(b)}function w(b){return 45===b||vQ(b)?(a.consume(b),w):47===b||62===b||vX(b)?x(b):c(b)}function x(b){return 47===b?(a.consume(b),D):58===b||95===b||vP(b)?(a.consume(b),y):vW(b)?(f=x,E(b)):vY(b)?(a.consume(b),x):D(b)}function y(b){return 45===b||46===b||58===b||95===b||vQ(b)?(a.consume(b),y):function b(c){return 61===c?(a.consume(c),z):vW(c)?(f=b,E(c)):vY(c)?(a.consume(c),b):x(c)}(b)}function z(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),d=b,A):vW(b)?(f=z,E(b)):vY(b)?(a.consume(b),z):(a.consume(b),B)}function A(b){return b===d?(a.consume(b),d=void 0,C):null===b?c(b):vW(b)?(f=A,E(b)):(a.consume(b),A)}function B(b){return null===b||34===b||39===b||60===b||61===b||96===b?c(b):47===b||62===b||vX(b)?x(b):(a.consume(b),B)}function C(a){return 47===a||62===a||vX(a)?x(a):c(a)}function D(d){return 62===d?(a.consume(d),a.exit("htmlTextData"),a.exit("htmlText"),b):c(d)}function E(b){return a.exit("htmlTextData"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),F}function F(b){return vY(b)?v0(a,G,"linePrefix",g.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):G(b)}function G(b){return a.enter("htmlTextData"),f(b)}}}],91:wK,92:[{name:"hardBreakEscape",tokenize:function(a,b,c){return function(b){return a.enter("hardBreakEscape"),a.consume(b),d};function d(d){return vW(d)?(a.exit("hardBreakEscape"),b(d)):c(d)}}},wm],93:wF,95:wj,96:{name:"codeText",previous:function(a){return 96!==a||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(a){let b,c,d=a.length-4,e=3;if(("lineEnding"===a[3][1].type||"space"===a[e][1].type)&&("lineEnding"===a[d][1].type||"space"===a[d][1].type)){for(b=e;++b<d;)if("codeTextData"===a[b][1].type){a[e][1].type="codeTextPadding",a[d][1].type="codeTextPadding",e+=2,d-=2;break}}for(b=e-1,d++;++b<=d;)void 0===c?b!==d&&"lineEnding"!==a[b][1].type&&(c=b):(b===d||"lineEnding"===a[b][1].type)&&(a[c][1].type="codeTextData",b!==c+2&&(a[c][1].end=a[b-1][1].end,a.splice(c+2,b-c-2),d-=b-c-2,b=c+2),c=void 0);return a},tokenize:function(a,b,c){let d,e,f=0;return function(b){return a.enter("codeText"),a.enter("codeTextSequence"),function b(c){return 96===c?(a.consume(c),f++,b):(a.exit("codeTextSequence"),g(c))}(b)};function g(i){return null===i?c(i):32===i?(a.enter("space"),a.consume(i),a.exit("space"),g):96===i?(e=a.enter("codeTextSequence"),d=0,function c(g){return 96===g?(a.consume(g),d++,c):d===f?(a.exit("codeTextSequence"),a.exit("codeText"),b(g)):(e.type="codeTextData",h(g))}(i)):vW(i)?(a.enter("lineEnding"),a.consume(i),a.exit("lineEnding"),g):(a.enter("codeTextData"),h(i))}function h(b){return null===b||32===b||96===b||vW(b)?(a.exit("codeTextData"),g(b)):(a.consume(b),h)}}}}],248293);var wR=a.i(248293);let wS=/[\0\t\n\r]/g;function wT(a,b){let c=Number.parseInt(a,b);return c<9||11===c||c>13&&c<32||c>126&&c<160||c>55295&&c<57344||c>64975&&c<65008||(65535&c)==65535||(65535&c)==65534||c>1114111?"�":String.fromCodePoint(c)}let wU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wV(a,b,c){if(b)return b;if(35===c.charCodeAt(0)){let a=c.charCodeAt(1),b=120===a||88===a;return wT(c.slice(b?2:1),b?16:10)}return wp(c)||a}let wW={}.hasOwnProperty;function wX(a){return{line:a.line,column:a.column,offset:a.offset}}function wY(a,b){if(a)throw Error("Cannot close `"+a.type+"` ("+vo({start:a.start,end:a.end})+"): a different token (`"+b.type+"`, "+vo({start:b.start,end:b.end})+") is open");throw Error("Cannot close document, a token (`"+b.type+"`, "+vo({start:b.start,end:b.end})+") is still open")}function wZ(a){let b=this;b.parser=function(c){var d,e;let f,g,h,i;return"object"==typeof(d={...b.data("settings"),...a,extensions:b.data("micromarkExtensions")||[],mdastExtensions:b.data("fromMarkdownExtensions")||[]})&&(e=d,d=void 0),(function(a){let b={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(r),autolinkProtocol:j,autolinkEmail:j,atxHeading:d(o),blockQuote:d(function(){return{type:"blockquote",children:[]}}),characterEscape:j,characterReference:j,codeFenced:d(n),codeFencedFenceInfo:e,codeFencedFenceMeta:e,codeIndented:d(n,e),codeText:d(function(){return{type:"inlineCode",value:""}},e),codeTextData:j,data:j,codeFlowValue:j,definition:d(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:e,definitionLabelString:e,definitionTitleString:e,emphasis:d(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:d(p),hardBreakTrailing:d(p),htmlFlow:d(q,e),htmlFlowData:j,htmlText:d(q,e),htmlTextData:j,image:d(function(){return{type:"image",title:null,url:"",alt:null}}),label:e,link:d(r),listItem:d(function(a){return{type:"listItem",spread:a._spread,checked:null,children:[]}}),listItemValue:function(a){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(a),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:d(s,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:d(s),paragraph:d(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:e,resourceDestinationString:e,resourceTitleString:e,setextHeading:d(o),strong:d(function(){return{type:"strong",children:[]}}),thematicBreak:d(function(){return{type:"thematicBreak"}})},exit:{atxHeading:g(),atxHeadingSequence:function(a){let b=this.stack[this.stack.length-1];b.depth||(b.depth=this.sliceSerialize(a).length)},autolink:g(),autolinkEmail:function(a){k.call(this,a),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(a)},autolinkProtocol:function(a){k.call(this,a),this.stack[this.stack.length-1].url=this.sliceSerialize(a)},blockQuote:g(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(a){let b,c=this.sliceSerialize(a),d=this.data.characterReferenceType;d?(b=wT(c,"characterReferenceMarkerNumeric"===d?10:16),this.data.characterReferenceType=void 0):b=wp(c);let e=this.stack[this.stack.length-1];e.value+=b},characterReference:function(a){this.stack.pop().position.end=wX(a.end)},codeFenced:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let a=this.resume();this.stack[this.stack.length-1].lang=a},codeFencedFenceMeta:function(){let a=this.resume();this.stack[this.stack.length-1].meta=a},codeFlowValue:k,codeIndented:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/(\r?\n|\r)$/g,"")}),codeText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),codeTextData:k,data:k,definition:g(),definitionDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},definitionLabelString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=wz(this.sliceSerialize(a)).toLowerCase()},definitionTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},emphasis:g(),hardBreakEscape:g(l),hardBreakTrailing:g(l),htmlFlow:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlFlowData:k,htmlText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlTextData:k,image:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),label:function(){let a=this.stack[this.stack.length-1],b=this.resume(),c=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===c.type?c.children=a.children:c.alt=b},labelText:function(a){let b=this.sliceSerialize(a),c=this.stack[this.stack.length-2];c.label=b.replace(wU,wV),c.identifier=wz(b).toLowerCase()},lineEnding:function(a){let c=this.stack[this.stack.length-1];if(this.data.atHardBreak){c.children[c.children.length-1].position.end=wX(a.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&b.canContainEols.includes(c.type)&&(j.call(this,a),k.call(this,a))},link:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=wz(this.sliceSerialize(a)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},resourceTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},resource:function(){this.data.inReference=void 0},setextHeading:g(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(a){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(a).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:g(),thematicBreak:g()}};!function a(b,c){let d=-1;for(;++d<c.length;){let e=c[d];Array.isArray(e)?a(b,e):function(a,b){let c;for(c in b)if(wW.call(b,c))switch(c){case"canContainEols":{let d=b[c];d&&a[c].push(...d);break}case"transforms":{let d=b[c];d&&a[c].push(...d);break}case"enter":case"exit":{let d=b[c];d&&Object.assign(a[c],d)}}}(b,e)}}(b,(a||{}).mdastExtensions||[]);let c={};return function(a){let d={type:"root",children:[]},g={stack:[d],tokenStack:[],config:b,enter:f,exit:h,buffer:e,resume:i,data:c},j=[],k=-1;for(;++k<a.length;)("listOrdered"===a[k][1].type||"listUnordered"===a[k][1].type)&&("enter"===a[k][0]?j.push(k):k=function(a,b,c){let d,e,f,g,h=b-1,i=-1,j=!1;for(;++h<=c;){let b=a[h];switch(b[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===b[0]?i++:i--,g=void 0;break;case"lineEndingBlank":"enter"===b[0]&&(!d||g||i||f||(f=h),g=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:g=void 0}if(!i&&"enter"===b[0]&&"listItemPrefix"===b[1].type||-1===i&&"exit"===b[0]&&("listUnordered"===b[1].type||"listOrdered"===b[1].type)){if(d){let g=h;for(e=void 0;g--;){let b=a[g];if("lineEnding"===b[1].type||"lineEndingBlank"===b[1].type){if("exit"===b[0])continue;e&&(a[e][1].type="lineEndingBlank",j=!0),b[1].type="lineEnding",e=g}else if("linePrefix"===b[1].type||"blockQuotePrefix"===b[1].type||"blockQuotePrefixWhitespace"===b[1].type||"blockQuoteMarker"===b[1].type||"listItemIndent"===b[1].type);else break}f&&(!e||f<e)&&(d._spread=!0),d.end=Object.assign({},e?a[e][1].start:b[1].end),a.splice(e||h,0,["exit",d,b[2]]),h++,c++}if("listItemPrefix"===b[1].type){let e={type:"listItem",_spread:!1,start:Object.assign({},b[1].start),end:void 0};d=e,a.splice(h,0,["enter",e,b[2]]),h++,c++,f=void 0,g=!0}}}return a[b][1]._spread=j,c}(a,j.pop(),k));for(k=-1;++k<a.length;){let c=b[a[k][0]];wW.call(c,a[k][1].type)&&c[a[k][1].type].call(Object.assign({sliceSerialize:a[k][2].sliceSerialize},g),a[k][1])}if(g.tokenStack.length>0){let a=g.tokenStack[g.tokenStack.length-1];(a[1]||wY).call(g,void 0,a[0])}for(d.position={start:wX(a.length>0?a[0][1].start:{line:1,column:1,offset:0}),end:wX(a.length>0?a[a.length-2][1].end:{line:1,column:1,offset:0})},k=-1;++k<b.transforms.length;)d=b.transforms[k](d)||d;return d};function d(a,b){return function(c){f.call(this,a(c),c),b&&b.call(this,c)}}function e(){this.stack.push({type:"fragment",children:[]})}function f(a,b,c){this.stack[this.stack.length-1].children.push(a),this.stack.push(a),this.tokenStack.push([b,c||void 0]),a.position={start:wX(b.start),end:void 0}}function g(a){return function(b){a&&a.call(this,b),h.call(this,b)}}function h(a,b){let c=this.stack.pop(),d=this.tokenStack.pop();if(d)d[0].type!==a.type&&(b?b.call(this,a,d[0]):(d[1]||wY).call(this,a,d[0]));else throw Error("Cannot close `"+a.type+"` ("+vo({start:a.start,end:a.end})+"): it’s not open");c.position.end=wX(a.end)}function i(){return vI(this.stack.pop())}function j(a){let b=this.stack[this.stack.length-1].children,c=b[b.length-1];c&&"text"===c.type||((c={type:"text",value:""}).position={start:wX(a.start),end:void 0},b.push(c)),this.stack.push(c)}function k(a){let b=this.stack.pop();b.value+=this.sliceSerialize(a),b.position.end=wX(a.end)}function l(){this.data.atHardBreak=!0}function m(a){this.data.characterReferenceType=a.type}function n(){return{type:"code",lang:null,meta:null,value:""}}function o(){return{type:"heading",depth:0,children:[]}}function p(){return{type:"break"}}function q(){return{type:"html",value:""}}function r(){return{type:"link",title:null,url:"",children:[]}}function s(a){return{type:"list",ordered:"listOrdered"===a.type,start:null,spread:a._spread,children:[]}}})(e)(function(a){for(;!v7(a););return a}((function(a){let b={constructs:vO([wR,...(a||{}).extensions||[]]),content:c(v1),defined:[],document:c(v2),flow:c(wa),lazy:{},string:c(wc),text:c(wd)};return b;function c(a){return function(c){return function(a,b,c){let d={_bufferIndex:-1,_index:0,line:c&&c.line||1,column:c&&c.column||1,offset:c&&c.offset||0},e={},f=[],g=[],h=[],i={attempt:o(function(a,b){p(a,b.from)}),check:o(n),consume:function(a){vW(a)?(d.line++,d.column=1,d.offset+=-3===a?2:1,q()):-1!==a&&(d.column++,d.offset++),d._bufferIndex<0?d._index++:(d._bufferIndex++,d._bufferIndex===g[d._index].length&&(d._bufferIndex=-1,d._index++)),j.previous=a},enter:function(a,b){let c=b||{};return c.type=a,c.start=m(),j.events.push(["enter",c,j]),h.push(c),c},exit:function(a){let b=h.pop();return b.end=m(),j.events.push(["exit",b,j]),b},interrupt:o(n,{interrupt:!0})},j={code:null,containerState:{},defineSkip:function(a){e[a.line]=a.column,q()},events:[],now:m,parser:a,previous:null,sliceSerialize:function(a,b){return function(a,b){let c,d=-1,e=[];for(;++d<a.length;){let f,g=a[d];if("string"==typeof g)f=g;else switch(g){case -5:f="\r";break;case -4:f="\n";break;case -3:f="\r\n";break;case -2:f=b?" ":" ";break;case -1:if(!b&&c)continue;f=" ";break;default:f=String.fromCharCode(g)}c=-2===g,e.push(f)}return e.join("")}(l(a),b)},sliceStream:l,write:function(a){return(g=vM(g,a),function(){let a;for(;d._index<g.length;){let c=g[d._index];if("string"==typeof c)for(a=d._index,d._bufferIndex<0&&(d._bufferIndex=0);d._index===a&&d._bufferIndex<c.length;){var b;b=c.charCodeAt(d._bufferIndex),k=k(b)}else k=k(c)}}(),null!==g[g.length-1])?[]:(p(b,0),j.events=wi(f,j.events,j),j.events)}},k=b.tokenize.call(j,i);return b.resolveAll&&f.push(b),j;function l(a){return function(a,b){let c,d=b.start._index,e=b.start._bufferIndex,f=b.end._index,g=b.end._bufferIndex;if(d===f)c=[a[d].slice(e,g)];else{if(c=a.slice(d,f),e>-1){let a=c[0];"string"==typeof a?c[0]=a.slice(e):c.shift()}g>0&&c.push(a[f].slice(0,g))}return c}(g,a)}function m(){let{_bufferIndex:a,_index:b,line:c,column:e,offset:f}=d;return{_bufferIndex:a,_index:b,line:c,column:e,offset:f}}function n(a,b){b.restore()}function o(a,b){return function(c,e,f){var g;let k,l,n,o;return Array.isArray(c)?p(c):"tokenize"in c?p([c]):(g=c,function(a){let b=null!==a&&g[a],c=null!==a&&g.null;return p([...Array.isArray(b)?b:b?[b]:[],...Array.isArray(c)?c:c?[c]:[]])(a)});function p(a){return(k=a,l=0,0===a.length)?f:r(a[l])}function r(a){return function(c){let e,f,g,k,l;return(e=m(),f=j.previous,g=j.currentConstruct,k=j.events.length,l=Array.from(h),o={from:k,restore:function(){d=e,j.previous=f,j.currentConstruct=g,j.events.length=k,h=l,q()}},n=a,a.partial||(j.currentConstruct=a),a.name&&j.parser.constructs.disable.null.includes(a.name))?t(c):a.tokenize.call(b?Object.assign(Object.create(j),b):j,i,s,t)(c)}}function s(b){return a(n,o),e}function t(a){return(o.restore(),++l<k.length)?r(k[l]):f}}}function p(a,b){a.resolveAll&&!f.includes(a)&&f.push(a),a.resolve&&vL(j.events,b,j.events.length-b,a.resolve(j.events.slice(b),j)),a.resolveTo&&(j.events=a.resolveTo(j.events,j))}function q(){d.line in e&&d.column<2&&(d.column=e[d.line],d.offset+=e[d.line]-1)}}(b,a,c)}}})(e).document().write((g=1,h="",i=!0,function(a,b,c){let d,e,j,k,l,m=[];for(a=h+("string"==typeof a?a.toString():new TextDecoder(b||void 0).decode(a)),j=0,h="",i&&(65279===a.charCodeAt(0)&&j++,i=void 0);j<a.length;){if(wS.lastIndex=j,k=(d=wS.exec(a))&&void 0!==d.index?d.index:a.length,l=a.charCodeAt(k),!d){h=a.slice(j);break}if(10===l&&j===k&&f)m.push(-3),f=void 0;else switch(f&&(m.push(-5),f=void 0),j<k&&(m.push(a.slice(j,k)),g+=k-j),l){case 0:m.push(65533),g++;break;case 9:for(e=4*Math.ceil(g/4),m.push(-2);g++<e;)m.push(-1);break;case 10:m.push(-4),g=1;break;default:f=!0,g=1}j=k+1}return c&&(f&&m.push(-5),h&&m.push(h),m.push(null)),m})(c,d,!0))))}}let w$="object"==typeof self?self:globalThis,w_=(a,b)=>{switch(a){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+a)}return new w$[a](b)},w0=a=>{var b;let c,d;return(b=new Map,c=(a,c)=>(b.set(c,a),a),d=e=>{if(b.has(e))return b.get(e);let[f,g]=a[e];switch(f){case 0:case -1:return c(g,e);case 1:{let a=c([],e);for(let b of g)a.push(d(b));return a}case 2:{let a=c({},e);for(let[b,c]of g)a[d(b)]=d(c);return a}case 3:return c(new Date(g),e);case 4:{let{source:a,flags:b}=g;return c(new RegExp(a,b),e)}case 5:{let a=c(new Map,e);for(let[b,c]of g)a.set(d(b),d(c));return a}case 6:{let a=c(new Set,e);for(let b of g)a.add(d(b));return a}case 7:{let{name:a,message:b}=g;return c(w_(a,b),e)}case 8:return c(BigInt(g),e);case"BigInt":return c(Object(BigInt(g)),e);case"ArrayBuffer":return c(new Uint8Array(g).buffer,g);case"DataView":{let{buffer:a}=new Uint8Array(g);return c(new DataView(a),g)}}return c(w_(f,g),e)})(0)},{toString:w1}={},{keys:w2}=Object,w3=a=>{let b=typeof a;if("object"!==b||!a)return[0,b];let c=w1.call(a).slice(8,-1);switch(c){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,c]}return c.includes("Array")?[1,c]:c.includes("Error")?[7,c]:[2,c]},w4=([a,b])=>0===a&&("function"===b||"symbol"===b),w5=(a,{json:b,lossy:c}={})=>{var d,e,f;let g,h,i=[];return(d=!(b||c),e=!!b,f=new Map,g=(a,b)=>{let c=i.push(a)-1;return f.set(b,c),c},h=a=>{if(f.has(a))return f.get(a);let[b,c]=w3(a);switch(b){case 0:{let e=a;switch(c){case"bigint":b=8,e=a.toString();break;case"function":case"symbol":if(d)throw TypeError("unable to serialize "+c);e=null;break;case"undefined":return g([-1],a)}return g([b,e],a)}case 1:{if(c){let b=a;return"DataView"===c?b=new Uint8Array(a.buffer):"ArrayBuffer"===c&&(b=new Uint8Array(a)),g([c,[...b]],a)}let d=[],e=g([b,d],a);for(let b of a)d.push(h(b));return e}case 2:{if(c)switch(c){case"BigInt":return g([c,a.toString()],a);case"Boolean":case"Number":case"String":return g([c,a.valueOf()],a)}if(e&&"toJSON"in a)return h(a.toJSON());let f=[],i=g([b,f],a);for(let b of w2(a))(d||!w4(w3(a[b])))&&f.push([h(b),h(a[b])]);return i}case 3:return g([b,a.toISOString()],a);case 4:{let{source:c,flags:d}=a;return g([b,{source:c,flags:d}],a)}case 5:{let c=[],e=g([b,c],a);for(let[b,e]of a)(d||!(w4(w3(b))||w4(w3(e))))&&c.push([h(b),h(e)]);return e}case 6:{let c=[],e=g([b,c],a);for(let b of a)(d||!w4(w3(b)))&&c.push(h(b));return e}}let{message:i}=a;return g([b,{name:c,message:i}],a)})(a),i},w6="function"==typeof structuredClone?(a,b)=>b&&("json"in b||"lossy"in b)?w0(w5(a,b)):structuredClone(a):(a,b)=>w0(w5(a,b));function w7(a){let b=[],c=-1,d=0,e=0;for(;++c<a.length;){let f=a.charCodeAt(c),g="";if(37===f&&vQ(a.charCodeAt(c+1))&&vQ(a.charCodeAt(c+2)))e=2;else if(f<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(f))||(g=String.fromCharCode(f));else if(f>55295&&f<57344){let b=a.charCodeAt(c+1);f<56320&&b>56319&&b<57344?(g=String.fromCharCode(f,b),e=1):g="�"}else g=String.fromCharCode(f);g&&(b.push(a.slice(d,c),encodeURIComponent(g)),d=c+e+1,g=""),e&&(c+=e,e=0)}return b.join("")+a.slice(d)}function w8(a,b){let c=[{type:"text",value:"↩"}];return b>1&&c.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(b)}]}),c}function w9(a,b){return"Back to reference "+(a+1)+(b>1?"-"+b:"")}let xa=function(a){var b,c;if(null==a)return xc;if("function"==typeof a)return xb(a);if("object"==typeof a){return Array.isArray(a)?function(a){let b=[],c=-1;for(;++c<a.length;)b[c]=xa(a[c]);return xb(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}(a):(b=a,xb(function(a){let c;for(c in b)if(a[c]!==b[c])return!1;return!0}))}if("string"==typeof a){return c=a,xb(function(a){return a&&a.type===c})}throw Error("Expected function, string, or object as test")};function xb(a){return function(b,c,d){return!!(function(a){return null!==a&&"object"==typeof a&&"type"in a}(b)&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function xc(){return!0}let xd=[],xe="skip";function xf(a,b,c,d){let e;"function"==typeof b&&"function"!=typeof c?(d=c,c=b):e=b;let f=xa(e),g=d?-1:1;(function a(e,h,i){let j=e&&"object"==typeof e?e:{};if("string"==typeof j.type){let a="string"==typeof j.tagName?j.tagName:"string"==typeof j.name?j.name:void 0;Object.defineProperty(k,"name",{value:"node (\x1b[33m"+e.type+(a?"<"+a+">":"")+"\x1b[39m)"})}return k;function k(){var j;let k,l,m,n=xd;if((!b||f(e,h,i[i.length-1]||void 0))&&!1===(n=Array.isArray(j=c(e,i))?j:"number"==typeof j?[!0,j]:null==j?xd:[j])[0])return n;if("children"in e&&e.children&&e.children&&n[0]!==xe)for(l=(d?e.children.length:-1)+g,m=i.concat(e);l>-1&&l<e.children.length;){if(!1===(k=a(e.children[l],l,m)())[0])return k;l="number"==typeof k[1]?k[1]:l+g}return n}})(a,void 0,[])()}function xg(a,b,c,d){let e,f,g;"function"==typeof b&&"function"!=typeof c?(f=void 0,g=b,e=c):(f=b,g=c,e=d),xf(a,f,function(a,b){let c=b[b.length-1],d=c?c.children.indexOf(a):void 0;return g(a,d,c)},e)}function xh(a,b){let c=b.referenceType,d="]";if("collapsed"===c?d+="[]":"full"===c&&(d+="["+(b.label||b.identifier)+"]"),"imageReference"===b.type)return[{type:"text",value:"!["+b.alt+d}];let e=a.all(b),f=e[0];f&&"text"===f.type?f.value="["+f.value:e.unshift({type:"text",value:"["});let g=e[e.length-1];return g&&"text"===g.type?g.value+=d:e.push({type:"text",value:d}),e}function xi(a){let b=a.spread;return null==b?a.children.length>1:b}function xj(a,b,c){let d=0,e=a.length;if(b){let b=a.codePointAt(d);for(;9===b||32===b;)d++,b=a.codePointAt(d)}if(c){let b=a.codePointAt(e-1);for(;9===b||32===b;)e--,b=a.codePointAt(e-1)}return e>d?a.slice(d,e):""}let xk={blockquote:function(a,b){let c={type:"element",tagName:"blockquote",properties:{},children:a.wrap(a.all(b),!0)};return a.patch(b,c),a.applyData(b,c)},break:function(a,b){let c={type:"element",tagName:"br",properties:{},children:[]};return a.patch(b,c),[a.applyData(b,c),{type:"text",value:"\n"}]},code:function(a,b){let c=b.value?b.value+"\n":"",d={},e=b.lang?b.lang.split(/\s+/):[];e.length>0&&(d.className=["language-"+e[0]]);let f={type:"element",tagName:"code",properties:d,children:[{type:"text",value:c}]};return b.meta&&(f.data={meta:b.meta}),a.patch(b,f),f={type:"element",tagName:"pre",properties:{},children:[f=a.applyData(b,f)]},a.patch(b,f),f},delete:function(a,b){let c={type:"element",tagName:"del",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},emphasis:function(a,b){let c={type:"element",tagName:"em",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},footnoteReference:function(a,b){let c,d="string"==typeof a.options.clobberPrefix?a.options.clobberPrefix:"user-content-",e=String(b.identifier).toUpperCase(),f=w7(e.toLowerCase()),g=a.footnoteOrder.indexOf(e),h=a.footnoteCounts.get(e);void 0===h?(h=0,a.footnoteOrder.push(e),c=a.footnoteOrder.length):c=g+1,h+=1,a.footnoteCounts.set(e,h);let i={type:"element",tagName:"a",properties:{href:"#"+d+"fn-"+f,id:d+"fnref-"+f+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};a.patch(b,i);let j={type:"element",tagName:"sup",properties:{},children:[i]};return a.patch(b,j),a.applyData(b,j)},heading:function(a,b){let c={type:"element",tagName:"h"+b.depth,properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},html:function(a,b){if(a.options.allowDangerousHtml){let c={type:"raw",value:b.value};return a.patch(b,c),a.applyData(b,c)}},imageReference:function(a,b){let c=String(b.identifier).toUpperCase(),d=a.definitionById.get(c);if(!d)return xh(a,b);let e={src:w7(d.url||""),alt:b.alt};null!==d.title&&void 0!==d.title&&(e.title=d.title);let f={type:"element",tagName:"img",properties:e,children:[]};return a.patch(b,f),a.applyData(b,f)},image:function(a,b){let c={src:w7(b.url)};null!==b.alt&&void 0!==b.alt&&(c.alt=b.alt),null!==b.title&&void 0!==b.title&&(c.title=b.title);let d={type:"element",tagName:"img",properties:c,children:[]};return a.patch(b,d),a.applyData(b,d)},inlineCode:function(a,b){let c={type:"text",value:b.value.replace(/\r?\n|\r/g," ")};a.patch(b,c);let d={type:"element",tagName:"code",properties:{},children:[c]};return a.patch(b,d),a.applyData(b,d)},linkReference:function(a,b){let c=String(b.identifier).toUpperCase(),d=a.definitionById.get(c);if(!d)return xh(a,b);let e={href:w7(d.url||"")};null!==d.title&&void 0!==d.title&&(e.title=d.title);let f={type:"element",tagName:"a",properties:e,children:a.all(b)};return a.patch(b,f),a.applyData(b,f)},link:function(a,b){let c={href:w7(b.url)};null!==b.title&&void 0!==b.title&&(c.title=b.title);let d={type:"element",tagName:"a",properties:c,children:a.all(b)};return a.patch(b,d),a.applyData(b,d)},listItem:function(a,b,c){let d=a.all(b),e=c?function(a){let b=!1;if("list"===a.type){b=a.spread||!1;let c=a.children,d=-1;for(;!b&&++d<c.length;)b=xi(c[d])}return b}(c):xi(b),f={},g=[];if("boolean"==typeof b.checked){let a,c=d[0];c&&"element"===c.type&&"p"===c.tagName?a=c:(a={type:"element",tagName:"p",properties:{},children:[]},d.unshift(a)),a.children.length>0&&a.children.unshift({type:"text",value:" "}),a.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:b.checked,disabled:!0},children:[]}),f.className=["task-list-item"]}let h=-1;for(;++h<d.length;){let a=d[h];(e||0!==h||"element"!==a.type||"p"!==a.tagName)&&g.push({type:"text",value:"\n"}),"element"!==a.type||"p"!==a.tagName||e?g.push(a):g.push(...a.children)}let i=d[d.length-1];i&&(e||"element"!==i.type||"p"!==i.tagName)&&g.push({type:"text",value:"\n"});let j={type:"element",tagName:"li",properties:f,children:g};return a.patch(b,j),a.applyData(b,j)},list:function(a,b){let c={},d=a.all(b),e=-1;for("number"==typeof b.start&&1!==b.start&&(c.start=b.start);++e<d.length;){let a=d[e];if("element"===a.type&&"li"===a.tagName&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){c.className=["contains-task-list"];break}}let f={type:"element",tagName:b.ordered?"ol":"ul",properties:c,children:a.wrap(d,!0)};return a.patch(b,f),a.applyData(b,f)},paragraph:function(a,b){let c={type:"element",tagName:"p",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},root:function(a,b){let c={type:"root",children:a.wrap(a.all(b))};return a.patch(b,c),a.applyData(b,c)},strong:function(a,b){let c={type:"element",tagName:"strong",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},table:function(a,b){let c=a.all(b),d=c.shift(),e=[];if(d){let c={type:"element",tagName:"thead",properties:{},children:a.wrap([d],!0)};a.patch(b.children[0],c),e.push(c)}if(c.length>0){let d={type:"element",tagName:"tbody",properties:{},children:a.wrap(c,!0)},f=vl(b.children[1]),g=vk(b.children[b.children.length-1]);f&&g&&(d.position={start:f,end:g}),e.push(d)}let f={type:"element",tagName:"table",properties:{},children:a.wrap(e,!0)};return a.patch(b,f),a.applyData(b,f)},tableCell:function(a,b){let c={type:"element",tagName:"td",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},tableRow:function(a,b,c){let d=c?c.children:void 0,e=0===(d?d.indexOf(b):1)?"th":"td",f=c&&"table"===c.type?c.align:void 0,g=f?f.length:b.children.length,h=-1,i=[];for(;++h<g;){let c=b.children[h],d={},g=f?f[h]:void 0;g&&(d.align=g);let j={type:"element",tagName:e,properties:d,children:[]};c&&(j.children=a.all(c),a.patch(c,j),j=a.applyData(c,j)),i.push(j)}let j={type:"element",tagName:"tr",properties:{},children:a.wrap(i,!0)};return a.patch(b,j),a.applyData(b,j)},text:function(a,b){let c={type:"text",value:function(a){let b=String(a),c=/\r?\n|\r/g,d=c.exec(b),e=0,f=[];for(;d;)f.push(xj(b.slice(e,d.index),e>0,!0),d[0]),e=d.index+d[0].length,d=c.exec(b);return f.push(xj(b.slice(e),e>0,!1)),f.join("")}(String(b.value))};return a.patch(b,c),a.applyData(b,c)},thematicBreak:function(a,b){let c={type:"element",tagName:"hr",properties:{},children:[]};return a.patch(b,c),a.applyData(b,c)},toml:xl,yaml:xl,definition:xl,footnoteDefinition:xl};function xl(){}let xm={}.hasOwnProperty,xn={};function xo(a,b){a.position&&(b.position=vn(a))}function xp(a,b){let c=b;if(a&&a.data){let b=a.data.hName,d=a.data.hChildren,e=a.data.hProperties;"string"==typeof b&&("element"===c.type?c.tagName=b:c={type:"element",tagName:b,properties:{},children:"children"in c?c.children:[c]}),"element"===c.type&&e&&Object.assign(c.properties,w6(e)),"children"in c&&c.children&&null!=d&&(c.children=d)}return c}function xq(a,b){let c=[],d=-1;for(b&&c.push({type:"text",value:"\n"});++d<a.length;)d&&c.push({type:"text",value:"\n"}),c.push(a[d]);return b&&a.length>0&&c.push({type:"text",value:"\n"}),c}function xr(a){let b=0,c=a.charCodeAt(b);for(;9===c||32===c;)b++,c=a.charCodeAt(b);return a.slice(b)}function xs(a,b){let c,d,e,f,g=(c=b||xn,d=new Map,e=new Map,f={all:function(a){let b=[];if("children"in a){let c=a.children,d=-1;for(;++d<c.length;){let e=f.one(c[d],a);if(e){if(d&&"break"===c[d-1].type&&(Array.isArray(e)||"text"!==e.type||(e.value=xr(e.value)),!Array.isArray(e)&&"element"===e.type)){let a=e.children[0];a&&"text"===a.type&&(a.value=xr(a.value))}Array.isArray(e)?b.push(...e):b.push(e)}}}return b},applyData:xp,definitionById:d,footnoteById:e,footnoteCounts:new Map,footnoteOrder:[],handlers:{...xk,...c.handlers},one:function(a,b){let c=a.type,d=f.handlers[c];if(xm.call(f.handlers,c)&&d)return d(f,a,b);if(f.options.passThrough&&f.options.passThrough.includes(c)){if("children"in a){let{children:b,...c}=a,d=w6(c);return d.children=f.all(a),d}return w6(a)}return(f.options.unknownHandler||function(a,b){let c=b.data||{},d="value"in b&&!(xm.call(c,"hProperties")||xm.call(c,"hChildren"))?{type:"text",value:b.value}:{type:"element",tagName:"div",properties:{},children:a.all(b)};return a.patch(b,d),a.applyData(b,d)})(f,a,b)},options:c,patch:xo,wrap:xq},xg(a,function(a){if("definition"===a.type||"footnoteDefinition"===a.type){let b="definition"===a.type?d:e,c=String(a.identifier).toUpperCase();b.has(c)||b.set(c,a)}}),f),h=g.one(a,void 0),i=function(a){let b="string"==typeof a.options.clobberPrefix?a.options.clobberPrefix:"user-content-",c=a.options.footnoteBackContent||w8,d=a.options.footnoteBackLabel||w9,e=a.options.footnoteLabel||"Footnotes",f=a.options.footnoteLabelTagName||"h2",g=a.options.footnoteLabelProperties||{className:["sr-only"]},h=[],i=-1;for(;++i<a.footnoteOrder.length;){let e=a.footnoteById.get(a.footnoteOrder[i]);if(!e)continue;let f=a.all(e),g=String(e.identifier).toUpperCase(),j=w7(g.toLowerCase()),k=0,l=[],m=a.footnoteCounts.get(g);for(;void 0!==m&&++k<=m;){l.length>0&&l.push({type:"text",value:" "});let a="string"==typeof c?c:c(i,k);"string"==typeof a&&(a={type:"text",value:a}),l.push({type:"element",tagName:"a",properties:{href:"#"+b+"fnref-"+j+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof d?d:d(i,k),className:["data-footnote-backref"]},children:Array.isArray(a)?a:[a]})}let n=f[f.length-1];if(n&&"element"===n.type&&"p"===n.tagName){let a=n.children[n.children.length-1];a&&"text"===a.type?a.value+=" ":n.children.push({type:"text",value:" "}),n.children.push(...l)}else f.push(...l);let o={type:"element",tagName:"li",properties:{id:b+"fn-"+j},children:a.wrap(f,!0)};a.patch(e,o),h.push(o)}if(0!==h.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:f,properties:{...w6(g),id:"footnote-label"},children:[{type:"text",value:e}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:a.wrap(h,!0)},{type:"text",value:"\n"}]}}(g),j=Array.isArray(h)?{type:"root",children:h}:h||{type:"root",children:[]};return i&&(uB("children"in j),j.children.push({type:"text",value:"\n"},i)),j}function xt(a,b){return a&&"run"in a?async function(c,d){let e=xs(c,{file:d,...b});await a.run(e,d)}:function(c,d){return xs(c,{file:d,...a||b})}}function xu(a){if(a)throw a}var xv=a.i(897599);function xw(a){if("object"!=typeof a||null===a)return!1;let b=Object.getPrototypeOf(a);return(null===b||b===Object.prototype||null===Object.getPrototypeOf(b))&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)}var xx=a.i(59639),xx=xx,xy=a.i(857764),xy=xy;function xz(a){return!!(null!==a&&"object"==typeof a&&"href"in a&&a.href&&"protocol"in a&&a.protocol&&void 0===a.auth)}let xA=["history","path","basename","stem","extname","dirname"];class xB{constructor(a){let b,c;b=a?xz(a)?{path:a}:"string"==typeof a||function(a){return!!(a&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a)}(a)?{value:a}:a:{},this.cwd="cwd"in b?"":xx.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let d=-1;for(;++d<xA.length;){const a=xA[d];a in b&&void 0!==b[a]&&null!==b[a]&&(this[a]="history"===a?[...b[a]]:b[a])}for(c in b)xA.includes(c)||(this[c]=b[c])}get basename(){return"string"==typeof this.path?mH.default.basename(this.path):void 0}set basename(a){xD(a,"basename"),xC(a,"basename"),this.path=mH.default.join(this.dirname||"",a)}get dirname(){return"string"==typeof this.path?mH.default.dirname(this.path):void 0}set dirname(a){xE(this.basename,"dirname"),this.path=mH.default.join(a||"",this.basename)}get extname(){return"string"==typeof this.path?mH.default.extname(this.path):void 0}set extname(a){if(xC(a,"extname"),xE(this.dirname,"extname"),a){if(46!==a.codePointAt(0))throw Error("`extname` must start with `.`");if(a.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=mH.default.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){xz(a)&&(a=(0,xy.fileURLToPath)(a)),xD(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return"string"==typeof this.path?mH.default.basename(this.path,this.extname):void 0}set stem(a){xD(a,"stem"),xC(a,"stem"),this.path=mH.default.join(this.dirname||"",a+(this.extname||""))}fail(a,b,c){let d=this.message(a,b,c);throw d.fatal=!0,d}info(a,b,c){let d=this.message(a,b,c);return d.fatal=void 0,d}message(a,b,c){let d=new vs(a,b,c);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(a){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(a||void 0).decode(this.value)}}function xC(a,b){if(a&&a.includes(mH.default.sep))throw Error("`"+b+"` cannot be a path: did not expect `"+mH.default.sep+"`")}function xD(a,b){if(!a)throw Error("`"+b+"` cannot be empty")}function xE(a,b){if(!a)throw Error("Setting `"+b+"` requires `path` to be set too")}let xF=function(a){let b=this.constructor.prototype,c=b[a],d=function(){return c.apply(d,arguments)};return Object.setPrototypeOf(d,b),d},xG={}.hasOwnProperty;class xH extends xF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let a=[],b={run:function(...b){let c=-1,d=b.pop();if("function"!=typeof d)throw TypeError("Expected function as last argument, not "+d);!function e(f,...g){let h=a[++c],i=-1;if(f)return void d(f);for(;++i<b.length;)(null===g[i]||void 0===g[i])&&(g[i]=b[i]);b=g,h?(function(a,b){let c;return function(...b){let f,g=a.length>b.length;g&&b.push(d);try{f=a.apply(this,b)}catch(a){if(g&&c)throw a;return d(a)}g||(f&&f.then&&"function"==typeof f.then?f.then(e,d):f instanceof Error?d(f):e(f))};function d(a,...e){c||(c=!0,b(a,...e))}function e(a){d(null,a)}})(h,e)(...g):d(null,...g)}(null,...b)},use:function(c){if("function"!=typeof c)throw TypeError("Expected `middelware` to be a function, not "+c);return a.push(c),b}};return b}()}copy(){let a=new xH,b=-1;for(;++b<this.attachers.length;){let c=this.attachers[b];a.use(...c)}return a.data((0,xv.default)(!0,{},this.namespace)),a}data(a,b){return"string"==typeof a?2==arguments.length?(xL("data",this.frozen),this.namespace[a]=b,this):xG.call(this.namespace,a)&&this.namespace[a]||void 0:a?(xL("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[a,...b]=this.attachers[this.freezeIndex];if(!1===b[0])continue;!0===b[0]&&(b[0]=void 0);let c=a.call(this,...b);"function"==typeof c&&this.transformers.use(c)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(a){this.freeze();let b=xO(a),c=this.parser||this.Parser;return xJ("parse",c),c(String(b),b)}process(a,b){let c=this;return this.freeze(),xJ("process",this.parser||this.Parser),xK("process",this.compiler||this.Compiler),b?d(void 0,b):new Promise(d);function d(d,e){let f=xO(a),g=c.parse(f);function h(a,c){a||!c?e(a):d?d(c):(uB(b,"`done` is defined if `resolve` is not"),b(void 0,c))}c.run(g,f,function(a,b,d){var e,f;if(a||!b||!d)return h(a);let g=c.stringify(b,d);"string"==typeof(e=g)||(f=e)&&"object"==typeof f&&"byteLength"in f&&"byteOffset"in f?d.value=g:d.result=g,h(a,d)})}}processSync(a){let b,c=!1;return this.freeze(),xJ("processSync",this.parser||this.Parser),xK("processSync",this.compiler||this.Compiler),this.process(a,function(a,d){c=!0,xu(a),b=d}),xN("processSync","process",c),uB(b,"we either bailed on an error or have a tree"),b}run(a,b,c){xM(a),this.freeze();let d=this.transformers;return c||"function"!=typeof b||(c=b,b=void 0),c?e(void 0,c):new Promise(e);function e(e,f){uB("function"!=typeof b,"`file` can’t be a `done` anymore, we checked");let g=xO(b);d.run(a,g,function(b,d,g){let h=d||a;b?f(b):e?e(h):(uB(c,"`done` is defined if `resolve` is not"),c(void 0,h,g))})}}runSync(a,b){let c,d=!1;return this.run(a,b,function(a,b){xu(a),c=b,d=!0}),xN("runSync","run",d),uB(c,"we either bailed on an error or have a tree"),c}stringify(a,b){this.freeze();let c=xO(b),d=this.compiler||this.Compiler;return xK("stringify",d),xM(a),d(a,c)}use(a,...b){let c=this.attachers,d=this.namespace;if(xL("use",this.frozen),null==a);else if("function"==typeof a)g(a,b);else if("object"==typeof a)Array.isArray(a)?f(a):e(a);else throw TypeError("Expected usable value, not `"+a+"`");return this;function e(a){if(!("plugins"in a)&&!("settings"in a))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(a.plugins),a.settings&&(d.settings=(0,xv.default)(!0,d.settings,a.settings))}function f(a){let b=-1;if(null==a);else if(Array.isArray(a))for(;++b<a.length;)!function(a){if("function"==typeof a)g(a,[]);else if("object"==typeof a)if(Array.isArray(a)){let[b,...c]=a;g(b,c)}else e(a);else throw TypeError("Expected usable value, not `"+a+"`")}(a[b]);else throw TypeError("Expected a list of plugins, not `"+a+"`")}function g(a,b){let d=-1,e=-1;for(;++d<c.length;)if(c[d][0]===a){e=d;break}if(-1===e)c.push([a,...b]);else if(b.length>0){let[d,...f]=b,g=c[e][1];xw(g)&&xw(d)&&(d=(0,xv.default)(!0,g,d)),c[e]=[a,d,...f]}}}}let xI=new xH().freeze();function xJ(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `parser`")}function xK(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `compiler`")}function xL(a,b){if(b)throw Error("Cannot call `"+a+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xM(a){if(!xw(a)||"string"!=typeof a.type)throw TypeError("Expected node, got `"+a+"`")}function xN(a,b,c){if(!c)throw Error("`"+a+"` finished async. Use `"+b+"` instead")}function xO(a){var b;return(b=a)&&"object"==typeof b&&"message"in b&&"messages"in b?a:new xB(a)}let xP=[],xQ={allowDangerousHtml:!0},xR=/^(https?|ircs?|mailto|xmpp)$/i,xS=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xT(a){var b;let c,d,e,f,g,h=(c=(b=a).rehypePlugins||xP,d=b.remarkPlugins||xP,e=b.remarkRehypeOptions?{...b.remarkRehypeOptions,...xQ}:xQ,xI().use(wZ).use(d).use(xt,e).use(c)),i=(f=a.children||"",g=new xB,"string"==typeof f?g.value=f:uC("Unexpected value `"+f+"` for `children` prop, expected `string`"),g);return function(a,b){let c=b.allowedElements,d=b.allowElement,e=b.components,f=b.disallowedElements,g=b.skipHtml,h=b.unwrapDisallowed,i=b.urlTransform||xU;for(let a of xS)Object.hasOwn(b,a.from)&&uC("Unexpected `"+a.from+"` prop, "+(a.to?"use `"+a.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+a.id+"> for more info)");return c&&f&&uC("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),b.className&&(a={type:"element",tagName:"div",properties:{className:b.className},children:"root"===a.type?a.children:[a]}),xg(a,function(a,b,e){if("raw"===a.type&&e&&"number"==typeof b)return g?e.children.splice(b,1):e.children[b]={type:"text",value:a.value},b;if("element"===a.type){let b;for(b in vG)if(Object.hasOwn(vG,b)&&Object.hasOwn(a.properties,b)){let c=a.properties[b],d=vG[b];(null===d||d.includes(a.tagName))&&(a.properties[b]=i(String(c||""),b,a))}}if("element"===a.type){let g=c?!c.includes(a.tagName):!!f&&f.includes(a.tagName);if(!g&&d&&"number"==typeof b&&(g=!d(a,b,e)),g&&e&&"number"==typeof b)return h&&a.children?e.children.splice(b,1,...a.children):e.children.splice(b,1),b}}),function(a,b){var c,d,e,f;let g;if(!b||void 0===b.Fragment)throw TypeError("Expected `Fragment` in options");let h=b.filePath||void 0;if(b.development){if("function"!=typeof b.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");c=h,d=b.jsxDEV,g=function(a,b,e,f){let g=Array.isArray(e.children),h=vl(a);return d(b,e,f,g,{columnNumber:h?h.column-1:void 0,fileName:c,lineNumber:h?h.line:void 0},void 0)}}else{if("function"!=typeof b.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof b.jsxs)throw TypeError("Expected `jsxs` in production options");e=b.jsx,f=b.jsxs,g=function(a,b,c,d){let g=Array.isArray(c.children)?f:e;return d?g(b,c,d):g(b,c)}}let i={Fragment:b.Fragment,ancestors:[],components:b.components||{},create:g,elementAttributeNameCase:b.elementAttributeNameCase||"react",evaluater:b.createEvaluater?b.createEvaluater():void 0,filePath:h,ignoreInvalidStyle:b.ignoreInvalidStyle||!1,passKeys:!1!==b.passKeys,passNode:b.passNode||!1,schema:"svg"===b.space?vg:vf,stylePropertyNameCase:b.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==b.tableCellAlignToStyle},j=vz(i,a,void 0);return j&&"string"!=typeof j?j:i.create(a,i.Fragment,{children:j||void 0},void 0)}(a,{Fragment:aA.Fragment,components:e,ignoreInvalidStyle:!0,jsx:aA.jsx,jsxs:aA.jsxs,passKeys:!0,passNode:!0})}(h.runSync(h.parse(i),i),a)}function xU(a){let b=a.indexOf(":"),c=a.indexOf("?"),d=a.indexOf("#"),e=a.indexOf("/");return -1===b||-1!==e&&b>e||-1!==c&&b>c||-1!==d&&b>d||xR.test(a.slice(0,b))?a:""}function xV(a,b){let c=String(a);if("string"!=typeof b)throw TypeError("Expected character");let d=0,e=c.indexOf(b);for(;-1!==e;)d++,e=c.indexOf(b,e+b.length);return d}let xW="phrasing",xX=["autolink","link","image","label"];function xY(a){this.enter({type:"link",title:null,url:"",children:[]},a)}function xZ(a){this.config.enter.autolinkProtocol.call(this,a)}function x$(a){this.config.exit.autolinkProtocol.call(this,a)}function x_(a){this.config.exit.data.call(this,a);let b=this.stack[this.stack.length-1];uB("link"===b.type),b.url="http://"+this.sliceSerialize(a)}function x0(a){this.config.exit.autolinkEmail.call(this,a)}function x1(a){this.exit(a)}function x2(a){!function(a,b,c){let d=xa((c||{}).ignore||[]),e=function(a){let b=[];if(!Array.isArray(a))throw TypeError("Expected find and replace tuple or list of tuples");let c=!a[0]||Array.isArray(a[0])?a:[a],d=-1;for(;++d<c.length;){var e;let a=c[d];b.push(["string"==typeof(e=a[0])?RegExp(function(a){if("string"!=typeof a)throw TypeError("Expected a string");return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e,function(a){return"function"==typeof a?a:function(){return a}}(a[1])])}return b}(b),f=-1;for(;++f<e.length;)xf(a,"text",g);function g(a,b){let c,g=-1;for(;++g<b.length;){let a=b[g],e=c?c.children:void 0;if(d(a,e?e.indexOf(a):void 0,c))return;c=a}if(c)return function(a,b){let c=b[b.length-1],d=e[f][0],g=e[f][1],h=0,i=c.children.indexOf(a),j=!1,k=[];d.lastIndex=0;let l=d.exec(a.value);for(;l;){let c=l.index,e={index:l.index,input:l.input,stack:[...b,a]},f=g(...l,e);if("string"==typeof f&&(f=f.length>0?{type:"text",value:f}:void 0),!1===f?d.lastIndex=c+1:(h!==c&&k.push({type:"text",value:a.value.slice(h,c)}),Array.isArray(f)?k.push(...f):f&&k.push(f),h=c+l[0].length,j=!0),!d.global)break;l=d.exec(a.value)}return j?(h<a.value.length&&k.push({type:"text",value:a.value.slice(h)}),c.children.splice(i,1,...k)):k=[a],i+k.length}(a,b)}}(a,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,x3],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,x4]],{ignore:["link","linkReference"]})}function x3(a,b,c,d,e){let f,g="";if(!x5(e))return!1;if(/^w/i.test(b)&&(c=b+c,b="",g="http://"),(f=c.split(".")).length<2||f[f.length-1]&&(/_/.test(f[f.length-1])||!/[a-zA-Z\d]/.test(f[f.length-1]))||f[f.length-2]&&(/_/.test(f[f.length-2])||!/[a-zA-Z\d]/.test(f[f.length-2])))return!1;let h=function(a){let b=/[!"&'),.:;<>?\]}]+$/.exec(a);if(!b)return[a,void 0];a=a.slice(0,b.index);let c=b[0],d=c.indexOf(")"),e=xV(a,"("),f=xV(a,")");for(;-1!==d&&e>f;)a+=c.slice(0,d+1),d=(c=c.slice(d+1)).indexOf(")"),f++;return[a,c]}(c+d);if(!h[0])return!1;let i={type:"link",title:null,url:g+b+h[0],children:[{type:"text",value:b+h[0]}]};return h[1]?[i,{type:"text",value:h[1]}]:i}function x4(a,b,c,d){return!(!x5(d,!0)||/[-\d_]$/.test(c))&&{type:"link",title:null,url:"mailto:"+b+"@"+c,children:[{type:"text",value:b+"@"+c}]}}function x5(a,b){let c=a.input.charCodeAt(a.index-1);return(0===a.index||v$(c)||vZ(c))&&(!b||47!==c)}function x6(){this.buffer()}function x7(a){this.enter({type:"footnoteReference",identifier:"",label:""},a)}function x8(){this.buffer()}function x9(a){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},a)}function ya(a){let b=this.resume(),c=this.stack[this.stack.length-1];uB("footnoteReference"===c.type),c.identifier=wz(this.sliceSerialize(a)).toLowerCase(),c.label=b}function yb(a){this.exit(a)}function yc(a){let b=this.resume(),c=this.stack[this.stack.length-1];uB("footnoteDefinition"===c.type),c.identifier=wz(this.sliceSerialize(a)).toLowerCase(),c.label=b}function yd(a){this.exit(a)}function ye(a,b,c,d){let e=c.createTracker(d),f=e.move("[^"),g=c.enter("footnoteReference"),h=c.enter("reference");return f+=e.move(c.safe(c.associationId(a),{after:"]",before:f})),h(),g(),f+=e.move("]")}function yf(a,b,c){return 0===b?a:yg(a,b,c)}function yg(a,b,c){return(c?"":" ")+a}ye.peek=function(){return"["};let yh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function yi(a){this.enter({type:"delete",children:[]},a)}function yj(a){this.exit(a)}function yk(a,b,c,d){let e=c.createTracker(d),f=c.enter("strikethrough"),g=e.move("~~");return g+=c.containerPhrasing(a,{...e.current(),before:g,after:"~"}),g+=e.move("~~"),f(),g}function yl(a){return a.length}function ym(a){let b="string"==typeof a?a.codePointAt(0):0;return 67===b||99===b?99:76===b||108===b?108:114*(82===b||114===b)}yk.peek=function(){return"~"};function yn(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}yn.peek=function(){return"`"};xa(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let yo=function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||function(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j};function yp(a){let b=a._align;uB(b,"expected `_align` on table"),this.enter({type:"table",align:b.map(function(a){return"none"===a?null:a}),children:[]},a),this.data.inTable=!0}function yq(a){this.exit(a),this.data.inTable=void 0}function yr(a){this.enter({type:"tableRow",children:[]},a)}function ys(a){this.exit(a)}function yt(a){this.enter({type:"tableCell",children:[]},a)}function yu(a){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,yv));let c=this.stack[this.stack.length-1];uB("inlineCode"===c.type),c.value=b,this.exit(a)}function yv(a,b){return"|"===b?b:a}function yw(a){let b=this.stack[this.stack.length-2];uB("listItem"===b.type),b.checked="taskListCheckValueChecked"===a.type}function yx(a){let b=this.stack[this.stack.length-2];if(b&&"listItem"===b.type&&"boolean"==typeof b.checked){let a=this.stack[this.stack.length-1];uB("paragraph"===a.type);let c=a.children[0];if(c&&"text"===c.type){let d,e=b.children,f=-1;for(;++f<e.length;){let a=e[f];if("paragraph"===a.type){d=a;break}}d===a&&(c.value=c.value.slice(1),0===c.value.length?a.children.shift():a.position&&c.position&&"number"==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,a.position.start=Object.assign({},c.position.start)))}}this.exit(a)}function yy(a,b,c,d){let e=a.children[0],f="boolean"==typeof a.checked&&e&&"paragraph"===e.type,g="["+(a.checked?"x":" ")+"] ",h=c.createTracker(d);f&&h.move(g);let i=yo(a,b,c,{...d,...h.current()});return f&&(i=i.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(a){return a+g})),i}let yz={tokenize:function(a,b,c){let d=0;return function b(f){return(87===f||119===f)&&d<3?(d++,a.consume(f),b):46===f&&3===d?(a.consume(f),e):c(f)};function e(a){return null===a?c(a):b(a)}},partial:!0},yA={tokenize:function(a,b,c){let d,e,f;return g;function g(b){return 46===b||95===b?a.check(yC,i,h)(b):null===b||vX(b)||v$(b)||45!==b&&vZ(b)?i(b):(f=!0,a.consume(b),g)}function h(b){return 95===b?d=!0:(e=d,d=void 0),a.consume(b),g}function i(a){return e||d||!f?c(a):b(a)}},partial:!0},yB={tokenize:function(a,b){let c=0,d=0;return e;function e(g){return 40===g?(c++,a.consume(g),e):41===g&&d<c?f(g):33===g||34===g||38===g||39===g||41===g||42===g||44===g||46===g||58===g||59===g||60===g||63===g||93===g||95===g||126===g?a.check(yC,b,f)(g):null===g||vX(g)||v$(g)?b(g):(a.consume(g),e)}function f(b){return 41===b&&d++,a.consume(b),e}},partial:!0},yC={tokenize:function(a,b,c){return d;function d(g){return 33===g||34===g||39===g||41===g||42===g||44===g||46===g||58===g||59===g||63===g||95===g||126===g?(a.consume(g),d):38===g?(a.consume(g),f):93===g?(a.consume(g),e):60===g||null===g||vX(g)||v$(g)?b(g):c(g)}function e(a){return null===a||40===a||91===a||vX(a)||v$(a)?b(a):d(a)}function f(b){return vP(b)?function b(e){return 59===e?(a.consume(e),d):vP(e)?(a.consume(e),b):c(e)}(b):c(b)}},partial:!0},yD={tokenize:function(a,b,c){return function(b){return a.consume(b),d};function d(a){return vQ(a)?c(a):b(a)}},partial:!0},yE={name:"wwwAutolink",tokenize:function(a,b,c){let d=this;return function(b){return 87!==b&&119!==b||!yJ.call(d,d.previous)||yN(d.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkWww"),a.check(yz,a.attempt(yA,a.attempt(yB,e),c),c)(b))};function e(c){return a.exit("literalAutolinkWww"),a.exit("literalAutolink"),b(c)}},previous:yJ},yF={name:"protocolAutolink",tokenize:function(a,b,c){let d=this,e="",f=!1;return function(b){return(72===b||104===b)&&yK.call(d,d.previous)&&!yN(d.events)?(a.enter("literalAutolink"),a.enter("literalAutolinkHttp"),e+=String.fromCodePoint(b),a.consume(b),g):c(b)};function g(b){if(vP(b)&&e.length<5)return e+=String.fromCodePoint(b),a.consume(b),g;if(58===b){let c=e.toLowerCase();if("http"===c||"https"===c)return a.consume(b),h}return c(b)}function h(b){return 47===b?(a.consume(b),f)?i:(f=!0,h):c(b)}function i(b){return null===b||vS(b)||vX(b)||v$(b)||vZ(b)?c(b):a.attempt(yA,a.attempt(yB,j),c)(b)}function j(c){return a.exit("literalAutolinkHttp"),a.exit("literalAutolink"),b(c)}},previous:yK},yG={name:"emailAutolink",tokenize:function(a,b,c){let d,e,f=this;return function(b){return!yM(b)||!yL.call(f,f.previous)||yN(f.events)?c(b):(a.enter("literalAutolink"),a.enter("literalAutolinkEmail"),function b(d){return yM(d)?(a.consume(d),b):64===d?(a.consume(d),g):c(d)}(b))};function g(b){return 46===b?a.check(yD,i,h)(b):45===b||95===b||vQ(b)?(e=!0,a.consume(b),g):i(b)}function h(b){return a.consume(b),d=!0,g}function i(g){return e&&d&&vP(f.previous)?(a.exit("literalAutolinkEmail"),a.exit("literalAutolink"),b(g)):c(g)}},previous:yL},yH={},yI=48;for(;yI<123;)yH[yI]=yG,58==++yI?yI=65:91===yI&&(yI=97);function yJ(a){return null===a||40===a||42===a||95===a||91===a||93===a||126===a||vX(a)}function yK(a){return!vP(a)}function yL(a){return!(47===a||yM(a))}function yM(a){return 43===a||45===a||46===a||95===a||vQ(a)}function yN(a){let b=a.length,c=!1;for(;b--;){let d=a[b][1];if(("labelLink"===d.type||"labelImage"===d.type)&&!d._balanced){c=!0;break}if(d._gfmAutolinkLiteralWalkedInto){c=!1;break}}return a.length>0&&!c&&(a[a.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),c}yH[43]=yG,yH[45]=yG,yH[46]=yG,yH[95]=yG,yH[72]=[yG,yF],yH[104]=[yG,yF],yH[87]=[yG,yE],yH[119]=[yG,yE];let yO={tokenize:function(a,b,c){let d=this;return v0(a,function(a){let e=d.events[d.events.length-1];return e&&"gfmFootnoteDefinitionIndent"===e[1].type&&4===e[2].sliceSerialize(e[1],!0).length?b(a):c(a)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function yP(a,b,c){let d,e=this,f=e.events.length,g=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]);for(;f--;){let a=e.events[f][1];if("labelImage"===a.type){d=a;break}if("gfmFootnoteCall"===a.type||"labelLink"===a.type||"label"===a.type||"image"===a.type||"link"===a.type)break}return function(f){if(!d||!d._balanced)return c(f);let h=wz(e.sliceSerialize({start:d.end,end:e.now()}));return 94===h.codePointAt(0)&&g.includes(h.slice(1))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(f),a.exit("gfmFootnoteCallLabelMarker"),b(f)):c(f)}}function yQ(a,b){let c=a.length;for(;c--;)if("labelImage"===a[c][1].type&&"enter"===a[c][0]){a[c][1];break}a[c+1][1].type="data",a[c+3][1].type="gfmFootnoteCallLabelMarker";let d={type:"gfmFootnoteCall",start:Object.assign({},a[c+3][1].start),end:Object.assign({},a[a.length-1][1].end)},e={type:"gfmFootnoteCallMarker",start:Object.assign({},a[c+3][1].end),end:Object.assign({},a[c+3][1].end)};e.end.column++,e.end.offset++,e.end._bufferIndex++;let f={type:"gfmFootnoteCallString",start:Object.assign({},e.end),end:Object.assign({},a[a.length-1][1].start)},g={type:"chunkString",contentType:"string",start:Object.assign({},f.start),end:Object.assign({},f.end)},h=[a[c+1],a[c+2],["enter",d,b],a[c+3],a[c+4],["enter",e,b],["exit",e,b],["enter",f,b],["enter",g,b],["exit",g,b],["exit",f,b],a[a.length-2],a[a.length-1],["exit",d,b]];return a.splice(c,a.length-c+1,...h),a}function yR(a,b,c){let d,e=this,f=e.parser.gfmFootnotes||(e.parser.gfmFootnotes=[]),g=0;return function(b){return a.enter("gfmFootnoteCall"),a.enter("gfmFootnoteCallLabelMarker"),a.consume(b),a.exit("gfmFootnoteCallLabelMarker"),h};function h(b){return 94!==b?c(b):(a.enter("gfmFootnoteCallMarker"),a.consume(b),a.exit("gfmFootnoteCallMarker"),a.enter("gfmFootnoteCallString"),a.enter("chunkString").contentType="string",i)}function i(h){if(g>999||93===h&&!d||null===h||91===h||vX(h))return c(h);if(93===h){a.exit("chunkString");let d=a.exit("gfmFootnoteCallString");return f.includes(wz(e.sliceSerialize(d)))?(a.enter("gfmFootnoteCallLabelMarker"),a.consume(h),a.exit("gfmFootnoteCallLabelMarker"),a.exit("gfmFootnoteCall"),b):c(h)}return vX(h)||(d=!0),g++,a.consume(h),92===h?j:i}function j(b){return 91===b||92===b||93===b?(a.consume(b),g++,i):i(b)}}function yS(a,b,c){let d,e,f=this,g=f.parser.gfmFootnotes||(f.parser.gfmFootnotes=[]),h=0;return function(b){return a.enter("gfmFootnoteDefinition")._container=!0,a.enter("gfmFootnoteDefinitionLabel"),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),i};function i(b){return 94===b?(a.enter("gfmFootnoteDefinitionMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionMarker"),a.enter("gfmFootnoteDefinitionLabelString"),a.enter("chunkString").contentType="string",j):c(b)}function j(b){if(h>999||93===b&&!e||null===b||91===b||vX(b))return c(b);if(93===b){a.exit("chunkString");let c=a.exit("gfmFootnoteDefinitionLabelString");return d=wz(f.sliceSerialize(c)),a.enter("gfmFootnoteDefinitionLabelMarker"),a.consume(b),a.exit("gfmFootnoteDefinitionLabelMarker"),a.exit("gfmFootnoteDefinitionLabel"),l}return vX(b)||(e=!0),h++,a.consume(b),92===b?k:j}function k(b){return 91===b||92===b||93===b?(a.consume(b),h++,j):j(b)}function l(b){return 58===b?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),g.includes(d)||g.push(d),v0(a,m,"gfmFootnoteDefinitionWhitespace")):c(b)}function m(a){return b(a)}}function yT(a,b,c){return a.check(v4,b,a.attempt(yO,b,c))}function yU(a){a.exit("gfmFootnoteDefinition")}class yV{constructor(){this.map=[]}add(a,b,c){!function(a,b,c,d){let e=0;if(0!==c||0!==d.length){for(;e<a.map.length;){if(a.map[e][0]===b){a.map[e][1]+=c,a.map[e][2].push(...d);return}e+=1}a.map.push([b,c,d])}}(this,a,b,c)}consume(a){if(this.map.sort(function(a,b){return a[0]-b[0]}),0===this.map.length)return;let b=this.map.length,c=[];for(;b>0;)b-=1,c.push(a.slice(this.map[b][0]+this.map[b][1]),this.map[b][2]),a.length=this.map[b][0];c.push(a.slice()),a.length=0;let d=c.pop();for(;d;){for(let b of d)a.push(b);d=c.pop()}this.map.length=0}}function yW(a,b,c){let d,e=this,f=0,g=0;return function(a){let b=e.events.length-1;for(;b>-1;){let a=e.events[b][1].type;if("lineEnding"===a||"linePrefix"===a)b--;else break}let d=b>-1?e.events[b][1].type:null,f="tableHead"===d||"tableRow"===d?s:h;return f===s&&e.parser.lazy[e.now().line]?c(a):f(a)};function h(b){var c;return a.enter("tableHead"),a.enter("tableRow"),124===(c=b)||(d=!0,g+=1),i(c)}function i(b){return null===b?c(b):vW(b)?g>1?(g=0,e.interrupt=!0,a.exit("tableRow"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),l):c(b):vY(b)?v0(a,i,"whitespace")(b):(g+=1,d&&(d=!1,f+=1),124===b)?(a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),d=!0,i):(a.enter("data"),j(b))}function j(b){return null===b||124===b||vX(b)?(a.exit("data"),i(b)):(a.consume(b),92===b?k:j)}function k(b){return 92===b||124===b?(a.consume(b),j):j(b)}function l(b){return(e.interrupt=!1,e.parser.lazy[e.now().line])?c(b):(a.enter("tableDelimiterRow"),d=!1,vY(b))?v0(a,m,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):m(b)}function m(b){return 45===b||58===b?o(b):124===b?(d=!0,a.enter("tableCellDivider"),a.consume(b),a.exit("tableCellDivider"),n):c(b)}function n(b){return vY(b)?v0(a,o,"whitespace")(b):o(b)}function o(b){return 58===b?(g+=1,d=!0,a.enter("tableDelimiterMarker"),a.consume(b),a.exit("tableDelimiterMarker"),p):45===b?(g+=1,p(b)):null===b||vW(b)?r(b):c(b)}function p(b){return 45===b?(a.enter("tableDelimiterFiller"),function b(c){return 45===c?(a.consume(c),b):58===c?(d=!0,a.exit("tableDelimiterFiller"),a.enter("tableDelimiterMarker"),a.consume(c),a.exit("tableDelimiterMarker"),q):(a.exit("tableDelimiterFiller"),q(c))}(b)):c(b)}function q(b){return vY(b)?v0(a,r,"whitespace")(b):r(b)}function r(e){if(124===e)return m(e);if(null===e||vW(e))return d&&f===g?(a.exit("tableDelimiterRow"),a.exit("tableHead"),b(e)):c(e);return c(e)}function s(b){return a.enter("tableRow"),t(b)}function t(c){return 124===c?(a.enter("tableCellDivider"),a.consume(c),a.exit("tableCellDivider"),t):null===c||vW(c)?(a.exit("tableRow"),b(c)):vY(c)?v0(a,t,"whitespace")(c):(a.enter("data"),u(c))}function u(b){return null===b||124===b||vX(b)?(a.exit("data"),t(b)):(a.consume(b),92===b?v:u)}function v(b){return 92===b||124===b?(a.consume(b),u):u(b)}}function yX(a,b){let c,d,e,f=-1,g=!0,h=0,i=[0,0,0,0],j=[0,0,0,0],k=!1,l=0,m=new yV;for(;++f<a.length;){let n=a[f],o=n[1];"enter"===n[0]?"tableHead"===o.type?(k=!1,0!==l&&(yZ(m,b,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",c,b]])):"tableRow"===o.type||"tableDelimiterRow"===o.type?(g=!0,e=void 0,i=[0,0,0,0],j=[0,f+1,0,0],k&&(k=!1,d={type:"tableBody",start:Object.assign({},o.start),end:Object.assign({},o.end)},m.add(f,0,[["enter",d,b]])),h="tableDelimiterRow"===o.type?2:d?3:1):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)?(g=!1,0===j[2]&&(0!==i[1]&&(j[0]=j[1],e=yY(m,b,i,h,void 0,e),i=[0,0,0,0]),j[2]=f)):"tableCellDivider"===o.type&&(g?g=!1:(0!==i[1]&&(j[0]=j[1],e=yY(m,b,i,h,void 0,e)),j=[(i=j)[1],f,0,0])):"tableHead"===o.type?(k=!0,l=f):"tableRow"===o.type||"tableDelimiterRow"===o.type?(l=f,0!==i[1]?(j[0]=j[1],e=yY(m,b,i,h,f,e)):0!==j[1]&&(e=yY(m,b,j,h,f,e)),h=0):h&&("data"===o.type||"tableDelimiterMarker"===o.type||"tableDelimiterFiller"===o.type)&&(j[3]=f)}for(0!==l&&yZ(m,b,l,c,d),m.consume(b.events),f=-1;++f<b.events.length;){let a=b.events[f];"enter"===a[0]&&"table"===a[1].type&&(a[1]._align=function(a,b){let c=!1,d=[];for(;b<a.length;){let e=a[b];if(c){if("enter"===e[0])"tableContent"===e[1].type&&d.push("tableDelimiterMarker"===a[b+1][1].type?"left":"none");else if("tableContent"===e[1].type){if("tableDelimiterMarker"===a[b-1][1].type){let a=d.length-1;d[a]="left"===d[a]?"center":"right"}}else if("tableDelimiterRow"===e[1].type)break}else"enter"===e[0]&&"tableDelimiterRow"===e[1].type&&(c=!0);b+=1}return d}(b.events,f))}return a}function yY(a,b,c,d,e,f){0!==c[0]&&(f.end=Object.assign({},y$(b.events,c[0])),a.add(c[0],0,[["exit",f,b]]));let g=y$(b.events,c[1]);if(f={type:1===d?"tableHeader":2===d?"tableDelimiter":"tableData",start:Object.assign({},g),end:Object.assign({},g)},a.add(c[1],0,[["enter",f,b]]),0!==c[2]){let e=y$(b.events,c[2]),f=y$(b.events,c[3]),g={type:"tableContent",start:Object.assign({},e),end:Object.assign({},f)};if(a.add(c[2],0,[["enter",g,b]]),2!==d){let d=b.events[c[2]],e=b.events[c[3]];if(d[1].end=Object.assign({},e[1].end),d[1].type="chunkText",d[1].contentType="text",c[3]>c[2]+1){let b=c[2]+1,d=c[3]-c[2]-1;a.add(b,d,[])}}a.add(c[3]+1,0,[["exit",g,b]])}return void 0!==e&&(f.end=Object.assign({},y$(b.events,e)),a.add(e,0,[["exit",f,b]]),f=void 0),f}function yZ(a,b,c,d,e){let f=[],g=y$(b.events,c);e&&(e.end=Object.assign({},g),f.push(["exit",e,b])),d.end=Object.assign({},g),f.push(["exit",d,b]),a.add(c+1,0,f)}function y$(a,b){let c=a[b],d="enter"===c[0]?"start":"end";return c[1][d]}let y_={name:"tasklistCheck",tokenize:function(a,b,c){let d=this;return function(b){return null===d.previous&&d._gfmTasklistFirstContentOfListItem?(a.enter("taskListCheck"),a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),e):c(b)};function e(b){return vX(b)?(a.enter("taskListCheckValueUnchecked"),a.consume(b),a.exit("taskListCheckValueUnchecked"),f):88===b||120===b?(a.enter("taskListCheckValueChecked"),a.consume(b),a.exit("taskListCheckValueChecked"),f):c(b)}function f(b){return 93===b?(a.enter("taskListCheckMarker"),a.consume(b),a.exit("taskListCheckMarker"),a.exit("taskListCheck"),g):c(b)}function g(d){return vW(d)?b(d):vY(d)?a.check({tokenize:y0},b,c)(d):c(d)}}};function y0(a,b,c){return v0(a,function(a){return null===a?c(a):b(a)},"whitespace")}let y1={};function y2(a){let b,c,d,e=a||y1,f=this.data(),g=f.micromarkExtensions||(f.micromarkExtensions=[]),h=f.fromMarkdownExtensions||(f.fromMarkdownExtensions=[]),i=f.toMarkdownExtensions||(f.toMarkdownExtensions=[]);g.push(vO([{text:yH},{document:{91:{name:"gfmFootnoteDefinition",tokenize:yS,continuation:{tokenize:yT},exit:yU}},text:{91:{name:"gfmFootnoteCall",tokenize:yR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yP,resolveTo:yQ}}},(b=(e||{}).singleTilde,c={name:"strikethrough",tokenize:function(a,c,d){let e=this.previous,f=this.events,g=0;return function(h){return 126===e&&"characterEscape"!==f[f.length-1][1].type?d(h):(a.enter("strikethroughSequenceTemporary"),function f(h){let i=wh(e);if(126===h)return g>1?d(h):(a.consume(h),g++,f);if(g<2&&!b)return d(h);let j=a.exit("strikethroughSequenceTemporary"),k=wh(h);return j._open=!k||2===k&&!!i,j._close=!i||2===i&&!!k,c(h)}(h))}},resolveAll:function(a,b){let c=-1;for(;++c<a.length;)if("enter"===a[c][0]&&"strikethroughSequenceTemporary"===a[c][1].type&&a[c][1]._close){let d=c;for(;d--;)if("exit"===a[d][0]&&"strikethroughSequenceTemporary"===a[d][1].type&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset==a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";let e={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},g=[["enter",e,b],["enter",a[d][1],b],["exit",a[d][1],b],["enter",f,b]],h=b.parser.constructs.insideSpan.null;h&&vL(g,g.length,0,wi(h,a.slice(d+1,c),b)),vL(g,g.length,0,[["exit",f,b],["enter",a[c][1],b],["exit",a[c][1],b],["exit",e,b]]),vL(a,d-1,c-d+3,g),c=d+g.length-2;break}}for(c=-1;++c<a.length;)"strikethroughSequenceTemporary"===a[c][1].type&&(a[c][1].type="data");return a}},null==b&&(b=!0),{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:yW,resolveAll:yX}}},{text:{91:y_}}])),h.push([{transforms:[x2],enter:{literalAutolink:xY,literalAutolinkEmail:xZ,literalAutolinkHttp:xZ,literalAutolinkWww:xZ},exit:{literalAutolink:x1,literalAutolinkEmail:x0,literalAutolinkHttp:x$,literalAutolinkWww:x_}},{enter:{gfmFootnoteCallString:x6,gfmFootnoteCall:x7,gfmFootnoteDefinitionLabelString:x8,gfmFootnoteDefinition:x9},exit:{gfmFootnoteCallString:ya,gfmFootnoteCall:yb,gfmFootnoteDefinitionLabelString:yc,gfmFootnoteDefinition:yd}},{canContainEols:["delete"],enter:{strikethrough:yi},exit:{strikethrough:yj}},{enter:{table:yp,tableData:yt,tableHeader:yt,tableRow:yr},exit:{codeText:yu,table:yq,tableData:ys,tableHeader:ys,tableRow:ys}},{exit:{taskListCheckValueChecked:yw,taskListCheckValueUnchecked:yw,paragraph:yx}}]),i.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xW,notInConstruct:xX},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xW,notInConstruct:xX},{character:":",before:"[ps]",after:"\\/",inConstruct:xW,notInConstruct:xX}]},(d=!1,e&&e.firstLineBlank&&(d=!0),{handlers:{footnoteDefinition:function(a,b,c,e){let f=c.createTracker(e),g=f.move("[^"),h=c.enter("footnoteDefinition"),i=c.enter("label");return g+=f.move(c.safe(c.associationId(a),{before:g,after:"]"})),i(),g+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),g+=f.move((d?"\n":" ")+c.indentLines(c.containerFlow(a,f.current()),d?yg:yf))),h(),g},footnoteReference:ye},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yh}],handlers:{delete:yk}},function(a){let b=a||{},c=b.tableCellPadding,d=b.tablePipeAlign,e=b.stringLength,f=c?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(a,b,c){let d=yn(a,b,c);return c.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d},table:function(a,b,c,d){return h(function(a,b,c){let d=a.children,e=-1,f=[],g=b.enter("table");for(;++e<d.length;)f[e]=i(d[e],b,c);return g(),f}(a,c,d),a.align)},tableCell:g,tableRow:function(a,b,c,d){let e=h([i(a,c,d)]);return e.slice(0,e.indexOf("\n"))}}};function g(a,b,c,d){let e=c.enter("tableCell"),g=c.enter("phrasing"),h=c.containerPhrasing(a,{...d,before:f,after:f});return g(),e(),h}function h(a,b){return function(a,b){let c=b||{},d=(c.align||[]).concat(),e=c.stringLength||yl,f=[],g=[],h=[],i=[],j=0,k=-1;for(;++k<a.length;){let b=[],d=[],f=-1;for(a[k].length>j&&(j=a[k].length);++f<a[k].length;){var l;let g=null==(l=a[k][f])?"":String(l);if(!1!==c.alignDelimiters){let a=e(g);d[f]=a,(void 0===i[f]||a>i[f])&&(i[f]=a)}b.push(g)}g[k]=b,h[k]=d}let m=-1;if("object"==typeof d&&"length"in d)for(;++m<j;)f[m]=ym(d[m]);else{let a=ym(d);for(;++m<j;)f[m]=a}m=-1;let n=[],o=[];for(;++m<j;){let a=f[m],b="",d="";99===a?(b=":",d=":"):108===a?b=":":114===a&&(d=":");let e=!1===c.alignDelimiters?1:Math.max(1,i[m]-b.length-d.length),g=b+"-".repeat(e)+d;!1!==c.alignDelimiters&&((e=b.length+e+d.length)>i[m]&&(i[m]=e),o[m]=e),n[m]=g}g.splice(1,0,n),h.splice(1,0,o),k=-1;let p=[];for(;++k<g.length;){let a=g[k],b=h[k];m=-1;let d=[];for(;++m<j;){let e=a[m]||"",g="",h="";if(!1!==c.alignDelimiters){let a=i[m]-(b[m]||0),c=f[m];114===c?g=" ".repeat(a):99===c?a%2?(g=" ".repeat(a/2+.5),h=" ".repeat(a/2-.5)):h=g=" ".repeat(a/2):h=" ".repeat(a)}!1===c.delimiterStart||m||d.push("|"),!1!==c.padding&&(!1!==c.alignDelimiters||""!==e)&&(!1!==c.delimiterStart||m)&&d.push(" "),!1!==c.alignDelimiters&&d.push(g),d.push(e),!1!==c.alignDelimiters&&d.push(h),!1!==c.padding&&d.push(" "),(!1!==c.delimiterEnd||m!==j-1)&&d.push("|")}p.push(!1===c.delimiterEnd?d.join("").replace(/ +$/,""):d.join(""))}return p.join("\n")}(a,{align:b,alignDelimiters:d,padding:c,stringLength:e})}function i(a,b,c){let d=a.children,e=-1,f=[],h=b.enter("tableRow");for(;++e<d.length;)f[e]=g(d[e],a,b,c);return h(),f}}(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:yy}}]})}let y3={tokenize:function(a,b,c){let d=this,e=d.events[d.events.length-1],f=e&&"linePrefix"===e[1].type?e[2].sliceSerialize(e[1],!0).length:0,g=0;return function(b){return a.enter("mathFlow"),a.enter("mathFlowFence"),a.enter("mathFlowFenceSequence"),function b(d){return 36===d?(a.consume(d),g++,b):g<2?c(d):(a.exit("mathFlowFenceSequence"),v0(a,h,"whitespace")(d))}(b)};function h(b){return null===b||vW(b)?i(b):(a.enter("mathFlowFenceMeta"),a.enter("chunkString",{contentType:"string"}),function b(d){return null===d||vW(d)?(a.exit("chunkString"),a.exit("mathFlowFenceMeta"),i(d)):36===d?c(d):(a.consume(d),b)}(b))}function i(c){return(a.exit("mathFlowFence"),d.interrupt)?b(c):a.attempt(y4,j,m)(c)}function j(b){return a.attempt({tokenize:n,partial:!0},m,k)(b)}function k(b){return(f?v0(a,l,"linePrefix",f+1):l)(b)}function l(b){return null===b?m(b):vW(b)?a.attempt(y4,j,m)(b):(a.enter("mathFlowValue"),function b(c){return null===c||vW(c)?(a.exit("mathFlowValue"),l(c)):(a.consume(c),b)}(b))}function m(c){return a.exit("mathFlow"),b(c)}function n(a,b,c){let e=0;return v0(a,function(b){return a.enter("mathFlowFence"),a.enter("mathFlowFenceSequence"),function b(d){return 36===d?(e++,a.consume(d),b):e<g?c(d):(a.exit("mathFlowFenceSequence"),v0(a,f,"whitespace")(d))}(b)},"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function f(d){return null===d||vW(d)?(a.exit("mathFlowFence"),b(d)):c(d)}}},concrete:!0,name:"mathFlow"},y4={tokenize:function(a,b,c){let d=this;return function(c){return null===c?b(c):(a.enter("lineEnding"),a.consume(c),a.exit("lineEnding"),e)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}},partial:!0};function y5(a){let b,c,d=a.length-4,e=3;if(("lineEnding"===a[3][1].type||"space"===a[e][1].type)&&("lineEnding"===a[d][1].type||"space"===a[d][1].type)){for(b=e;++b<d;)if("mathTextData"===a[b][1].type){a[d][1].type="mathTextPadding",a[e][1].type="mathTextPadding",e+=2,d-=2;break}}for(b=e-1,d++;++b<=d;)void 0===c?b!==d&&"lineEnding"!==a[b][1].type&&(c=b):(b===d||"lineEnding"===a[b][1].type)&&(a[c][1].type="mathTextData",b!==c+2&&(a[c][1].end=a[b-1][1].end,a.splice(c+2,b-c-2),d-=b-c-2,b=c+2),c=void 0);return a}function y6(a){return 36!==a||"characterEscape"===this.events[this.events.length-1][1].type}let y7={};function y8(a){let b,c=a||y7,d=this.data(),e=d.micromarkExtensions||(d.micromarkExtensions=[]),f=d.fromMarkdownExtensions||(d.fromMarkdownExtensions=[]),g=d.toMarkdownExtensions||(d.toMarkdownExtensions=[]);e.push({flow:{36:y3},text:{36:(null==(b=(c||{}).singleDollarTextMath)&&(b=!0),{tokenize:function(a,c,d){let e,f,g=0;return function(c){return a.enter("mathText"),a.enter("mathTextSequence"),function c(e){return 36===e?(a.consume(e),g++,c):g<2&&!b?d(e):(a.exit("mathTextSequence"),h(e))}(c)};function h(b){return null===b?d(b):36===b?(f=a.enter("mathTextSequence"),e=0,function b(d){return 36===d?(a.consume(d),e++,b):e===g?(a.exit("mathTextSequence"),a.exit("mathText"),c(d)):(f.type="mathTextData",i(d))}(b)):32===b?(a.enter("space"),a.consume(b),a.exit("space"),h):vW(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),h):(a.enter("mathTextData"),i(b))}function i(b){return null===b||32===b||36===b||vW(b)?(a.exit("mathTextData"),h(b)):(a.consume(b),i)}},resolve:y5,previous:y6,name:"mathText"})}}),f.push(function(){return{enter:{mathFlow:function(a){this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[{type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]}]}},a)},mathFlowFenceMeta:function(){this.buffer()},mathText:function(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}},exit:{mathFlow:function(a){let b=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),c=this.stack[this.stack.length-1];uB("math"===c.type),this.exit(a),c.value=b;let d=c.data.hChildren[0];uB("element"===d.type),uB("code"===d.tagName),d.children.push({type:"text",value:b}),this.data.mathFlowInside=void 0},mathFlowFence:function(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)},mathFlowFenceMeta:function(){let a=this.resume(),b=this.stack[this.stack.length-1];uB("math"===b.type),b.meta=a},mathFlowValue:a,mathText:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];uB("inlineMath"===c.type),this.exit(a),c.value=b,c.data.hChildren.push({type:"text",value:b})},mathTextData:a}};function a(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}()),g.push(function(a){let b=(a||{}).singleDollarTextMath;return null==b&&(b=!0),c.peek=function(){return"$"},{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:"\n",inConstruct:"mathFlowMeta"},{character:"$",after:b?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:function(a,b,c,d){let e=a.value||"",f=c.createTracker(d),g="$".repeat(Math.max(function(a){let b=String(a),c=b.indexOf("$"),d=c,e=0,f=0;!1;for(;-1!==c;)c===d?++e>f&&(f=e):e=1,d=c+1,c=b.indexOf("$",d);return f}(e)+1,2)),h=c.enter("mathFlow"),i=f.move(g);if(a.meta){let b=c.enter("mathFlowMeta");i+=f.move(c.safe(a.meta,{after:"\n",before:i,encode:["$"],...f.current()})),b()}return i+=f.move("\n"),e&&(i+=f.move(e+"\n")),i+=f.move(g),h(),i},inlineMath:c}};function c(a,c,d){let e=a.value||"",f=1;for(!b&&f++;RegExp("(^|[^$])"+"\\$".repeat(f)+"([^$]|$)").test(e);)f++;let g="$".repeat(f);/[^ \r\n]/.test(e)&&(/^[ \r\n]/.test(e)&&/[ \r\n]$/.test(e)||/^\$|\$$/.test(e))&&(e=" "+e+" ");let h=-1;for(;++h<d.unsafe.length;){let a,b=d.unsafe[h];if(!b.atBreak)continue;let c=d.compilePattern(b);for(;a=c.exec(e);){let b=a.index;10===e.codePointAt(b)&&13===e.codePointAt(b-1)&&b--,e=e.slice(0,b)+" "+e.slice(a.index+1)}}return g+e+g}}(c))}let y9=/[#.]/g;function za(a,b,c){let d=c?function(a){let b=new Map;for(let c of a)b.set(c.toLowerCase(),c);return b}(c):void 0;return function(c,e,...f){let g;if(null==c)g={type:"root",children:[]},f.unshift(e);else{let h=(g=function(a,b){let c,d,e=a||"",f={},g=0;for(;g<e.length;){y9.lastIndex=g;let a=y9.exec(e),b=e.slice(g,a?a.index:e.length);b&&(c?"#"===c?f.id=b:Array.isArray(f.className)?f.className.push(b):f.className=[b]:d=b,g+=b.length),a&&(c=a[0],g++)}return{type:"element",tagName:d||b||"div",properties:f,children:[]}}(c,b)).tagName.toLowerCase(),i=d?d.get(h):void 0;if(g.tagName=i||h,function(a){if(null===a||"object"!=typeof a||Array.isArray(a))return!0;if("string"!=typeof a.type)return!1;for(let b of Object.keys(a)){let c=a[b];if(c&&"object"==typeof c){if(!Array.isArray(c))return!0;for(let a of c)if("number"!=typeof a&&"string"!=typeof a)return!0}}return!!("children"in a&&Array.isArray(a.children))}(e))f.unshift(e);else for(let[b,c]of Object.entries(e))!function(a,b,c,d){let e,f=u0(a,c);if(null!=d){if("number"==typeof d){if(Number.isNaN(d))return;e=d}else e="boolean"==typeof d?d:"string"==typeof d?f.spaceSeparated?vh(d):f.commaSeparated?uD(d):f.commaOrSpaceSeparated?vh(uD(d).join(" ")):zb(f,f.property,d):Array.isArray(d)?[...d]:"style"===f.property?function(a){let b=[];for(let[c,d]of Object.entries(a))b.push([c,d].join(": "));return b.join("; ")}(d):String(d);if(Array.isArray(e)){let a=[];for(let b of e)a.push(zb(f,f.property,b));e=a}"className"===f.property&&Array.isArray(b.className)&&(e=b.className.concat(e)),b[f.property]=e}}(a,g.properties,b,c)}for(let a of f)!function a(b,c){if(null==c);else if("number"==typeof c||"string"==typeof c)b.push({type:"text",value:String(c)});else if(Array.isArray(c))for(let d of c)a(b,d);else if("object"==typeof c&&"type"in c)"root"===c.type?a(b,c.children):b.push(c);else throw Error("Expected node, nodes, or string, got `"+c+"`")}(g.children,a);return"element"===g.type&&"template"===g.tagName&&(g.content={type:"root",children:g.children},g.children=[]),g}}function zb(a,b,c){if("string"==typeof c){if(a.number&&c&&!Number.isNaN(Number(c)))return Number(c);if((a.boolean||a.overloadedBoolean)&&(""===c||uY(c)===uY(b)))return!0}return c}let zc=za(vf,"div"),zd=za(vg,"g",["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]);function ze(a,b){let c=a.indexOf("\r",b),d=a.indexOf("\n",b);return -1===d?c:-1===c||c+1===d?d:c<d?c:d}let zf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},zg={}.hasOwnProperty,zh=Object.prototype;function zi(a,b){let c=b||{};return zj({file:c.file||void 0,location:!1,schema:"svg"===c.space?vg:vf,verbose:c.verbose||!1},a)}function zj(a,b){let c;switch(b.nodeName){case"#comment":return c={type:"comment",value:b.data},zl(a,b,c),c;case"#document":case"#document-fragment":{let d="mode"in b&&("quirks"===b.mode||"limited-quirks"===b.mode);if(c={type:"root",children:zk(a,b.childNodes),data:{quirksMode:d}},a.file&&a.location){let b,d,e=String(a.file),f=(b=String(e),d=[],{toOffset:function(a){if(a&&"number"==typeof a.line&&"number"==typeof a.column&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;d.length<a.line;){let a=d[d.length-1],c=ze(b,a),e=-1===c?b.length+1:c+1;if(a===e)break;d.push(e)}let c=(a.line>1?d[a.line-2]:0)+a.column-1;if(c<d[a.line-1])return c}},toPoint:function(a){if("number"==typeof a&&a>-1&&a<=b.length){let c=0;for(;;){let e=d[c];if(void 0===e){let a=ze(b,d[c-1]);e=-1===a?b.length+1:a+1,d[c]=e}if(e>a)return{line:c+1,column:a-(c>0?d[c-1]:0)+1,offset:a};c++}}}}),g=f.toPoint(0),h=f.toPoint(e.length);uB(g,"expected `start`"),uB(h,"expected `end`"),c.position={start:g,end:h}}return c}case"#documentType":return zl(a,b,c={type:"doctype"}),c;case"#text":return c={type:"text",value:b.value},zl(a,b,c),c;default:return function(a,b){let c=a.schema;a.schema=b.namespaceURI===zf.svg?vg:vf;let d=-1,e={};for(;++d<b.attrs.length;){let a=b.attrs[d],c=(a.prefix?a.prefix+":":"")+a.name;zg.call(zh,c)||(e[c]=a.value)}let f=("svg"===a.schema.space?zd:zc)(b.tagName,e,zk(a,b.childNodes));if(zl(a,b,f),"template"===f.tagName){let c=b.sourceCodeLocation,d=c&&c.startTag&&zm(c.startTag),e=c&&c.endTag&&zm(c.endTag),g=zj(a,b.content);d&&e&&a.file&&(g.position={start:d.end,end:e.start}),f.content=g}return a.schema=c,f}(a,b)}}function zk(a,b){let c=-1,d=[];for(;++c<b.length;){let e=zj(a,b[c]);d.push(e)}return d}function zl(a,b,c){if("sourceCodeLocation"in b&&b.sourceCodeLocation&&a.file){let d=function(a,b,c){let d=zm(c);if("element"===b.type){let e=b.children[b.children.length-1];if(d&&!c.endTag&&e&&e.position&&e.position.end&&(d.end=Object.assign({},e.position.end)),a.verbose){let d,e={};if(c.attrs)for(d in c.attrs)zg.call(c.attrs,d)&&(e[u0(a.schema,d).property]=zm(c.attrs[d]));uB(c.startTag,"a start tag should exist");let f=zm(c.startTag),g=c.endTag?zm(c.endTag):void 0,h={opening:f};g&&(h.closing=g),h.properties=e,b.data={position:h}}}return d}(a,c,b.sourceCodeLocation);d&&(a.location=!0,c.position=d)}}function zm(a){let b=zn({line:a.startLine,column:a.startCol,offset:a.startOffset}),c=zn({line:a.endLine,column:a.endCol,offset:a.endOffset});return b||c?{start:b,end:c}:void 0}function zn(a){return a.line&&a.column?a:void 0}let zo={}.hasOwnProperty;function zp(a,b){let c=b||{};function d(b,...c){let e=d.invalid,f=d.handlers;if(b&&zo.call(b,a)){let c=String(b[a]);e=zo.call(f,c)?f[c]:d.unknown}if(e)return e.call(this,b,...c)}return d.handlers=c.handlers||{},d.invalid=c.invalid,d.unknown=c.unknown,d}let zq={}.hasOwnProperty,zr=zp("type",{handlers:{root:function(a,b){let c={nodeName:"#document",mode:(a.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return c.childNodes=zs(a.children,c,b),zt(a,c),c},element:function(a,b){var c,d;let e,f,g=b;"element"===a.type&&"svg"===a.tagName.toLowerCase()&&"html"===b.space&&(g=vg);let h=[];if(a.properties){for(e in a.properties)if("children"!==e&&zq.call(a.properties,e)){let b=function(a,b,c){let d=u0(a,b);if(!1===c||null==c||"number"==typeof c&&Number.isNaN(c)||!c&&d.boolean)return;Array.isArray(c)&&(c=d.commaSeparated?uE(c):vi(c));let e={name:d.attribute,value:!0===c?"":String(c)};if(d.space&&"html"!==d.space&&"svg"!==d.space){let a=e.name.indexOf(":");a<0?e.prefix="":(e.name=e.name.slice(a+1),e.prefix=d.attribute.slice(0,a)),e.namespace=zf[d.space]}return e}(g,e,a.properties[e]);b&&h.push(b)}}let i=g.space;uB(i);let j={nodeName:a.tagName,tagName:a.tagName,attrs:h,namespaceURI:zf[i],childNodes:[],parentNode:null};return j.childNodes=zs(a.children,j,g),zt(a,j),"template"===a.tagName&&a.content&&(c=a.content,d=g,(f={nodeName:"#document-fragment",childNodes:[]}).childNodes=zs(c.children,f,d),zt(c,f),j.content=f),j},text:function(a){let b={nodeName:"#text",value:a.value,parentNode:null};return zt(a,b),b},comment:function(a){let b={nodeName:"#comment",data:a.value,parentNode:null};return zt(a,b),b},doctype:function(a){let b={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return zt(a,b),b}}});function zs(a,b,c){let d=-1,e=[];if(a)for(;++d<a.length;){let f=zr(a[d],c);f.parentNode=b,e.push(f)}return e}function zt(a,b){let c=a.position;c&&c.start&&c.end&&(uB("number"==typeof c.start.offset),uB("number"==typeof c.end.offset),b.sourceCodeLocation={startLine:c.start.line,startCol:c.start.column,startOffset:c.start.offset,endLine:c.end.line,endCol:c.end.column,endOffset:c.end.offset})}let zu=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],zv=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]);(M=ak||(ak={}))[M.EOF=-1]="EOF",M[M.NULL=0]="NULL",M[M.TABULATION=9]="TABULATION",M[M.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",M[M.LINE_FEED=10]="LINE_FEED",M[M.FORM_FEED=12]="FORM_FEED",M[M.SPACE=32]="SPACE",M[M.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",M[M.QUOTATION_MARK=34]="QUOTATION_MARK",M[M.AMPERSAND=38]="AMPERSAND",M[M.APOSTROPHE=39]="APOSTROPHE",M[M.HYPHEN_MINUS=45]="HYPHEN_MINUS",M[M.SOLIDUS=47]="SOLIDUS",M[M.DIGIT_0=48]="DIGIT_0",M[M.DIGIT_9=57]="DIGIT_9",M[M.SEMICOLON=59]="SEMICOLON",M[M.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",M[M.EQUALS_SIGN=61]="EQUALS_SIGN",M[M.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",M[M.QUESTION_MARK=63]="QUESTION_MARK",M[M.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",M[M.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",M[M.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",M[M.GRAVE_ACCENT=96]="GRAVE_ACCENT",M[M.LATIN_SMALL_A=97]="LATIN_SMALL_A",M[M.LATIN_SMALL_Z=122]="LATIN_SMALL_Z";let zw="[CDATA[",zx="doctype",zy="script";function zz(a){return a>=55296&&a<=57343}function zA(a){return 32!==a&&10!==a&&13!==a&&9!==a&&12!==a&&a>=1&&a<=31||a>=127&&a<=159}function zB(a){return a>=64976&&a<=65007||zv.has(a)}(N=al||(al={})).controlCharacterInInputStream="control-character-in-input-stream",N.noncharacterInInputStream="noncharacter-in-input-stream",N.surrogateInInputStream="surrogate-in-input-stream",N.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",N.endTagWithAttributes="end-tag-with-attributes",N.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",N.unexpectedSolidusInTag="unexpected-solidus-in-tag",N.unexpectedNullCharacter="unexpected-null-character",N.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",N.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",N.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",N.missingEndTagName="missing-end-tag-name",N.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",N.unknownNamedCharacterReference="unknown-named-character-reference",N.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",N.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",N.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",N.eofBeforeTagName="eof-before-tag-name",N.eofInTag="eof-in-tag",N.missingAttributeValue="missing-attribute-value",N.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",N.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",N.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",N.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",N.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",N.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",N.missingDoctypePublicIdentifier="missing-doctype-public-identifier",N.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",N.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",N.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",N.cdataInHtmlContent="cdata-in-html-content",N.incorrectlyOpenedComment="incorrectly-opened-comment",N.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",N.eofInDoctype="eof-in-doctype",N.nestedComment="nested-comment",N.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",N.eofInComment="eof-in-comment",N.incorrectlyClosedComment="incorrectly-closed-comment",N.eofInCdata="eof-in-cdata",N.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",N.nullCharacterReference="null-character-reference",N.surrogateCharacterReference="surrogate-character-reference",N.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",N.controlCharacterReference="control-character-reference",N.noncharacterCharacterReference="noncharacter-character-reference",N.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",N.missingDoctypeName="missing-doctype-name",N.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",N.duplicateAttribute="duplicate-attribute",N.nonConformingDoctype="non-conforming-doctype",N.missingDoctype="missing-doctype",N.misplacedDoctype="misplaced-doctype",N.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",N.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",N.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",N.openElementsLeftAfterEof="open-elements-left-after-eof",N.abandonedHeadElementChild="abandoned-head-element-child",N.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",N.nestedNoscriptInHead="nested-noscript-in-head",N.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text";class zC{constructor(a){this.handler=a,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(a,b){let{line:c,col:d,offset:e}=this,f=d+b,g=e+b;return{code:a,startLine:c,endLine:c,startCol:f,endCol:f,startOffset:g,endOffset:g}}_err(a){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(a,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(a){if(this.pos!==this.html.length-1){let b=this.html.charCodeAt(this.pos+1);if(b>=56320&&b<=57343)return this.pos++,this._addGap(),(a-55296)*1024+9216+b}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ak.EOF;return this._err(al.surrogateInInputStream),a}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(a,b){this.html.length>0?this.html+=a:this.html=a,this.endOfChunkHit=!1,this.lastChunkWritten=b}insertHtmlAtCurrentPos(a){this.html=this.html.substring(0,this.pos+1)+a+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(a,b){if(this.pos+a.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(b)return this.html.startsWith(a,this.pos);for(let b=0;b<a.length;b++)if((32|this.html.charCodeAt(this.pos+b))!==a.charCodeAt(b))return!1;return!0}peek(a){let b=this.pos+a;if(b>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ak.EOF;let c=this.html.charCodeAt(b);return c===ak.CARRIAGE_RETURN?ak.LINE_FEED:c}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ak.EOF;let a=this.html.charCodeAt(this.pos);return a===ak.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ak.LINE_FEED):a===ak.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,zz(a)&&(a=this._processSurrogate(a)),null===this.handler.onParseError||a>31&&a<127||a===ak.LINE_FEED||a===ak.CARRIAGE_RETURN||a>159&&a<64976||this._checkForProblematicCharacters(a),a)}_checkForProblematicCharacters(a){zA(a)?this._err(al.controlCharacterInInputStream):zB(a)&&this._err(al.noncharacterInInputStream)}retreat(a){for(this.pos-=a;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}function zD(a,b){for(let c=a.attrs.length-1;c>=0;c--)if(a.attrs[c].name===b)return a.attrs[c].value;return null}(O=am||(am={}))[O.CHARACTER=0]="CHARACTER",O[O.NULL_CHARACTER=1]="NULL_CHARACTER",O[O.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",O[O.START_TAG=3]="START_TAG",O[O.END_TAG=4]="END_TAG",O[O.COMMENT=5]="COMMENT",O[O.DOCTYPE=6]="DOCTYPE",O[O.EOF=7]="EOF",O[O.HIBERNATION=8]="HIBERNATION",a.s(["TokenType",0,am,"getTokenAttr",0,zD],61659);let zE=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(a=>a.charCodeAt(0))),zF=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function zG(a){return a>=ao.ZERO&&a<=ao.NINE}an=String.fromCodePoint,(P=ao||(ao={}))[P.NUM=35]="NUM",P[P.SEMI=59]="SEMI",P[P.EQUALS=61]="EQUALS",P[P.ZERO=48]="ZERO",P[P.NINE=57]="NINE",P[P.LOWER_A=97]="LOWER_A",P[P.LOWER_F=102]="LOWER_F",P[P.LOWER_X=120]="LOWER_X",P[P.LOWER_Z=122]="LOWER_Z",P[P.UPPER_A=65]="UPPER_A",P[P.UPPER_F=70]="UPPER_F",P[P.UPPER_Z=90]="UPPER_Z",(Q=ap||(ap={}))[Q.VALUE_LENGTH=49152]="VALUE_LENGTH",Q[Q.BRANCH_LENGTH=16256]="BRANCH_LENGTH",Q[Q.JUMP_TABLE=127]="JUMP_TABLE",(R=aq||(aq={}))[R.EntityStart=0]="EntityStart",R[R.NumericStart=1]="NumericStart",R[R.NumericDecimal=2]="NumericDecimal",R[R.NumericHex=3]="NumericHex",R[R.NamedEntity=4]="NamedEntity",(S=ar||(ar={}))[S.Legacy=0]="Legacy",S[S.Strict=1]="Strict",S[S.Attribute=2]="Attribute";class zH{constructor(a,b,c){this.decodeTree=a,this.emitCodePoint=b,this.errors=c,this.state=aq.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ar.Strict}startEntity(a){this.decodeMode=a,this.state=aq.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(a,b){switch(this.state){case aq.EntityStart:if(a.charCodeAt(b)===ao.NUM)return this.state=aq.NumericStart,this.consumed+=1,this.stateNumericStart(a,b+1);return this.state=aq.NamedEntity,this.stateNamedEntity(a,b);case aq.NumericStart:return this.stateNumericStart(a,b);case aq.NumericDecimal:return this.stateNumericDecimal(a,b);case aq.NumericHex:return this.stateNumericHex(a,b);case aq.NamedEntity:return this.stateNamedEntity(a,b)}}stateNumericStart(a,b){return b>=a.length?-1:(32|a.charCodeAt(b))===ao.LOWER_X?(this.state=aq.NumericHex,this.consumed+=1,this.stateNumericHex(a,b+1)):(this.state=aq.NumericDecimal,this.stateNumericDecimal(a,b))}addToNumericResult(a,b,c,d){if(b!==c){let e=c-b;this.result=this.result*Math.pow(d,e)+Number.parseInt(a.substr(b,e),d),this.consumed+=e}}stateNumericHex(a,b){let c=b;for(;b<a.length;){var d;let e=a.charCodeAt(b);if(!zG(e)&&(!((d=e)>=ao.UPPER_A)||!(d<=ao.UPPER_F))&&(!(d>=ao.LOWER_A)||!(d<=ao.LOWER_F)))return this.addToNumericResult(a,c,b,16),this.emitNumericEntity(e,3);b+=1}return this.addToNumericResult(a,c,b,16),-1}stateNumericDecimal(a,b){let c=b;for(;b<a.length;){let d=a.charCodeAt(b);if(!zG(d))return this.addToNumericResult(a,c,b,10),this.emitNumericEntity(d,2);b+=1}return this.addToNumericResult(a,c,b,10),-1}emitNumericEntity(a,b){var c,d,e;if(this.consumed<=b)return null==(c=this.errors)||c.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(a===ao.SEMI)this.consumed+=1;else if(this.decodeMode===ar.Strict)return 0;return this.emitCodePoint((d=this.result)>=55296&&d<=57343||d>1114111?65533:null!=(e=zF.get(d))?e:d,this.consumed),this.errors&&(a!==ao.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(a,b){let{decodeTree:c}=this,d=c[this.treeIndex],e=(d&ap.VALUE_LENGTH)>>14;for(;b<a.length;b++,this.excess++){let f=a.charCodeAt(b);if(this.treeIndex=function(a,b,c,d){let e=(b&ap.BRANCH_LENGTH)>>7,f=b&ap.JUMP_TABLE;if(0===e)return 0!==f&&d===f?c:-1;if(f){let b=d-f;return b<0||b>=e?-1:a[c+b]-1}let g=c,h=g+e-1;for(;g<=h;){let b=g+h>>>1,c=a[b];if(c<d)g=b+1;else{if(!(c>d))return a[b+e];h=b-1}}return -1}(c,d,this.treeIndex+Math.max(1,e),f),this.treeIndex<0)return 0===this.result||this.decodeMode===ar.Attribute&&(0===e||function(a){var b;return a===ao.EQUALS||(b=a)>=ao.UPPER_A&&b<=ao.UPPER_Z||b>=ao.LOWER_A&&b<=ao.LOWER_Z||zG(b)}(f))?0:this.emitNotTerminatedNamedEntity();if(0!=(e=((d=c[this.treeIndex])&ap.VALUE_LENGTH)>>14)){if(f===ao.SEMI)return this.emitNamedEntityData(this.treeIndex,e,this.consumed+this.excess);this.decodeMode!==ar.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return -1}emitNotTerminatedNamedEntity(){var a;let{result:b,decodeTree:c}=this,d=(c[b]&ap.VALUE_LENGTH)>>14;return this.emitNamedEntityData(b,d,this.consumed),null==(a=this.errors)||a.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(a,b,c){let{decodeTree:d}=this;return this.emitCodePoint(1===b?d[a]&~ap.VALUE_LENGTH:d[a+1],c),3===b&&this.emitCodePoint(d[a+2],c),c}end(){var a;switch(this.state){case aq.NamedEntity:return 0!==this.result&&(this.decodeMode!==ar.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case aq.NumericDecimal:return this.emitNumericEntity(0,2);case aq.NumericHex:return this.emitNumericEntity(0,3);case aq.NumericStart:return null==(a=this.errors)||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case aq.EntityStart:return 0}}}(T=as||(as={})).HTML="http://www.w3.org/1999/xhtml",T.MATHML="http://www.w3.org/1998/Math/MathML",T.SVG="http://www.w3.org/2000/svg",T.XLINK="http://www.w3.org/1999/xlink",T.XML="http://www.w3.org/XML/1998/namespace",T.XMLNS="http://www.w3.org/2000/xmlns/",(U=at||(at={})).TYPE="type",U.ACTION="action",U.ENCODING="encoding",U.PROMPT="prompt",U.NAME="name",U.COLOR="color",U.FACE="face",U.SIZE="size",(V=au||(au={})).NO_QUIRKS="no-quirks",V.QUIRKS="quirks",V.LIMITED_QUIRKS="limited-quirks",(W=av||(av={})).A="a",W.ADDRESS="address",W.ANNOTATION_XML="annotation-xml",W.APPLET="applet",W.AREA="area",W.ARTICLE="article",W.ASIDE="aside",W.B="b",W.BASE="base",W.BASEFONT="basefont",W.BGSOUND="bgsound",W.BIG="big",W.BLOCKQUOTE="blockquote",W.BODY="body",W.BR="br",W.BUTTON="button",W.CAPTION="caption",W.CENTER="center",W.CODE="code",W.COL="col",W.COLGROUP="colgroup",W.DD="dd",W.DESC="desc",W.DETAILS="details",W.DIALOG="dialog",W.DIR="dir",W.DIV="div",W.DL="dl",W.DT="dt",W.EM="em",W.EMBED="embed",W.FIELDSET="fieldset",W.FIGCAPTION="figcaption",W.FIGURE="figure",W.FONT="font",W.FOOTER="footer",W.FOREIGN_OBJECT="foreignObject",W.FORM="form",W.FRAME="frame",W.FRAMESET="frameset",W.H1="h1",W.H2="h2",W.H3="h3",W.H4="h4",W.H5="h5",W.H6="h6",W.HEAD="head",W.HEADER="header",W.HGROUP="hgroup",W.HR="hr",W.HTML="html",W.I="i",W.IMG="img",W.IMAGE="image",W.INPUT="input",W.IFRAME="iframe",W.KEYGEN="keygen",W.LABEL="label",W.LI="li",W.LINK="link",W.LISTING="listing",W.MAIN="main",W.MALIGNMARK="malignmark",W.MARQUEE="marquee",W.MATH="math",W.MENU="menu",W.META="meta",W.MGLYPH="mglyph",W.MI="mi",W.MO="mo",W.MN="mn",W.MS="ms",W.MTEXT="mtext",W.NAV="nav",W.NOBR="nobr",W.NOFRAMES="noframes",W.NOEMBED="noembed",W.NOSCRIPT="noscript",W.OBJECT="object",W.OL="ol",W.OPTGROUP="optgroup",W.OPTION="option",W.P="p",W.PARAM="param",W.PLAINTEXT="plaintext",W.PRE="pre",W.RB="rb",W.RP="rp",W.RT="rt",W.RTC="rtc",W.RUBY="ruby",W.S="s",W.SCRIPT="script",W.SEARCH="search",W.SECTION="section",W.SELECT="select",W.SOURCE="source",W.SMALL="small",W.SPAN="span",W.STRIKE="strike",W.STRONG="strong",W.STYLE="style",W.SUB="sub",W.SUMMARY="summary",W.SUP="sup",W.TABLE="table",W.TBODY="tbody",W.TEMPLATE="template",W.TEXTAREA="textarea",W.TFOOT="tfoot",W.TD="td",W.TH="th",W.THEAD="thead",W.TITLE="title",W.TR="tr",W.TRACK="track",W.TT="tt",W.U="u",W.UL="ul",W.SVG="svg",W.VAR="var",W.WBR="wbr",W.XMP="xmp",(X=aw||(aw={}))[X.UNKNOWN=0]="UNKNOWN",X[X.A=1]="A",X[X.ADDRESS=2]="ADDRESS",X[X.ANNOTATION_XML=3]="ANNOTATION_XML",X[X.APPLET=4]="APPLET",X[X.AREA=5]="AREA",X[X.ARTICLE=6]="ARTICLE",X[X.ASIDE=7]="ASIDE",X[X.B=8]="B",X[X.BASE=9]="BASE",X[X.BASEFONT=10]="BASEFONT",X[X.BGSOUND=11]="BGSOUND",X[X.BIG=12]="BIG",X[X.BLOCKQUOTE=13]="BLOCKQUOTE",X[X.BODY=14]="BODY",X[X.BR=15]="BR",X[X.BUTTON=16]="BUTTON",X[X.CAPTION=17]="CAPTION",X[X.CENTER=18]="CENTER",X[X.CODE=19]="CODE",X[X.COL=20]="COL",X[X.COLGROUP=21]="COLGROUP",X[X.DD=22]="DD",X[X.DESC=23]="DESC",X[X.DETAILS=24]="DETAILS",X[X.DIALOG=25]="DIALOG",X[X.DIR=26]="DIR",X[X.DIV=27]="DIV",X[X.DL=28]="DL",X[X.DT=29]="DT",X[X.EM=30]="EM",X[X.EMBED=31]="EMBED",X[X.FIELDSET=32]="FIELDSET",X[X.FIGCAPTION=33]="FIGCAPTION",X[X.FIGURE=34]="FIGURE",X[X.FONT=35]="FONT",X[X.FOOTER=36]="FOOTER",X[X.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",X[X.FORM=38]="FORM",X[X.FRAME=39]="FRAME",X[X.FRAMESET=40]="FRAMESET",X[X.H1=41]="H1",X[X.H2=42]="H2",X[X.H3=43]="H3",X[X.H4=44]="H4",X[X.H5=45]="H5",X[X.H6=46]="H6",X[X.HEAD=47]="HEAD",X[X.HEADER=48]="HEADER",X[X.HGROUP=49]="HGROUP",X[X.HR=50]="HR",X[X.HTML=51]="HTML",X[X.I=52]="I",X[X.IMG=53]="IMG",X[X.IMAGE=54]="IMAGE",X[X.INPUT=55]="INPUT",X[X.IFRAME=56]="IFRAME",X[X.KEYGEN=57]="KEYGEN",X[X.LABEL=58]="LABEL",X[X.LI=59]="LI",X[X.LINK=60]="LINK",X[X.LISTING=61]="LISTING",X[X.MAIN=62]="MAIN",X[X.MALIGNMARK=63]="MALIGNMARK",X[X.MARQUEE=64]="MARQUEE",X[X.MATH=65]="MATH",X[X.MENU=66]="MENU",X[X.META=67]="META",X[X.MGLYPH=68]="MGLYPH",X[X.MI=69]="MI",X[X.MO=70]="MO",X[X.MN=71]="MN",X[X.MS=72]="MS",X[X.MTEXT=73]="MTEXT",X[X.NAV=74]="NAV",X[X.NOBR=75]="NOBR",X[X.NOFRAMES=76]="NOFRAMES",X[X.NOEMBED=77]="NOEMBED",X[X.NOSCRIPT=78]="NOSCRIPT",X[X.OBJECT=79]="OBJECT",X[X.OL=80]="OL",X[X.OPTGROUP=81]="OPTGROUP",X[X.OPTION=82]="OPTION",X[X.P=83]="P",X[X.PARAM=84]="PARAM",X[X.PLAINTEXT=85]="PLAINTEXT",X[X.PRE=86]="PRE",X[X.RB=87]="RB",X[X.RP=88]="RP",X[X.RT=89]="RT",X[X.RTC=90]="RTC",X[X.RUBY=91]="RUBY",X[X.S=92]="S",X[X.SCRIPT=93]="SCRIPT",X[X.SEARCH=94]="SEARCH",X[X.SECTION=95]="SECTION",X[X.SELECT=96]="SELECT",X[X.SOURCE=97]="SOURCE",X[X.SMALL=98]="SMALL",X[X.SPAN=99]="SPAN",X[X.STRIKE=100]="STRIKE",X[X.STRONG=101]="STRONG",X[X.STYLE=102]="STYLE",X[X.SUB=103]="SUB",X[X.SUMMARY=104]="SUMMARY",X[X.SUP=105]="SUP",X[X.TABLE=106]="TABLE",X[X.TBODY=107]="TBODY",X[X.TEMPLATE=108]="TEMPLATE",X[X.TEXTAREA=109]="TEXTAREA",X[X.TFOOT=110]="TFOOT",X[X.TD=111]="TD",X[X.TH=112]="TH",X[X.THEAD=113]="THEAD",X[X.TITLE=114]="TITLE",X[X.TR=115]="TR",X[X.TRACK=116]="TRACK",X[X.TT=117]="TT",X[X.U=118]="U",X[X.UL=119]="UL",X[X.SVG=120]="SVG",X[X.VAR=121]="VAR",X[X.WBR=122]="WBR",X[X.XMP=123]="XMP";let zI=new Map([[av.A,aw.A],[av.ADDRESS,aw.ADDRESS],[av.ANNOTATION_XML,aw.ANNOTATION_XML],[av.APPLET,aw.APPLET],[av.AREA,aw.AREA],[av.ARTICLE,aw.ARTICLE],[av.ASIDE,aw.ASIDE],[av.B,aw.B],[av.BASE,aw.BASE],[av.BASEFONT,aw.BASEFONT],[av.BGSOUND,aw.BGSOUND],[av.BIG,aw.BIG],[av.BLOCKQUOTE,aw.BLOCKQUOTE],[av.BODY,aw.BODY],[av.BR,aw.BR],[av.BUTTON,aw.BUTTON],[av.CAPTION,aw.CAPTION],[av.CENTER,aw.CENTER],[av.CODE,aw.CODE],[av.COL,aw.COL],[av.COLGROUP,aw.COLGROUP],[av.DD,aw.DD],[av.DESC,aw.DESC],[av.DETAILS,aw.DETAILS],[av.DIALOG,aw.DIALOG],[av.DIR,aw.DIR],[av.DIV,aw.DIV],[av.DL,aw.DL],[av.DT,aw.DT],[av.EM,aw.EM],[av.EMBED,aw.EMBED],[av.FIELDSET,aw.FIELDSET],[av.FIGCAPTION,aw.FIGCAPTION],[av.FIGURE,aw.FIGURE],[av.FONT,aw.FONT],[av.FOOTER,aw.FOOTER],[av.FOREIGN_OBJECT,aw.FOREIGN_OBJECT],[av.FORM,aw.FORM],[av.FRAME,aw.FRAME],[av.FRAMESET,aw.FRAMESET],[av.H1,aw.H1],[av.H2,aw.H2],[av.H3,aw.H3],[av.H4,aw.H4],[av.H5,aw.H5],[av.H6,aw.H6],[av.HEAD,aw.HEAD],[av.HEADER,aw.HEADER],[av.HGROUP,aw.HGROUP],[av.HR,aw.HR],[av.HTML,aw.HTML],[av.I,aw.I],[av.IMG,aw.IMG],[av.IMAGE,aw.IMAGE],[av.INPUT,aw.INPUT],[av.IFRAME,aw.IFRAME],[av.KEYGEN,aw.KEYGEN],[av.LABEL,aw.LABEL],[av.LI,aw.LI],[av.LINK,aw.LINK],[av.LISTING,aw.LISTING],[av.MAIN,aw.MAIN],[av.MALIGNMARK,aw.MALIGNMARK],[av.MARQUEE,aw.MARQUEE],[av.MATH,aw.MATH],[av.MENU,aw.MENU],[av.META,aw.META],[av.MGLYPH,aw.MGLYPH],[av.MI,aw.MI],[av.MO,aw.MO],[av.MN,aw.MN],[av.MS,aw.MS],[av.MTEXT,aw.MTEXT],[av.NAV,aw.NAV],[av.NOBR,aw.NOBR],[av.NOFRAMES,aw.NOFRAMES],[av.NOEMBED,aw.NOEMBED],[av.NOSCRIPT,aw.NOSCRIPT],[av.OBJECT,aw.OBJECT],[av.OL,aw.OL],[av.OPTGROUP,aw.OPTGROUP],[av.OPTION,aw.OPTION],[av.P,aw.P],[av.PARAM,aw.PARAM],[av.PLAINTEXT,aw.PLAINTEXT],[av.PRE,aw.PRE],[av.RB,aw.RB],[av.RP,aw.RP],[av.RT,aw.RT],[av.RTC,aw.RTC],[av.RUBY,aw.RUBY],[av.S,aw.S],[av.SCRIPT,aw.SCRIPT],[av.SEARCH,aw.SEARCH],[av.SECTION,aw.SECTION],[av.SELECT,aw.SELECT],[av.SOURCE,aw.SOURCE],[av.SMALL,aw.SMALL],[av.SPAN,aw.SPAN],[av.STRIKE,aw.STRIKE],[av.STRONG,aw.STRONG],[av.STYLE,aw.STYLE],[av.SUB,aw.SUB],[av.SUMMARY,aw.SUMMARY],[av.SUP,aw.SUP],[av.TABLE,aw.TABLE],[av.TBODY,aw.TBODY],[av.TEMPLATE,aw.TEMPLATE],[av.TEXTAREA,aw.TEXTAREA],[av.TFOOT,aw.TFOOT],[av.TD,aw.TD],[av.TH,aw.TH],[av.THEAD,aw.THEAD],[av.TITLE,aw.TITLE],[av.TR,aw.TR],[av.TRACK,aw.TRACK],[av.TT,aw.TT],[av.U,aw.U],[av.UL,aw.UL],[av.SVG,aw.SVG],[av.VAR,aw.VAR],[av.WBR,aw.WBR],[av.XMP,aw.XMP]]);function zJ(a){var b;return null!=(b=zI.get(a))?b:aw.UNKNOWN}let zK=aw,zL={[as.HTML]:new Set([zK.ADDRESS,zK.APPLET,zK.AREA,zK.ARTICLE,zK.ASIDE,zK.BASE,zK.BASEFONT,zK.BGSOUND,zK.BLOCKQUOTE,zK.BODY,zK.BR,zK.BUTTON,zK.CAPTION,zK.CENTER,zK.COL,zK.COLGROUP,zK.DD,zK.DETAILS,zK.DIR,zK.DIV,zK.DL,zK.DT,zK.EMBED,zK.FIELDSET,zK.FIGCAPTION,zK.FIGURE,zK.FOOTER,zK.FORM,zK.FRAME,zK.FRAMESET,zK.H1,zK.H2,zK.H3,zK.H4,zK.H5,zK.H6,zK.HEAD,zK.HEADER,zK.HGROUP,zK.HR,zK.HTML,zK.IFRAME,zK.IMG,zK.INPUT,zK.LI,zK.LINK,zK.LISTING,zK.MAIN,zK.MARQUEE,zK.MENU,zK.META,zK.NAV,zK.NOEMBED,zK.NOFRAMES,zK.NOSCRIPT,zK.OBJECT,zK.OL,zK.P,zK.PARAM,zK.PLAINTEXT,zK.PRE,zK.SCRIPT,zK.SECTION,zK.SELECT,zK.SOURCE,zK.STYLE,zK.SUMMARY,zK.TABLE,zK.TBODY,zK.TD,zK.TEMPLATE,zK.TEXTAREA,zK.TFOOT,zK.TH,zK.THEAD,zK.TITLE,zK.TR,zK.TRACK,zK.UL,zK.WBR,zK.XMP]),[as.MATHML]:new Set([zK.MI,zK.MO,zK.MN,zK.MS,zK.MTEXT,zK.ANNOTATION_XML]),[as.SVG]:new Set([zK.TITLE,zK.FOREIGN_OBJECT,zK.DESC]),[as.XLINK]:new Set,[as.XML]:new Set,[as.XMLNS]:new Set},zM=new Set([zK.H1,zK.H2,zK.H3,zK.H4,zK.H5,zK.H6]),zN=new Set([av.STYLE,av.SCRIPT,av.XMP,av.IFRAME,av.NOEMBED,av.NOFRAMES,av.PLAINTEXT]);a.s(["ATTRS",0,at,"DOCUMENT_MODE",0,au,"NS",0,as,"NUMBERED_HEADERS",0,zM,"SPECIAL_ELEMENTS",0,zL,"TAG_ID",0,aw,"TAG_NAMES",0,av,"getTagID",0,zJ,"hasUnescapedText",0,function(a,b){return zN.has(a)||b&&a===av.NOSCRIPT}],305856),(Y=ax||(ax={}))[Y.DATA=0]="DATA",Y[Y.RCDATA=1]="RCDATA",Y[Y.RAWTEXT=2]="RAWTEXT",Y[Y.SCRIPT_DATA=3]="SCRIPT_DATA",Y[Y.PLAINTEXT=4]="PLAINTEXT",Y[Y.TAG_OPEN=5]="TAG_OPEN",Y[Y.END_TAG_OPEN=6]="END_TAG_OPEN",Y[Y.TAG_NAME=7]="TAG_NAME",Y[Y.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",Y[Y.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",Y[Y.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",Y[Y.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",Y[Y.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",Y[Y.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",Y[Y.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",Y[Y.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",Y[Y.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",Y[Y.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",Y[Y.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",Y[Y.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",Y[Y.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",Y[Y.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",Y[Y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",Y[Y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",Y[Y.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",Y[Y.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",Y[Y.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",Y[Y.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",Y[Y.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",Y[Y.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",Y[Y.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",Y[Y.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",Y[Y.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",Y[Y.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",Y[Y.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",Y[Y.BOGUS_COMMENT=40]="BOGUS_COMMENT",Y[Y.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",Y[Y.COMMENT_START=42]="COMMENT_START",Y[Y.COMMENT_START_DASH=43]="COMMENT_START_DASH",Y[Y.COMMENT=44]="COMMENT",Y[Y.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",Y[Y.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",Y[Y.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",Y[Y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",Y[Y.COMMENT_END_DASH=49]="COMMENT_END_DASH",Y[Y.COMMENT_END=50]="COMMENT_END",Y[Y.COMMENT_END_BANG=51]="COMMENT_END_BANG",Y[Y.DOCTYPE=52]="DOCTYPE",Y[Y.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",Y[Y.DOCTYPE_NAME=54]="DOCTYPE_NAME",Y[Y.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",Y[Y.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",Y[Y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",Y[Y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",Y[Y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",Y[Y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",Y[Y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",Y[Y.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",Y[Y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",Y[Y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",Y[Y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",Y[Y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",Y[Y.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",Y[Y.CDATA_SECTION=68]="CDATA_SECTION",Y[Y.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",Y[Y.CDATA_SECTION_END=70]="CDATA_SECTION_END",Y[Y.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",Y[Y.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND";let zO={DATA:ax.DATA,RCDATA:ax.RCDATA,RAWTEXT:ax.RAWTEXT,SCRIPT_DATA:ax.SCRIPT_DATA,PLAINTEXT:ax.PLAINTEXT,CDATA_SECTION:ax.CDATA_SECTION};function zP(a){return a>=ak.LATIN_CAPITAL_A&&a<=ak.LATIN_CAPITAL_Z}function zQ(a){return a>=ak.LATIN_SMALL_A&&a<=ak.LATIN_SMALL_Z||zP(a)}function zR(a){return zQ(a)||a>=ak.DIGIT_0&&a<=ak.DIGIT_9}function zS(a){return a===ak.SPACE||a===ak.LINE_FEED||a===ak.TABULATION||a===ak.FORM_FEED}function zT(a){return zS(a)||a===ak.SOLIDUS||a===ak.GREATER_THAN_SIGN}class zU{constructor(a,b){this.options=a,this.handler=b,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=ax.DATA,this.returnState=ax.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new zC(b),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new zH(zE,(a,b)=>{this.preprocessor.pos=this.entityStartPos+b-1,this._flushCodePointConsumedAsCharacterReference(a)},b.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(al.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(al.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{let b=function(a){if(a===ak.NULL)return al.nullCharacterReference;if(a>1114111)return al.characterReferenceOutsideUnicodeRange;if(zz(a))return al.surrogateCharacterReference;if(zB(a))return al.noncharacterCharacterReference;if(zA(a)||a===ak.CARRIAGE_RETURN)return al.controlCharacterReference;return null}(a);b&&this._err(b,1)}}:void 0)}_err(a,b=0){var c,d;null==(d=(c=this.handler).onParseError)||d.call(c,this.preprocessor.getError(a,b))}getCurrentLocation(a){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-a,startOffset:this.preprocessor.offset-a,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let a=this._consume();this._ensureHibernation()||this._callState(a)}this.inLoop=!1}}pause(){this.paused=!0}resume(a){if(!this.paused)throw Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||null==a||a())}write(a,b,c){this.active=!0,this.preprocessor.write(a,b),this._runParsingLoop(),this.paused||null==c||c()}insertHtmlAtCurrentPos(a){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(a),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(a){this.consumedAfterSnapshot+=a;for(let b=0;b<a;b++)this.preprocessor.advance()}_consumeSequenceIfMatch(a,b){return!!this.preprocessor.startsWith(a,b)&&(this._advanceBy(a.length-1),!0)}_createStartTagToken(){this.currentToken={type:am.START_TAG,tagName:"",tagID:aw.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:am.END_TAG,tagName:"",tagID:aw.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(a){this.currentToken={type:am.COMMENT,data:"",location:this.getCurrentLocation(a)}}_createDoctypeToken(a){this.currentToken={type:am.DOCTYPE,name:a,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(a,b){this.currentCharacterToken={type:a,chars:b,location:this.currentLocation}}_createAttr(a){this.currentAttr={name:a,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var a,b;let c=this.currentToken;null===zD(c,this.currentAttr.name)?(c.attrs.push(this.currentAttr),c.location&&this.currentLocation&&((null!=(a=(b=c.location).attrs)?a:b.attrs=Object.create(null))[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue())):this._err(al.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(a){this._emitCurrentCharacterToken(a.location),this.currentToken=null,a.location&&(a.location.endLine=this.preprocessor.line,a.location.endCol=this.preprocessor.col+1,a.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let a=this.currentToken;this.prepareToken(a),a.tagID=zJ(a.tagName),a.type===am.START_TAG?(this.lastStartTagName=a.tagName,this.handler.onStartTag(a)):(a.attrs.length>0&&this._err(al.endTagWithAttributes),a.selfClosing&&this._err(al.endTagWithTrailingSolidus),this.handler.onEndTag(a)),this.preprocessor.dropParsedChunk()}emitCurrentComment(a){this.prepareToken(a),this.handler.onComment(a),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(a){this.prepareToken(a),this.handler.onDoctype(a),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(a){if(this.currentCharacterToken){switch(a&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=a.startLine,this.currentCharacterToken.location.endCol=a.startCol,this.currentCharacterToken.location.endOffset=a.startOffset),this.currentCharacterToken.type){case am.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case am.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case am.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let a=this.getCurrentLocation(0);a&&(a.endLine=a.startLine,a.endCol=a.startCol,a.endOffset=a.startOffset),this._emitCurrentCharacterToken(a),this.handler.onEof({type:am.EOF,location:a}),this.active=!1}_appendCharToCurrentCharacterToken(a,b){if(this.currentCharacterToken)if(this.currentCharacterToken.type===a){this.currentCharacterToken.chars+=b;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(a,b)}_emitCodePoint(a){let b=zS(a)?am.WHITESPACE_CHARACTER:a===ak.NULL?am.NULL_CHARACTER:am.CHARACTER;this._appendCharToCurrentCharacterToken(b,String.fromCodePoint(a))}_emitChars(a){this._appendCharToCurrentCharacterToken(am.CHARACTER,a)}_startCharacterReference(){this.returnState=this.state,this.state=ax.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ar.Attribute:ar.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===ax.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===ax.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===ax.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(a){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(a):this._emitCodePoint(a)}_callState(a){switch(this.state){case ax.DATA:this._stateData(a);break;case ax.RCDATA:this._stateRcdata(a);break;case ax.RAWTEXT:this._stateRawtext(a);break;case ax.SCRIPT_DATA:this._stateScriptData(a);break;case ax.PLAINTEXT:this._statePlaintext(a);break;case ax.TAG_OPEN:this._stateTagOpen(a);break;case ax.END_TAG_OPEN:this._stateEndTagOpen(a);break;case ax.TAG_NAME:this._stateTagName(a);break;case ax.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(a);break;case ax.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(a);break;case ax.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(a);break;case ax.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(a);break;case ax.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(a);break;case ax.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(a);break;case ax.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(a);break;case ax.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(a);break;case ax.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(a);break;case ax.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(a);break;case ax.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(a);break;case ax.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(a);break;case ax.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(a);break;case ax.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(a);break;case ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(a);break;case ax.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(a);break;case ax.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(a);break;case ax.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(a);break;case ax.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(a);break;case ax.ATTRIBUTE_NAME:this._stateAttributeName(a);break;case ax.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(a);break;case ax.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(a);break;case ax.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(a);break;case ax.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(a);break;case ax.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(a);break;case ax.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(a);break;case ax.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(a);break;case ax.BOGUS_COMMENT:this._stateBogusComment(a);break;case ax.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(a);break;case ax.COMMENT_START:this._stateCommentStart(a);break;case ax.COMMENT_START_DASH:this._stateCommentStartDash(a);break;case ax.COMMENT:this._stateComment(a);break;case ax.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(a);break;case ax.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(a);break;case ax.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(a);break;case ax.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(a);break;case ax.COMMENT_END_DASH:this._stateCommentEndDash(a);break;case ax.COMMENT_END:this._stateCommentEnd(a);break;case ax.COMMENT_END_BANG:this._stateCommentEndBang(a);break;case ax.DOCTYPE:this._stateDoctype(a);break;case ax.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(a);break;case ax.DOCTYPE_NAME:this._stateDoctypeName(a);break;case ax.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(a);break;case ax.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(a);break;case ax.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(a);break;case ax.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(a);break;case ax.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(a);break;case ax.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(a);break;case ax.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(a);break;case ax.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(a);break;case ax.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(a);break;case ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(a);break;case ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(a);break;case ax.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(a);break;case ax.BOGUS_DOCTYPE:this._stateBogusDoctype(a);break;case ax.CDATA_SECTION:this._stateCdataSection(a);break;case ax.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(a);break;case ax.CDATA_SECTION_END:this._stateCdataSectionEnd(a);break;case ax.CHARACTER_REFERENCE:this._stateCharacterReference();break;case ax.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(a);break;default:throw Error("Unknown state")}}_stateData(a){switch(a){case ak.LESS_THAN_SIGN:this.state=ax.TAG_OPEN;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitCodePoint(a);break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateRcdata(a){switch(a){case ak.AMPERSAND:this._startCharacterReference();break;case ak.LESS_THAN_SIGN:this.state=ax.RCDATA_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateRawtext(a){switch(a){case ak.LESS_THAN_SIGN:this.state=ax.RAWTEXT_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateScriptData(a){switch(a){case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_statePlaintext(a){switch(a){case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateTagOpen(a){if(zQ(a))this._createStartTagToken(),this.state=ax.TAG_NAME,this._stateTagName(a);else switch(a){case ak.EXCLAMATION_MARK:this.state=ax.MARKUP_DECLARATION_OPEN;break;case ak.SOLIDUS:this.state=ax.END_TAG_OPEN;break;case ak.QUESTION_MARK:this._err(al.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=ax.BOGUS_COMMENT,this._stateBogusComment(a);break;case ak.EOF:this._err(al.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(al.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=ax.DATA,this._stateData(a)}}_stateEndTagOpen(a){if(zQ(a))this._createEndTagToken(),this.state=ax.TAG_NAME,this._stateTagName(a);else switch(a){case ak.GREATER_THAN_SIGN:this._err(al.missingEndTagName),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break;default:this._err(al.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=ax.BOGUS_COMMENT,this._stateBogusComment(a)}}_stateTagName(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_ATTRIBUTE_NAME;break;case ak.SOLIDUS:this.state=ax.SELF_CLOSING_START_TAG;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.tagName+="�";break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:b.tagName+=String.fromCodePoint(zP(a)?a+32:a)}}_stateRcdataLessThanSign(a){a===ak.SOLIDUS?this.state=ax.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=ax.RCDATA,this._stateRcdata(a))}_stateRcdataEndTagOpen(a){zQ(a)?(this.state=ax.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(a)):(this._emitChars("</"),this.state=ax.RCDATA,this._stateRcdata(a))}handleSpecialEndTag(a){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();switch(this._createEndTagToken(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=ax.BEFORE_ATTRIBUTE_NAME,!1;case ak.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=ax.SELF_CLOSING_START_TAG,!1;case ak.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=ax.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.RCDATA,this._stateRcdata(a))}_stateRawtextLessThanSign(a){a===ak.SOLIDUS?this.state=ax.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=ax.RAWTEXT,this._stateRawtext(a))}_stateRawtextEndTagOpen(a){zQ(a)?(this.state=ax.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(a)):(this._emitChars("</"),this.state=ax.RAWTEXT,this._stateRawtext(a))}_stateRawtextEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.RAWTEXT,this._stateRawtext(a))}_stateScriptDataLessThanSign(a){switch(a){case ak.SOLIDUS:this.state=ax.SCRIPT_DATA_END_TAG_OPEN;break;case ak.EXCLAMATION_MARK:this.state=ax.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break;default:this._emitChars("<"),this.state=ax.SCRIPT_DATA,this._stateScriptData(a)}}_stateScriptDataEndTagOpen(a){zQ(a)?(this.state=ax.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(a)):(this._emitChars("</"),this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEscapeStart(a){a===ak.HYPHEN_MINUS?(this.state=ax.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEscapeStartDash(a){a===ak.HYPHEN_MINUS?(this.state=ax.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=ax.SCRIPT_DATA,this._stateScriptData(a))}_stateScriptDataEscaped(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateScriptDataEscapedDash(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataEscapedDashDash(a){switch(a){case ak.HYPHEN_MINUS:this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case ak.GREATER_THAN_SIGN:this.state=ax.SCRIPT_DATA,this._emitChars(">");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataEscapedLessThanSign(a){a===ak.SOLIDUS?this.state=ax.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:zQ(a)?(this._emitChars("<"),this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(a)):(this._emitChars("<"),this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataEscapedEndTagOpen(a){zQ(a)?(this.state=ax.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(a)):(this._emitChars("</"),this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataEscapedEndTagName(a){this.handleSpecialEndTag(a)&&(this._emitChars("</"),this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataDoubleEscapeStart(a){if(this.preprocessor.startsWith(zy,!1)&&zT(this.preprocessor.peek(zy.length))){this._emitCodePoint(a);for(let a=0;a<zy.length;a++)this._emitCodePoint(this._consume());this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=ax.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(a))}_stateScriptDataDoubleEscaped(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateScriptDataDoubleEscapedDash(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataDoubleEscapedDashDash(a){switch(a){case ak.HYPHEN_MINUS:this._emitChars("-");break;case ak.LESS_THAN_SIGN:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break;case ak.GREATER_THAN_SIGN:this.state=ax.SCRIPT_DATA,this._emitChars(">");break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case ak.EOF:this._err(al.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(a)}}_stateScriptDataDoubleEscapedLessThanSign(a){a===ak.SOLIDUS?(this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(a))}_stateScriptDataDoubleEscapeEnd(a){if(this.preprocessor.startsWith(zy,!1)&&zT(this.preprocessor.peek(zy.length))){this._emitCodePoint(a);for(let a=0;a<zy.length;a++)this._emitCodePoint(this._consume());this.state=ax.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=ax.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(a))}_stateBeforeAttributeName(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.SOLIDUS:case ak.GREATER_THAN_SIGN:case ak.EOF:this.state=ax.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(a);break;case ak.EQUALS_SIGN:this._err(al.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=ax.ATTRIBUTE_NAME;break;default:this._createAttr(""),this.state=ax.ATTRIBUTE_NAME,this._stateAttributeName(a)}}_stateAttributeName(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:case ak.SOLIDUS:case ak.GREATER_THAN_SIGN:case ak.EOF:this._leaveAttrName(),this.state=ax.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(a);break;case ak.EQUALS_SIGN:this._leaveAttrName(),this.state=ax.BEFORE_ATTRIBUTE_VALUE;break;case ak.QUOTATION_MARK:case ak.APOSTROPHE:case ak.LESS_THAN_SIGN:this._err(al.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(a);break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.name+="�";break;default:this.currentAttr.name+=String.fromCodePoint(zP(a)?a+32:a)}}_stateAfterAttributeName(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.SOLIDUS:this.state=ax.SELF_CLOSING_START_TAG;break;case ak.EQUALS_SIGN:this.state=ax.BEFORE_ATTRIBUTE_VALUE;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this._createAttr(""),this.state=ax.ATTRIBUTE_NAME,this._stateAttributeName(a)}}_stateBeforeAttributeValue(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.QUOTATION_MARK:this.state=ax.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this.state=ax.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingAttributeValue),this.state=ax.DATA,this.emitCurrentTagToken();break;default:this.state=ax.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(a)}}_stateAttributeValueDoubleQuoted(a){switch(a){case ak.QUOTATION_MARK:this.state=ax.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.value+="�";break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(a)}}_stateAttributeValueSingleQuoted(a){switch(a){case ak.APOSTROPHE:this.state=ax.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.value+="�";break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(a)}}_stateAttributeValueUnquoted(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this._leaveAttrValue(),this.state=ax.BEFORE_ATTRIBUTE_NAME;break;case ak.AMPERSAND:this._startCharacterReference();break;case ak.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.NULL:this._err(al.unexpectedNullCharacter),this.currentAttr.value+="�";break;case ak.QUOTATION_MARK:case ak.APOSTROPHE:case ak.LESS_THAN_SIGN:case ak.EQUALS_SIGN:case ak.GRAVE_ACCENT:this._err(al.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(a);break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(a)}}_stateAfterAttributeValueQuoted(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this._leaveAttrValue(),this.state=ax.BEFORE_ATTRIBUTE_NAME;break;case ak.SOLIDUS:this._leaveAttrValue(),this.state=ax.SELF_CLOSING_START_TAG;break;case ak.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this._err(al.missingWhitespaceBetweenAttributes),this.state=ax.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(a)}}_stateSelfClosingStartTag(a){switch(a){case ak.GREATER_THAN_SIGN:this.currentToken.selfClosing=!0,this.state=ax.DATA,this.emitCurrentTagToken();break;case ak.EOF:this._err(al.eofInTag),this._emitEOFToken();break;default:this._err(al.unexpectedSolidusInTag),this.state=ax.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(a)}}_stateBogusComment(a){let b=this.currentToken;switch(a){case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EOF:this.emitCurrentComment(b),this._emitEOFToken();break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.data+="�";break;default:b.data+=String.fromCodePoint(a)}}_stateMarkupDeclarationOpen(a){this._consumeSequenceIfMatch("--",!0)?(this._createCommentToken(3),this.state=ax.COMMENT_START):this._consumeSequenceIfMatch(zx,!1)?(this.currentLocation=this.getCurrentLocation(zx.length+1),this.state=ax.DOCTYPE):this._consumeSequenceIfMatch(zw,!0)?this.inForeignNode?this.state=ax.CDATA_SECTION:(this._err(al.cdataInHtmlContent),this._createCommentToken(zw.length+1),this.currentToken.data="[CDATA[",this.state=ax.BOGUS_COMMENT):this._ensureHibernation()||(this._err(al.incorrectlyOpenedComment),this._createCommentToken(2),this.state=ax.BOGUS_COMMENT,this._stateBogusComment(a))}_stateCommentStart(a){switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_START_DASH;break;case ak.GREATER_THAN_SIGN:{this._err(al.abruptClosingOfEmptyComment),this.state=ax.DATA;let a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentStartDash(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_END;break;case ak.GREATER_THAN_SIGN:this._err(al.abruptClosingOfEmptyComment),this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="-",this.state=ax.COMMENT,this._stateComment(a)}}_stateComment(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_END_DASH;break;case ak.LESS_THAN_SIGN:b.data+="<",this.state=ax.COMMENT_LESS_THAN_SIGN;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.data+="�";break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+=String.fromCodePoint(a)}}_stateCommentLessThanSign(a){let b=this.currentToken;switch(a){case ak.EXCLAMATION_MARK:b.data+="!",this.state=ax.COMMENT_LESS_THAN_SIGN_BANG;break;case ak.LESS_THAN_SIGN:b.data+="<";break;default:this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentLessThanSignBang(a){a===ak.HYPHEN_MINUS?this.state=ax.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=ax.COMMENT,this._stateComment(a))}_stateCommentLessThanSignBangDash(a){a===ak.HYPHEN_MINUS?this.state=ax.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=ax.COMMENT_END_DASH,this._stateCommentEndDash(a))}_stateCommentLessThanSignBangDashDash(a){a!==ak.GREATER_THAN_SIGN&&a!==ak.EOF&&this._err(al.nestedComment),this.state=ax.COMMENT_END,this._stateCommentEnd(a)}_stateCommentEndDash(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:this.state=ax.COMMENT_END;break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="-",this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentEnd(a){let b=this.currentToken;switch(a){case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EXCLAMATION_MARK:this.state=ax.COMMENT_END_BANG;break;case ak.HYPHEN_MINUS:b.data+="-";break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="--",this.state=ax.COMMENT,this._stateComment(a)}}_stateCommentEndBang(a){let b=this.currentToken;switch(a){case ak.HYPHEN_MINUS:b.data+="--!",this.state=ax.COMMENT_END_DASH;break;case ak.GREATER_THAN_SIGN:this._err(al.incorrectlyClosedComment),this.state=ax.DATA,this.emitCurrentComment(b);break;case ak.EOF:this._err(al.eofInComment),this.emitCurrentComment(b),this._emitEOFToken();break;default:b.data+="--!",this.state=ax.COMMENT,this._stateComment(a)}}_stateDoctype(a){switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_DOCTYPE_NAME;break;case ak.GREATER_THAN_SIGN:this.state=ax.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(a);break;case ak.EOF:{this._err(al.eofInDoctype),this._createDoctypeToken(null);let a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(al.missingWhitespaceBeforeDoctypeName),this.state=ax.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(a)}}_stateBeforeDoctypeName(a){if(zP(a))this._createDoctypeToken(String.fromCharCode(a+32)),this.state=ax.DOCTYPE_NAME;else switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.NULL:this._err(al.unexpectedNullCharacter),this._createDoctypeToken("�"),this.state=ax.DOCTYPE_NAME;break;case ak.GREATER_THAN_SIGN:{this._err(al.missingDoctypeName),this._createDoctypeToken(null);let a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=ax.DATA;break}case ak.EOF:{this._err(al.eofInDoctype),this._createDoctypeToken(null);let a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(a)),this.state=ax.DOCTYPE_NAME}}_stateDoctypeName(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.AFTER_DOCTYPE_NAME;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.name+="�";break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.name+=String.fromCodePoint(zP(a)?a+32:a)}}_stateAfterDoctypeName(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._consumeSequenceIfMatch("public",!1)?this.state=ax.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch("system",!1)?this.state=ax.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(al.invalidCharacterSequenceAfterDoctypeName),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a))}}_stateAfterDoctypePublicKeyword(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case ak.QUOTATION_MARK:this._err(al.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this._err(al.missingWhitespaceAfterDoctypePublicKeyword),b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBeforeDoctypePublicIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.QUOTATION_MARK:b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:b.publicId="",this.state=ax.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypePublicIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateDoctypePublicIdentifierDoubleQuoted(a){let b=this.currentToken;switch(a){case ak.QUOTATION_MARK:this.state=ax.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.publicId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.publicId+=String.fromCodePoint(a)}}_stateDoctypePublicIdentifierSingleQuoted(a){let b=this.currentToken;switch(a){case ak.APOSTROPHE:this.state=ax.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.publicId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypePublicIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.publicId+=String.fromCodePoint(a)}}_stateAfterDoctypePublicIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case ak.GREATER_THAN_SIGN:this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.QUOTATION_MARK:this._err(al.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this._err(al.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBetweenDoctypePublicAndSystemIdentifiers(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.GREATER_THAN_SIGN:this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.QUOTATION_MARK:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateAfterDoctypeSystemKeyword(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:this.state=ax.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case ak.QUOTATION_MARK:this._err(al.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:this._err(al.missingWhitespaceAfterDoctypeSystemKeyword),b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBeforeDoctypeSystemIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.QUOTATION_MARK:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case ak.APOSTROPHE:b.systemId="",this.state=ax.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case ak.GREATER_THAN_SIGN:this._err(al.missingDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.DATA,this.emitCurrentDoctype(b);break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.missingQuoteBeforeDoctypeSystemIdentifier),b.forceQuirks=!0,this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateDoctypeSystemIdentifierDoubleQuoted(a){let b=this.currentToken;switch(a){case ak.QUOTATION_MARK:this.state=ax.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.systemId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.systemId+=String.fromCodePoint(a)}}_stateDoctypeSystemIdentifierSingleQuoted(a){let b=this.currentToken;switch(a){case ak.APOSTROPHE:this.state=ax.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case ak.NULL:this._err(al.unexpectedNullCharacter),b.systemId+="�";break;case ak.GREATER_THAN_SIGN:this._err(al.abruptDoctypeSystemIdentifier),b.forceQuirks=!0,this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:b.systemId+=String.fromCodePoint(a)}}_stateAfterDoctypeSystemIdentifier(a){let b=this.currentToken;switch(a){case ak.SPACE:case ak.LINE_FEED:case ak.TABULATION:case ak.FORM_FEED:break;case ak.GREATER_THAN_SIGN:this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.EOF:this._err(al.eofInDoctype),b.forceQuirks=!0,this.emitCurrentDoctype(b),this._emitEOFToken();break;default:this._err(al.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=ax.BOGUS_DOCTYPE,this._stateBogusDoctype(a)}}_stateBogusDoctype(a){let b=this.currentToken;switch(a){case ak.GREATER_THAN_SIGN:this.emitCurrentDoctype(b),this.state=ax.DATA;break;case ak.NULL:this._err(al.unexpectedNullCharacter);break;case ak.EOF:this.emitCurrentDoctype(b),this._emitEOFToken()}}_stateCdataSection(a){switch(a){case ak.RIGHT_SQUARE_BRACKET:this.state=ax.CDATA_SECTION_BRACKET;break;case ak.EOF:this._err(al.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(a)}}_stateCdataSectionBracket(a){a===ak.RIGHT_SQUARE_BRACKET?this.state=ax.CDATA_SECTION_END:(this._emitChars("]"),this.state=ax.CDATA_SECTION,this._stateCdataSection(a))}_stateCdataSectionEnd(a){switch(a){case ak.GREATER_THAN_SIGN:this.state=ax.DATA;break;case ak.RIGHT_SQUARE_BRACKET:this._emitChars("]");break;default:this._emitChars("]]"),this.state=ax.CDATA_SECTION,this._stateCdataSection(a)}}_stateCharacterReference(){let a=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(a<0)if(this.preprocessor.lastChunkWritten)a=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}0===a?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(ak.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&zR(this.preprocessor.peek(1))?ax.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(a){zR(a)?this._flushCodePointConsumedAsCharacterReference(a):(a===ak.SEMICOLON&&this._err(al.unknownNamedCharacterReference),this.state=this.returnState,this._callState(a))}}let zV=new Set([aw.DD,aw.DT,aw.LI,aw.OPTGROUP,aw.OPTION,aw.P,aw.RB,aw.RP,aw.RT,aw.RTC]),zW=new Set([...zV,aw.CAPTION,aw.COLGROUP,aw.TBODY,aw.TD,aw.TFOOT,aw.TH,aw.THEAD,aw.TR]),zX=new Set([aw.APPLET,aw.CAPTION,aw.HTML,aw.MARQUEE,aw.OBJECT,aw.TABLE,aw.TD,aw.TEMPLATE,aw.TH]),zY=new Set([...zX,aw.OL,aw.UL]),zZ=new Set([...zX,aw.BUTTON]),z$=new Set([aw.ANNOTATION_XML,aw.MI,aw.MN,aw.MO,aw.MS,aw.MTEXT]),z_=new Set([aw.DESC,aw.FOREIGN_OBJECT,aw.TITLE]),z0=new Set([aw.TR,aw.TEMPLATE,aw.HTML]),z1=new Set([aw.TBODY,aw.TFOOT,aw.THEAD,aw.TEMPLATE,aw.HTML]),z2=new Set([aw.TABLE,aw.TEMPLATE,aw.HTML]),z3=new Set([aw.TD,aw.TH]);class z4{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(a,b,c){this.treeAdapter=b,this.handler=c,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=aw.UNKNOWN,this.current=a}_indexOf(a){return this.items.lastIndexOf(a,this.stackTop)}_isInTemplate(){return this.currentTagId===aw.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===as.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(a,b){this.stackTop++,this.items[this.stackTop]=a,this.current=a,this.tagIDs[this.stackTop]=b,this.currentTagId=b,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(a,b,!0)}pop(){let a=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,!0)}replace(a,b){let c=this._indexOf(a);this.items[c]=b,c===this.stackTop&&(this.current=b)}insertAfter(a,b,c){let d=this._indexOf(a)+1;this.items.splice(d,0,b),this.tagIDs.splice(d,0,c),this.stackTop++,d===this.stackTop&&this._updateCurrentElement(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,d===this.stackTop)}popUntilTagNamePopped(a){let b=this.stackTop+1;do b=this.tagIDs.lastIndexOf(a,b-1);while(b>0&&this.treeAdapter.getNamespaceURI(this.items[b])!==as.HTML)this.shortenToLength(Math.max(b,0))}shortenToLength(a){for(;this.stackTop>=a;){let b=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(b,this.stackTop<a)}}popUntilElementPopped(a){let b=this._indexOf(a);this.shortenToLength(Math.max(b,0))}popUntilPopped(a,b){let c=this._indexOfTagNames(a,b);this.shortenToLength(Math.max(c,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(zM,as.HTML)}popUntilTableCellPopped(){this.popUntilPopped(z3,as.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(a,b){for(let c=this.stackTop;c>=0;c--)if(a.has(this.tagIDs[c])&&this.treeAdapter.getNamespaceURI(this.items[c])===b)return c;return -1}clearBackTo(a,b){let c=this._indexOfTagNames(a,b);this.shortenToLength(c+1)}clearBackToTableContext(){this.clearBackTo(z2,as.HTML)}clearBackToTableBodyContext(){this.clearBackTo(z1,as.HTML)}clearBackToTableRowContext(){this.clearBackTo(z0,as.HTML)}remove(a){let b=this._indexOf(a);b>=0&&(b===this.stackTop?this.pop():(this.items.splice(b,1),this.tagIDs.splice(b,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===aw.BODY?this.items[1]:null}contains(a){return this._indexOf(a)>-1}getCommonAncestor(a){let b=this._indexOf(a)-1;return b>=0?this.items[b]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===aw.HTML}hasInDynamicScope(a,b){for(let c=this.stackTop;c>=0;c--){let d=this.tagIDs[c];switch(this.treeAdapter.getNamespaceURI(this.items[c])){case as.HTML:if(d===a)return!0;if(b.has(d))return!1;break;case as.SVG:if(z_.has(d))return!1;break;case as.MATHML:if(z$.has(d))return!1}}return!0}hasInScope(a){return this.hasInDynamicScope(a,zX)}hasInListItemScope(a){return this.hasInDynamicScope(a,zY)}hasInButtonScope(a){return this.hasInDynamicScope(a,zZ)}hasNumberedHeaderInScope(){for(let a=this.stackTop;a>=0;a--){let b=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case as.HTML:if(zM.has(b))return!0;if(zX.has(b))return!1;break;case as.SVG:if(z_.has(b))return!1;break;case as.MATHML:if(z$.has(b))return!1}}return!0}hasInTableScope(a){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===as.HTML)switch(this.tagIDs[b]){case a:return!0;case aw.TABLE:case aw.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===as.HTML)switch(this.tagIDs[a]){case aw.TBODY:case aw.THEAD:case aw.TFOOT:return!0;case aw.TABLE:case aw.HTML:return!1}return!0}hasInSelectScope(a){for(let b=this.stackTop;b>=0;b--)if(this.treeAdapter.getNamespaceURI(this.items[b])===as.HTML)switch(this.tagIDs[b]){case a:return!0;case aw.OPTION:case aw.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&zV.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&zW.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(a){for(;void 0!==this.currentTagId&&this.currentTagId!==a&&zW.has(this.currentTagId);)this.pop()}}(Z=ay||(ay={}))[Z.Marker=0]="Marker",Z[Z.Element=1]="Element";let z5={type:ay.Marker};class z6{constructor(a){this.treeAdapter=a,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(a,b){let c=[],d=b.length,e=this.treeAdapter.getTagName(a),f=this.treeAdapter.getNamespaceURI(a);for(let a=0;a<this.entries.length;a++){let b=this.entries[a];if(b.type===ay.Marker)break;let{element:g}=b;if(this.treeAdapter.getTagName(g)===e&&this.treeAdapter.getNamespaceURI(g)===f){let b=this.treeAdapter.getAttrList(g);b.length===d&&c.push({idx:a,attrs:b})}}return c}_ensureNoahArkCondition(a){if(this.entries.length<3)return;let b=this.treeAdapter.getAttrList(a),c=this._getNoahArkConditionCandidates(a,b);if(c.length<3)return;let d=new Map(b.map(a=>[a.name,a.value])),e=0;for(let a=0;a<c.length;a++){let b=c[a];b.attrs.every(a=>d.get(a.name)===a.value)&&(e+=1)>=3&&this.entries.splice(b.idx,1)}}insertMarker(){this.entries.unshift(z5)}pushElement(a,b){this._ensureNoahArkCondition(a),this.entries.unshift({type:ay.Element,element:a,token:b})}insertElementAfterBookmark(a,b){let c=this.entries.indexOf(this.bookmark);this.entries.splice(c,0,{type:ay.Element,element:a,token:b})}removeEntry(a){let b=this.entries.indexOf(a);-1!==b&&this.entries.splice(b,1)}clearToLastMarker(){let a=this.entries.indexOf(z5);-1===a?this.entries.length=0:this.entries.splice(0,a+1)}getElementEntryInScopeWithTagName(a){let b=this.entries.find(b=>b.type===ay.Marker||this.treeAdapter.getTagName(b.element)===a);return b&&b.type===ay.Element?b:null}getElementEntry(a){return this.entries.find(b=>b.type===ay.Element&&b.element===a)}}let z7={createDocument:()=>({nodeName:"#document",mode:au.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(a,b,c)=>({nodeName:a,tagName:a,attrs:c,namespaceURI:b,childNodes:[],parentNode:null}),createCommentNode:a=>({nodeName:"#comment",data:a,parentNode:null}),createTextNode:a=>({nodeName:"#text",value:a,parentNode:null}),appendChild(a,b){a.childNodes.push(b),b.parentNode=a},insertBefore(a,b,c){let d=a.childNodes.indexOf(c);a.childNodes.splice(d,0,b),b.parentNode=a},setTemplateContent(a,b){a.content=b},getTemplateContent:a=>a.content,setDocumentType(a,b,c,d){let e=a.childNodes.find(a=>"#documentType"===a.nodeName);e?(e.name=b,e.publicId=c,e.systemId=d):z7.appendChild(a,{nodeName:"#documentType",name:b,publicId:c,systemId:d,parentNode:null})},setDocumentMode(a,b){a.mode=b},getDocumentMode:a=>a.mode,detachNode(a){if(a.parentNode){let b=a.parentNode.childNodes.indexOf(a);a.parentNode.childNodes.splice(b,1),a.parentNode=null}},insertText(a,b){if(a.childNodes.length>0){let c=a.childNodes[a.childNodes.length-1];if(z7.isTextNode(c)){c.value+=b;return}}z7.appendChild(a,z7.createTextNode(b))},insertTextBefore(a,b,c){let d=a.childNodes[a.childNodes.indexOf(c)-1];d&&z7.isTextNode(d)?d.value+=b:z7.insertBefore(a,z7.createTextNode(b),c)},adoptAttributes(a,b){let c=new Set(a.attrs.map(a=>a.name));for(let d=0;d<b.length;d++)c.has(b[d].name)||a.attrs.push(b[d])},getFirstChild:a=>a.childNodes[0],getChildNodes:a=>a.childNodes,getParentNode:a=>a.parentNode,getAttrList:a=>a.attrs,getTagName:a=>a.tagName,getNamespaceURI:a=>a.namespaceURI,getTextNodeContent:a=>a.value,getCommentNodeContent:a=>a.data,getDocumentTypeNodeName:a=>a.name,getDocumentTypeNodePublicId:a=>a.publicId,getDocumentTypeNodeSystemId:a=>a.systemId,isTextNode:a=>"#text"===a.nodeName,isCommentNode:a=>"#comment"===a.nodeName,isDocumentTypeNode:a=>"#documentType"===a.nodeName,isElementNode:a=>Object.prototype.hasOwnProperty.call(a,"tagName"),setNodeSourceCodeLocation(a,b){a.sourceCodeLocation=b},getNodeSourceCodeLocation:a=>a.sourceCodeLocation,updateNodeSourceCodeLocation(a,b){a.sourceCodeLocation={...a.sourceCodeLocation,...b}}},z8="html",z9=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Aa=[...z9,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Ab=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ac=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Ad=[...Ac,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ae(a,b){return b.some(b=>a.startsWith(b))}let Af=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(a=>[a.toLowerCase(),a])),Ag=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:as.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:as.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:as.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:as.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:as.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:as.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:as.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:as.XML}],["xml:space",{prefix:"xml",name:"space",namespace:as.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:as.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:as.XMLNS}]]),Ah=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(a=>[a.toLowerCase(),a])),Ai=new Set([aw.B,aw.BIG,aw.BLOCKQUOTE,aw.BODY,aw.BR,aw.CENTER,aw.CODE,aw.DD,aw.DIV,aw.DL,aw.DT,aw.EM,aw.EMBED,aw.H1,aw.H2,aw.H3,aw.H4,aw.H5,aw.H6,aw.HEAD,aw.HR,aw.I,aw.IMG,aw.LI,aw.LISTING,aw.MENU,aw.META,aw.NOBR,aw.OL,aw.P,aw.PRE,aw.RUBY,aw.S,aw.SMALL,aw.SPAN,aw.STRONG,aw.STRIKE,aw.SUB,aw.SUP,aw.TABLE,aw.TT,aw.U,aw.UL,aw.VAR]);function Aj(a){for(let b=0;b<a.attrs.length;b++)if("definitionurl"===a.attrs[b].name){a.attrs[b].name="definitionURL";break}}function Ak(a){for(let b=0;b<a.attrs.length;b++){let c=Af.get(a.attrs[b].name);null!=c&&(a.attrs[b].name=c)}}function Al(a){for(let b=0;b<a.attrs.length;b++){let c=Ag.get(a.attrs[b].name);c&&(a.attrs[b].prefix=c.prefix,a.attrs[b].name=c.name,a.attrs[b].namespace=c.namespace)}}($=az||(az={}))[$.INITIAL=0]="INITIAL",$[$.BEFORE_HTML=1]="BEFORE_HTML",$[$.BEFORE_HEAD=2]="BEFORE_HEAD",$[$.IN_HEAD=3]="IN_HEAD",$[$.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",$[$.AFTER_HEAD=5]="AFTER_HEAD",$[$.IN_BODY=6]="IN_BODY",$[$.TEXT=7]="TEXT",$[$.IN_TABLE=8]="IN_TABLE",$[$.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",$[$.IN_CAPTION=10]="IN_CAPTION",$[$.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",$[$.IN_TABLE_BODY=12]="IN_TABLE_BODY",$[$.IN_ROW=13]="IN_ROW",$[$.IN_CELL=14]="IN_CELL",$[$.IN_SELECT=15]="IN_SELECT",$[$.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",$[$.IN_TEMPLATE=17]="IN_TEMPLATE",$[$.AFTER_BODY=18]="AFTER_BODY",$[$.IN_FRAMESET=19]="IN_FRAMESET",$[$.AFTER_FRAMESET=20]="AFTER_FRAMESET",$[$.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",$[$.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET";let Am={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},An=new Set([aw.TABLE,aw.TBODY,aw.TFOOT,aw.THEAD,aw.TR]),Ao={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:z7,onParseError:null};class Ap{constructor(a,b,c=null,d=null){this.fragmentContext=c,this.scriptHandler=d,this.currentToken=null,this.stopped=!1,this.insertionMode=az.INITIAL,this.originalInsertionMode=az.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Ao,...a},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=b?b:this.treeAdapter.createDocument(),this.tokenizer=new zU(this.options,this),this.activeFormattingElements=new z6(this.treeAdapter),this.fragmentContextID=c?zJ(this.treeAdapter.getTagName(c)):aw.UNKNOWN,this._setContextModes(null!=c?c:this.document,this.fragmentContextID),this.openElements=new z4(this.document,this.treeAdapter,this)}static parse(a,b){let c=new this(b);return c.tokenizer.write(a,!0),c.document}static getFragmentParser(a,b){let c={...Ao,...b};null!=a||(a=c.treeAdapter.createElement(av.TEMPLATE,as.HTML,[]));let d=c.treeAdapter.createElement("documentmock",as.HTML,[]),e=new this(c,d,a);return e.fragmentContextID===aw.TEMPLATE&&e.tmplInsertionModeStack.unshift(az.IN_TEMPLATE),e._initTokenizerForFragmentParsing(),e._insertFakeRootElement(),e._resetInsertionMode(),e._findFormInFragmentContext(),e}getFragment(){let a=this.treeAdapter.getFirstChild(this.document),b=this.treeAdapter.createDocumentFragment();return this._adoptNodes(a,b),b}_err(a,b,c){var d;if(!this.onParseError)return;let e=null!=(d=a.location)?d:Am,f={code:b,startLine:e.startLine,startCol:e.startCol,startOffset:e.startOffset,endLine:c?e.startLine:e.endLine,endCol:c?e.startCol:e.endCol,endOffset:c?e.startOffset:e.endOffset};this.onParseError(f)}onItemPush(a,b,c){var d,e;null==(e=(d=this.treeAdapter).onItemPush)||e.call(d,a),c&&this.openElements.stackTop>0&&this._setContextModes(a,b)}onItemPop(a,b){var c,d;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(a,this.currentToken),null==(d=(c=this.treeAdapter).onItemPop)||d.call(c,a,this.openElements.current),b){let a,b;0===this.openElements.stackTop&&this.fragmentContext?(a=this.fragmentContext,b=this.fragmentContextID):{current:a,currentTagId:b}=this.openElements,this._setContextModes(a,b)}}_setContextModes(a,b){let c=a===this.document||a&&this.treeAdapter.getNamespaceURI(a)===as.HTML;this.currentNotInHTML=!c,this.tokenizer.inForeignNode=!c&&void 0!==a&&void 0!==b&&!this._isIntegrationPoint(b,a)}_switchToTextParsing(a,b){this._insertElement(a,as.HTML),this.tokenizer.state=b,this.originalInsertionMode=this.insertionMode,this.insertionMode=az.TEXT}switchToPlaintextParsing(){this.insertionMode=az.TEXT,this.originalInsertionMode=az.IN_BODY,this.tokenizer.state=zO.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let a=this.fragmentContext;for(;a;){if(this.treeAdapter.getTagName(a)===av.FORM){this.formElement=a;break}a=this.treeAdapter.getParentNode(a)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===as.HTML)switch(this.fragmentContextID){case aw.TITLE:case aw.TEXTAREA:this.tokenizer.state=zO.RCDATA;break;case aw.STYLE:case aw.XMP:case aw.IFRAME:case aw.NOEMBED:case aw.NOFRAMES:case aw.NOSCRIPT:this.tokenizer.state=zO.RAWTEXT;break;case aw.SCRIPT:this.tokenizer.state=zO.SCRIPT_DATA;break;case aw.PLAINTEXT:this.tokenizer.state=zO.PLAINTEXT}}_setDocumentType(a){let b=a.name||"",c=a.publicId||"",d=a.systemId||"";if(this.treeAdapter.setDocumentType(this.document,b,c,d),a.location){let b=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));b&&this.treeAdapter.setNodeSourceCodeLocation(b,a.location)}}_attachElementToTree(a,b){if(this.options.sourceCodeLocationInfo){let c=b&&{...b,startTag:b};this.treeAdapter.setNodeSourceCodeLocation(a,c)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(a);else{let b=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=b?b:this.document,a)}}_appendElement(a,b){let c=this.treeAdapter.createElement(a.tagName,b,a.attrs);this._attachElementToTree(c,a.location)}_insertElement(a,b){let c=this.treeAdapter.createElement(a.tagName,b,a.attrs);this._attachElementToTree(c,a.location),this.openElements.push(c,a.tagID)}_insertFakeElement(a,b){let c=this.treeAdapter.createElement(a,as.HTML,[]);this._attachElementToTree(c,null),this.openElements.push(c,b)}_insertTemplate(a){let b=this.treeAdapter.createElement(a.tagName,as.HTML,a.attrs),c=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(b,c),this._attachElementToTree(b,a.location),this.openElements.push(b,a.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,null)}_insertFakeRootElement(){let a=this.treeAdapter.createElement(av.HTML,as.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null),this.treeAdapter.appendChild(this.openElements.current,a),this.openElements.push(a,aw.HTML)}_appendCommentNode(a,b){let c=this.treeAdapter.createCommentNode(a.data);this.treeAdapter.appendChild(b,c),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(c,a.location)}_insertCharacters(a){let b,c;if(this._shouldFosterParentOnInsertion()?({parent:b,beforeElement:c}=this._findFosterParentingLocation(),c?this.treeAdapter.insertTextBefore(b,a.chars,c):this.treeAdapter.insertText(b,a.chars)):(b=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(b,a.chars)),!a.location)return;let d=this.treeAdapter.getChildNodes(b),e=c?d.lastIndexOf(c):d.length,f=d[e-1];if(this.treeAdapter.getNodeSourceCodeLocation(f)){let{endLine:b,endCol:c,endOffset:d}=a.location;this.treeAdapter.updateNodeSourceCodeLocation(f,{endLine:b,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(f,a.location)}_adoptNodes(a,b){for(let c=this.treeAdapter.getFirstChild(a);c;c=this.treeAdapter.getFirstChild(a))this.treeAdapter.detachNode(c),this.treeAdapter.appendChild(b,c)}_setEndLocation(a,b){if(this.treeAdapter.getNodeSourceCodeLocation(a)&&b.location){let c=b.location,d=this.treeAdapter.getTagName(a),e=b.type===am.END_TAG&&d===b.tagName?{endTag:{...c},endLine:c.endLine,endCol:c.endCol,endOffset:c.endOffset}:{endLine:c.startLine,endCol:c.startCol,endOffset:c.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(a,e)}}shouldProcessStartTagTokenInForeignContent(a){let b,c;return!!this.currentNotInHTML&&(0===this.openElements.stackTop&&this.fragmentContext?(b=this.fragmentContext,c=this.fragmentContextID):{current:b,currentTagId:c}=this.openElements,(a.tagID!==aw.SVG||this.treeAdapter.getTagName(b)!==av.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(b)!==as.MATHML)&&(this.tokenizer.inForeignNode||(a.tagID===aw.MGLYPH||a.tagID===aw.MALIGNMARK)&&void 0!==c&&!this._isIntegrationPoint(c,b,as.HTML)))}_processToken(a){switch(a.type){case am.CHARACTER:this.onCharacter(a);break;case am.NULL_CHARACTER:this.onNullCharacter(a);break;case am.COMMENT:this.onComment(a);break;case am.DOCTYPE:this.onDoctype(a);break;case am.START_TAG:this._processStartTag(a);break;case am.END_TAG:this.onEndTag(a);break;case am.EOF:this.onEof(a);break;case am.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(a)}}_isIntegrationPoint(a,b,c){let d=this.treeAdapter.getNamespaceURI(b),e=this.treeAdapter.getAttrList(b);return(!c||c===as.HTML)&&function(a,b,c){if(b===as.MATHML&&a===aw.ANNOTATION_XML){for(let a=0;a<c.length;a++)if(c[a].name===at.ENCODING){let b=c[a].value.toLowerCase();return"text/html"===b||"application/xhtml+xml"===b}}return b===as.SVG&&(a===aw.FOREIGN_OBJECT||a===aw.DESC||a===aw.TITLE)}(a,d,e)||(!c||c===as.MATHML)&&d===as.MATHML&&(a===aw.MI||a===aw.MO||a===aw.MN||a===aw.MS||a===aw.MTEXT)}_reconstructActiveFormattingElements(){let a=this.activeFormattingElements.entries.length;if(a){let b=this.activeFormattingElements.entries.findIndex(a=>a.type===ay.Marker||this.openElements.contains(a.element)),c=-1===b?a-1:b-1;for(let a=c;a>=0;a--){let b=this.activeFormattingElements.entries[a];this._insertElement(b.token,this.treeAdapter.getNamespaceURI(b.element)),b.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=az.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(aw.P),this.openElements.popUntilTagNamePopped(aw.P)}_resetInsertionMode(){for(let a=this.openElements.stackTop;a>=0;a--)switch(0===a&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[a]){case aw.TR:this.insertionMode=az.IN_ROW;return;case aw.TBODY:case aw.THEAD:case aw.TFOOT:this.insertionMode=az.IN_TABLE_BODY;return;case aw.CAPTION:this.insertionMode=az.IN_CAPTION;return;case aw.COLGROUP:this.insertionMode=az.IN_COLUMN_GROUP;return;case aw.TABLE:this.insertionMode=az.IN_TABLE;return;case aw.BODY:this.insertionMode=az.IN_BODY;return;case aw.FRAMESET:this.insertionMode=az.IN_FRAMESET;return;case aw.SELECT:return void this._resetInsertionModeForSelect(a);case aw.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case aw.HTML:this.insertionMode=this.headElement?az.AFTER_HEAD:az.BEFORE_HEAD;return;case aw.TD:case aw.TH:if(a>0){this.insertionMode=az.IN_CELL;return}break;case aw.HEAD:if(a>0){this.insertionMode=az.IN_HEAD;return}}this.insertionMode=az.IN_BODY}_resetInsertionModeForSelect(a){if(a>0)for(let b=a-1;b>0;b--){let a=this.openElements.tagIDs[b];if(a===aw.TEMPLATE)break;if(a===aw.TABLE){this.insertionMode=az.IN_SELECT_IN_TABLE;return}}this.insertionMode=az.IN_SELECT}_isElementCausesFosterParenting(a){return An.has(a)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let a=this.openElements.stackTop;a>=0;a--){let b=this.openElements.items[a];switch(this.openElements.tagIDs[a]){case aw.TEMPLATE:if(this.treeAdapter.getNamespaceURI(b)===as.HTML)return{parent:this.treeAdapter.getTemplateContent(b),beforeElement:null};break;case aw.TABLE:{let c=this.treeAdapter.getParentNode(b);if(c)return{parent:c,beforeElement:b};return{parent:this.openElements.items[a-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(a){let b=this._findFosterParentingLocation();b.beforeElement?this.treeAdapter.insertBefore(b.parent,a,b.beforeElement):this.treeAdapter.appendChild(b.parent,a)}_isSpecialElement(a,b){return zL[this.treeAdapter.getNamespaceURI(a)].has(b)}onCharacter(a){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){var b,c;return void(b=this,c=a,b._insertCharacters(c),b.framesetOk=!1)}switch(this.insertionMode){case az.INITIAL:At(this,a);break;case az.BEFORE_HTML:Au(this,a);break;case az.BEFORE_HEAD:Av(this,a);break;case az.IN_HEAD:Ay(this,a);break;case az.IN_HEAD_NO_SCRIPT:Az(this,a);break;case az.AFTER_HEAD:AA(this,a);break;case az.IN_BODY:case az.IN_CAPTION:case az.IN_CELL:case az.IN_TEMPLATE:AD(this,a);break;case az.TEXT:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:this._insertCharacters(a);break;case az.IN_TABLE:case az.IN_TABLE_BODY:case az.IN_ROW:AM(this,a);break;case az.IN_TABLE_TEXT:AR(this,a);break;case az.IN_COLUMN_GROUP:AV(this,a);break;case az.AFTER_BODY:A2(this,a);break;case az.AFTER_AFTER_BODY:A3(this,a)}}onNullCharacter(a){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){var b,c;return void(b=this,(c=a).chars="�",b._insertCharacters(c))}switch(this.insertionMode){case az.INITIAL:At(this,a);break;case az.BEFORE_HTML:Au(this,a);break;case az.BEFORE_HEAD:Av(this,a);break;case az.IN_HEAD:Ay(this,a);break;case az.IN_HEAD_NO_SCRIPT:Az(this,a);break;case az.AFTER_HEAD:AA(this,a);break;case az.TEXT:this._insertCharacters(a);break;case az.IN_TABLE:case az.IN_TABLE_BODY:case az.IN_ROW:AM(this,a);break;case az.IN_COLUMN_GROUP:AV(this,a);break;case az.AFTER_BODY:A2(this,a);break;case az.AFTER_AFTER_BODY:A3(this,a)}}onComment(a){var b,c,d,e;if(this.skipNextNewLine=!1,this.currentNotInHTML)return void Ar(this,a);switch(this.insertionMode){case az.INITIAL:case az.BEFORE_HTML:case az.BEFORE_HEAD:case az.IN_HEAD:case az.IN_HEAD_NO_SCRIPT:case az.AFTER_HEAD:case az.IN_BODY:case az.IN_TABLE:case az.IN_CAPTION:case az.IN_COLUMN_GROUP:case az.IN_TABLE_BODY:case az.IN_ROW:case az.IN_CELL:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:case az.IN_TEMPLATE:case az.IN_FRAMESET:case az.AFTER_FRAMESET:Ar(this,a);break;case az.IN_TABLE_TEXT:AS(this,a);break;case az.AFTER_BODY:b=this,c=a,b._appendCommentNode(c,b.openElements.items[0]);break;case az.AFTER_AFTER_BODY:case az.AFTER_AFTER_FRAMESET:d=this,e=a,d._appendCommentNode(e,d.document)}}onDoctype(a){switch(this.skipNextNewLine=!1,this.insertionMode){case az.INITIAL:!function(a,b){a._setDocumentType(b);let c=b.forceQuirks?au.QUIRKS:function(a){if(a.name!==z8)return au.QUIRKS;let{systemId:b}=a;if(b&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===b.toLowerCase())return au.QUIRKS;let{publicId:c}=a;if(null!==c){if(c=c.toLowerCase(),Ab.has(c))return au.QUIRKS;let a=null===b?Aa:z9;if(Ae(c,a))return au.QUIRKS;if(Ae(c,a=null===b?Ac:Ad))return au.LIMITED_QUIRKS}return au.NO_QUIRKS}(b);(b.name!==z8||null!==b.publicId||null!==b.systemId&&"about:legacy-compat"!==b.systemId)&&a._err(b,al.nonConformingDoctype),a.treeAdapter.setDocumentMode(a.document,c),a.insertionMode=az.BEFORE_HTML}(this,a);break;case az.BEFORE_HEAD:case az.IN_HEAD:case az.IN_HEAD_NO_SCRIPT:case az.AFTER_HEAD:this._err(a,al.misplacedDoctype);break;case az.IN_TABLE_TEXT:AS(this,a)}}onStartTag(a){this.skipNextNewLine=!1,this.currentToken=a,this._processStartTag(a),a.selfClosing&&!a.ackSelfClosing&&this._err(a,al.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(a){this.shouldProcessStartTagTokenInForeignContent(a)?function(a,b){let c;if((c=b.tagID)===aw.FONT&&b.attrs.some(({name:a})=>a===at.COLOR||a===at.SIZE||a===at.FACE)||Ai.has(c))A4(a),a._startTagOutsideForeignContent(b);else{let c=a._getAdjustedCurrentElement(),d=a.treeAdapter.getNamespaceURI(c);if(d===as.MATHML)Aj(b);else if(d===as.SVG){let a;null!=(a=Ah.get(b.tagName))&&(b.tagName=a,b.tagID=zJ(b.tagName)),Ak(b)}Al(b),b.selfClosing?a._appendElement(b,d):a._insertElement(b,d),b.ackSelfClosing=!0}}(this,a):this._startTagOutsideForeignContent(a)}_startTagOutsideForeignContent(a){switch(this.insertionMode){case az.INITIAL:At(this,a);break;case az.BEFORE_HTML:b=this,(c=a).tagID===aw.HTML?(b._insertElement(c,as.HTML),b.insertionMode=az.BEFORE_HEAD):Au(b,c);break;case az.BEFORE_HEAD:var b,c,d,e,f,g,h,i,j,k,l,m,n=this,o=a;switch(o.tagID){case aw.HTML:AI(n,o);break;case aw.HEAD:n._insertElement(o,as.HTML),n.headElement=n.openElements.current,n.insertionMode=az.IN_HEAD;break;default:Av(n,o)}break;case az.IN_HEAD:Aw(this,a);break;case az.IN_HEAD_NO_SCRIPT:var p=this,q=a;switch(q.tagID){case aw.HTML:AI(p,q);break;case aw.BASEFONT:case aw.BGSOUND:case aw.HEAD:case aw.LINK:case aw.META:case aw.NOFRAMES:case aw.STYLE:Aw(p,q);break;case aw.NOSCRIPT:p._err(q,al.nestedNoscriptInHead);break;default:Az(p,q)}break;case az.AFTER_HEAD:var r=this,s=a;switch(s.tagID){case aw.HTML:AI(r,s);break;case aw.BODY:r._insertElement(s,as.HTML),r.framesetOk=!1,r.insertionMode=az.IN_BODY;break;case aw.FRAMESET:r._insertElement(s,as.HTML),r.insertionMode=az.IN_FRAMESET;break;case aw.BASE:case aw.BASEFONT:case aw.BGSOUND:case aw.LINK:case aw.META:case aw.NOFRAMES:case aw.SCRIPT:case aw.STYLE:case aw.TEMPLATE:case aw.TITLE:r._err(s,al.abandonedHeadElementChild),r.openElements.push(r.headElement,aw.HEAD),Aw(r,s),r.openElements.remove(r.headElement);break;case aw.HEAD:r._err(s,al.misplacedStartTagForHeadElement);break;default:AA(r,s)}break;case az.IN_BODY:AI(this,a);break;case az.IN_TABLE:AN(this,a);break;case az.IN_TABLE_TEXT:AS(this,a);break;case az.IN_CAPTION:let t;d=this,t=(e=a).tagID,AT.has(t)?d.openElements.hasInTableScope(aw.CAPTION)&&(d.openElements.generateImpliedEndTags(),d.openElements.popUntilTagNamePopped(aw.CAPTION),d.activeFormattingElements.clearToLastMarker(),d.insertionMode=az.IN_TABLE,AN(d,e)):AI(d,e);break;case az.IN_COLUMN_GROUP:AU(this,a);break;case az.IN_TABLE_BODY:AW(this,a);break;case az.IN_ROW:AY(this,a);break;case az.IN_CELL:let u;f=this,u=(g=a).tagID,AT.has(u)?(f.openElements.hasInTableScope(aw.TD)||f.openElements.hasInTableScope(aw.TH))&&(f._closeTableCell(),AY(f,g)):AI(f,g);break;case az.IN_SELECT:A$(this,a);break;case az.IN_SELECT_IN_TABLE:let v;h=this,(v=(i=a).tagID)===aw.CAPTION||v===aw.TABLE||v===aw.TBODY||v===aw.TFOOT||v===aw.THEAD||v===aw.TR||v===aw.TD||v===aw.TH?(h.openElements.popUntilTagNamePopped(aw.SELECT),h._resetInsertionMode(),h._processStartTag(i)):A$(h,i);break;case az.IN_TEMPLATE:var w=this,x=a;switch(x.tagID){case aw.BASE:case aw.BASEFONT:case aw.BGSOUND:case aw.LINK:case aw.META:case aw.NOFRAMES:case aw.SCRIPT:case aw.STYLE:case aw.TEMPLATE:case aw.TITLE:Aw(w,x);break;case aw.CAPTION:case aw.COLGROUP:case aw.TBODY:case aw.TFOOT:case aw.THEAD:w.tmplInsertionModeStack[0]=az.IN_TABLE,w.insertionMode=az.IN_TABLE,AN(w,x);break;case aw.COL:w.tmplInsertionModeStack[0]=az.IN_COLUMN_GROUP,w.insertionMode=az.IN_COLUMN_GROUP,AU(w,x);break;case aw.TR:w.tmplInsertionModeStack[0]=az.IN_TABLE_BODY,w.insertionMode=az.IN_TABLE_BODY,AW(w,x);break;case aw.TD:case aw.TH:w.tmplInsertionModeStack[0]=az.IN_ROW,w.insertionMode=az.IN_ROW,AY(w,x);break;default:w.tmplInsertionModeStack[0]=az.IN_BODY,w.insertionMode=az.IN_BODY,AI(w,x)}break;case az.AFTER_BODY:j=this,(k=a).tagID===aw.HTML?AI(j,k):A2(j,k);break;case az.IN_FRAMESET:var y=this,z=a;switch(z.tagID){case aw.HTML:AI(y,z);break;case aw.FRAMESET:y._insertElement(z,as.HTML);break;case aw.FRAME:y._appendElement(z,as.HTML),z.ackSelfClosing=!0;break;case aw.NOFRAMES:Aw(y,z)}break;case az.AFTER_FRAMESET:var A=this,B=a;switch(B.tagID){case aw.HTML:AI(A,B);break;case aw.NOFRAMES:Aw(A,B)}break;case az.AFTER_AFTER_BODY:l=this,(m=a).tagID===aw.HTML?AI(l,m):A3(l,m);break;case az.AFTER_AFTER_FRAMESET:var C=this,D=a;switch(D.tagID){case aw.HTML:AI(C,D);break;case aw.NOFRAMES:Aw(C,D)}}}onEndTag(a){this.skipNextNewLine=!1,this.currentToken=a,this.currentNotInHTML?function(a,b){if(b.tagID===aw.P||b.tagID===aw.BR){A4(a),a._endTagOutsideForeignContent(b);return}for(let c=a.openElements.stackTop;c>0;c--){let d=a.openElements.items[c];if(a.treeAdapter.getNamespaceURI(d)===as.HTML){a._endTagOutsideForeignContent(b);break}let e=a.treeAdapter.getTagName(d);if(e.toLowerCase()===b.tagName){b.tagName=e,a.openElements.shortenToLength(c);break}}}(this,a):this._endTagOutsideForeignContent(a)}_endTagOutsideForeignContent(a){switch(this.insertionMode){case az.INITIAL:At(this,a);break;case az.BEFORE_HTML:let b;d=this,((b=(e=a).tagID)===aw.HTML||b===aw.HEAD||b===aw.BODY||b===aw.BR)&&Au(d,e);break;case az.BEFORE_HEAD:let c;f=this,(c=(g=a).tagID)===aw.HEAD||c===aw.BODY||c===aw.HTML||c===aw.BR?Av(f,g):f._err(g,al.endTagWithoutMatchingOpenElement);break;case az.IN_HEAD:var d,e,f,g,h,i,j,k,l,m,n,o,p=this,q=a;switch(q.tagID){case aw.HEAD:p.openElements.pop(),p.insertionMode=az.AFTER_HEAD;break;case aw.BODY:case aw.BR:case aw.HTML:Ay(p,q);break;case aw.TEMPLATE:Ax(p,q);break;default:p._err(q,al.endTagWithoutMatchingOpenElement)}break;case az.IN_HEAD_NO_SCRIPT:var r=this,s=a;switch(s.tagID){case aw.NOSCRIPT:r.openElements.pop(),r.insertionMode=az.IN_HEAD;break;case aw.BR:Az(r,s);break;default:r._err(s,al.endTagWithoutMatchingOpenElement)}break;case az.AFTER_HEAD:var t=this,u=a;switch(u.tagID){case aw.BODY:case aw.HTML:case aw.BR:AA(t,u);break;case aw.TEMPLATE:Ax(t,u);break;default:t._err(u,al.endTagWithoutMatchingOpenElement)}break;case az.IN_BODY:AK(this,a);break;case az.TEXT:h=this,a.tagID===aw.SCRIPT&&(null==(i=h.scriptHandler)||i.call(h,h.openElements.current)),h.openElements.pop(),h.insertionMode=h.originalInsertionMode;break;case az.IN_TABLE:AO(this,a);break;case az.IN_TABLE_TEXT:AS(this,a);break;case az.IN_CAPTION:var v=this,w=a;let x=w.tagID;switch(x){case aw.CAPTION:case aw.TABLE:v.openElements.hasInTableScope(aw.CAPTION)&&(v.openElements.generateImpliedEndTags(),v.openElements.popUntilTagNamePopped(aw.CAPTION),v.activeFormattingElements.clearToLastMarker(),v.insertionMode=az.IN_TABLE,x===aw.TABLE&&AO(v,w));break;case aw.BODY:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TBODY:case aw.TD:case aw.TFOOT:case aw.TH:case aw.THEAD:case aw.TR:break;default:AK(v,w)}break;case az.IN_COLUMN_GROUP:var y=this,z=a;switch(z.tagID){case aw.COLGROUP:y.openElements.currentTagId===aw.COLGROUP&&(y.openElements.pop(),y.insertionMode=az.IN_TABLE);break;case aw.TEMPLATE:Ax(y,z);break;case aw.COL:break;default:AV(y,z)}break;case az.IN_TABLE_BODY:AX(this,a);break;case az.IN_ROW:AZ(this,a);break;case az.IN_CELL:var A=this,B=a;let C=B.tagID;switch(C){case aw.TD:case aw.TH:A.openElements.hasInTableScope(C)&&(A.openElements.generateImpliedEndTags(),A.openElements.popUntilTagNamePopped(C),A.activeFormattingElements.clearToLastMarker(),A.insertionMode=az.IN_ROW);break;case aw.TABLE:case aw.TBODY:case aw.TFOOT:case aw.THEAD:case aw.TR:A.openElements.hasInTableScope(C)&&(A._closeTableCell(),AZ(A,B));break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:break;default:AK(A,B)}break;case az.IN_SELECT:A_(this,a);break;case az.IN_SELECT_IN_TABLE:let D;j=this,(D=(k=a).tagID)===aw.CAPTION||D===aw.TABLE||D===aw.TBODY||D===aw.TFOOT||D===aw.THEAD||D===aw.TR||D===aw.TD||D===aw.TH?j.openElements.hasInTableScope(D)&&(j.openElements.popUntilTagNamePopped(aw.SELECT),j._resetInsertionMode(),j.onEndTag(k)):A_(j,k);break;case az.IN_TEMPLATE:l=this,(m=a).tagID===aw.TEMPLATE&&Ax(l,m);break;case az.AFTER_BODY:A1(this,a);break;case az.IN_FRAMESET:n=this,a.tagID===aw.FRAMESET&&!n.openElements.isRootHtmlElementCurrent()&&(n.openElements.pop(),n.fragmentContext||n.openElements.currentTagId===aw.FRAMESET||(n.insertionMode=az.AFTER_FRAMESET));break;case az.AFTER_FRAMESET:o=this,a.tagID===aw.HTML&&(o.insertionMode=az.AFTER_AFTER_FRAMESET);break;case az.AFTER_AFTER_BODY:A3(this,a)}}onEof(a){switch(this.insertionMode){case az.INITIAL:At(this,a);break;case az.BEFORE_HTML:Au(this,a);break;case az.BEFORE_HEAD:Av(this,a);break;case az.IN_HEAD:Ay(this,a);break;case az.IN_HEAD_NO_SCRIPT:Az(this,a);break;case az.AFTER_HEAD:AA(this,a);break;case az.IN_BODY:case az.IN_TABLE:case az.IN_CAPTION:case az.IN_COLUMN_GROUP:case az.IN_TABLE_BODY:case az.IN_ROW:case az.IN_CELL:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:AL(this,a);break;case az.TEXT:var b,c;b=this,c=a,b._err(c,al.eofInElementThatCanContainOnlyText),b.openElements.pop(),b.insertionMode=b.originalInsertionMode,b.onEof(c);break;case az.IN_TABLE_TEXT:AS(this,a);break;case az.IN_TEMPLATE:A0(this,a);break;case az.AFTER_BODY:case az.IN_FRAMESET:case az.AFTER_FRAMESET:case az.AFTER_AFTER_BODY:case az.AFTER_AFTER_FRAMESET:As(this,a)}}onWhitespaceCharacter(a){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,a.chars.charCodeAt(0)===ak.LINE_FEED)){if(1===a.chars.length)return;a.chars=a.chars.substr(1)}if(this.tokenizer.inForeignNode)return void this._insertCharacters(a);switch(this.insertionMode){case az.IN_HEAD:case az.IN_HEAD_NO_SCRIPT:case az.AFTER_HEAD:case az.TEXT:case az.IN_COLUMN_GROUP:case az.IN_SELECT:case az.IN_SELECT_IN_TABLE:case az.IN_FRAMESET:case az.AFTER_FRAMESET:this._insertCharacters(a);break;case az.IN_BODY:case az.IN_CAPTION:case az.IN_CELL:case az.IN_TEMPLATE:case az.AFTER_BODY:case az.AFTER_AFTER_BODY:case az.AFTER_AFTER_FRAMESET:AC(this,a);break;case az.IN_TABLE:case az.IN_TABLE_BODY:case az.IN_ROW:AM(this,a);break;case az.IN_TABLE_TEXT:AQ(this,a)}}}function Aq(a,b){for(let c=0;c<8;c++){let c=function(a,b){let c=a.activeFormattingElements.getElementEntryInScopeWithTagName(b.tagName);return c?a.openElements.contains(c.element)?a.openElements.hasInScope(b.tagID)||(c=null):(a.activeFormattingElements.removeEntry(c),c=null):AJ(a,b),c}(a,b);if(!c)break;let d=function(a,b){let c=null,d=a.openElements.stackTop;for(;d>=0;d--){let e=a.openElements.items[d];if(e===b.element)break;a._isSpecialElement(e,a.openElements.tagIDs[d])&&(c=e)}return c||(a.openElements.shortenToLength(Math.max(d,0)),a.activeFormattingElements.removeEntry(b)),c}(a,c);if(!d)break;a.activeFormattingElements.bookmark=c;let e=function(a,b,c){let d=b,e=a.openElements.getCommonAncestor(b);for(let f=0,g=e;g!==c;f++,g=e){e=a.openElements.getCommonAncestor(g);let c=a.activeFormattingElements.getElementEntry(g),h=c&&f>=3;!c||h?(h&&a.activeFormattingElements.removeEntry(c),a.openElements.remove(g)):(g=function(a,b){let c=a.treeAdapter.getNamespaceURI(b.element),d=a.treeAdapter.createElement(b.token.tagName,c,b.token.attrs);return a.openElements.replace(b.element,d),b.element=d,d}(a,c),d===b&&(a.activeFormattingElements.bookmark=c),a.treeAdapter.detachNode(d),a.treeAdapter.appendChild(g,d),d=g)}return d}(a,d,c.element),f=a.openElements.getCommonAncestor(c.element);a.treeAdapter.detachNode(e),f&&function(a,b,c){let d=zJ(a.treeAdapter.getTagName(b));if(a._isElementCausesFosterParenting(d))a._fosterParentElement(c);else{let e=a.treeAdapter.getNamespaceURI(b);d===aw.TEMPLATE&&e===as.HTML&&(b=a.treeAdapter.getTemplateContent(b)),a.treeAdapter.appendChild(b,c)}}(a,f,e),function(a,b,c){let d=a.treeAdapter.getNamespaceURI(c.element),{token:e}=c,f=a.treeAdapter.createElement(e.tagName,d,e.attrs);a._adoptNodes(b,f),a.treeAdapter.appendChild(b,f),a.activeFormattingElements.insertElementAfterBookmark(f,e),a.activeFormattingElements.removeEntry(c),a.openElements.remove(c.element),a.openElements.insertAfter(b,f,e.tagID)}(a,d,c)}}function Ar(a,b){a._appendCommentNode(b,a.openElements.currentTmplContentOrNode)}function As(a,b){if(a.stopped=!0,b.location){let c=2*!a.fragmentContext;for(let d=a.openElements.stackTop;d>=c;d--)a._setEndLocation(a.openElements.items[d],b);if(!a.fragmentContext&&a.openElements.stackTop>=0){let c=a.openElements.items[0],d=a.treeAdapter.getNodeSourceCodeLocation(c);if(d&&!d.endTag&&(a._setEndLocation(c,b),a.openElements.stackTop>=1)){let c=a.openElements.items[1],d=a.treeAdapter.getNodeSourceCodeLocation(c);d&&!d.endTag&&a._setEndLocation(c,b)}}}}function At(a,b){a._err(b,al.missingDoctype,!0),a.treeAdapter.setDocumentMode(a.document,au.QUIRKS),a.insertionMode=az.BEFORE_HTML,a._processToken(b)}function Au(a,b){a._insertFakeRootElement(),a.insertionMode=az.BEFORE_HEAD,a._processToken(b)}function Av(a,b){a._insertFakeElement(av.HEAD,aw.HEAD),a.headElement=a.openElements.current,a.insertionMode=az.IN_HEAD,a._processToken(b)}function Aw(a,b){switch(b.tagID){case aw.HTML:AI(a,b);break;case aw.BASE:case aw.BASEFONT:case aw.BGSOUND:case aw.LINK:case aw.META:a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.TITLE:a._switchToTextParsing(b,zO.RCDATA);break;case aw.NOSCRIPT:a.options.scriptingEnabled?a._switchToTextParsing(b,zO.RAWTEXT):(a._insertElement(b,as.HTML),a.insertionMode=az.IN_HEAD_NO_SCRIPT);break;case aw.NOFRAMES:case aw.STYLE:a._switchToTextParsing(b,zO.RAWTEXT);break;case aw.SCRIPT:a._switchToTextParsing(b,zO.SCRIPT_DATA);break;case aw.TEMPLATE:a._insertTemplate(b),a.activeFormattingElements.insertMarker(),a.framesetOk=!1,a.insertionMode=az.IN_TEMPLATE,a.tmplInsertionModeStack.unshift(az.IN_TEMPLATE);break;case aw.HEAD:a._err(b,al.misplacedStartTagForHeadElement);break;default:Ay(a,b)}}function Ax(a,b){a.openElements.tmplCount>0?(a.openElements.generateImpliedEndTagsThoroughly(),a.openElements.currentTagId!==aw.TEMPLATE&&a._err(b,al.closingOfElementWithOpenChildElements),a.openElements.popUntilTagNamePopped(aw.TEMPLATE),a.activeFormattingElements.clearToLastMarker(),a.tmplInsertionModeStack.shift(),a._resetInsertionMode()):a._err(b,al.endTagWithoutMatchingOpenElement)}function Ay(a,b){a.openElements.pop(),a.insertionMode=az.AFTER_HEAD,a._processToken(b)}function Az(a,b){let c=b.type===am.EOF?al.openElementsLeftAfterEof:al.disallowedContentInNoscriptInHead;a._err(b,c),a.openElements.pop(),a.insertionMode=az.IN_HEAD,a._processToken(b)}function AA(a,b){a._insertFakeElement(av.BODY,aw.BODY),a.insertionMode=az.IN_BODY,AB(a,b)}function AB(a,b){switch(b.type){case am.CHARACTER:AD(a,b);break;case am.WHITESPACE_CHARACTER:AC(a,b);break;case am.COMMENT:Ar(a,b);break;case am.START_TAG:AI(a,b);break;case am.END_TAG:AK(a,b);break;case am.EOF:AL(a,b)}}function AC(a,b){a._reconstructActiveFormattingElements(),a._insertCharacters(b)}function AD(a,b){a._reconstructActiveFormattingElements(),a._insertCharacters(b),a.framesetOk=!1}function AE(a,b){a._reconstructActiveFormattingElements(),a._appendElement(b,as.HTML),a.framesetOk=!1,b.ackSelfClosing=!0}function AF(a){let b=zD(a,at.TYPE);return null!=b&&"hidden"===b.toLowerCase()}function AG(a,b){a._switchToTextParsing(b,zO.RAWTEXT)}function AH(a,b){a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML)}function AI(a,b){switch(b.tagID){case aw.I:case aw.S:case aw.B:case aw.U:case aw.EM:case aw.TT:case aw.BIG:case aw.CODE:case aw.FONT:case aw.SMALL:case aw.STRIKE:case aw.STRONG:a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.activeFormattingElements.pushElement(a.openElements.current,b);break;case aw.A:let c;(c=a.activeFormattingElements.getElementEntryInScopeWithTagName(av.A))&&(Aq(a,b),a.openElements.remove(c.element),a.activeFormattingElements.removeEntry(c)),a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.activeFormattingElements.pushElement(a.openElements.current,b);break;case aw.H1:case aw.H2:case aw.H3:case aw.H4:case aw.H5:case aw.H6:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),void 0!==a.openElements.currentTagId&&zM.has(a.openElements.currentTagId)&&a.openElements.pop(),a._insertElement(b,as.HTML);break;case aw.P:case aw.DL:case aw.OL:case aw.UL:case aw.DIV:case aw.DIR:case aw.NAV:case aw.MAIN:case aw.MENU:case aw.ASIDE:case aw.CENTER:case aw.FIGURE:case aw.FOOTER:case aw.HEADER:case aw.HGROUP:case aw.DIALOG:case aw.DETAILS:case aw.ADDRESS:case aw.ARTICLE:case aw.SEARCH:case aw.SECTION:case aw.SUMMARY:case aw.FIELDSET:case aw.BLOCKQUOTE:case aw.FIGCAPTION:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML);break;case aw.LI:case aw.DD:case aw.DT:a.framesetOk=!1;let d=b.tagID;for(let b=a.openElements.stackTop;b>=0;b--){let c=a.openElements.tagIDs[b];if(d===aw.LI&&c===aw.LI||(d===aw.DD||d===aw.DT)&&(c===aw.DD||c===aw.DT)){a.openElements.generateImpliedEndTagsWithExclusion(c),a.openElements.popUntilTagNamePopped(c);break}if(c!==aw.ADDRESS&&c!==aw.DIV&&c!==aw.P&&a._isSpecialElement(a.openElements.items[b],c))break}a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML);break;case aw.BR:case aw.IMG:case aw.WBR:case aw.AREA:case aw.EMBED:case aw.KEYGEN:AE(a,b);break;case aw.HR:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._appendElement(b,as.HTML),a.framesetOk=!1,b.ackSelfClosing=!0;break;case aw.RB:case aw.RTC:a.openElements.hasInScope(aw.RUBY)&&a.openElements.generateImpliedEndTags(),a._insertElement(b,as.HTML);break;case aw.RT:case aw.RP:a.openElements.hasInScope(aw.RUBY)&&a.openElements.generateImpliedEndTagsWithExclusion(aw.RTC),a._insertElement(b,as.HTML);break;case aw.PRE:case aw.LISTING:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),a.skipNextNewLine=!0,a.framesetOk=!1;break;case aw.XMP:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._reconstructActiveFormattingElements(),a.framesetOk=!1,a._switchToTextParsing(b,zO.RAWTEXT);break;case aw.SVG:a._reconstructActiveFormattingElements(),Ak(b),Al(b),b.selfClosing?a._appendElement(b,as.SVG):a._insertElement(b,as.SVG),b.ackSelfClosing=!0;break;case aw.HTML:0===a.openElements.tmplCount&&a.treeAdapter.adoptAttributes(a.openElements.items[0],b.attrs);break;case aw.BASE:case aw.LINK:case aw.META:case aw.STYLE:case aw.TITLE:case aw.SCRIPT:case aw.BGSOUND:case aw.BASEFONT:case aw.TEMPLATE:Aw(a,b);break;case aw.BODY:let e;(e=a.openElements.tryPeekProperlyNestedBodyElement())&&0===a.openElements.tmplCount&&(a.framesetOk=!1,a.treeAdapter.adoptAttributes(e,b.attrs));break;case aw.FORM:let f;f=a.openElements.tmplCount>0,(!a.formElement||f)&&(a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),f||(a.formElement=a.openElements.current));break;case aw.NOBR:a._reconstructActiveFormattingElements(),a.openElements.hasInScope(aw.NOBR)&&(Aq(a,b),a._reconstructActiveFormattingElements()),a._insertElement(b,as.HTML),a.activeFormattingElements.pushElement(a.openElements.current,b);break;case aw.MATH:a._reconstructActiveFormattingElements(),Aj(b),Al(b),b.selfClosing?a._appendElement(b,as.MATHML):a._insertElement(b,as.MATHML),b.ackSelfClosing=!0;break;case aw.TABLE:a.treeAdapter.getDocumentMode(a.document)!==au.QUIRKS&&a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),a.framesetOk=!1,a.insertionMode=az.IN_TABLE;break;case aw.INPUT:a._reconstructActiveFormattingElements(),a._appendElement(b,as.HTML),AF(b)||(a.framesetOk=!1),b.ackSelfClosing=!0;break;case aw.PARAM:case aw.TRACK:case aw.SOURCE:a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.IMAGE:b.tagName=av.IMG,b.tagID=aw.IMG,AE(a,b);break;case aw.BUTTON:a.openElements.hasInScope(aw.BUTTON)&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilTagNamePopped(aw.BUTTON)),a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.framesetOk=!1;break;case aw.APPLET:case aw.OBJECT:case aw.MARQUEE:a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.activeFormattingElements.insertMarker(),a.framesetOk=!1;break;case aw.IFRAME:a.framesetOk=!1,a._switchToTextParsing(b,zO.RAWTEXT);break;case aw.SELECT:a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML),a.framesetOk=!1,a.insertionMode=a.insertionMode===az.IN_TABLE||a.insertionMode===az.IN_CAPTION||a.insertionMode===az.IN_TABLE_BODY||a.insertionMode===az.IN_ROW||a.insertionMode===az.IN_CELL?az.IN_SELECT_IN_TABLE:az.IN_SELECT;break;case aw.OPTION:case aw.OPTGROUP:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a._reconstructActiveFormattingElements(),a._insertElement(b,as.HTML);break;case aw.NOEMBED:case aw.NOFRAMES:AG(a,b);break;case aw.FRAMESET:let g;g=a.openElements.tryPeekProperlyNestedBodyElement(),a.framesetOk&&g&&(a.treeAdapter.detachNode(g),a.openElements.popAllUpToHtmlElement(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_FRAMESET);break;case aw.TEXTAREA:a._insertElement(b,as.HTML),a.skipNextNewLine=!0,a.tokenizer.state=zO.RCDATA,a.originalInsertionMode=a.insertionMode,a.framesetOk=!1,a.insertionMode=az.TEXT;break;case aw.NOSCRIPT:a.options.scriptingEnabled?AG(a,b):AH(a,b);break;case aw.PLAINTEXT:a.openElements.hasInButtonScope(aw.P)&&a._closePElement(),a._insertElement(b,as.HTML),a.tokenizer.state=zO.PLAINTEXT;break;case aw.COL:case aw.TH:case aw.TD:case aw.TR:case aw.HEAD:case aw.FRAME:case aw.TBODY:case aw.TFOOT:case aw.THEAD:case aw.CAPTION:case aw.COLGROUP:break;default:AH(a,b)}}function AJ(a,b){let c=b.tagName,d=b.tagID;for(let b=a.openElements.stackTop;b>0;b--){let e=a.openElements.items[b],f=a.openElements.tagIDs[b];if(d===f&&(d!==aw.UNKNOWN||a.treeAdapter.getTagName(e)===c)){a.openElements.generateImpliedEndTagsWithExclusion(d),a.openElements.stackTop>=b&&a.openElements.shortenToLength(b);break}if(a._isSpecialElement(e,f))break}}function AK(a,b){switch(b.tagID){case aw.A:case aw.B:case aw.I:case aw.S:case aw.U:case aw.EM:case aw.TT:case aw.BIG:case aw.CODE:case aw.FONT:case aw.NOBR:case aw.SMALL:case aw.STRIKE:case aw.STRONG:Aq(a,b);break;case aw.P:a.openElements.hasInButtonScope(aw.P)||a._insertFakeElement(av.P,aw.P),a._closePElement();break;case aw.DL:case aw.UL:case aw.OL:case aw.DIR:case aw.DIV:case aw.NAV:case aw.PRE:case aw.MAIN:case aw.MENU:case aw.ASIDE:case aw.BUTTON:case aw.CENTER:case aw.FIGURE:case aw.FOOTER:case aw.HEADER:case aw.HGROUP:case aw.DIALOG:case aw.ADDRESS:case aw.ARTICLE:case aw.DETAILS:case aw.SEARCH:case aw.SECTION:case aw.SUMMARY:case aw.LISTING:case aw.FIELDSET:case aw.BLOCKQUOTE:case aw.FIGCAPTION:let c;c=b.tagID,a.openElements.hasInScope(c)&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilTagNamePopped(c));break;case aw.LI:a.openElements.hasInListItemScope(aw.LI)&&(a.openElements.generateImpliedEndTagsWithExclusion(aw.LI),a.openElements.popUntilTagNamePopped(aw.LI));break;case aw.DD:case aw.DT:let d;d=b.tagID,a.openElements.hasInScope(d)&&(a.openElements.generateImpliedEndTagsWithExclusion(d),a.openElements.popUntilTagNamePopped(d));break;case aw.H1:case aw.H2:case aw.H3:case aw.H4:case aw.H5:case aw.H6:a.openElements.hasNumberedHeaderInScope()&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilNumberedHeaderPopped());break;case aw.BR:a._reconstructActiveFormattingElements(),a._insertFakeElement(av.BR,aw.BR),a.openElements.pop(),a.framesetOk=!1;break;case aw.BODY:if(a.openElements.hasInScope(aw.BODY)&&(a.insertionMode=az.AFTER_BODY,a.options.sourceCodeLocationInfo)){let c=a.openElements.tryPeekProperlyNestedBodyElement();c&&a._setEndLocation(c,b)}break;case aw.HTML:a.openElements.hasInScope(aw.BODY)&&(a.insertionMode=az.AFTER_BODY,A1(a,b));break;case aw.FORM:!function(a){let b=a.openElements.tmplCount>0,{formElement:c}=a;b||(a.formElement=null),(c||b)&&a.openElements.hasInScope(aw.FORM)&&(a.openElements.generateImpliedEndTags(),b?a.openElements.popUntilTagNamePopped(aw.FORM):c&&a.openElements.remove(c))}(a);break;case aw.APPLET:case aw.OBJECT:case aw.MARQUEE:let e;e=b.tagID,a.openElements.hasInScope(e)&&(a.openElements.generateImpliedEndTags(),a.openElements.popUntilTagNamePopped(e),a.activeFormattingElements.clearToLastMarker());break;case aw.TEMPLATE:Ax(a,b);break;default:AJ(a,b)}}function AL(a,b){a.tmplInsertionModeStack.length>0?A0(a,b):As(a,b)}function AM(a,b){if(void 0!==a.openElements.currentTagId&&An.has(a.openElements.currentTagId))switch(a.pendingCharacterTokens.length=0,a.hasNonWhitespacePendingCharacterToken=!1,a.originalInsertionMode=a.insertionMode,a.insertionMode=az.IN_TABLE_TEXT,b.type){case am.CHARACTER:AR(a,b);break;case am.WHITESPACE_CHARACTER:AQ(a,b)}else AP(a,b)}function AN(a,b){switch(b.tagID){case aw.TD:case aw.TH:case aw.TR:a.openElements.clearBackToTableContext(),a._insertFakeElement(av.TBODY,aw.TBODY),a.insertionMode=az.IN_TABLE_BODY,AW(a,b);break;case aw.STYLE:case aw.SCRIPT:case aw.TEMPLATE:Aw(a,b);break;case aw.COL:a.openElements.clearBackToTableContext(),a._insertFakeElement(av.COLGROUP,aw.COLGROUP),a.insertionMode=az.IN_COLUMN_GROUP,AU(a,b);break;case aw.FORM:a.formElement||0!==a.openElements.tmplCount||(a._insertElement(b,as.HTML),a.formElement=a.openElements.current,a.openElements.pop());break;case aw.TABLE:a.openElements.hasInTableScope(aw.TABLE)&&(a.openElements.popUntilTagNamePopped(aw.TABLE),a._resetInsertionMode(),a._processStartTag(b));break;case aw.TBODY:case aw.TFOOT:case aw.THEAD:a.openElements.clearBackToTableContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_TABLE_BODY;break;case aw.INPUT:AF(b)?a._appendElement(b,as.HTML):AP(a,b),b.ackSelfClosing=!0;break;case aw.CAPTION:a.openElements.clearBackToTableContext(),a.activeFormattingElements.insertMarker(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_CAPTION;break;case aw.COLGROUP:a.openElements.clearBackToTableContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_COLUMN_GROUP;break;default:AP(a,b)}}function AO(a,b){switch(b.tagID){case aw.TABLE:a.openElements.hasInTableScope(aw.TABLE)&&(a.openElements.popUntilTagNamePopped(aw.TABLE),a._resetInsertionMode());break;case aw.TEMPLATE:Ax(a,b);break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TBODY:case aw.TD:case aw.TFOOT:case aw.TH:case aw.THEAD:case aw.TR:break;default:AP(a,b)}}function AP(a,b){let c=a.fosterParentingEnabled;a.fosterParentingEnabled=!0,AB(a,b),a.fosterParentingEnabled=c}function AQ(a,b){a.pendingCharacterTokens.push(b)}function AR(a,b){a.pendingCharacterTokens.push(b),a.hasNonWhitespacePendingCharacterToken=!0}function AS(a,b){let c=0;if(a.hasNonWhitespacePendingCharacterToken)for(;c<a.pendingCharacterTokens.length;c++)AP(a,a.pendingCharacterTokens[c]);else for(;c<a.pendingCharacterTokens.length;c++)a._insertCharacters(a.pendingCharacterTokens[c]);a.insertionMode=a.originalInsertionMode,a._processToken(b)}let AT=new Set([aw.CAPTION,aw.COL,aw.COLGROUP,aw.TBODY,aw.TD,aw.TFOOT,aw.TH,aw.THEAD,aw.TR]);function AU(a,b){switch(b.tagID){case aw.HTML:AI(a,b);break;case aw.COL:a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.TEMPLATE:Aw(a,b);break;default:AV(a,b)}}function AV(a,b){a.openElements.currentTagId===aw.COLGROUP&&(a.openElements.pop(),a.insertionMode=az.IN_TABLE,a._processToken(b))}function AW(a,b){switch(b.tagID){case aw.TR:a.openElements.clearBackToTableBodyContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_ROW;break;case aw.TH:case aw.TD:a.openElements.clearBackToTableBodyContext(),a._insertFakeElement(av.TR,aw.TR),a.insertionMode=az.IN_ROW,AY(a,b);break;case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.TBODY:case aw.TFOOT:case aw.THEAD:a.openElements.hasTableBodyContextInTableScope()&&(a.openElements.clearBackToTableBodyContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE,AN(a,b));break;default:AN(a,b)}}function AX(a,b){let c=b.tagID;switch(b.tagID){case aw.TBODY:case aw.TFOOT:case aw.THEAD:a.openElements.hasInTableScope(c)&&(a.openElements.clearBackToTableBodyContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE);break;case aw.TABLE:a.openElements.hasTableBodyContextInTableScope()&&(a.openElements.clearBackToTableBodyContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE,AO(a,b));break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TD:case aw.TH:case aw.TR:break;default:AO(a,b)}}function AY(a,b){switch(b.tagID){case aw.TH:case aw.TD:a.openElements.clearBackToTableRowContext(),a._insertElement(b,as.HTML),a.insertionMode=az.IN_CELL,a.activeFormattingElements.insertMarker();break;case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.TBODY:case aw.TFOOT:case aw.THEAD:case aw.TR:a.openElements.hasInTableScope(aw.TR)&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY,AW(a,b));break;default:AN(a,b)}}function AZ(a,b){switch(b.tagID){case aw.TR:a.openElements.hasInTableScope(aw.TR)&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY);break;case aw.TABLE:a.openElements.hasInTableScope(aw.TR)&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY,AX(a,b));break;case aw.TBODY:case aw.TFOOT:case aw.THEAD:(a.openElements.hasInTableScope(b.tagID)||a.openElements.hasInTableScope(aw.TR))&&(a.openElements.clearBackToTableRowContext(),a.openElements.pop(),a.insertionMode=az.IN_TABLE_BODY,AX(a,b));break;case aw.BODY:case aw.CAPTION:case aw.COL:case aw.COLGROUP:case aw.HTML:case aw.TD:case aw.TH:break;default:AO(a,b)}}function A$(a,b){switch(b.tagID){case aw.HTML:AI(a,b);break;case aw.OPTION:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a._insertElement(b,as.HTML);break;case aw.OPTGROUP:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a.openElements.currentTagId===aw.OPTGROUP&&a.openElements.pop(),a._insertElement(b,as.HTML);break;case aw.HR:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop(),a.openElements.currentTagId===aw.OPTGROUP&&a.openElements.pop(),a._appendElement(b,as.HTML),b.ackSelfClosing=!0;break;case aw.INPUT:case aw.KEYGEN:case aw.TEXTAREA:case aw.SELECT:a.openElements.hasInSelectScope(aw.SELECT)&&(a.openElements.popUntilTagNamePopped(aw.SELECT),a._resetInsertionMode(),b.tagID!==aw.SELECT&&a._processStartTag(b));break;case aw.SCRIPT:case aw.TEMPLATE:Aw(a,b)}}function A_(a,b){switch(b.tagID){case aw.OPTGROUP:a.openElements.stackTop>0&&a.openElements.currentTagId===aw.OPTION&&a.openElements.tagIDs[a.openElements.stackTop-1]===aw.OPTGROUP&&a.openElements.pop(),a.openElements.currentTagId===aw.OPTGROUP&&a.openElements.pop();break;case aw.OPTION:a.openElements.currentTagId===aw.OPTION&&a.openElements.pop();break;case aw.SELECT:a.openElements.hasInSelectScope(aw.SELECT)&&(a.openElements.popUntilTagNamePopped(aw.SELECT),a._resetInsertionMode());break;case aw.TEMPLATE:Ax(a,b)}}function A0(a,b){a.openElements.tmplCount>0?(a.openElements.popUntilTagNamePopped(aw.TEMPLATE),a.activeFormattingElements.clearToLastMarker(),a.tmplInsertionModeStack.shift(),a._resetInsertionMode(),a.onEof(b)):As(a,b)}function A1(a,b){var c;if(b.tagID===aw.HTML){if(a.fragmentContext||(a.insertionMode=az.AFTER_AFTER_BODY),a.options.sourceCodeLocationInfo&&a.openElements.tagIDs[0]===aw.HTML){a._setEndLocation(a.openElements.items[0],b);let d=a.openElements.items[1];!d||(null==(c=a.treeAdapter.getNodeSourceCodeLocation(d))?void 0:c.endTag)||a._setEndLocation(d,b)}}else A2(a,b)}function A2(a,b){a.insertionMode=az.IN_BODY,AB(a,b)}function A3(a,b){a.insertionMode=az.IN_BODY,AB(a,b)}function A4(a){for(;a.treeAdapter.getNamespaceURI(a.openElements.current)!==as.HTML&&void 0!==a.openElements.currentTagId&&!a._isIntegrationPoint(a.openElements.currentTagId,a.openElements.current);)a.openElements.pop()}function A5(a,b){return Ap.parse(a,b)}function A6(a,b,c){"string"==typeof a&&(c=b,b=a,a=null);let d=Ap.getFragmentParser(a,c);return d.tokenizer.write(b,!0),d.getFragment()}av.AREA,av.BASE,av.BASEFONT,av.BGSOUND,av.BR,av.COL,av.EMBED,av.FRAME,av.HR,av.IMG,av.INPUT,av.KEYGEN,av.LINK,av.META,av.PARAM,av.SOURCE,av.TRACK,av.WBR;var A7=a.i(61659),A7=A7,A8=a.i(305856),A8=A8;let A9=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ba=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Bb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Bc(a,b){var c;let d,e=!!((d="root"===(c=a).type?c.children[0]:c)&&("doctype"===d.type||"element"===d.type&&"html"===d.tagName.toLowerCase())),f=zp("type",{handlers:{root:Be,element:Bf,text:Bg,comment:Bi,doctype:Bh,raw:Bj},unknown:Bk}),g={parser:e?new Ap(Bb):Ap.getFragmentParser(void 0,Bb),handle(a){f(a,g)},stitches:!1,options:b||{}};f(a,g),Bl(g,vl());let h=zi(e?g.parser.document:g.parser.getFragment(),{file:g.options.file});return(g.stitches&&xg(h,"comment",function(a,b,c){if(a.value.stitch&&c&&void 0!==b)return c.children[b]=a.value.stitch,b}),"root"===h.type&&1===h.children.length&&h.children[0].type===a.type)?h.children[0]:h}function Bd(a,b){let c=-1;if(a)for(;++c<a.length;)b.handle(a[c])}function Be(a,b){Bd(a.children,b)}function Bf(a,b){(function(a,b){let c=a.tagName.toLowerCase();if(b.parser.tokenizer.state===zO.PLAINTEXT)return;Bl(b,vl(a));let d=b.parser.openElements.current,e="namespaceURI"in d?d.namespaceURI:zf.html;e===zf.html&&"svg"===c&&(e=zf.svg);let f=zr({...a,children:[]},"svg"===({space:e===zf.svg?"svg":"html"}).space?vg:vf),g={type:A7.TokenType.START_TAG,tagName:c,tagID:A8.getTagID(c),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in f?f.attrs:[],location:Bn(a)};b.parser.currentToken=g,b.parser._processToken(b.parser.currentToken),b.parser.tokenizer.lastStartTagName=c})(a,b),Bd(a.children,b),function(a,b){let c=a.tagName.toLowerCase();if(!b.parser.tokenizer.inForeignNode&&zu.includes(c)||b.parser.tokenizer.state===zO.PLAINTEXT)return;Bl(b,vk(a));let d={type:A7.TokenType.END_TAG,tagName:c,tagID:A8.getTagID(c),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Bn(a)};b.parser.currentToken=d,b.parser._processToken(b.parser.currentToken),c===b.parser.tokenizer.lastStartTagName&&(b.parser.tokenizer.state===zO.RCDATA||b.parser.tokenizer.state===zO.RAWTEXT||b.parser.tokenizer.state===zO.SCRIPT_DATA)&&(b.parser.tokenizer.state=zO.DATA)}(a,b)}function Bg(a,b){b.parser.tokenizer.state>4&&(b.parser.tokenizer.state=0);let c={type:A7.TokenType.CHARACTER,chars:a.value,location:Bn(a)};Bl(b,vl(a)),b.parser.currentToken=c,b.parser._processToken(b.parser.currentToken)}function Bh(a,b){let c={type:A7.TokenType.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Bn(a)};Bl(b,vl(a)),b.parser.currentToken=c,b.parser._processToken(b.parser.currentToken)}function Bi(a,b){let c=a.value,d={type:A7.TokenType.COMMENT,data:c,location:Bn(a)};Bl(b,vl(a)),b.parser.currentToken=d,b.parser._processToken(b.parser.currentToken)}function Bj(a,b){if(b.parser.tokenizer.preprocessor.html="",b.parser.tokenizer.preprocessor.pos=-1,b.parser.tokenizer.preprocessor.lastGapPos=-2,b.parser.tokenizer.preprocessor.gapStack=[],b.parser.tokenizer.preprocessor.skipNextNewLine=!1,b.parser.tokenizer.preprocessor.lastChunkWritten=!1,b.parser.tokenizer.preprocessor.endOfChunkHit=!1,b.parser.tokenizer.preprocessor.isEol=!1,Bm(b,vl(a)),b.parser.tokenizer.write(b.options.tagfilter?a.value.replace(A9,"&lt;$1$2"):a.value,!1),b.parser.tokenizer._runParsingLoop(),72===b.parser.tokenizer.state||78===b.parser.tokenizer.state){b.parser.tokenizer.preprocessor.lastChunkWritten=!0;let a=b.parser.tokenizer._consume();b.parser.tokenizer._callState(a)}}function Bk(a,b){if(b.options.passThrough&&b.options.passThrough.includes(a.type)){var c;let d;b.stitches=!0,d="children"in(c=a)?w6({...c,children:[]}):w6(c),"children"in a&&"children"in d&&(d.children=Bc({type:"root",children:a.children},b.options).children),Bi({type:"comment",value:{stitch:d}},b)}else{let b="";throw Ba.has(a.type)&&(b=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+a.type+"` node"+b)}}function Bl(a,b){Bm(a,b);let c=a.parser.tokenizer.currentCharacterToken;c&&c.location&&(c.location.endLine=a.parser.tokenizer.preprocessor.line,c.location.endCol=a.parser.tokenizer.preprocessor.col+1,c.location.endOffset=a.parser.tokenizer.preprocessor.offset+1,a.parser.currentToken=c,a.parser._processToken(a.parser.currentToken)),a.parser.tokenizer.paused=!1,a.parser.tokenizer.inLoop=!1,a.parser.tokenizer.active=!1,a.parser.tokenizer.returnState=zO.DATA,a.parser.tokenizer.charRefCode=-1,a.parser.tokenizer.consumedAfterSnapshot=-1,a.parser.tokenizer.currentLocation=null,a.parser.tokenizer.currentCharacterToken=null,a.parser.tokenizer.currentToken=null,a.parser.tokenizer.currentAttr={name:"",value:""}}function Bm(a,b){if(b&&void 0!==b.offset){let c={startLine:b.line,startCol:b.column,startOffset:b.offset,endLine:-1,endCol:-1,endOffset:-1};a.parser.tokenizer.preprocessor.lineStartPos=-b.column+1,a.parser.tokenizer.preprocessor.droppedBufferSize=b.offset,a.parser.tokenizer.preprocessor.line=b.line,a.parser.tokenizer.currentLocation=c}}function Bn(a){let b=vl(a)||{line:void 0,column:void 0,offset:void 0},c=vk(a)||{line:void 0,column:void 0,offset:void 0};return{startLine:b.line,startCol:b.column,startOffset:b.offset,endLine:c.line,endCol:c.column,endOffset:c.offset}}function Bo(a){return function(b,c){return Bc(b,{...a,file:c})}}let Bp={abandonedHeadElementChild:{reason:"Unexpected metadata element after head",description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:"Unexpected too big numeric character reference",description:"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)"},closingOfElementWithOpenChildElements:{reason:"Unexpected closing tag with open child elements",description:"Unexpectedly closing tag. Expected other tags to be closed first",url:!1},controlCharacterInInputStream:{reason:"Unexpected control character",description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:"Unexpected control character reference",description:"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace"},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:"Unexpected duplicate attribute",description:"Unexpectedly double attribute. Expected attributes to occur only once"},endTagWithAttributes:{reason:"Unexpected attribute on closing tag",description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:"Unexpected slash at end of closing tag",description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:"Unexpected unopened end tag",description:"Unexpected end tag. Expected no end tag or another end tag",url:!1},eofBeforeTagName:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected tag name instead"},eofInCdata:{reason:"Unexpected end of file in CDATA",description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:"Unexpected end of file in comment",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:"Unexpected end of file in doctype",description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:"Unexpected end of file in element that can only contain text",description:"Unexpected end of file. Expected text or a closing tag",url:!1},eofInScriptHtmlCommentLikeText:{reason:"Unexpected end of file in comment inside script",description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:"Unexpected end of file in tag",description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:"Incorrectly closed comment",description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:"Incorrectly opened comment",description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:"Invalid sequence after doctype name",description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:"Invalid first character in tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:"Misplaced doctype",description:"Unexpected doctype. Expected doctype before head",url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:"Missing attribute value",description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:"Missing doctype before other content",description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:"Missing doctype name",description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:"Missing public identifier in doctype",description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:"Missing system identifier in doctype",description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:"Missing name in end tag",description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:"Missing quote before public identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:"Missing quote before system identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:"Missing semicolon after character reference",description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:"Missing whitespace after public identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:"Missing whitespace after system identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:"Missing whitespace before doctype name",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:"Missing whitespace between attributes",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:"Missing whitespace between public and system identifiers in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:"Unexpected nested comment",description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:"Unexpected non-conforming doctype declaration",description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:"Unexpected trailing slash on start tag of non-void element",description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:"Unexpected noncharacter code point referenced by character reference",description:"Unexpected code point. Do not use noncharacters in HTML"},noncharacterInInputStream:{reason:"Unexpected noncharacter character",description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:"Unexpected NULL character referenced by character reference",description:"Unexpected code point. Do not use NULL characters in HTML"},openElementsLeftAfterEof:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected closing tag instead",url:!1},surrogateCharacterReference:{reason:"Unexpected surrogate character referenced by character reference",description:"Unexpected code point. Do not use lone surrogate characters in HTML"},surrogateInInputStream:{reason:"Unexpected surrogate character",description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:"Invalid character after system identifier in doctype",description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:"Unexpected character in attribute name",description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:"Unexpected character in unquoted attribute value",description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:"Unexpected equals sign before attribute name",description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:"Unexpected NULL character",description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:"Unexpected question mark instead of tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:"Unexpected slash in tag",description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:"Unexpected unknown named character reference",description:"Unexpected character reference. Expected known named character references"}},Bq=/-[a-z]/g,Br=/%c(?:([-+])(\d+))?/g,Bs=/%x/g,Bt={2:!0,1:!1,0:null},Bu={};function Bv(a){return a.charAt(1).toUpperCase()}let Bw=function(a,b,c){let d=xa(c);if(!a||!a.type||!a.children)throw Error("Expected parent node");if("number"==typeof b){if(b<0||b===1/0)throw Error("Expected positive finite number as index")}else if((b=a.children.indexOf(b))<0)throw Error("Expected child node or index");for(;++b<a.children.length;)if(d(a.children[b],b,a))return a.children[b]},Bx=function(a){if(null==a)return Bz;if("string"==typeof a){var b;return b=a,By(function(a){return a.tagName===b})}if("object"==typeof a){var c=a;let b=[],d=-1;for(;++d<c.length;)b[d]=Bx(c[d]);return By(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}if("function"==typeof a)return By(a);throw Error("Expected function, string, or array as `test`")};function By(a){return function(b,c,d){var e;return!!(null!==(e=b)&&"object"==typeof e&&"type"in e&&"tagName"in e&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function Bz(a){return!!(a&&"object"==typeof a&&"type"in a&&"element"===a.type&&"tagName"in a&&"string"==typeof a.tagName)}let BA=/\n/g,BB=/[\t ]+/g,BC=Bx("br"),BD=Bx(function(a){return"td"===a.tagName||"th"===a.tagName}),BE=Bx("p"),BF=Bx("tr"),BG=Bx(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(a){return!!(a.properties||{}).hidden},function(a){return"dialog"===a.tagName&&!(a.properties||{}).open}]),BH=Bx(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function BI(a,b){let c,d=String(a.value),e=[],f=[],g=0;for(;g<=d.length;){BA.lastIndex=g;let a=BA.exec(d),c=a&&"index"in a?a.index:d.length;e.push(function(a,b,c){let d,e=[],f=0;for(;f<a.length;){BB.lastIndex=f;let c=BB.exec(a);d=c?c.index:a.length,f||d||!c||b||e.push(""),f!==d&&e.push(a.slice(f,d)),f=c?d+c[0].length:d}return f===d||c||e.push(""),e.join(" ")}(d.slice(g,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==g||b.breakBefore,c!==d.length||b.breakAfter)),g=c+1}let h=-1;for(;++h<e.length;)8203===e[h].charCodeAt(e[h].length-1)||h<e.length-1&&8203===e[h+1].charCodeAt(0)?(f.push(e[h]),c=void 0):e[h]?("number"==typeof c&&f.push(c),f.push(e[h]),c=0):(0===h||h===e.length-1)&&f.push(0);return f}function BJ(a,b){if("element"===a.type){let c=a.properties||{};switch(a.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return c.wrap?"pre-wrap":"pre";case"td":case"th":return c.noWrap?"nowrap":b.whitespace;case"textarea":return"pre-wrap"}}return b.whitespace}var BK=a.i(948986);let BL={},BM=[];function BN(a){let b=a||BL;return function(a,c){xf(a,"element",function(a,d){let e,f=Array.isArray(a.properties.className)?a.properties.className:BM,g=f.includes("language-math"),h=f.includes("math-display"),i=f.includes("math-inline"),j=h;if(!g&&!h&&!i)return;let k=d[d.length-1],l=a;if("code"===a.tagName&&g&&k&&"element"===k.type&&"pre"===k.tagName&&(l=k,k=d[d.length-2],j=!0),!k)return;let m=function(a,b){let c,d="children"in a?a.children:[],e=BH(a),f=BJ(a,{whitespace:(b||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),g=[];("text"===a.type||"comment"===a.type)&&g.push(...BI(a,{whitespace:f,breakBefore:!0,breakAfter:!0}));let h=-1;for(;++h<d.length;)g.push(...function a(b,c,d){return"element"===b.type?function(b,c,d){let e,f,g=BJ(b,d),h=b.children||[],i=-1,j=[];if(BG(b))return j;for(BC(b)||BF(b)&&Bw(c,b,BF)?f="\n":BE(b)?(e=2,f=2):BH(b)&&(e=1,f=1);++i<h.length;)j=j.concat(a(h[i],b,{whitespace:g,breakBefore:i?void 0:e,breakAfter:i<h.length-1?BC(h[i+1]):f}));return BD(b)&&Bw(c,b,BD)&&j.push(" "),e&&j.unshift(e),f&&j.push(f),j}(b,c,d):"text"===b.type?"normal"===d.whitespace?BI(b,d):[String(b.value)]:[]}(d[h],a,{whitespace:f,breakBefore:h?void 0:e,breakAfter:h<d.length-1?BC(d[h+1]):e}));let i=[];for(h=-1;++h<g.length;){let a=g[h];"number"==typeof a?void 0!==c&&a>c&&(c=a):a&&(void 0!==c&&c>-1&&i.push("\n".repeat(c)||" "),c=-1,i.push(a))}return i.join("")}(l,{whitespace:"pre"});try{e=BK.default.renderToString(m,{...b,displayMode:j,throwOnError:!0})}catch(g){let f=g.name.toLowerCase();c.message("Could not render math with KaTeX",{ancestors:[...d,a],cause:g,place:a.position,ruleId:f,source:"rehype-katex"});try{e=BK.default.renderToString(m,{...b,displayMode:j,strict:"ignore",throwOnError:!1})}catch{e=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(b.errorColor||"#cc0000"),title:String(g)},children:[{type:"text",value:m}]}]}}"string"==typeof e&&(e=function(a,b){let c,d,e,f,g,h=(d=(c=b||Bu).onerror,e=a instanceof xB?a:new xB(a),f=c.fragment?A6:A5,zi(f(g=String(e),{sourceCodeLocationInfo:!0,onParseError:c.onerror?function(a){let b=a.code,f=b.replace(Bq,Bv),h=c[f],i=null==h||h,j="number"==typeof i?i:+!!i;if(j){let c=Bp[f];uB(c,"expected known error from `parse5`");let g=new vs(k(c.reason),{place:{start:{line:a.startLine,column:a.startCol,offset:a.startOffset},end:{line:a.endLine,column:a.endCol,offset:a.endOffset}},ruleId:b,source:"hast-util-from-html"});e.path&&(g.file=e.path,g.name=e.path+":"+g.name),g.fatal=Bt[j],g.note=k(c.description),g.url=!1===c.url?void 0:"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-"+b,uB(d,"`internalOnerror` is not passed if `onerror` is not set"),d(g)}function k(b){return b.replace(Br,function(b,c,d){var e;let f=(d?Number.parseInt(d,10):0)*("-"===c?-1:1);return"`"===(e=g.charAt(a.startOffset+f))?"` ` `":e}).replace(Bs,function(){return"0x"+g.charCodeAt(a.startOffset).toString(16).toUpperCase()})}}:null,scriptingEnabled:!1}),{file:e,space:c.space,verbose:c.verbose}));return xg(h,function(a){delete a.position}),delete h.data,h}(e,{fragment:!0}).children);let n=k.children.indexOf(l);return k.children.splice(n,1,...e),xe})}}let BO=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],BP={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...BO,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...BO],h2:[["className","sr-only"]],img:[...BO,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...BO,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...BO],table:[...BO],ul:[...BO,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},BQ={}.hasOwnProperty;function BR(a,b){if(b&&"object"==typeof b)switch("string"==typeof b.type?b.type:""){case"comment":var c,d,e=a,f=b;if(e.schema.allowComments){let a="string"==typeof f.value?f.value:"",b=a.indexOf("-->"),c={type:"comment",value:b<0?a:a.slice(0,b)};return BV(c,f),c}return;case"doctype":var g=a,h=b;if(g.schema.allowDoctypes){let a={type:"doctype"};return BV(a,h),a}return;case"element":return function(a,b){let c="string"==typeof b.tagName?b.tagName:"";a.stack.push(c);let d=BS(a,b.children),e=function(a,b){let c,d=a.stack[a.stack.length-1],e=a.schema.attributes,f=a.schema.required,g=e&&BQ.call(e,d)?e[d]:void 0,h=e&&BQ.call(e,"*")?e["*"]:void 0,i=b&&"object"==typeof b?b:{},j={};for(c in i)if(BQ.call(i,c)){let b=i[c],d=BT(a,BW(g,c),c,b);null==d&&(d=BT(a,BW(h,c),c,b)),null!=d&&(j[c]=d)}if(f&&BQ.call(f,d)){let a=f[d];for(c in a)BQ.call(a,c)&&!BQ.call(j,c)&&(j[c]=a[c])}return j}(a,b.properties);a.stack.pop();let f=!1;if(c&&"*"!==c&&(!a.schema.tagNames||a.schema.tagNames.includes(c))&&(f=!0,a.schema.ancestors&&BQ.call(a.schema.ancestors,c))){let b=a.schema.ancestors[c],d=-1;for(f=!1;++d<b.length;)a.stack.includes(b[d])&&(f=!0)}if(!f)return a.schema.strip&&!a.schema.strip.includes(c)?d:void 0;let g={type:"element",tagName:c,properties:e,children:d};return BV(g,b),g}(a,b);case"root":let i;return BV(i={type:"root",children:BS(a,(c=b).children)},c),i;case"text":let j;return BV(j={type:"text",value:"string"==typeof(d=b).value?d.value:""},d),j}}function BS(a,b){let c=[];if(Array.isArray(b)){let d=-1;for(;++d<b.length;){let e=BR(a,b[d]);e&&(Array.isArray(e)?c.push(...e):c.push(e))}}return c}function BT(a,b,c,d){return b?Array.isArray(d)?function(a,b,c,d){let e=-1,f=[];for(;++e<d.length;){let g=BU(a,b,c,d[e]);("number"==typeof g||"string"==typeof g)&&f.push(g)}return f}(a,b,c,d):BU(a,b,c,d):void 0}function BU(a,b,c,d){if(("boolean"==typeof d||"number"==typeof d||"string"==typeof d)&&function(a,b,c){let d=a.schema.protocols&&BQ.call(a.schema.protocols,b)?a.schema.protocols[b]:void 0;if(!d||0===d.length)return!0;let e=String(c),f=e.indexOf(":"),g=e.indexOf("?"),h=e.indexOf("#"),i=e.indexOf("/");if(f<0||i>-1&&f>i||g>-1&&f>g||h>-1&&f>h)return!0;let j=-1;for(;++j<d.length;){let a=d[j];if(f===a.length&&e.slice(0,a.length)===a)return!0}return!1}(a,c,d)){if("object"==typeof b&&b.length>1){let a=!1,c=0;for(;++c<b.length;){let e=b[c];if(e&&"object"==typeof e&&"flags"in e){if(e.test(String(d))){a=!0;break}}else if(e===d){a=!0;break}}if(!a)return}return a.schema.clobber&&a.schema.clobberPrefix&&a.schema.clobber.includes(c)?a.schema.clobberPrefix+d:d}}function BV(a,b){let c=vn(b);b.data&&(a.data=w6(b.data)),c&&(a.position=c)}function BW(a,b){let c,d=-1;if(a)for(;++d<a.length;){let e=a[d],f="string"==typeof e?e:e[0];if(f===b)return e;"data*"===f&&(c=e)}if(b.length>4&&"data"===b.slice(0,4).toLowerCase())return c}function BX(a){return function(b){let c,d;return c={type:"root",children:[]},(d=BR({schema:a?{...BP,...a}:BP,stack:[]},b))&&(Array.isArray(d)?1===d.length?c=d[0]:c.children=d:c=d),c}}var BY=a.i(92743),BZ=a.i(995051),B$=a.i(441415),B_=a.i(577518);function B0(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function B1(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?B0(Object(c),!0).forEach(function(b){(0,B$.default)(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):B0(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}var B2={},B3=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function B4(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function B5(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?B4(Object(c),!0).forEach(function(b){(0,B$.default)(a,b,c[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):B4(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}var B6=/\n/g;function B7(a){var b,c,d,e,f=a.codeString,g=a.codeStyle,h=a.containerStyle,i=a.numberStyle,j=a.startingLineNumber;return aB.default.createElement("code",{style:Object.assign({},g,void 0===h?{float:"left",paddingRight:"10px"}:h)},(c=(b={lines:f.replace(/\n$/,"").split("\n"),style:void 0===i?{}:i,startingLineNumber:j}).lines,d=b.startingLineNumber,e=b.style,c.map(function(a,b){var c=b+d;return aB.default.createElement("span",{key:"line-".concat(b),className:"react-syntax-highlighter-line-number",style:"function"==typeof e?e(c):e},"".concat(c,"\n"))})))}function B8(a,b){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(a),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:b},children:[{type:"text",value:a}]}}function B9(a,b,c){var d={display:"inline-block",minWidth:"".concat(c.toString().length,".25em"),paddingRight:"1em",textAlign:"right",userSelect:"none"},e="function"==typeof a?a(b):a;return B5(B5({},d),e)}function Ca(a){var b=a.children,c=a.lineNumber,d=a.lineNumberStyle,e=a.largestLineNumber,f=a.showInlineLineNumbers,g=a.lineProps,h=void 0===g?{}:g,i=a.className,j=void 0===i?[]:i,k=a.showLineNumbers,l=a.wrapLongLines,m=a.wrapLines,n=void 0!==m&&m?B5({},"function"==typeof h?h(c):h):{};if(n.className=n.className?[].concat((0,BZ.default)(n.className.trim().split(/\s+/)),(0,BZ.default)(j)):j,c&&f){var o=B9(d,c,e);b.unshift(B8(c,o))}return l&k&&(n.style=B5({display:"flex"},n.style)),{type:"element",tagName:"span",properties:n,children:b}}function Cb(a){var b=a.rows,c=a.stylesheet,d=a.useInlineStyles;return b.map(function(a,b){return function a(b){var c=b.node,d=b.stylesheet,e=b.style,f=b.useInlineStyles,g=b.key,h=c.properties,i=c.type,j=c.tagName,k=c.value;if("text"===i)return k;if(j){var l,m,n=(l=0,function(b){return l+=1,b.map(function(b,c){return a({node:b,stylesheet:d,useInlineStyles:f,key:"code-segment-".concat(l,"-").concat(c)})})});if(f){var o=Object.keys(d).reduce(function(a,b){return b.split(".").forEach(function(b){a.includes(b)||a.push(b)}),a},[]),p=h.className&&h.className.includes("token")?["token"]:[],q=h.className&&p.concat(h.className.filter(function(a){return!o.includes(a)}));m=B1(B1({},h),{},{className:q.join(" ")||void 0,style:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;return(function(a){if(0===a.length||1===a.length)return a;var b,c=a.join(".");return B2[c]||(B2[c]=0===(b=a.length)||1===b?a:2===b?[a[0],a[1],"".concat(a[0],".").concat(a[1]),"".concat(a[1],".").concat(a[0])]:3===b?[a[0],a[1],a[2],"".concat(a[0],".").concat(a[1]),"".concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[0]),"".concat(a[1],".").concat(a[2]),"".concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[1]),"".concat(a[0],".").concat(a[1],".").concat(a[2]),"".concat(a[0],".").concat(a[2],".").concat(a[1]),"".concat(a[1],".").concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[0],".").concat(a[1]),"".concat(a[2],".").concat(a[1],".").concat(a[0])]:b>=4?[a[0],a[1],a[2],a[3],"".concat(a[0],".").concat(a[1]),"".concat(a[0],".").concat(a[2]),"".concat(a[0],".").concat(a[3]),"".concat(a[1],".").concat(a[0]),"".concat(a[1],".").concat(a[2]),"".concat(a[1],".").concat(a[3]),"".concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[1]),"".concat(a[2],".").concat(a[3]),"".concat(a[3],".").concat(a[0]),"".concat(a[3],".").concat(a[1]),"".concat(a[3],".").concat(a[2]),"".concat(a[0],".").concat(a[1],".").concat(a[2]),"".concat(a[0],".").concat(a[1],".").concat(a[3]),"".concat(a[0],".").concat(a[2],".").concat(a[1]),"".concat(a[0],".").concat(a[2],".").concat(a[3]),"".concat(a[0],".").concat(a[3],".").concat(a[1]),"".concat(a[0],".").concat(a[3],".").concat(a[2]),"".concat(a[1],".").concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[0],".").concat(a[3]),"".concat(a[1],".").concat(a[2],".").concat(a[0]),"".concat(a[1],".").concat(a[2],".").concat(a[3]),"".concat(a[1],".").concat(a[3],".").concat(a[0]),"".concat(a[1],".").concat(a[3],".").concat(a[2]),"".concat(a[2],".").concat(a[0],".").concat(a[1]),"".concat(a[2],".").concat(a[0],".").concat(a[3]),"".concat(a[2],".").concat(a[1],".").concat(a[0]),"".concat(a[2],".").concat(a[1],".").concat(a[3]),"".concat(a[2],".").concat(a[3],".").concat(a[0]),"".concat(a[2],".").concat(a[3],".").concat(a[1]),"".concat(a[3],".").concat(a[0],".").concat(a[1]),"".concat(a[3],".").concat(a[0],".").concat(a[2]),"".concat(a[3],".").concat(a[1],".").concat(a[0]),"".concat(a[3],".").concat(a[1],".").concat(a[2]),"".concat(a[3],".").concat(a[2],".").concat(a[0]),"".concat(a[3],".").concat(a[2],".").concat(a[1]),"".concat(a[0],".").concat(a[1],".").concat(a[2],".").concat(a[3]),"".concat(a[0],".").concat(a[1],".").concat(a[3],".").concat(a[2]),"".concat(a[0],".").concat(a[2],".").concat(a[1],".").concat(a[3]),"".concat(a[0],".").concat(a[2],".").concat(a[3],".").concat(a[1]),"".concat(a[0],".").concat(a[3],".").concat(a[1],".").concat(a[2]),"".concat(a[0],".").concat(a[3],".").concat(a[2],".").concat(a[1]),"".concat(a[1],".").concat(a[0],".").concat(a[2],".").concat(a[3]),"".concat(a[1],".").concat(a[0],".").concat(a[3],".").concat(a[2]),"".concat(a[1],".").concat(a[2],".").concat(a[0],".").concat(a[3]),"".concat(a[1],".").concat(a[2],".").concat(a[3],".").concat(a[0]),"".concat(a[1],".").concat(a[3],".").concat(a[0],".").concat(a[2]),"".concat(a[1],".").concat(a[3],".").concat(a[2],".").concat(a[0]),"".concat(a[2],".").concat(a[0],".").concat(a[1],".").concat(a[3]),"".concat(a[2],".").concat(a[0],".").concat(a[3],".").concat(a[1]),"".concat(a[2],".").concat(a[1],".").concat(a[0],".").concat(a[3]),"".concat(a[2],".").concat(a[1],".").concat(a[3],".").concat(a[0]),"".concat(a[2],".").concat(a[3],".").concat(a[0],".").concat(a[1]),"".concat(a[2],".").concat(a[3],".").concat(a[1],".").concat(a[0]),"".concat(a[3],".").concat(a[0],".").concat(a[1],".").concat(a[2]),"".concat(a[3],".").concat(a[0],".").concat(a[2],".").concat(a[1]),"".concat(a[3],".").concat(a[1],".").concat(a[0],".").concat(a[2]),"".concat(a[3],".").concat(a[1],".").concat(a[2],".").concat(a[0]),"".concat(a[3],".").concat(a[2],".").concat(a[0],".").concat(a[1]),"".concat(a[3],".").concat(a[2],".").concat(a[1],".").concat(a[0])]:void 0),B2[c]})(a.filter(function(a){return"token"!==a})).reduce(function(a,b){return B1(B1({},a),c[b])},b)}(h.className,Object.assign({},h.style,void 0===e?{}:e),d)})}else m=B1(B1({},h),{},{className:h.className.join(" ")});var r=n(c.children);return aB.default.createElement(j,(0,B_.default)({key:g},m),r)}}({node:a,stylesheet:c,useInlineStyles:d,key:"code-segment-".concat(b)})})}function Cc(a){return a&&void 0!==a.highlightAuto}var Cd=(_=a.i(807416).default,aa={'code[class*="language-"]':{color:"black",background:"none",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"black",background:"#f5f2f0",textShadow:"0 1px white",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto"},'pre[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::-moz-selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'pre[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"]::selection':{textShadow:"none",background:"#b3d4fc"},'code[class*="language-"] ::selection':{textShadow:"none",background:"#b3d4fc"},':not(pre) > code[class*="language-"]':{background:"#f5f2f0",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"slategray"},prolog:{color:"slategray"},doctype:{color:"slategray"},cdata:{color:"slategray"},punctuation:{color:"#999"},namespace:{Opacity:".7"},property:{color:"#905"},tag:{color:"#905"},boolean:{color:"#905"},number:{color:"#905"},constant:{color:"#905"},symbol:{color:"#905"},deleted:{color:"#905"},selector:{color:"#690"},"attr-name":{color:"#690"},string:{color:"#690"},char:{color:"#690"},builtin:{color:"#690"},inserted:{color:"#690"},operator:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},entity:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)",cursor:"help"},url:{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".language-css .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},".style .token.string":{color:"#9a6e3a",background:"hsla(0, 0%, 100%, .5)"},atrule:{color:"#07a"},"attr-value":{color:"#07a"},keyword:{color:"#07a"},function:{color:"#DD4A68"},"class-name":{color:"#DD4A68"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"bold"},variable:{color:"#e90"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}},function(a){var b,c,d=a.language,e=a.children,f=a.style,g=void 0===f?aa:f,h=a.customStyle,i=void 0===h?{}:h,j=a.codeTagProps,k=void 0===j?{className:d?"language-".concat(d):void 0,style:B5(B5({},g['code[class*="language-"]']),g['code[class*="language-'.concat(d,'"]')])}:j,l=a.useInlineStyles,m=void 0===l||l,n=a.showLineNumbers,o=void 0!==n&&n,p=a.showInlineLineNumbers,q=void 0===p||p,r=a.startingLineNumber,s=void 0===r?1:r,t=a.lineNumberContainerStyle,u=a.lineNumberStyle,v=void 0===u?{}:u,w=a.wrapLines,x=a.wrapLongLines,y=void 0!==x&&x,z=a.lineProps,A=a.renderer,B=a.PreTag,C=void 0===B?"pre":B,D=a.CodeTag,E=void 0===D?"code":D,F=a.code,G=void 0===F?(Array.isArray(e)?e[0]:e)||"":F,H=a.astGenerator,I=(0,BY.default)(a,B3);H=H||_;var J=o?aB.default.createElement(B7,{containerStyle:t,codeStyle:k.style||{},numberStyle:v,startingLineNumber:s,codeString:G}):null,K=g.hljs||g['pre[class*="language-"]']||{backgroundColor:"#fff"},L=Cc(H)?"hljs":"prismjs",M=m?Object.assign({},I,{style:Object.assign({},K,i)}):Object.assign({},I,{className:I.className?"".concat(L," ").concat(I.className):L,style:Object.assign({},i)});if(y?k.style=B5({whiteSpace:"pre-wrap"},k.style):k.style=B5({whiteSpace:"pre"},k.style),!H)return aB.default.createElement(C,M,J,aB.default.createElement(E,k,G));(void 0===w&&A||y)&&(w=!0),A=A||Cb;var N=[{type:"text",value:G}],O=function(a){var b=a.astGenerator,c=a.language,d=a.code,e=a.defaultCodeValue;if(Cc(b)){var f=-1!==b.listLanguages().indexOf(c);return"text"===c?{value:e,language:"text"}:f?b.highlight(c,d):b.highlightAuto(d)}try{return c&&"text"!==c?{value:b.highlight(d,c)}:{value:e}}catch(a){return{value:e}}}({astGenerator:H,language:d,code:G,defaultCodeValue:N});null===O.language&&(O.value=N);var P=s+(null!=(b=null==(c=G.match(/\n/g))?void 0:c.length)?b:0),Q=function(a,b,c,d,e,f,g,h,i){var j,k=function a(b){for(var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],e=0;e<b.length;e++){var f=b[e];if("text"===f.type)d.push(Ca({children:[f],className:(0,BZ.default)(new Set(c))}));else if(f.children){var g=c.concat(f.properties.className);a(f.children,g).forEach(function(a){return d.push(a)})}}return d}(a.value),l=[],m=-1,n=0;function o(a,f){var j=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return b||j.length>0?function(a,f){var j=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Ca({children:a,lineNumber:f,lineNumberStyle:h,largestLineNumber:g,showInlineLineNumbers:e,lineProps:c,className:j,showLineNumbers:d,wrapLongLines:i,wrapLines:b})}(a,f,j):function(a,b){if(d&&b&&e){var c=B9(h,b,g);a.unshift(B8(b,c))}return a}(a,f)}for(;n<k.length;)!function(){var a=k[n],b=a.children[0].value;if(b.match(B6)){var c=b.split("\n");c.forEach(function(b,e){var g=d&&l.length+f,h={type:"text",value:"".concat(b,"\n")};if(0===e){var i=o(k.slice(m+1,n).concat(Ca({children:[h],className:a.properties.className})),g);l.push(i)}else if(e===c.length-1){var j=k[n+1]&&k[n+1].children&&k[n+1].children[0],p={type:"text",value:"".concat(b)};if(j){var q=Ca({children:[p],className:a.properties.className});k.splice(n+1,0,q)}else{var r=o([p],g,a.properties.className);l.push(r)}}else{var s=o([h],g,a.properties.className);l.push(s)}}),m=n}n++}();if(m!==k.length-1){var p=k.slice(m+1,k.length);if(p&&p.length){var q=o(p,d&&l.length+f);l.push(q)}}return b?l:(j=[]).concat.apply(j,l)}(O,w,void 0===z?{}:z,o,q,s,P,v,y);return aB.default.createElement(C,M,aB.default.createElement(E,k,!q&&J,A({rows:Q,stylesheet:g,useInlineStyles:m})))});Cd.supportedLanguages=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"];let Ce={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}},Cf=cz("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);async function Cg(a){try{if("u">typeof navigator&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(a),!0}catch{}try{if("u"<typeof document)return!1;let b=document.createElement("textarea");b.value=a,b.setAttribute("readonly",""),b.style.position="fixed",b.style.top="-9999px",b.style.opacity="0",document.body.appendChild(b);try{return b.select(),b.setSelectionRange(0,a.length),document.execCommand("copy")}finally{b.remove()}}catch{return!1}}let Ch=aB.default.memo(({language:a,value:b})=>{let[c,d]=(0,aB.useState)(!1),e=(0,aB.useRef)(void 0);(0,aB.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,aB.useEffect)(()=>{d(!1),e.current&&clearTimeout(e.current)},[b]);let f=(0,aB.useCallback)(async()=>{await Cg(b)?(d(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>d(!1),2e3)):jD.toast.error("Couldn't copy to clipboard.")},[b]);return(0,aA.jsxs)("div",{className:"group relative max-w-full",children:[(0,aA.jsx)("button",{type:"button",onClick:f,"aria-label":c?"Copied":"Copy code",className:"absolute right-2 top-2 z-10 rounded-md border border-border bg-[var(--color-surface)] p-1.5 text-[var(--color-text-tertiary)] opacity-0 backdrop-blur-sm transition-opacity hover:text-[var(--color-text-primary)] focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring group-hover:opacity-100",children:c?(0,aA.jsx)(iq,{className:"h-3.5 w-3.5","aria-hidden":"true"}):(0,aA.jsx)(Cf,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),(0,aA.jsx)(Cd,{style:Ce,language:a,PreTag:"div",className:"max-w-full rounded-md text-sm",wrapLines:!0,wrapLongLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap",overflowWrap:"break-word"}},customStyle:{margin:0,maxWidth:"100%",overflowX:"auto",fontSize:"0.875rem"},children:b})]})});Ch.displayName="CodeBlock";let Ci=cz("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),Cj=cz("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Ck=cz("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);var Cl=a.i(423571);let Cm=null,Cn=Promise.resolve();async function Co(b,c,d){let e=Cn.then(async()=>{let e=await (!Cm&&(Cm=a.A(96299).then(a=>a.default)),Cm);if(e.initialize({startOnLoad:!1,theme:d,securityLevel:"strict"}),!await e.parse(c,{suppressErrors:!0}))return null;let{svg:f}=await e.render(b,c);return f});return Cn=e.catch(()=>void 0),e}let Cp=aB.default.memo(({code:a,isStreaming:b=!1})=>{let c=(0,aB.useId)().replace(/:/g,""),{resolvedTheme:d}=(0,Cl.useTheme)(),e="dark"===d?"dark":"default",[f,g]=(0,aB.useState)(null);return((0,aB.useEffect)(()=>{if(b)return;let d=!1;return g(null),Co(`mermaid-${c}`,a,e).then(a=>{d||g(a)}).catch(()=>{d||g(null)}),()=>{d=!0}},[a,c,b,e]),b)?(0,aA.jsx)("pre",{className:"my-4 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded-md bg-[var(--color-surface)] p-3 text-xs text-[var(--color-text-tertiary)]",children:(0,aA.jsx)("code",{children:a})}):f?(0,aA.jsx)(Cq,{svg:f}):(0,aA.jsx)(Ch,{language:"mermaid",value:a})});Cp.displayName="MermaidDiagram";let Cq=aB.default.memo(({svg:a})=>{let[b,c]=(0,aB.useState)(!1),[d,e]=(0,aB.useState)(1),f=Math.round(100*d);return(0,aB.useEffect)(()=>{b&&e(1)},[b]),(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("button",{type:"button","aria-label":"Open diagram in full view","aria-haspopup":"dialog",onClick:()=>c(!0),className:"my-4 block max-w-full cursor-zoom-in overflow-x-auto rounded-md bg-[var(--color-surface)] p-4 text-left transition-shadow hover:ring-2 hover:ring-primary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",dangerouslySetInnerHTML:{__html:a}}),(0,aA.jsx)(de,{open:b,onOpenChange:c,children:(0,aA.jsxs)(dh,{className:"max-h-[calc(100svh-1rem)] w-[calc(100vw-1rem)] max-w-[calc(100vw-1rem)] overflow-auto p-3 sm:max-h-[92vh] sm:w-[min(1200px,95vw)] sm:max-w-[95vw] sm:p-4",children:[(0,aA.jsx)(dk,{className:"sr-only",children:"Mermaid diagram"}),(0,aA.jsx)(dl,{className:"sr-only",children:"Full-size preview of the generated Mermaid diagram."}),(0,aA.jsxs)("div",{className:"sticky top-0 z-10 -mx-1 -mt-1 mb-2 flex items-center justify-end gap-1 bg-background/95 pb-2 pr-8 backdrop-blur",children:[(0,aA.jsx)("button",{type:"button",onClick:()=>e(a=>Math.max(.75,a-.25)),disabled:d<=.75,"aria-label":"Zoom out",className:"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:(0,aA.jsx)(Ck,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("span",{className:"min-w-12 text-center text-xs font-medium tabular-nums text-muted-foreground","aria-live":"polite",children:[f,"%"]}),(0,aA.jsx)("button",{type:"button",onClick:()=>e(a=>Math.min(2.5,a+.25)),disabled:d>=2.5,"aria-label":"Zoom in",className:"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:(0,aA.jsx)(Cj,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsx)("button",{type:"button",onClick:()=>e(1),"aria-label":"Reset zoom",className:"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(Ci,{className:"size-4","aria-hidden":"true"})})]}),(0,aA.jsx)("div",{className:"min-w-full overflow-auto rounded-md bg-[var(--color-surface)] p-3",children:(0,aA.jsx)("div",{className:"[&_svg]:!h-auto [&_svg]:!w-full [&_svg]:!max-w-none",style:{width:`${f}%`},dangerouslySetInnerHTML:{__html:a}})})]})})]})});Cq.displayName="MermaidPreview";let Cr=new Set(["md","txt","json","jsonl","yaml","yml","csv","tsv","log","py","ts","tsx","js","jsx","html","css","sh","pdf","png","jpg","jpeg","gif","svg","webp","mp3","wav","mp4","mov"]);function Cs(a){let b=a.trim();if(!b||/\s/.test(b)||/^[a-z][a-z0-9+.-]*:/i.test(b)||!b.includes("/"))return null;let c=b.lastIndexOf(".");if(c<=b.lastIndexOf("/"))return null;let d=b.slice(c+1).toLowerCase();if(!Cr.has(d))return null;if(b.startsWith("/memories/"))return{kind:"memory",display:b,path:b.replace(/^\/memories\/+/,"")};let e=b.replace(/^\/+/,"").replace(/^\.\/+/,"");return{kind:"workspace",display:b,path:e}}let Ct="evosci:open-file";function Cu(a){}let Cv="#evosci-file:",Cw=Array.from(Cr).join("|"),Cx=RegExp(`(?:\\/(?:[\\w\\-.]+\\/)*|(?:[\\w\\-.]+\\/)+)[\\w\\-.]+\\.(?:${Cw})\\b`,"g"),Cy=new Set(["a","code","pre","script","style","kbd","samp"]);function Cz(){let a=b=>{if(!b.children||0===b.children.length)return;let c=[];for(let d of b.children){let b;if("element"===d.type&&Cy.has(d.tagName??"")){c.push(d);continue}if("element"===d.type){a(d),c.push(d);continue}if("text"!==d.type||"string"!=typeof d.value){c.push(d);continue}let e=d.value;Cx.lastIndex=0;let f=0,g=!1;for(;null!==(b=Cx.exec(e));)g=!0,b.index>f&&c.push({type:"text",value:e.slice(f,b.index)}),c.push({type:"element",tagName:"a",properties:{href:`${Cv}${encodeURIComponent(b[0])}`},children:[{type:"text",value:b[0]}]}),f=b.index+b[0].length;if(!g){c.push(d);continue}f<e.length&&c.push({type:"text",value:e.slice(f)})}b.children=c};return b=>a(b)}let CA={...BP,attributes:{...BP.attributes,code:[...BP.attributes?.code||[],["className","math-inline","math-display"]]}},CB=aB.default.memo(({content:a,className:b="",isStreaming:c=!1})=>(0,aA.jsx)("div",{className:dd("prose min-w-0 max-w-full overflow-hidden break-words text-sm leading-relaxed text-inherit [&_h1:first-child]:mt-0 [&_h1]:mb-4 [&_h1]:mt-6 [&_h1]:font-semibold [&_h2:first-child]:mt-0 [&_h2]:mb-4 [&_h2]:mt-6 [&_h2]:font-semibold [&_h3:first-child]:mt-0 [&_h3]:mb-4 [&_h3]:mt-6 [&_h3]:font-semibold [&_h4:first-child]:mt-0 [&_h4]:mb-4 [&_h4]:mt-6 [&_h4]:font-semibold [&_h5:first-child]:mt-0 [&_h5]:mb-4 [&_h5]:mt-6 [&_h5]:font-semibold [&_h6:first-child]:mt-0 [&_h6]:mb-4 [&_h6]:mt-6 [&_h6]:font-semibold [&_p:last-child]:mb-0 [&_p]:mb-4",b),children:(0,aA.jsx)(xT,{remarkPlugins:[y2,y8],rehypePlugins:[Bo,Cz,[BX,CA],[BN,{throwOnError:!1,strict:!1}]],components:{code({className:a,children:b,...d}){let e=/language-(\w+)/.exec(a||""),f=String(b),g=f.endsWith("\n"),h=f.replace(/\n$/,"");if(e?.[1]==="mermaid")return(0,aA.jsx)(Cp,{code:h,isStreaming:c});if(e)return(0,aA.jsx)(Ch,{language:e[1],value:h});let i=g?null:Cs(h);return i?(0,aA.jsx)("button",{type:"button",onClick:()=>Cu(i),title:`Open ${i.display}`,className:"rounded-sm bg-[var(--color-surface)] px-1 py-0.5 font-mono text-[0.9em] text-primary underline underline-offset-2 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.display}):(0,aA.jsx)("code",{className:"rounded-sm bg-[var(--color-surface)] px-1 py-0.5 font-mono text-[0.9em]",...d,children:b})},pre:({children:a})=>(0,aA.jsx)("div",{className:"my-4 max-w-full overflow-hidden last:mb-0",children:a}),a({href:a,children:b}){if(a&&a.startsWith(Cv)){let c,d=a.slice(Cv.length);try{c=decodeURIComponent(d)}catch{c=d}let e=Cs(c);return e?(0,aA.jsx)("button",{type:"button",onClick:()=>Cu(e),title:`Open ${e.display}`,className:"text-primary underline underline-offset-2 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:b}):(0,aA.jsx)("span",{children:b})}return(0,aA.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-primary no-underline hover:underline",children:b})},blockquote:({children:a})=>(0,aA.jsx)("blockquote",{className:"my-4 border-l-4 border-border pl-4 italic text-[var(--color-text-tertiary)]",children:a}),ul:({children:a})=>(0,aA.jsx)("ul",{className:"my-4 list-disc pl-6 [&>li:last-child]:mb-0 [&>li]:mb-1",children:a}),ol:({children:a})=>(0,aA.jsx)("ol",{className:"my-4 list-decimal pl-6 [&>li:last-child]:mb-0 [&>li]:mb-1",children:a}),details:({children:a,...b})=>(0,aA.jsx)("details",{...b,className:"my-4 rounded-md border border-border bg-[var(--color-surface)] px-3 py-2 [&[open]>summary]:mb-2",children:a}),summary:({children:a,...b})=>(0,aA.jsx)("summary",{...b,className:"cursor-pointer select-none font-medium text-[var(--color-text-primary)] hover:text-[var(--color-text-secondary)]",children:a}),table:({children:a})=>(0,aA.jsx)("div",{className:"my-4 overflow-x-auto",children:(0,aA.jsx)("table",{className:"w-full border-collapse [&_td]:border [&_td]:border-border [&_td]:p-2 [&_th]:border [&_th]:border-border [&_th]:bg-[var(--color-surface)] [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold",children:a})})},children:a})}));function CC({steps:a,hideFinalText:b,compact:c=!1}){let d=new Map;for(let b of a)"tool_result"===b.kind&&b.toolCallId&&d.set(b.toolCallId,b.text);let e=-1;if(b){for(let b=a.length-1;b>=0;b--)if("text"===a[b].kind){e=b;break}}return(0,aA.jsx)("div",{className:dd("flex flex-col gap-1",c&&"gap-0.5"),children:a.map((a,b)=>{if(b===e)return null;if("tool_call"===a.kind){let e={id:a.id,name:a.name,args:a.args,result:d.get(a.id),status:d.has(a.id)?"completed":"pending"};return(0,aA.jsx)(uA,{toolCall:e,compact:c},a.id||`tc-${b}`)}return"text"===a.kind?(0,aA.jsx)("div",{className:dd("px-2 text-sm",c&&"px-1 text-xs"),children:(0,aA.jsx)(CB,{content:a.text,className:c?"text-xs leading-5 [&_blockquote]:my-2 [&_blockquote]:pl-2 [&_h1]:mb-2 [&_h1]:mt-3 [&_h1]:text-base [&_h2]:mb-2 [&_h2]:mt-3 [&_h2]:text-base [&_h3]:mb-1.5 [&_h3]:mt-3 [&_h3]:text-sm [&_h4]:mb-1.5 [&_h4]:mt-3 [&_h4]:text-sm [&_ol]:my-2 [&_ol]:pl-5 [&_p]:mb-2 [&_table]:text-[11px] [&_td]:p-1.5 [&_th]:p-1.5 [&_ul]:my-2 [&_ul]:pl-5":void 0})},`txt-${b}`):null})})}function CD(a){switch(a){case"running":case"pending":case"busy":return"running";case"success":return"success";case"error":case"timeout":return"error";case"cancelled":case"interrupted":return"cancelled";case"expired":return"expired";default:return"unknown"}}CB.displayName="MarkdownContent";let CE={"writing-agent":"Writing agent","data-analysis-agent":"Data analysis agent"},CF="[Async tasks update]";function CG(a){return`${a.task_id}:${a.run_id||"legacy"}`}function CH(a){let b=a.trim().split(/\r?\n/);if(b[0]!==CF||!b[1])return null;try{let a=JSON.parse(b[1]);if("string"!=typeof a.task_id||!a.task_id)return null;return{taskId:a.task_id,runId:"string"==typeof a.run_id&&a.run_id?a.run_id:void 0}}catch{return null}}function CI(a,b){let c=CH(a);return!!c&&c.taskId===b.task_id&&(!c.runId||c.runId===b.run_id)}function CJ(a){let b=a.liveStatus||a.status||"success";return[CF,JSON.stringify({agent:a.agent_name,kind:"agent",...a.run_id?{run_id:a.run_id}:{},status:b,task_id:a.task_id}),"(Signal only — fetch full result via check_async_task (sub-agents) if relevant to the current step, else acknowledge & continue.)"].join("\n")}let CK={running:{dot:"bg-[var(--color-warning)]",label:"Running",pulse:!0},success:{dot:"bg-[var(--color-success)]",label:"Done",pulse:!1},error:{dot:"bg-[var(--color-error)]",label:"Error",pulse:!1},cancelled:{dot:"bg-muted-foreground",label:"Cancelled",pulse:!1},expired:{dot:"bg-muted-foreground",label:"Expired",pulse:!1},unknown:{dot:"bg-muted-foreground",label:"Unknown",pulse:!1}};function CL(a){let b=CD(a);return"success"===b||"error"===b||"cancelled"===b}function CM(a){return a.filter(a=>"running"===CD(a.liveStatus??a.status)).length}let CN=cz("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),CO=cz("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),CP=cz("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),CQ=aB.default.memo(({message:a,toolCalls:b,isLoading:c,isStreaming:d,actionRequests:e,submittedActionRequestKeys:f,onActionRequestSubmitted:g,reviewConfigsMap:h,ui:i,stream:j,onResumeInterrupt:k,graphId:l,onEditMessage:m,autoApprove:n,subAgentSteps:o})=>{let p="human"===a.type,q=t3(a),r=q&&""!==q.trim(),s=b.length>0,t=(0,aB.useMemo)(()=>{let b=a.additional_kwargs?.reasoning_content;return"string"==typeof b&&b.trim()?b.trim():null},[a.additional_kwargs]),u=(0,aB.useMemo)(()=>b.filter(a=>"task"===a.name&&a.args.subagent_type&&""!==a.args.subagent_type&&null!==a.args.subagent_type).map(a=>{let b=a.args.subagent_type;return{id:a.id,name:a.name,subAgentName:b,input:a.args,output:a.result?{result:a.result}:void 0,status:a.status}}),[b]),v=(0,aB.useMemo)(()=>{let a=new Map;if(!e||0===e.length)return a;let c=new Map;e.forEach((a,b)=>{let d=c.get(a.name),e={actionRequest:a,actionIndex:b};d?d.push(e):c.set(a.name,[e])});let d=new Map;for(let e of b){if("interrupted"!==e.status)continue;let b=c.get(e.name);if(!b)continue;let f=d.get(e.name)??0;f<b.length&&(a.set(e.id,b[f]),d.set(e.name,f+1))}return a},[e,b]),w=(0,aB.useMemo)(()=>JSON.stringify((e??[]).map(a=>({name:a.name,args:a.args}))),[e]),x=(0,aB.useRef)({});(0,aB.useEffect)(()=>{x.current={}},[w]);let y=(0,aB.useCallback)((a,b)=>{let c=b?.decisions;if(!Array.isArray(c)||!e?.length||1===e.length||c.length===e.length)return void k?.(b);let d=c[0],f={...x.current,[a]:d};x.current=f,e.every((a,b)=>f[b])&&(x.current={},k?.({decisions:e.map((a,b)=>f[b])}))},[e,k]),[z,A]=(0,aB.useState)(!1),[B,C]=(0,aB.useState)(!1),D=(0,aB.useRef)(void 0);(0,aB.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]),(0,aB.useEffect)(()=>{C(!1),D.current&&clearTimeout(D.current)},[q]);let E=(0,aB.useCallback)(async()=>{q&&(await Cg(q)?(C(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>C(!1),2e3)):jD.toast.error("Couldn't copy to clipboard."))},[q]),[F,G]=(0,aB.useState)({}),H=(0,aB.useCallback)(a=>F[a]??!1,[F]),I=(0,aB.useCallback)(a=>{G(b=>({...b,[a]:!b[a]}))},[]);return p&&null!==CH(q)?(0,aA.jsx)("div",{className:"flex w-full justify-center py-1.5",children:(0,aA.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/40 px-3 py-1 text-xs text-muted-foreground",children:[(0,aA.jsx)(CN,{className:"size-3 text-[var(--brand)]","aria-hidden":"true"}),"Background agent reported back"]})}):(0,aA.jsx)("div",{className:dd("group flex w-full max-w-full overflow-x-hidden",p&&"flex-row-reverse"),children:(0,aA.jsxs)("div",{className:dd("min-w-0 max-w-full",p?"max-w-[70%]":"w-full"),children:[!p&&t&&(0,aA.jsxs)("div",{className:"mt-4",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>A(a=>!a),"aria-expanded":z,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[(0,aA.jsx)(CP,{className:dd("h-3.5 w-3.5 transition-transform",z&&"rotate-90"),"aria-hidden":"true"}),(0,aA.jsx)(CO,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Thinking"]}),z&&(0,aA.jsx)("div",{className:"mt-2 whitespace-pre-wrap break-words border-l-2 border-border pl-3 text-sm leading-relaxed text-muted-foreground",children:t})]}),r&&(0,aA.jsx)("div",{className:dd("relative flex items-end gap-0"),children:(0,aA.jsx)("div",{className:dd("mt-4 overflow-hidden break-words text-sm font-normal leading-[150%]",p?"rounded-xl rounded-br-none border border-border px-3 py-2 text-foreground":"text-primary"),style:p?{backgroundColor:"var(--color-user-message-bg)"}:void 0,children:p?(0,aA.jsx)("p",{className:"m-0 whitespace-pre-wrap break-words text-sm leading-relaxed",children:q}):r?(0,aA.jsx)(CB,{content:q,isStreaming:d}):null})}),!p&&r&&(0,aA.jsx)("div",{className:"mt-1",children:(0,aA.jsx)("button",{type:"button",onClick:E,"aria-label":B?"Copied":"Copy message",className:"inline-flex items-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:B?(0,aA.jsx)(iq,{className:"h-4 w-4","aria-hidden":"true"}):(0,aA.jsx)(Cf,{className:"h-4 w-4","aria-hidden":"true"})})}),p&&r&&(0,aA.jsxs)("div",{className:"mt-1 flex justify-end gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",children:[(0,aA.jsx)("button",{type:"button",onClick:E,"aria-label":B?"Copied":"Copy message",className:"inline-flex items-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:B?(0,aA.jsx)(iq,{className:"h-4 w-4","aria-hidden":"true"}):(0,aA.jsx)(Cf,{className:"h-4 w-4","aria-hidden":"true"})}),(0,aA.jsx)("button",{type:"button",onClick:()=>m?.(q),"aria-label":"Edit message",className:"inline-flex items-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(fl,{className:"h-4 w-4","aria-hidden":"true"})})]}),s&&(0,aA.jsx)("div",{className:"mt-4 flex w-full flex-col",children:b.map(a=>{if("task"===a.name)return null;let b=i?.find(b=>b.metadata?.tool_call_id===a.id),d=v.get(a.id),e=d?.actionRequest,m=d?a.id:void 0,o=h?.get(a.name);return(0,aA.jsx)(uA,{toolCall:a,uiComponent:b,stream:j,graphId:l,actionRequest:e,actionRequestKey:m,actionRequestSubmitted:m?f?.has(m):void 0,onActionRequestSubmitted:g,reviewConfig:o,onResume:d?a=>y(d.actionIndex,a):k,isLoading:c,autoApprove:n},a.id)})}),!p&&u.length>0&&(0,aA.jsx)("div",{className:"flex w-fit max-w-full flex-col gap-4",children:u.map(a=>(0,aA.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,aA.jsx)("div",{className:"flex items-end gap-2",children:(0,aA.jsx)("div",{className:"w-[calc(100%-100px)]",children:(0,aA.jsx)(up,{subAgent:a,onClick:()=>I(a.id),isExpanded:H(a.id)})})}),H(a.id)&&(0,aA.jsx)("div",{className:"w-full max-w-full",children:(0,aA.jsxs)("div",{className:"border-border-light rounded-md border bg-[var(--color-surface)] p-4",children:[(0,aA.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-secondary)]",children:"Input"}),(0,aA.jsx)("div",{className:"mb-4",children:(0,aA.jsx)(CB,{content:t4(a.input)})}),(o?.[a.id]?.length??0)>0&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-secondary)]",children:"Steps"}),(0,aA.jsx)("div",{className:"mb-4",children:(0,aA.jsx)(CC,{steps:o[a.id],hideFinalText:!!a.output})})]}),a.output&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-[var(--color-text-secondary)]",children:"Output"}),(0,aA.jsx)(CB,{content:t4(a.output)})]})]})})]},a.id))})]})})});CQ.displayName="ChatMessage";let CR=cz("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),CS=aB.default.memo(({content:a,summarizedCount:b})=>{let[c,d]=(0,aB.useState)(!1),e=function(a){if(!a)return"";let b=a.match(/<summary>\s*([\s\S]*?)\s*<\/summary>/);if(b)return b[1].trim();let c=a.match(/Here is a summary of the conversation to date:\s*([\s\S]*)$/);return c?c[1].trim():a.trim()}(a);return(0,aA.jsxs)("div",{className:"my-3 w-full",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-2",children:[(0,aA.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,aA.jsxs)("button",{type:"button",onClick:()=>d(a=>!a),"aria-expanded":c,className:"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/40 px-3 py-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:[(0,aA.jsx)(CR,{className:"size-3.5 text-[var(--brand)]","aria-hidden":"true"}),"Conversation compacted","number"==typeof b&&b>0&&(0,aA.jsxs)("span",{className:"text-muted-foreground/70",children:["· ",b," earlier"," ",1===b?"message":"messages"," summarized"]}),(0,aA.jsx)(CP,{className:dd("size-3.5 transition-transform",c&&"rotate-90"),"aria-hidden":"true"})]}),(0,aA.jsx)("div",{className:"h-px flex-1 bg-border"})]}),c&&(0,aA.jsx)("div",{className:"mt-2 overflow-hidden rounded-md border border-border bg-muted/20 px-4 py-3",children:(0,aA.jsx)(CB,{content:e})})]})});CS.displayName="CompactionSummary";let CT=aB.default.memo(function({items:a,isStreaming:b,defaultCollapsed:c,isAtBottom:d,lastMessageId:e,isLoading:f,actionRequests:g,submittedActionRequestKeys:h,onActionRequestSubmitted:i,reviewConfigsMap:j,stream:k,onResumeInterrupt:l,graphId:m,onEditMessage:n,autoApprove:o,subAgentSteps:p,ui:q,compactionAnchorId:r,summarizationEvent:s}){let t=(0,aB.useMemo)(()=>!o&&0!==g.length&&void 0!==e&&a.some(a=>a.message.id===e),[o,g.length,e,a]),[u,v]=(0,aB.useState)(()=>!c),w=(0,aB.useRef)(b);(0,aB.useEffect)(()=>{let a=w.current;w.current=b,a&&!b&&!t&&c&&d&&v(!1)},[b,t,c,d]);let x=a.reduce((a,b)=>a+b.toolCalls.length,0),y=function(a){for(let b=a.length-1;b>=0;b--){let c=a[b].toolCalls;if(c.length>0)return c[c.length-1].name||"tool"}return"action"}(a),z=b?`${x} action${1===x?"":"s"} running — ${y}`:`${x} action${1===x?"":"s"} — last: ${y}`;return(0,aA.jsxs)("div",{className:"my-2",children:[(0,aA.jsxs)("button",{type:"button","aria-expanded":u,"aria-label":`${u?"Collapse":"Expand"} ${z}`,title:z,onClick:()=>v(a=>!a),className:dd("group flex w-full items-center gap-2 rounded-md border border-border bg-[var(--color-surface)] px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,aA.jsx)(CP,{"aria-hidden":"true",className:dd("size-3.5 shrink-0 transition-transform",u&&"rotate-90")}),b&&(0,aA.jsx)(fj,{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin text-[var(--brand)]"}),(0,aA.jsx)("span",{className:"truncate",children:z})]}),(()=>{if(u||!t||void 0===e)return null;let c=a.find(a=>a.message.id===e);if(!c)return null;let d=q?.filter(a=>a.metadata?.message_id===c.message.id);return(0,aA.jsx)("div",{className:"mt-2 space-y-2 border-l-2 border-border pl-3",children:(0,aA.jsx)(CQ,{message:c.message,toolCalls:c.toolCalls,isLoading:f,isStreaming:b,actionRequests:g,submittedActionRequestKeys:h,onActionRequestSubmitted:i,reviewConfigsMap:j??void 0,ui:d,stream:k,onResumeInterrupt:l,graphId:m,onEditMessage:n,autoApprove:o,subAgentSteps:p})})})(),u&&(0,aA.jsxs)("div",{className:"mt-2 space-y-2 border-l-2 border-border pl-3",children:[a.map(a=>{let c=a.message.id===e,d=q?.filter(b=>b.metadata?.message_id===a.message.id),t=r===a.message.id;return(0,aA.jsxs)(aB.default.Fragment,{children:[t&&s&&(0,aA.jsx)(CS,{content:s.content,summarizedCount:s.cutoffIndex}),(0,aA.jsx)(CQ,{message:a.message,toolCalls:a.toolCalls,isLoading:f,isStreaming:b&&c,actionRequests:c?g:void 0,submittedActionRequestKeys:h,onActionRequestSubmitted:i,reviewConfigsMap:c?j??void 0:void 0,ui:d,stream:k,onResumeInterrupt:l,graphId:m,onEditMessage:n,autoApprove:o,subAgentSteps:p})]},a.message.id)}),(0,aA.jsxs)("button",{type:"button",onClick:()=>v(!1),className:"flex w-full items-center justify-center gap-1.5 rounded-md py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Collapse ${x} action${1===x?"":"s"}`,children:[(0,aA.jsx)(is,{"aria-hidden":"true",className:"size-3.5"}),"Collapse"]})]})]})}),CU=cz("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),CV="__other__";function CW({questions:a,onSubmit:b,onCancel:c,isLoading:d}){let[e,f]=(0,aB.useState)(()=>a.map(()=>"")),[g,h]=(0,aB.useState)(()=>a.map(()=>null)),i=(a,b)=>f(c=>c.map((c,d)=>d===a?b:c)),j=(a,b)=>h(c=>c.map((c,d)=>d===a?b:c)),k=a=>"text"===a.type&&!1===a.required,l=a.every((a,b)=>k(a)||""!==e[b].trim());return(0,aA.jsxs)("div",{className:"w-full rounded-lg border border-border bg-muted/30 p-4",children:[(0,aA.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-foreground",children:[(0,aA.jsx)(CU,{size:16,className:"text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider",children:"EvoScientist Needs Your Input"})]}),(0,aA.jsx)("div",{className:"space-y-5",children:a.map((a,b)=>(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("p",{className:"mb-2 text-sm font-medium text-foreground",children:[a.question,!k(a)&&(0,aA.jsx)("span",{className:"ml-1 text-destructive",children:"*"})]}),"multiple_choice"===a.type?(0,aA.jsxs)("div",{className:"flex flex-col gap-2",children:[a.choices?.map(a=>{let c=g[b]===a.value;return(0,aA.jsx)("button",{type:"button",disabled:d,onClick:()=>{j(b,a.value),i(b,a.value)},className:dd("rounded-md border px-3 py-2 text-left text-sm transition-colors",c?"border-[var(--brand-solid)] bg-[var(--brand-solid)] text-[var(--brand-foreground)]":"border-border bg-background hover:bg-accent"),children:a.value},a.value)}),(0,aA.jsx)("button",{type:"button",disabled:d,onClick:()=>{j(b,CV),i(b,"")},className:dd("rounded-md border px-3 py-2 text-left text-sm transition-colors",g[b]===CV?"border-[var(--brand)] text-foreground":"border-border bg-background hover:bg-accent"),children:"Other…"}),g[b]===CV&&(0,aA.jsx)(uw,{value:e[b],onChange:a=>i(b,a.target.value),placeholder:"Type your answer…",className:"text-sm",rows:2,disabled:d})]}):(0,aA.jsx)(uw,{value:e[b],onChange:a=>i(b,a.target.value),placeholder:k(a)?"Type your answer… (optional)":"Type your answer…",className:"text-sm",rows:2,disabled:d})]},b))}),(0,aA.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,aA.jsx)(dy,{variant:"outline",size:"sm",onClick:c,disabled:d,children:"Cancel"}),(0,aA.jsx)(dy,{size:"sm",onClick:()=>b(e),disabled:!l||d,className:"bg-[var(--brand-solid)] text-[var(--brand-foreground)] hover:opacity-90",children:d?"Submitting…":"Submit"})]})]})}let CX="__new__";function CY(a){}function CZ(a){return!0===({})[a??CX]}function C$(a,b){let c={},d=a??CX;b?c[d]=!0:delete c[d],CY(c)}function C_(a,b){let c=b?.enabled??!0,d=b?.intervalMs??3e3,e=d5(),[f,g]=(0,aB.useState)([]),[h,i]=(0,aB.useState)(!1),[j,k]=(0,aB.useState)(null),l=(0,aB.useRef)(0),m=(0,aB.useRef)(!0),n=(0,aB.useRef)(new Set);(0,aB.useEffect)(()=>{n.current.clear()},[e,a]);let o=(0,aB.useCallback)(async()=>{if(!c||!a){g([]),i(!0);return}let b=++l.current;try{let c=await e.threads.getState(a),d=function(a){if(!a||"object"!=typeof a)return[];let b=[];for(let c of Object.values(a))c&&"object"==typeof c&&"string"==typeof c.task_id&&"string"==typeof c.agent_name&&b.push({task_id:c.task_id,agent_name:c.agent_name,thread_id:"string"==typeof c.thread_id?c.thread_id:c.task_id,run_id:"string"==typeof c.run_id?c.run_id:"",status:"string"==typeof c.status?c.status:"",created_at:"string"==typeof c.created_at?c.created_at:void 0,last_updated_at:"string"==typeof c.last_updated_at?c.last_updated_at:void 0});return b.sort((a,b)=>(b.created_at??"").localeCompare(a.created_at??"")),b}(c.values?.async_tasks),f=await Promise.all(d.map(async a=>{if(!a.run_id)return{...a,liveStatus:a.status,startedAt:a.created_at};let b=`${a.thread_id}:${a.run_id}`;if(n.current.has(b))return{...a,liveStatus:"expired",startedAt:a.created_at,endedAt:a.last_updated_at??a.created_at};try{let b=await e.runs.get(a.thread_id,a.run_id),c=b.status??a.status;return{...a,liveStatus:c,startedAt:b.created_at??a.created_at,endedAt:CL(c)?b.updated_at??a.last_updated_at:void 0}}catch(c){if("object"==typeof c&&null!==c&&404===c.status)return n.current.add(b),{...a,liveStatus:"expired",startedAt:a.created_at,endedAt:a.last_updated_at??a.created_at};return{...a,liveStatus:a.status,startedAt:a.created_at}}}));if(b!==l.current||!m.current)return;g(f),k(null)}catch{b===l.current&&m.current&&k("Couldn't load background agents.")}finally{b===l.current&&m.current&&i(!0)}},[e,a,c]);return(0,aB.useEffect)(()=>{if(m.current=!0,!c)return g([]),i(!0),()=>{m.current=!1};i(!1),o();let a=setInterval(()=>{document.hidden||o()},d);return()=>{m.current=!1,clearInterval(a)}},[o,c,d]),{tasks:f,loaded:h,error:j,refresh:o}}function C0(a){}function C1(a){return!!a&&!1!==({})[a]}function C2(a,b){if(!a)return;let c={},d=c[a];c[a]={initialized:!0,keys:Array.from(new Set([...d?.keys??[],...b]))},C0(c)}function C3(a,b){if(!a)return;let c={},d=c[a];c[a]={initialized:d?.initialized??!0,keys:Array.from(new Set([...d?.keys??[],b]))},C0(c)}function C4(a){let[b,c]=(0,aB.useState)(()=>C1(a));return(0,aB.useEffect)(()=>(c(C1(a)),()=>{}),[a]),[b,(0,aB.useCallback)(b=>(function(a,b){if(!a)return;let c={};b?delete c[a]:c[a]=!1})(a,b),[a])]}let C5={damping:.7,stiffness:.05,mass:1.25},C6=1e3/60,C7=!1;function C8(a,b){let c=(0,aB.useCallback)(b=>(c.current=b,a(b)),b);return c}globalThis.document?.addEventListener("mousedown",()=>{C7=!0}),globalThis.document?.addEventListener("mouseup",()=>{C7=!1}),globalThis.document?.addEventListener("click",()=>{C7=!1});let C9=new Map;function Da(...a){let b={...C5},c=!1;for(let d of a){if("instant"===d){c=!0;continue}"object"==typeof d&&(c=!1,b.damping=d.damping??b.damping,b.stiffness=d.stiffness??b.stiffness,b.mass=d.mass??b.mass)}let d=JSON.stringify(b);return C9.has(d)||C9.set(d,Object.freeze(b)),c?"instant":C9.get(d)}let Db=cz("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),Dc=cz("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),Dd=iS?a=>{a()}:aB.default.startTransition,De=jf(jm,()=>(a,b,c={})=>{let{mutate:d}=jd(),e=(0,aB.useRef)(a),f=(0,aB.useRef)(b),g=(0,aB.useRef)(c),h=(0,aB.useRef)(0),[i,j,k]=(a=>{let[,b]=(0,aB.useState)({}),c=(0,aB.useRef)(!1),d=(0,aB.useRef)(a),e=(0,aB.useRef)({data:!1,error:!1,isValidating:!1}),f=(0,aB.useCallback)(a=>{let f=!1,g=d.current;for(let b in a)Object.prototype.hasOwnProperty.call(a,b)&&g[b]!==a[b]&&(g[b]=a[b],e.current[b]&&(f=!0));f&&!c.current&&b({})},[]);return iU(()=>(c.current=!1,()=>{c.current=!0})),[d,e.current,f]})({data:iE,error:iE,isMutating:!1}),l=i.current,m=(0,aB.useCallback)(async(a,b)=>{let[c,i]=i$(e.current);if(!f.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!c)throw Error("Can’t trigger the mutation: missing key.");let j=iH(iH({populateCache:!1,throwOnError:!0},g.current),b),l=i0();h.current=l,k({isMutating:!0});try{let b=await d(c,f.current(i,{arg:a}),iH(j,{throwOnError:!0}));return h.current<=l&&(Dd(()=>k({data:b,isMutating:!1,error:void 0})),null==j.onSuccess||j.onSuccess.call(j,b,c,j)),b}catch(a){if(h.current<=l&&(Dd(()=>k({error:a,isMutating:!1})),null==j.onError||j.onError.call(j,a,c,j),j.throwOnError))throw a}},[]),n=(0,aB.useCallback)(()=>{h.current=i0(),k({data:iE,error:iE,isMutating:!1})},[]);return iU(()=>{e.current=a,f.current=b,g.current=c}),{trigger:m,reset:n,get data(){return j.data=!0,l.data},get error(){return j.error=!0,l.error},get isMutating(){return j.isMutating=!0,l.isMutating}}}),Df={js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",json:"json",xml:"xml",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",dockerfile:"dockerfile",makefile:"makefile"},Dg=aB.default.memo(({file:a,onSaveFile:b,onClose:c,editDisabled:d})=>{let[e,f]=(0,aB.useState)(null===a),[g,h]=(0,aB.useState)(String(a?.path||"")),[i,j]=(0,aB.useState)(String(a?.content||"")),k=De({kind:"files-update",fileName:g,fileContent:i},async({fileName:a,fileContent:c})=>{if(a&&c)return await b(a,c)},{onSuccess:()=>f(!1),onError:a=>jD.toast.error(`Failed to save file: ${a}`)});(0,aB.useEffect)(()=>{h(String(a?.path||"")),j(String(a?.content||"")),f(null===a)},[a]);let l=(0,aB.useMemo)(()=>{let a=String(g||"");return a.split(".").pop()?.toLowerCase()||""},[g]),m=(0,aB.useMemo)(()=>"md"===l||"markdown"===l,[l]),n=(0,aB.useMemo)(()=>Df[l]||"text",[l]),o=(0,aB.useCallback)(()=>{i&&Cg(i)},[i]),p=(0,aB.useCallback)(()=>{if(i&&g){let a=new Blob([i],{type:"text/plain"}),b=URL.createObjectURL(a),c=document.createElement("a");c.href=b,c.download=g,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(b)}},[i,g]),q=(0,aB.useCallback)(()=>{f(!0)},[]),r=(0,aB.useCallback)(()=>{null===a?c():(h(String(a.path)),j(String(a.content)),f(!1))},[a,c]),s=(0,aB.useMemo)(()=>""!==g.trim()&&!g.includes("/")&&!g.includes(" "),[g]);return(0,aA.jsx)(de,{open:!0,onOpenChange:c,children:(0,aA.jsxs)(dh,{"aria-describedby":void 0,className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6",children:[(0,aA.jsx)(dk,{className:"sr-only",children:a?.path||"New File"}),(0,aA.jsxs)("div",{className:"mb-4 flex items-center justify-between border-b border-border pb-4",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,aA.jsx)(Db,{className:"h-5 w-5 shrink-0 text-[var(--color-text-tertiary)]"}),e&&null===a?(0,aA.jsx)(dD,{value:g,onChange:a=>h(a.target.value),placeholder:"Enter filename…",className:"text-base font-medium","aria-invalid":!s}):(0,aA.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-primary",children:a?.path})]}),(0,aA.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:!e&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)(dy,{onClick:q,variant:"ghost",size:"sm",className:"h-8 px-2",disabled:d,children:[(0,aA.jsx)(d7,{size:16,className:"mr-1"}),"Edit"]}),(0,aA.jsxs)(dy,{onClick:o,variant:"ghost",size:"sm",className:"h-8 px-2",children:[(0,aA.jsx)(Cf,{size:16,className:"mr-1"}),"Copy"]}),(0,aA.jsxs)(dy,{onClick:p,variant:"ghost",size:"sm",className:"h-8 px-2",children:[(0,aA.jsx)(fi,{size:16,className:"mr-1"}),"Download"]})]})})]}),(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?(0,aA.jsx)(uw,{value:i,onChange:a=>j(a.target.value),placeholder:"Enter file content…",className:"h-full min-h-[400px] resize-none font-mono text-sm"}):(0,aA.jsx)(f_,{className:"h-full rounded-md bg-[var(--color-surface)]",children:(0,aA.jsx)("div",{className:"p-4",children:i?m?(0,aA.jsx)("div",{className:"rounded-md p-6",children:(0,aA.jsx)(CB,{content:i})}):(0,aA.jsx)(Cd,{language:n,style:Ce,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem"},showLineNumbers:!0,wrapLines:!0,lineProps:{style:{whiteSpace:"pre-wrap"}},children:i}):(0,aA.jsx)("div",{className:"flex items-center justify-center p-12",children:(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"File is empty"})})})})}),e&&(0,aA.jsxs)("div",{className:"mt-4 flex justify-end gap-2 border-t border-border pt-4",children:[(0,aA.jsxs)(dy,{onClick:r,variant:"outline",size:"sm",children:[(0,aA.jsx)(cA,{size:16,className:"mr-1"}),"Cancel"]}),(0,aA.jsxs)(dy,{onClick:()=>k.trigger(),size:"sm",disabled:k.isMutating||!g.trim()||!i.trim()||!s,children:[k.isMutating?(0,aA.jsx)(fj,{size:16,className:"mr-1 animate-spin"}):(0,aA.jsx)(Dc,{size:16,className:"mr-1"}),"Save"]})]})]})})});function Dh({files:a,setFiles:b,editDisabled:c}){let[d,e]=(0,aB.useState)(null),f=(0,aB.useCallback)(async(c,d)=>{await b({...a,[c]:d}),e({path:c,content:d})},[a,b]);return(0,aA.jsxs)(aA.Fragment,{children:[0===Object.keys(a).length?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center p-4 text-center",children:(0,aA.jsx)("p",{className:"text-xs text-muted-foreground",children:"No files created yet"})}):(0,aA.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(256px,1fr))] gap-2",children:Object.keys(a).map(b=>{let c,d=String(b),f=a[b];if("object"==typeof f&&null!==f&&"content"in f){let a=f.content;c=Array.isArray(a)?a.join("\n"):String(a||"")}else c=String(f||"");return(0,aA.jsxs)("button",{type:"button",onClick:()=>e({path:d,content:c}),className:"cursor-pointer space-y-1 truncate rounded-md border border-border px-2 py-3 shadow-sm transition-colors",style:{backgroundColor:"var(--color-file-button)"},onMouseEnter:a=>{a.currentTarget.style.backgroundColor="var(--color-file-button-hover)"},onMouseLeave:a=>{a.currentTarget.style.backgroundColor="var(--color-file-button)"},children:[(0,aA.jsx)(Db,{size:24,className:"mx-auto text-muted-foreground"}),(0,aA.jsx)("span",{className:"mx-auto block w-full truncate break-words text-center text-sm leading-relaxed text-foreground",children:d})]},d)})}),d&&(0,aA.jsx)(Dg,{file:d,onSaveFile:f,onClose:()=>e(null),editDisabled:c})]})}Dg.displayName="FileViewDialog",aB.default.memo(({todos:a,files:b,setFiles:c})=>{let{isLoading:d,interrupt:e}=t9(),[f,g]=(0,aB.useState)(!1),[h,i]=(0,aB.useState)(!1),j=(0,aB.useRef)(a.length),k=(0,aB.useRef)(Object.keys(b).length);(0,aB.useEffect)(()=>{0===j.current&&a.length>0&&g(!0),j.current=a.length},[a.length]);let l=Object.keys(b).length;(0,aB.useEffect)(()=>{0===k.current&&l>0&&i(!0),k.current=l},[l]);let m=(0,aB.useCallback)(a=>{switch(a){case"completed":return(0,aA.jsx)(uc,{size:12,className:"text-[var(--color-success)]"});case"in_progress":return(0,aA.jsx)(ud,{size:12,className:"text-[var(--color-warning)]"});default:return(0,aA.jsx)(ue,{size:10,className:"text-[var(--color-text-tertiary)]"})}},[]),n=(0,aB.useMemo)(()=>({pending:a.filter(a=>"pending"===a.status),in_progress:a.filter(a=>"in_progress"===a.status),completed:a.filter(a=>"completed"===a.status)}),[a]),o={pending:"Pending",in_progress:"In Progress",completed:"Completed"};return(0,aA.jsx)("div",{className:"min-h-0 w-full flex-1",children:(0,aA.jsx)("div",{className:"font-inter flex h-full w-full flex-col p-0",children:(0,aA.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden",children:[(0,aA.jsxs)("div",{className:"flex items-center justify-between px-3 pb-1.5 pt-2",children:[(0,aA.jsx)("span",{className:"text-xs font-semibold tracking-wide text-zinc-600",children:"AGENT TASKS"}),(0,aA.jsx)("button",{onClick:()=>g(a=>!a),className:dd("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-transform duration-200 hover:bg-muted",f?"rotate-180":"rotate-0"),"aria-label":"Toggle tasks panel",children:(0,aA.jsx)(ir,{size:14})})]}),f&&(0,aA.jsx)("div",{className:"bg-muted-secondary rounded-xl px-3 pb-2",children:(0,aA.jsx)(f_,{className:"h-full",children:0===a.length?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center p-4 text-center",children:(0,aA.jsx)("p",{className:"text-xs text-muted-foreground",children:"No tasks created yet"})}):(0,aA.jsx)("div",{className:"ml-1 p-0.5",children:Object.entries(n).map(([a,b])=>(0,aA.jsxs)("div",{className:"mb-4",children:[(0,aA.jsx)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-tertiary",children:o[a]}),b.map((b,c)=>(0,aA.jsxs)("div",{className:"mb-1.5 flex items-start gap-2 rounded-sm p-1 text-sm",children:[m(b.status),(0,aA.jsx)("span",{className:"flex-1 break-words leading-relaxed text-inherit",children:b.content})]},`${a}_${b.id}_${c}`))]}))})})}),(0,aA.jsxs)("div",{className:"flex items-center justify-between px-3 pb-1.5 pt-2",children:[(0,aA.jsx)("span",{className:"text-xs font-semibold tracking-wide text-zinc-600",children:"FILE SYSTEM"}),(0,aA.jsx)("button",{onClick:()=>i(a=>!a),className:dd("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition-transform duration-200 hover:bg-muted",h?"rotate-180":"rotate-0"),"aria-label":"Toggle files panel",children:(0,aA.jsx)(ir,{size:14})})]}),h&&(0,aA.jsx)(Dh,{files:b,setFiles:c,editDisabled:!0===d||void 0!==e})]})})})}).displayName="TasksFilesSidebar";let Di=cz("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),Dj=cz("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Dk=cz("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Dl=cz("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Dm=cz("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),Dn=cz("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Do={js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",sh:"bash",bash:"bash",zsh:"bash",json:"json",jsonl:"json",xml:"xml",html:"html",css:"css",scss:"scss",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",tex:"latex",bib:"latex",r:"r"},Dp=new Set(["png","jpg","jpeg","gif","webp","svg","bmp"]),Dq=new Set([...Object.keys(Do),"txt","md","markdown","log","csv","tsv","cfg","conf","env","gitignore"]);function Dr(a,b=!1){let c=new URLSearchParams({path:a});return b&&c.set("download","1"),`/api/workspace/file?${c.toString()}`}let Ds=aB.default.memo(({path:a,size:b,onClose:c,onChanged:d})=>{let[e,f]=(0,aB.useState)(null),[g,h]=(0,aB.useState)(!1),[i,j]=(0,aB.useState)(null),[k,l]=(0,aB.useState)(!1),[m,n]=(0,aB.useState)(""),[o,p]=(0,aB.useState)(!1),[q,r]=(0,aB.useState)(null),[s,t]=(0,aB.useState)(!1),[u,v]=(0,aB.useState)(!1),[w,x]=(0,aB.useState)(null),y=(0,aB.useRef)(!0);(0,aB.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let z=a?a.split("/").pop()||a:"",A=(0,aB.useMemo)(()=>z.includes(".")?z.split(".").pop().toLowerCase():"",[z]),B=Dp.has(A)?"image":"pdf"===A?"pdf":Dq.has(A)?"text":"binary",C="text"===B&&null!=b&&b>2097152;if((0,aB.useEffect)(()=>{if(!a||"text"!==B||C)return void f(null);let b=!1;return h(!0),j(null),l(!1),r(null),fetch(Dr(a)).then(async a=>{if(!a.ok){let b=await a.json().catch(()=>null);throw Error(b?.error||`Failed to load file (${a.status})`)}return a.text()}).then(a=>{b||f(a)}).catch(a=>{b||j(a.message??"Failed to load file.")}).finally(()=>{b||h(!1)}),()=>{b=!0}},[a,B,C]),!a)return null;let D="md"===A||"markdown"===A,E=Do[A]||"text",F=k&&null!==e&&m!==e,G=a=>{F?x(a):"close"===a?c():l(!1)},H=async()=>{p(!0),r(null);try{let b=await fetch(Dr(a),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:m})}),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error||"Failed to save.");if(!y.current)return;f(m),l(!1),d?.()}catch(a){y.current&&r(a instanceof Error?a.message:"Failed to save.")}finally{y.current&&p(!1)}},I=async()=>{t(!0),r(null);try{let b=await fetch(Dr(a),{method:"DELETE"});if(!b.ok){let a=await b.json().catch(()=>null);throw Error(a?.error||"Failed to delete.")}d?.(),c()}catch(a){y.current&&(v(!1),r(a instanceof Error?a.message:"Failed to delete."))}finally{y.current&&t(!1)}};return(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(de,{open:!0,onOpenChange:a=>{a||G("close")},children:(0,aA.jsxs)(dh,{"aria-describedby":void 0,className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6",children:[(0,aA.jsx)(dk,{className:"sr-only",children:a}),(0,aA.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3 border-b border-border pb-4",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,aA.jsx)(Db,{className:"h-5 w-5 shrink-0 text-[var(--color-text-tertiary)]","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-base font-medium text-primary",children:a})]}),(0,aA.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:k?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{G("cancel-edit")},disabled:o,children:[(0,aA.jsx)(Dn,{size:16,className:"mr-1","aria-hidden":"true"}),"Cancel"]}),(0,aA.jsxs)(dy,{size:"sm",className:"h-8 bg-[var(--brand-solid)] px-3 text-[var(--brand-foreground)] hover:opacity-90",onClick:H,disabled:o||!F,children:[o?(0,aA.jsx)(fj,{size:16,className:"mr-1 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(Dc,{size:16,className:"mr-1","aria-hidden":"true"}),o?"Saving…":"Save"]})]}):(0,aA.jsxs)(aA.Fragment,{children:["text"===B&&!C&&(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{n(e??""),r(null),l(!0)},disabled:g||null===e,"aria-label":"Edit file",children:[(0,aA.jsx)(fl,{size:16,className:"mr-1","aria-hidden":"true"}),"Edit"]}),(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",asChild:!0,children:(0,aA.jsxs)("a",{href:Dr(a,!0),download:z,children:[(0,aA.jsx)(fi,{size:16,className:"mr-1","aria-hidden":"true"}),"Download"]})}),(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-destructive",onClick:()=>v(!0),disabled:s,"aria-label":"Delete file",title:"Delete file",children:s?(0,aA.jsx)(fj,{size:16,className:"animate-spin","aria-hidden":"true"}):(0,aA.jsx)(fq,{size:16,"aria-hidden":"true"})})]})})]}),q&&(0,aA.jsx)("p",{role:"alert",className:"mb-2 text-sm text-destructive",children:q}),(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:k?(0,aA.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),spellCheck:!1,"aria-label":"File content",className:"h-full w-full resize-none rounded-md border border-border bg-background p-4 font-mono text-sm leading-relaxed text-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",placeholder:"File is empty…"}):"image"===B?(0,aA.jsx)(f_,{className:"h-full rounded-md bg-[var(--color-surface)]",children:(0,aA.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,aA.jsx)("img",{src:Dr(a),alt:z,className:"max-h-full max-w-full object-contain"})})}):"pdf"===B?(0,aA.jsx)("iframe",{src:Dr(a),title:z,className:"h-full w-full rounded-md border border-border"}):"binary"===B||C?(0,aA.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-12 text-center",children:[(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:C?"This file is too large to preview inline.":"This file type can't be previewed."}),(0,aA.jsx)(dy,{variant:"outline",size:"sm",asChild:!0,children:(0,aA.jsxs)("a",{href:Dr(a,!0),download:z,children:[(0,aA.jsx)(fi,{size:16,className:"mr-1","aria-hidden":"true"}),"Download file"]})})]}):g?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,aA.jsx)(fj,{className:"size-5 animate-spin text-muted-foreground","aria-hidden":"true"})}):i?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center p-12",children:(0,aA.jsx)("p",{className:"text-sm text-destructive",children:i})}):(0,aA.jsx)(f_,{className:"h-full rounded-md bg-[var(--color-surface)]",children:(0,aA.jsx)("div",{className:"p-4",children:e&&e.length>0?D?(0,aA.jsx)("div",{className:"rounded-md p-6",children:(0,aA.jsx)(CB,{content:e})}):(0,aA.jsx)(Cd,{language:E,style:Ce,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem"},showLineNumbers:!0,wrapLines:!0,lineProps:{style:{whiteSpace:"pre-wrap"}},children:e}):(0,aA.jsx)("div",{className:"flex items-center justify-center p-12",children:(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"File is empty"})})})})})]})}),(0,aA.jsx)(de,{open:null!==w,onOpenChange:a=>{a||x(null)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Discard unsaved changes?"}),(0,aA.jsxs)(dl,{children:["Your edits to “",z,"” have not been saved."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>x(null),children:"Keep Editing"}),(0,aA.jsx)(dy,{onClick:()=>{x(null),"close"===w&&c(),"cancel-edit"===w&&l(!1)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})}),(0,aA.jsx)(de,{open:u,onOpenChange:a=>{s||v(a)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Delete file?"}),(0,aA.jsxs)(dl,{children:["“",z,"” will be permanently removed from the workspace. This can't be undone."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>v(!1),disabled:s,children:"Cancel"}),(0,aA.jsx)(dy,{onClick:I,disabled:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:s?"Deleting…":"Delete"})]})]})})]})});async function Dt(a){let b=await fetch(`/api/workspace?${new URLSearchParams({path:a})}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error||"Failed to list workspace.");return c?.entries??[]}async function Du(){let a=await fetch("/api/workspace?recursive=1"),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error||"Failed to load workspace.");return{entries:b?.entries??[],truncated:!!b?.truncated}}Ds.displayName="WorkspaceFileDialog";let Dv=[{key:"docs",label:"Papers & docs",Icon:Db,exts:["pdf","tex","bib","md","markdown","txt","docx","doc","rtf","odt"]},{key:"figures",label:"Figures",Icon:Dk,exts:["png","jpg","jpeg","gif","svg","webp","bmp","tiff","tif","eps"]},{key:"data",label:"Data",Icon:Dl,exts:["json","jsonl","csv","tsv","xlsx","xls","parquet","pkl","npy","npz","h5","hdf5","db","sqlite","yaml","yml","xml"]},{key:"code",label:"Code",Icon:Dm,exts:["py","ipynb","js","ts","tsx","jsx","sh","bash","r","jl","cpp","cc","c","h","hpp","java","go","rs","m","rb"]}],Dw={key:"other",label:"Other",Icon:uf},Dx={};for(let a of Dv)for(let b of a.exts)Dx[b]=a.key;function Dy(){let[a,b]=(0,aB.useState)("tree"),[c,d]=(0,aB.useState)({}),[e,f]=(0,aB.useState)(new Set),[g,h]=(0,aB.useState)(new Set),[i,j]=(0,aB.useState)(!1),[k,l]=(0,aB.useState)(null),[m,n]=(0,aB.useState)(!1),[o,p]=(0,aB.useState)(!1),[q,r]=(0,aB.useState)(null),[s,t]=(0,aB.useState)(null),u=(0,aB.useCallback)(async a=>{h(b=>new Set(b).add(a));try{let b=await Dt(a);return d(c=>({...c,[a]:b})),""===a&&r(null),b}catch(b){throw""===a&&r(b instanceof Error?b.message:"Failed to load."),b}finally{h(b=>{let c=new Set(b);return c.delete(a),c})}},[]),v=(0,aB.useCallback)(async()=>{n(!0);try{let{entries:a,truncated:b}=await Du();l(a),p(b),r(null)}catch(a){r(a instanceof Error?a.message:"Failed to load.")}finally{n(!1)}},[]);(0,aB.useEffect)(()=>{j(!0),u("").catch(()=>{}).finally(()=>j(!1))},[]),(0,aB.useEffect)(()=>{"type"!==a||null!==k||m||v()},[a]);let w=(0,aB.useCallback)(async()=>{(r(null),"type"===a)?await v():(j(!0),await Promise.allSettled(["",...e].map(a=>u(a))),j(!1))},[a,e,u,v]),x=(0,aB.useCallback)(a=>{f(b=>{let d=new Set(b);return d.has(a)?d.delete(a):(d.add(a),c[a]||u(a).catch(()=>{})),d})},[c,u]),y=(0,aB.useMemo)(()=>{let a={};for(let b of k??[]){let c=Dx[b.ext]??Dw.key;(a[c]??=[]).push(b)}for(let b of Object.values(a))b.sort((a,b)=>b.mtime-a.mtime);return a},[k]),z="type"===a?m:i,A=(a,b)=>{let d=c[a];return d?0===d.length&&0===b?(0,aA.jsx)("p",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:"No files in the workspace yet"}):d.map(a=>{let c=e.has(a.path),d=g.has(a.path);return(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>"dir"===a.type?x(a.path):t({path:a.path,size:a.size}),className:"flex w-full items-center gap-1.5 rounded-md py-1 pr-2 text-left text-sm text-foreground transition-colors hover:bg-muted",style:{paddingLeft:`${14*b+4}px`},title:a.name,children:["dir"===a.type?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("span",{className:"flex size-4 shrink-0 items-center justify-center text-muted-foreground",children:d?(0,aA.jsx)(fj,{className:"size-3 animate-spin"}):c?(0,aA.jsx)(ir,{className:"size-3.5"}):(0,aA.jsx)(CP,{className:"size-3.5"})}),(0,aA.jsx)(Di,{className:"size-4 shrink-0 text-[var(--brand)]"})]}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("span",{className:"size-4 shrink-0"}),(0,aA.jsx)(Db,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,aA.jsx)("span",{className:"truncate",children:a.name})]}),"dir"===a.type&&c&&A(a.path,b+1)]},a.path)}):null};return(0,aA.jsxs)("div",{className:"flex min-h-0 flex-col",children:[(0,aA.jsxs)("div",{className:"flex items-center justify-between gap-2 pb-1.5",children:[(0,aA.jsx)("div",{className:"flex items-center gap-0.5 rounded-md bg-muted p-0.5 text-xs",children:["tree","type"].map(c=>(0,aA.jsx)("button",{type:"button",onClick:()=>b(c),className:dd("rounded px-2 py-0.5 font-medium transition-colors",a===c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),"aria-pressed":a===c,children:"tree"===c?"Tree":"By type"},c))}),(0,aA.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,aA.jsxs)("a",{href:"/api/workspace/download",download:!0,className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:"Download the whole workspace as a zip",children:[(0,aA.jsx)(fi,{className:"size-3.5"}),"All"]}),(0,aA.jsx)("button",{type:"button",onClick:w,disabled:z,className:"inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50","aria-label":"Refresh workspace",title:"Refresh",children:(0,aA.jsx)(Dj,{className:dd("size-3.5",z&&"animate-spin")})})]})]}),q?(0,aA.jsx)("p",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:q}):"tree"===a?i&&!c[""]?(0,aA.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,aA.jsx)(fj,{className:"size-4 animate-spin text-muted-foreground"})}):(0,aA.jsx)("div",{className:"-mx-1",children:A("",0)}):m&&null===k?(0,aA.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,aA.jsx)(fj,{className:"size-4 animate-spin text-muted-foreground"})}):(()=>{if(!k)return null;if(0===k.length)return(0,aA.jsx)("p",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:"No files in the workspace yet"});let a=[...Dv,Dw];return(0,aA.jsxs)("div",{className:"space-y-3",children:[o&&(0,aA.jsx)("p",{className:"px-1 text-[11px] text-muted-foreground",children:"Showing the first files only — the workspace has more than the limit."}),a.map(a=>{let b=y[a.key];if(!b||0===b.length)return null;let c=a.Icon;return(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("div",{className:"mb-0.5 flex items-center gap-1.5 px-1 text-[10px] font-semibold uppercase tracking-wider text-tertiary",children:[(0,aA.jsx)(c,{className:"size-3.5"}),a.label,(0,aA.jsxs)("span",{className:"text-muted-foreground",children:["(",b.length,")"]})]}),b.map(a=>{let b=a.path.includes("/")?a.path.slice(0,a.path.lastIndexOf("/")):"";return(0,aA.jsxs)("button",{type:"button",onClick:()=>t({path:a.path,size:a.size}),className:"flex w-full items-center gap-1.5 rounded-md px-1 py-1 text-left text-sm text-foreground transition-colors hover:bg-muted",title:a.path,children:[(0,aA.jsx)(c,{className:"size-4 shrink-0 text-muted-foreground"}),(0,aA.jsx)("span",{className:"truncate",children:a.name}),b&&(0,aA.jsx)("span",{className:"ml-auto shrink-0 truncate pl-2 text-[11px] text-muted-foreground",children:b})]},a.path)})]},a.key)})]})})(),(0,aA.jsx)(Ds,{path:s?.path??null,size:s?.size,onClose:()=>t(null),onChanged:w})]})}let Dz=aB.default.memo(({path:a,onClose:b})=>{let[c,d]=(0,aB.useState)(null),[e,f]=(0,aB.useState)(!1),[g,h]=(0,aB.useState)(null),i=(0,aB.useRef)(0);(0,aB.useEffect)(()=>{if(!a){d(null),h(null);return}let b=++i.current;f(!0),h(null),d(null),(async()=>{try{let c=await fetch(`/api/memory?path=${encodeURIComponent(a)}`);if(!c.ok){let a=await c.json().catch(()=>null);throw Error(a?.error||`HTTP ${c.status}`)}let e=await c.json();if(i.current!==b)return;d("string"==typeof e.content?e.content:"")}catch(a){if(i.current!==b)return;h(a instanceof Error?a.message:"Failed to read file.")}finally{i.current===b&&f(!1)}})()},[a]);let j=null!==a,k=a?a.split("/").filter(Boolean).pop()||a:"",l=k.toLowerCase().endsWith(".md");return(0,aA.jsx)(de,{open:j,onOpenChange:a=>{a||b()},children:(0,aA.jsxs)(dh,{className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col gap-3 p-6",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsxs)(dk,{className:"flex items-center gap-2 text-base",children:[(0,aA.jsx)(Db,{className:"size-4 shrink-0","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"truncate",children:k})]}),a&&(0,aA.jsx)(dl,{className:"break-all font-mono text-xs",children:a})]}),(0,aA.jsxs)(f_,{className:"-mx-2 max-h-[65vh] flex-1 px-2",children:[e&&(0,aA.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,aA.jsx)(fj,{className:"size-4 animate-spin text-muted-foreground"})}),g&&(0,aA.jsx)("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm",children:g}),!e&&!g&&null!==c&&(l?(0,aA.jsx)(CB,{content:c}):(0,aA.jsx)("pre",{className:"m-0 whitespace-pre-wrap break-words font-mono text-xs leading-6",children:c}))]})]})})});Dz.displayName="MemoryFileDialog";let DA=["Survey recent papers on a topic","Design an experiment plan","Analyze workspace files"];function DB(a,b){let c=b.length>0?`
162
162
 
163
163
  Workspace files uploaded for this request:
164
- ${b.map(a=>`- ${a.path}`).join("\n")}`:"";return`${a}${c}`}let Dr=(a,b)=>{switch(a){case"completed":return(0,aA.jsx)(uc,{size:16,className:dd("text-[var(--color-success)]",b)});case"in_progress":return(0,aA.jsx)(ud,{size:16,className:dd("text-[var(--color-warning)]",b)});default:return(0,aA.jsx)(ue,{size:16,className:dd("text-[var(--color-text-tertiary)]",b)})}},Ds=aB.default.memo(({assistant:a,onShowAgents:b,onNotifyReady:c})=>{let d,e,f,g,h,i,j,[k,l]=(0,aB.useState)(null),m=(0,aB.useRef)(null),n=(0,aB.useRef)(null),o=(0,aB.useRef)(null),[p,q]=(0,aB.useState)(""),[r,s]=(0,aB.useState)([]),[t,u]=(0,aB.useState)(!1),[v,w]=(0,aB.useState)([]),x=(0,aB.useRef)(v);x.current=v;let y=(0,aB.useRef)(0),z=(0,aB.useRef)(null),[A]=aM("threadId"),[B,C]=(0,aB.useState)(()=>CP(A)),[D,E]=(0,aB.useState)(!1),F=(0,aB.useRef)(null),G=(0,aB.useRef)(A),H=(0,aB.useRef)(!1),{scrollRef:I,contentRef:J,scrollToBottom:K,isAtBottom:L}=((a={})=>{let[b,c]=(0,aB.useState)(!1),[d,e]=(0,aB.useState)(!1!==a.initial),[f,g]=(0,aB.useState)(!1),h=(0,aB.useRef)(null);h.current=a;let i=(0,aB.useCallback)(()=>{if(!CZ)return!1;let a=window.getSelection();if(!a||!a.rangeCount)return!1;let b=a.getRangeAt(0);return b.commonAncestorContainer.contains(q.current)||q.current?.contains(b.commonAncestorContainer)},[]),j=(0,aB.useCallback)(a=>{l.isAtBottom=a,e(a)},[]),k=(0,aB.useCallback)(a=>{l.escapedFromLock=a,c(a)},[]),l=(0,aB.useMemo)(()=>{let c;return{escapedFromLock:b,isAtBottom:d,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return q.current?.scrollTop??0},set scrollTop(scrollTop){if(q.current){let{scrollBehavior:a}=getComputedStyle(q.current);"auto"!==a&&(q.current.style.scrollBehavior="auto"),q.current.scrollTop=scrollTop,l.ignoreScrollToTop=q.current.scrollTop,"auto"!==a&&(q.current.style.scrollBehavior=a)}},get targetScrollTop(){if(!q.current||!r.current)return 0;return q.current.scrollHeight-1-q.current.clientHeight},get calculatedTargetScrollTop(){if(!q.current||!r.current)return 0;let{targetScrollTop:b}=this;if(!a.targetScrollTop)return b;if(c?.targetScrollTop===b)return c.calculatedScrollTop;let d=Math.max(Math.min(a.targetScrollTop(b,{scrollElement:q.current,contentElement:r.current}),b),0);return c={targetScrollTop:b,calculatedScrollTop:d},requestAnimationFrame(()=>{c=void 0}),d},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=70}}},[]),m=(0,aB.useCallback)((a={})=>{let b;"string"==typeof a&&(a={animation:a}),a.preserveScrollPosition||j(!0);let c=Date.now()+(Number(a.wait)||0),d=C0(h.current,a.animation),{ignoreEscapes:e=!1}=a,f=l.calculatedTargetScrollTop;a.duration instanceof Promise?a.duration.finally(()=>{b=Date.now()}):b=c+(a.duration??0);let g=async()=>{let a=new Promise(requestAnimationFrame).then(()=>{if(!l.isAtBottom)return l.animation=void 0,!1;let{scrollTop:j}=l,k=performance.now(),n=(k-(l.lastTick??k))/CY;if(l.animation||(l.animation={behavior:d,promise:a,ignoreEscapes:e}),l.animation.behavior===d&&(l.lastTick=k),i()||c>Date.now())return g();if(j<Math.min(f,l.calculatedTargetScrollTop)){if(l.animation?.behavior===d){if("instant"===d)return l.scrollTop=l.calculatedTargetScrollTop,g();l.velocity=(d.damping*l.velocity+d.stiffness*l.scrollDifference)/d.mass,l.accumulated+=l.velocity*n,l.scrollTop+=l.accumulated,l.scrollTop!==j&&(l.accumulated=0)}return g()}return b>Date.now()?(f=l.calculatedTargetScrollTop,g()):(l.animation=void 0,l.scrollTop<l.calculatedTargetScrollTop)?m({animation:C0(h.current,h.current.resize),ignoreEscapes:e,duration:Math.max(0,b-Date.now())||void 0}):l.isAtBottom});return a.then(a=>(requestAnimationFrame(()=>{l.animation||(l.lastTick=void 0,l.velocity=0)}),a))};return(!0!==a.wait&&(l.animation=void 0),l.animation?.behavior===d)?l.animation.promise:g()},[j,i,l]),n=(0,aB.useCallback)(()=>{k(!0),j(!1)},[k,j]),o=(0,aB.useCallback)(({target:a})=>{if(a!==q.current)return;let{scrollTop:b,ignoreScrollToTop:c}=l,{lastScrollTop:d=b}=l;l.lastScrollTop=b,l.ignoreScrollToTop=void 0,c&&c>b&&(d=c),g(l.isNearBottom),setTimeout(()=>{if(l.resizeDifference||b===c)return;if(i()){k(!0),j(!1);return}let a=b>d,e=b<d;if(l.animation?.ignoreEscapes){l.scrollTop=d;return}e&&(k(!0),j(!1)),a&&k(!1),!l.escapedFromLock&&l.isNearBottom&&j(!0)},1)},[k,j,i,l]),p=(0,aB.useCallback)(({target:a,deltaY:b})=>{let c=a;for(;!["scroll","auto"].includes(getComputedStyle(c).overflow);){if(!c.parentElement)return;c=c.parentElement}c===q.current&&b<0&&q.current.scrollHeight>q.current.clientHeight&&!l.animation?.ignoreEscapes&&(k(!0),j(!1))},[k,j,l]),q=C$(a=>{q.current?.removeEventListener("scroll",o),q.current?.removeEventListener("wheel",p),a?.addEventListener("scroll",o,{passive:!0}),a?.addEventListener("wheel",p,{passive:!0})},[]),r=C$(a=>{let b;l.resizeObserver?.disconnect(),a&&(l.resizeObserver=new ResizeObserver(([a])=>{let{height:c}=a.contentRect,d=c-(b??c);if(l.resizeDifference=d,l.scrollTop>l.targetScrollTop&&(l.scrollTop=l.targetScrollTop),g(l.isNearBottom),d>=0){let a=C0(h.current,b?h.current.resize:h.current.initial);m({animation:a,wait:!0,preserveScrollPosition:!0,duration:"instant"===a?void 0:350})}else l.isNearBottom&&(k(!1),j(!0));b=c,requestAnimationFrame(()=>{setTimeout(()=>{l.resizeDifference===d&&(l.resizeDifference=0)},1)})}),l.resizeObserver?.observe(a))},[]);return{contentRef:r,scrollRef:q,scrollToBottom:m,stopScroll:n,isAtBottom:d||f,isNearBottom:f,escapedFromLock:b,state:l}})(),{stream:M,messages:N,todos:O,files:P,ui:Q,setFiles:R,isLoading:S,isThreadLoading:T,interrupt:U,sendMessage:V,stopStream:W,resumeInterrupt:X,subAgentActivity:Y,asyncTasks:Z,summarizationEvent:$}=t9(),{tasks:_}=CR(A,{enabled:Object.keys(Z??{}).length>0}),aa=(0,aB.useMemo)(()=>CC(_),[_]),[ab]=CW(A),ac=(0,aB.useRef)(!1);(0,aB.useEffect)(()=>{ac.current=!1},[A]),(0,aB.useEffect)(()=>{S&&(ac.current=!1)},[S]),(0,aB.useEffect)(()=>{var a;if(!_||0===_.length||!A||!ab)return;if(!(A&&({})[A]?.initialized===!0))return void CU(A,_.filter(a=>CB(a.liveStatus)).map(Cw));if(S||ac.current||p.trim()||v.length>0)return;let b=function(a){if(!a)return new Set;let b={}[a];return new Set(Array.isArray(b?.keys)?b.keys:[])}(A);for(let c of _){if(!CB(c.liveStatus))continue;let d=Cw(c);if(!b.has(d)){if(N.some(a=>"human"===a.type&&Cy(t3(a),c))){CV(A,d);continue}ac.current=!0,CV(A,d),V(Cz(c)),jD.toast.success(`Auto-reported ${Cu[a=c.agent_name]??a} to the main chat.`);break}}},[_,ab,S,p,N,V,A,v]),(0,aB.useEffect)(()=>{S&&K()},[S,K]);let ad=(0,aB.useRef)({sendMessage:V,isLoading:S,messages:N,threadId:A});ad.current={sendMessage:V,isLoading:S,messages:N,threadId:A};let ae=(0,aB.useRef)(c);ae.current=c,(0,aB.useEffect)(()=>(ae.current?.((a,b)=>{let c=ad.current;return c.threadId!==b?"wrong-thread":c.isLoading?"busy":c.messages.some(b=>"human"===b.type&&Cy(t3(b),a))?"duplicate":(CV(b,Cw(a)),c.sendMessage(Cz(a)),"sent")}),()=>ae.current?.(null)),[]);let af=(0,aB.useMemo)(()=>{for(let a=N.length-1;a>=0;a--){let b=N[a];if("ai"!==b.type)continue;let c=b.response_metadata,d=function(a,b){if("string"!=typeof a||!a.trim())return null;let c=a.trim(),d=c.lastIndexOf("/"),e=d>=0?c.slice(0,d):"";d>=0&&(c=c.slice(d+1)),c=c.replace(/-\d{8}$/,"");let f="string"==typeof b&&b.trim()||e;return{name:c,provider:f?f.charAt(0).toUpperCase()+f.slice(1):null}}(c?.model_name??c?.model,c?.model_provider);if(d)return d}return null},[N]),ag=(0,aB.useMemo)(()=>{let a={},b=Object.keys(Y);if(0===b.length)return a;let c=[],d={};for(let a of N)if("ai"===a.type)for(let b of a.tool_calls??[])"task"===b.name&&b.id&&c.push(b.id);else if("tool"===a.type){let b=a.tool_call_id;b&&(d[b]=t3(a))}let e=a=>a.replace(/\s+/g," ").trim(),f=new Set;for(let g of c){let c=e(d[g]??"");if(!c)continue;let h=b.find(a=>{if(f.has(a))return!1;let b=e(function(a){for(let b=a.length-1;b>=0;b--){let c=a[b];if("text"===c.kind)return c.text}return""}(Y[a]));return""!==b&&(c.includes(b)||b.includes(c))});h&&(a[g]=Y[h],f.add(h))}let g=b.filter(a=>!f.has(a)),h=0;for(let b of c)a[b]||d[b]||h<g.length&&(a[b]=Y[g[h++]]);return a},[N,Y]),ah=U?.value,ai=ah?.type==="ask_user"||Array.isArray(ah?.action_requests)&&ah.action_requests.length>0,aj=S||!a||ai;(0,aB.useEffect)(()=>{if(S||ai||ac.current||0===v.length)return;let[a,...b]=v;a.threadId===A&&(ac.current=!0,w(b),V(Dq(a.text,a.files)))},[S,ai,v,V,A]);let ak=(0,aB.useRef)(A);(0,aB.useEffect)(()=>{let a=ak.current;(ak.current=A,null===a&&null!==A)?w(a=>a.map(a=>null===a.threadId?{...a,threadId:A}:a)):a!==A&&w([])},[A]);let al=(0,aB.useCallback)(()=>{C(!0),CQ(A,!0),E(!1)},[A]),am=(0,aB.useCallback)(()=>{C(!1),CQ(A,!1),E(!1),F.current=null},[A]);(0,aB.useEffect)(()=>{let a=G.current;if(a!==A){if(null===a&&null!==A&&H.current){let a;(a={})[CN]&&(a[A]=!0),CN in a&&(delete a[CN],CO(a))}else null===a&&null!==A&&CQ(null,!1);C(CP(A)),F.current=null,E(!1),s([]),H.current=!1,G.current=A}},[A]);let an=(0,aB.useCallback)(async a=>{let b=Array.from(a.target.files??[]);if(a.target.value="",0!==b.length){u(!0);try{let a=new FormData;b.forEach(b=>a.append("files",b));let c=await fetch("/api/workspace/upload",{method:"POST",body:a}),d=await c.json();if(!c.ok||!d.files)throw Error(d.error||"Failed to upload files.");s(a=>[...a,...d.files]),jD.toast.success(`${d.files.length} file${1===d.files.length?"":"s"} uploaded to the workspace.`)}catch(a){jD.toast.error(a instanceof Error?a.message:"Failed to upload files.")}finally{u(!1)}}},[]),ao=(0,aB.useCallback)(a=>{s(b=>b.filter(b=>b.path!==a))},[]),ap=(0,aB.useCallback)(b=>{b&&b.preventDefault();let c=p.trim();if(c&&a&&!ai&&!t){if(S){w(a=>[...a,{id:y.current+=1,text:c,files:r,threadId:A}]),q(""),s([]);return}H.current=null===A&&B,V(Dq(c,r)),q(""),s([])}},[p,a,ai,B,S,t,r,V,A]),aq=(0,aB.useCallback)(a=>{let b=x.current.find(b=>b.id===a);b&&(w(b=>b.filter(b=>b.id!==a)),q(b.text),s(b.files),requestAnimationFrame(()=>{let a=n.current;a&&(a.focus(),a.setSelectionRange(b.text.length,b.text.length))}))},[]),ar=(0,aB.useCallback)(a=>{w(b=>{let c=b.find(b=>b.id===a);return c&&b[0]?.id!==a?[c,...b.filter(b=>b.id!==a)]:b}),jD.toast.info("This message will run next without interrupting the current turn.")},[]),as=(0,aB.useCallback)((a,b)=>{w(c=>{let d=c.findIndex(b=>b.id===a),e=d+b;if(d<0||e<0||e>=c.length)return c;let f=[...c],[g]=f.splice(d,1);return f.splice(e,0,g),f})},[]),at=(0,aB.useCallback)(a=>{let b=z.current;z.current=null,null!==b&&b!==a&&w(c=>{let d=c.findIndex(a=>a.id===b),e=c.findIndex(b=>b.id===a);if(d<0||e<0)return c;let f=[...c],[g]=f.splice(d,1);return f.splice(e,0,g),f})},[]),au=(0,aB.useCallback)(a=>{w(b=>b.filter(b=>b.id!==a))},[]),av=(0,aB.useCallback)(()=>{w([])},[]),aw=(0,aB.useCallback)(a=>{if(!ai&&!a.nativeEvent.isComposing&&229!==a.keyCode){if("ArrowUp"===a.key&&0===p.length&&x.current.length>0){a.preventDefault();let b=x.current;aq(b[b.length-1].id);return}"Enter"!==a.key||a.shiftKey||(a.preventDefault(),ap())}},[ap,ai,p,aq]),ax=(0,aB.useCallback)(a=>{q(a),requestAnimationFrame(()=>{let b=n.current;b&&(b.focus(),b.setSelectionRange(a.length,a.length))})},[]),ay=(0,aB.useCallback)(a=>{q(a),requestAnimationFrame(()=>n.current?.focus())},[]);(0,aB.useEffect)(()=>{if(!B)return;let a=U?.value&&U.value.action_requests;if(!U||!Array.isArray(a)||0===a.length){F.current=null;return}F.current!==U&&(F.current=U,X({decisions:a.map(()=>({type:"approve"}))}))},[B,U,X]);let az=(0,aB.useMemo)(()=>{let a=U?.value;return a?.type==="ask_user"&&Array.isArray(a.questions)?a.questions:null},[U]),aC=(0,aB.useCallback)(a=>{X({status:"answered",answers:a})},[X]),aD=(0,aB.useCallback)(()=>{X({status:"cancelled"})},[X]),aE=(0,aB.useMemo)(()=>{let a=U?.value&&U.value.action_requests;return Array.isArray(a)?a:[]},[U]),aF=(0,aB.useMemo)(()=>{let a=new Map,b=new Set,c=N.filter(a=>{if("human"===a.type){let c,d=(c=Cx(t3(a)))?`${c.taskId}:${c.runId||"legacy"}`:null;return!d||!b.has(d)&&(b.add(d),!0)}let c=M.getMessagesMetadata(a)?.streamMetadata,d=c?.langgraph_checkpoint_ns;return!("string"==typeof d&&d.includes("|")||function(a){if("human"===a.type){var b;if("human"!==a.type)return!1;let c=a.additional_kwargs;return c?.lc_source==="summarization"}return"ai"===a.type&&!!(b=t3(a))&&(!!(/\bconversation that has been summarized\b/.test(b)||/\bHere is a summary of the conversation to date\b/.test(b)||/<summary>[\s\S]*<\/summary>/.test(b))||/##\s+SESSION INTENT\b/.test(b))}(a))}),d=new Set;for(let a of c){if("tool"!==a.type)continue;let b=a.tool_call_id;b&&d.add(b)}let e=new Map;for(let a of aE)e.set(a.name,(e.get(a.name)??0)+1);c.forEach(b=>{if("ai"===b.type){let c,f=(c=[],b.additional_kwargs?.tool_calls&&Array.isArray(b.additional_kwargs.tool_calls)?c.push(...b.additional_kwargs.tool_calls):b.tool_calls&&Array.isArray(b.tool_calls)?c.push(...b.tool_calls.filter(a=>""!==a.name)):Array.isArray(b.content)&&c.push(...b.content.filter(a=>"tool_use"===a.type)),c.map(a=>{let b=a.function?.arguments||a.args||a.input||{};return{id:a.id,name:a.function?.name||a.name||a.type||"",args:function(a){if(a&&"object"==typeof a)return a;if("string"!=typeof a)return{};try{let b=JSON.parse(a);return b&&"object"==typeof b?b:{}}catch{return{}}}(b)}})).filter(a=>"ToolSelectionResponse"!==a.name||S&&!U).map((a,c)=>{let f=a.name||"unknown",g=a.id||`${b.id??"ai-message"}-tool-${c}-${f}`,h=e.get(f)??0,i=h>0&&!d.has(g);return i&&e.set(f,h-1),{id:g,name:f,args:a.args,status:i?"interrupted":"pending"}});a.set(b.id,{message:b,toolCalls:f})}else if("tool"===b.type){let c=b.tool_call_id;if(!c)return;for(let[,d]of a.entries()){let a=d.toolCalls.findIndex(a=>a.id===c);if(-1!==a){d.toolCalls[a]={...d.toolCalls[a],status:"completed",result:t3(b)};break}}}else"human"===b.type&&a.set(b.id,{message:b,toolCalls:[]})});let f=Array.from(a.values());return f.map((a,b)=>{let c=b>0?f[b-1].message:null;return{...a,showAvatar:a.message.type!==c?.type}})},[N,aE,U,S,M]),{value:aG}=dF(),aH=a=>{let b=a.content;if("string"==typeof b)return b.trim().length>0;if(Array.isArray(b))for(let a of b){let b=a?.text;if("string"==typeof b&&b.trim().length>0)return!0}return!1},aI=(0,aB.useMemo)(()=>{let a=[];for(let b of aF)if("ai"===b.message.type&&b.toolCalls.length>0&&!aH(b.message)){let c=a[a.length-1];c?.kind==="action-group"?c.items.push(b):a.push({kind:"action-group",items:[b]})}else a.push({kind:"message",data:b});return a},[aF]),aJ=aF.length>0?aF[aF.length-1].message.id:void 0,aK=(0,aB.useMemo)(()=>{if(!$)return null;let a=new Set(aF.map(a=>a.message.id));for(let b=$.cutoffIndex;b<N.length;b++){let c=N[b]?.id;if(null!=c&&a.has(c))return c}return null},[$,N,aF]),aL={in_progress:O.filter(a=>"in_progress"===a.status),pending:O.filter(a=>"pending"===a.status),completed:O.filter(a=>"completed"===a.status)},aN=O.length>0,aO=Object.keys(P).length>0,[aP,aQ]=(0,aB.useState)(()=>new Set);(0,aB.useEffect)(()=>{0===aE.length&&aQ(new Set)},[aE.length]);let aR=(0,aB.useCallback)(a=>{aQ(b=>{let c=new Set(b);return c.add(a),c})},[]),aS=(0,aB.useMemo)(()=>{let a=U?.value&&U.value.review_configs;if(!Array.isArray(a))return new Map;let b=[];for(let c of a){let a=c.actionName??c.action_name;a&&b.push([a,{actionName:a,allowedDecisions:c.allowedDecisions??c.allowed_decisions}])}return new Map(b)},[U]);return(0,aA.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,aA.jsx)(de,{open:D,onOpenChange:E,children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Enable Auto-approve?"}),(0,aA.jsx)(dl,{children:"EvoScientist will run tool actions in this research without asking you to review each one. Turn this on only when you trust the current task and deployment."})]}),(0,aA.jsxs)("div",{className:"flex items-start gap-3 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100",children:[(0,aA.jsx)(uj,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),(0,aA.jsx)("p",{children:"Auto-approve stays on for this research only — it follows this conversation across views and reloads, and other research keeps its own setting. Turn it off here anytime."})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>E(!1),children:"Cancel"}),(0,aA.jsx)(dy,{onClick:al,className:"bg-amber-600 text-white hover:bg-amber-700",children:"Enable Auto-approve"})]})]})}),(0,aA.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",ref:I,children:(0,aA.jsx)("div",{className:"mx-auto w-full max-w-[960px] px-4 pb-4 pt-3 sm:px-5",ref:J,children:T?(0,aA.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,aA.jsx)("p",{className:"text-muted-foreground",children:"Loading…"})}):(0,aA.jsxs)(aA.Fragment,{children:[0===aF.length&&!S&&(0,aA.jsxs)("div",{className:"flex min-h-[42vh] flex-col items-center justify-center px-3 text-center",children:[(0,aA.jsx)("h2",{className:"text-pretty text-lg font-semibold sm:text-xl",children:"Start Research"}),(0,aA.jsx)("p",{className:"mt-2 max-w-lg text-sm text-muted-foreground",children:"Ask EvoScientist to review literature, inspect workspace files, or plan the next experiment."}),(0,aA.jsx)("div",{className:"mt-4 flex max-w-2xl flex-wrap justify-center gap-2",children:Dp.map(a=>(0,aA.jsx)("button",{type:"button",onClick:()=>ay(a),className:"max-w-full rounded-full border border-border bg-card px-2.5 py-1.5 text-xs text-foreground shadow-sm transition-colors hover:border-[var(--color-border)] hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring sm:text-sm",children:a},a))})]}),aI.map((b,c)=>{if("action-group"===b.kind){let d=b.items[b.items.length-1].message.id,e=c===aI.length-1,f=S&&e&&d===aJ;return(0,aA.jsx)(CJ,{items:b.items,isStreaming:f,defaultCollapsed:aG,isAtBottom:L,lastMessageId:aJ,isLoading:S,actionRequests:aE,submittedActionRequestKeys:aP,onActionRequestSubmitted:aR,reviewConfigsMap:aS,stream:M,onResumeInterrupt:X,graphId:a?.graph_id,onEditMessage:ax,autoApprove:B,subAgentSteps:ag,ui:Q,compactionAnchorId:aK,summarizationEvent:$??null},`action-group-${b.items[0].message.id}`)}let d=b.data,e=Q?.filter(a=>a.metadata?.message_id===d.message.id),f=c===aI.length-1,g="human"!==d.message.type,h=aK===d.message.id;return(0,aA.jsxs)(aB.default.Fragment,{children:[h&&$&&(0,aA.jsx)(CI,{content:$.content,summarizedCount:$.cutoffIndex}),(0,aA.jsx)(CG,{message:d.message,toolCalls:d.toolCalls,isLoading:S,isStreaming:S&&f&&g,actionRequests:f?aE:void 0,submittedActionRequestKeys:aP,onActionRequestSubmitted:aR,reviewConfigsMap:f?aS:void 0,ui:e,stream:M,onResumeInterrupt:X,graphId:a?.graph_id,onEditMessage:ax,autoApprove:B,subAgentSteps:ag})]},d.message.id)}),$&&!aK&&(0,aA.jsx)(CI,{content:$.content,summarizedCount:$.cutoffIndex}),az&&(0,aA.jsx)("div",{className:"mt-4",children:(0,aA.jsx)(CM,{questions:az,onSubmit:aC,onCancel:aD,isLoading:S})})]})})}),(0,aA.jsxs)("div",{className:"flex-shrink-0 bg-background",children:[v.length>0&&(0,aA.jsx)("div",{"aria-label":"Queued messages",className:"relative mx-auto -mb-4 w-[calc(100%-16px)] max-w-[960px] px-2 sm:w-[calc(100%-24px)]",children:(0,aA.jsx)("div",{className:"rounded-b-lg rounded-t-2xl border border-border bg-background pb-5 pt-1 shadow-sm",children:v.map((a,b)=>{let c=p.trim().length>0||r.length>0;return(0,aA.jsxs)("div",{onDragOver:a=>a.preventDefault(),onDrop:()=>at(a.id),className:"relative flex min-h-11 items-start gap-1.5 px-2 py-2 text-sm sm:gap-2 sm:px-3",children:[(0,aA.jsx)("button",{type:"button",draggable:!0,onDragStart:b=>{z.current=a.id,b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("text/plain",String(a.id))},onDragEnd:()=>{z.current=null},onKeyDown:c=>{"ArrowUp"===c.key&&b>0&&(c.preventDefault(),as(a.id,-1)),"ArrowDown"===c.key&&b<v.length-1&&(c.preventDefault(),as(a.id,1))},"aria-label":`Reorder queued message ${b+1} of ${v.length}`,title:"Drag to reorder, or use the arrow keys",className:"mt-0.5 inline-flex size-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground/60 focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing",children:(0,aA.jsx)(ec,{className:"size-3.5","aria-hidden":"true"})}),(0,aA.jsx)(ul,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,aA.jsx)("span",{className:"line-clamp-2 whitespace-pre-wrap break-words pt-0.5 text-foreground",children:a.text}),a.files.length>0&&(0,aA.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,aA.jsx)(uk,{className:"size-3 shrink-0","aria-hidden":"true"}),a.files.length," file",1===a.files.length?"":"s"]})]}),(0,aA.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>ar(a.id),"aria-label":"Steer with this message next",title:"Submit next without interrupting the current turn",className:"inline-flex h-7 items-center gap-1 rounded-full px-2 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)(ul,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"Steer"})]}),(0,aA.jsx)("button",{type:"button",onClick:()=>au(a.id),"aria-label":"Remove queued message",title:"Remove from queue",className:"inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(fq,{className:"size-3.5","aria-hidden":"true"})}),(0,aA.jsxs)("details",{className:"group/menu relative",onBlur:a=>{a.currentTarget.contains(a.relatedTarget)||a.currentTarget.removeAttribute("open")},onKeyDown:a=>{"Escape"===a.key&&(a.currentTarget.removeAttribute("open"),a.currentTarget.querySelector("summary")?.focus())},children:[(0,aA.jsx)("summary",{"aria-label":"More queued message actions",title:"More actions",className:"inline-flex size-7 cursor-pointer list-none items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:(0,aA.jsx)(um,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("div",{className:"absolute right-0 top-8 z-30 min-w-40 rounded-xl border border-border bg-background p-1.5 shadow-lg",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>aq(a.id),disabled:c,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:[(0,aA.jsx)(fl,{className:"size-4","aria-hidden":"true"}),"Edit message"]}),(0,aA.jsxs)("button",{type:"button",onClick:av,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)(un,{className:"size-4","aria-hidden":"true"}),"Close queue"]})]})]})]})]},a.id)})})}),(0,aA.jsxs)("div",{className:dd("relative z-10 mx-auto mb-2 flex w-[calc(100%-16px)] max-w-[960px] flex-shrink-0 flex-col overflow-hidden rounded-xl border border-border bg-background transition-colors duration-200 ease-in-out sm:mb-4 sm:w-[calc(100%-24px)]","focus-within:ring-2 focus-within:ring-ring"),children:[(0,aA.jsxs)("div",{className:"flex max-h-60 flex-col overflow-y-auto border-b border-border bg-sidebar empty:hidden sm:max-h-72",children:[!k&&(0,aA.jsx)(aA.Fragment,{children:(d=O.find(a=>"in_progress"===a.status),f=(e=O.length)-aL.pending.length,g=e===f,h=aN?(0,aA.jsx)("button",{type:"button",onClick:()=>l(a=>"tasks"===a?null:"tasks"),className:"grid w-full cursor-pointer grid-cols-[auto_auto_1fr] items-center gap-2.5 px-3 py-2.5 text-left sm:px-4","aria-expanded":"tasks"===k,children:g?[(0,aA.jsx)(uc,{size:16,className:"text-[var(--color-success)]"},"icon"),(0,aA.jsx)("span",{className:"ml-[1px] min-w-0 truncate text-sm",children:"All tasks completed"},"label")]:null!=d?[(0,aA.jsx)("div",{children:Dr(d.status)},"icon"),(0,aA.jsxs)("span",{className:"ml-[1px] min-w-0 truncate text-sm",children:["Task"," ",e-aL.pending.length," ","of ",e]},"label"),(0,aA.jsx)("span",{className:"min-w-0 gap-2 truncate text-sm text-muted-foreground",children:d.content},"content")]:[(0,aA.jsx)(ue,{size:16,className:"text-[var(--color-text-tertiary)]"},"icon"),(0,aA.jsxs)("span",{className:"ml-[1px] min-w-0 truncate text-sm",children:["Task"," ",e-aL.pending.length," of"," ",e]},"label")]}):null,i=aO?(0,aA.jsxs)("button",{type:"button",onClick:()=>l(a=>"files"===a?null:"files"),className:"flex flex-shrink-0 cursor-pointer items-center gap-2 px-3 py-2.5 text-left text-sm sm:px-4","aria-expanded":"files"===k,children:[(0,aA.jsx)(uf,{size:16}),"Files (State)",(0,aA.jsx)("span",{className:"h-4 min-w-4 rounded-full bg-[var(--brand-solid)] px-0.5 text-center text-[10px] leading-[16px] text-[var(--brand-foreground)]",children:Object.keys(P).length})]}):null,j=(0,aA.jsxs)("button",{type:"button",onClick:()=>l(a=>"workspace"===a?null:"workspace"),className:"flex flex-shrink-0 cursor-pointer items-center gap-2 px-3 py-2.5 text-left text-sm sm:px-4","aria-expanded":"workspace"===k,"aria-label":"Open workspace",children:[(0,aA.jsx)(ug,{size:16,"aria-hidden":"true"}),(0,aA.jsx)("span",{children:"Workspace"})]}),(0,aA.jsxs)("div",{className:"flex items-center",children:[(0,aA.jsx)("div",{className:"min-w-0 flex-1",children:h}),i,j]}))}),k&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)("div",{className:"sticky top-0 flex items-stretch bg-sidebar text-sm",children:[aN&&(0,aA.jsx)("button",{type:"button",className:"py-2.5 pr-4 first:pl-3 aria-expanded:font-semibold sm:first:pl-4",onClick:()=>l(a=>"tasks"===a?null:"tasks"),"aria-expanded":"tasks"===k,children:"Tasks"}),aO&&(0,aA.jsxs)("button",{type:"button",className:"inline-flex items-center gap-2 py-2.5 pr-4 first:pl-3 aria-expanded:font-semibold sm:first:pl-4",onClick:()=>l(a=>"files"===a?null:"files"),"aria-expanded":"files"===k,children:["Files (State)",(0,aA.jsx)("span",{className:"h-4 min-w-4 rounded-full bg-[var(--brand-solid)] px-0.5 text-center text-[10px] leading-[16px] text-[var(--brand-foreground)]",children:Object.keys(P).length})]}),(0,aA.jsx)("button",{type:"button",className:"inline-flex items-center gap-2 py-2.5 pr-4 first:pl-3 aria-expanded:font-semibold sm:first:pl-4",onClick:()=>l(a=>"workspace"===a?null:"workspace"),"aria-expanded":"workspace"===k,children:"Workspace"}),(0,aA.jsx)("button",{"aria-label":"Close",className:"flex-1",onClick:()=>l(null)})]}),(0,aA.jsxs)("div",{ref:m,className:"px-3 sm:px-4",children:["tasks"===k&&Object.entries(aL).filter(([a,b])=>b.length>0).map(([a,b])=>(0,aA.jsxs)("div",{className:"mb-4",children:[(0,aA.jsx)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-tertiary",children:{pending:"Pending",in_progress:"In Progress",completed:"Completed"}[a]}),(0,aA.jsx)("div",{className:"grid grid-cols-[auto_1fr] gap-3 rounded-sm p-1 pl-0 text-sm",children:b.map((b,c)=>(0,aA.jsxs)(aB.Fragment,{children:[Dr(b.status,"mt-0.5"),(0,aA.jsx)("span",{className:"break-words text-inherit",children:b.content})]},`${a}_${b.id}_${c}`))})]},a)),"files"===k&&(0,aA.jsx)("div",{className:"mb-6",children:(0,aA.jsx)(C7,{files:P,setFiles:R,editDisabled:!0===S||void 0!==U})}),"workspace"===k&&(0,aA.jsx)("div",{className:"mb-6 pt-2",children:(0,aA.jsx)(Do,{})})]})]})]}),B&&(0,aA.jsxs)("div",{"aria-live":"polite",className:"flex items-center justify-between gap-3 border-b border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100",children:[(0,aA.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,aA.jsx)(uj,{className:"size-3.5 shrink-0","aria-hidden":"true"}),"Tool actions will run without review."]}),(0,aA.jsx)("button",{type:"button",onClick:am,className:"shrink-0 rounded px-2 py-1 font-semibold transition-colors hover:bg-amber-200 focus-visible:ring-2 focus-visible:ring-amber-700 dark:hover:bg-amber-900",children:"Turn Off"})]}),(af||aa>0)&&(0,aA.jsxs)("div",{className:"flex items-center gap-1.5 border-t border-border px-3 py-1.5 text-xs text-muted-foreground",children:[af&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(ui,{className:"size-3.5 shrink-0 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"font-medium text-foreground",children:af.name}),af.provider&&(0,aA.jsxs)("span",{children:["· ",af.provider]})]}),aa>0&&(0,aA.jsxs)("button",{type:"button",onClick:b,title:`${aa} background agent${1===aa?"":"s"} running — click to view`,"aria-label":`${aa} background agent${1===aa?"":"s"} running — view`,className:"ml-auto flex shrink-0 items-center gap-1.5 rounded px-1.5 py-0.5 font-medium text-[var(--brand)] transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)("span",{className:"size-2 animate-pulse rounded-full bg-[var(--color-warning)]","aria-hidden":"true"}),aa," agent",1===aa?"":"s"]})]}),(0,aA.jsxs)("form",{onSubmit:ap,className:"flex flex-col",children:[r.length>0&&(0,aA.jsx)("div",{"aria-label":"Attached files",className:"flex flex-wrap gap-2 border-b border-border px-3 py-2",children:r.map(a=>(0,aA.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1 text-xs text-foreground",children:[(0,aA.jsx)(uf,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"max-w-48 truncate",title:a.path,children:a.name}),(0,aA.jsx)("button",{type:"button",onClick:()=>ao(a.path),"aria-label":`Remove ${a.name} from this message`,title:`Remove ${a.name} from this message`,className:"rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(cA,{className:"size-3.5","aria-hidden":"true"})})]},a.path))}),(0,aA.jsx)("textarea",{ref:n,value:p,onChange:a=>q(a.target.value),onKeyDown:aw,"aria-label":"Message",disabled:ai,placeholder:ai?"Respond to the request above to continue…":S?"Queue a follow-up — sends when this turn finishes…":"Ask EvoScientist anything…",className:"font-inherit field-sizing-content flex-1 resize-none border-0 bg-transparent px-3.5 pb-2.5 pt-3 text-sm leading-6 text-primary outline-none placeholder:text-tertiary disabled:cursor-not-allowed sm:px-4",rows:1}),(0,aA.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 sm:p-2.5",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-1",children:[(0,aA.jsx)("input",{ref:o,type:"file",multiple:!0,onChange:an,disabled:!a||ai||t,className:"hidden"}),(0,aA.jsx)("button",{type:"button",onClick:()=>o.current?.click(),disabled:!a||ai||t,"aria-label":"Upload files to workspace",title:"Upload files to workspace (max 50 MB each)",className:"inline-flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:(0,aA.jsx)(uk,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("button",{type:"button",onClick:()=>B?am():E(!0),"aria-pressed":B,title:"Auto-approve all tool actions in this conversation",className:dd("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors",B?"bg-amber-600 text-white hover:bg-amber-700":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[(0,aA.jsx)(uh,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden min-[360px]:inline",children:B?"Auto-approve On":"Auto-approve"})]})]}),(0,aA.jsx)("div",{className:"flex justify-end gap-2",children:(0,aA.jsx)(dy,{type:S?"button":"submit",variant:S?"destructive":"default",onClick:S?W:ap,disabled:!S&&(aj||t||!p.trim()),"aria-label":S?"Stop generating":"Send message",children:S?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(ua,{size:14}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"Stop"})]}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(ub,{size:18}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"Send"})]})})})]})]})]})]})]})});Ds.displayName="ChatInterface";let Dt=cz("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),Du=cz("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),Dv=cz("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Dw=aB.default.memo(({skill:a,onClose:b})=>{let[c,d]=(0,aB.useState)(null),[e,f]=(0,aB.useState)(!1),[g,h]=(0,aB.useState)(null);if((0,aB.useEffect)(()=>{if(!a)return;let b=!1;return d(null),h(null),f(!0),fetch(`/api/skills/detail?name=${encodeURIComponent(a.name)}`).then(async a=>{let b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error||`Failed to load (${a.status})`);return b}).then(a=>{b||d(a)}).catch(a=>{b||h(a.message??"Failed to load skill detail.")}).finally(()=>{b||f(!1)}),()=>{b=!0}},[a]),!a)return null;let i=c?.title??a.title,j=c?.version??a.version,k=c?.description??a.description,l=c?.installed??a.installed,m=c?.body;return(0,aA.jsx)(de,{open:!0,onOpenChange:b,children:(0,aA.jsxs)(dh,{"aria-describedby":void 0,className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6",children:[(0,aA.jsx)(dk,{className:"sr-only",children:i}),(0,aA.jsxs)("div",{className:"mb-3 flex items-start gap-3 border-b border-border pb-4",children:[(0,aA.jsx)(fo,{className:"mt-1 size-6 shrink-0 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("div",{className:"min-w-0 flex-1",children:(0,aA.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,aA.jsx)("h2",{className:"break-words text-lg font-semibold",children:i}),j&&(0,aA.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:["v",j]}),null!=a.fileCount&&(0,aA.jsxs)("span",{className:"text-xs text-muted-foreground",children:["· ",a.fileCount," file",1===a.fileCount?"":"s"]}),l&&(0,aA.jsxs)("span",{className:"bg-[var(--brand)]/10 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium text-[var(--brand)]",children:[(0,aA.jsx)(Dv,{className:"size-3","aria-hidden":"true"}),"Installed"]})]})})]}),(0,aA.jsx)(f_,{className:"min-h-0 flex-1",children:(0,aA.jsxs)("div",{className:"pr-3",children:[(0,aA.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-foreground",children:k||"No description."}),(0,aA.jsx)("div",{className:"mt-4 border-t border-border pt-4",children:e?(0,aA.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading skill contents…"]}):g?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:g}):m?(0,aA.jsx)(Cr,{content:m}):(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"No additional contents."})})]})})]})})});function Dx(){let[a,b]=(0,aB.useState)([]),[c,d]=(0,aB.useState)([]),[e,f]=(0,aB.useState)(!0),[g,h]=(0,aB.useState)(null),[i,j]=(0,aB.useState)(null),[k,l]=(0,aB.useState)({}),[m,n]=(0,aB.useState)(null),[o,p]=(0,aB.useState)(null),q=(0,aB.useCallback)(async(a=!1)=>{f(!0),j(null),h(null);let[c,e]=await Promise.allSettled([fetch(`/api/skills/catalog${a?"?refresh=1":""}`).then(async a=>{let b=await a.json();if(!a.ok)throw Error(b.error||"Failed to load catalog");return b.skills??[]}),fetch("/api/skills").then(async a=>{let b=await a.json();if(!a.ok)throw Error(b.error||"Failed to load skills");return b.skills??[]})]),g="fulfilled"===c.status?c.value:[];if("rejected"===c.status&&h(c.reason instanceof Error?c.reason.message:"Failed to load the official catalog."),b(g),"fulfilled"===e.status){let a=new Set(g.map(a=>a.name));d(e.value.filter(b=>!a.has(b.name)))}else d([]),j(e.reason instanceof Error?e.reason.message:"Failed to load installed skills.");f(!1)},[]);(0,aB.useEffect)(()=>{q()},[q]);let r=async(a,c="install")=>{l(b=>({...b,[a]:c})),j(null);try{let c=await fetch("/api/skills/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),d=await c.json();if(!c.ok)throw Error(d.error||"Failed to install");b(b=>b.map(b=>b.name===a?{...b,installed:!0,updateAvailable:!1,installedVersion:b.latestVersion??b.installedVersion}:b))}catch(a){j(a instanceof Error?a.message:`Failed to ${c}`)}finally{l(b=>{let c={...b};return delete c[a],c})}},s=async(a,c)=>{l(b=>({...b,[a]:"uninstall"})),j(null);try{let e=await fetch(`/api/skills?name=${encodeURIComponent(a)}`,{method:"DELETE"});if(!e.ok){let a=await e.json();throw Error(a.error||"Failed to uninstall")}c?b(b=>b.map(b=>b.name===a?{...b,installed:!1}:b)):d(b=>b.filter(b=>b.name!==a))}catch(a){j(a instanceof Error?a.message:"Failed to uninstall")}finally{l(b=>{let c={...b};return delete c[a],c})}},t=async()=>{o&&(p(null),await s(o.name,o.isCatalog))};return(0,aA.jsxs)("div",{className:"h-full overflow-y-auto",children:[(0,aA.jsxs)("div",{className:"mx-auto max-w-[960px] px-4 py-5 sm:px-5 sm:py-6",children:[(0,aA.jsxs)("header",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,aA.jsxs)("div",{children:[(0,aA.jsx)("h2",{className:"text-xl font-semibold sm:text-2xl",children:"Research Skills"}),(0,aA.jsxs)("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:["Install official skills from the"," ",(0,aA.jsx)("a",{href:"https://github.com/EvoScientist/EvoSkills",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"EvoSkills"})," ","catalog, or remove ones you don't need."]})]}),(0,aA.jsx)("button",{type:"button",onClick:()=>q(!0),disabled:e,"aria-label":"Refresh",className:"rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(Dt,{className:e?"size-4 animate-spin":"size-4","aria-hidden":"true"})})]}),i&&(0,aA.jsx)("p",{role:"alert",className:"mb-4 text-sm text-destructive",children:i}),e?(0,aA.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground","aria-live":"polite",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading skills…"]}):(0,aA.jsxs)("div",{className:"space-y-6",children:[(0,aA.jsxs)("section",{children:[(0,aA.jsx)("h3",{className:"mb-2.5 text-xs font-semibold uppercase tracking-wider text-tertiary",children:"Official catalog"}),g?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:g}):0===a.length?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"No skills found in the catalog."}):(0,aA.jsx)("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2",children:a.map(a=>(0,aA.jsx)(Dy,{title:a.title,description:a.description,meta:`${a.fileCount} file${1===a.fileCount?"":"s"}`,installed:a.installed,installedVersion:a.installedVersion,latestVersion:a.latestVersion,updateAvailable:a.updateAvailable,busy:k[a.name],onOpen:()=>n({name:a.name,title:a.title,description:a.description,version:a.installed?a.installedVersion:a.latestVersion,fileCount:a.fileCount,installed:a.installed}),onInstall:()=>r(a.name),onUpdate:()=>r(a.name,"update"),onUninstall:()=>p({name:a.name,title:a.title,isCatalog:!0})},a.name))})]}),c.length>0&&(0,aA.jsxs)("section",{children:[(0,aA.jsx)("h3",{className:"mb-2.5 text-xs font-semibold uppercase tracking-wider text-tertiary",children:"Other installed skills"}),(0,aA.jsx)("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2",children:c.map(a=>(0,aA.jsx)(Dy,{title:a.title,description:a.description,installed:!0,busy:k[a.name],onOpen:()=>n({name:a.name,title:a.title,description:a.description,installed:!0}),onUninstall:()=>p({name:a.name,title:a.title,isCatalog:!1})},a.name))})]})]})]}),(0,aA.jsx)(Dw,{skill:m,onClose:()=>n(null)}),(0,aA.jsx)(de,{open:null!==o,onOpenChange:a=>{a||p(null)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Uninstall skill?"}),(0,aA.jsxs)(dl,{children:["“",o?.title??o?.name,"” will be removed from this Web UI. You can install it again later."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>p(null),children:"Cancel"}),(0,aA.jsx)(dy,{onClick:t,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Uninstall"})]})]})})]})}function Dy({title:a,description:b,meta:c,installed:d,installedVersion:e,latestVersion:f,updateAvailable:g,busy:h,onOpen:i,onInstall:j,onUpdate:k,onUninstall:l}){let m=d?e&&`v${e}`:f&&`v${f}`;return(0,aA.jsxs)("div",{className:"flex flex-col rounded-lg border border-border bg-card p-3",children:[(0,aA.jsxs)("button",{type:"button",onClick:i,className:"-m-1 flex items-start gap-2.5 rounded-md p-1 text-left transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring",title:"View details",children:[(0,aA.jsx)(fo,{className:"mt-0.5 size-5 shrink-0 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,aA.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,aA.jsx)("h3",{className:"break-words text-lg font-medium leading-tight",children:a}),m&&(0,aA.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:m}),c&&(0,aA.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["· ",c]})]}),(0,aA.jsx)("p",{className:"mt-1 line-clamp-2 text-sm leading-6 text-muted-foreground",children:b||"No description."})]})]}),(0,aA.jsxs)("div",{className:"mt-2.5 flex items-center justify-end gap-2",children:[d&&g&&(0,aA.jsxs)("button",{type:"button",onClick:k,disabled:!!h,className:"inline-flex items-center gap-1.5 rounded-md bg-[var(--brand-solid)] px-2.5 py-1 text-xs font-medium text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",title:f?`Update to v${f}`:"Update",children:["update"===h?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(Du,{className:"size-3.5","aria-hidden":"true"}),"update"===h?"Updating…":f?`Update → v${f}`:"Update"]}),d?(0,aA.jsxs)("button",{type:"button",onClick:l,disabled:!!h,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:["uninstall"===h?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(fq,{className:"size-3.5","aria-hidden":"true"}),"uninstall"===h?"Removing…":"Uninstall"]}):(0,aA.jsxs)("button",{type:"button",onClick:j,disabled:!!h,className:"inline-flex items-center gap-1.5 rounded-md bg-[var(--brand-solid)] px-2.5 py-1 text-xs font-medium text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:["install"===h?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(fi,{className:"size-3.5","aria-hidden":"true"}),"install"===h?"Installing…":"Install"]})]})]})}Dw.displayName="SkillDetailDialog";let Dz=cz("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),DA=cz("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),DB={json:"json",yaml:"yaml",yml:"yaml",csv:"text",tsv:"text",log:"text",txt:"text",tex:"latex",bib:"latex",rst:"markdown"},DC=["Core memory","Profile","Projects","Evolution reports"];function DD(a){let b=a.lastIndexOf("/");return b>=0?a.slice(0,b):""}function DE(a){return a.split("/").pop()||a}function DF(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}function DG(a,b){return Math.min(Math.max(a,200),b?Math.max(280,b.clientWidth-360):640)}function DH(){var a;let b,[c,d]=(0,aB.useState)(null),[e,f]=(0,aB.useState)(!0),[g,h]=(0,aB.useState)(null),[i,j]=(0,aB.useState)(null),[k,l]=(0,aB.useState)(null),[m,n]=(0,aB.useState)(!1),[o,p]=(0,aB.useState)(null),[q,r]=(0,aB.useState)(!1),[s,t]=(0,aB.useState)(""),[u,v]=(0,aB.useState)(!1),[w,x]=(0,aB.useState)(!1),[y,z]=(0,aB.useState)(!1),[A,B]=(0,aB.useState)(""),[C,D]=(0,aB.useState)(!1),[E,F]=(0,aB.useState)(null),[G,H]=(0,aB.useState)(!1),[I,J]=(0,aB.useState)(!1),[K,L]=(0,aB.useState)(!1),M=(0,aB.useRef)(!1),N=(0,aB.useRef)(0),O=(0,aB.useRef)(null),P=function(){let[a,b]=(0,aB.useState)(!1);return(0,aB.useEffect)(()=>{let a=window.matchMedia("(min-width: 768px)"),c=()=>b(a.matches);return c(),a.addEventListener("change",c),()=>a.removeEventListener("change",c)},[]),a}(),Q=(0,aB.useRef)(null),R=(0,aB.useRef)(null),S=(0,aB.useRef)(null),[T,U]=(0,aB.useState)(()=>256);(0,aB.useEffect)(()=>{try{window.localStorage.setItem("evoscientist-memory-list-width",String(T))}catch{}},[T]);let V=(0,aB.useCallback)(a=>{if(Q.current=a,S.current?.disconnect(),S.current=null,a&&"u">typeof ResizeObserver){let b=new ResizeObserver(()=>{window.matchMedia("(min-width: 768px)").matches&&U(b=>DG(b,a))});b.observe(a),S.current=b}},[]);(0,aB.useEffect)(()=>()=>R.current?.(),[]);let W=(0,aB.useCallback)(a=>{a.preventDefault(),R.current?.();let b=a.clientX,c=new AbortController,d=()=>{c.abort(),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select"),R.current=null},e={signal:c.signal};window.addEventListener("pointermove",a=>{U(DG(T+(a.clientX-b),Q.current))},e),window.addEventListener("pointerup",d,e),window.addEventListener("pointercancel",d,e),window.addEventListener("blur",d,e),document.body.style.cursor="col-resize",document.body.style.userSelect="none",R.current=d},[T]),X=(0,aB.useCallback)(async()=>{f(!0),h(null);try{let a=await fetch("/api/memory"),b=await a.json();if(!a.ok)throw Error(b.error||"Failed to load memory.");d(b);let c=b.entries.reduce((a,b)=>b.mtime>a?b.mtime:a,0);c>0&&jC(c)}catch(a){h(a instanceof Error?a.message:"Failed to load memory.")}finally{f(!1)}},[]);(0,aB.useEffect)(()=>{X()},[X]);let[Y,Z]=(0,aB.useState)(()=>Date.now());(0,aB.useEffect)(()=>{let a=setInterval(()=>Z(Date.now()),6e4);return()=>clearInterval(a)},[]);let $=(0,aB.useMemo)(()=>{let a=c?.entries??[],b=new Map;for(let c of a){let a=function(a){let b=a.split("/");return"profile"===b[0]?"projects"===b[1]?"Projects":"Profile":"evolution-reports"===b[0]?"Evolution reports":1===b.length?"Core memory":b[0]}(c.path);(b.get(a)??b.set(a,[]).get(a)).push(c)}return[...b.keys()].sort((a,b)=>{let c=DC.indexOf(a),d=DC.indexOf(b);return -1!==c||-1!==d?(-1===c?99:c)-(-1===d?99:d):a.localeCompare(b)}).map(a=>({name:a,files:b.get(a).sort((a,b)=>a.path.localeCompare(b.path))}))},[c]),_=(0,aB.useCallback)(async a=>{let b=++N.current;j(a),r(!1),l(null),p(null),n(!0);try{let c=await fetch(`/api/memory?path=${encodeURIComponent(a)}`),d=await c.json();if(b!==N.current)return;if(!c.ok)throw Error(d.error||"Failed to open file.");l(d)}catch(a){if(b!==N.current)return;p(a instanceof Error?a.message:"Failed to open file.")}finally{b===N.current&&n(!1)}},[]);(0,aB.useEffect)(()=>{if(M.current||i)return;let a=$[0]?.files[0];a&&(M.current=!0,_(a.path))},[$,i,_]);let aa=async()=>{if(!i)return;let a=N.current;v(!0),p(null);try{let b=await fetch("/api/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i,content:s})}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to save.");a===N.current&&(l(c),r(!1)),X()}catch(b){a===N.current&&p(b instanceof Error?b.message:"Failed to save.")}finally{v(!1)}},ab=async()=>{if(!i)return;let a=N.current;J(!0);try{let b=await fetch(`/api/memory?path=${encodeURIComponent(i)}`,{method:"DELETE"});if(!b.ok){let a=await b.json().catch(()=>null);throw Error(a?.error||"Failed to delete.")}a===N.current&&(j(null),l(null),r(!1)),H(!1),X()}catch(b){a===N.current&&p(b instanceof Error?b.message:"Failed to delete.")}finally{J(!1)}},ac=async()=>{k&&await Cf(k.content)&&(x(!0),setTimeout(()=>x(!1),1500))},ad=async()=>{let a=A.trim();if(!a)return void F("Enter a file name.");/\.[A-Za-z0-9]+$/.test(a)||(a+=".md"),D(!0),F(null);try{let b=await fetch("/api/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a,content:`# ${DE(a).replace(/\.[^.]+$/,"")}
164
+ ${b.map(a=>`- ${a.path}`).join("\n")}`:"";return`${a}${c}`}let DC=(a,b)=>{switch(a){case"completed":return(0,aA.jsx)(uc,{size:16,className:dd("text-[var(--color-success)]",b)});case"in_progress":return(0,aA.jsx)(ud,{size:16,className:dd("text-[var(--color-warning)]",b)});default:return(0,aA.jsx)(ue,{size:16,className:dd("text-[var(--color-text-tertiary)]",b)})}},DD=aB.default.memo(({assistant:a,onShowAgents:b,onNotifyReady:c})=>{let d,e,f,g,h,i,j,[k,l]=(0,aB.useState)(null),m=(0,aB.useRef)(null),n=(0,aB.useRef)(null),o=(0,aB.useRef)(null),[p,q]=(0,aB.useState)(""),[r,s]=(0,aB.useState)([]),[t,u]=(0,aB.useState)(!1),[v,w]=(0,aB.useState)([]),x=(0,aB.useRef)(v);x.current=v;let y=(0,aB.useRef)(0),z=(0,aB.useRef)(null),[A]=aM("threadId"),[B,C]=(0,aB.useState)(null),[D,E]=(0,aB.useState)(null);(0,aB.useEffect)(()=>{let a=a=>{let b=a.detail;b&&("memory"===b.kind?E(b.path):C(b.path))};return window.addEventListener(Ct,a),()=>window.removeEventListener(Ct,a)},[]);let[F,G]=(0,aB.useState)(()=>CZ(A)),[H,I]=(0,aB.useState)(!1),J=(0,aB.useRef)(null),K=(0,aB.useRef)(A),L=(0,aB.useRef)(!1),{scrollRef:M,contentRef:N,scrollToBottom:O,isAtBottom:P}=((a={})=>{let[b,c]=(0,aB.useState)(!1),[d,e]=(0,aB.useState)(!1!==a.initial),[f,g]=(0,aB.useState)(!1),h=(0,aB.useRef)(null);h.current=a;let i=(0,aB.useCallback)(()=>{if(!C7)return!1;let a=window.getSelection();if(!a||!a.rangeCount)return!1;let b=a.getRangeAt(0);return b.commonAncestorContainer.contains(q.current)||q.current?.contains(b.commonAncestorContainer)},[]),j=(0,aB.useCallback)(a=>{l.isAtBottom=a,e(a)},[]),k=(0,aB.useCallback)(a=>{l.escapedFromLock=a,c(a)},[]),l=(0,aB.useMemo)(()=>{let c;return{escapedFromLock:b,isAtBottom:d,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return q.current?.scrollTop??0},set scrollTop(scrollTop){if(q.current){let{scrollBehavior:a}=getComputedStyle(q.current);"auto"!==a&&(q.current.style.scrollBehavior="auto"),q.current.scrollTop=scrollTop,l.ignoreScrollToTop=q.current.scrollTop,"auto"!==a&&(q.current.style.scrollBehavior=a)}},get targetScrollTop(){if(!q.current||!r.current)return 0;return q.current.scrollHeight-1-q.current.clientHeight},get calculatedTargetScrollTop(){if(!q.current||!r.current)return 0;let{targetScrollTop:b}=this;if(!a.targetScrollTop)return b;if(c?.targetScrollTop===b)return c.calculatedScrollTop;let d=Math.max(Math.min(a.targetScrollTop(b,{scrollElement:q.current,contentElement:r.current}),b),0);return c={targetScrollTop:b,calculatedScrollTop:d},requestAnimationFrame(()=>{c=void 0}),d},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=70}}},[]),m=(0,aB.useCallback)((a={})=>{let b;"string"==typeof a&&(a={animation:a}),a.preserveScrollPosition||j(!0);let c=Date.now()+(Number(a.wait)||0),d=Da(h.current,a.animation),{ignoreEscapes:e=!1}=a,f=l.calculatedTargetScrollTop;a.duration instanceof Promise?a.duration.finally(()=>{b=Date.now()}):b=c+(a.duration??0);let g=async()=>{let a=new Promise(requestAnimationFrame).then(()=>{if(!l.isAtBottom)return l.animation=void 0,!1;let{scrollTop:j}=l,k=performance.now(),n=(k-(l.lastTick??k))/C6;if(l.animation||(l.animation={behavior:d,promise:a,ignoreEscapes:e}),l.animation.behavior===d&&(l.lastTick=k),i()||c>Date.now())return g();if(j<Math.min(f,l.calculatedTargetScrollTop)){if(l.animation?.behavior===d){if("instant"===d)return l.scrollTop=l.calculatedTargetScrollTop,g();l.velocity=(d.damping*l.velocity+d.stiffness*l.scrollDifference)/d.mass,l.accumulated+=l.velocity*n,l.scrollTop+=l.accumulated,l.scrollTop!==j&&(l.accumulated=0)}return g()}return b>Date.now()?(f=l.calculatedTargetScrollTop,g()):(l.animation=void 0,l.scrollTop<l.calculatedTargetScrollTop)?m({animation:Da(h.current,h.current.resize),ignoreEscapes:e,duration:Math.max(0,b-Date.now())||void 0}):l.isAtBottom});return a.then(a=>(requestAnimationFrame(()=>{l.animation||(l.lastTick=void 0,l.velocity=0)}),a))};return(!0!==a.wait&&(l.animation=void 0),l.animation?.behavior===d)?l.animation.promise:g()},[j,i,l]),n=(0,aB.useCallback)(()=>{k(!0),j(!1)},[k,j]),o=(0,aB.useCallback)(({target:a})=>{if(a!==q.current)return;let{scrollTop:b,ignoreScrollToTop:c}=l,{lastScrollTop:d=b}=l;l.lastScrollTop=b,l.ignoreScrollToTop=void 0,c&&c>b&&(d=c),g(l.isNearBottom),setTimeout(()=>{if(l.resizeDifference||b===c)return;if(i()){k(!0),j(!1);return}let a=b>d,e=b<d;if(l.animation?.ignoreEscapes){l.scrollTop=d;return}e&&(k(!0),j(!1)),a&&k(!1),!l.escapedFromLock&&l.isNearBottom&&j(!0)},1)},[k,j,i,l]),p=(0,aB.useCallback)(({target:a,deltaY:b})=>{let c=a;for(;!["scroll","auto"].includes(getComputedStyle(c).overflow);){if(!c.parentElement)return;c=c.parentElement}c===q.current&&b<0&&q.current.scrollHeight>q.current.clientHeight&&!l.animation?.ignoreEscapes&&(k(!0),j(!1))},[k,j,l]),q=C8(a=>{q.current?.removeEventListener("scroll",o),q.current?.removeEventListener("wheel",p),a?.addEventListener("scroll",o,{passive:!0}),a?.addEventListener("wheel",p,{passive:!0})},[]),r=C8(a=>{let b;l.resizeObserver?.disconnect(),a&&(l.resizeObserver=new ResizeObserver(([a])=>{let{height:c}=a.contentRect,d=c-(b??c);if(l.resizeDifference=d,l.scrollTop>l.targetScrollTop&&(l.scrollTop=l.targetScrollTop),g(l.isNearBottom),d>=0){let a=Da(h.current,b?h.current.resize:h.current.initial);m({animation:a,wait:!0,preserveScrollPosition:!0,duration:"instant"===a?void 0:350})}else l.isNearBottom&&(k(!1),j(!0));b=c,requestAnimationFrame(()=>{setTimeout(()=>{l.resizeDifference===d&&(l.resizeDifference=0)},1)})}),l.resizeObserver?.observe(a))},[]);return{contentRef:r,scrollRef:q,scrollToBottom:m,stopScroll:n,isAtBottom:d||f,isNearBottom:f,escapedFromLock:b,state:l}})(),{stream:Q,messages:R,todos:S,files:T,ui:U,setFiles:V,isLoading:W,isThreadLoading:X,interrupt:Y,sendMessage:Z,stopStream:$,resumeInterrupt:_,subAgentActivity:aa,asyncTasks:ab,summarizationEvent:ac}=t9(),{tasks:ad}=C_(A,{enabled:Object.keys(ab??{}).length>0}),ae=(0,aB.useMemo)(()=>CM(ad),[ad]),[af]=C4(A),ag=(0,aB.useRef)(!1);(0,aB.useEffect)(()=>{ag.current=!1},[A]),(0,aB.useEffect)(()=>{W&&(ag.current=!1)},[W]),(0,aB.useEffect)(()=>{var a;if(!ad||0===ad.length||!A||!af)return;if(!(A&&({})[A]?.initialized===!0))return void C2(A,ad.filter(a=>CL(a.liveStatus)).map(CG));if(W||ag.current||p.trim()||v.length>0)return;let b=function(a){if(!a)return new Set;let b={}[a];return new Set(Array.isArray(b?.keys)?b.keys:[])}(A);for(let c of ad){if(!CL(c.liveStatus))continue;let d=CG(c);if(!b.has(d)){if(R.some(a=>"human"===a.type&&CI(t3(a),c))){C3(A,d);continue}ag.current=!0,C3(A,d),Z(CJ(c)),jD.toast.success(`Auto-reported ${CE[a=c.agent_name]??a} to the main chat.`);break}}},[ad,af,W,p,R,Z,A,v]),(0,aB.useEffect)(()=>{W&&O()},[W,O]);let ah=(0,aB.useRef)({sendMessage:Z,isLoading:W,messages:R,threadId:A});ah.current={sendMessage:Z,isLoading:W,messages:R,threadId:A};let ai=(0,aB.useRef)(c);ai.current=c,(0,aB.useEffect)(()=>(ai.current?.((a,b)=>{let c=ah.current;return c.threadId!==b?"wrong-thread":c.isLoading?"busy":c.messages.some(b=>"human"===b.type&&CI(t3(b),a))?"duplicate":(C3(b,CG(a)),c.sendMessage(CJ(a)),"sent")}),()=>ai.current?.(null)),[]);let aj=(0,aB.useMemo)(()=>{for(let a=R.length-1;a>=0;a--){let b=R[a];if("ai"!==b.type)continue;let c=b.response_metadata,d=function(a,b){if("string"!=typeof a||!a.trim())return null;let c=a.trim(),d=c.lastIndexOf("/"),e=d>=0?c.slice(0,d):"";d>=0&&(c=c.slice(d+1)),c=c.replace(/-\d{8}$/,"");let f="string"==typeof b&&b.trim()||e;return{name:c,provider:f?f.charAt(0).toUpperCase()+f.slice(1):null}}(c?.model_name??c?.model,c?.model_provider);if(d)return d}return null},[R]),ak=(0,aB.useMemo)(()=>{let a={},b=Object.keys(aa);if(0===b.length)return a;let c=[],d={};for(let a of R)if("ai"===a.type)for(let b of a.tool_calls??[])"task"===b.name&&b.id&&c.push(b.id);else if("tool"===a.type){let b=a.tool_call_id;b&&(d[b]=t3(a))}let e=a=>a.replace(/\s+/g," ").trim(),f=new Set;for(let g of c){let c=e(d[g]??"");if(!c)continue;let h=b.find(a=>{if(f.has(a))return!1;let b=e(function(a){for(let b=a.length-1;b>=0;b--){let c=a[b];if("text"===c.kind)return c.text}return""}(aa[a]));return""!==b&&(c.includes(b)||b.includes(c))});h&&(a[g]=aa[h],f.add(h))}let g=b.filter(a=>!f.has(a)),h=0;for(let b of c)a[b]||d[b]||h<g.length&&(a[b]=aa[g[h++]]);return a},[R,aa]),al=Y?.value,am=al?.type==="ask_user"||Array.isArray(al?.action_requests)&&al.action_requests.length>0,an=W||!a||am;(0,aB.useEffect)(()=>{if(W||am||ag.current||0===v.length)return;let[a,...b]=v;a.threadId===A&&(ag.current=!0,w(b),Z(DB(a.text,a.files)))},[W,am,v,Z,A]);let ao=(0,aB.useRef)(A);(0,aB.useEffect)(()=>{let a=ao.current;(ao.current=A,null===a&&null!==A)?w(a=>a.map(a=>null===a.threadId?{...a,threadId:A}:a)):a!==A&&w([])},[A]);let ap=(0,aB.useCallback)(()=>{G(!0),C$(A,!0),I(!1)},[A]),aq=(0,aB.useCallback)(()=>{G(!1),C$(A,!1),I(!1),J.current=null},[A]);(0,aB.useEffect)(()=>{let a=K.current;if(a!==A){if(null===a&&null!==A&&L.current){let a;(a={})[CX]&&(a[A]=!0),CX in a&&(delete a[CX],CY(a))}else null===a&&null!==A&&C$(null,!1);G(CZ(A)),J.current=null,I(!1),s([]),L.current=!1,K.current=A}},[A]);let ar=(0,aB.useCallback)(async a=>{let b=Array.from(a.target.files??[]);if(a.target.value="",0!==b.length){u(!0);try{let a=new FormData;b.forEach(b=>a.append("files",b));let c=await fetch("/api/workspace/upload",{method:"POST",body:a}),d=await c.json();if(!c.ok||!d.files)throw Error(d.error||"Failed to upload files.");s(a=>[...a,...d.files]),jD.toast.success(`${d.files.length} file${1===d.files.length?"":"s"} uploaded to the workspace.`)}catch(a){jD.toast.error(a instanceof Error?a.message:"Failed to upload files.")}finally{u(!1)}}},[]),as=(0,aB.useCallback)(a=>{s(b=>b.filter(b=>b.path!==a))},[]),at=(0,aB.useCallback)(b=>{b&&b.preventDefault();let c=p.trim();if(c&&a&&!am&&!t){if(W){w(a=>[...a,{id:y.current+=1,text:c,files:r,threadId:A}]),q(""),s([]);return}L.current=null===A&&F,Z(DB(c,r)),q(""),s([])}},[p,a,am,F,W,t,r,Z,A]),au=(0,aB.useCallback)(a=>{let b=x.current.find(b=>b.id===a);b&&(w(b=>b.filter(b=>b.id!==a)),q(b.text),s(b.files),requestAnimationFrame(()=>{let a=n.current;a&&(a.focus(),a.setSelectionRange(b.text.length,b.text.length))}))},[]),av=(0,aB.useCallback)(a=>{w(b=>{let c=b.find(b=>b.id===a);return c&&b[0]?.id!==a?[c,...b.filter(b=>b.id!==a)]:b}),jD.toast.info("This message will run next without interrupting the current turn.")},[]),aw=(0,aB.useCallback)((a,b)=>{w(c=>{let d=c.findIndex(b=>b.id===a),e=d+b;if(d<0||e<0||e>=c.length)return c;let f=[...c],[g]=f.splice(d,1);return f.splice(e,0,g),f})},[]),ax=(0,aB.useCallback)(a=>{let b=z.current;z.current=null,null!==b&&b!==a&&w(c=>{let d=c.findIndex(a=>a.id===b),e=c.findIndex(b=>b.id===a);if(d<0||e<0)return c;let f=[...c],[g]=f.splice(d,1);return f.splice(e,0,g),f})},[]),ay=(0,aB.useCallback)(a=>{w(b=>b.filter(b=>b.id!==a))},[]),az=(0,aB.useCallback)(()=>{w([])},[]),aC=(0,aB.useCallback)(a=>{if(!am&&!a.nativeEvent.isComposing&&229!==a.keyCode){if("ArrowUp"===a.key&&0===p.length&&x.current.length>0){a.preventDefault();let b=x.current;au(b[b.length-1].id);return}"Enter"!==a.key||a.shiftKey||(a.preventDefault(),at())}},[at,am,p,au]),aD=(0,aB.useCallback)(a=>{q(a),requestAnimationFrame(()=>{let b=n.current;b&&(b.focus(),b.setSelectionRange(a.length,a.length))})},[]),aE=(0,aB.useCallback)(a=>{q(a),requestAnimationFrame(()=>n.current?.focus())},[]);(0,aB.useEffect)(()=>{if(!F)return;let a=Y?.value&&Y.value.action_requests;if(!Y||!Array.isArray(a)||0===a.length){J.current=null;return}J.current!==Y&&(J.current=Y,_({decisions:a.map(()=>({type:"approve"}))}))},[F,Y,_]);let aF=(0,aB.useMemo)(()=>{let a=Y?.value;return a?.type==="ask_user"&&Array.isArray(a.questions)?a.questions:null},[Y]),aG=(0,aB.useCallback)(a=>{_({status:"answered",answers:a})},[_]),aH=(0,aB.useCallback)(()=>{_({status:"cancelled"})},[_]),aI=(0,aB.useMemo)(()=>{let a=Y?.value&&Y.value.action_requests;return Array.isArray(a)?a:[]},[Y]),aJ=(0,aB.useMemo)(()=>{let a=new Map,b=new Set,c=R.filter(a=>{if("human"===a.type){let c,d=(c=CH(t3(a)))?`${c.taskId}:${c.runId||"legacy"}`:null;return!d||!b.has(d)&&(b.add(d),!0)}let c=Q.getMessagesMetadata(a)?.streamMetadata,d=c?.langgraph_checkpoint_ns;return!("string"==typeof d&&d.includes("|")||function(a){if("human"===a.type){var b;if("human"!==a.type)return!1;let c=a.additional_kwargs;return c?.lc_source==="summarization"}return"ai"===a.type&&!!(b=t3(a))&&(!!(/\bconversation that has been summarized\b/.test(b)||/\bHere is a summary of the conversation to date\b/.test(b)||/<summary>[\s\S]*<\/summary>/.test(b))||/##\s+SESSION INTENT\b/.test(b))}(a))}),d=new Set;for(let a of c){if("tool"!==a.type)continue;let b=a.tool_call_id;b&&d.add(b)}let e=new Map;for(let a of aI)e.set(a.name,(e.get(a.name)??0)+1);c.forEach(b=>{if("ai"===b.type){let c,f=(c=[],b.additional_kwargs?.tool_calls&&Array.isArray(b.additional_kwargs.tool_calls)?c.push(...b.additional_kwargs.tool_calls):b.tool_calls&&Array.isArray(b.tool_calls)?c.push(...b.tool_calls.filter(a=>""!==a.name)):Array.isArray(b.content)&&c.push(...b.content.filter(a=>"tool_use"===a.type)),c.map(a=>{let b=a.function?.arguments||a.args||a.input||{};return{id:a.id,name:a.function?.name||a.name||a.type||"",args:function(a){if(a&&"object"==typeof a)return a;if("string"!=typeof a)return{};try{let b=JSON.parse(a);return b&&"object"==typeof b?b:{}}catch{return{}}}(b)}})).filter(a=>"ToolSelectionResponse"!==a.name||W&&!Y).map((a,c)=>{let f=a.name||"unknown",g=a.id||`${b.id??"ai-message"}-tool-${c}-${f}`,h=e.get(f)??0,i=h>0&&!d.has(g);return i&&e.set(f,h-1),{id:g,name:f,args:a.args,status:i?"interrupted":"pending"}});a.set(b.id,{message:b,toolCalls:f})}else if("tool"===b.type){let c=b.tool_call_id;if(!c)return;for(let[,d]of a.entries()){let a=d.toolCalls.findIndex(a=>a.id===c);if(-1!==a){d.toolCalls[a]={...d.toolCalls[a],status:"completed",result:t3(b)};break}}}else"human"===b.type&&a.set(b.id,{message:b,toolCalls:[]})});let f=Array.from(a.values());return f.map((a,b)=>{let c=b>0?f[b-1].message:null;return{...a,showAvatar:a.message.type!==c?.type}})},[R,aI,Y,W,Q]),{value:aK}=dF(),aL=a=>{let b=a.content;if("string"==typeof b)return b.trim().length>0;if(Array.isArray(b))for(let a of b){let b=a?.text;if("string"==typeof b&&b.trim().length>0)return!0}return!1},aN=(0,aB.useMemo)(()=>{let a=[];for(let b of aJ)if("ai"===b.message.type&&b.toolCalls.length>0&&!aL(b.message)){let c=a[a.length-1];c?.kind==="action-group"?c.items.push(b):a.push({kind:"action-group",items:[b]})}else a.push({kind:"message",data:b});return a},[aJ]),aO=aJ.length>0?aJ[aJ.length-1].message.id:void 0,aP=(0,aB.useMemo)(()=>{if(!ac)return null;let a=new Set(aJ.map(a=>a.message.id));for(let b=ac.cutoffIndex;b<R.length;b++){let c=R[b]?.id;if(null!=c&&a.has(c))return c}return null},[ac,R,aJ]),aQ={in_progress:S.filter(a=>"in_progress"===a.status),pending:S.filter(a=>"pending"===a.status),completed:S.filter(a=>"completed"===a.status)},aR=S.length>0,aS=Object.keys(T).length>0,[aT,aU]=(0,aB.useState)(()=>new Set);(0,aB.useEffect)(()=>{0===aI.length&&aU(new Set)},[aI.length]);let aV=(0,aB.useCallback)(a=>{aU(b=>{let c=new Set(b);return c.add(a),c})},[]),aW=(0,aB.useMemo)(()=>{let a=Y?.value&&Y.value.review_configs;if(!Array.isArray(a))return new Map;let b=[];for(let c of a){let a=c.actionName??c.action_name;a&&b.push([a,{actionName:a,allowedDecisions:c.allowedDecisions??c.allowed_decisions}])}return new Map(b)},[Y]);return(0,aA.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,aA.jsx)(de,{open:H,onOpenChange:I,children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Enable Auto-approve?"}),(0,aA.jsx)(dl,{children:"EvoScientist will run tool actions in this research without asking you to review each one. Turn this on only when you trust the current task and deployment."})]}),(0,aA.jsxs)("div",{className:"flex items-start gap-3 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100",children:[(0,aA.jsx)(uj,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),(0,aA.jsx)("p",{children:"Auto-approve stays on for this research only — it follows this conversation across views and reloads, and other research keeps its own setting. Turn it off here anytime."})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>I(!1),children:"Cancel"}),(0,aA.jsx)(dy,{onClick:ap,className:"bg-amber-600 text-white hover:bg-amber-700",children:"Enable Auto-approve"})]})]})}),(0,aA.jsx)(Ds,{path:B,onClose:()=>C(null)}),(0,aA.jsx)(Dz,{path:D,onClose:()=>E(null)}),(0,aA.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",ref:M,children:(0,aA.jsx)("div",{className:"mx-auto w-full max-w-[960px] px-4 pb-4 pt-3 sm:px-5",ref:N,children:X?(0,aA.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,aA.jsx)("p",{className:"text-muted-foreground",children:"Loading…"})}):(0,aA.jsxs)(aA.Fragment,{children:[0===aJ.length&&!W&&(0,aA.jsxs)("div",{className:"flex min-h-[42vh] flex-col items-center justify-center px-3 text-center",children:[(0,aA.jsx)("h2",{className:"text-pretty text-lg font-semibold sm:text-xl",children:"Start Research"}),(0,aA.jsx)("p",{className:"mt-2 max-w-lg text-sm text-muted-foreground",children:"Ask EvoScientist to review literature, inspect workspace files, or plan the next experiment."}),(0,aA.jsx)("div",{className:"mt-4 flex max-w-2xl flex-wrap justify-center gap-2",children:DA.map(a=>(0,aA.jsx)("button",{type:"button",onClick:()=>aE(a),className:"max-w-full rounded-full border border-border bg-card px-2.5 py-1.5 text-xs text-foreground shadow-sm transition-colors hover:border-[var(--color-border)] hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring sm:text-sm",children:a},a))})]}),aN.map((b,c)=>{if("action-group"===b.kind){let d=b.items[b.items.length-1].message.id,e=c===aN.length-1,f=W&&e&&d===aO;return(0,aA.jsx)(CT,{items:b.items,isStreaming:f,defaultCollapsed:aK,isAtBottom:P,lastMessageId:aO,isLoading:W,actionRequests:aI,submittedActionRequestKeys:aT,onActionRequestSubmitted:aV,reviewConfigsMap:aW,stream:Q,onResumeInterrupt:_,graphId:a?.graph_id,onEditMessage:aD,autoApprove:F,subAgentSteps:ak,ui:U,compactionAnchorId:aP,summarizationEvent:ac??null},`action-group-${b.items[0].message.id}`)}let d=b.data,e=U?.filter(a=>a.metadata?.message_id===d.message.id),f=c===aN.length-1,g="human"!==d.message.type,h=aP===d.message.id;return(0,aA.jsxs)(aB.default.Fragment,{children:[h&&ac&&(0,aA.jsx)(CS,{content:ac.content,summarizedCount:ac.cutoffIndex}),(0,aA.jsx)(CQ,{message:d.message,toolCalls:d.toolCalls,isLoading:W,isStreaming:W&&f&&g,actionRequests:f?aI:void 0,submittedActionRequestKeys:aT,onActionRequestSubmitted:aV,reviewConfigsMap:f?aW:void 0,ui:e,stream:Q,onResumeInterrupt:_,graphId:a?.graph_id,onEditMessage:aD,autoApprove:F,subAgentSteps:ak})]},d.message.id)}),ac&&!aP&&(0,aA.jsx)(CS,{content:ac.content,summarizedCount:ac.cutoffIndex}),aF&&(0,aA.jsx)("div",{className:"mt-4",children:(0,aA.jsx)(CW,{questions:aF,onSubmit:aG,onCancel:aH,isLoading:W})})]})})}),(0,aA.jsxs)("div",{className:"flex-shrink-0 bg-background",children:[v.length>0&&(0,aA.jsx)("div",{"aria-label":"Queued messages",className:"relative mx-auto -mb-4 w-[calc(100%-16px)] max-w-[960px] px-2 sm:w-[calc(100%-24px)]",children:(0,aA.jsx)("div",{className:"rounded-b-lg rounded-t-2xl border border-border bg-background pb-5 pt-1 shadow-sm",children:v.map((a,b)=>{let c=p.trim().length>0||r.length>0;return(0,aA.jsxs)("div",{onDragOver:a=>a.preventDefault(),onDrop:()=>ax(a.id),className:"relative flex min-h-11 items-start gap-1.5 px-2 py-2 text-sm sm:gap-2 sm:px-3",children:[(0,aA.jsx)("button",{type:"button",draggable:!0,onDragStart:b=>{z.current=a.id,b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("text/plain",String(a.id))},onDragEnd:()=>{z.current=null},onKeyDown:c=>{"ArrowUp"===c.key&&b>0&&(c.preventDefault(),aw(a.id,-1)),"ArrowDown"===c.key&&b<v.length-1&&(c.preventDefault(),aw(a.id,1))},"aria-label":`Reorder queued message ${b+1} of ${v.length}`,title:"Drag to reorder, or use the arrow keys",className:"mt-0.5 inline-flex size-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground/60 focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing",children:(0,aA.jsx)(ec,{className:"size-3.5","aria-hidden":"true"})}),(0,aA.jsx)(ul,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,aA.jsx)("span",{className:"line-clamp-2 whitespace-pre-wrap break-words pt-0.5 text-foreground",children:a.text}),a.files.length>0&&(0,aA.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,aA.jsx)(uk,{className:"size-3 shrink-0","aria-hidden":"true"}),a.files.length," file",1===a.files.length?"":"s"]})]}),(0,aA.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>av(a.id),"aria-label":"Steer with this message next",title:"Submit next without interrupting the current turn",className:"inline-flex h-7 items-center gap-1 rounded-full px-2 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)(ul,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"Steer"})]}),(0,aA.jsx)("button",{type:"button",onClick:()=>ay(a.id),"aria-label":"Remove queued message",title:"Remove from queue",className:"inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(fq,{className:"size-3.5","aria-hidden":"true"})}),(0,aA.jsxs)("details",{className:"group/menu relative",onBlur:a=>{a.currentTarget.contains(a.relatedTarget)||a.currentTarget.removeAttribute("open")},onKeyDown:a=>{"Escape"===a.key&&(a.currentTarget.removeAttribute("open"),a.currentTarget.querySelector("summary")?.focus())},children:[(0,aA.jsx)("summary",{"aria-label":"More queued message actions",title:"More actions",className:"inline-flex size-7 cursor-pointer list-none items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:(0,aA.jsx)(um,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("div",{className:"absolute right-0 top-8 z-30 min-w-40 rounded-xl border border-border bg-background p-1.5 shadow-lg",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>au(a.id),disabled:c,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:[(0,aA.jsx)(fl,{className:"size-4","aria-hidden":"true"}),"Edit message"]}),(0,aA.jsxs)("button",{type:"button",onClick:az,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)(un,{className:"size-4","aria-hidden":"true"}),"Close queue"]})]})]})]})]},a.id)})})}),(0,aA.jsxs)("div",{className:dd("relative z-10 mx-auto mb-2 flex w-[calc(100%-16px)] max-w-[960px] flex-shrink-0 flex-col overflow-hidden rounded-xl border border-border bg-background transition-colors duration-200 ease-in-out sm:mb-4 sm:w-[calc(100%-24px)]","focus-within:ring-2 focus-within:ring-ring"),children:[(0,aA.jsxs)("div",{className:"flex max-h-60 flex-col overflow-y-auto border-b border-border bg-sidebar empty:hidden sm:max-h-72",children:[!k&&(0,aA.jsx)(aA.Fragment,{children:(d=S.find(a=>"in_progress"===a.status),f=(e=S.length)-aQ.pending.length,g=e===f,h=aR?(0,aA.jsx)("button",{type:"button",onClick:()=>l(a=>"tasks"===a?null:"tasks"),className:"grid w-full cursor-pointer grid-cols-[auto_auto_1fr] items-center gap-2.5 px-3 py-2.5 text-left sm:px-4","aria-expanded":"tasks"===k,children:g?[(0,aA.jsx)(uc,{size:16,className:"text-[var(--color-success)]"},"icon"),(0,aA.jsx)("span",{className:"ml-[1px] min-w-0 truncate text-sm",children:"All tasks completed"},"label")]:null!=d?[(0,aA.jsx)("div",{children:DC(d.status)},"icon"),(0,aA.jsxs)("span",{className:"ml-[1px] min-w-0 truncate text-sm",children:["Task"," ",e-aQ.pending.length," ","of ",e]},"label"),(0,aA.jsx)("span",{className:"min-w-0 gap-2 truncate text-sm text-muted-foreground",children:d.content},"content")]:[(0,aA.jsx)(ue,{size:16,className:"text-[var(--color-text-tertiary)]"},"icon"),(0,aA.jsxs)("span",{className:"ml-[1px] min-w-0 truncate text-sm",children:["Task"," ",e-aQ.pending.length," of"," ",e]},"label")]}):null,i=aS?(0,aA.jsxs)("button",{type:"button",onClick:()=>l(a=>"files"===a?null:"files"),className:"flex flex-shrink-0 cursor-pointer items-center gap-2 px-3 py-2.5 text-left text-sm sm:px-4","aria-expanded":"files"===k,children:[(0,aA.jsx)(uf,{size:16}),"Files (State)",(0,aA.jsx)("span",{className:"h-4 min-w-4 rounded-full bg-[var(--brand-solid)] px-0.5 text-center text-[10px] leading-[16px] text-[var(--brand-foreground)]",children:Object.keys(T).length})]}):null,j=(0,aA.jsxs)("button",{type:"button",onClick:()=>l(a=>"workspace"===a?null:"workspace"),className:"flex flex-shrink-0 cursor-pointer items-center gap-2 px-3 py-2.5 text-left text-sm sm:px-4","aria-expanded":"workspace"===k,"aria-label":"Open workspace",children:[(0,aA.jsx)(ug,{size:16,"aria-hidden":"true"}),(0,aA.jsx)("span",{children:"Workspace"})]}),(0,aA.jsxs)("div",{className:"flex items-center",children:[(0,aA.jsx)("div",{className:"min-w-0 flex-1",children:h}),i,j]}))}),k&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)("div",{className:"sticky top-0 flex items-stretch bg-sidebar text-sm",children:[aR&&(0,aA.jsx)("button",{type:"button",className:"py-2.5 pr-4 first:pl-3 aria-expanded:font-semibold sm:first:pl-4",onClick:()=>l(a=>"tasks"===a?null:"tasks"),"aria-expanded":"tasks"===k,children:"Tasks"}),aS&&(0,aA.jsxs)("button",{type:"button",className:"inline-flex items-center gap-2 py-2.5 pr-4 first:pl-3 aria-expanded:font-semibold sm:first:pl-4",onClick:()=>l(a=>"files"===a?null:"files"),"aria-expanded":"files"===k,children:["Files (State)",(0,aA.jsx)("span",{className:"h-4 min-w-4 rounded-full bg-[var(--brand-solid)] px-0.5 text-center text-[10px] leading-[16px] text-[var(--brand-foreground)]",children:Object.keys(T).length})]}),(0,aA.jsx)("button",{type:"button",className:"inline-flex items-center gap-2 py-2.5 pr-4 first:pl-3 aria-expanded:font-semibold sm:first:pl-4",onClick:()=>l(a=>"workspace"===a?null:"workspace"),"aria-expanded":"workspace"===k,children:"Workspace"}),(0,aA.jsx)("button",{"aria-label":"Close",className:"flex-1",onClick:()=>l(null)})]}),(0,aA.jsxs)("div",{ref:m,className:"px-3 sm:px-4",children:["tasks"===k&&Object.entries(aQ).filter(([a,b])=>b.length>0).map(([a,b])=>(0,aA.jsxs)("div",{className:"mb-4",children:[(0,aA.jsx)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-tertiary",children:{pending:"Pending",in_progress:"In Progress",completed:"Completed"}[a]}),(0,aA.jsx)("div",{className:"grid grid-cols-[auto_1fr] gap-3 rounded-sm p-1 pl-0 text-sm",children:b.map((b,c)=>(0,aA.jsxs)(aB.Fragment,{children:[DC(b.status,"mt-0.5"),(0,aA.jsx)("span",{className:"break-words text-inherit",children:b.content})]},`${a}_${b.id}_${c}`))})]},a)),"files"===k&&(0,aA.jsx)("div",{className:"mb-6",children:(0,aA.jsx)(Dh,{files:T,setFiles:V,editDisabled:!0===W||void 0!==Y})}),"workspace"===k&&(0,aA.jsx)("div",{className:"mb-6 pt-2",children:(0,aA.jsx)(Dy,{})})]})]})]}),F&&(0,aA.jsxs)("div",{"aria-live":"polite",className:"flex items-center justify-between gap-3 border-b border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100",children:[(0,aA.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,aA.jsx)(uj,{className:"size-3.5 shrink-0","aria-hidden":"true"}),"Tool actions will run without review."]}),(0,aA.jsx)("button",{type:"button",onClick:aq,className:"shrink-0 rounded px-2 py-1 font-semibold transition-colors hover:bg-amber-200 focus-visible:ring-2 focus-visible:ring-amber-700 dark:hover:bg-amber-900",children:"Turn Off"})]}),(aj||ae>0)&&(0,aA.jsxs)("div",{className:"flex items-center gap-1.5 border-t border-border px-3 py-1.5 text-xs text-muted-foreground",children:[aj&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(ui,{className:"size-3.5 shrink-0 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"font-medium text-foreground",children:aj.name}),aj.provider&&(0,aA.jsxs)("span",{children:["· ",aj.provider]})]}),ae>0&&(0,aA.jsxs)("button",{type:"button",onClick:b,title:`${ae} background agent${1===ae?"":"s"} running — click to view`,"aria-label":`${ae} background agent${1===ae?"":"s"} running — view`,className:"ml-auto flex shrink-0 items-center gap-1.5 rounded px-1.5 py-0.5 font-medium text-[var(--brand)] transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)("span",{className:"size-2 animate-pulse rounded-full bg-[var(--color-warning)]","aria-hidden":"true"}),ae," agent",1===ae?"":"s"]})]}),(0,aA.jsxs)("form",{onSubmit:at,className:"flex flex-col",children:[r.length>0&&(0,aA.jsx)("div",{"aria-label":"Attached files",className:"flex flex-wrap gap-2 border-b border-border px-3 py-2",children:r.map(a=>(0,aA.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1 text-xs text-foreground",children:[(0,aA.jsx)(uf,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"max-w-48 truncate",title:a.path,children:a.name}),(0,aA.jsx)("button",{type:"button",onClick:()=>as(a.path),"aria-label":`Remove ${a.name} from this message`,title:`Remove ${a.name} from this message`,className:"rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(cA,{className:"size-3.5","aria-hidden":"true"})})]},a.path))}),(0,aA.jsx)("textarea",{ref:n,value:p,onChange:a=>q(a.target.value),onKeyDown:aC,"aria-label":"Message",disabled:am,placeholder:am?"Respond to the request above to continue…":W?"Queue a follow-up — sends when this turn finishes…":"Ask EvoScientist anything…",className:"font-inherit field-sizing-content flex-1 resize-none border-0 bg-transparent px-3.5 pb-2.5 pt-3 text-sm leading-6 text-primary outline-none placeholder:text-tertiary disabled:cursor-not-allowed sm:px-4",rows:1}),(0,aA.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 sm:p-2.5",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-1",children:[(0,aA.jsx)("input",{ref:o,type:"file",multiple:!0,onChange:ar,disabled:!a||am||t,className:"hidden"}),(0,aA.jsx)("button",{type:"button",onClick:()=>o.current?.click(),disabled:!a||am||t,"aria-label":"Upload files to workspace",title:"Upload files to workspace (max 50 MB each)",className:"inline-flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:(0,aA.jsx)(uk,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("button",{type:"button",onClick:()=>F?aq():I(!0),"aria-pressed":F,title:"Auto-approve all tool actions in this conversation",className:dd("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors",F?"bg-amber-600 text-white hover:bg-amber-700":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[(0,aA.jsx)(uh,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden min-[360px]:inline",children:F?"Auto-approve On":"Auto-approve"})]})]}),(0,aA.jsx)("div",{className:"flex justify-end gap-2",children:(0,aA.jsx)(dy,{type:W?"button":"submit",variant:W?"destructive":"default",onClick:W?$:at,disabled:!W&&(an||t||!p.trim()),"aria-label":W?"Stop generating":"Send message",children:W?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(ua,{size:14}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"Stop"})]}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(ub,{size:18}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"Send"})]})})})]})]})]})]})]})});DD.displayName="ChatInterface";let DE=cz("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),DF=cz("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),DG=cz("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),DH=aB.default.memo(({skill:a,onClose:b})=>{let[c,d]=(0,aB.useState)(null),[e,f]=(0,aB.useState)(!1),[g,h]=(0,aB.useState)(null);if((0,aB.useEffect)(()=>{if(!a)return;let b=!1;return d(null),h(null),f(!0),fetch(`/api/skills/detail?name=${encodeURIComponent(a.name)}`).then(async a=>{let b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error||`Failed to load (${a.status})`);return b}).then(a=>{b||d(a)}).catch(a=>{b||h(a.message??"Failed to load skill detail.")}).finally(()=>{b||f(!1)}),()=>{b=!0}},[a]),!a)return null;let i=c?.title??a.title,j=c?.version??a.version,k=c?.description??a.description,l=c?.installed??a.installed,m=c?.body;return(0,aA.jsx)(de,{open:!0,onOpenChange:b,children:(0,aA.jsxs)(dh,{"aria-describedby":void 0,className:"flex h-[80vh] max-h-[80vh] min-w-[60vw] flex-col p-6",children:[(0,aA.jsx)(dk,{className:"sr-only",children:i}),(0,aA.jsxs)("div",{className:"mb-3 flex items-start gap-3 border-b border-border pb-4",children:[(0,aA.jsx)(fo,{className:"mt-1 size-6 shrink-0 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("div",{className:"min-w-0 flex-1",children:(0,aA.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,aA.jsx)("h2",{className:"break-words text-lg font-semibold",children:i}),j&&(0,aA.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:["v",j]}),null!=a.fileCount&&(0,aA.jsxs)("span",{className:"text-xs text-muted-foreground",children:["· ",a.fileCount," file",1===a.fileCount?"":"s"]}),l&&(0,aA.jsxs)("span",{className:"bg-[var(--brand)]/10 inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium text-[var(--brand)]",children:[(0,aA.jsx)(DG,{className:"size-3","aria-hidden":"true"}),"Installed"]})]})})]}),(0,aA.jsx)(f_,{className:"min-h-0 flex-1",children:(0,aA.jsxs)("div",{className:"pr-3",children:[(0,aA.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-foreground",children:k||"No description."}),(0,aA.jsx)("div",{className:"mt-4 border-t border-border pt-4",children:e?(0,aA.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading skill contents…"]}):g?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:g}):m?(0,aA.jsx)(CB,{content:m}):(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"No additional contents."})})]})})]})})});function DI(){let[a,b]=(0,aB.useState)([]),[c,d]=(0,aB.useState)([]),[e,f]=(0,aB.useState)(!0),[g,h]=(0,aB.useState)(null),[i,j]=(0,aB.useState)(null),[k,l]=(0,aB.useState)({}),[m,n]=(0,aB.useState)(null),[o,p]=(0,aB.useState)(null),q=(0,aB.useCallback)(async(a=!1)=>{f(!0),j(null),h(null);let[c,e]=await Promise.allSettled([fetch(`/api/skills/catalog${a?"?refresh=1":""}`).then(async a=>{let b=await a.json();if(!a.ok)throw Error(b.error||"Failed to load catalog");return b.skills??[]}),fetch("/api/skills").then(async a=>{let b=await a.json();if(!a.ok)throw Error(b.error||"Failed to load skills");return b.skills??[]})]),g="fulfilled"===c.status?c.value:[];if("rejected"===c.status&&h(c.reason instanceof Error?c.reason.message:"Failed to load the official catalog."),b(g),"fulfilled"===e.status){let a=new Set(g.map(a=>a.name));d(e.value.filter(b=>!a.has(b.name)))}else d([]),j(e.reason instanceof Error?e.reason.message:"Failed to load installed skills.");f(!1)},[]);(0,aB.useEffect)(()=>{q()},[q]);let r=async(a,c="install")=>{l(b=>({...b,[a]:c})),j(null);try{let c=await fetch("/api/skills/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),d=await c.json();if(!c.ok)throw Error(d.error||"Failed to install");b(b=>b.map(b=>b.name===a?{...b,installed:!0,updateAvailable:!1,installedVersion:b.latestVersion??b.installedVersion}:b))}catch(a){j(a instanceof Error?a.message:`Failed to ${c}`)}finally{l(b=>{let c={...b};return delete c[a],c})}},s=async(a,c)=>{l(b=>({...b,[a]:"uninstall"})),j(null);try{let e=await fetch(`/api/skills?name=${encodeURIComponent(a)}`,{method:"DELETE"});if(!e.ok){let a=await e.json();throw Error(a.error||"Failed to uninstall")}c?b(b=>b.map(b=>b.name===a?{...b,installed:!1}:b)):d(b=>b.filter(b=>b.name!==a))}catch(a){j(a instanceof Error?a.message:"Failed to uninstall")}finally{l(b=>{let c={...b};return delete c[a],c})}},t=async()=>{o&&(p(null),await s(o.name,o.isCatalog))};return(0,aA.jsxs)("div",{className:"h-full overflow-y-auto",children:[(0,aA.jsxs)("div",{className:"mx-auto max-w-[960px] px-4 py-5 sm:px-5 sm:py-6",children:[(0,aA.jsxs)("header",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,aA.jsxs)("div",{children:[(0,aA.jsx)("h2",{className:"text-xl font-semibold sm:text-2xl",children:"Research Skills"}),(0,aA.jsxs)("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:["Install official skills from the"," ",(0,aA.jsx)("a",{href:"https://github.com/EvoScientist/EvoSkills",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"EvoSkills"})," ","catalog, or remove ones you don't need."]})]}),(0,aA.jsx)("button",{type:"button",onClick:()=>q(!0),disabled:e,"aria-label":"Refresh",className:"rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(DE,{className:e?"size-4 animate-spin":"size-4","aria-hidden":"true"})})]}),i&&(0,aA.jsx)("p",{role:"alert",className:"mb-4 text-sm text-destructive",children:i}),e?(0,aA.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground","aria-live":"polite",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading skills…"]}):(0,aA.jsxs)("div",{className:"space-y-6",children:[(0,aA.jsxs)("section",{children:[(0,aA.jsx)("h3",{className:"mb-2.5 text-xs font-semibold uppercase tracking-wider text-tertiary",children:"Official catalog"}),g?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:g}):0===a.length?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"No skills found in the catalog."}):(0,aA.jsx)("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2",children:a.map(a=>(0,aA.jsx)(DJ,{title:a.title,description:a.description,meta:`${a.fileCount} file${1===a.fileCount?"":"s"}`,installed:a.installed,installedVersion:a.installedVersion,latestVersion:a.latestVersion,updateAvailable:a.updateAvailable,busy:k[a.name],onOpen:()=>n({name:a.name,title:a.title,description:a.description,version:a.installed?a.installedVersion:a.latestVersion,fileCount:a.fileCount,installed:a.installed}),onInstall:()=>r(a.name),onUpdate:()=>r(a.name,"update"),onUninstall:()=>p({name:a.name,title:a.title,isCatalog:!0})},a.name))})]}),c.length>0&&(0,aA.jsxs)("section",{children:[(0,aA.jsx)("h3",{className:"mb-2.5 text-xs font-semibold uppercase tracking-wider text-tertiary",children:"Other installed skills"}),(0,aA.jsx)("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2",children:c.map(a=>(0,aA.jsx)(DJ,{title:a.title,description:a.description,installed:!0,busy:k[a.name],onOpen:()=>n({name:a.name,title:a.title,description:a.description,installed:!0}),onUninstall:()=>p({name:a.name,title:a.title,isCatalog:!1})},a.name))})]})]})]}),(0,aA.jsx)(DH,{skill:m,onClose:()=>n(null)}),(0,aA.jsx)(de,{open:null!==o,onOpenChange:a=>{a||p(null)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Uninstall skill?"}),(0,aA.jsxs)(dl,{children:["“",o?.title??o?.name,"” will be removed from this Web UI. You can install it again later."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>p(null),children:"Cancel"}),(0,aA.jsx)(dy,{onClick:t,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Uninstall"})]})]})})]})}function DJ({title:a,description:b,meta:c,installed:d,installedVersion:e,latestVersion:f,updateAvailable:g,busy:h,onOpen:i,onInstall:j,onUpdate:k,onUninstall:l}){let m=d?e&&`v${e}`:f&&`v${f}`;return(0,aA.jsxs)("div",{className:"flex flex-col rounded-lg border border-border bg-card p-3",children:[(0,aA.jsxs)("button",{type:"button",onClick:i,className:"-m-1 flex items-start gap-2.5 rounded-md p-1 text-left transition-colors hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring",title:"View details",children:[(0,aA.jsx)(fo,{className:"mt-0.5 size-5 shrink-0 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,aA.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,aA.jsx)("h3",{className:"break-words text-lg font-medium leading-tight",children:a}),m&&(0,aA.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:m}),c&&(0,aA.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["· ",c]})]}),(0,aA.jsx)("p",{className:"mt-1 line-clamp-2 text-sm leading-6 text-muted-foreground",children:b||"No description."})]})]}),(0,aA.jsxs)("div",{className:"mt-2.5 flex items-center justify-end gap-2",children:[d&&g&&(0,aA.jsxs)("button",{type:"button",onClick:k,disabled:!!h,className:"inline-flex items-center gap-1.5 rounded-md bg-[var(--brand-solid)] px-2.5 py-1 text-xs font-medium text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",title:f?`Update to v${f}`:"Update",children:["update"===h?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(DF,{className:"size-3.5","aria-hidden":"true"}),"update"===h?"Updating…":f?`Update → v${f}`:"Update"]}),d?(0,aA.jsxs)("button",{type:"button",onClick:l,disabled:!!h,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-muted-foreground transition-colors hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:["uninstall"===h?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(fq,{className:"size-3.5","aria-hidden":"true"}),"uninstall"===h?"Removing…":"Uninstall"]}):(0,aA.jsxs)("button",{type:"button",onClick:j,disabled:!!h,className:"inline-flex items-center gap-1.5 rounded-md bg-[var(--brand-solid)] px-2.5 py-1 text-xs font-medium text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:["install"===h?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(fi,{className:"size-3.5","aria-hidden":"true"}),"install"===h?"Installing…":"Install"]})]})]})}DH.displayName="SkillDetailDialog";let DK=cz("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),DL=cz("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),DM={json:"json",yaml:"yaml",yml:"yaml",csv:"text",tsv:"text",log:"text",txt:"text",tex:"latex",bib:"latex",rst:"markdown"},DN=["Core memory","Profile","Projects","Evolution reports"];function DO(a){let b=a.lastIndexOf("/");return b>=0?a.slice(0,b):""}function DP(a){return a.split("/").pop()||a}function DQ(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}function DR(a,b){return Math.min(Math.max(a,200),b?Math.max(280,b.clientWidth-360):640)}function DS(){var a;let b,[c,d]=(0,aB.useState)(null),[e,f]=(0,aB.useState)(!0),[g,h]=(0,aB.useState)(null),[i,j]=(0,aB.useState)(null),[k,l]=(0,aB.useState)(null),[m,n]=(0,aB.useState)(!1),[o,p]=(0,aB.useState)(null),[q,r]=(0,aB.useState)(!1),[s,t]=(0,aB.useState)(""),[u,v]=(0,aB.useState)(!1),[w,x]=(0,aB.useState)(!1),[y,z]=(0,aB.useState)(!1),[A,B]=(0,aB.useState)(""),[C,D]=(0,aB.useState)(!1),[E,F]=(0,aB.useState)(null),[G,H]=(0,aB.useState)(!1),[I,J]=(0,aB.useState)(!1),[K,L]=(0,aB.useState)(!1),M=(0,aB.useRef)(!1),N=(0,aB.useRef)(0),O=(0,aB.useRef)(null),P=function(){let[a,b]=(0,aB.useState)(!1);return(0,aB.useEffect)(()=>{let a=window.matchMedia("(min-width: 768px)"),c=()=>b(a.matches);return c(),a.addEventListener("change",c),()=>a.removeEventListener("change",c)},[]),a}(),Q=(0,aB.useRef)(null),R=(0,aB.useRef)(null),S=(0,aB.useRef)(null),[T,U]=(0,aB.useState)(()=>256);(0,aB.useEffect)(()=>{try{window.localStorage.setItem("evoscientist-memory-list-width",String(T))}catch{}},[T]);let V=(0,aB.useCallback)(a=>{if(Q.current=a,S.current?.disconnect(),S.current=null,a&&"u">typeof ResizeObserver){let b=new ResizeObserver(()=>{window.matchMedia("(min-width: 768px)").matches&&U(b=>DR(b,a))});b.observe(a),S.current=b}},[]);(0,aB.useEffect)(()=>()=>R.current?.(),[]);let W=(0,aB.useCallback)(a=>{a.preventDefault(),R.current?.();let b=a.clientX,c=new AbortController,d=()=>{c.abort(),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select"),R.current=null},e={signal:c.signal};window.addEventListener("pointermove",a=>{U(DR(T+(a.clientX-b),Q.current))},e),window.addEventListener("pointerup",d,e),window.addEventListener("pointercancel",d,e),window.addEventListener("blur",d,e),document.body.style.cursor="col-resize",document.body.style.userSelect="none",R.current=d},[T]),X=(0,aB.useCallback)(async()=>{f(!0),h(null);try{let a=await fetch("/api/memory"),b=await a.json();if(!a.ok)throw Error(b.error||"Failed to load memory.");d(b);let c=b.entries.reduce((a,b)=>b.mtime>a?b.mtime:a,0);c>0&&jC(c)}catch(a){h(a instanceof Error?a.message:"Failed to load memory.")}finally{f(!1)}},[]);(0,aB.useEffect)(()=>{X()},[X]);let[Y,Z]=(0,aB.useState)(()=>Date.now());(0,aB.useEffect)(()=>{let a=setInterval(()=>Z(Date.now()),6e4);return()=>clearInterval(a)},[]);let $=(0,aB.useMemo)(()=>{let a=c?.entries??[],b=new Map;for(let c of a){let a=function(a){let b=a.split("/");return"profile"===b[0]?"projects"===b[1]?"Projects":"Profile":"evolution-reports"===b[0]?"Evolution reports":1===b.length?"Core memory":b[0]}(c.path);(b.get(a)??b.set(a,[]).get(a)).push(c)}return[...b.keys()].sort((a,b)=>{let c=DN.indexOf(a),d=DN.indexOf(b);return -1!==c||-1!==d?(-1===c?99:c)-(-1===d?99:d):a.localeCompare(b)}).map(a=>({name:a,files:b.get(a).sort((a,b)=>a.path.localeCompare(b.path))}))},[c]),_=(0,aB.useCallback)(async a=>{let b=++N.current;j(a),r(!1),l(null),p(null),n(!0);try{let c=await fetch(`/api/memory?path=${encodeURIComponent(a)}`),d=await c.json();if(b!==N.current)return;if(!c.ok)throw Error(d.error||"Failed to open file.");l(d)}catch(a){if(b!==N.current)return;p(a instanceof Error?a.message:"Failed to open file.")}finally{b===N.current&&n(!1)}},[]);(0,aB.useEffect)(()=>{if(M.current||i)return;let a=$[0]?.files[0];a&&(M.current=!0,_(a.path))},[$,i,_]);let aa=async()=>{if(!i)return;let a=N.current;v(!0),p(null);try{let b=await fetch("/api/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i,content:s})}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to save.");a===N.current&&(l(c),r(!1)),X()}catch(b){a===N.current&&p(b instanceof Error?b.message:"Failed to save.")}finally{v(!1)}},ab=async()=>{if(!i)return;let a=N.current;J(!0);try{let b=await fetch(`/api/memory?path=${encodeURIComponent(i)}`,{method:"DELETE"});if(!b.ok){let a=await b.json().catch(()=>null);throw Error(a?.error||"Failed to delete.")}a===N.current&&(j(null),l(null),r(!1)),H(!1),X()}catch(b){a===N.current&&p(b instanceof Error?b.message:"Failed to delete.")}finally{J(!1)}},ac=async()=>{k&&await Cg(k.content)&&(x(!0),setTimeout(()=>x(!1),1500))},ad=async()=>{let a=A.trim();if(!a)return void F("Enter a file name.");/\.[A-Za-z0-9]+$/.test(a)||(a+=".md"),D(!0),F(null);try{let b=await fetch("/api/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a,content:`# ${DP(a).replace(/\.[^.]+$/,"")}
165
165
 
166
- `})}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to create file.");z(!1),B(""),await X(),await _(c.path),t(c.content),r(!0)}catch(a){F(a instanceof Error?a.message:"Failed to create file.")}finally{D(!1)}},ae=q&&null!=k&&s!==k.content,af=a=>{ae?(O.current=a,L(!0)):a()},ag=i&&(b=(a=DE(i)).lastIndexOf("."))>=0?a.slice(b+1).toLowerCase():"";return(0,aA.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,aA.jsxs)("header",{className:"flex flex-shrink-0 items-start justify-between gap-3 border-b border-border px-4 py-3 sm:px-5",children:[(0,aA.jsxs)("div",{className:"min-w-0",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-2",children:[(0,aA.jsx)(fh,{className:"size-5 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("h2",{className:"text-xl font-semibold",children:"EvoMemory"})]}),(0,aA.jsxs)("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-muted-foreground",children:["EvoScientist's"," ",(0,aA.jsx)("span",{className:"font-medium text-[var(--brand)]",children:"self-evolving memory system"})," ","— it continuously learns and refines what it knows about you, your research taste, and lessons from past experiments, updating itself after every turn. View or edit it directly."]})]}),(0,aA.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1.5",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>{B(""),F(null),z(!0)},"aria-label":"New memory file",title:"New memory file",className:"inline-flex items-center gap-1.5 rounded-md bg-[var(--brand-solid)] px-2.5 py-1.5 text-xs font-medium text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)(DA,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"New"})]}),(0,aA.jsx)("button",{type:"button",onClick:X,disabled:e,"aria-label":"Refresh",className:"rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(Dt,{className:e?"size-4 animate-spin":"size-4","aria-hidden":"true"})})]})]}),g?(0,aA.jsx)("div",{className:"flex flex-1 items-center justify-center p-8",children:(0,aA.jsx)("p",{className:"text-sm text-destructive",children:g})}):e&&!c?(0,aA.jsxs)("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading memory…"]}):c&&!c.exists||c&&0===c.entries.length?(0,aA.jsx)(DI,{dir:c.dir}):(0,aA.jsxs)("div",{ref:V,className:"flex min-h-0 flex-1",children:[(0,aA.jsx)("aside",{className:dd("w-full flex-col md:flex md:flex-shrink-0",i?"hidden md:flex":"flex"),style:P?{width:T}:void 0,children:(0,aA.jsx)(f_,{className:"h-0 flex-1",children:(0,aA.jsxs)("div",{className:"p-1.5",children:[$.map(a=>(0,aA.jsxs)("div",{className:"mb-2.5",children:[(0,aA.jsx)("h4",{className:"px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:a.name}),(0,aA.jsx)("div",{className:"flex flex-col",children:a.files.map(a=>{var b;let c=DD(a.path),d=a.path===i,e=(b=a.mtime,b>0&&Y-b<6e5),f=function(a,b){if(!a)return"";let c=Math.max(0,Math.round((b-a)/1e3));if(c<45)return"just now";let d=Math.round(c/60);if(d<60)return`${d}m ago`;let e=Math.round(d/60);return e<24?`${e}h ago`:`${Math.round(e/24)}d ago`}(a.mtime,Y);return(0,aA.jsxs)("button",{type:"button",onClick:()=>{af(()=>_(a.path))},className:dd("flex items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors focus-visible:ring-2 focus-visible:ring-ring",d?"bg-accent":"hover:bg-accent/60"),"aria-current":d,children:[e?(0,aA.jsx)("span",{className:"mt-1.5 size-2 shrink-0 rounded-full bg-[var(--brand)]",title:"Recently updated","aria-label":"Recently updated"}):(0,aA.jsx)(C1,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,aA.jsx)("span",{className:dd("block truncate text-sm font-medium",e&&"text-[var(--brand)]"),children:DE(a.path)}),(0,aA.jsxs)("span",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:[c&&(0,aA.jsx)("span",{className:"truncate",children:c}),(0,aA.jsx)("span",{className:"shrink-0 tabular-nums",children:DF(a.size)}),f&&(0,aA.jsxs)("span",{className:"shrink-0 tabular-nums",children:["· ",f]})]})]})]},a.path)})})]},a.name)),c?.truncated&&(0,aA.jsxs)("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:["Showing the first ",c.entries.length," files."]})]})})}),(0,aA.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerDown:W,className:"relative hidden w-px shrink-0 cursor-col-resize bg-border transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-2 after:-translate-x-1/2 hover:bg-[var(--brand)] md:block"}),(0,aA.jsx)("section",{className:dd("min-w-0 flex-1 flex-col",i?"flex":"hidden md:flex"),children:i?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)("div",{className:"flex flex-shrink-0 flex-wrap items-center gap-2 border-b border-border px-3 py-2 sm:px-4",children:[(0,aA.jsx)("button",{type:"button",onClick:()=>{af(()=>{j(null),l(null),r(!1)})},"aria-label":"Back to list",className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring md:hidden",children:(0,aA.jsx)(Dz,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,aA.jsx)("p",{className:"truncate text-sm font-medium",children:DE(i)}),k&&(0,aA.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[DD(i)&&`${DD(i)} \xb7 `,DF(k.size),k.mtime?` \xb7 ${function(a){if(!a)return"";try{return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(new Date(a))}catch{return""}}(k.mtime)}`:""]})]}),(0,aA.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:q?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{af(()=>r(!1))},disabled:u,"aria-label":"Cancel editing",children:[(0,aA.jsx)(Dd,{className:"mr-1 size-4"}),"Cancel"]}),(0,aA.jsxs)(dy,{size:"sm",className:"h-8 px-3",onClick:aa,disabled:u||!ae,"aria-label":"Save memory file",children:[u?(0,aA.jsx)(fj,{className:"mr-1 size-4 animate-spin"}):(0,aA.jsx)(C2,{className:"mr-1 size-4"}),u?"Saving…":"Save"]})]}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:ac,disabled:!k,"aria-label":w?"Copied memory content":"Copy memory content",title:w?"Copied memory content":"Copy memory content",children:w?(0,aA.jsx)(iq,{className:"size-4"}):(0,aA.jsx)(Ce,{className:"size-4"})}),(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{k&&(t(k.content),r(!0))},disabled:!k,"aria-label":"Edit memory file",children:[(0,aA.jsx)(fl,{className:"mr-1 size-4"}),"Edit"]}),(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-destructive",onClick:()=>H(!0),disabled:!k,"aria-label":"Delete memory file",title:"Delete memory file",children:(0,aA.jsx)(fq,{className:"size-4"})})]})})]}),o&&(0,aA.jsx)("p",{role:"alert",className:"px-4 py-2 text-sm text-destructive",children:o}),(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:m?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,aA.jsx)(fj,{className:"size-5 animate-spin text-muted-foreground"})}):q?(0,aA.jsx)("textarea",{value:s,onChange:a=>t(a.target.value),spellCheck:!1,"aria-label":"Memory file content",className:"h-full w-full resize-none bg-background p-4 font-mono text-sm leading-relaxed text-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",placeholder:"Write memory…"}):k?(0,aA.jsx)(f_,{className:"h-full",children:(0,aA.jsx)("div",{className:"mx-auto max-w-[780px] px-4 py-4 sm:px-6",children:0===k.content.trim().length?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"This file is empty."}):"md"===ag||"markdown"===ag?(0,aA.jsx)(Cr,{content:k.content}):(0,aA.jsx)(Cc,{language:DB[ag]||"text",style:Cd,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.85rem"},wrapLongLines:!0,children:k.content})})}):null})]}):(0,aA.jsx)("div",{className:"flex flex-1 items-center justify-center p-8",children:(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a memory file to view or edit."})})})]}),(0,aA.jsx)(de,{open:y,onOpenChange:a=>{C||z(a)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"New memory file"}),(0,aA.jsxs)(dl,{children:["Create a markdown file in the memory directory. Use a path like"," ",(0,aA.jsx)("code",{className:"font-mono text-xs",children:"notes/idea.md"})," to nest it."]})]}),(0,aA.jsx)(dD,{name:"memory-file-path",autoComplete:"off",spellCheck:!1,value:A,onChange:a=>B(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ad())},placeholder:"notes/research-idea.md…",disabled:C,"aria-invalid":!!E||void 0,"aria-describedby":E?"new-memory-error":void 0}),E&&(0,aA.jsx)("p",{id:"new-memory-error",role:"alert",className:"text-sm text-destructive",children:E}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>z(!1),disabled:C,children:"Cancel"}),(0,aA.jsx)(dy,{onClick:ad,disabled:C||!A.trim(),children:C?"Creating…":"Create"})]})]})}),(0,aA.jsx)(de,{open:G,onOpenChange:a=>{I||H(a)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Delete memory file?"}),(0,aA.jsx)(dl,{children:i?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("code",{children:i}),"will be permanently deleted. This can't be undone."]}):"This memory file will be permanently deleted."})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>H(!1),disabled:I,children:"Cancel"}),(0,aA.jsx)(dy,{onClick:ab,disabled:I||!i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:I?"Deleting…":"Delete"})]})]})}),(0,aA.jsx)(de,{open:K,onOpenChange:a=>{a||(O.current=null,L(!1))},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Discard unsaved changes?"}),(0,aA.jsxs)(dl,{children:["Your edits to “",i?DE(i):"this file","” have not been saved."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>{O.current=null,L(!1)},children:"Keep Editing"}),(0,aA.jsx)(dy,{onClick:()=>{let a=O.current;O.current=null,L(!1),r(!1),a?.()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}function DI({dir:a}){return(0,aA.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[(0,aA.jsx)(fh,{className:"size-10 text-muted-foreground/40","aria-hidden":"true"}),(0,aA.jsx)("p",{className:"text-sm font-medium",children:"No memory yet"}),(0,aA.jsxs)("p",{className:"max-w-md text-sm text-muted-foreground",children:["EvoScientist will write what it learns here as you work together. Memory lives at ",(0,aA.jsx)("code",{className:"break-all font-mono text-xs",children:a}),"."]})]})}let DJ=cz("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),DK=cz("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function DL(){let{resolvedTheme:a,setTheme:b}=(0,Ck.useTheme)(),[c,d]=(0,aB.useState)(!1);(0,aB.useEffect)(()=>d(!0),[]);let e=c&&"dark"===a;return(0,aA.jsx)(dy,{variant:"ghost",size:"icon",className:"size-8 sm:size-9",onClick:()=>b(e?"light":"dark"),"aria-label":e?"Switch to light mode":"Switch to dark mode",title:e?"Switch to light mode":"Switch to dark mode",children:e?(0,aA.jsx)(DJ,{className:"size-5","aria-hidden":"true"}):(0,aA.jsx)(DK,{className:"size-5","aria-hidden":"true"})})}let DM={checking:{dot:"bg-[var(--color-warning)]",label:"Connecting…",pulse:!0},online:{dot:"bg-[var(--color-success)]",label:"Connected",pulse:!1},offline:{dot:"bg-[var(--color-error)]",label:"Offline",pulse:!1}};function DN(a){return a.trim().replace(/\/+$/,"")}async function DO(a){let b=new AbortController,c=setTimeout(()=>b.abort(),4e3);try{return(await fetch(`${a}/info`,{signal:b.signal,cache:"no-store"})).ok}catch{return!1}finally{clearTimeout(c)}}function DP({deploymentUrl:a,onReconnect:b}){let[c,d]=(0,aB.useState)("checking"),[e,f]=(0,aB.useState)(null),[g,h]=(0,aB.useState)(null),i=(0,aB.useRef)(0),j=(0,aB.useRef)(!0),k=(0,aB.useRef)(null),l=(0,aB.useCallback)(async b=>{let c=DN(a);try{let a=await fetch("/api/evosci-config",{cache:"no-store"}),d=await a.json().catch(()=>null),e=d?.deploymentUrl?DN(d.deploymentUrl):"";if(b!==i.current||!j.current)return;if(!e||e===c)return void h(null);let f=await DO(e);if(b!==i.current||!j.current)return;h(f?e:null)}catch{b===i.current&&j.current&&h(null)}},[a]),m=(0,aB.useCallback)(async()=>{let b=++i.current,c=DN(a);if(!c){b===i.current&&j.current&&(f(null),d("offline"),h(null));return}k.current?.abort();let e=new AbortController;k.current=e;let g=setTimeout(()=>e.abort(),4e3);try{let a=await fetch(`${c}/info`,{signal:e.signal,cache:"no-store"});if(b!==i.current||!j.current)return;if(!a.ok){d("offline"),l(b);return}let g=await a.json().catch(()=>null);if(b!==i.current||!j.current)return;f(g),d("online"),h(null)}catch{b===i.current&&j.current&&(d("offline"),l(b))}finally{clearTimeout(g)}},[a,l]);(0,aB.useEffect)(()=>{j.current=!0,d("checking"),m();let a=setInterval(()=>{document.hidden||m()},1e4),b=()=>m(),c=()=>{document.hidden||m()};return window.addEventListener("focus",b),window.addEventListener("online",b),document.addEventListener("visibilitychange",c),()=>{j.current=!1,k.current?.abort(),clearInterval(a),window.removeEventListener("focus",b),window.removeEventListener("online",b),document.removeEventListener("visibilitychange",c)}},[m]);let n=DM[c],o="online"===c?`Connected to ${a}${e?.version?` \xb7 langgraph ${e.version}`:""}`:"offline"===c?`Can't reach the backend at ${a}. Is "EvoSci deploy" running? Click to retry.`:`Checking connection to ${a}…`;return(0,aA.jsxs)("div",{className:"flex items-center gap-1",children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",onClick:m,title:o,"aria-label":o,className:"h-8 gap-1.5 px-2 text-xs font-normal text-muted-foreground",children:[(0,aA.jsx)("span",{className:`size-2 shrink-0 rounded-full ${n.dot} ${n.pulse?"animate-pulse":""}`,"aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:n.label})]}),"offline"===c&&null!==g&&void 0!==b&&(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",onClick:()=>{g&&(h(null),d("checking"),b?.(g))},title:`Backend detected at ${g}. Click to reconnect.`,"aria-label":`Reconnect to detected backend ${g}`,className:"h-8 gap-1 px-2 text-xs font-medium text-[var(--brand)] hover:text-[var(--brand)]",children:["Reconnect"," ",(0,aA.jsx)("span",{className:"tabular-nums",children:g?function(a){try{let b=new URL(a),c="127.0.0.1"===b.hostname||"localhost"===b.hostname||"0.0.0.0"===b.hostname,d=b.port||("https:"===b.protocol?"443":"80");return c?`:${d}`:`${b.hostname}:${d}`}catch{return a}}(g):""})]})]})}let DQ=cz("bell-ring",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]),DR=cz("corner-up-left",[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]]);function DS(a){let b="";for(let c of a)if("human"===c.type){let a=t3(c).trim();if(a){b=a;break}}return{prompt:b,steps:function(a){let b=[];for(let c of a)if("ai"===c.type){let a=t2(c.content).trim();for(let d of(a&&b.push({kind:"text",text:a}),function(a){let b=[];if(Array.isArray(a.tool_calls)&&a.tool_calls.length>0){for(let c of a.tool_calls)b.push({id:c.id??"",name:c.name??"tool",args:c.args&&"object"==typeof c.args?c.args:{}});return b}let c=a.additional_kwargs?.tool_calls;if(Array.isArray(c))for(let a of c){let c={},d=a.function?.arguments;if(d&&"object"==typeof d)c=d;else if("string"==typeof d)try{let a=JSON.parse(d);a&&"object"==typeof a&&(c=a)}catch{c={input:d}}b.push({id:a.id??"",name:a.function?.name??"tool",args:c})}return b}(c)))b.push({kind:"tool_call",id:d.id,name:d.name,args:d.args})}else"tool"===c.type&&b.push({kind:"tool_result",toolCallId:c.tool_call_id??"",name:c.name??"tool",text:t2(c.content).trim()});return b}(a)}}function DT({status:a}){let b=CA[Ct(a)];return(0,aA.jsx)("span",{className:dd("size-2 shrink-0 rounded-full",b.dot,b.pulse&&"animate-pulse"),"aria-hidden":"true"})}function DU({onReportToMainChat:a}){let b=d5(),[c]=aM("threadId"),{tasks:d,loaded:e,error:f,refresh:g}=CR(c),[h,i]=(0,aB.useState)(()=>Date.now()),[j,k]=(0,aB.useState)(null),[l,m]=(0,aB.useState)({}),n=(0,aB.useRef)(new Map),[o,p]=(0,aB.useState)({}),[q,r]=CW(c),[s,t]=(0,aB.useState)({}),[u,v]=(0,aB.useState)({}),[w,x]=(0,aB.useState)({}),y=(0,aB.useRef)(!0);(0,aB.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]),(0,aB.useEffect)(()=>{let a=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(a)},[]);let z=async a=>{let c=(s[a.task_id]??"").trim();if(c&&!u[a.task_id]){v(b=>({...b,[a.task_id]:!0})),x(b=>({...b,[a.task_id]:null}));try{let d=await b.runs.wait(a.thread_id,a.agent_name,{input:{messages:[{type:"human",content:c}]}});if(!y.current)return;let e=Array.isArray(d?.messages)?d.messages:[];if(0===e.length)return void x(b=>({...b,[a.task_id]:"The agent didn't return a reply — it may have hit an error."}));t(b=>({...b,[a.task_id]:""}));let{prompt:f,steps:g}=DS(e);m(b=>({...b,[a.task_id]:{loading:!1,error:null,prompt:f,steps:g}}))}catch(c){if(!y.current)return;let b=c instanceof TypeError||"object"==typeof c&&null!==c&&"number"==typeof c.status;x(c=>({...c,[a.task_id]:b?"Couldn't reach this agent — try again.":"The agent hit an error processing this follow-up."}))}finally{y.current&&v(b=>({...b,[a.task_id]:!1}))}}};(0,aB.useEffect)(()=>{if(!j)return;let a=d.find(a=>a.task_id===j);if(!a||"expired"===Ct(a.liveStatus))return;let c="running"===Ct(a.liveStatus),e=[a.run_id,a.last_updated_at,a.endedAt].join(":");if(!c&&n.current.get(j)===e)return;let f=!1;return m(a=>({...a,[j]:{loading:!a[j],error:null,prompt:a[j]?.prompt??"",steps:a[j]?.steps??[]}})),(async()=>{try{let d=await b.threads.getState(a.thread_id);if(f)return;let{prompt:g,steps:h}=DS(d.values?.messages??[]);c||n.current.set(j,e),m(a=>({...a,[j]:{loading:!1,error:null,prompt:g,steps:h}}))}catch{if(f)return;n.current.delete(j),m(a=>({...a,[j]:{loading:!1,error:"Couldn't load this agent's steps.",prompt:a[j]?.prompt??"",steps:a[j]?.steps??[]}}))}})(),()=>{f=!0}},[j,d,b]);let A=(0,aB.useMemo)(()=>CC(d),[d]);return(0,aA.jsxs)("div",{className:"flex h-full flex-col",children:[(0,aA.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 pb-2",children:[(0,aA.jsx)("p",{className:"text-xs text-muted-foreground",children:A>0?`${A} running`:d.length>0?`${d.length} total`:"Background agents"}),(0,aA.jsxs)("div",{className:"flex items-center gap-1",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>{c&&(q||CU(c,d.filter(a=>CB(a.liveStatus)).map(Cw)),r(!q))},"aria-pressed":q,"aria-label":`Auto-report ${q?"on":"off"}`,title:q?"Auto-report on: finished agents are sent to the main chat automatically":"Auto-report off: use each agent's “Notify main chat” button",className:dd("inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",q?"bg-accent text-[var(--brand)]":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[(0,aA.jsx)(DQ,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsxs)("span",{className:"hidden min-[340px]:inline",children:["Auto-report ",q?"On":"Off"]})]}),(0,aA.jsx)("button",{type:"button",onClick:g,"aria-label":"Refresh agents",title:"Refresh",className:"rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(C9,{className:"size-3.5","aria-hidden":"true"})})]})]}),f&&(0,aA.jsx)("p",{className:"px-1 text-xs text-[var(--color-error)]",children:f}),!e&&(0,aA.jsxs)("div",{className:"flex items-center gap-2 px-1 py-4 text-xs text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading…"]}),e&&0===d.length&&(0,aA.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-10 text-center",children:[(0,aA.jsx)(uo,{className:"size-9 text-muted-foreground/60","aria-hidden":"true"}),(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"No background agents yet."}),(0,aA.jsx)("p",{className:"text-xs text-muted-foreground/80",children:"When EvoScientist delegates long tasks (writing, data analysis) they run in the background and show up here."})]}),(0,aA.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto",children:d.map(b=>{var d;let e,f,g,i=Ct(b.liveStatus),m=CA[i],n=j===b.task_id,r="expired"===i,v=l[b.task_id];return(0,aA.jsxs)("div",{className:"rounded-md border border-border bg-background",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>k(n?null:b.task_id),className:"flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","aria-expanded":n,children:[n?(0,aA.jsx)(ir,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}):(0,aA.jsx)(CF,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsx)(DT,{status:b.liveStatus}),(0,aA.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:Cu[d=b.agent_name]??d}),(0,aA.jsxs)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[m.label,(e=function(a,b){let c=Ct(a.liveStatus);if("expired"===c)return"";let d="running"===c?b:a.endedAt?Date.parse(a.endedAt):b;return function(a,b){if(!a)return"";let c=Date.parse(a);if(Number.isNaN(c))return"";let d=Math.max(0,Math.round((b-c)/1e3)),e=Math.floor(d/60);if(e>=60){let a=Math.floor(e/60);return`${a}h ${e%60}m`}return e>0?`${e}m ${d%60}s`:`${d}s`}(a.startedAt??a.created_at,d)}(b,h))?` \xb7 ${e}`:""]})]}),n&&r&&(0,aA.jsx)("div",{className:"border-t border-border px-2.5 py-2 text-xs",children:(0,aA.jsx)("p",{className:"text-muted-foreground",children:"This task ran before a backend restart and its records are gone, so its steps and result can no longer be loaded. Any files it produced are still in the workspace."})}),n&&!r&&(0,aA.jsxs)("div",{className:"border-t border-border px-2.5 py-2 text-xs",children:[v?.loading&&(0,aA.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Loading steps…"]}),v?.error&&(0,aA.jsx)("p",{className:"text-[var(--color-error)]",children:v.error}),v&&!v.loading&&!v.error&&(0,aA.jsxs)("div",{className:"flex flex-col gap-2",children:[v.prompt&&(0,aA.jsxs)("div",{children:[(0,aA.jsx)("p",{className:"font-semibold text-foreground",children:"Task"}),(0,aA.jsx)("p",{className:"whitespace-pre-wrap break-words text-muted-foreground",children:v.prompt.length>600?v.prompt.slice(0,600)+"…":v.prompt})]}),(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("p",{className:"mb-1 font-semibold text-foreground",children:["Steps"," ",(0,aA.jsxs)("span",{className:"font-normal text-muted-foreground",children:["(",v.steps.length,")"]})]}),0===v.steps.length?(0,aA.jsx)("p",{className:"text-muted-foreground",children:"No steps yet."}):(0,aA.jsx)(Cs,{steps:v.steps,compact:!0})]}),CB(b.liveStatus)&&(0,aA.jsx)("div",{className:"mt-1 border-t border-border pt-2",children:q?(0,aA.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,aA.jsx)(DQ,{className:"size-3.5 text-[var(--brand)]","aria-hidden":"true"}),"Auto-report on · future completions notify the main chat"]}):(0,aA.jsxs)("button",{type:"button",onClick:()=>(b=>{if(!a||!c)return void jD.toast.error("Open the conversation to notify the main agent.");let d=a(b,c);if("sent"===d){p(a=>({...a,[Cw(b)]:!0})),jD.toast.success("Reported to the main chat.");return}if("duplicate"===d){p(a=>({...a,[Cw(b)]:!0})),jD.toast.info("This result is already in the main chat.");return}jD.toast.error("wrong-thread"===d?"The active conversation changed — reopen this task and try again.":"Main chat is busy — try again when it's idle.")})(b),disabled:!a||!!o[Cw(b)],title:a?"Send this result back to the main agent":"Open the conversation to notify the main agent",className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[(0,aA.jsx)(DR,{className:"size-3.5 text-[var(--brand)]","aria-hidden":"true"}),o[Cw(b)]?"Reported to main chat":"Notify main chat"]})}),(f="running"===Ct(b.liveStatus),g=!!u[b.task_id],(0,aA.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,aA.jsx)("p",{className:"mb-1 text-[11px] text-muted-foreground",children:"Direct follow-up · Main chat is not notified"}),(0,aA.jsxs)("form",{onSubmit:a=>{a.preventDefault(),z(b)},className:"flex items-center gap-1.5",children:[(0,aA.jsx)("input",{type:"text",name:`agent-message-${b.task_id}`,autoComplete:"off",value:s[b.task_id]??"",onChange:a=>t(c=>({...c,[b.task_id]:a.target.value})),onKeyDown:a=>{"Enter"===a.key&&(a.nativeEvent.isComposing||229===a.keyCode)&&a.preventDefault()},disabled:f||g,placeholder:f?"Agent is working…":"Send a direct follow-up…","aria-label":"Message this agent",className:"min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60"}),(0,aA.jsx)("button",{type:"submit",disabled:f||g||!(s[b.task_id]??"").trim(),"aria-label":"Send",title:"Send to this agent",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md bg-[var(--brand-solid)] text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:g?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(ub,{className:"size-3.5","aria-hidden":"true"})})]}),w[b.task_id]&&(0,aA.jsx)("p",{className:"mt-1 text-[var(--color-error)]",role:"status","aria-live":"polite",children:w[b.task_id]})]}))]})]})]},b.task_id)})})]})}function DV({onClose:a,onReportToMainChat:b}){let[c,d]=aM("inspectorTab"),e="agents"===c?"agents":"workspace";return(0,aA.jsxs)("div",{className:"flex h-full flex-col border-l border-border bg-sidebar",children:[(0,aA.jsxs)("div",{className:"flex h-11 shrink-0 items-center justify-between gap-2 border-b border-border px-2",children:[(0,aA.jsxs)("div",{role:"tablist","aria-label":"Inspector",className:"flex items-center gap-1",children:[(0,aA.jsxs)("button",{type:"button",role:"tab","aria-selected":"workspace"===e,onClick:()=>d(null),className:dd("flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","workspace"===e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,aA.jsx)(ug,{className:"size-4 text-[var(--brand)]","aria-hidden":"true"}),"Workspace"]}),(0,aA.jsxs)("button",{type:"button",role:"tab","aria-selected":"agents"===e,onClick:()=>d("agents"),className:dd("flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","agents"===e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,aA.jsx)(uo,{className:"size-4 text-[var(--brand)]","aria-hidden":"true"}),"Agents"]})]}),(0,aA.jsx)(dy,{variant:"ghost",size:"icon",className:"size-7",onClick:a,"aria-label":"Close inspector",title:"Close",children:(0,aA.jsx)(cA,{className:"size-4","aria-hidden":"true"})})]}),"agents"===e?(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden p-3",children:(0,aA.jsx)(DU,{onReportToMainChat:b})}):(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:(0,aA.jsx)(Do,{})})]})}function DW({config:a,configDialogOpen:b,setConfigDialogOpen:c,handleSaveConfig:d}){let e=d5(),[,f]=aM("threadId"),[g,h]=aM("sidebar"),[i,j]=aM("view"),[k,l]=aM("inspector"),[,m]=aM("inspectorTab"),[n,o]=(0,aB.useState)(null),[p,q]=(0,aB.useState)(0),[r,s]=(0,aB.useState)(null),[t,u]=(0,aB.useState)(null),[v,w]=(0,aB.useState)(0),[x,y]=(0,aB.useState)(null),z=(0,aB.useCallback)(async()=>{let b=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(a.assistantId),c=async()=>{if(b)return await e.assistants.get(a.assistantId);let c=await e.assistants.search({graphId:a.assistantId,limit:100}),d=c.find(a=>a.metadata?.created_by==="system")??c[0];if(!d)throw Error("No assistant found for this graph.");return d};for(let a=0;a<3;a+=1)try{s(await c());return}catch(b){if(a<2){await new Promise(a=>setTimeout(a,700));continue}console.warn("Couldn't resolve the EvoScientist assistant; addressing the graph by id instead. Is the backend running?",b)}s({assistant_id:a.assistantId,graph_id:a.assistantId,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),config:{},metadata:{},version:1,name:a.assistantId,context:{}})},[e,a.assistantId]);(0,aB.useEffect)(()=>{z()},[z]),(0,aB.useEffect)(()=>{let a=window.matchMedia("(min-width: 768px)"),b=()=>u(a.matches);return b(),a.addEventListener("change",b),()=>a.removeEventListener("change",b)},[]),(0,aB.useEffect)(()=>{!1===t&&g&&k&&l(null)},[k,t,l,g]);let A=(0,aB.useCallback)(()=>h(null),[h]),B=(0,aB.useCallback)(()=>{l(null),m(null)},[l,m]),C=(0,aB.useCallback)(()=>{g?h(null):(!1===t&&B(),h("1"))},[B,t,h,g]),D=(0,aB.useCallback)(()=>{k?B():(!1===t&&h(null),m(null),l("1"))},[B,k,t,l,m,h]),E=(0,aB.useCallback)(()=>{m("agents"),!1===t&&h(null),l("1")},[t,l,h,m]),F=i?g?"Hide navigation":"Show navigation":g?"Hide research":"Show research",G=(0,aB.useCallback)(()=>{CQ(null,!1),f(null),j(null),w(a=>a+1)},[f,j]),H=(0,aB.useCallback)(async a=>{CQ(null,!1),j(null),await f(a),w(a=>a+1)},[f,j]);return(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dG,{open:b,onOpenChange:c,onSave:d,initialConfig:a}),(0,aA.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,aA.jsxs)("header",{className:"flex h-14 items-center justify-between gap-2 border-b border-border px-2.5 sm:px-4",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2 sm:gap-3",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,aA.jsx)(aC.default,{src:"/evoscientist-logo.png",alt:"EvoScientist",width:28,height:28,className:"size-6 shrink-0",priority:!0}),g&&(0,aA.jsx)("h1",{className:"truncate text-base font-semibold sm:text-lg",children:"EvoScientist"})]}),(0,aA.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"icon",onClick:C,"aria-label":F,className:"relative size-8",children:[g?(0,aA.jsx)(d9,{className:"size-5","aria-hidden":"true"}):(0,aA.jsx)(d8,{className:"size-5","aria-hidden":"true"}),p>0&&(0,aA.jsx)("span",{className:"absolute right-0 top-0 inline-flex min-h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[10px] text-destructive-foreground",children:p})]}),!g&&(0,aA.jsx)(dy,{variant:"ghost",size:"icon",onClick:G,"aria-label":"New chat",className:"size-8",children:(0,aA.jsx)(d7,{className:"size-5","aria-hidden":"true"})})]})]}),(0,aA.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,aA.jsx)(DP,{deploymentUrl:a.deploymentUrl,onReconnect:b=>d({...a,deploymentUrl:b})}),(0,aA.jsx)(DL,{}),(0,aA.jsx)(dy,{variant:"ghost",size:"icon",onClick:D,"aria-label":k?"Hide inspector":"Show workspace",title:k?"Hide inspector":"Show workspace",className:"size-8",children:k?(0,aA.jsx)(eb,{className:"size-5","aria-hidden":"true"}):(0,aA.jsx)(ea,{className:"size-5","aria-hidden":"true"})}),(0,aA.jsx)(dy,{variant:"ghost",size:"icon",onClick:()=>c(!0),"aria-label":"Settings",title:"Settings",className:"size-8",children:(0,aA.jsx)(d6,{className:"size-5","aria-hidden":"true"})})]})]}),(0,aA.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[g&&!1===t&&(0,aA.jsxs)("div",{className:"absolute inset-0 z-40 flex md:hidden",children:[(0,aA.jsx)("button",{type:"button","aria-label":"Close research",className:"absolute inset-0 bg-black/40",onClick:A}),(0,aA.jsx)("aside",{"aria-label":i?"Navigation":"Research navigation",className:"relative z-10 h-full w-[min(19rem,calc(100vw-2.25rem))] bg-background shadow-xl",children:(0,aA.jsx)(jM,{onClose:A,onNewChat:G,onThreadSelect:async a=>{await H(a),A()},onMutateReady:a=>o(()=>a),onInterruptCountChange:q})})]}),k&&!1===t&&(0,aA.jsxs)("div",{className:"absolute inset-0 z-40 flex justify-end md:hidden",children:[(0,aA.jsx)("button",{type:"button","aria-label":"Close inspector",className:"absolute inset-0 bg-black/40",onClick:B}),(0,aA.jsx)("aside",{"aria-label":"Inspector",className:"relative z-10 h-full w-[min(22rem,calc(100vw-2.25rem))] bg-background shadow-xl",children:(0,aA.jsx)(DV,{onClose:B,onReportToMainChat:x})})]}),(0,aA.jsxs)(ff,{direction:"horizontal",autoSaveId:"evoscientist-chat",children:[g&&t&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(en,{id:"thread-history",order:1,defaultSize:23,minSize:18,className:"relative min-w-[260px]",children:(0,aA.jsx)(jM,{onNewChat:G,onThreadSelect:H,onMutateReady:a=>o(()=>a),onInterruptCountChange:q})}),(0,aA.jsx)(fg,{})]}),(0,aA.jsx)(en,{id:"chat",className:"relative flex flex-col",order:2,children:"skills"===i?(0,aA.jsx)(Dx,{}):"memory"===i?(0,aA.jsx)(DH,{}):(0,aA.jsx)(t7,{activeAssistant:r,onHistoryRevalidate:()=>n?.(),children:(0,aA.jsx)(Ds,{assistant:r,onShowAgents:E,onNotifyReady:a=>y(()=>a)})},v)}),k&&t&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(fg,{}),(0,aA.jsx)(en,{id:"inspector",order:3,defaultSize:26,minSize:20,className:"relative min-w-[300px]",children:(0,aA.jsx)(DV,{onClose:B,onReportToMainChat:x})})]})]})]})]})]})}function DX(){let[a,b]=(0,aB.useState)(null),[c,d]=(0,aB.useState)(!1),[e,f]=aM("assistantId");(0,aB.useEffect)(()=>{d(!0)},[]),(0,aB.useEffect)(()=>{a&&!e&&f(a.assistantId)},[a,e,f]);let g=(0,aB.useCallback)(a=>{b(a)},[]),h=a?.langsmithApiKey||process.env.NEXT_PUBLIC_LANGSMITH_API_KEY||"";return a?(0,aA.jsx)(d4,{deploymentUrl:a.deploymentUrl,apiKey:h,children:(0,aA.jsx)(DW,{config:a,configDialogOpen:c,setConfigDialogOpen:d,handleSaveConfig:g})}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dG,{open:c,onOpenChange:d,onSave:g}),(0,aA.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,aA.jsxs)("div",{className:"text-center",children:[(0,aA.jsx)("h1",{className:"text-2xl font-bold",children:"Welcome to EvoScientist"}),(0,aA.jsx)("p",{className:"mt-2 text-muted-foreground",children:"Configure your deployment to get started"}),(0,aA.jsx)(dy,{onClick:()=>d(!0),className:"mt-4",children:"Open Configuration"})]})})]})}a.s(["default",0,function(){return(0,aA.jsx)(aB.Suspense,{fallback:(0,aA.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,aA.jsx)("p",{className:"text-muted-foreground",children:"Loading…"})}),children:(0,aA.jsx)(DX,{})})}],240777)}];
166
+ `})}),c=await b.json();if(!b.ok)throw Error(c.error||"Failed to create file.");z(!1),B(""),await X(),await _(c.path),t(c.content),r(!0)}catch(a){F(a instanceof Error?a.message:"Failed to create file.")}finally{D(!1)}},ae=q&&null!=k&&s!==k.content,af=a=>{ae?(O.current=a,L(!0)):a()},ag=i&&(b=(a=DP(i)).lastIndexOf("."))>=0?a.slice(b+1).toLowerCase():"";return(0,aA.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,aA.jsxs)("header",{className:"flex flex-shrink-0 items-start justify-between gap-3 border-b border-border px-4 py-3 sm:px-5",children:[(0,aA.jsxs)("div",{className:"min-w-0",children:[(0,aA.jsxs)("div",{className:"flex items-center gap-2",children:[(0,aA.jsx)(fh,{className:"size-5 text-[var(--brand)]","aria-hidden":"true"}),(0,aA.jsx)("h2",{className:"text-xl font-semibold",children:"EvoMemory"})]}),(0,aA.jsxs)("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-muted-foreground",children:["EvoScientist's"," ",(0,aA.jsx)("span",{className:"font-medium text-[var(--brand)]",children:"self-evolving memory system"})," ","— it continuously learns and refines what it knows about you, your research taste, and lessons from past experiments, updating itself after every turn. View or edit it directly."]})]}),(0,aA.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1.5",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>{B(""),F(null),z(!0)},"aria-label":"New memory file",title:"New memory file",className:"inline-flex items-center gap-1.5 rounded-md bg-[var(--brand-solid)] px-2.5 py-1.5 text-xs font-medium text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",children:[(0,aA.jsx)(DL,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:"New"})]}),(0,aA.jsx)("button",{type:"button",onClick:X,disabled:e,"aria-label":"Refresh",className:"rounded-md p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(DE,{className:e?"size-4 animate-spin":"size-4","aria-hidden":"true"})})]})]}),g?(0,aA.jsx)("div",{className:"flex flex-1 items-center justify-center p-8",children:(0,aA.jsx)("p",{className:"text-sm text-destructive",children:g})}):e&&!c?(0,aA.jsxs)("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading memory…"]}):c&&!c.exists||c&&0===c.entries.length?(0,aA.jsx)(DT,{dir:c.dir}):(0,aA.jsxs)("div",{ref:V,className:"flex min-h-0 flex-1",children:[(0,aA.jsx)("aside",{className:dd("w-full flex-col md:flex md:flex-shrink-0",i?"hidden md:flex":"flex"),style:P?{width:T}:void 0,children:(0,aA.jsx)(f_,{className:"h-0 flex-1",children:(0,aA.jsxs)("div",{className:"p-1.5",children:[$.map(a=>(0,aA.jsxs)("div",{className:"mb-2.5",children:[(0,aA.jsx)("h4",{className:"px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:a.name}),(0,aA.jsx)("div",{className:"flex flex-col",children:a.files.map(a=>{var b;let c=DO(a.path),d=a.path===i,e=(b=a.mtime,b>0&&Y-b<6e5),f=function(a,b){if(!a)return"";let c=Math.max(0,Math.round((b-a)/1e3));if(c<45)return"just now";let d=Math.round(c/60);if(d<60)return`${d}m ago`;let e=Math.round(d/60);return e<24?`${e}h ago`:`${Math.round(e/24)}d ago`}(a.mtime,Y);return(0,aA.jsxs)("button",{type:"button",onClick:()=>{af(()=>_(a.path))},className:dd("flex items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors focus-visible:ring-2 focus-visible:ring-ring",d?"bg-accent":"hover:bg-accent/60"),"aria-current":d,children:[e?(0,aA.jsx)("span",{className:"mt-1.5 size-2 shrink-0 rounded-full bg-[var(--brand)]",title:"Recently updated","aria-label":"Recently updated"}):(0,aA.jsx)(Db,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,aA.jsx)("span",{className:dd("block truncate text-sm font-medium",e&&"text-[var(--brand)]"),children:DP(a.path)}),(0,aA.jsxs)("span",{className:"mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:[c&&(0,aA.jsx)("span",{className:"truncate",children:c}),(0,aA.jsx)("span",{className:"shrink-0 tabular-nums",children:DQ(a.size)}),f&&(0,aA.jsxs)("span",{className:"shrink-0 tabular-nums",children:["· ",f]})]})]})]},a.path)})})]},a.name)),c?.truncated&&(0,aA.jsxs)("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:["Showing the first ",c.entries.length," files."]})]})})}),(0,aA.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerDown:W,className:"relative hidden w-px shrink-0 cursor-col-resize bg-border transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-2 after:-translate-x-1/2 hover:bg-[var(--brand)] md:block"}),(0,aA.jsx)("section",{className:dd("min-w-0 flex-1 flex-col",i?"flex":"hidden md:flex"),children:i?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)("div",{className:"flex flex-shrink-0 flex-wrap items-center gap-2 border-b border-border px-3 py-2 sm:px-4",children:[(0,aA.jsx)("button",{type:"button",onClick:()=>{af(()=>{j(null),l(null),r(!1)})},"aria-label":"Back to list",className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring md:hidden",children:(0,aA.jsx)(DK,{className:"size-4","aria-hidden":"true"})}),(0,aA.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,aA.jsx)("p",{className:"truncate text-sm font-medium",children:DP(i)}),k&&(0,aA.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[DO(i)&&`${DO(i)} \xb7 `,DQ(k.size),k.mtime?` \xb7 ${function(a){if(!a)return"";try{return new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(new Date(a))}catch{return""}}(k.mtime)}`:""]})]}),(0,aA.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:q?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{af(()=>r(!1))},disabled:u,"aria-label":"Cancel editing",children:[(0,aA.jsx)(Dn,{className:"mr-1 size-4"}),"Cancel"]}),(0,aA.jsxs)(dy,{size:"sm",className:"h-8 px-3",onClick:aa,disabled:u||!ae,"aria-label":"Save memory file",children:[u?(0,aA.jsx)(fj,{className:"mr-1 size-4 animate-spin"}):(0,aA.jsx)(Dc,{className:"mr-1 size-4"}),u?"Saving…":"Save"]})]}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:ac,disabled:!k,"aria-label":w?"Copied memory content":"Copy memory content",title:w?"Copied memory content":"Copy memory content",children:w?(0,aA.jsx)(iq,{className:"size-4"}):(0,aA.jsx)(Cf,{className:"size-4"})}),(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{k&&(t(k.content),r(!0))},disabled:!k,"aria-label":"Edit memory file",children:[(0,aA.jsx)(fl,{className:"mr-1 size-4"}),"Edit"]}),(0,aA.jsx)(dy,{variant:"ghost",size:"sm",className:"h-8 px-2 text-muted-foreground hover:text-destructive",onClick:()=>H(!0),disabled:!k,"aria-label":"Delete memory file",title:"Delete memory file",children:(0,aA.jsx)(fq,{className:"size-4"})})]})})]}),o&&(0,aA.jsx)("p",{role:"alert",className:"px-4 py-2 text-sm text-destructive",children:o}),(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:m?(0,aA.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,aA.jsx)(fj,{className:"size-5 animate-spin text-muted-foreground"})}):q?(0,aA.jsx)("textarea",{value:s,onChange:a=>t(a.target.value),spellCheck:!1,"aria-label":"Memory file content",className:"h-full w-full resize-none bg-background p-4 font-mono text-sm leading-relaxed text-foreground outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",placeholder:"Write memory…"}):k?(0,aA.jsx)(f_,{className:"h-full",children:(0,aA.jsx)("div",{className:"mx-auto max-w-[780px] px-4 py-4 sm:px-6",children:0===k.content.trim().length?(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"This file is empty."}):"md"===ag||"markdown"===ag?(0,aA.jsx)(CB,{content:k.content}):(0,aA.jsx)(Cd,{language:DM[ag]||"text",style:Ce,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.85rem"},wrapLongLines:!0,children:k.content})})}):null})]}):(0,aA.jsx)("div",{className:"flex flex-1 items-center justify-center p-8",children:(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a memory file to view or edit."})})})]}),(0,aA.jsx)(de,{open:y,onOpenChange:a=>{C||z(a)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"New memory file"}),(0,aA.jsxs)(dl,{children:["Create a markdown file in the memory directory. Use a path like"," ",(0,aA.jsx)("code",{className:"font-mono text-xs",children:"notes/idea.md"})," to nest it."]})]}),(0,aA.jsx)(dD,{name:"memory-file-path",autoComplete:"off",spellCheck:!1,value:A,onChange:a=>B(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ad())},placeholder:"notes/research-idea.md…",disabled:C,"aria-invalid":!!E||void 0,"aria-describedby":E?"new-memory-error":void 0}),E&&(0,aA.jsx)("p",{id:"new-memory-error",role:"alert",className:"text-sm text-destructive",children:E}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>z(!1),disabled:C,children:"Cancel"}),(0,aA.jsx)(dy,{onClick:ad,disabled:C||!A.trim(),children:C?"Creating…":"Create"})]})]})}),(0,aA.jsx)(de,{open:G,onOpenChange:a=>{I||H(a)},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Delete memory file?"}),(0,aA.jsx)(dl,{children:i?(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)("code",{children:i}),"will be permanently deleted. This can't be undone."]}):"This memory file will be permanently deleted."})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>H(!1),disabled:I,children:"Cancel"}),(0,aA.jsx)(dy,{onClick:ab,disabled:I||!i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:I?"Deleting…":"Delete"})]})]})}),(0,aA.jsx)(de,{open:K,onOpenChange:a=>{a||(O.current=null,L(!1))},children:(0,aA.jsxs)(dh,{className:"sm:max-w-md",children:[(0,aA.jsxs)(di,{children:[(0,aA.jsx)(dk,{children:"Discard unsaved changes?"}),(0,aA.jsxs)(dl,{children:["Your edits to “",i?DP(i):"this file","” have not been saved."]})]}),(0,aA.jsxs)(dj,{children:[(0,aA.jsx)(dy,{variant:"outline",onClick:()=>{O.current=null,L(!1)},children:"Keep Editing"}),(0,aA.jsx)(dy,{onClick:()=>{let a=O.current;O.current=null,L(!1),r(!1),a?.()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Discard"})]})]})})]})}function DT({dir:a}){return(0,aA.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[(0,aA.jsx)(fh,{className:"size-10 text-muted-foreground/40","aria-hidden":"true"}),(0,aA.jsx)("p",{className:"text-sm font-medium",children:"No memory yet"}),(0,aA.jsxs)("p",{className:"max-w-md text-sm text-muted-foreground",children:["EvoScientist will write what it learns here as you work together. Memory lives at ",(0,aA.jsx)("code",{className:"break-all font-mono text-xs",children:a}),"."]})]})}let DU=cz("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),DV=cz("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function DW(){let{resolvedTheme:a,setTheme:b}=(0,Cl.useTheme)(),[c,d]=(0,aB.useState)(!1);(0,aB.useEffect)(()=>d(!0),[]);let e=c&&"dark"===a;return(0,aA.jsx)(dy,{variant:"ghost",size:"icon",className:"size-8 sm:size-9",onClick:()=>b(e?"light":"dark"),"aria-label":e?"Switch to light mode":"Switch to dark mode",title:e?"Switch to light mode":"Switch to dark mode",children:e?(0,aA.jsx)(DU,{className:"size-5","aria-hidden":"true"}):(0,aA.jsx)(DV,{className:"size-5","aria-hidden":"true"})})}let DX={checking:{dot:"bg-[var(--color-warning)]",label:"Connecting…",pulse:!0},online:{dot:"bg-[var(--color-success)]",label:"Connected",pulse:!1},offline:{dot:"bg-[var(--color-error)]",label:"Offline",pulse:!1}};function DY(a){return a.trim().replace(/\/+$/,"")}async function DZ(a){let b=new AbortController,c=setTimeout(()=>b.abort(),4e3);try{return(await fetch(`${a}/info`,{signal:b.signal,cache:"no-store"})).ok}catch{return!1}finally{clearTimeout(c)}}function D$({deploymentUrl:a,onReconnect:b}){let[c,d]=(0,aB.useState)("checking"),[e,f]=(0,aB.useState)(null),[g,h]=(0,aB.useState)(null),i=(0,aB.useRef)(0),j=(0,aB.useRef)(!0),k=(0,aB.useRef)(null),l=(0,aB.useCallback)(async b=>{let c=DY(a);try{let a=await fetch("/api/evosci-config",{cache:"no-store"}),d=await a.json().catch(()=>null),e=d?.deploymentUrl?DY(d.deploymentUrl):"";if(b!==i.current||!j.current)return;if(!e||e===c)return void h(null);let f=await DZ(e);if(b!==i.current||!j.current)return;h(f?e:null)}catch{b===i.current&&j.current&&h(null)}},[a]),m=(0,aB.useCallback)(async()=>{let b=++i.current,c=DY(a);if(!c){b===i.current&&j.current&&(f(null),d("offline"),h(null));return}k.current?.abort();let e=new AbortController;k.current=e;let g=setTimeout(()=>e.abort(),4e3);try{let a=await fetch(`${c}/info`,{signal:e.signal,cache:"no-store"});if(b!==i.current||!j.current)return;if(!a.ok){d("offline"),l(b);return}let g=await a.json().catch(()=>null);if(b!==i.current||!j.current)return;f(g),d("online"),h(null)}catch{b===i.current&&j.current&&(d("offline"),l(b))}finally{clearTimeout(g)}},[a,l]);(0,aB.useEffect)(()=>{j.current=!0,d("checking"),m();let a=setInterval(()=>{document.hidden||m()},1e4),b=()=>m(),c=()=>{document.hidden||m()};return window.addEventListener("focus",b),window.addEventListener("online",b),document.addEventListener("visibilitychange",c),()=>{j.current=!1,k.current?.abort(),clearInterval(a),window.removeEventListener("focus",b),window.removeEventListener("online",b),document.removeEventListener("visibilitychange",c)}},[m]);let n=DX[c],o="online"===c?`Connected to ${a}${e?.version?` \xb7 langgraph ${e.version}`:""}`:"offline"===c?`Can't reach the backend at ${a}. Is "EvoSci deploy" running? Click to retry.`:`Checking connection to ${a}…`;return(0,aA.jsxs)("div",{className:"flex items-center gap-1",children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",onClick:m,title:o,"aria-label":o,className:"h-8 gap-1.5 px-2 text-xs font-normal text-muted-foreground",children:[(0,aA.jsx)("span",{className:`size-2 shrink-0 rounded-full ${n.dot} ${n.pulse?"animate-pulse":""}`,"aria-hidden":"true"}),(0,aA.jsx)("span",{className:"hidden sm:inline",children:n.label})]}),"offline"===c&&null!==g&&void 0!==b&&(0,aA.jsxs)(dy,{variant:"ghost",size:"sm",onClick:()=>{g&&(h(null),d("checking"),b?.(g))},title:`Backend detected at ${g}. Click to reconnect.`,"aria-label":`Reconnect to detected backend ${g}`,className:"h-8 gap-1 px-2 text-xs font-medium text-[var(--brand)] hover:text-[var(--brand)]",children:["Reconnect"," ",(0,aA.jsx)("span",{className:"tabular-nums",children:g?function(a){try{let b=new URL(a),c="127.0.0.1"===b.hostname||"localhost"===b.hostname||"0.0.0.0"===b.hostname,d=b.port||("https:"===b.protocol?"443":"80");return c?`:${d}`:`${b.hostname}:${d}`}catch{return a}}(g):""})]})]})}let D_=cz("bell-ring",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]),D0=cz("corner-up-left",[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]]);function D1(a){let b="";for(let c of a)if("human"===c.type){let a=t3(c).trim();if(a){b=a;break}}return{prompt:b,steps:function(a){let b=[];for(let c of a)if("ai"===c.type){let a=t2(c.content).trim();for(let d of(a&&b.push({kind:"text",text:a}),function(a){let b=[];if(Array.isArray(a.tool_calls)&&a.tool_calls.length>0){for(let c of a.tool_calls)b.push({id:c.id??"",name:c.name??"tool",args:c.args&&"object"==typeof c.args?c.args:{}});return b}let c=a.additional_kwargs?.tool_calls;if(Array.isArray(c))for(let a of c){let c={},d=a.function?.arguments;if(d&&"object"==typeof d)c=d;else if("string"==typeof d)try{let a=JSON.parse(d);a&&"object"==typeof a&&(c=a)}catch{c={input:d}}b.push({id:a.id??"",name:a.function?.name??"tool",args:c})}return b}(c)))b.push({kind:"tool_call",id:d.id,name:d.name,args:d.args})}else"tool"===c.type&&b.push({kind:"tool_result",toolCallId:c.tool_call_id??"",name:c.name??"tool",text:t2(c.content).trim()});return b}(a)}}function D2({status:a}){let b=CK[CD(a)];return(0,aA.jsx)("span",{className:dd("size-2 shrink-0 rounded-full",b.dot,b.pulse&&"animate-pulse"),"aria-hidden":"true"})}function D3({onReportToMainChat:a}){let b=d5(),[c]=aM("threadId"),{tasks:d,loaded:e,error:f,refresh:g}=C_(c),[h,i]=(0,aB.useState)(()=>Date.now()),[j,k]=(0,aB.useState)(null),[l,m]=(0,aB.useState)({}),n=(0,aB.useRef)(new Map),[o,p]=(0,aB.useState)({}),[q,r]=C4(c),[s,t]=(0,aB.useState)({}),[u,v]=(0,aB.useState)({}),[w,x]=(0,aB.useState)({}),y=(0,aB.useRef)(!0);(0,aB.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]),(0,aB.useEffect)(()=>{let a=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(a)},[]);let z=async a=>{let c=(s[a.task_id]??"").trim();if(c&&!u[a.task_id]){v(b=>({...b,[a.task_id]:!0})),x(b=>({...b,[a.task_id]:null}));try{let d=await b.runs.wait(a.thread_id,a.agent_name,{input:{messages:[{type:"human",content:c}]}});if(!y.current)return;let e=Array.isArray(d?.messages)?d.messages:[];if(0===e.length)return void x(b=>({...b,[a.task_id]:"The agent didn't return a reply — it may have hit an error."}));t(b=>({...b,[a.task_id]:""}));let{prompt:f,steps:g}=D1(e);m(b=>({...b,[a.task_id]:{loading:!1,error:null,prompt:f,steps:g}}))}catch(c){if(!y.current)return;let b=c instanceof TypeError||"object"==typeof c&&null!==c&&"number"==typeof c.status;x(c=>({...c,[a.task_id]:b?"Couldn't reach this agent — try again.":"The agent hit an error processing this follow-up."}))}finally{y.current&&v(b=>({...b,[a.task_id]:!1}))}}};(0,aB.useEffect)(()=>{if(!j)return;let a=d.find(a=>a.task_id===j);if(!a||"expired"===CD(a.liveStatus))return;let c="running"===CD(a.liveStatus),e=[a.run_id,a.last_updated_at,a.endedAt].join(":");if(!c&&n.current.get(j)===e)return;let f=!1;return m(a=>({...a,[j]:{loading:!a[j],error:null,prompt:a[j]?.prompt??"",steps:a[j]?.steps??[]}})),(async()=>{try{let d=await b.threads.getState(a.thread_id);if(f)return;let{prompt:g,steps:h}=D1(d.values?.messages??[]);c||n.current.set(j,e),m(a=>({...a,[j]:{loading:!1,error:null,prompt:g,steps:h}}))}catch{if(f)return;n.current.delete(j),m(a=>({...a,[j]:{loading:!1,error:"Couldn't load this agent's steps.",prompt:a[j]?.prompt??"",steps:a[j]?.steps??[]}}))}})(),()=>{f=!0}},[j,d,b]);let A=(0,aB.useMemo)(()=>CM(d),[d]);return(0,aA.jsxs)("div",{className:"flex h-full flex-col",children:[(0,aA.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 pb-2",children:[(0,aA.jsx)("p",{className:"text-xs text-muted-foreground",children:A>0?`${A} running`:d.length>0?`${d.length} total`:"Background agents"}),(0,aA.jsxs)("div",{className:"flex items-center gap-1",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>{c&&(q||C2(c,d.filter(a=>CL(a.liveStatus)).map(CG)),r(!q))},"aria-pressed":q,"aria-label":`Auto-report ${q?"on":"off"}`,title:q?"Auto-report on: finished agents are sent to the main chat automatically":"Auto-report off: use each agent's “Notify main chat” button",className:dd("inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",q?"bg-accent text-[var(--brand)]":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[(0,aA.jsx)(D_,{className:"size-3.5","aria-hidden":"true"}),(0,aA.jsxs)("span",{className:"hidden min-[340px]:inline",children:["Auto-report ",q?"On":"Off"]})]}),(0,aA.jsx)("button",{type:"button",onClick:g,"aria-label":"Refresh agents",title:"Refresh",className:"rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,aA.jsx)(Dj,{className:"size-3.5","aria-hidden":"true"})})]})]}),f&&(0,aA.jsx)("p",{className:"px-1 text-xs text-[var(--color-error)]",children:f}),!e&&(0,aA.jsxs)("div",{className:"flex items-center gap-2 px-1 py-4 text-xs text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-4 animate-spin","aria-hidden":"true"}),"Loading…"]}),e&&0===d.length&&(0,aA.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-10 text-center",children:[(0,aA.jsx)(uo,{className:"size-9 text-muted-foreground/60","aria-hidden":"true"}),(0,aA.jsx)("p",{className:"text-sm text-muted-foreground",children:"No background agents yet."}),(0,aA.jsx)("p",{className:"text-xs text-muted-foreground/80",children:"When EvoScientist delegates long tasks (writing, data analysis) they run in the background and show up here."})]}),(0,aA.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-1.5 overflow-y-auto",children:d.map(b=>{var d;let e,f,g,i=CD(b.liveStatus),m=CK[i],n=j===b.task_id,r="expired"===i,v=l[b.task_id];return(0,aA.jsxs)("div",{className:"rounded-md border border-border bg-background",children:[(0,aA.jsxs)("button",{type:"button",onClick:()=>k(n?null:b.task_id),className:"flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring","aria-expanded":n,children:[n?(0,aA.jsx)(ir,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}):(0,aA.jsx)(CP,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,aA.jsx)(D2,{status:b.liveStatus}),(0,aA.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:CE[d=b.agent_name]??d}),(0,aA.jsxs)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[m.label,(e=function(a,b){let c=CD(a.liveStatus);if("expired"===c)return"";let d="running"===c?b:a.endedAt?Date.parse(a.endedAt):b;return function(a,b){if(!a)return"";let c=Date.parse(a);if(Number.isNaN(c))return"";let d=Math.max(0,Math.round((b-c)/1e3)),e=Math.floor(d/60);if(e>=60){let a=Math.floor(e/60);return`${a}h ${e%60}m`}return e>0?`${e}m ${d%60}s`:`${d}s`}(a.startedAt??a.created_at,d)}(b,h))?` \xb7 ${e}`:""]})]}),n&&r&&(0,aA.jsx)("div",{className:"border-t border-border px-2.5 py-2 text-xs",children:(0,aA.jsx)("p",{className:"text-muted-foreground",children:"This task ran before a backend restart and its records are gone, so its steps and result can no longer be loaded. Any files it produced are still in the workspace."})}),n&&!r&&(0,aA.jsxs)("div",{className:"border-t border-border px-2.5 py-2 text-xs",children:[v?.loading&&(0,aA.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Loading steps…"]}),v?.error&&(0,aA.jsx)("p",{className:"text-[var(--color-error)]",children:v.error}),v&&!v.loading&&!v.error&&(0,aA.jsxs)("div",{className:"flex flex-col gap-2",children:[v.prompt&&(0,aA.jsxs)("div",{children:[(0,aA.jsx)("p",{className:"font-semibold text-foreground",children:"Task"}),(0,aA.jsx)("p",{className:"whitespace-pre-wrap break-words text-muted-foreground",children:v.prompt.length>600?v.prompt.slice(0,600)+"…":v.prompt})]}),(0,aA.jsxs)("div",{children:[(0,aA.jsxs)("p",{className:"mb-1 font-semibold text-foreground",children:["Steps"," ",(0,aA.jsxs)("span",{className:"font-normal text-muted-foreground",children:["(",v.steps.length,")"]})]}),0===v.steps.length?(0,aA.jsx)("p",{className:"text-muted-foreground",children:"No steps yet."}):(0,aA.jsx)(CC,{steps:v.steps,compact:!0})]}),CL(b.liveStatus)&&(0,aA.jsx)("div",{className:"mt-1 border-t border-border pt-2",children:q?(0,aA.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,aA.jsx)(D_,{className:"size-3.5 text-[var(--brand)]","aria-hidden":"true"}),"Auto-report on · future completions notify the main chat"]}):(0,aA.jsxs)("button",{type:"button",onClick:()=>(b=>{if(!a||!c)return void jD.toast.error("Open the conversation to notify the main agent.");let d=a(b,c);if("sent"===d){p(a=>({...a,[CG(b)]:!0})),jD.toast.success("Reported to the main chat.");return}if("duplicate"===d){p(a=>({...a,[CG(b)]:!0})),jD.toast.info("This result is already in the main chat.");return}jD.toast.error("wrong-thread"===d?"The active conversation changed — reopen this task and try again.":"Main chat is busy — try again when it's idle.")})(b),disabled:!a||!!o[CG(b)],title:a?"Send this result back to the main agent":"Open the conversation to notify the main agent",className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[(0,aA.jsx)(D0,{className:"size-3.5 text-[var(--brand)]","aria-hidden":"true"}),o[CG(b)]?"Reported to main chat":"Notify main chat"]})}),(f="running"===CD(b.liveStatus),g=!!u[b.task_id],(0,aA.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,aA.jsx)("p",{className:"mb-1 text-[11px] text-muted-foreground",children:"Direct follow-up · Main chat is not notified"}),(0,aA.jsxs)("form",{onSubmit:a=>{a.preventDefault(),z(b)},className:"flex items-center gap-1.5",children:[(0,aA.jsx)("input",{type:"text",name:`agent-message-${b.task_id}`,autoComplete:"off",value:s[b.task_id]??"",onChange:a=>t(c=>({...c,[b.task_id]:a.target.value})),onKeyDown:a=>{"Enter"===a.key&&(a.nativeEvent.isComposing||229===a.keyCode)&&a.preventDefault()},disabled:f||g,placeholder:f?"Agent is working…":"Send a direct follow-up…","aria-label":"Message this agent",className:"min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60"}),(0,aA.jsx)("button",{type:"submit",disabled:f||g||!(s[b.task_id]??"").trim(),"aria-label":"Send",title:"Send to this agent",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md bg-[var(--brand-solid)] text-[var(--brand-foreground)] transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:g?(0,aA.jsx)(fj,{className:"size-3.5 animate-spin","aria-hidden":"true"}):(0,aA.jsx)(ub,{className:"size-3.5","aria-hidden":"true"})})]}),w[b.task_id]&&(0,aA.jsx)("p",{className:"mt-1 text-[var(--color-error)]",role:"status","aria-live":"polite",children:w[b.task_id]})]}))]})]})]},b.task_id)})})]})}function D4({onClose:a,onReportToMainChat:b}){let[c,d]=aM("inspectorTab"),e="agents"===c?"agents":"workspace";return(0,aA.jsxs)("div",{className:"flex h-full flex-col border-l border-border bg-sidebar",children:[(0,aA.jsxs)("div",{className:"flex h-11 shrink-0 items-center justify-between gap-2 border-b border-border px-2",children:[(0,aA.jsxs)("div",{role:"tablist","aria-label":"Inspector",className:"flex items-center gap-1",children:[(0,aA.jsxs)("button",{type:"button",role:"tab","aria-selected":"workspace"===e,onClick:()=>d(null),className:dd("flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","workspace"===e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,aA.jsx)(ug,{className:"size-4 text-[var(--brand)]","aria-hidden":"true"}),"Workspace"]}),(0,aA.jsxs)("button",{type:"button",role:"tab","aria-selected":"agents"===e,onClick:()=>d("agents"),className:dd("flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","agents"===e?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,aA.jsx)(uo,{className:"size-4 text-[var(--brand)]","aria-hidden":"true"}),"Agents"]})]}),(0,aA.jsx)(dy,{variant:"ghost",size:"icon",className:"size-7",onClick:a,"aria-label":"Close inspector",title:"Close",children:(0,aA.jsx)(cA,{className:"size-4","aria-hidden":"true"})})]}),"agents"===e?(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden p-3",children:(0,aA.jsx)(D3,{onReportToMainChat:b})}):(0,aA.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:(0,aA.jsx)(Dy,{})})]})}function D5({config:a,configDialogOpen:b,setConfigDialogOpen:c,handleSaveConfig:d}){let e=d5(),[f,g]=aM("threadId"),[h,i]=aM("sidebar"),[j,k]=aM("view"),[l,m]=aM("inspector"),[,n]=aM("inspectorTab"),[o,p]=(0,aB.useState)(null),[q,r]=(0,aB.useState)(0),[s,t]=(0,aB.useState)(null),[u,v]=(0,aB.useState)(null),[w,x]=(0,aB.useState)(0),[y,z]=(0,aB.useState)(null),A=(0,aB.useCallback)(async()=>{let b=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(a.assistantId),c=async()=>{if(b)return await e.assistants.get(a.assistantId);let c=await e.assistants.search({graphId:a.assistantId,limit:100}),d=c.find(a=>a.metadata?.created_by==="system")??c[0];if(!d)throw Error("No assistant found for this graph.");return d};for(let a=0;a<3;a+=1)try{t(await c());return}catch(b){if(a<2){await new Promise(a=>setTimeout(a,700));continue}console.warn("Couldn't resolve the EvoScientist assistant; addressing the graph by id instead. Is the backend running?",b)}t({assistant_id:a.assistantId,graph_id:a.assistantId,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),config:{},metadata:{},version:1,name:a.assistantId,context:{}})},[e,a.assistantId]);(0,aB.useEffect)(()=>{A()},[A]),(0,aB.useEffect)(()=>{let a=window.matchMedia("(min-width: 768px)"),b=()=>v(a.matches);return b(),a.addEventListener("change",b),()=>a.removeEventListener("change",b)},[]),(0,aB.useEffect)(()=>{!1===u&&h&&l&&m(null)},[l,u,m,h]);let B=(0,aB.useCallback)(()=>i(null),[i]),C=(0,aB.useCallback)(()=>{m(null),n(null)},[m,n]),D=(0,aB.useCallback)(()=>{h?i(null):(!1===u&&C(),i("1"))},[C,u,i,h]),E=(0,aB.useCallback)(()=>{l?C():(!1===u&&i(null),n(null),m("1"))},[C,l,u,m,n,i]),F=(0,aB.useCallback)(()=>{n("agents"),!1===u&&i(null),m("1")},[u,m,i,n]),G=j?h?"Hide navigation":"Show navigation":h?"Hide research":"Show research",H=(0,aB.useCallback)(()=>{C$(null,!1),g(null),k(null),x(a=>a+1)},[g,k]),I=(0,aB.useCallback)(async a=>{C$(null,!1),k(null);let b=f===a;await g(a),b||x(a=>a+1)},[g,k,f]);return(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dG,{open:b,onOpenChange:c,onSave:d,initialConfig:a}),(0,aA.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,aA.jsxs)("header",{className:"flex h-14 items-center justify-between gap-2 border-b border-border px-2.5 sm:px-4",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2 sm:gap-3",children:[(0,aA.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,aA.jsx)(aC.default,{src:"/evoscientist-logo.png",alt:"EvoScientist",width:28,height:28,className:"size-6 shrink-0",priority:!0}),h&&(0,aA.jsx)("h1",{className:"truncate text-base font-semibold sm:text-lg",children:"EvoScientist"})]}),(0,aA.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,aA.jsxs)(dy,{variant:"ghost",size:"icon",onClick:D,"aria-label":G,className:"relative size-8",children:[h?(0,aA.jsx)(d9,{className:"size-5","aria-hidden":"true"}):(0,aA.jsx)(d8,{className:"size-5","aria-hidden":"true"}),q>0&&(0,aA.jsx)("span",{className:"absolute right-0 top-0 inline-flex min-h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[10px] text-destructive-foreground",children:q})]}),!h&&(0,aA.jsx)(dy,{variant:"ghost",size:"icon",onClick:H,"aria-label":"New chat",className:"size-8",children:(0,aA.jsx)(d7,{className:"size-5","aria-hidden":"true"})})]})]}),(0,aA.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,aA.jsx)(D$,{deploymentUrl:a.deploymentUrl,onReconnect:b=>d({...a,deploymentUrl:b})}),(0,aA.jsx)(DW,{}),(0,aA.jsx)(dy,{variant:"ghost",size:"icon",onClick:E,"aria-label":l?"Hide inspector":"Show workspace",title:l?"Hide inspector":"Show workspace",className:"size-8",children:l?(0,aA.jsx)(eb,{className:"size-5","aria-hidden":"true"}):(0,aA.jsx)(ea,{className:"size-5","aria-hidden":"true"})}),(0,aA.jsx)(dy,{variant:"ghost",size:"icon",onClick:()=>c(!0),"aria-label":"Settings",title:"Settings",className:"size-8",children:(0,aA.jsx)(d6,{className:"size-5","aria-hidden":"true"})})]})]}),(0,aA.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[h&&!1===u&&(0,aA.jsxs)("div",{className:"absolute inset-0 z-40 flex md:hidden",children:[(0,aA.jsx)("button",{type:"button","aria-label":"Close research",className:"absolute inset-0 bg-black/40",onClick:B}),(0,aA.jsx)("aside",{"aria-label":j?"Navigation":"Research navigation",className:"relative z-10 h-full w-[min(19rem,calc(100vw-2.25rem))] bg-background shadow-xl",children:(0,aA.jsx)(jM,{onClose:B,onNewChat:H,onThreadSelect:async a=>{await I(a),B()},onMutateReady:a=>p(()=>a),onInterruptCountChange:r})})]}),l&&!1===u&&(0,aA.jsxs)("div",{className:"absolute inset-0 z-40 flex justify-end md:hidden",children:[(0,aA.jsx)("button",{type:"button","aria-label":"Close inspector",className:"absolute inset-0 bg-black/40",onClick:C}),(0,aA.jsx)("aside",{"aria-label":"Inspector",className:"relative z-10 h-full w-[min(22rem,calc(100vw-2.25rem))] bg-background shadow-xl",children:(0,aA.jsx)(D4,{onClose:C,onReportToMainChat:y})})]}),(0,aA.jsxs)(ff,{direction:"horizontal",autoSaveId:"evoscientist-chat",children:[h&&u&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(en,{id:"thread-history",order:1,defaultSize:23,minSize:18,className:"relative min-w-[260px]",children:(0,aA.jsx)(jM,{onNewChat:H,onThreadSelect:I,onMutateReady:a=>p(()=>a),onInterruptCountChange:r})}),(0,aA.jsx)(fg,{})]}),(0,aA.jsxs)(en,{id:"chat",className:"relative flex flex-col",order:2,children:[(0,aA.jsx)("div",{className:dd("flex h-full min-h-0 flex-1 flex-col",null!==j&&"hidden"),children:(0,aA.jsx)(t7,{activeAssistant:s,onHistoryRevalidate:()=>o?.(),children:(0,aA.jsx)(DD,{assistant:s,onShowAgents:F,onNotifyReady:a=>z(()=>a)})},w)}),"skills"===j&&(0,aA.jsx)(DI,{}),"memory"===j&&(0,aA.jsx)(DS,{})]}),l&&u&&(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(fg,{}),(0,aA.jsx)(en,{id:"inspector",order:3,defaultSize:26,minSize:20,className:"relative min-w-[300px]",children:(0,aA.jsx)(D4,{onClose:C,onReportToMainChat:y})})]})]})]})]})]})}function D6(){let[a,b]=(0,aB.useState)(null),[c,d]=(0,aB.useState)(!1),[e,f]=aM("assistantId");(0,aB.useEffect)(()=>{d(!0)},[]),(0,aB.useEffect)(()=>{a&&!e&&f(a.assistantId)},[a,e,f]);let g=(0,aB.useCallback)(a=>{b(a)},[]),h=a?.langsmithApiKey||process.env.NEXT_PUBLIC_LANGSMITH_API_KEY||"";return a?(0,aA.jsx)(d4,{deploymentUrl:a.deploymentUrl,apiKey:h,children:(0,aA.jsx)(D5,{config:a,configDialogOpen:c,setConfigDialogOpen:d,handleSaveConfig:g})}):(0,aA.jsxs)(aA.Fragment,{children:[(0,aA.jsx)(dG,{open:c,onOpenChange:d,onSave:g}),(0,aA.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,aA.jsxs)("div",{className:"text-center",children:[(0,aA.jsx)("h1",{className:"text-2xl font-bold",children:"Welcome to EvoScientist"}),(0,aA.jsx)("p",{className:"mt-2 text-muted-foreground",children:"Configure your deployment to get started"}),(0,aA.jsx)(dy,{onClick:()=>d(!0),className:"mt-4",children:"Open Configuration"})]})})]})}a.s(["default",0,function(){return(0,aA.jsx)(aB.Suspense,{fallback:(0,aA.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,aA.jsx)("p",{className:"text-muted-foreground",children:"Loading…"})}),children:(0,aA.jsx)(D6,{})})}],240777)}];
167
167
 
168
168
  //# sourceMappingURL=%5Broot-of-the-server%5D__0wd7vkh._.js.map