archsight 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/README.md +7 -2
- data/docs/computed_annotations.md +7 -5
- data/docs/icons.md +3 -2
- data/docs/index.md.erb +5 -4
- data/docs/licenses.md +1 -2
- data/docs/modeling.md +127 -6
- data/docs/pages.md +72 -6
- data/docs/search.md +26 -2
- data/docs/togaf.md +4 -0
- data/lib/archsight/annotations/annotation.rb +5 -4
- data/lib/archsight/annotations/computed.rb +5 -1
- data/lib/archsight/annotations/relation_resolver.rb +109 -83
- data/lib/archsight/cli.rb +9 -2
- data/lib/archsight/database.rb +59 -4
- data/lib/archsight/diagram.rb +7 -0
- data/lib/archsight/documentation.rb +9 -5
- data/lib/archsight/editor.rb +2 -2
- data/lib/archsight/export/confluence/exporter.rb +11 -2
- data/lib/archsight/export/confluence/storage.rb +99 -8
- data/lib/archsight/export/confluence/tables.rb +78 -0
- data/lib/archsight/helpers/fenced_blocks.rb +61 -0
- data/lib/archsight/helpers/requirements_blocks.rb +90 -0
- data/lib/archsight/helpers/resource_resolver.rb +1 -1
- data/lib/archsight/helpers/view_blocks.rb +108 -0
- data/lib/archsight/helpers/wiki_links.rb +50 -5
- data/lib/archsight/helpers.rb +3 -0
- data/lib/archsight/import/handlers/go_grapher.rb +4 -1
- data/lib/archsight/import/handlers/go_module_parser.rb +4 -1
- data/lib/archsight/linter.rb +31 -3
- data/lib/archsight/mcp/analyze_resource_tool.rb +2 -2
- data/lib/archsight/mcp/base.rb +38 -0
- data/lib/archsight/mcp/resource_doc_tool.rb +2 -2
- data/lib/archsight/query/ast.rb +2 -1
- data/lib/archsight/query/evaluator.rb +2 -2
- data/lib/archsight/references.rb +129 -0
- data/lib/archsight/requirements.rb +70 -0
- data/lib/archsight/resources/analysis.rb +2 -1
- data/lib/archsight/resources/application_component.rb +8 -3
- data/lib/archsight/resources/application_interface.rb +5 -3
- data/lib/archsight/resources/application_service.rb +8 -7
- data/lib/archsight/resources/base.rb +67 -17
- data/lib/archsight/resources/business_actor.rb +5 -3
- data/lib/archsight/resources/business_control.rb +80 -0
- data/lib/archsight/resources/business_process.rb +3 -2
- data/lib/archsight/resources/business_product.rb +6 -5
- data/lib/archsight/resources/compliance_evidence.rb +40 -3
- data/lib/archsight/resources/data_object.rb +3 -2
- data/lib/archsight/resources/import.rb +5 -2
- data/lib/archsight/resources/{business_constraint.rb → motivation_constraint.rb} +4 -4
- data/lib/archsight/resources/motivation_goal.rb +1 -1
- data/lib/archsight/resources/{business_requirement.rb → motivation_requirement.rb} +19 -8
- data/lib/archsight/resources/motivation_stakeholder.rb +2 -2
- data/lib/archsight/resources/page.rb +4 -2
- data/lib/archsight/resources/strategy_capability.rb +2 -2
- data/lib/archsight/resources/technology_artifact.rb +4 -3
- data/lib/archsight/resources/technology_node.rb +2 -2
- data/lib/archsight/resources/technology_service.rb +4 -0
- data/lib/archsight/resources/technology_system_software.rb +4 -0
- data/lib/archsight/resources/view.rb +2 -1
- data/lib/archsight/resources.rb +34 -3
- data/lib/archsight/template.rb +2 -2
- data/lib/archsight/version.rb +1 -1
- data/lib/archsight/view_table.rb +102 -0
- data/lib/archsight/web/api/docs.rb +1 -1
- data/lib/archsight/web/api/json_helpers.rb +21 -15
- data/lib/archsight/web/api/openapi/spec.yaml +135 -2
- data/lib/archsight/web/api/page_helpers.rb +8 -7
- data/lib/archsight/web/api/requirements_helpers.rb +26 -0
- data/lib/archsight/web/api/routes.rb +19 -0
- data/lib/archsight/web/application.rb +12 -2
- data/lib/archsight/web/public/vue/ApiDocsPage-DZ0fa5-h.css +1 -0
- data/lib/archsight/web/public/vue/ApiDocsPage-DoOxKjG0.js +1 -0
- data/lib/archsight/web/public/vue/{DocPage-uaT8CdFm.js → DocPage-CfsC3CeQ.js} +1 -1
- data/lib/archsight/web/public/vue/EditorPage-CbG4mc9T.css +1 -0
- data/lib/archsight/web/public/vue/EditorPage-CsJA0q8n.js +35 -0
- data/lib/archsight/web/public/vue/ErrorPage-Ck9izEUS.css +1 -0
- data/lib/archsight/web/public/vue/ErrorPage-OJpJz9df.js +2 -0
- data/lib/archsight/web/public/vue/GraphView-BvWAbUAl.css +1 -0
- data/lib/archsight/web/public/vue/GraphView-CBq6oFRV.js +1 -0
- data/lib/archsight/web/public/vue/HomePage-BwgMLgVC.js +2 -0
- data/lib/archsight/web/public/vue/InstanceRouter-DQz-SsQq.js +1 -0
- data/lib/archsight/web/public/vue/InstanceRouter-jeavM6PW.css +1 -0
- data/lib/archsight/web/public/vue/KindList-4q0K9Cll.js +1 -0
- data/lib/archsight/web/public/vue/PageView-DzeGnvoS.js +1 -0
- data/lib/archsight/web/public/vue/QueryError-3EqjpbyV.css +1 -0
- data/lib/archsight/web/public/vue/QueryError-kg6Yf-pW.js +1 -0
- data/lib/archsight/web/public/vue/ResourceList-B0FLaFR3.css +1 -0
- data/lib/archsight/web/public/vue/ResourceList-Df_0e0qt.js +2 -0
- data/lib/archsight/web/public/vue/SearchResults-CKgY6_wH.js +1 -0
- data/lib/archsight/web/public/vue/SearchResults-CyPUZZSC.css +1 -0
- data/lib/archsight/web/public/vue/WikiPage-DoFJ0dbW.css +1 -0
- data/lib/archsight/web/public/vue/WikiPage-DrvCHwJ7.js +13 -0
- data/lib/archsight/web/public/vue/architecture-7GRP2DOG-BfA1TPxQ.js +1 -0
- data/lib/archsight/web/public/vue/cynefin-OW5HDTMX-BmgdUKVD.js +1 -0
- data/lib/archsight/web/public/vue/eventmodeling-NTZA5JFV-DbXDvAWF.js +1 -0
- data/lib/archsight/web/public/vue/gitGraph-4MIJSDKK-BkVhrKS1.js +1 -0
- data/lib/archsight/web/public/vue/index-D0Q5GZRs.js +3 -0
- data/lib/archsight/web/public/vue/index-oF-iyZvk.css +1 -0
- data/lib/archsight/web/public/vue/info-A6RAGUB7-BIlCVuUY.js +1 -0
- data/lib/archsight/web/public/vue/mermaid-BjEi5URd.js +3334 -0
- data/lib/archsight/web/public/vue/packet-AYTQ26CC-eoQTjY3j.js +1 -0
- data/lib/archsight/web/public/vue/pie-WAS4IAKB-DEOotGhh.js +1 -0
- data/lib/archsight/web/public/vue/radar-RG4KPBEZ-C2yucuUN.js +1 -0
- data/lib/archsight/web/public/vue/railroad-74A4TZTK-CzONK5VY.js +1 -0
- data/lib/archsight/web/public/vue/railroad-abnf-HS5TGJTU-9zRPsDsx.js +1 -0
- data/lib/archsight/web/public/vue/railroad-ebnf-LZEXJU2U-BJ4dkz9l.js +1 -0
- data/lib/archsight/web/public/vue/railroad-peg-WCYAUIDC-DFy_rqAj.js +1 -0
- data/lib/archsight/web/public/vue/treeView-Q6P3EWNA-2cq5CyD2.js +1 -0
- data/lib/archsight/web/public/vue/treemap-WGGIJYW6-DK-e9Ez4.js +1 -0
- data/lib/archsight/web/public/vue/{useGraphviz-C71SdG-N.js → useGraphviz-DweKV7Kg.js} +1 -1
- data/lib/archsight/web/public/vue/wardley-WFR3VGLG-BQwqUqfB.js +1 -0
- data/lib/archsight/web/public/vue.html +3 -3
- data/lib/archsight.rb +2 -0
- metadata +53 -42
- data/lib/archsight/web/public/vue/ApiDocsPage-C0y953v0.css +0 -1
- data/lib/archsight/web/public/vue/ApiDocsPage-C_4tAWis.js +0 -1
- data/lib/archsight/web/public/vue/EditorPage-C557BJC-.js +0 -35
- data/lib/archsight/web/public/vue/EditorPage-df5N-p21.css +0 -1
- data/lib/archsight/web/public/vue/ErrorPage-Vdebmife.js +0 -2
- data/lib/archsight/web/public/vue/ErrorPage-uMDnfY5_.css +0 -1
- data/lib/archsight/web/public/vue/GraphView-BduUql2N.js +0 -1
- data/lib/archsight/web/public/vue/GraphView-Cj2V2stN.css +0 -1
- data/lib/archsight/web/public/vue/HomePage-BHUTg8Ap.js +0 -2
- data/lib/archsight/web/public/vue/InstanceRouter-1lSigA58.js +0 -1
- data/lib/archsight/web/public/vue/InstanceRouter-Di7f3Rya.css +0 -1
- data/lib/archsight/web/public/vue/KindList-BDZs0j6d.js +0 -1
- data/lib/archsight/web/public/vue/PageView-BYzJDwof.js +0 -1
- data/lib/archsight/web/public/vue/ResourceList-CnbhU9wm.js +0 -1
- data/lib/archsight/web/public/vue/ResourceList-xyBwu7fh.css +0 -1
- data/lib/archsight/web/public/vue/SearchResults-CNhf6VOx.js +0 -1
- data/lib/archsight/web/public/vue/SearchResults-DOHzqAy3.css +0 -1
- data/lib/archsight/web/public/vue/WikiPage-DbmWkM7W.js +0 -13
- data/lib/archsight/web/public/vue/WikiPage-GV67QmNJ.css +0 -1
- data/lib/archsight/web/public/vue/architecture-TIHT7OUA-Bf-MWFmn.js +0 -1
- data/lib/archsight/web/public/vue/cynefin-VYW2F7L2-CkKt8qqs.js +0 -1
- data/lib/archsight/web/public/vue/eventmodeling-45OFAUF4-NwSTYPHj.js +0 -1
- data/lib/archsight/web/public/vue/gitGraph-TEB2WS4Q-DLRegrRG.js +0 -1
- data/lib/archsight/web/public/vue/index-CyVWObLU.js +0 -3
- data/lib/archsight/web/public/vue/index-DtKeHT3S.css +0 -1
- data/lib/archsight/web/public/vue/info-DKCQHKI2-EV39NzoN.js +0 -1
- data/lib/archsight/web/public/vue/mermaid-BMkGfnhm.js +0 -3279
- data/lib/archsight/web/public/vue/packet-7NZHBO7P-USljV3MZ.js +0 -1
- data/lib/archsight/web/public/vue/pie-RZYD4A2V-DChciBW2.js +0 -1
- data/lib/archsight/web/public/vue/radar-I7S5WNFK-CgGJdW1t.js +0 -1
- data/lib/archsight/web/public/vue/railroad-3IZDKUUU-Dy43vF5c.js +0 -1
- data/lib/archsight/web/public/vue/railroad-abnf-AHOZXSZD-BhsTH-sE.js +0 -1
- data/lib/archsight/web/public/vue/railroad-ebnf-EBAXGLYW-BBTd_u0u.js +0 -1
- data/lib/archsight/web/public/vue/railroad-peg-LSFZ7HO6-BiNTEzf0.js +0 -1
- data/lib/archsight/web/public/vue/treeView-QDETBFTQ-BfnCcf-q.js +0 -1
- data/lib/archsight/web/public/vue/treemap-6X3UGDF4-BsAORhvk.js +0 -1
- data/lib/archsight/web/public/vue/wardley-OPB4EBWU-DQvnEhRj.js +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./useHighlight-D5Gf8DLl.js";import{A as r,B as i,D as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,O as p,P as m,Q as h,R as g,S as _,T as v,V as y,W as b,X as x,Y as S,_ as C,a as ee,b as te,c as w,g as ne,j as T,k as re,l as ie,o as ae,q as oe,t as se,w as ce,x as le,z as ue}from"./index-CyVWObLU.js";var de=`archsight.diagramPreview.layout`,fe=[`bottom`,`right`,`full`,`hidden`],pe=`(min-width: 1400px)`;function me(){try{let e=localStorage.getItem(de);return fe.includes(e)?e:null}catch{return null}}var he=l(me()),ge=l(typeof matchMedia==`function`&&matchMedia(pe).matches);typeof matchMedia==`function`&&matchMedia(pe).addEventListener(`change`,e=>{ge.value=e.matches});var _e=a(()=>he.value||(ge.value?`right`:`bottom`));function ve(e){if(fe.includes(e)){he.value=e;try{localStorage.setItem(de,e)}catch{}}}function ye(){return{layout:_e,setLayout:ve}}var be={class:`preview-head`},xe={class:`preview-tools`},Se={key:0,class:`preview-state`},Ce={class:`preview-layout`,role:`group`,"aria-label":`Preview layout`},we=[`aria-pressed`,`title`,`aria-label`,`onClick`],Te={key:0,class:`preview-error`,role:`alert`},Ee=[`innerHTML`],De={key:2,class:`preview-empty`},Oe=300,ke=se({__name:`DiagramPreview`,props:{source:String},setup(e){let t=e,{layout:n,setLayout:i}=ye(),c=a(()=>n.value===`hidden`),u=[{value:`bottom`,icon:`iconoir-table-rows`,label:`Below the editor`},{value:`right`,icon:`iconoir-view-columns-2`,label:`Right of the editor`},{value:`full`,icon:`iconoir-expand`,label:`Preview only`},{value:`hidden`,icon:`iconoir-eye-closed`,label:`Hide preview`}],d=l(``),m=l(null),_=l(!1),b=null,C=null;function ee(){clearTimeout(b),b=null,C?.abort(),C=null}async function te(e){C=new AbortController;let t=C;_.value=!0;try{let n=await ne(e,{signal:t.signal});if(t!==C)return;n.html&&(d.value=n.html),m.value=n.error}catch(e){if(e.name===`AbortError`||t!==C)return;m.value=e.message}finally{t===C&&(_.value=!1)}}o([()=>t.source,c],([e,t],[,n])=>{if(ee(),t){_.value=!1;return}if(!e||!e.trim()){d.value=``,m.value=null,_.value=!1;return}_.value=!0,b=setTimeout(()=>te(e),n?0:Oe)},{immediate:!0}),g(ee);function w(e){e.target.closest(`a`)&&e.preventDefault()}return(e,t)=>(y(),T(`div`,{class:x([`diagram-preview`,`layout-${S(n)}`])},[p(`div`,be,[p(`span`,null,[t[0]||=p(`i`,{class:`iconoir-eye`},null,-1),t[1]||=f(` Preview`,-1),c.value?(y(),T(v,{key:0},[f(` hidden`)],64)):r(``,!0)]),p(`span`,xe,[_.value&&!c.value?(y(),T(`span`,Se,`Rendering…`)):r(``,!0),p(`span`,Ce,[(y(!0),T(v,null,s(u.filter(e=>!c.value||e.value!==`hidden`),e=>(y(),T(`button`,{key:e.value,type:`button`,class:x({active:S(n)===e.value}),"aria-pressed":S(n)===e.value,title:e.label,"aria-label":e.label,onClick:t=>S(i)(e.value)},[p(`i`,{class:x(e.icon)},null,2)],10,we))),128))])])]),c.value?r(``,!0):(y(),T(v,{key:0},[m.value?(y(),T(`div`,Te,[t[2]||=p(`i`,{class:`iconoir-warning-triangle`},null,-1),f(` `+h(m.value),1)])):r(``,!0),d.value?(y(),T(`div`,{key:1,class:x([`preview-body`,{stale:!!m.value}]),title:`Links are disabled in the preview`,onClick:w,innerHTML:d.value},null,10,Ee)):!m.value&&!_.value?(y(),T(`p`,De,`Nothing to preview yet.`)):r(``,!0)],64))],2))}},[[`__scopeId`,`data-v-f72f41b9`]]),Ae={class:`label-row`},je=[`for`,`title`],Me={key:0,class:`required`},Ne=[`id`,`aria-invalid`],Pe=[`value`],Fe=[`id`,`aria-invalid`,`placeholder`],Ie={key:0,class:`future-hint`},Le={class:`code-source`},Re=[`id`,`aria-invalid`,`placeholder`],ze={class:`future-hint`},Be=[`id`,`step`,`aria-invalid`],Ve=[`id`,`aria-invalid`],He=[`id`,`aria-invalid`],Ue=[`id`,`aria-invalid`],We={key:7,class:`field-description`},Ge={key:8,class:`field-error`},Ke=se({__name:`EditorField`,props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:[`update:modelValue`,`openMarkdown`],setup(e,{emit:t}){let n=e,i=t,o=a({get:()=>n.modelValue??``,set:e=>i(`update:modelValue`,e)}),c=a(()=>[`textarea`,`markdown`,`code`].includes(n.field.input_type)),l=a(()=>n.field.key===`page/content`),u=a(()=>n.field.code_language===`asd`),{layout:d}=ye(),m={asd:`Archsight Diagram`},g=a(()=>{let e=n.field.code_language||``;return m[e]||e.charAt(0).toUpperCase()+e.slice(1)}),b=a(()=>n.error&&n.error.length>0);return(t,n)=>(y(),T(`div`,{class:x([`field-group`,{"field-full-width":c.value}])},[p(`div`,Ae,[p(`label`,{for:e.field.key,title:e.field.description},[f(h(e.field.title)+` `,1),e.field.required?(y(),T(`span`,Me,`*`)):r(``,!0)],8,je),e.field.input_type===`markdown`?(y(),T(`button`,{key:0,type:`button`,class:`btn-edit-markdown`,title:`Open rich text editor`,onClick:n[0]||=n=>t.$emit(`openMarkdown`,e.field.key)},[...n[8]||=[p(`i`,{class:`iconoir-edit-pencil`},null,-1),f(` Edit `,-1)]])):r(``,!0)]),e.field.input_type===`select`?oe((y(),T(`select`,{key:0,id:e.field.key,"onUpdate:modelValue":n[1]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},[n[9]||=p(`option`,{value:``},`Select...`,-1),(y(!0),T(v,null,s(e.field.options,e=>(y(),T(`option`,{key:e,value:e},h(e),9,Pe))),128))],8,Ne)),[[le,o.value]]):e.field.input_type===`textarea`||e.field.input_type===`markdown`?(y(),T(`div`,{key:1,class:x([`markdown-field`,{"page-body":l.value}])},[oe(p(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[2]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:e.field.input_type===`markdown`?`Enter markdown content...`:`One entry per line...`},null,8,Fe),[[_,o.value]]),e.field.input_type===`markdown`?(y(),T(`small`,Ie,[...n[10]||=[p(`i`,{class:`iconoir-info-circle`},null,-1),f(` Markdown, `,-1),p(`code`,null,`[[links]]`,-1),f(` and `,-1),p(`code`,null,"```asd",-1),f(` diagrams. Use Edit for the rich text editor `,-1)]])):r(``,!0)],2)):e.field.input_type===`code`?(y(),T(`div`,{key:2,class:x([`code-field`,u.value&&[`with-preview`,`layout-${S(d)}`]])},[p(`div`,Le,[oe(p(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[3]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:`Enter ${e.field.code_language||``} code...`,spellcheck:`false`},null,8,Re),[[_,o.value]]),p(`small`,ze,[n[11]||=p(`i`,{class:`iconoir-code`},null,-1),f(` `+h(g.value)+` code `,1)])]),u.value?(y(),re(ke,{key:0,class:`field-diagram-preview`,source:String(o.value)},null,8,[`source`])):r(``,!0)],2)):e.field.input_type===`number`?oe((y(),T(`input`,{key:3,id:e.field.key,type:`number`,"onUpdate:modelValue":n[4]||=e=>o.value=e,step:e.field.step,"aria-invalid":b.value?`true`:void 0},null,8,Be)),[[_,o.value]]):e.field.input_type===`url`?oe((y(),T(`input`,{key:4,id:e.field.key,type:`url`,"onUpdate:modelValue":n[5]||=e=>o.value=e,placeholder:`https://...`,"aria-invalid":b.value?`true`:void 0},null,8,Ve)),[[_,o.value]]):e.field.input_type===`list`?oe((y(),T(`input`,{key:5,id:e.field.key,type:`text`,"onUpdate:modelValue":n[6]||=e=>o.value=e,placeholder:`Comma-separated values`,"aria-invalid":b.value?`true`:void 0},null,8,He)),[[_,o.value]]):oe((y(),T(`input`,{key:6,id:e.field.key,type:`text`,"onUpdate:modelValue":n[7]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},null,8,Ue)),[[_,o.value]]),e.field.description&&![`textarea`,`markdown`,`code`].includes(e.field.input_type)?(y(),T(`small`,We,h(e.field.description),1)):r(``,!0),b.value?(y(),T(`div`,Ge,h(e.error.join(`, `)),1)):r(``,!0)],2))}},[[`__scopeId`,`data-v-d1e027c0`]]),qe={class:`relations-editor`},Je={key:0,class:`no-relations`},Ye={id:`relations-list`},Xe={class:`relation-text`},Ze=[`onClick`],Qe={class:`add-relation-row`},$e=[`value`],et=[`value`],tt=se({__name:`EditorRelations`,props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:[`update:relations`],setup(e,{emit:t}){let n=e,r=t,i=l(``),c=l(``),u=a(()=>[...n.relations].sort((e,t)=>(e.verb+e.kind+e.name).localeCompare(t.verb+t.kind+t.name))),d=a(()=>i.value?n.relationOptions.find(e=>e.combo===i.value)?.target_kind:null),m=a(()=>d.value&&n.instancesByKind[d.value]||[]);o(i,()=>{c.value=``});function g(){if(!i.value||!c.value)return;let e=n.relationOptions.find(e=>e.combo===i.value);if(!e||n.relations.some(t=>t.verb===e.verb&&t.kind===e.target_kind&&t.name===c.value))return;let t=[...n.relations,{verb:e.verb,kind:e.target_kind,name:c.value}];r(`update:relations`,t),i.value=``,c.value=``}function _(e){let t=n.relations.filter((t,n)=>n!==e);r(`update:relations`,t)}return(t,n)=>(y(),T(`div`,qe,[!e.relationOptions||e.relationOptions.length===0?(y(),T(`p`,Je,` This resource type has no defined relations. `)):(y(),T(v,{key:1},[p(`div`,Ye,[(y(!0),T(v,null,s(u.value,(e,t)=>(y(),T(`div`,{key:`${e.verb}:${e.kind}:${e.name}`,class:`relation-item`},[p(`span`,Xe,[p(`strong`,null,h(e.verb),1),f(` → `+h(e.kind)+`: `,1),p(`em`,null,h(e.name),1)]),p(`button`,{class:`btn-remove`,type:`button`,title:`Remove`,onClick:e=>_(t)},[...n[2]||=[p(`i`,{class:`iconoir-xmark`},null,-1)]],8,Ze)]))),128))]),p(`div`,Qe,[oe(p(`select`,{"onUpdate:modelValue":n[0]||=e=>i.value=e},[n[3]||=p(`option`,{value:``},`Select relation...`,-1),(y(!0),T(v,null,s(e.relationOptions,e=>(y(),T(`option`,{key:e.combo,value:e.combo},h(e.verb)+` → `+h(e.target_kind),9,$e))),128))],512),[[le,i.value]]),oe(p(`select`,{"onUpdate:modelValue":n[1]||=e=>c.value=e},[n[4]||=p(`option`,{value:``},`Select instance...`,-1),(y(!0),T(v,null,s(m.value,e=>(y(),T(`option`,{key:e,value:e},h(e),9,et))),128))],512),[[le,c.value]]),p(`button`,{class:`secondary btn-add`,type:`button`,onClick:g},[...n[5]||=[p(`i`,{class:`iconoir-plus`},null,-1),f(` Add `,-1)]])])],64))]))}},[[`__scopeId`,`data-v-e27dc1c0`]]),nt={class:`yaml-output-container`},rt={key:0,class:`conflict-error`},it={class:`yaml-success`},at={id:`yaml-content`},ot={key:0,class:`yaml-file-info`},st={key:1,class:`yaml-instructions`},ct={class:`yaml-actions`},lt=[`disabled`],ut=se({__name:`EditorYamlOutput`,props:{yaml:String,format:{type:String,default:`yaml`},kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:[`editAgain`],setup(e,{emit:t}){let i=e,s=l(null),c=l(`idle`),u=l(`idle`),m=l(null),g=a(()=>i.format===`markdown`),_=a(()=>g.value?`Markdown`:`YAML`),b=a(()=>g.value?`.md`:`.yaml`);ue(()=>{s.value&&n(s.value)}),o(()=>i.yaml,async()=>{await d(),s.value&&n(s.value)});async function S(){try{await navigator.clipboard.writeText(i.yaml),c.value=`copied`,setTimeout(()=>{c.value=`idle`},2e3)}catch{let e=document.createElement(`textarea`);e.value=i.yaml,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),c.value=`copied`,setTimeout(()=>{c.value=`idle`},2e3)}}async function ee(){u.value=`saving`,m.value=null;try{let e=await C(i.kind,i.name,i.yaml,i.contentHash);e.success?(u.value=`saved`,setTimeout(()=>{u.value=`idle`},2e3)):e.conflict?(m.value=e.error,u.value=`idle`):(alert(`Save failed: `+e.error),u.value=`idle`)}catch(e){alert(`Save failed: `+e.message),u.value=`idle`}}return(t,n)=>(y(),T(`div`,nt,[m.value?(y(),T(`div`,rt,[n[1]||=p(`i`,{class:`iconoir-warning-triangle`},null,-1),p(`span`,null,h(m.value),1)])):r(``,!0),p(`p`,it,[n[2]||=p(`i`,{class:`iconoir-check-circle`},null,-1),f(` Generated `+h(_.value),1)]),p(`div`,{ref_key:`codeEl`,ref:s},[p(`pre`,at,[p(`code`,{class:x(`language-${e.format}`)},h(e.yaml),3)])],512),p(`footer`,null,[e.pathRef?(y(),T(`p`,ot,[n[3]||=p(`i`,{class:`iconoir-folder`},null,-1),p(`span`,null,`Source: `+h(e.pathRef),1)])):(y(),T(`p`,st,[n[10]||=p(`i`,{class:`iconoir-info-circle`},null,-1),p(`span`,null,[f(` Copy this `+h(_.value)+` and save it to a `,1),p(`code`,null,h(b.value),1),n[6]||=f(` file in your resources directory`,-1),g.value?(y(),T(v,{key:0},[n[4]||=f(` (named `,-1),p(`code`,null,h(e.name)+`.md`,1),n[5]||=f(`)`,-1)],64)):r(``,!0),n[7]||=f(`, `,-1),n[8]||=p(`br`,null,null,-1),n[9]||=f(`then reload the application. `,-1)])])),p(`div`,ct,[e.pathRef&&e.inlineEditEnabled?(y(),T(`button`,{key:0,type:`button`,onClick:ee,disabled:u.value===`saving`,class:x({saved:u.value===`saved`})},[p(`i`,{class:x(u.value===`saving`?`iconoir-refresh`:u.value===`saved`?`iconoir-check`:`iconoir-check-circle`)},null,2),f(` `+h(u.value===`saving`?`Saving...`:u.value===`saved`?`Saved!`:`Save to File`),1)],10,lt)):r(``,!0),p(`button`,{type:`button`,onClick:S,class:x({copied:c.value===`copied`})},[p(`i`,{class:x(c.value===`copied`?`iconoir-check`:`iconoir-copy`)},null,2),f(` `+h(c.value===`copied`?`Copied!`:`Copy to Clipboard`),1)],2),p(`button`,{class:`secondary`,type:`button`,onClick:n[0]||=e=>t.$emit(`editAgain`)},[...n[11]||=[p(`i`,{class:`iconoir-edit-pencil`},null,-1),f(` Edit Again `,-1)]])])])]))}},[[`__scopeId`,`data-v-3a9b027a`]]);function E(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function dt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ft=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,pt=ft&&`documentMode`in document?document.documentMode:null,mt=ft&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ht=ft&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),gt=!(!ft||!(`InputEvent`in window)||pt)&&`getTargetRanges`in new window.InputEvent(`input`),_t=ft&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),vt=ft&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,yt=ft&&/Android/.test(navigator.userAgent),bt=ft&&/^(?=.*Chrome).*/i.test(navigator.userAgent),xt=ft&&yt&&bt,St=ft&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mt&&!bt,Ct=0,wt=1,Tt=2,Et=1,Dt=2,Ot=3,kt=4,At=5,jt=6,Mt=_t||vt||St?`\xA0`:``,Nt=`
|
|
2
|
-
|
|
3
|
-
`,Pt=ht?`\xA0`:Mt,Ft=RegExp(`^[^A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--]*[֑-߿יִ-﷽ﹰ-ﻼ]`),It=RegExp(`^[^֑-߿יִ-﷽ﹰ-ﻼ]*[A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--]`),Lt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Rt={directionless:1,unmergeable:2},zt={center:2,end:6,justify:4,left:1,right:3,start:5},Bt={[Dt]:`center`,[jt]:`end`,[kt]:`justify`,[Et]:`left`,[Ot]:`right`,[At]:`start`},Vt={normal:0,segmented:2,token:1},Ht={[Ct]:`normal`,[Tt]:`segmented`,[wt]:`token`},Ut=`$config`;function Wt(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(z(o)&&Wt(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Gt=!1,Kt=0;function qt(e){Kt=e.timeStamp}function Jt(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Jo(e,n)!==void 0}function Yt(e,t,n){let r=Fs(Ds(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&os(t,o,i,a,!1)}function Xt(e,t,n){if(N(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Ro(t)&&n.isAttached()}function Zt(e,t,n,r){for(let i=e;i&&!Xs(i);i=xs(i)){let e=Jo(i,t);if(e!==void 0){let t=W(e,n);if(t)return B(t)||!J(i)?void 0:[i,t]}else if(i===r)return[r,Qo(n)]}}function Qt(e,t,n){Gt=!0;let r=performance.now()-Kt>100;try{ro(e,()=>{let i=P()||function(e){return e.getEditorState().read(()=>{let e=P();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Zt(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&M(g)&&Ro(p)&&Xt(i,p,g)&&Yt(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=qo(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Jt(r,a,e)){if(ht){let e=(J(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Jt(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Jt(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&$o(i),ht&&ys(e)&&i.insertRawText(u))})}finally{Gt=!1}}function $t(e){let t=e._observer;t!==null&&Qt(e,t.takeRecords(),t)}function en(e){(function(e){Kt===0&&Ds(e).addEventListener(`textInput`,qt,!0)})(e),e._observer=new MutationObserver((t,n)=>{Qt(e,t,n)})}var tn=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||dn).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function nn(e,t){return new tn(e,t)}function rn(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function an(e,t,n){let r;if(L(),typeof n==`function`){let i=e.getLatest(),a=rn(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return cn(i).updateFromKnown(t,r),i}function on(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Qs(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var sn=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return un(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=un(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function cn(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new sn(t,ln(t));return t.__state=n,n}function ln(e){return e.__state?e.__state.sharedNodeState:Eo(Us(),e.getType()).sharedNodeState}function un(e){if(e)for(let t in e)return e}function dn(e){return e}function fn(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function pn(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function mn(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function hn(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&fn(n,e,t)||t&&fn(n,t,e)||e&&pn(n,e,t)||t&&pn(n,t,e))}(c,l))}function gn(e,t){let n=e.mergeWithSibling(t),r=R()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function _n(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&M(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(hn(t,r)){r=gn(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&M(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(hn(r,n)){r=gn(r,n);break}break}n.remove()}}else r.remove()}function vn(e){return yn(e.anchor),yn(e.focus),e}function yn(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),M(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!z(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var bn,D,xn,Sn,Cn,wn,Tn,En,Dn,On,O=``,kn=null,An=null,jn=!1,Mn=!1;function Nn(e,t){let n=Tn.get(e);if(t!==null){let n=Zn(e);n.parentNode===t&&t.removeChild(n)}if(En.has(e)||D._keyToDOMMap.delete(e),z(n)){let e=Gn(n,Tn);Pn(e,0,e.length-1,null)}n!==void 0&&gs(On,xn,Sn,n,`destroyed`)}function Pn(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Nn(t,r)}}function Fn(e,t){e.setProperty(`text-align`,t)}var In=`40px`;function Ln(e,t){let n=bn.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(D._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||In;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function Rn(e,t){let n=e.style;t===0?Fn(n,``):t===1?Fn(n,`left`):t===2?Fn(n,`center`):t===3?Fn(n,`right`):t===4?Fn(n,`justify`):t===5?Fn(n,`start`):t===6&&Fn(n,`end`)}function zn(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(V(e))return null;let n=e.getParentOrThrow();return V(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Bn(e,t){let n=En.get(e);n===void 0&&E(60);let r=n.createDOM(bn,D);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,D),M(n)?r.setAttribute(`data-lexical-text`,`true`):B(n)&&r.setAttribute(`data-lexical-decorator`,`true`),z(n)){let e=n.__indent,t=n.__size;if(zn(r,n),e!==0&&Ln(r,e),t!==0){let e=t-1;Vn(Gn(n,En),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Rn(r,i),n.isInline()||Un(null,n,r)}else{let t=n.getTextContent();if(B(n)){let t=n.decorate(D,bn);t!==null&&qn(e,t),r.contentEditable=`false`}O+=t}return t!==null&&t.insertChild(r),gs(On,xn,Sn,n,`created`),r}function Vn(e,t,n,r,i){let a=O;O=``;let o=n;for(;o<=r;++o){Bn(e[o],i);let t=En.get(e[o]);t!==null&&M(t)?kn===null&&(kn=t.getFormat(),An=t.getStyle()):z(t)&&o<r&&!t.isInline()&&(O+=Nt)}i.element.__lexicalTextContent=O,O=a+O}function Hn(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return A(e)?`line-break`:B(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Un(e,t,n){let r=Hn(e,Tn),i=Hn(t,En);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Wn(e,t,n){var r;kn=null,An=null,function(e,t,n){let r=O,i=e.__size,a=t.__size;O=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Kn(n,o);else{let e=Zn(n),t=Bn(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Nn(n,null)}let i=En.get(r);M(i)&&kn===null&&(kn=i.getFormat(),An=i.getStyle())}else{let r=Gn(e,Tn),s=Gn(t,En);if(r.length!==i&&E(227),s.length!==a&&E(228),i===0)a!==0&&Vn(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Pn(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Jn(Kn(r,a.element)),d++,f++;else{if(l===void 0&&(l=Yn(n,f)),c===void 0)c=Yn(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Jn(Zn(e)),Nn(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=bs(D,r);e!==u&&a.withBefore(u).insertChild(e),u=Jn(Kn(r,a.element)),d++,f++}else Bn(r,a.withBefore(u)),f++}let i=En.get(r);i!==null&&M(i)?kn===null&&(kn=i.getFormat(),An=i.getStyle()):z(i)&&f<=s&&!i.isInline()&&(O+=Nt)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:D.getElementByKey(e);Vn(n,0,f,s,a.withBefore(t))}else m&&!p&&Pn(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=O,O=r+O}(e,t,t.getDOMSlot(n)),r=t,kn==null||kn===r.__textFormat||Mn||r.setTextFormat(kn),function(e){An==null||An===e.__textStyle||Mn||e.setTextStyle(An)}(t)}function Gn(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&E(101),n.push(r),r=e.__next}return n}function Kn(e,t){let n=Tn.get(e),r=En.get(e);n!==void 0&&r!==void 0||E(61);let i=jn||wn.has(e)||Cn.has(e),a=bs(D,e);if(n===r&&!i){let e;if(z(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return O+=e,a}if(n!==r&&i&&gs(On,xn,Sn,r,`updated`),r.updateDOM(n,a,bn)){let n=Bn(e,null);return t===null&&E(62),t.replaceChild(n,a),Nn(e,null),n}if(z(n)){z(r)||E(334,e);let t=r.__indent;(jn||t!==n.__indent)&&Ln(a,t);let o=r.__format;if((jn||o!==n.__format)&&Rn(a,o),i)Wn(n,r,a),V(r)||r.isInline()||Un(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),O+=t}if((jn||r.__dir!==n.__dir)&&(zn(a,r),V(r)&&!jn))for(let e of r.getChildren())z(e)&&zn(bs(D,e.getKey()),e)}else{let t=r.getTextContent();if(B(r)){let t=r.decorate(D,bn);t!==null&&qn(e,t)}O+=t}if(!Mn&&V(r)&&r.__cachedText!==O){let e=r.getWritable();e.__cachedText=O,r=e}return a}function qn(e,t){let n=D._pendingDecorators,r=D._decorators;if(n===null){if(r[e]===t)return;n=Xo(D)}n[e]=t}function Jn(e){let t=e.nextSibling;return t!==null&&t===D._blockCursorElement&&(t=t.nextSibling),t}function Yn(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Xn(e,t,n,r,i,a){O=``,jn=r===2,D=n,bn=n._config,xn=n._nodes,Sn=D._listeners.mutation,Cn=i,wn=a,Tn=e._nodeMap,En=t._nodeMap,Mn=t._readOnly,Dn=new Map(n._keyToDOMMap);let o=new Map;return On=o,Kn(`root`,null),D=void 0,xn=void 0,Cn=void 0,wn=void 0,Tn=void 0,En=void 0,bn=void 0,Dn=void 0,On=void 0,o}function Zn(e){let t=Dn.get(e);return t===void 0&&E(75,e),t}function k(e){return{type:e}}var Qn=k(`SELECTION_CHANGE_COMMAND`),$n=k(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),er=k(`CLICK_COMMAND`),tr=k(`BEFORE_INPUT_COMMAND`),nr=k(`INPUT_COMMAND`),rr=k(`COMPOSITION_START_COMMAND`),ir=k(`COMPOSITION_END_COMMAND`),ar=k(`DELETE_CHARACTER_COMMAND`),or=k(`INSERT_LINE_BREAK_COMMAND`),sr=k(`INSERT_PARAGRAPH_COMMAND`),cr=k(`CONTROLLED_TEXT_INSERTION_COMMAND`),lr=k(`PASTE_COMMAND`),ur=k(`REMOVE_TEXT_COMMAND`),dr=k(`DELETE_WORD_COMMAND`),fr=k(`DELETE_LINE_COMMAND`),pr=k(`FORMAT_TEXT_COMMAND`),mr=k(`UNDO_COMMAND`),hr=k(`REDO_COMMAND`),gr=k(`KEYDOWN_COMMAND`),_r=k(`KEY_ARROW_RIGHT_COMMAND`),vr=k(`MOVE_TO_END`),yr=k(`KEY_ARROW_LEFT_COMMAND`),br=k(`MOVE_TO_START`),xr=k(`KEY_ARROW_UP_COMMAND`),Sr=k(`KEY_ARROW_DOWN_COMMAND`),Cr=k(`KEY_ENTER_COMMAND`),wr=k(`KEY_SPACE_COMMAND`),Tr=k(`KEY_BACKSPACE_COMMAND`),Er=k(`KEY_ESCAPE_COMMAND`),Dr=k(`KEY_DELETE_COMMAND`),Or=k(`KEY_TAB_COMMAND`),kr=k(`INSERT_TAB_COMMAND`),Ar=k(`INDENT_CONTENT_COMMAND`),jr=k(`OUTDENT_CONTENT_COMMAND`),Mr=k(`DROP_COMMAND`),Nr=k(`FORMAT_ELEMENT_COMMAND`),Pr=k(`DRAGSTART_COMMAND`),Fr=k(`DRAGOVER_COMMAND`),Ir=k(`DRAGEND_COMMAND`),Lr=k(`COPY_COMMAND`),Rr=k(`CUT_COMMAND`),zr=k(`SELECT_ALL_COMMAND`),Br=k(`CLEAR_EDITOR_COMMAND`),Vr=k(`CLEAR_HISTORY_COMMAND`),Hr=k(`CAN_REDO_COMMAND`),Ur=k(`CAN_UNDO_COMMAND`),Wr=k(`FOCUS_COMMAND`),Gr=k(`BLUR_COMMAND`),Kr=k(`KEY_MODIFIER_COMMAND`),qr=Object.freeze({}),Jr=[[`keydown`,function(e,t){Yr=e.timeStamp,Xr=e.key,!t.isComposing()&&q(t,gr,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;Rs(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&ro(t,()=>{ko(n)||(ni=!0)})}],[`compositionstart`,function(e,t){q(t,rr,e)}],[`compositionend`,function(e,t){ht?ii=!0:vt||!_t&&!St?q(t,ir,e):(ai=!0,oi=e.data)}],[`input`,function(e,t){e.stopPropagation(),ro(t,()=>{t.dispatchCommand(nr,e)},{event:e}),Qr=null}],[`click`,function(e,t){ro(t,()=>{let n=P(),r=Fs(Ds(t)),i=Ea();if(r){if(N(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!V(a)&&G().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=ec(a,e=>z(e)&&!e.isInline());z(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(J(n)||Ro(n))&&$o(Ta(i,r,t,e))}}q(t,er,e)})}],[`cut`,qr],[`copy`,qr],[`dragstart`,qr],[`dragover`,qr],[`dragend`,qr],[`paste`,qr],[`focus`,qr],[`blur`,qr],[`drop`,qr]];gt&&Jr.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||ht&&ys(t)||n!==`insertCompositionText`&&q(t,tr,e)}(e,t)]);var Yr=0,Xr=null,Zr=0,Qr=null,$r=new WeakMap,ei=new WeakMap,ti=!1,ni=!1,ri=!1,ii=!1,ai=!1,oi=``,si=null,ci=[0,``,0,`root`,0];function li(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=R(),l=Fs(Ds(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!M(s)||(!i&&(!gt||Zr<r+50)||s.isDirty()&&p<2||ts(n))&&a.offset!==o.offset&&!s.isComposing()||Lo(s)||s.isDirty()&&p>1||(i||!gt)&&f!==null&&!s.isComposing()&&u!==Bo(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Io(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(M(t)||z(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function ui(e,t){return Ro(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function di(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;ti&&(ti=!1,ui(r,i)&&ui(a,o)&&!si)||ro(t,()=>{if(!n)return void $o(null);if(!jo(t,r,a))return;let s=P();if(si&&N(s)&&s.isCollapsed()){let e=s.anchor,t=si.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=si.clone(),$o(s))}if(si=null,N(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=Ds(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=ci,f=G(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)fi(s,o,c);else if(n.type===`text`)M(r)||E(141),pi(s,r);else if(n.type===`element`&&!p){z(r)||E(259);let e=n.getNode();e.isEmpty()?function(e,t){fi(e,t.getTextFormat(),t.getTextStyle())}(s,e):fi(s,0,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(M(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}q(t,Qn,void 0)})}function fi(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function pi(e,t){fi(e,t.getFormat(),t.getStyle())}function mi(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function hi(e){let t=e.inputType,n=mi(e),r=R(),i=P();if(t===`deleteContentBackward`){if(i===null){let e=Ea();if(!N(e))return!0;$o(e.clone())}if(N(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Xr===`MediaLast`&&a<Yr+30&&r.isComposing()&&t){if(U(null),Yr=0,setTimeout(()=>{ro(r,()=>{U(null)})},30),N(i)){let e=i.anchor.getNode();e.markDirty(),M(e)||E(142),pi(i,e)}}else{U(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=xt&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!B(vs(i.anchor,!0))),!c){q(r,ar,!0);let e=P();xt&&N(e)&&e.isCollapsed()&&(si=e,setTimeout(()=>si=null))}}return!0}}var a;if(!N(i))return!0;let o=e.data;Qr!==null&&as(!1,r,Qr),i.dirty&&Qr===null||!i.isCollapsed()||V(i.anchor.getNode())||n===null||i.applyDOMRange(n),Qr=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
4
|
-
`)e.preventDefault(),q(r,or,!1);else if(o===Nt)e.preventDefault(),q(r,sr,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&li(i,n,o,e.timeStamp,!0)?(e.preventDefault(),q(r,cr,o)):Qr=o;return Zr=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:q(r,cr,e);break;case`insertFromComposition`:U(null),q(r,cr,e);break;case`insertLineBreak`:U(null),q(r,or,!1);break;case`insertParagraph`:U(null),ri&&!vt?(ri=!1,q(r,or,!1)):q(r,sr,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:q(r,lr,e);break;case`deleteByComposition`:(function(e,t){return e!==t||z(e)||z(t)||!Io(e)||!Io(t)})(l,u)&&q(r,ur,e);break;case`deleteByDrag`:case`deleteByCut`:q(r,ur,e);break;case`deleteContent`:q(r,ar,!1);break;case`deleteWordBackward`:q(r,dr,!0);break;case`deleteWordForward`:q(r,dr,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:q(r,fr,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:q(r,fr,!1);break;case`formatStrikeThrough`:q(r,pr,`strikethrough`);break;case`formatBold`:q(r,pr,`bold`);break;case`formatItalic`:q(r,pr,`italic`);break;case`formatUnderline`:q(r,pr,`underline`);break;case`historyUndo`:q(r,mr,void 0);break;case`historyRedo`:q(r,hr,void 0)}return!0}function gi(e){if(J(e.target)&&ko(e.target))return!0;let t=R(),n=P(),r=e.data,i=mi(e);if(r!=null&&N(n)&&li(n,i,r,e.timeStamp,!1)){ii&&=(yi(t,r),!1);let i=n.anchor.getNode(),a=Fs(Ds(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;gt&&!n.isCollapsed()&&M(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===is(a.anchorNode)||q(t,cr,r);let l=r.length;ht&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),xt&&t.isComposing()&&(Yr=0,U(null))}else as(!1,t,r===null?void 0:r),ii&&=(yi(t,r||void 0),!1);return function(){L(),$t(R())}(),!0}function _i(e){let t=R(),n=P();if(N(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();U(r.key),Cs(Pi),(e.timeStamp<Yr+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||M(i)&&i.getStyle()!==n.style)&&q(t,cr,Pt)}return!0}function vi(e){return yi(R(),e.data),Cs(Fi),!0}function yi(e,t){let n=e._compositionKey;if(U(null),n!==null&&t!=null){if(t===``){let t=W(n),r=Bo(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&M(t)){let n=Fs(Ds(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),os(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
|
|
5
|
-
`){let t=P();if(N(t)||da(t)){if(N(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}q(e,Cr,null);return}}}as(!0,e,t)}function bi(e){let t=R();if(e.key==null)return!0;if(ai){if(fs(e))return ro(t,()=>{yi(t,oi)}),ai=!1,oi=``,!0;ai=!1,oi=``}if(function(e){return K(e,`ArrowRight`,{shiftKey:`any`})}(e))q(t,_r,e);else if(function(e){return K(e,`ArrowRight`,us)}(e))q(t,vr,e);else if(function(e){return K(e,`ArrowLeft`,{shiftKey:`any`})}(e))q(t,yr,e);else if(function(e){return K(e,`ArrowLeft`,us)}(e))q(t,br,e);else if(function(e){return K(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))q(t,xr,e);else if(function(e){return K(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))q(t,Sr,e);else if(function(e){return K(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))ri=!0,q(t,Cr,e);else if(function(e){return e.key===` `}(e))q(t,wr,e);else if(function(e){return mt&&K(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),ri=!0,q(t,or,!0);else if(function(e){return K(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))ri=!1,q(t,Cr,e);else if(function(e){return K(e,`Backspace`,{shiftKey:`any`})||mt&&K(e,`h`,{ctrlKey:!0})}(e))fs(e)?q(t,Tr,e):(e.preventDefault(),q(t,ar,!0));else if(function(e){return e.key===`Escape`}(e))q(t,Er,e);else if(function(e){return K(e,`Delete`,{})||mt&&K(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?q(t,Dr,e):(e.preventDefault(),q(t,ar,!1));else if(function(e){return K(e,`Backspace`,ds)}(e))e.preventDefault(),q(t,dr,!0);else if(function(e){return K(e,`Delete`,ds)}(e))e.preventDefault(),q(t,dr,!1);else if(function(e){return mt&&K(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),q(t,fr,!0);else if(function(e){return mt&&(K(e,`Delete`,{metaKey:!0})||K(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),q(t,fr,!1);else if(function(e){return K(e,`b`,us)}(e))e.preventDefault(),q(t,pr,`bold`);else if(function(e){return K(e,`u`,us)}(e))e.preventDefault(),q(t,pr,`underline`);else if(function(e){return K(e,`i`,us)}(e))e.preventDefault(),q(t,pr,`italic`);else if(function(e){return K(e,`Tab`,{shiftKey:`any`})}(e))q(t,Or,e);else if(function(e){return K(e,`z`,us)}(e))e.preventDefault(),q(t,mr,void 0);else if(function(e){return mt?K(e,`z`,{metaKey:!0,shiftKey:!0}):K(e,`y`,{ctrlKey:!0})||K(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),q(t,hr,void 0);else{let n=t._editorState._selection;n===null||N(n)?ps(e)&&(e.preventDefault(),q(t,zr,e)):function(e){return K(e,`c`,us)}(e)?(e.preventDefault(),q(t,Lr,e)):function(e){return K(e,`x`,us)}(e)?(e.preventDefault(),q(t,Rr,e)):ps(e)&&(e.preventDefault(),q(t,zr,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Kr,e),!0}function xi(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Si=new Map;function Ci(e){let t=Is(e.target);if(t===null)return;let n=No(t.anchorNode);if(n===null)return;ni&&(ni=!1,ro(n,()=>{let r=Ea(),i=t.anchorNode;(J(i)||Ro(i))&&$o(Ta(r,t,n,e))}));let r=ns(n),i=r[r.length-1],a=i._key,o=Si.get(a),s=o||i;s!==n&&di(t,s,!1),di(t,n,!0),n===i?o&&Si.delete(a):Si.set(a,n)}function wi(e){e._lexicalHandled=!0}function Ti(e){return!0===e._lexicalHandled}function Ei(e){let t=$r.get(e);if(t===void 0)return;let n=ei.get(t);if(n===void 0)return;let r=n-1;r>=0||E(164),$r.delete(e),ei.set(t,r),r===0&&t.removeEventListener(`selectionchange`,Ci);let i=Po(e);Mo(i)?(function(e){if(e._parentEditor!==null){let t=ns(e),n=t[t.length-1]._key;Si.get(n)===e&&Si.delete(n)}else Si.delete(e._key)}(i),e.__lexicalEditor=null):i&&E(198);let a=xi(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function Di(e,t,n){L();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=P();if(!N(t)||!z(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Ts(i,e)&&n.set(e.__key,0,`element`),Ts(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(N(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(ka(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(ka(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else da(a)&&t&&e.isSelected()&&e.selectPrevious();if(N(a)&&t&&!o){let t=e.getIndexWithinParent();Wo(e),Da(a,i,t,-1)}else Wo(e);n||ks(i)||i.canBeEmpty()||!i.isEmpty()||Di(i,t),t&&a&&V(i)&&i.isEmpty()&&i.selectEnd()}function Oi(e){return e}var ki=Symbol.for(`ephemeral`);function Ai(e){return e[ki]||!1}var ji=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Qs(this);return e===void 0&&E(64,this.name),e}static clone(e){E(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Uo(this,e)}getType(){return this.__type}isInline(){E(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=W(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||P();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(M(this))return n;if(N(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(B(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:W(e)}getParentOrThrow(){let e=this.getParent();return e===null&&E(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(ks(t))return z(e)||e===this&&B(e)||E(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&E(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:W(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:W(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=z(this)?this:this.getParent(),n=z(e)?e:e.getParent(),r=t&&n?jc(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=jc(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?Oc(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&E(279),!1)))}isParentOf(e){let t=jc(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=z(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&E(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=R()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Ai(this))return this;let e=W(this.__key);return e===null&&E(113),e}getWritable(){if(Ai(this))return this;L();let e=Wa(),t=R(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=P();if(o!==null&&o.setCachedNodes(null),a.has(r))return Go(i),i;let s=qs(i);return a.add(r),Go(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){E(70)}updateDOM(e,t,n){E(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){E(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of ln(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&cn(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Di(this,!0,e)}replace(e,t){L();let n=P();n!==null&&(n=n.clone()),js(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;Wo(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(Di(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(z(this)&&z(o)||E(139),this.getChildren().forEach(e=>{o.append(e)})),N(n)){$o(n);let e=n.anchor,t=n.focus;e.key===i&&ca(e,o),t.key===i&&ca(t,o)}return Ko()===i&&U(a),o}insertAfter(e,t=!0){L(),js(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=P(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(Wo(r),N(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&N(a)){let e=this.getIndexWithinParent();Da(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){L(),js(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;Wo(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=P();return t&&N(l)&&Da(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return H()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){L();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(z(n))return n.select();if(!M(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){L();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(z(n))return n.select(0,0);if(!M(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},Mi=`history-push`,Ni=`history-merge`,Pi=`composition-start`,Fi=`composition-end`,Ii=class e extends ji{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
6
|
-
`}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&Vs(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&zi(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&zi(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&Vs(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&zi(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&zi(r))return!0}return!1}(e)?null:{conversion:Li,priority:0}}}static importJSON(e){return Ri().updateFromJSON(e)}};function Li(e){return{node:Ri()}}function Ri(){return As(new Ii)}function A(e){return e instanceof Ii}function zi(e){return Ro(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Bi(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function Vi(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Hi(e,t,n,r,i){let a=r.classList,o=hs(i,`base`);o!==void 0&&a.add(...o),o=hs(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Lt){let r=Lt[e];if(o=hs(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}}function Ui(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?Mt:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a){if(i||ht){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}}function Wi(e,t,n,r,i,a){Ui(i,e,t);let o=a.theme.text;o!==void 0&&Hi(0,0,r,e,o)}function Gi(e,t){let n=document.createElement(t);return n.appendChild(e),n}var Ki=class e extends ji{__text;__format;__style;__mode;__detail;static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return Ht[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ko()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Lt[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Vo(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Bi(0,n),i=Vi(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),Wi(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Bi(0,i),s=Bi(0,a),c=Vi(0,i),l=Vi(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??E(48);let i=document.createElement(l);return Wi(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??E(49)),Ui(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Hi(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:Zi,priority:0}),b:()=>({conversion:Ji,priority:0}),code:()=>({conversion:ea,priority:0}),em:()=>({conversion:ea,priority:0}),i:()=>({conversion:ea,priority:0}),mark:()=>({conversion:ea,priority:0}),s:()=>({conversion:ea,priority:0}),span:()=>({conversion:qi,priority:0}),strong:()=>({conversion:ea,priority:0}),sub:()=>({conversion:ea,priority:0}),sup:()=>({conversion:ea,priority:0}),u:()=>({conversion:ea,priority:0})}}static importJSON(e){return j().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return J(t)||E(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Gi(t,`b`)),this.hasFormat(`italic`)&&(t=Gi(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Gi(t,`s`)),this.hasFormat(`underline`)&&(t=Gi(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Lt[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Rt[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Vo(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Vt[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){L();let n=e,r=t,i=P(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!N(i))return Sa(o,n,o,r,`text`,`text`);{let e=Ko();e!==i.anchor.key&&e!==i.focus.key||U(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=P();if(r&&N(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){L();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Ko(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=P();if(N(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=j(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=mn(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=j(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=mn(t,n);let a=n.__key;i===r&&U(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&Go(t),n!==null&&Go(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),N(v)&&Da(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||E(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Ko()===r&&U(n);let o=P();if(N(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Aa(i,t,n,e,a),s!==null&&s.key===r&&Aa(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function qi(e){return{forChild:ta(e.style),node:null}}function Ji(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:ta(t.style,n?void 0:`bold`),node:null}}var Yi=new WeakMap;function Xi(e){if(!J(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Zi(e){let t=e;e.parentElement===null&&E(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=Yi.get(n))===void 0&&!Xi(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)Yi.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
|
|
7
|
-
`||r===`\r
|
|
8
|
-
`?t.push(Ri()):r===` `?t.push(ra()):r!==``&&t.push(j(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Qi(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Qi(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:j(n)}}function Qi(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,J(n)){let e=n.style.display;if(e===``&&!Bs(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Ro(n))return n;if(n.nodeName===`BR`)return null}}var $i={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function ea(e){let t=$i[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:ta(e.style,t),node:null}}function j(e=``){return As(new Ki(e))}function M(e){return e instanceof Ki}function ta(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>M(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var na=class e extends Ki{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=hs(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return ra().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&dt(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||E(286),this}setDetail(e){return e!==2&&E(127),this}setMode(e){return e!==`normal`&&E(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function ra(){return As(new na)}function ia(e){return e instanceof na}var aa=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Dc(Vc(Mc(this,`next`)),Vc(Mc(e,`next`)))<0}getNode(){let e=W(this.key);return e===null&&E(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Ha()||(Ko()===a&&U(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function oa(e,t,n){return new aa(e,t,n)}function sa(e,t){let n=t.__key,r=e.offset,i=`element`;if(M(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!z(t)){let e=t.getNextSibling();if(M(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function ca(e,t){if(z(t)){let n=t.getLastDescendant();z(n)||M(n)?sa(e,n):sa(e,t)}else sa(e,t)}var la=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!da(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(M(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=W(e);t!==null&&n.push(t)}return Ha()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((P()||Ea())===this&&e[0]){let t=Y(e[0],`next`);Pc(Tc(t,t))}for(let t of e)t.remove()}};function N(e){return e instanceof ua}var ua=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!N(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(dc(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;z(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),uc(e.focus)&&z(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=vc(e.focus.origin,`previous`);dc(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=bc(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!z(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Vc(e.anchor),r=Vc(e.anchor.getFlipped()),i=e=>lc(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Wc(Ic(this),`next`));return Ha()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=pa(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(z(d)&&!d.isInline())l||(c+=`
|
|
9
|
-
`),l=!d.isEmpty();else if(l=!1,M(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else!B(d)&&!A(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=R(),n=t.getEditorState()._selection,r=ba(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),vn(this)}clone(){let t=this.anchor,n=this.focus;return new e(oa(t.key,t.offset,t.type),oa(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Vo(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Lt[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
|
|
10
|
-
`||r===`\r
|
|
11
|
-
`?n.push(Ri()):r===` `?n.push(ra()):n.push(j(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=j();if(o.setFormat(n),o.setStyle(r),vo(a))a.splice(0,0,[o]);else{let e=V(i)?H().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&Nc(o,Vc(Mc(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];M(d)||E(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(Lo(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(M(t)&&t.canInsertTextBefore()&&!Lo(t)||(t=j(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(Lo(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(M(t)&&!Lo(t)||(t=j(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=j(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||z(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),ya(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(Io(d)){let t=j(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(ia(d)){let t=j(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=j(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=z(d)?d:d.getParentOrThrow(),r=z(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c){if(M(m)&&!Io(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=j(m.getTextContent());m.replace(e),m=e}V(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||z(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Io(d)){if(s===f)d.select();else{let t=j(e);t.select(),d.replace(t)}}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=P()===this;Fc(this,Bc(Ic(this))),e&&P()!==this&&$o(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void U(null);let n=this.getNodes(),r=[];for(let e of n)M(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(z(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},a=r.length;if(a===0)return this.toggleFormat(e),U(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(Lo(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||Lo(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||Lo(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=P();return N(t)||E(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=ec(t,Hs),r=e[e.length-1];if(z(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=Fa(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(z(e)||B(e))&&!e.isInline())){z(n)||E(211,t.constructor.name,t.getType());let i=Fa(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=H(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=A(i);if(a||B(i)&&i.isInline()||z(i)&&i.isInline()||M(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!z(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;z(u=l)&&Hs(u)&&!u.isEmpty()&&z(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(z(n)||E(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&E(212,t.constructor.name,t.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||E(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(n,l));let d=ec(a,Hs);s&&z(d)&&(s.canMergeWhenEmpty()||Hs(c))&&(d.append(...s.getChildren()),s.remove()),z(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=z(n)?n.getLastChild():null;A(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=H();return G().splice(this.anchor.offset,0,[e]),e.select(),e}let e=Fa(this),t=ec(this.anchor.getNode(),Hs);z(t)||E(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=Ri();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=pa(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(M(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(M(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),M(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(La(this,e,t,n))return;let r=e===`move`,i=R(),a=Fs(Ds(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!z(c)||c.isInline()||c.canBeEmpty()||Ps(o,i,s),this.dirty){let e=bs(i,this.anchor.key),t=bs(i,this.focus.key);this.anchor.type===`text`&&(e=Bo(e)),this.focus.type===`text`&&(t=Bo(t)),e&&t&&ja(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=V(n)?n:Os(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];Ts(t,i)?r.push(t):o=!0}if(o&&r.length>0){if(t){let e=r[0];z(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];z(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&La(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&z(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(z(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=Cc(Mc(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(dc(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(z(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=Vc(t);Fc(this,Tc(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(uc(t)){if(z(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(B(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&z(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=wa();e.add(t.origin.getKey()),$o(e)}else t.origin.remove()}return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Fc(this,Tc(!t.origin.isEmpty()&&n.isEmpty()?Lc(Y(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&ma(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void ga(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void ga(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(ts(e)||ha(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&V(e.getParent())&&e.getPreviousSibling()===null&&ma(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function da(e){return e instanceof la}function fa(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function pa(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[fa(n),fa(r)]}function ma(e,t){for(let n=t;n;n=n.getParent()){if(z(n)){if(n.collapseAtStart(e))return!0;if(ks(n))break}if(n.getPreviousSibling())break}return!1}var ha=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function ga(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function _a(e,t,n,r){let i,a=t;if(J(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=es(u),M(i))a=gc(i,o?`next`:`previous`);else{let s=es(e);if(s===null)return null;if(z(s)){let c=r.getElementByKey(s.getKey());c===null&&E(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),z(s)||E(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(z(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=z(u)?u:u.getParentOrThrow()),a=0}M(u)?(i=u,s=null,a=gc(u,o?`next`:`previous`)):u!==s&&o&&!d&&(z(s)||E(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&B(s)&&es(e)===s?n:n+1,s=s.getParentOrThrow()}if(z(s))return oa(s.__key,a,`element`)}}else i=es(e);return M(i)?oa(i.__key,gc(i,a,`clamp`),`text`):null}function va(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&z(a)&&a.isInline()){let t=a.getPreviousSibling();M(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else z(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):M(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&z(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&z(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();M(t)&&e.set(t.__key,0,`text`)}}}function ya(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);va(e,n,r),va(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function ba(e,t,n,r,i,a){if(e===null||n===null||!jo(i,e,n))return null;let o=_a(e,t,N(a)?a.anchor:null,i);if(o===null)return null;let s=_a(n,r,N(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=es(e),r=es(n);if(B(t)&&B(r))return null}return ya(o,s),[o,s]}function xa(e){return z(e)&&!e.isInline()}function Sa(e,t,n,r,i,a){let o=Wa(),s=new ua(oa(e,t,i),oa(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Ca(){return new ua(oa(`root`,0,`element`),oa(`root`,0,`element`),0,``)}function wa(){return new la(new Set)}function Ta(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Gt&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(N(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,(s||o===void 0)&&N(e)&&!jo(n,l,u))return e.clone();let p=ba(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p,g=0,_=``;if(N(e)){let t=e.anchor;if(m.key===t.key)g=e.format,_=e.style;else{let e=m.getNode();M(e)?(g=e.getFormat(),_=e.getStyle()):z(e)&&(g=e.getTextFormat(),_=e.getTextStyle())}}return new ua(m,h,g,_)}function P(){return Wa()._selection}function Ea(){return R()._editorState._selection}function Da(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),Oa(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}Oa(e)}function Oa(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!z(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(M(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(z(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(M(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(z(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(M(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function ka(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,M(i)?s=`text`:z(i)&&(s=`element`)):(a=r.__key,M(r)?(o=r.getTextContentSize(),s=`text`):z(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Aa(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function ja(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Ma(e,t,n){let r=bs(e,t.getKey());if(z(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function Na(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&Ao(d))return;if(!N(t))return void(e!==null&&jo(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=Ma(n,m,f.offset),[v,y]=Ma(n,h,p.offset),b=t.format,x=t.style,S=t.isCollapsed(),C=g,ee=v,te=!1;var w,ne,T,re,ie;if(f.type===`text`?(C=Bo(g),te=m.getFormat()!==b||m.getStyle()!==x):N(e)&&e.anchor.type===`text`&&(te=!0),p.type===`text`&&(ee=Bo(v)),C!==null&&ee!==null&&(S&&(e===null||te||N(e)&&(e.format!==b||e.style!==x))&&(w=b,ne=x,T=_,re=f.key,ie=performance.now(),ci=[w,ne,T,re,ie]),l!==_||u!==y||s!==C||c!==ee||r.type===`Range`&&S||(d!==null&&a.contains(d)||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0}),f.type===`element`))){if(ja(r,C,_,ee,y),!ht||!t.isCollapsed()||a===null||i.has(`skip-selection-focus`)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=N(t)&&t.anchor.type===`element`?C.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=Ss(n),i=Es(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t)s=0,c=Ds(e).innerHeight;else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0){if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}}if(t)break;l=xs(l)}})(n,t,a)}}ti=!0}}function Pa(e){let t=P()||Ea();t===null&&(t=G().selectEnd()),t.insertNodes(e)}function Fa(e){let t=e;e.isCollapsed()||t.removeText();let n=P();N(n)&&(t=n),N(t)||E(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!Hs(i);){let e=i;if([i,a]=Ia(i,a),e.is(i))break}return a}function Ia(e,t){let n=e.getParent();if(!n){let e=H();return G().append(e),e.select(),[G(),0]}if(M(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!z(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new ua(oa(e.__key,t,`element`),oa(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function La(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=Mc(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!Hc(c)){for(let e of c){l=!1;let{origin:t}=e;if(!B(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of Cc(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(dc(e))e.origin.isInline()||(c=e);else{if(z(e.origin))continue;B(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&B(c.origin)&&c.origin.isKeyboardSelectable()){let e=wa();return e.add(c.origin.getKey()),$o(e),!0}return c=Vc(c),s&&Nc(e.anchor,c),Nc(e.focus,c),l||!o}var F=null,I=null,Ra=!1,za=!1,Ba=0,Va={characterData:!0,childList:!0,subtree:!0};function Ha(){return Ra||F!==null&&F._readOnly}function L(){Ra&&E(13)}function Ua(){Ba>99&&E(14)}function Wa(){return F===null&&E(195,Ga()),F}function R(){return I===null&&E(196,Ga()),I}function Ga(){let e=0,t=new Set,n=So.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=Po(r);if(Mo(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Ka(){return I}function qa(e,t,n){let r=t.__type,i=Eo(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Ja(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Ya(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Xa(e){return Za(e,R()._nodes)}function Za(e,t){let n=e.type,r=t.get(n);r===void 0&&E(17,n);let i=r.klass;e.type!==i.getType()&&E(18,i.name);let a=i.importJSON(e),o=e.children;if(z(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Za(o[e],t);a.append(n)}return a}function Qa(e,t,n){let r=F,i=Ra,a=I;F=t,Ra=!0,I=e;try{return n()}finally{F=r,Ra=i,I=a}}function $a(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=F,u=Ra,d=I,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){I=e,F=n,Ra=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Xn(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),za)throw t;yo(e,null,r,n),en(e),e._dirtyType=2,za=!0,$a(e,a),za=!1;return}finally{p.observe(r,Va),e._updating=f,F=l,Ra=u,I=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=Xo(e)),delete r[a])}(e,n);let b=i?null:Fs(Ds(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){I=e,F=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Ps(t,e,r),Na(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(N(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Ns(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&Ns(t)){let n=t.getPreviousSibling();(n===null||Ns(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Kc(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Ps(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Va),I=d,F=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),N(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(Qn,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,eo(`decorator`,e,!0,x)),function(e,t,n){let r=Zo(t),i=Zo(n);r!==i&&eo(`textcontent`,e,!0,i)}(e,t||a,n),eo(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;no(e,t,r)}}}(e)}function eo(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function to(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&E(191),a._flushSync=!0),o&&e._deferred.push(o),Ya(e,i.tag)),a==null?no(e,n,i):n()}}return r}function no(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,Ya(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=uo(c||s),l=!0),c._flushSync=o;let u=F,d=Ra,f=I,p=e._updating;F=c,Ra=!1,e._updating=!0,I=e;let m=e._headless||e.getRootElement()===null;wo(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=Fs(Ds(e));return N(n)||n==null?Ta(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=to(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(N(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);M(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&_n(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Ko(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);M(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&_n(r),r!==void 0&&Ja(r,a)&&qa(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){Ba++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Ja(c,a)&&qa(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,Ba++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),to(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(z(t)&&Wt(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(N(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||E(19)}else da(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),$a(e);return}finally{F=u,Ra=d,I=f,e._updating=p,Ba=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,$a(e)):l&&Oo(()=>{$a(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function ro(e,t,n){I===e&&n===void 0?t():no(e,t,n)}var io=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&E(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&E(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&E(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(St||vt||_t);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=ao(t,n);i.push(r);let a=ao(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function ao(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&E(225),n.reverse()}var oo=class extends ji{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return Bt[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=R()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(M(t)&&e.push(t),z(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;z(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;z(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return z(e)&&e.getLastDescendant()||e||null}let r=t[e];return z(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:W(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&E(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:W(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&E(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),z(i)&&r!==n-1&&!i.isInline()&&(e+=Nt)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),z(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=zt[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Lt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Vo(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){L();let n=P(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(M(e)||z(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(M(e)||z(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return N(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):Sa(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:zt[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Ai(this)&&E(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||E(226,String(e),String(t),String(r));let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&E(100);let t=e.getNextSibling(),n=e.__key;Wo(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,Wo(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&E(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=P();if(N(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;so(r,t,n)&&ka(r,r.getNode(),this,l,c),so(i,t,n)&&ka(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||ks(this)||this.remove()}}return i}getDOMSlot(e){return new io(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(J(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||ks(this)||this.getChildren().some(M)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function z(e){return e instanceof oo}function so(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var co=class extends ji{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function B(e){return e instanceof co}var lo=class e extends oo{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){E(51)}getTextContent(){let e=this.__cachedText;return!Ha()&&R()._dirtyType!==0||e===null?super.getTextContent():e}remove(){E(52)}replace(e){E(53)}insertBefore(e){E(54)}insertAfter(e){E(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)z(e)||B(e)||E(282);return super.splice(e,t,n)}static importJSON(e){return G().updateFromJSON(e)}collapseAtStart(){return!0}};function V(e){return e instanceof lo}function uo(e){return new mo(new Map(e._nodeMap))}function fo(){return new mo(new Map([[`root`,new lo]]))}function po(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&E(130,n.name),z(e)){let r=t.children;Array.isArray(r)||E(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=po(i[e]);r.push(t)}}return t}var mo=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Qa(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Qa(null,this,()=>({root:po(G())}))}},ho=class extends oo{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},go=class e extends oo{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=hs(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:_o,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(J(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return H().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(M);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=H();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||M(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function _o(e){let t=H();if(e.style&&(t.setFormat(e.style.textAlign),Ys(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in zt&&t.setFormat(n)}return{node:t}}function H(){return As(new go)}function vo(e){return e instanceof go}function yo(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=fo(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function bo(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=Qs(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof ji&&e!==ji?e:void 0}}return t}function xo(e){let t=e||{},n=Ka(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=fo(),s=t.namespace||(i===null?rs():i._config.namespace),c=t.editorState,l=[lo,Ki,Ii,na,go,ho,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}Qs(t);let i=t.getType(),a=bo(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:on(l[e]),transforms:a})}}let m=new So(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=2),function(e){e.registerCommand(tr,hi,0),e.registerCommand(nr,gi,0),e.registerCommand(rr,_i,0),e.registerCommand(ir,vi,0),e.registerCommand(gr,bi,0)}(m),m}var So=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=rs(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&E(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&E(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&E(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Ks(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=Ks(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=W(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Ni}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return q(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=hs(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,yo(this,t,e,r),t!==null&&(this._config.disableEvents||Ei(t),n!=null&&t.classList.remove(...n)),e!==null){let t=Es(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,en(this),this._updateTags.add(Ni),$a(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;$r.set(e,n);let r=ei.get(n)??0;r<1&&n.addEventListener(`selectionchange`,Ci),ei.set(n,r+1),e.__lexicalEditor=t;let i=xi(e);for(let n=0;n<Jr.length;n++){let[r,a]=Jr[n],o=typeof a==`function`?e=>{Ti(e)||(wi(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(Ti(e))return;wi(e);let n=t.isEditable();switch(r){case`cut`:return n&&q(t,Rr,e);case`copy`:return q(t,Lr,e);case`paste`:return n&&q(t,lr,e);case`dragstart`:return n&&q(t,Pr,e);case`dragover`:return n&&q(t,Fr,e);case`dragend`:return n&&q(t,Ir,e);case`focus`:return n&&q(t,Wr,e);case`blur`:return n&&q(t,Gr,e);case`drop`:return n&&q(t,Mr,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Ni),$a(this);eo(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&E(38);let n=e;n._readOnly&&(n=uo(e),n._selection=e._selection?e._selection.clone():null),$t(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),$a(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||$a(this)}parseEditorState(e,t){return function(e,t,n){let r=fo(),i=F,a=Ra,o=I,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,F=r,Ra=!1,I=t,wo(null);try{let i=t._nodes;Za(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,F=i,Ra=a,I=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return $a(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):no(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),ro(this,()=>{let r=P(),i=G();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||$o(r.clone()),Cs(`focus`),ws(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Fs(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,eo(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};So.version=`0.41.0+prod.esm`;var Co=null;function wo(e){Co=e}var To=1;function Eo(e,t){let n=Do(e,t);return n===void 0&&E(30,t),n}function Do(e,t){return e._nodes.get(t)}var Oo=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function ko(e){return B(Yo(e))}function Ao(e){let t=document.activeElement;if(!J(t))return!1;let n=t.nodeName;return B(Yo(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&Po(t)==null)}function jo(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Ao(t)&&No(t)===e}catch{return!1}}function Mo(e){return e instanceof So}function No(e){let t=e;for(;t!=null;){let e=Po(t);if(Mo(e))return e;t=xs(t)}return null}function Po(e){return e?e.__lexicalEditor:null}function Fo(e){return Ft.test(e)?`rtl`:It.test(e)?`ltr`:null}function Io(e){return ia(e)||e.isToken()}function Lo(e){return Io(e)||e.isSegmented()}function Ro(e){return Rs(e)&&e.nodeType===3}function zo(e){return Rs(e)&&e.nodeType===9}function Bo(e){let t=e;for(;t!=null;){if(Ro(t))return t;t=t.firstChild}return null}function Vo(e,t,n){let r=Lt[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Lt.superscript:t===`superscript`?i&=~Lt.subscript:t===`lowercase`?(i&=~Lt.uppercase,i&=~Lt.capitalize):t===`uppercase`?(i&=~Lt.lowercase,i&=~Lt.capitalize):t===`capitalize`&&(i&=~Lt.lowercase,i&=~Lt.uppercase),i}function Ho(e){return M(e)||A(e)||B(e)}function Uo(e,t){let n=function(){let e=Co;return Co=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);L(),Ua();let r=R(),i=Wa(),a=``+To++;i._nodeMap.set(a,e),z(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=1,e.__key=a}function Wo(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Go(e){Ua(),Ai(e)&&E(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=Wa(),i=R(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=1,z(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function U(e){L();let t=R(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=W(n);e!==null&&e.getWritable()}if(e!==null){let t=W(e);t!==null&&t.getWritable()}}}function Ko(){return Ha()?null:R()._compositionKey}function W(e,t){let n=(t||Wa())._nodeMap.get(e);return n===void 0?null:n}function qo(e,t){let n=Jo(e,R());return n===void 0?null:W(n,t)}function Jo(e,t){return e[`__lexicalKey_${t._key}`]}function Yo(e,t){let n=e;for(;n!=null;){let e=qo(n,t);if(e!==null)return e;n=xs(n)}return null}function Xo(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Zo(e){return e.read(()=>G().getTextContent())}function G(){return Qo(Wa())}function Qo(e){return e._nodeMap.get(`root`)}function $o(e){L();let t=Wa();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function es(e){let t=R(),n=function(e,t){let n=e;for(;n!=null;){let e=Jo(n,t);if(e!==void 0)return e;n=xs(n)}return null}(e,t);return n===null?e===t.getRootElement()?W(`root`):null:W(n)}function ts(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ns(e){let t=[],n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function rs(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function is(e){return Ro(e)?e.nodeValue:null}function as(e,t,n){let r=Fs(Ds(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=is(i),r=Yo(i);if(t!==null&&M(r)){if((t===Mt||t===Pt)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&os(r,t,a,o,e)}}}function os(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;if((o||i)&&(t.endsWith(Mt)&&(s=t.slice(0,-Mt.length)),i)){let e=Pt,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){if(s===``){if(U(null),_t||vt||St)a.remove();else{let e=R();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=Ea(),c=a.getTextContentSize(),l=Ko(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||N(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=P();if(!N(d)||n===null||r===null)return void ss(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=j(a.getTextContent());a.replace(e),a=e}ss(a,s,d)}}}function ss(e,t,n){if(e.setTextContent(t),N(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=gc(e,i.offset,`clamp`))}}}function cs(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function ls(e,t){return cs(e,t,`altKey`)&&cs(e,t,`ctrlKey`)&&cs(e,t,`shiftKey`)&&cs(e,t,`metaKey`)}function K(e,t,n){if(!ls(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let r=`Key`+t.toUpperCase();return e.code===r}var us={ctrlKey:!mt,metaKey:mt},ds={altKey:mt,ctrlKey:!mt};function fs(e){return e.key===`Backspace`}function ps(e){return K(e,`a`,us)}function ms(e){let t=G();if(N(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),vn(e),e}{let e=t.select(0,t.getChildrenSize());return $o(vn(e)),e}}function hs(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Kc(i);return n[t]=e,e}return i}function gs(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&E(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function _s(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function vs(e,t){let n=e.offset;if(e.type===`element`)return _s(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?_s(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function ys(e){let t=Ds(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function q(e,t,n){return function(e,t,n){let r=ns(e);for(let i=4;i>=0;i--)for(let a=0;a<r.length;a++){let o=r[a],s=o._commands.get(t);if(s!==void 0){let t=s[i];if(t!==void 0){let r=Array.from(t),i=r.length,a=!1;if(ro(o,()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(a=!0)}),a)return a}}}return!1}(e,t,n)}function bs(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&E(75,t),n}function xs(e){let t=e.assignedSlot||e.parentElement;return zs(t)?t.host:t}function Ss(e){return zo(e)?e:J(e)?e.ownerDocument:null}function Cs(e){L(),R()._updateTags.add(e)}function ws(e){L(),R()._deferred.push(e)}function Ts(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Es(e){let t=Ss(e);return t?t.defaultView:null}function Ds(e){let t=e._window;return t===null&&E(78),t}function Os(e){let t=e.getParentOrThrow();for(;t!==null;){if(ks(t))return t;t=t.getParentOrThrow()}return t}function ks(e){return V(e)||z(e)&&e.isShadowRoot()}function As(e){let t=R(),n=e.getType(),r=Do(t,n);r===void 0&&E(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||E(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||E(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&E(203,e.constructor.name,n,r.name,r.getType()),t}return e}function js(e,t){!V(e.getParent())||z(t)||B(t)||E(99)}function Ms(e){let t=W(e);return t===null&&E(63,e),t}function Ns(e){return(B(e)||z(e)&&!e.canBeEmpty())&&!e.isInline()}function Ps(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Fs(e){return ft?(e||window).getSelection():null}function Is(e){let t=Es(e);return t?t.getSelection():null}function Ls(e){return J(e)&&e.tagName===`A`}function J(e){return Rs(e)&&e.nodeType===1}function Rs(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function zs(e){return Rs(e)&&e.nodeType===11}function Bs(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function Vs(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function Hs(e){if(B(e)&&!e.isInline())return!0;if(!z(e)||ks(e))return!1;let t=e.getFirstChild(),n=t===null||A(t)||M(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Us(){return R()}var Ws=new WeakMap,Gs=new Map;function Ks(e){if(!e._readOnly&&e.isEmpty())return Gs;e._readOnly||E(192);let t=Ws.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Ws.set(e,t)),t}function qs(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Js(e){return(t=qs(e))[ki]=!0,t;var t}function Ys(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Xs(e){return!0===e.__lexicalUnmanaged}function Zs(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==ji[t]}function Qs(e){let t=Ut in e.prototype?e.prototype[Ut]():void 0,n=function(e){if(!(e===ji||e.prototype instanceof ji)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{So.version&&(n=JSON.parse(So.version))}catch{}E(290,e.name,t,n)}return e===co||e===oo||e===ji}(e),r=!n&&Zs(e,`getType`)?e.getType():void 0,i,a=r;if(t){if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n}if(!n&&a&&(Zs(e,`getType`)||(e.getType=()=>a),Zs(e,`clone`)||(e.clone=t=>(wo(t),new e)),Zs(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!Zs(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function $s(e){let t=Us();return L(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var ec=(e,t)=>{let n=e;for(;n!=null&&!V(n);){if(t(n))return n;n=n.getParent()}return null},tc={next:`previous`,previous:`next`},nc=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Ec({hasNext:uc,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Y(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Y(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&E(263,Array.from(o).join(` `))}else i.insert(e);i=Y(e,this.direction)}for(let e of o.values())e.remove();return this}},rc=class e extends nc{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:vc(e,this.direction)}getParentCaret(e=`root`){return Y(oc(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ac(this.direction);return Y(this.getNodeAtCaret(),e)||vc(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},ic={root:V,shadowRoot:ks};function ac(e){return tc[e]}function oc(e,t=`root`){return ic[t](e)?null:e}var sc=class e extends nc{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Y(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return z(this.origin)?vc(this.origin,this.direction):null}getParentCaret(e=`root`){return Y(oc(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ac(this.direction);return Y(this.getNodeAtCaret(),e)||vc(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof cc)&&this.direction===t.direction&&this.origin.is(t.origin)}},cc=class e extends nc{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:hc(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Y(oc(this.getParentAtCaret(),e),this.direction)}getFlipped(){return hc(this.origin,ac(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof sc||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Y(this.origin,this.direction)}};function lc(e){return e instanceof cc}function uc(e){return e instanceof sc}function dc(e){return e instanceof rc}var fc={next:class extends cc{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends cc{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},pc={next:class extends sc{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends sc{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},mc={next:class extends rc{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends rc{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Y(e,t){return e?new pc[t](e):null}function hc(e,t,n){return e?new fc[t](e,gc(e,n)):null}function gc(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&dt(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function _c(e,t){return new Sc(e,t)}function vc(e,t){return z(e)?new mc[t](e):null}function yc(e){return e&&e.getChildCaret()||e}function bc(e){return e&&yc(e.getAdjacentCaret())}var xc=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return lc(t)?function(e,t){let{direction:n,origin:r}=e;return _c(e,gc(r,t===`focus`?ac(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[_c(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=lc(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=lc(n),i=t=>t.isSameNodeCaret(n)?null:bc(t)||t.getParentCaret(e);return Ec({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Sc=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return hc(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Cc(e){return Tc(e,Y(G(),e.direction))}function wc(e){return Tc(e,e)}function Tc(e,t){return e.direction!==t.direction&&E(265),new xc(e,t,e.direction)}function Ec(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function Dc(e,t){let n=jc(e.origin,t.origin);switch(n===null&&E(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return Oc(n)}}function Oc(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function kc(e,t){return t.is(e)}function Ac(e){return z(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function jc(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=Ac(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=Ac(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(kc(e,r)||E(276),{commonAncestor:r,type:`ancestor`}):i===null?(kc(t,r)||E(277),{commonAncestor:r,type:`descendant`}):((z(a)||kc(e,a))&&(z(i)||kc(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||E(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function Mc(e,t){let{type:n,key:r,offset:i}=e,a=Ms(e.key);return n===`text`?(M(a)||E(266,a.getType(),r),hc(a,t,i)):(z(a)||E(267,a.getType(),r),Gc(a,e.offset,t))}function Nc(e,t){let{origin:n,direction:r}=t,i=r===`next`;lc(t)?e.set(n.getKey(),t.offset,`text`):uc(t)?M(n)?e.set(n.getKey(),gc(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(dc(t)&&z(n)||E(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Pc(e){let t=P(),n=N(t)?t:Ca();return Fc(n,e),$o(n),n}function Fc(e,t){Nc(e.anchor,t.anchor),Nc(e.focus,t.focus)}function Ic(e){let{anchor:t,focus:n}=e,r=Mc(t,`next`),i=Mc(n,`next`),a=Dc(r,i)<=0?`next`:`previous`;return Tc(Uc(r,a),Uc(i,a))}function Lc(e){let{direction:t,origin:n}=e,r=Y(n,ac(t)).getNodeAtCaret();return r?Y(r,t):vc(n.getParentOrThrow(),t)}function Rc(e,t=`root`){let n=[e];for(let r=dc(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Lc(r));return n}function zc(e){return!!e&&e.origin.isAttached()}function Bc(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Wc(e,r),o=Rc(a.anchor,n),s=Rc(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(dc(e))c.add(e.origin.getKey());else if(uc(e)){let{origin:t}=e;z(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Lc(Y(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=j(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=hc(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(zc(e)){u=Vc(e);break}for(let e of s)if(zc(e)){d=Vc(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(ks(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,Hs),d=u&&l(o,e=>n.has(e.getKey())&&Hs(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;vc(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let p=[u,d,...o,...s].find(zc);if(p)return wc(Uc(Vc(p),e.direction));E(269,JSON.stringify(o.map(e=>e.origin.__key)))}function Vc(e){let t=function(e){let t=e;for(;dc(t);){let e=bc(t);if(!dc(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(M(t.origin))return lc(t)?t:hc(t.origin,n,n);let r=t.getAdjacentCaret();return uc(r)&&M(r.origin)?hc(r.origin,n,ac(n)):t}function Hc(e){return lc(e)&&e.offset!==gc(e.origin,e.direction)}function Uc(e,t){return e.direction===t?e:e.getFlipped()}function Wc(e,t){return e.direction===t?e:Tc(Uc(e.focus,t),Uc(e.anchor,t))}function Gc(e,t,n){let r=vc(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return Uc(r,n)}function Kc(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function qc(e,...t){let n=Kc(...t);n.length>0&&e.classList.add(...n)}function Jc(e,...t){let n=Kc(...t);n.length>0&&e.classList.remove(...n)}function Yc(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var Xc=new Map;function Zc(e){let t={};if(!e)return t;let n=e.split(`;`);for(let e of n)if(e!==``){let[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function Qc(e){let t=Xc.get(e);return t===void 0&&(t=Zc(e),Xc.set(e,t)),t}function $c(e){let t=Us().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function el(e){return $c(V(e)?e:e.getParentOrThrow())}function tl(e){let t=el(e);return t!==null&&t.direction===`rtl`}function nl(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!Lo(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=pa(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=Js(t)),t.__text=p)}}return t}function rl(e){let t=e.getStyle(),n=Zc(t);Xc.set(t,n)}function il(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function al(e,t,n=il){if(e===null)return;let r=e.getStartEndPoints(),i=new Map,a=null;if(r){let[e,t]=r;a=Ca(),a.anchor.set(e.key,e.offset,e.type),a.focus.set(t.key,t.offset,t.type);let n=ec(e.getNode(),Hs),o=ec(t.getNode(),Hs);z(n)&&i.set(n.getKey(),n),z(o)&&i.set(o.getKey(),o)}for(let t of e.getNodes())if(z(t)&&Hs(t))i.set(t.getKey(),t);else if(r===null){let e=ec(t,Hs);z(e)&&i.set(e.getKey(),e)}for(let[e,r]of i){let i=t();n(r,i),r.replace(i,!0),a&&(e===a.anchor.key&&a.anchor.set(i.getKey(),a.anchor.offset,a.anchor.type),e===a.focus.key&&a.focus.set(i.getKey(),a.focus.offset,a.focus.type))}a&&e.is(P())&&$o(a)}function ol(e){let t=sl(e);return t!==null&&t.writingMode===`vertical-rl`}function sl(e){let t=e.anchor.getNode();return z(t)?$c(t):el(t)}function cl(e,t){let n=ol(e)?!t:t;ul(e)&&(n=!n);let r=Mc(e.focus,n?`previous`:`next`);if(Hc(r))return!1;for(let e of Cc(r)){if(dc(e))return!e.origin.isInline();if(!z(e.origin)){if(B(e.origin))return!0;break}}return!1}function ll(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function ul(e){let t=sl(e);return t!==null&&t.direction===`rtl`}function dl(e,t,n){let r=ul(e),i;i=ol(e)||r?!n:n,ll(e,t,i,`character`)}function fl(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var pl=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,ml=pl&&`documentMode`in document?document.documentMode:null;pl&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pl&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!pl||!(`InputEvent`in window)||ml)&&`getTargetRanges`in new window.InputEvent(`input`),pl&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pl&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,pl&&/Android/.test(navigator.userAgent),pl&&/^(?=.*Chrome).*/i.test(navigator.userAgent),pl&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function hl(e){return e?e.getAdjacentCaret():null}function gl(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function _l(e){let t=ec(e,e=>z(e)&&!e.isInline());return z(t)||fl(4,e.__key),t}function vl(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function yl(e){let t=P();if(!N(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=ec(i,e=>z(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function bl(e,t){let n=zo(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Cl.has(t.nodeName)){let n=wl(t,e,i,!1);n!==null&&(r=r.concat(n))}return function(e){for(let t of e)t.getNextSibling()instanceof ho&&t.insertAfter(Ri());for(let t of e){let e=t.getChildren();for(let n of e)t.insertBefore(n);t.remove()}}(i),r}function xl(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=G().getChildren();for(let i=0;i<r.length;i++)Sl(e,r[i],n,t);return n.innerHTML}function Sl(e,t,n,r=null){let i=r===null||t.isSelected(r),a=z(t)&&t.excludeFromCopy(`html`),o=t;r!==null&&M(t)&&(o=nl(r,t,`clone`));let s=z(o)?o.getChildren():[],c=Do(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=Sl(e,a,f,r);!i&&z(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((J(u)||zs(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(zs(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}var Cl=new Set([`STYLE`,`SCRIPT`]);function wl(e,t,n,r,i=new Map,a){let o=[];if(Cl.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!ks(s))&&(s!=null&&xa(s)||r);for(let e=0;e<d.length;e++)f.push(...wl(d[e],t,n,p,new Map(i),s));return u!=null&&(f=u(f)),Vs(e)&&(f=Tl(e,f,p?()=>{let e=new ho;return n.push(e),e}:H)),s==null?f.length>0?o=o.concat(f):Vs(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:Bs(e.nextSibling)&&Bs(e.previousSibling)}(e)&&(o=o.concat(Ri())):z(s)&&s.append(...f),o}function Tl(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(xa(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&xa(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function El(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Dl(e,t=P()){return t??El(166),N(t)&&t.isCollapsed()||t.getNodes().length===0?``:xl(e,t)}function Ol(e,t=P()){return t??El(166),N(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(Ml(e,t))}function kl(e,t,n){let r=e.getData(`application/x-lexical-editor`);if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return Al(n,Nl(e.nodes),t)}catch(e){console.error(e)}let i=e.getData(`text/html`),a=e.getData(`text/plain`);if(i&&a!==i)try{return Al(n,bl(n,new DOMParser().parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}(i),`text/html`)),t)}catch(e){console.error(e)}let o=a||e.getData(`text/uri-list`);if(o!=null){if(N(t)){let e=o.split(/(\r?\n|\t)/);e[e.length-1]===``&&e.pop();for(let t=0;t<e.length;t++){let n=P();if(N(n)){let r=e[t];r===`
|
|
12
|
-
`||r===`\r
|
|
13
|
-
`?n.insertParagraph():r===` `?n.insertNodes([ra()]):n.insertText(r)}}}else t.insertRawText(o)}}function Al(e,t,n){e.dispatchCommand($n,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(N(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Mc(t,`previous`);if(r){if(lc(r))n=r.origin;else{let e=Tc(r,vc(G(),`next`).getFlipped());for(let t of e){if(M(t.origin)){n=t.origin;break}if(z(t.origin)&&!t.origin.isInline())break}}}if(n&&M(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function jl(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=z(n)&&n.excludeFromCopy(`html`),o=n;t!==null&&M(o)&&(o=nl(t,o,`clone`));let s=z(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&El(58,n.name),z(e)){let e=t.children;Array.isArray(e)||El(59,n.name)}return t}(o);M(o)&&o.getTextContentSize()===0&&(i=!1);for(let r=0;r<s.length;r++){let a=s[r],o=jl(e,t,a,c.children);!i&&z(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function Ml(e,t){let n=[],r=G().getChildren();for(let i=0;i<r.length;i++)jl(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}function Nl(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=Xa(r);M(i)&&rl(i),t.push(i)}return t}var Pl=null;async function Fl(e,t,n){if(Pl!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(Il(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Fs(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.cssText=`position: fixed; top: -1000px;`,s.append(a.createTextNode(`#`)),r.append(s);let c=new Range;return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Lr,r=>(vl(r,ClipboardEvent)&&(o(),Pl!==null&&(i.clearTimeout(Pl),Pl=null),t(Il(e,r,n))),!0),4);Pl=i.setTimeout(()=>{o(),Pl=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function Il(e,t,n){if(n===void 0){let t=Fs(e._window),r=P();if(!r||r.isCollapsed()||!t)return!1;let i=t.anchorNode,a=t.focusNode;if(i!==null&&a!==null&&!jo(e,i,a))return!1;n=Rl(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(zl(r,n),!0)}var Ll=[[`text/html`,Dl],[`application/x-lexical-editor`,Ol]];function Rl(e=P()){let t={"text/plain":e?e.getTextContent():``};if(e){let n=Us();for(let[r,i]of Ll){let a=i(n,e);a!==null&&(t[r]=a)}}return t}function zl(e,t){for(let[n]of Ll)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}var Bl=Symbol.for(`preact-signals`);function Vl(){if(Wl>1)return void Wl--;let e,t=!1;for(;Hl!==void 0;){let n=Hl;for(Hl=void 0,Gl++;n!==void 0;){let r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Yl(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Gl=0,Wl--,t)throw e}var X,Hl;function Ul(e){let t=X;X=void 0;try{return e()}finally{X=t}}var Wl=0,Gl=0,Kl=0;function ql(e){if(X===void 0)return;let t=e.n;return t===void 0||t.t!==X?(t={i:0,S:e,p:X.s,n:void 0,t:X,e:void 0,x:void 0,r:t},X.s!==void 0&&(X.s.n=t),X.s=t,e.n=t,32&X.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=X.s,t.n=void 0,X.s.n=t,X.s=t),t):void 0}function Jl(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Yl(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Xl(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Zl(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function Ql(e,t){Jl.call(this,void 0),this.x=e,this.s=void 0,this.g=Kl-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function $l(e){let t=e.u;if(e.u=void 0,typeof t==`function`){Wl++;let n=X;X=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,eu(e),t}finally{X=n,Vl()}}}function eu(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,$l(e)}function tu(e){if(X!==this)throw Error(`Out-of-order effect`);Zl(this),X=e,this.f&=-2,8&this.f&&eu(this),Vl()}function nu(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function ru(e,t){let n=new nu(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}Jl.prototype.brand=Bl,Jl.prototype.h=function(){return!0},Jl.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Ul(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Jl.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Ul(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Jl.prototype.subscribe=function(e){return ru(()=>{let t=this.value,n=X;X=void 0;try{e(t)}finally{X=n}},{name:`sub`})},Jl.prototype.valueOf=function(){return this.value},Jl.prototype.toString=function(){return this.value+``},Jl.prototype.toJSON=function(){return this.value},Jl.prototype.peek=function(){let e=X;X=void 0;try{return this.value}finally{X=e}},Object.defineProperty(Jl.prototype,"value",{get(){let e=ql(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Gl>100)throw Error(`Cycle detected`);this.v=e,this.i++,Kl++,Wl++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Vl()}}}}),Ql.prototype=new Jl,Ql.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Kl))return!0;if(this.g=Kl,this.f|=1,this.i>0&&!Yl(this))return this.f&=-2,!0;let e=X;try{Xl(this),X=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return X=e,Zl(this),this.f&=-2,!0},Ql.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Jl.prototype.S.call(this,e)},Ql.prototype.U=function(e){if(this.t!==void 0&&(Jl.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Ql.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ql.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=ql(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),nu.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.u=e)}finally{e()}},nu.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,$l(this),Xl(this),Wl++;let e=X;return X=this,tu.bind(this,e)},nu.prototype.N=function(){2&this.f||(this.f|=2,this.o=Hl,Hl=this)},nu.prototype.d=function(){this.f|=8,1&this.f||eu(this)},nu.prototype.dispose=function(){this.d()},nn(`format`,{parse:e=>typeof e==`number`?e:0});var iu=class e extends co{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return ou().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:au,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return qc(t,e.theme.hr),t}getTextContent(){return`
|
|
14
|
-
`}isInline(){return!1}updateDOM(){return!1}};function au(){return{node:ou()}}function ou(){return $s(iu)}function su(e,t){if(document.caretRangeFromPoint!==void 0){let n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!==`undefined`){let n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}var cu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,lu=cu&&`documentMode`in document?document.documentMode:null,uu=cu&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),du=!(!cu||!(`InputEvent`in window)||lu)&&`getTargetRanges`in new window.InputEvent(`input`),fu=cu&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pu=cu&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mu=cu&&/^(?=.*Chrome).*/i.test(navigator.userAgent),hu=cu&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&uu&&!mu,gu=k(`DRAG_DROP_PASTE_FILE`),_u=class e extends oo{static getType(){return`quote`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`blockquote`);return qc(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Cu,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(J(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return vu().updateFromJSON(e)}insertNewAfter(e,t){let n=H(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=H();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function vu(){return As(new _u)}function yu(e){return e instanceof _u}var bu=class e extends oo{__tag;static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];qc(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Su,priority:0}),h2:e=>({conversion:Su,priority:0}),h3:e=>({conversion:Su,priority:0}),h4:e=>({conversion:Su,priority:0}),h5:e=>({conversion:Su,priority:0}),h6:e=>({conversion:Su,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&xu(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>xu(e)?{conversion:e=>({node:wu(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(J(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return wu(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?H():wu(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=H();e.select(),this.replace(e,!0)}return i}collapseAtStart(){let e=this.isEmpty()?H():wu(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function xu(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function Su(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=wu(t),e.style!==null&&(Ys(e,n),n.setFormat(e.style.textAlign))),{node:n}}function Cu(e){let t=vu();return e.style!==null&&(t.setFormat(e.style.textAlign),Ys(e,t)),{node:t}}function wu(e=`h1`){return As(new bu(e))}function Tu(e){return e instanceof bu}function Eu(e){let t=null;if(vl(e,DragEvent)?t=e.dataTransfer:vl(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function Du(e){return B(Yo(e))}function Ou(e){for(let t of[`lowercase`,`uppercase`,`capitalize`])e.hasFormat(t)&&e.toggleFormat(t)}function ku(e){return Yc(e.registerCommand(er,e=>{let t=P();return!!da(t)&&(t.clear(),!0)},0),e.registerCommand(ar,e=>{let t=P();return N(t)?(t.deleteCharacter(e),!0):!!da(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(dr,e=>{let t=P();return!!N(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(fr,e=>{let t=P();return!!N(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(cr,t=>{let n=P();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)kl(r,n,e);else if(N(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(ur,()=>{let e=P();return!!N(e)&&(e.removeText(),!0)},0),e.registerCommand(pr,e=>{let t=P();return!!N(t)&&(t.formatText(e),!0)},0),e.registerCommand(Nr,e=>{let t=P();if(!N(t)&&!da(t))return!1;let n=t.getNodes();for(let t of n){let n=ec(t,e=>z(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(or,e=>{let t=P();return!!N(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(sr,()=>{let e=P();return!!N(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(kr,()=>{let e=ra(),t=P();return N(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Pa([e]),!0},0),e.registerCommand(Ar,()=>yl(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(jr,()=>yl(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(xr,e=>{let t=P();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if(N(t)){let n=vs(t.focus,!0);if(!e.shiftKey&&B(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},0),e.registerCommand(Sr,e=>{let t=P();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if(N(t)){if(function(e){let t=e.focus;return t.key===`root`&&t.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;let n=vs(t.focus,!1);if(!e.shiftKey&&B(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},0),e.registerCommand(yr,e=>{let t=P();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),tl(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!N(t))return!1;if(cl(t,!0)){let n=e.shiftKey;return e.preventDefault(),dl(t,n,!0),!0}return!1},0),e.registerCommand(_r,e=>{let t=P();if(da(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),tl(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!N(t))return!1;let n=e.shiftKey;return!!cl(t,!1)&&(e.preventDefault(),dl(t,n,!1),!0)},0),e.registerCommand(Tr,t=>{if(Du(t.target))return!1;let n=P();if(N(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(V(n))return!1;let r=_l(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(jr,void 0);if(pu&&navigator.language===`ko-KR`)return!1}else if(!da(n))return!1;return t.preventDefault(),e.dispatchCommand(ar,!0)},0),e.registerCommand(Dr,t=>{if(Du(t.target))return!1;let n=P();return!(!N(n)&&!da(n))&&(t.preventDefault(),e.dispatchCommand(ar,!1))},0),e.registerCommand(Cr,t=>{let n=P();if(!N(n))return!1;if(Ou(n),t!==null){if((pu||fu||hu)&&du)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(or,!1)}return e.dispatchCommand(sr,void 0)},0),e.registerCommand(Er,()=>!!N(P())&&(e.blur(),!0),0),e.registerCommand(Mr,t=>{let[,n]=Eu(t);if(n.length>0){let r=su(t.clientX,t.clientY);if(r!==null){let{offset:t,node:i}=r,a=Yo(i);if(a!==null){let e=Ca();if(M(a))e.anchor.set(a.getKey(),t,`text`),e.focus.set(a.getKey(),t,`text`);else{let t=a.getParentOrThrow().getKey(),n=a.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}$o(vn(e))}e.dispatchCommand(gu,n)}return t.preventDefault(),!0}return!!N(P())},0),e.registerCommand(Pr,e=>{let[t]=Eu(e),n=P();return!(t&&!N(n))},0),e.registerCommand(Fr,e=>{let[t]=Eu(e),n=P();if(t&&!N(n))return!1;let r=su(e.clientX,e.clientY);return r!==null&&B(Yo(r.node))&&e.preventDefault(),!0},0),e.registerCommand(zr,()=>(ms(),!0),0),e.registerCommand(Lr,t=>(Fl(e,vl(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Rr,t=>(async function(e,t){await Fl(t,vl(e,ClipboardEvent)?e:null),t.update(()=>{let e=P();N(e)?e.removeText():da(e)&&e.getNodes().forEach(e=>e.remove())})}(t,e),!0),0),e.registerCommand(lr,t=>{let[,n,r]=Eu(t);return n.length>0&&!r?(e.dispatchCommand(gu,n),!0):Rs(t.target)&&Ao(t.target)?!1:P()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=P(),r=vl(e,InputEvent)||vl(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&kl(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(wr,e=>{let t=P();return N(t)&&Ou(t),!1},0),e.registerCommand(Or,e=>{let t=P();return N(t)&&Ou(t),!1},0))}function Au(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(N(a)&&N(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||V(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&M(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!M(l)||!M(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}function ju(e,t){let n=Date.now(),r=0,i=Date.now(),a=0,o=null;return(s,c,l,u,d,f)=>{let p=Date.now();if(f.has(`composition-start`)&&(i=n,a=r,o=s),f.has(`historic`))return r=0,n=p,2;f.has(`composition-end`)&&o&&(n=i,r=a,s=o);let m=Au(s,c,u,d,e.isComposing()),h=(()=>{let i=l===null||l.editor===e,a=f.has(Mi);if(!a&&i&&f.has(`history-merge`))return 0;if(m===1)return 2;if(s===null)return 1;let o=c._selection;if(!(u.size>0||d.size>0))return o===null?2:0;let h=typeof t==`number`?t:t.peek();return!1===a&&m!==0&&m===r&&p<n+h&&i||u.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(N(a)&&N(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!M(r)||!M(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(u)[0],s,c)?0:1})();return n=p,r=m,h}}function Mu(e){e.undoStack=[],e.redoStack=[],e.current=null}function Nu(e,t,n){let r=ju(e,n);return Yc(e.registerCommand(mr,()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(r.length!==0){let i=t.current,a=r.pop();i!==null&&(n.push(i),e.dispatchCommand(Hr,!0)),r.length===0&&e.dispatchCommand(Ur,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0),0),e.registerCommand(hr,()=>(function(e,t){let n=t.redoStack,r=t.undoStack;if(n.length!==0){let i=t.current;i!==null&&(r.push(i),e.dispatchCommand(Ur,!0));let a=n.pop();n.length===0&&e.dispatchCommand(Hr,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:`historic`})}}(e,t),!0),0),e.registerCommand(Br,()=>(Mu(t),!1),0),e.registerCommand(Vr,()=>(Mu(t),e.dispatchCommand(Hr,!1),e.dispatchCommand(Ur,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:i,dirtyLeaves:a,dirtyElements:o,tags:s})=>{let c=t.current,l=t.redoStack,u=t.undoStack,d=c===null?null:c.editorState;if(c!==null&&n===d)return;let f=r(i,n,c,a,o,s);if(f===1)l.length!==0&&(t.redoStack=[],e.dispatchCommand(Hr,!1)),c!==null&&(u.push({...c}),e.dispatchCommand(Ur,!0));else if(f===2)return;t.current={editor:e,editorState:n}}))}function Pu(){return{current:null,redoStack:[],undoStack:[]}}function Fu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Iu(e){let t=1,n=e.getParent();for(;n!=null;){if(Z(n)){let e=n.getParent();if(Q(e)){t++,n=e.getParent();continue}Fu(40)}return t}return t}function Lu(e){let t=e.getParent();Q(t)||Fu(40);let n=t;for(;n!==null;)n=n.getParent(),Q(n)&&(t=n);return t}function Ru(e){let t=[],n=e.getChildren().filter(Z);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();Q(i)?t=t.concat(Ru(i)):t.push(r)}return t}function zu(e){return Z(e)&&Q(e.getFirstChild())}function Bu(e){return ed().append(e)}function Vu(e,t){return Z(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Hu(e){let t=P();if(t!==null){let n=t.getNodes();if(N(t)){let r=t.getStartEndPoints();r===null&&Fu(143);let[i]=r,a=i.getNode(),o=a.getParent();if(ks(a)){let e=a.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=H();a.append(e),n=e.select().getNodes()}}else if(Vu(a,n)){let t=od(e);if(ks(o)){a.replace(t);let e=ed();z(a)&&(e.setFormat(a.getFormatType()),e.setIndent(a.getIndent())),t.append(e)}else if(Z(a)){let e=a.getParentOrThrow();Uu(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(z(i)&&i.isEmpty()&&!Z(i)&&!r.has(i.getKey())){Wu(i,e);continue}let a=Ho(i)?i.getParent():Z(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(Q(a)){if(!r.has(t)){let n=od(e);Uu(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(ks(n)&&!r.has(t)){r.add(t),Wu(a,e);break}a=n}}}}}function Uu(e,t){e.splice(e.getChildrenSize(),0,t)}function Wu(e,t){if(Q(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=ed(),a;if(Uu(i,e.getChildren()),Q(n)&&t===n.getListType())n.append(i),Q(r)&&t===r.getListType()&&(Uu(n,r.getChildren()),r.remove()),a=n;else if(Q(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=od(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=P();return N(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function Gu(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&zu(n)&&zu(r)&&(Gu(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Ku(){let e=P();if(N(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Vu(r,n))t.add(Lu(r));else for(let e=0;e<n.length;e++){let r=n[e];if(Ho(r)){let e=gl(r,Zu);e!=null&&t.add(Lu(e))}}for(let n of t){let t=n,r=Ru(n);for(let n of r){let r=H().setTextStyle(e.style).setTextFormat(e.format);Uu(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Nc(e.anchor,Vc(vc(r,`next`))),n.__key===e.focus.key&&Nc(e.focus,Vc(vc(r,`next`))),n.remove()}n.remove()}}}function qu(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())Z(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),Q(r.getFirstChild())||n++)}function Ju(e){let t=new Set;if(zu(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(zu(r)&&zu(i)){let n=i.getFirstChild();if(Q(n)){n.append(e);let i=r.getFirstChild();Q(i)&&(Uu(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(zu(r)){let t=r.getFirstChild();if(Q(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(zu(i)){let t=i.getFirstChild();Q(t)&&t.append(e)}else if(Q(n)){let t=ed().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),a=od(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function Yu(e){if(zu(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(Q(n?n.getParent():void 0)&&Z(n)&&Q(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=t.getListType(),i=ed(),a=od(r);i.append(a),e.getPreviousSiblings().forEach(e=>a.append(e));let o=ed(),s=od(r);o.append(s),Uu(s,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function Xu(e=!1){let t=P();if(!N(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(Z(n)&&n.getChildrenSize()===0)r=n;else if(M(n)){let e=n.getParent();Z(e)&&e.getChildren().every(e=>M(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Lu(r),a=r.getParent();Q(a)||Fu(40);let o=a.getParent(),s;if(ks(o))s=H(),i.insertAfter(s);else{if(!Z(o))return!1;s=ed(),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(a,r):1,n=od(a.getListType(),t);if(Z(s)){let e=ed();e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!Z(e)&&!Q(e))break;t=e}t.remove()}(r),!0}var Zu=class extends oo{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();Q(t)&&t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0)},extends:oo,importDOM:Oi({li:()=>({conversion:Qu,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t,n){let r=t.getParent();!Q(r)||r.getListType()!==`check`||Q(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),n&&t.__checked===n.__checked||e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this,e),t.value=this.__value,function(e,t,n){let r=[],i=[],a=t.list,o=a?a.listitem:void 0,s;if(a&&a.nested&&(s=a.nested.listitem),o!==void 0&&r.push(...Kc(o)),a){let e=n.getParent(),t=Q(e)&&e.getListType()===`check`,o=n.getChecked();t&&!o||i.push(a.listitemUnchecked),t&&o||i.push(a.listitemChecked),t&&r.push(o?a.listitemChecked:a.listitemUnchecked)}if(s!==void 0){let e=Kc(s);n.getChildren().some(e=>Q(e))?r.push(...e):i.push(...e)}i.length>0&&Jc(e,...i),r.length>0&&qc(e,...r)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&(i===``?t.removeAttribute(`style`):t.style.cssText=i),function(e,t,n){let r=Qc(t.__textStyle);for(let t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(let t in Qc(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(z(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Z(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!Q(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=od(n.getListType()),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(z(e)||Fu(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(Q(n)||Fu(39),Z(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=od(n.getListType());r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&zu(t)&&zu(n)&&(Gu(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=ed().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=H();this.getChildren().forEach(e=>t.append(e));let n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=Z(r);if(n.getChildrenSize()===1){if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();let r=e.anchor,i=e.focus,a=t.getKey();r.type===`element`&&r.getNode().is(this)&&r.set(a,r.offset,`element`),i.type===`element`&&i.getNode().is(this)&&i.set(a,i.offset,`element`)}}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return Q(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Z(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&Fu(117),(e=Math.floor(e))>=0||Fu(199);let t=this.getIndent();for(;t!==e;)t<e?(Ju(this),t++):(Yu(this),t--);return this}canInsertAfter(e){return Z(e)}canReplaceWith(e){return Z(e)}canMergeWith(e){return Z(e)||vo(e)}extractWithChild(e,t){if(!N(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return od(`bullet`)}canMergeWhenEmpty(){return!0}};function Qu(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return $u(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return $u(t.children[0])}let t=e.getAttribute(`aria-checked`);return{node:ed(t===`true`||t!==`false`&&void 0)}}function $u(e){return e.getAttribute(`type`)===`checkbox`?{node:ed(e.hasAttribute(`checked`))}:{node:null}}function ed(e){return As(new Zu(void 0,e))}function Z(e){return e instanceof Zu}var td=class extends oo{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();Q(t)&&e.getListType()===t.getListType()&&Gu(e,t)})(e),qu(e)},extends:oo,importDOM:Oi({ol:()=>({conversion:id,priority:0}),ul:()=>({conversion:id,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=ad[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,nd(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(nd(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return J(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];Z(t)||(r===n&&(r=[...n]),r[e]=ed().append(!z(t)||Q(t)||t.isInline()?t:j(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return Z(e)}};function nd(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=Iu(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...Kc(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=Kc(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&Jc(e,...i),r.length>0&&qc(e,...r)}function rd(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(Z(r)){t.push(r);let e=r.getChildren();e.length>1&&e.forEach(e=>{Q(e)&&t.push(Bu(e))})}else t.push(Bu(r))}return t}function id(e){let t=e.nodeName.toLowerCase(),n=null;return t===`ol`?n=od(`number`,e.start):t===`ul`&&(n=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(J(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?od(`check`):od(`bullet`)),{after:rd,node:n}}var ad={ol:`number`,ul:`bullet`};function od(e=`number`,t=1){return As(new td(e,t))}function Q(e){return e instanceof td}var sd=k(`UPDATE_LIST_START_COMMAND`),cd=k(`INSERT_UNORDERED_LIST_COMMAND`),ld=k(`INSERT_ORDERED_LIST_COMMAND`),ud=k(`REMOVE_LIST_COMMAND`);function dd(e,t){return Yc(e.registerCommand(ld,()=>(Hu(`number`),!0),1),e.registerCommand(sd,e=>{let{listNodeKey:t,newStart:n}=e,r=W(t);return!!Q(r)&&(r.getListType()===`number`&&(r.setStart(n),qu(r)),!0)},1),e.registerCommand(cd,()=>(Hu(`bullet`),!0),1),e.registerCommand(ud,()=>(Ku(),!0),1),e.registerCommand(sr,()=>Xu(!!(t&&t.restoreNumbering)),1),e.registerNodeTransform(Zu,e=>{let t=e.getFirstChild();if(t){if(M(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=P();N(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(Ki,e=>{let t=e.getParent();if(Z(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}var fd=e(t(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&`).replace(/</g,`<`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`"`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var ee=S.value;if(t.length>e.length)return;if(!(ee instanceof a)){var te=1,w;if(v){if(w=o(x,C,e,_),!w||w.index>=e.length)break;var ne=w.index,T=w.index+w[0].length,re=C;for(re+=S.value.length;ne>=re;)S=S.next,re+=S.value.length;if(re-=S.value.length,C=re,S.value instanceof a)continue;for(var ie=S;ie!==t.tail&&(re<T||typeof ie.value==`string`);ie=ie.next)te++,re+=ie.value.length;te--,ee=e.slice(C,re),w.index-=C}else if(w=o(x,0,ee,_),!w)continue;var ne=w.index,ae=w[0],oe=ee.slice(0,ne),se=ee.slice(ne+ae.length),ce=C+ee.length;d&&ce>d.reach&&(d.reach=ce);var le=S.prev;oe&&(le=l(t,le,oe),C+=oe.length),u(t,le,te);var ue=new a(f,g?i.tokenize(ae,g):ae,y,ae);if(S=l(t,le,ue),se&&l(t,S,se),te>1){var de={cause:f+`,`+m,reach:ce};s(e,t,n,S.prev,C,de),d&&de.reach>d.reach&&(d.reach=de.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
|
|
15
|
-
`),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside[`attr-value`].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside[`internal-subset`].inside=Prism.languages.markup,Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&/,`&`))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend(`markup`,{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,(function(e){function t(e){return e=e.replace(/<inner>/g,function(){return`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var n="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",r=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return n}),i=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+r+i+`(?:`+r+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+r+i+`)(?:`+r+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+r+`)`+i+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+r+`$`),inside:{"table-header":{pattern:RegExp(n),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:t(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:t(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(c(t.content),s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var l=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var a=RegExp(e.languages.markup.tag.pattern.source,`gi`),o={amp:`&`,lt:`<`,gt:`>`,quot:`"`},s=String.fromCodePoint||String.fromCharCode;function c(e){var t=e.replace(a,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?s(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):o[t]||e}),t}e.languages.md=e.languages.markdown})(Prism),Prism.languages.c=Prism.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(Prism),Prism.languages.objectivec=Prism.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec[`class-name`],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(Prism);function pd(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var md=`javascript`;function hd(e,t){for(let n of e.childNodes){if(J(n)&&n.tagName===t)return!0;hd(n,t)}return!1}var gd=`data-language`,_d=`data-highlight-language`,vd=`data-theme`,yd=class e extends oo{__language;__theme;__isSyntaxHighlightSupported;static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=document.createElement(`code`);qc(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(gd,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(_d,n));let r=this.getTheme();r&&t.setAttribute(vd,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(gd,r):i&&t.removeAttribute(gd);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(_d,r):t.removeAttribute(_d):a&&r&&t.setAttribute(_d,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(vd,o):s&&t.removeAttribute(vd);let c=this.__style,l=e.__style;return c?c!==l&&t.setAttribute(`style`,c):l&&t.removeAttribute(`style`),!1}exportDOM(e){let t=document.createElement(`pre`);qc(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(gd,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(_d,n));let r=this.getTheme();r&&t.setAttribute(vd,r);let i=this.getStyle();return i&&t.setAttribute(`style`,i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||hd(e,`BR`))?{conversion:Sd,priority:1}:null,div:()=>({conversion:Cd,priority:1}),pre:()=>({conversion:Sd,priority:0}),table:e=>Dd(e)?{conversion:wd,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&Dd(n)?{conversion:Td,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&Dd(t)?{conversion:Td,priority:3}:null}}}static importJSON(e){return bd().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){let n=this.getChildren(),r=n.length;if(r>=2&&n[r-1].getTextContent()===`
|
|
16
|
-
`&&n[r-2].getTextContent()===`
|
|
17
|
-
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();let e=H();return this.insertAfter(e,t),e}let{anchor:i,focus:a}=e,o=(i.isBefore(a)?i:a).getNode();if(M(o)){let e=Md(o),t=[];for(;;)if(ia(e))t.push(ra()),e=e.getNextSibling();else{if(!$(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(Ad(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let n=o.splitText(i.offset)[0],r=i.offset===0?0:1,a=n.getIndexWithinParent()+r,s=o.getParentOrThrow(),c=[Ri(),...t];s.splice(a,0,c);let l=t[t.length-1];l?l.select():i.offset===0?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(xd(o)){let{offset:t}=e.anchor;o.splice(t,0,[Ri()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=H();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function bd(e,t){return $s(yd).setLanguage(e).setTheme(t)}function xd(e){return e instanceof yd}function Sd(e){return{node:bd(e.getAttribute(gd))}}function Cd(e){let t=e,n=Ed(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(Ed(t))return!0;t=t.parentElement}return!1}(t)?{node:n?bd():null}:{node:null}}function wd(){return{node:bd()}}function Td(){return{node:null}}function Ed(e){return e.style.fontFamily.match(`monospace`)!==null}function Dd(e){return e.classList.contains(`js-file-line-container`)}var Od=class e extends Ki{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return qc(t,kd(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=kd(n.theme,e.__highlightType),a=kd(n.theme,this.__highlightType);return i!==a&&(i&&Jc(t,i),a&&qc(t,a)),r}static importJSON(e){return Ad().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return bd()}};function kd(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Ad(e=``,t){return As(new Od(e,t))}function $(e){return e instanceof Od}function jd(e,t){let n=e;for(let r=Y(e,t);r&&($(r.origin)||ia(r.origin));r=hl(r))n=r.origin;return n}function Md(e){return jd(e,`previous`)}function Nd(e){return jd(e,`next`)}function Pd(e){let t=Md(e),n=Nd(e),r=t;for(;r!==null;){if($(r)){let e=Fo(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if(z(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function Fd(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){if(i=i.getPreviousSibling(),i===null)break;if($(i)||ia(i)||A(i)||pd(167),A(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];$(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(t<e.getTextContentSize())$(e)&&(s=e.getTextContent()[t]);else{let t=e.getNextSibling();$(t)&&(s=t.getTextContent()[0])}if(s!==null&&s!==` `)return n;{let r=function(e,t){let n=e,r=t,i=e.getTextContent(),a=e.getTextContentSize();for(;;){if(!$(n)||r===a){if(n=n.getNextSibling(),n===null||A(n))return null;$(n)&&(r=0,i=n.getTextContent(),a=n.getTextContentSize())}if($(n)){if(i[r]!==` `)return{node:n,offset:r};r++}}}(e,t);return r===null?n:r}}function Id(e){let t=Nd(e);return A(t)&&pd(168),t}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
|
|
18
|
-
?|
|
|
19
|
-
|(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);var Ld=globalThis.Prism||window.Prism;function Rd(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Rd).join(``):Rd(e.content)}function zd(e,t){let n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent(),i=Ld.tokenize(r,Ld.languages[n?`diff`:t]);return n&&(i=function(e,t){let n=t,r=Ld.languages[n],i={tokens:e},a=Ld.languages.diff.PREFIXES;for(let e of i.tokens){if(typeof e==`string`||!(e.type in a)||!Array.isArray(e.content))continue;let t=e.type,n=0,i=()=>(n++,new Ld.Token(`prefix`,a[t],t.replace(/^(\w+).*/,`$1`))),o=e.content.filter(e=>typeof e==`string`||e.type!==`prefix`),s=e.content.length-o.length,c=Ld.tokenize(Rd(o),r);c.unshift(i());let l=/\r\n|\n/g,u=e=>{let t=[];l.lastIndex=0;let r,a=0;for(;n<s&&(r=l.exec(e));){let n=r.index+r[0].length;t.push(e.slice(a,n)),a=n,t.push(i())}if(t.length!==0)return a<e.length&&t.push(e.slice(a)),t},d=e=>{for(let t=0;t<e.length&&n<s;t++){let n=e[t];if(typeof n==`string`){let r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if(typeof n.content==`string`){let e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(c),n<s&&c.push(i()),e.content=c}return i.tokens}(i,n[1])),Bd(i)}function Bd(e,t){let n=[];for(let r of e)if(typeof r==`string`){let e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){let i=e[r];i===`
|
|
20
|
-
`||i===`\r
|
|
21
|
-
`?n.push(Ri()):i===` `?n.push(ra()):i.length>0&&n.push(Ad(i,t))}}else{let{content:e,alias:t}=r;typeof e==`string`?n.push(...Bd([e],r.type===`prefix`&&typeof t==`string`?t:r.type)):Array.isArray(e)&&n.push(...Bd(e,r.type===`unchanged`?void 0:r.type))}return n}var Vd={$tokenize(e,t){return zd(e,t||this.defaultLanguage)},defaultLanguage:md,tokenize(e,t){return Ld.tokenize(e,Ld.languages[t||``]||Ld.languages[this.defaultLanguage])}};function Hd(e,t,n){let r=e.getParent();xd(r)?Gd(r,t,n):$(e)&&e.replace(j(e.__text))}function Ud(e,t){let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;e<i;e++)A(r[e])&&(a+=`
|
|
22
|
-
`+ ++o);n.setAttribute(`data-gutter`,a)}var Wd=new Set;function Gd(e,t,n){let r=e.getKey(),i=t.getKey()+`/`+r;if(e.getLanguage()===void 0&&e.setLanguage(n.defaultLanguage),!function(e){let t=function(e){let t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e)||e;try{return!!t&&Ld.languages.hasOwnProperty(t)}catch{return!1}}(e.getLanguage()||n.defaultLanguage))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),Wd.has(i)||(Wd.add(i),t.update(()=>{(function(e,t){let n=W(e);if(!xd(n)||!n.isAttached())return;let r=P();if(!N(r))return void t();let i=r.anchor,a=i.offset,o=i.type===`element`&&A(n.getChildAtIndex(i.offset-1)),s=0;if(o||(s=a+i.getNode().getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),t()){if(o)return void i.getNode().select(a,a);n.getChildren().some(e=>{let t=M(e);if(t||A(e)){let n=e.getTextContentSize();if(t&&n>=s)return e.select(s,s),!0;s-=n}return!1})}})(r,()=>{let t=W(r);if(!xd(t)||!t.isAttached())return!1;let i=t.getLanguage()||n.defaultLanguage,a=n.$tokenize(t,i),{from:o,to:s,nodesForReplacement:c}=function(e,t){let n=0;for(;n<e.length&&Kd(e[n],t[n]);)n++;let r=e.length,i=t.length,a=Math.min(r,i)-n,o=0;for(;o<a;)if(o++,!Kd(e[r-o],t[i-o])){o--;break}let s=n,c=r-o;return{from:s,nodesForReplacement:t.slice(n,i-o),to:c}}(t.getChildren(),a);return!(o===s&&!c.length)&&(e.splice(o,s-o,c),!0)})},{onUpdate:()=>{Wd.delete(i)},skipTransforms:!0}))}function Kd(e,t){return $(e)&&$(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||ia(e)&&ia(t)||A(e)&&A(t)}function qd(e){if(!N(e))return!1;let t=e.anchor.getNode(),n=xd(t)?t:t.getParent(),r=e.focus.getNode(),i=xd(r)?r:r.getParent();return xd(n)&&n.is(i)}function Jd(e){let t=e.getNodes(),n=[];if(t.length===1&&xd(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){let i=t[e];$(i)||ia(i)||A(i)||pd(169),A(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=oa(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function Yd(e){let t=P();if(!N(t)||!qd(t))return!1;let n=Jd(t),r=n.length;if(r===0&&t.isCollapsed())return e===Ar&&t.insertNodes([ra()]),!0;if(r===0&&e===Ar&&t.getTextContent()===`
|
|
23
|
-
`){let e=ra(),n=Ri(),r=t.isBackward()?`previous`:`next`;return t.insertNodes([e,n]),Pc(Wc(Tc(hc(e,`next`,0),Vc(Y(n,`next`))),r)),!0}for(let i=0;i<r;i++){let r=n[i];if(r.length>0){let n=r[0];if(i===0&&(n=Md(n)),e===Ar){let e=ra();if(n.insertBefore(e),i===0){let r=t.isBackward()?`focus`:`anchor`,i=oa(n.getKey(),0,`text`);t[r].is(i)&&t[r].set(e.getKey(),0,`text`)}}else ia(n)&&n.remove()}}return!0}function Xd(e,t){let n=P();if(!N(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===xr;if(!qd(n)||!$(s)&&!ia(s)||!$(c)&&!ia(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!0}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(s.isBefore(c)?(u=Md(s),d=Nd(c)):(u=Md(c),d=Nd(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;e<f.length;e++){let t=f[e];if(!$(t)&&!ia(t)&&!A(t))return!1}t.preventDefault(),t.stopPropagation();let p=l?u.getPreviousSibling():d.getNextSibling();if(!A(p))return!0;let m=l?p.getPreviousSibling():p.getNextSibling();if(m==null)return!0;let h=($(m)||ia(m)||A(m)?l?Md(m):Nd(m):null)??m;return p.remove(),f.forEach(e=>e.remove()),e===xr?(f.forEach(e=>h.insertBefore(e)),h.insertBefore(p)):(h.insertAfter(p),h=p,f.forEach(e=>{h.insertAfter(e),h=e})),n.setTextNodeRange(s,a,c,o),!0}function Zd(e,t){let n=P();if(!N(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===br;if(!qd(n)||!$(a)&&!ia(a)||!$(o)&&!ia(o))return!1;let c=o;if(Pd(c)===`rtl`?!s:s){let e=Fd(c,i.offset);if(e!==null){let{node:t,offset:r}=e;A(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else Id(c).select();return t.preventDefault(),t.stopPropagation(),!0}function Qd(e,t){if(!e.hasNodes([yd,Od]))throw Error(`CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor`);t??=Vd;let n=[];return!0!==e._headless&&n.push(e.registerMutationListener(yd,t=>{e.getEditorState().read(()=>{for(let[n,r]of t)if(r!==`destroyed`){let t=W(n);t!==null&&Ud(t,e)}})},{skipInitialization:!1})),n.push(e.registerNodeTransform(yd,n=>Gd(n,e,t)),e.registerNodeTransform(Ki,n=>Hd(n,e,t)),e.registerNodeTransform(Od,n=>Hd(n,e,t)),e.registerCommand(Or,t=>{let n=function(e){let t=P();if(!N(t)||!qd(t))return null;let n=e?jr:Ar,r=e?jr:kr,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=Jd(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&pd(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=Md(s[0]),d=Nd(s[0]),f=oa(u.getKey(),0,`text`),p=oa(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)},1),e.registerCommand(kr,()=>!!qd(P())&&(Pa([ra()]),!0),1),e.registerCommand(Ar,e=>Yd(Ar),1),e.registerCommand(jr,e=>Yd(jr),1),e.registerCommand(xr,e=>{let t=P();if(!N(t)||!qd(t))return!1;let n=G().getFirstDescendant(),{anchor:r}=t,i=r.getNode();return(!n||!i||n.getKey()!==i.getKey())&&Xd(xr,e)},1),e.registerCommand(Sr,e=>{let t=P();if(!N(t)||!qd(t))return!1;let n=G().getLastDescendant(),{anchor:r}=t,i=r.getNode();return(!n||!i||n.getKey()!==i.getKey())&&Xd(Sr,e)},1),e.registerCommand(br,e=>Zd(br,e),1),e.registerCommand(vr,e=>Zd(vr,e),1)),Yc(...n)}var $d=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),ef=class e extends oo{__url;__target;__rel;__title;static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=document.createElement(`a`);return this.updateLinkDOM(null,t,e),qc(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Ls(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:tf,priority:1})}}static importJSON(e){return nf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=lf(e);try{let t=new URL(lf(e));if(!$d.has(t.protocol))return`about:blank`}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=nf(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!N(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}};function tf(e){let t=null;if(Ls(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=nf(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function nf(e=``,t){return As(new ef(e,t))}function rf(e){return e instanceof ef}var af=class e extends ef{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return of().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=of(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function of(e=``,t){return As(new af(e,t))}function sf(e){return e instanceof af}var cf=/^\+?[0-9\s()-]{5,}$/;function lf(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:cf.test(e)?`tel:${e}`:`https://${e}`}function uf(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function df(e){let t=uf(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var ff=/[ \t\n\r\f]/,pf=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,mf=/^\s{0,3}$/;function hf(e){if(!vo(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&M(t)&&mf.test(t.getTextContent())}function gf(e,t,n,r){for(let i of t){if(!i.export)continue;let t=i.export(e,e=>_f(e,n,r));if(t!=null)return t}return z(e)?_f(e,n,r):B(e)?e.getTextContent():null}function _f(e,t,n,r,i){let a=[],o=e.getChildren();r||=[],i||=[];t:for(let e of o){for(let o of n){if(!o.export)continue;let s=o.export(e,e=>_f(e,t,n,r,[...i,...r]),(e,n)=>vf(e,n,t,r,i));if(s!=null){a.push(s);continue t}}A(e)?a.push(`
|
|
24
|
-
`):M(e)?a.push(vf(e,e.getTextContent(),t,r,i)):z(e)?a.push(_f(e,t,n,r,i)):B(e)&&a.push(e.getTextContent())}return a.join(``)}function vf(e,t,n,r,i){let a=e.getFormat()===0?t:function(e){return e.replace(/^\s+|\s+$/g,e=>[...e].map(e=>`&#`+e.codePointAt(0)+`;`).join(``))}(t);e.hasFormat(`code`)||(a=a.replace(/([*_`~\\])/g,`\\$1`));let o=``,s=``,c=``,l=yf(e,!0),u=yf(e,!1),d=new Set;for(let t of n){let n=t.format[0],i=t.tag;bf(e,n)&&!d.has(n)&&(d.add(n),bf(l,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),o+=i))}for(let t=0;t<r.length;t++){let n=bf(e,r[t].format),a=bf(u,r[t].format);if(n&&a)continue;let o=[...r];for(;o.length>t;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(c+=e.tag):s+=e.tag),r.pop())}break}return a=o+a+c,s+a}function yf(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return M(n)?n:null}function bf(e,t){return M(e)&&e.hasFormat(t)}function xf(e,t){let n=e.getTextContent(),r=t.fullMatchRegExpByTag["`"],i=t.transformersByTag["`"],a=[],o=null;if(r&&i){let e=new RegExp(r.source,`g`),t=Array.from(n.matchAll(e));for(let e of t){let t=e.index,n=t+e[0].length;o||={content:e[2],endIndex:n,startIndex:t,tag:"`"},a.push({end:n,start:t})}}let s=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e<t.end),s=0;for(;s<e.length;){let t=e[s];if(!i.has(t)||a(s)||o(s)){s++;continue}let n=1;for(;s+n<e.length&&e[s+n]===t;)n++;let c=Sf(t,e,s,n,!0),l=Sf(t,e,s,n,!1);(c||l)&&r.push({active:!0,canClose:l,canOpen:c,char:t,index:s,length:n,originalLength:n}),s+=n}return r}(n,t,a),c=s.length>0?function(e,t,n){let r={},i=0,a=null;for(;i<t.length;){let o=t[i];if(!o.active||!o.canClose||o.length===0){i++;continue}let s=`${o.char}${o.canOpen}`,c=r[s]??-1,l=!1;for(let r=i-1;r>c;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.originalLength+o.originalLength)%3==0&&s.originalLength%3!=0&&o.originalLength%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndex<a.startIndex||f.startIndex===a.startIndex&&f.endIndex>a.endIndex)&&(a=f);for(let e=r+1;e<i;e++)t[e].active=!1;s.length-=d,o.length-=d,s.active=s.length>0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,s,t):null,l=null,u=null;if(o&&c?c.startIndex<=o.startIndex&&c.endIndex>=o.endIndex?(l=c,u=t.transformersByTag[c.tag]):(l=o,u=i):o?(l=o,u=i):c&&(l=c,u=t.transformersByTag[c.tag]),!l||!u)return null;let d=[n.slice(l.startIndex,l.endIndex),l.tag,l.content];return d.index=l.startIndex,d.input=n,{endIndex:l.endIndex,match:d,startIndex:l.startIndex,transformer:u}}function Sf(e,t,n,r,i){if(!Cf(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!Cf(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&pf.test(e)}return!0}function Cf(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!ff.test(o)&&(!pf.test(o)||s===void 0||ff.test(s)||pf.test(s))}function wf(e){return M(e)&&!e.hasFormat(`code`)}function Tf(e,t,n){let r=xf(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent().match(e.importRegExp);if(!t)continue;let s=t.index||0,c=e.getEndIndex?e.getEndIndex(n,t):s+t[0].length;!1!==c&&(r===void 0||i===void 0||s<r&&(c>i||c<=r))&&(r=s,i=c,a=e,o=t)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);wf(i.nodeAfter)&&Tf(i.nodeAfter,t,n),wf(i.nodeBefore)&&Tf(i.nodeBefore,t,n),wf(i.transformedNode)&&Tf(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;wf(r.nodeAfter)&&Tf(r.nodeAfter,t,n),wf(r.nodeBefore)&&Tf(r.nodeBefore,t,n),wf(r.transformedNode)&&Tf(r.transformedNode,t,n)}let a=e.getTextContent().replace(/\\([*_`~\\])/g,`$1`).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(t));e.setTextContent(a)}function Ef(e,t=!1){let n=df(e),r=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(?<![\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)((?<!\\\\)|(?<=\\\\\\\\))(${a})(?![\\\\${a}])`):RegExp(`(?<!\\\\)(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)((?<!\\\\)|(?<=\\\\\\\\))(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(?<![\\\\])(${r.join(`|`)})`,`g`),transformersByTag:t}}(n.textFormat);return(e,i)=>{let a=e.split(`
|
|
25
|
-
`),o=a.length,s=i||G();s.clear();for(let e=0;e<o;e++){let i=a[e],[o,c]=Df(a,e,n.multilineElement,s);o?e=c:Of(i,s,n.element,r,n.textMatch,t)}let c=s.getChildren();for(let e of c)!t&&hf(e)&&s.getChildrenSize()>1&&e.remove();P()!==null&&s.selectStart()}}function Df(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d<f;){let n=l?e[d].match(l):null;if(!n&&(!u||u&&d<f-1)){d++;continue}if(n&&t===d&&n.index===c.index){d++;continue}let i=[];if(n&&t===d)i.push(e[t].slice(c[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){let t=e[r].slice(c[0].length);i.push(t)}else if(r===d&&n){let t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==s(r,null,c,n,i,!0))return[!0,d];break}}return[!1,t]}function Of(e,t,n,r,i,a){let o=j(e),s=H();s.append(o),t.append(s);for(let{regExp:t,replace:r}of n){let n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(s,[o],n,!0)))break}if(Tf(o,r,i),s.isAttached()&&e.length>0){let e=s.getPreviousSibling();if(!a&&(vo(e)||yu(e)||Q(e))){let t=e;if(Q(e)){let n=e.getLastDescendant();t=n==null?null:ec(n,Z)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[Ri(),...s.getChildren()]),s.remove())}}}var kf=/^(\s*)(\d{1,})\.\s/,Af=/^(\s*)[-*+]\s/,jf=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Mf=/^(#{1,6})\s/,Nf=/^>\s/,Pf=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,Ff=/^[ \t]*`{3,}$/,If=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Lf=/^(?:\|)(.+)(?:\|)\s?$/,Rf=/^(\| ?:?-*:? ?)+\|\s?$/,zf=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Bf=/^<\/[a-z_][\w-]*\s*>/i,Vf=e=>RegExp(`(?:${e.source})$`,e.flags),Hf=nn(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`}),Uf=nn(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```"}),Wf=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)},Gf=e=>(t,n,r,i)=>{let a=t.getPreviousSibling(),o=t.getNextSibling(),s=ed(e===`check`?r[3]===`x`:void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==Hf.parse(c)?void 0:c;if(Q(o)&&o.getListType()===e){l&&an(o,Hf,l);let e=o.getFirstChild();e===null?o.append(s):e.insertBefore(s),t.remove()}else if(Q(a)&&a.getListType()===e)l&&an(a,Hf,l),a.append(s),t.remove();else{let n=od(e,e===`number`?Number(r[2]):void 0);l&&an(n,Hf,l),n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0);let u=function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&s.setIndent(u)},Kf=(e,t,n)=>{let r=[],i=e.getChildren(),a=0;for(let o of i)if(Z(o)){if(o.getChildrenSize()===1){let e=o.getFirstChild();if(Q(e)){r.push(Kf(e,t,n+1));continue}}let i=` `.repeat(4*n),s=e.getListType(),c=rn(e,Hf),l=s===`number`?`${e.getStart()+a}. `:s===`check`?`${c} [${o.getChecked()?`x`:` `}] `:c+` `;r.push(i+l+t(o)),a++}return r.join(`
|
|
26
|
-
`)},qf={dependencies:[bu],export:(e,t)=>{if(!Tu(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:Mf,replace:Wf(e=>wu(`h`+e[1].length)),type:`element`},Jf={dependencies:[_u],export:(e,t)=>{if(!yu(e))return null;let n=t(e).split(`
|
|
27
|
-
`),r=[];for(let e of n)r.push(`> `+e);return r.join(`
|
|
28
|
-
`)},regExp:Nf,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(yu(n))return n.splice(n.getChildrenSize(),0,[Ri(),...t]),void e.remove()}let i=vu();i.append(...t),e.replace(i),r||i.select(0,0)},type:`element`},Yf={dependencies:[yd],export:e=>{if(!xd(e))return null;let t=e.getTextContent(),n=rn(e,Uf);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||``)+(t?`
|
|
29
|
-
`+t:``)+`
|
|
30
|
-
`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,Yf.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=o.slice(r[0].length);return l.length>0&&c.unshift(l),Yf.replace(t,null,r,s,c,!0),[!0,i]}}let d=e.slice(n+1),f=o.slice(r[0].length);return f.length>0&&d.unshift(f),Yf.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:Ff},regExpStart:Pf,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0;if(!t&&i){if(i.length===1)r?(o=bd(l),s=i[0]):(o=bd(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=bd(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
|
|
31
|
-
`)}an(o,Uf,c);let t=j(s);o.append(t),e.append(o)}else t&&Wf(e=>bd(e?e[2]:void 0))(e,t,n,a)},type:`multiline-element`},Xf={dependencies:[td,Zu],export:(e,t)=>Q(e)?Kf(e,t,0):null,regExp:Af,replace:Gf(`bullet`),type:`element`},Zf={dependencies:[td,Zu],export:(e,t)=>Q(e)?Kf(e,t,0):null,regExp:kf,replace:Gf(`number`),type:`element`},Qf={format:[`code`],tag:"`",type:`text-format`},$f={format:[`highlight`],tag:`==`,type:`text-format`},ep={format:[`bold`,`italic`],tag:`***`,type:`text-format`},tp={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},np={format:[`bold`],tag:`**`,type:`text-format`},rp={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},ip={format:[`strikethrough`],tag:`~~`,type:`text-format`},ap={format:[`italic`],tag:`*`,type:`text-format`},op={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},sp={dependencies:[ef],export:(e,t,n)=>{if(!rf(e)||sf(e))return null;let r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(ec(e,rf))return;let[,n,r,i]=t,a=nf(r,{title:i}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=j(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(j(l)),u},trigger:`)`,type:`text-match`},cp=[qf,Jf,Xf,Zf],lp=[Yf],up=[Qf,ep,tp,np,rp,$f,ap,op,ip],dp=[sp],fp=[...cp,...lp,...up,...dp];function pp(e,t=fp,n,r=!1,i=!1){let a=r?e:function(e,t=!1){let n=e.split(`
|
|
32
|
-
`),r=!1,i=[];for(let e=0;e<n.length;e++){let a=n[e].trimEnd(),o=i[i.length-1];If.test(a)?i.push(a):Pf.test(a)||Ff.test(a)?(r=!r,i.push(a)):r||a===``||o===``||!o||Mf.test(o)||Mf.test(a)||Nf.test(a)||kf.test(a)||Af.test(a)||jf.test(a)||Lf.test(a)||Rf.test(a)||!t||zf.test(a)||Bf.test(a)||Vf(Bf).test(o)||Vf(zf).test(o)||Ff.test(o)?i.push(a):i[i.length-1]=o+` `+a.trimStart()}return i.join(`
|
|
33
|
-
`)}(e,i);return Ef(t,r)(a,n)}function mp(e=fp,t,n=!1){return function(e,t=!1){let n=df(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let t=[],o=(e||G()).getChildren();for(let e=0;e<o.length;e++){let s=o[e],c=gf(s,r,a,n.textMatch);c!=null&&t.push(i&&e>0&&!hf(s)&&!hf(o[e-1])?`
|
|
34
|
-
${c}`:c)}return t.join(`
|
|
35
|
-
`)}}(e,n)(t)}var hp=`group|layer|stack|boundary`,gp=`component|application|api|database|queue|actor|file`,_p=`dataflow|hop|branch|theme|legend`,vp=`label|tint|link|resource|extend|shape|gap|no-gap|no-extend|ranks|columns|style|relation|color`,yp=e=>RegExp(`(?<![\\w./-])(?:${e})(?![\\w./-])`);fd.default.languages.asd={comment:/#.*/,string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},keyword:yp(`${hp}|${gp}|${_p}`),property:yp(vp),operator:/<->|->|--/,punctuation:/[{};]/};var bp={class:`markdown-editor-panel`},xp={class:`lexical-toolbar`},Sp=[`value`],Cp=[`value`],wp={class:`lexical-editor-container`},Tp=se({__name:`MarkdownEditor`,props:{modelValue:String,visible:Boolean},emits:[`update:modelValue`,`close`],setup(e,{emit:t}){let n=e,a=t,c=l(null),u=null,d=l(null),f=l(null),{layout:m}=ye(),g=[`javascript`,`typescript`,`ruby`,`python`,`html`,`css`,`json`,`yaml`,`bash`,`sql`,`go`,`rust`,`java`,`mermaid`,`asd`,`markdown`,`text`],_={asd:`Archsight Diagram`};function b(e){return _[e]||e.charAt(0).toUpperCase()+e.slice(1)}function C(){u||!c.value||(u=xo({namespace:`ArchsightMarkdownEditor`,nodes:[bu,_u,td,Zu,yd,Od,ef],onError:e=>console.error(`Lexical Error:`,e),theme:{paragraph:`lexical-paragraph`,heading:{h1:`lexical-h1`,h2:`lexical-h2`,h3:`lexical-h3`},list:{ul:`lexical-ul`,ol:`lexical-ol`,listitem:`lexical-li`},quote:`lexical-quote`,code:`lexical-code`,codeHighlight:{atrule:`tokenAttr`,attr:`tokenAttr`,boolean:`tokenProperty`,builtin:`tokenSelector`,cdata:`tokenComment`,char:`tokenSelector`,class:`tokenFunction`,"class-name":`tokenFunction`,comment:`tokenComment`,constant:`tokenProperty`,deleted:`tokenProperty`,doctype:`tokenComment`,entity:`tokenOperator`,function:`tokenFunction`,important:`tokenVariable`,inserted:`tokenSelector`,keyword:`tokenAttr`,namespace:`tokenVariable`,number:`tokenProperty`,operator:`tokenOperator`,prolog:`tokenComment`,property:`tokenProperty`,punctuation:`tokenPunctuation`,regex:`tokenVariable`,selector:`tokenSelector`,string:`tokenSelector`,symbol:`tokenProperty`,tag:`tokenProperty`,url:`tokenOperator`,variable:`tokenVariable`},link:`lexical-link`,text:{bold:`lexical-bold`,italic:`lexical-italic`,underline:`lexical-underline`,strikethrough:`lexical-strikethrough`,code:`lexical-text-code`}}}),u.setRootElement(c.value),ku(u),dd(u),Qd(u),Nu(u,Pu(),300),u.registerUpdateListener(()=>{u.getEditorState().read(()=>{let e=P();if(N(e)){let t=e.getNodes();for(let e of t){let t=e.getParent(),n=xd(t)?t:xd(e)?e:null;if(n){d.value=n.getLanguage()||``,f.value=d.value===`asd`?n.getTextContent():null;return}}}d.value=null,m.value!==`full`&&(f.value=null)})}))}o(()=>n.visible,e=>{e&&(f.value=null,setTimeout(()=>{u&&=(u.setRootElement(null),null),C(),u&&u.update(()=>{G().clear(),pp(n.modelValue||``,fp)})},0))});function ee(){u&&u.update(()=>{let e=mp(fp);a(`update:modelValue`,e),a(`close`)})}function te(e){u&&u.dispatchCommand(pr,e)}function w(e){if(u){if(e===`bullet`){u.dispatchCommand(cd,void 0);return}if(e===`number`){u.dispatchCommand(ld,void 0);return}u.update(()=>{let t=P();N(t)&&([`h1`,`h2`,`h3`].includes(e)?al(t,()=>wu(e)):e===`quote`?al(t,()=>vu()):e===`paragraph`&&al(t,()=>H()))})}}function ne(){u&&u.update(()=>{let e=P();if(N(e)){let t=bd(``);e.insertNodes([t]),t.select()}})}function ie(e){u&&u.update(()=>{let t=P();if(N(t))for(let n of t.getNodes()){let t=n.getParent();if(xd(t)){t.setLanguage(e);return}if(xd(n)){n.setLanguage(e);return}}})}function ae(){let e=prompt(`Enter URL:`,`https://`);e!==null&&u&&u.update(()=>{let t=P();if(N(t)){if(e===``)t.getNodes().forEach(e=>{let t=e.getParent();rf(t)&&(t.getChildren().forEach(e=>t.insertBefore(e)),t.remove())});else{let n=t.getTextContent()||e,r=nf(e);r.append(j(n)),t.insertNodes([r])}}})}function oe(e){e.key===`Escape`&&a(`close`)}return i(()=>{u&&=(u.setRootElement(null),null)}),(t,n)=>e.visible?(y(),T(`div`,{key:0,id:`markdown-editor-overlay`,onKeydown:oe},[p(`div`,{class:`markdown-editor-backdrop`,onClick:n[0]||=e=>t.$emit(`close`)}),p(`div`,bp,[p(`div`,xp,[p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[1]||=e=>te(`bold`),title:`Bold (Ctrl+B)`},[...n[15]||=[p(`i`,{class:`iconoir-bold`},null,-1)]]),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[2]||=e=>te(`italic`),title:`Italic (Ctrl+I)`},[...n[16]||=[p(`i`,{class:`iconoir-italic`},null,-1)]]),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[3]||=e=>te(`strikethrough`),title:`Strikethrough`},[...n[17]||=[p(`i`,{class:`iconoir-strikethrough`},null,-1)]]),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[4]||=e=>te(`code`),title:`Inline Code`},[...n[18]||=[p(`i`,{class:`iconoir-code`},null,-1)]]),n[25]||=p(`div`,{class:`toolbar-divider`},null,-1),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[5]||=e=>w(`h1`),title:`Heading 1`},`H1`),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[6]||=e=>w(`h2`),title:`Heading 2`},`H2`),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[7]||=e=>w(`h3`),title:`Heading 3`},`H3`),n[26]||=p(`div`,{class:`toolbar-divider`},null,-1),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[8]||=e=>w(`bullet`),title:`Bullet List`},[...n[19]||=[p(`i`,{class:`iconoir-list`},null,-1)]]),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[9]||=e=>w(`number`),title:`Numbered List`},[...n[20]||=[p(`i`,{class:`iconoir-numbered-list-left`},null,-1)]]),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[10]||=e=>w(`quote`),title:`Quote`},[...n[21]||=[p(`i`,{class:`iconoir-quote`},null,-1)]]),n[27]||=p(`div`,{class:`toolbar-divider`},null,-1),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[11]||=e=>ae(),title:`Insert Link`},[...n[22]||=[p(`i`,{class:`iconoir-link`},null,-1)]]),n[28]||=p(`div`,{class:`toolbar-divider`},null,-1),p(`button`,{class:`toolbar-btn`,type:`button`,onClick:n[12]||=e=>ne(),title:`Code Block`},[...n[23]||=[p(`i`,{class:`iconoir-code-brackets`},null,-1)]]),d.value===null?r(``,!0):(y(),T(`select`,{key:0,class:`toolbar-select`,value:d.value,onChange:n[13]||=e=>ie(e.target.value),title:`Code Language`},[n[24]||=p(`option`,{value:``},`Language...`,-1),(y(),T(v,null,s(g,e=>p(`option`,{key:e,value:e},h(b(e)),9,Cp)),64))],40,Sp)),n[29]||=p(`div`,{class:`toolbar-spacer`},null,-1),p(`button`,{class:`secondary toolbar-action`,type:`button`,onClick:n[14]||=e=>t.$emit(`close`)},`Cancel`),p(`button`,{class:`toolbar-action`,type:`button`,onClick:ee},`Save`)]),p(`div`,{class:x([`editor-split`,`layout-${S(m)}`])},[p(`div`,wp,[p(`div`,{ref_key:`editorRoot`,ref:c,id:`lexical-editor-root`,contenteditable:`true`},null,512)]),f.value===null?r(``,!0):(y(),re(ke,{key:0,class:`editor-diagram-preview`,source:f.value},null,8,[`source`]))],2)])],32)):r(``,!0)}},[[`__scopeId`,`data-v-301f6d2d`]]),Ep={key:0},Dp={key:1},Op={key:2,class:`yaml-output`},kp={key:0,class:`field-group`},Ap=[`value`],jp={key:1,class:`field-group`},Mp=[`aria-invalid`],Np={key:0,class:`field-error`},Pp={class:`annotations-grid`},Fp={key:0},Ip={class:`form-actions`},Lp={type:`submit`},Rp=se({__name:`EditorPage`,props:{kind:String,instance:String},setup(e){let t=e,n=te(),i=c(`kinds`),o=l(!0),d=l(null),g=l(null),C=l(``),ne=l({}),se=l([]),le=l({}),de=l(null),fe=l(`yaml`),pe=l(null),me=l(null),he=l(null),ge=l(!1),_e=a(()=>!!t.instance),ve=a(()=>_e.value?`Edit ${t.kind}`:`New ${t.kind}`),ye=a(()=>_e.value?`/kinds/${t.kind}/instances/${t.instance}`:`/kinds/${t.kind}`),be=a(()=>!i.value||!d.value?null:{icon:d.value.icon,layer:d.value.layer});ue(async()=>{try{let e=_e.value?await w(t.kind,t.instance):await ie(t.kind);d.value=e,_e.value&&(C.value=e.name||``,ne.value=e.annotations||{},se.value=e.relations||[],me.value=e.content_hash,pe.value=e.path_ref)}catch(e){g.value=e.message}finally{o.value=!1}});async function xe(){le.value={};let e={name:C.value,annotations:ne.value,relations:se.value.map(e=>({verb:e.verb,kind:e.kind,names:[e.name]})),content_hash:me.value},n;try{n=_e.value?await ee(t.kind,t.instance,e):await ae(t.kind,e)}catch(e){alert(`Generate failed: ${e.message}`);return}n.errors?le.value=n.errors:(de.value=n.yaml,fe.value=n.format||`yaml`,n.path_ref&&(pe.value=n.path_ref),n.content_hash&&(me.value=n.content_hash))}function Se(){de.value=null}function Ce(e){he.value=e,ge.value=!0}function we(e){he.value&&(ne.value[he.value]=e)}function Te(){ge.value=!1,he.value=null}return(t,i)=>{let a=b(`router-link`);return o.value?(y(),T(`article`,Ep,[...i[3]||=[p(`p`,null,`Loading...`,-1)]])):g.value?(y(),T(`article`,Dp,[i[4]||=p(`header`,null,[p(`h2`,null,`Error`)],-1),p(`p`,null,h(g.value),1)])):de.value?(y(),T(`article`,Op,[p(`header`,null,[p(`h3`,null,[be.value?(y(),T(`i`,{key:0,class:x(`iconoir-${be.value.icon} icon-${be.value.layer}`)},null,2)):r(``,!0),f(` `+h(ve.value),1)]),m(a,{class:`btn-back`,to:ye.value},{default:u(()=>[...i[5]||=[p(`i`,{class:`iconoir-arrow-left`},null,-1),f(` Back `,-1)]]),_:1},8,[`to`])]),m(ut,{yaml:de.value,format:fe.value,kind:e.kind,name:C.value,"content-hash":me.value,"path-ref":pe.value,"inline-edit-enabled":d.value.inline_edit_enabled,onEditAgain:Se},null,8,[`yaml`,`format`,`kind`,`name`,`content-hash`,`path-ref`,`inline-edit-enabled`])])):d.value?(y(),T(v,{key:3},[p(`form`,{class:`editor-form`,onSubmit:ce(xe,[`prevent`])},[p(`article`,null,[p(`header`,null,[p(`h3`,null,[be.value?(y(),T(`i`,{key:0,class:x(`iconoir-${be.value.icon} icon-${be.value.layer}`)},null,2)):r(``,!0),f(` `+h(ve.value),1)]),m(a,{class:`btn-back`,to:ye.value},{default:u(()=>[...i[6]||=[p(`i`,{class:`iconoir-arrow-left`},null,-1),f(` Back `,-1)]]),_:1},8,[`to`])]),_e.value?(y(),T(`div`,kp,[p(`input`,{id:`name`,type:`text`,value:C.value,disabled:``},null,8,Ap)])):(y(),T(`div`,jp,[i[7]||=p(`label`,{for:`name`},[f(` Name `),p(`span`,{class:`required`},`*`)],-1),oe(p(`input`,{id:`name`,type:`text`,"onUpdate:modelValue":i[0]||=e=>C.value=e,required:``,placeholder:`Enter resource name (no spaces)`,pattern:`\\S+`,"aria-invalid":le.value.name?`true`:void 0},null,8,Mp),[[_,C.value]]),le.value.name?(y(),T(`div`,Np,h(le.value.name.join(`, `)),1)):r(``,!0)]))]),p(`article`,null,[i[8]||=p(`header`,null,[p(`h3`,null,`Annotations`)],-1),p(`div`,Pp,[(y(!0),T(v,null,s(d.value.fields,e=>(y(),re(Ke,{key:e.key,field:e,"model-value":ne.value[e.key],error:le.value[e.key],"onUpdate:modelValue":t=>ne.value[e.key]=t,onOpenMarkdown:Ce},null,8,[`field`,`model-value`,`error`,`onUpdate:modelValue`]))),128))])]),d.value.relation_options.length?(y(),T(`article`,Fp,[i[9]||=p(`header`,null,[p(`h3`,null,`Relations`)],-1),m(tt,{relations:se.value,"relation-options":d.value.relation_options,"instances-by-kind":d.value.instances_by_kind,"onUpdate:relations":i[1]||=e=>se.value=e},null,8,[`relations`,`relation-options`,`instances-by-kind`])])):r(``,!0),p(`div`,Ip,[p(`button`,Lp,[i[10]||=p(`i`,{class:`iconoir-code`},null,-1),f(` Generate `+h(d.value.format===`markdown`?`MD`:`YAML`),1)]),p(`button`,{type:`button`,class:`secondary`,onClick:i[2]||=e=>S(n).push(ye.value)},` Cancel `)])],32),m(Tp,{visible:ge.value,"model-value":he.value&&ne.value[he.value]||``,"onUpdate:modelValue":we,onClose:Te},null,8,[`visible`,`model-value`])],64)):r(``,!0)}}},[[`__scopeId`,`data-v-eaf4b1c1`]]);export{Rp as default};
|