1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6712],{438:(e,t,n)=>{n.d(t,{Fq:()=>s,Is:()=>i,YH:()=>l});var r=n(62261),o=n(79274);let i=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;o.vZ,o.CW;let s=Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&r.RI(e)===e)},1651:(e,t,n)=>{n.d(t,{Mq:()=>i,bD:()=>o,vt:()=>r});let r=e=>Error(e),o=()=>{throw r("Method unimplemented")},i=()=>{throw r("Unexpected case")}},2109:(e,t,n)=>{n.d(t,{a:()=>tV,c:()=>tL,f:()=>tB,g:()=>tP,h:()=>tj,i:()=>tU,l:()=>tD,m:()=>t_,n:()=>tJ,o:()=>tH,p:()=>tO,r:()=>tW,s:()=>t$,t:()=>tY,u:()=>tR});var r=n(12115),o=n(76701),i=n(17294),l=n(94577);function s(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=a(e);if(n.length!==a(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function a(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var c=n(37366),d=n(14267),u=n(13015),p=n(32803),h={slash_menu:{heading:{title:"Heading 1",subtext:"Top-level heading",aliases:["h","heading1","h1"],group:"Headings"},heading_2:{title:"Heading 2",subtext:"Key section heading",aliases:["h2","heading2","subheading"],group:"Headings"},heading_3:{title:"Heading 3",subtext:"Subsection and group heading",aliases:["h3","heading3","subheading"],group:"Headings"},heading_4:{title:"Heading 4",subtext:"Minor subsection heading",aliases:["h4","heading4","subheading4"],group:"Subheadings"},heading_5:{title:"Heading 5",subtext:"Small subsection heading",aliases:["h5","heading5","subheading5"],group:"Subheadings"},heading_6:{title:"Heading 6",subtext:"Lowest-level heading",aliases:["h6","heading6","subheading6"],group:"Subheadings"},toggle_heading:{title:"Toggle Heading 1",subtext:"Toggleable top-level heading",aliases:["h","heading1","h1","collapsable"],group:"Subheadings"},toggle_heading_2:{title:"Toggle Heading 2",subtext:"Toggleable key section heading",aliases:["h2","heading2","subheading","collapsable"],group:"Subheadings"},toggle_heading_3:{title:"Toggle Heading 3",subtext:"Toggleable subsection and group heading",aliases:["h3","heading3","subheading","collapsable"],group:"Subheadings"},quote:{title:"Quote",subtext:"Quote or excerpt",aliases:["quotation","blockquote","bq"],group:"Basic blocks"},toggle_list:{title:"Toggle List",subtext:"List with hideable sub-items",aliases:["li","list","toggleList","toggle list","collapsable list"],group:"Basic blocks"},numbered_list:{title:"Numbered List",subtext:"List with ordered items",aliases:["ol","li","list","numberedlist","numbered list"],group:"Basic blocks"},bullet_list:{title:"Bullet List",subtext:"List with unordered items",aliases:["ul","li","list","bulletlist","bullet list"],group:"Basic blocks"},check_list:{title:"Check List",subtext:"List with checkboxes",aliases:["ul","li","list","checklist","check list","checked list","checkbox"],group:"Basic blocks"},paragraph:{title:"Paragraph",subtext:"The body of your document",aliases:["p","paragraph"],group:"Basic blocks"},code_block:{title:"Code Block",subtext:"Code block with syntax highlighting",aliases:["code","pre"],group:"Basic blocks"},page_break:{title:"Page Break",subtext:"Page separator",aliases:["page","break","separator"],group:"Basic blocks"},table:{title:"Table",subtext:"Table with editable cells",aliases:["table"],group:"Advanced"},image:{title:"Image",subtext:"Resizable image with caption",aliases:["image","imageUpload","upload","img","picture","media","url"],group:"Media"},video:{title:"Video",subtext:"Resizable video with caption",aliases:["video","videoUpload","upload","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Embedded audio with caption",aliases:["audio","audioUpload","upload","mp3","sound","media","url"],group:"Media"},file:{title:"File",subtext:"Embedded file",aliases:["file","upload","embed","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Search for and insert an emoji",aliases:["emoji","emote","emotion","face"],group:"Others"}
1,divider:{title:"Divider",subtext:"Visually divide blocks",aliases:["divider","hr","line","horizontal rule"],group:"Basic blocks"}},placeholders:{default:"Enter text or type '/' for commands",heading:"Heading",toggleListItem:"Toggle",bulletListItem:"List",numberedListItem:"List",checkListItem:"List",emptyDocument:void 0,new_comment:"Write a comment...",edit_comment:"Edit comment...",comment_reply:"Add comment..."},file_blocks:{add_button_text:{image:"Add image",video:"Add video",audio:"Add audio",file:"Add file"}},toggle_blocks:{add_block_button:"Empty toggle. Click to add a block."},side_menu:{add_block_label:"Add block",drag_handle_label:"Open block menu"},drag_handle:{delete_menuitem:"Delete",colors_menuitem:"Colors",header_row_menuitem:"Header row",header_column_menuitem:"Header column"},table_handle:{delete_column_menuitem:"Delete column",delete_row_menuitem:"Delete row",add_left_menuitem:"Add column left",add_right_menuitem:"Add column right",add_above_menuitem:"Add row above",add_below_menuitem:"Add row below",split_cell_menuitem:"Split cell",merge_cells_menuitem:"Merge cells",background_color_menuitem:"Background color"},suggestion_menu:{no_items_title:"No items found"},color_picker:{text_title:"Text",background_title:"Background",colors:{default:"Auto",gray:"Gray",brown:"Brown",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",pink:"Pink"}},formatting_toolbar:{bold:{tooltip:"Bold",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italic",secondary_tooltip:"Mod+I"},underline:{tooltip:"Underline",secondary_tooltip:"Mod+U"},strike:{tooltip:"Strike",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Colors"},link:{tooltip:"Create link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Edit caption",input_placeholder:"Edit caption"},file_replace:{tooltip:{image:"Replace image",video:"Replace video",audio:"Replace audio",file:"Replace file"}},file_rename:{tooltip:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"},input_placeholder:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"}},file_download:{tooltip:{image:"Download image",video:"Download video",audio:"Download audio",file:"Download file"}},file_delete:{tooltip:{image:"Delete image",video:"Delete video",audio:"Delete audio",file:"Delete file"}},file_preview_toggle:{tooltip:"Toggle preview"},nest:{tooltip:"Nest block",secondary_tooltip:"Tab"},unnest:{tooltip:"Unnest block",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Align text left"},align_center:{tooltip:"Align text center"},align_right:{tooltip:"Align text right"},align_justify:{tooltip:"Justify text"},table_cell_merge:{tooltip:"Merge cells"},comment:{tooltip:"Add comment"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload image",video:"Upload video",audio:"Upload audio",file:"Upload file"},upload_error:"Error: Upload failed"},embed:{title:"Embed",embed_button:{image:"Embed image",video:"Embed video",audio:"Embed audio",file:"Embed file"},url_placeholder:"Enter URL"}},link_toolbar:{delete:{tooltip:"Remove link"},edit:{text:"Edit link",tooltip:"Edit"},open:{tooltip:"Open in new tab"},form:{title_placeholder:"Edit title",url_placeholder:"Edit URL"}},comments:{edited:"edited",save_button_text:"Save",cancel_button_text:"Cancel",deleted_reference_text:"Original content deleted",actions:{add_reaction:"Add reaction",resolve:"Resolve",reopen:"Re-open",edit_comment:"Edit comment",delete_comment:"Delete comment",more_actions:"More actions"},reactions:{reacted_by:"Reacted by"},sidebar:{marked_as_resolved:"Marked as resolved",more_replies:e=>`${e} more replies`}},generic:{ctrl_shortcut:"Ctrl"}},f=n(48863),m=n(27050),g=n(8242),b=n(82159),y=n(76865),v=n(62921),k=n(59710);class w{match;handler;undoable;inCode;inCodeMark;constructor(e,t,n={}){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,r,o){let i=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);i+=n[0].slice(e+n[1].length);let t=(r+=e)-o;t>0&&(i=n[0].slice(e-t,e)+i,r=o)}return t.tr.insertText(i,r,o)}}(t):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark}}
1function x(e,t,n,r,o,i){if(e.composing)return!1;let l=e.state.tr.insertText(r,t,n),s=l.mapping.map(t),a=l.mapping.map(n),c=null,d=l.doc.resolve(s),u=d.parent.textBetween(Math.max(0,d.parentOffset-500),d.parentOffset,null,"");for(let t=0;t<o.length;t++){let n=o[t];if(!n.inCodeMark&&d.marks().some(e=>e.type.spec.code))continue;if(d.parent.type.spec.code){if(!n.inCode)continue}else if("only"===n.inCode)continue;let p=n.match.exec(u);if(!p||p[0].length<r.length)continue;c??=e.state.apply(l);let h=n.handler(c,p,s-p[0].length,a);if(h)return e.dispatch(l),e.dispatch((0,k.xq)(e.state.tr)),n.undoable&&h.setMeta(i,{transform:h,from:s,to:a,text:r}),e.dispatch(h),!0}return!1}new w(/--$/,"â",{inCodeMark:!1}),new w(/\.\.\.$/,"â¦",{inCodeMark:!1}),new w(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"â",{inCodeMark:!1}),new w(/"$/,"â",{inCodeMark:!1}),new w(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"â",{inCodeMark:!1}),new w(/'$/,"â",{inCodeMark:!1});var C=n(12894),S=n(63197);class E extends y.LN{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return E.valid(n)?new E(n):y.LN.near(n)}content(){return m.Ji.empty}eq(e){return e instanceof E&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new E(e.resolve(t.pos))}getBookmark(){return new M(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||T(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||T(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&E.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let l=e.doc.resolve(r);if(E.valid(l))return l}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!y.nh.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let l=e.doc.resolve(r);if(E.valid(l))return l}return null}}}E.prototype.visible=!1,E.findFrom=E.findGapCursorFrom,y.LN.jsonID("gapcursor",E);class M{constructor(e){this.pos=e}map(e){return new M(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return E.valid(t)?new E(t):y.LN.near(t)}}function T(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let A=(0,C.K)({ArrowLeft:I("horiz",-1),ArrowRight:I("horiz",1),ArrowUp:I("vert",-1),ArrowDown:I("vert",1)});function I(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,l=t>0?i.$to:i.$from,s=i.empty;if(i instanceof y.U3){if(!o.endOfTextblock(n)||0==l.depth)return!1;s=!1,l=e.doc.resolve(t>0?l.after():l.before())}let a=E.findGapCursorFrom(l,t,s);return!!a&&(r&&r(e.tr.setSelection(new E(a))),!0)}}function N(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!E.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&y.nh.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new E(r))),!0)}function j(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof E))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=m.FK.empty;for(let e=r.length-1;e>=0;e--)o=m.FK.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new m.Ji(o,0,0));return i.setSelection(y.U3.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function P(e){if(!(e.selection instanceof E))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",S.zF.create(e.doc,[S.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}var _=b.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new y.k_({props:{decorations:P,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&E.valid(n)?new E(n):null,handleClick:N,handleKeyDown:A,handleDOMEvents:{beforeinput
1:j}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,b.gk)((0,b.iI)(e,"allowGapCursor",n)))?t:null}}}),B=b.bP.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});function O(e){if(!e||"column"!==e.type.name)throw Error("Invalid columnPos: does not point to column node.");let t=e.firstChild;if(!t)throw Error("Invalid column: does not have child node.");let n=t.firstChild;if(!n)throw Error("Invalid blockContainer: does not have child node.");return 1===e.childCount&&1===t.childCount&&"paragraph"===n.type.name&&0===n.content.content.length}function R(e,t){!function(e,t){let n=e.doc.resolve(t),r=n.nodeAfter;if(!r||"columnList"!==r.type.name)throw Error("Invalid columnListPos: does not point to columnList node.");for(let t=r.childCount-1;t>=0;t--){let r=e.doc.resolve(n.pos+1).posAtIndex(t),o=e.doc.resolve(r).nodeAfter;if(!o||"column"!==o.type.name)throw Error("Invalid columnPos: does not point to column node.");O(o)&&e.delete(r,r+o.nodeSize)}}(e,t);let n=e.doc.resolve(t).nodeAfter;if(!n||"columnList"!==n.type.name)throw Error("Invalid columnListPos: does not point to columnList node.");if(n.childCount>2)return;if(n.childCount<2)throw Error("Invalid columnList: contains fewer than two children.");let r=t+1,o=e.doc.resolve(r).nodeAfter,i=t+n.nodeSize-1,l=e.doc.resolve(i).nodeBefore;if(!o||!l)throw Error("Invalid columnList: does not contain children.");let s=O(o),a=O(l);s&&a?e.delete(t,t+n.nodeSize):s?e.step(new g.Wg(t,t+n.nodeSize,i-l.nodeSize+1,i-1,m.Ji.empty,0,!1)):a&&e.step(new g.Wg(t,t+n.nodeSize,r+1,r+o.nodeSize-1,m.Ji.empty,0,!1))}function L(e,t,n){let r=(0,c.fn)(e),o=n.map(e=>{let t=(0,c.kt)(e,r);return t.check(),t}),i=new Set(t.map(e=>"string"==typeof e?e:e.id)),l=[],s=new Set,a="string"==typeof t[0]?t[0]:t[0].id,d=0;if(e.doc.descendants((t,u)=>{if(0===i.size)return!1;if(!t.type.isInGroup("bnBlock")||!i.has(t.attrs.id))return!0;if(l.push((0,c.an)(t,r)),i.delete(t.attrs.id),n.length>0&&t.attrs.id===a){let t=e.doc.nodeSize;e.insert(u,o);let n=e.doc.nodeSize;d+=t-n}let p=e.doc.nodeSize,h=e.doc.resolve(u-d);"column"===h.node().type.name?s.add(h.before(-1)):"columnList"===h.node().type.name&&s.add(h.before()),"blockGroup"===h.node().type.name&&"doc"!==h.node(h.depth-1).type.name&&1===h.node().childCount?e.delete(h.before(),h.after()):e.delete(u-d,u-d+t.nodeSize);let f=e.doc.nodeSize;return d+=p-f,!1}),i.size>0)throw Error("Blocks with the following IDs could not be found in the editor: "+[...i].join("\n"));return s.forEach(t=>R(e,t)),{insertedBlocks:o.map(e=>(0,c.an)(e,r)),removedBlocks:l}}var D=(e,t,n,r)=>{let o=e.pmSchema.nodes.blockGroup,i=o.spec.toDOM(o.create({})),l=function e(t,n,r,o){let i=(o?.document??document).createDocumentFragment();for(let l of n){let n=function(t,n,r,o){let i=t.pmSchema.nodes.blockContainer,l=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))e in l||void 0===r.default||(l[e]=r.default);let s=n.children||[],a=t.blockImplementations[n.type].implementation.render.call({renderType:"dom",props:void 0},{...n,props:l,children:s},t);if(a.contentDOM&&n.content){let e=function(e,t,n,r,o){let i;if(!t)throw Error("blockContent is required");if("string"==typeof t)i=(0,c.At)([t],e.pmSchema,r);else if(Array.isArray(t))i=(0,c.At)(t,e.pmSchema,r);else if("tableContent"===t.type)i=(0,c.jt)(t,e.pmSchema);else throw new c.zn(t.type);let l=(o?.document??document).createDocumentFragment();for(let t of i)if("text"!==t.type.name&&e.schema.inlineContentSchema[t.type.name]){let r=e.schema.inlineContentSpecs[t.type.name].implementation;if(r){let i=(0,c.on)(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=r.render.call({renderType:"dom",props:void 0},i,()=>{},e);if(s){if(l.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,o);s.contentDOM.dataset.editable="",s.contentDOM.appendChild(e)}continue}}}else if("text"===t.type.name){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=e.schema.styleSpecs[r.type.n
1ame].implementation.render(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=m.ZF.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}l.appendChild(n)}else{let e=n.serializeFragment(m.FK.from([t]),o);l.appendChild(e)}return l}(t,n.content,r,n.type,o);a.contentDOM.appendChild(e)}if(t.pmSchema.nodes[n.type].isInGroup("bnBlock")){if(n.children&&n.children.length>0){let i=e(t,n.children,r,o);a.contentDOM?.append(i)}return a.dom}let d=i.spec?.toDOM?.(i.create({id:n.id,...l}));return d.contentDOM?.appendChild(a.dom),n.children&&n.children.length>0&&d.contentDOM?.appendChild(D(t,n.children,r,o)),d.dom}(t,l,r,o);i.appendChild(n)}return i}(e,t,n,r);return i.contentDOM?.appendChild(l),i.dom},$=e=>(e.querySelectorAll('[data-content-type="numberedListItem"]').forEach(e=>{let t=e.closest(".bn-block-outer")?.previousElementSibling?.querySelector('[data-content-type="numberedListItem"]');if(t){let n=t.getAttribute("data-index");e.setAttribute("data-index",(parseInt(n||"0")+1).toString())}else e.setAttribute("data-index",e.getAttribute("data-start")||"1")}),e),F=e=>(e.querySelectorAll('[data-content-type="checkListItem"] input').forEach(e=>{e.disabled=!0}),e),z=e=>(e.querySelectorAll('.bn-toggle-wrapper[data-show-children="false"]').forEach(e=>{e.setAttribute("data-show-children","true")}),e),H=e=>(e.querySelectorAll('[data-content-type="table"] table').forEach(e=>{e.setAttribute("style","--default-cell-min-width: 120px;"),e.setAttribute("data-show-children","true")}),e),V=e=>(e.querySelectorAll('[data-content-type="table"] table').forEach(e=>{let t=document.createElement("div");t.className="tableWrapper";let n=document.createElement("div");n.className="tableWrapper-inner",t.appendChild(n),e.parentElement?.appendChild(t),t.appendChild(e)}),e),U=e=>(e.querySelectorAll(".bn-inline-content:empty").forEach(e=>{let t=document.createElement("span");t.className="ProseMirror-trailingBreak",t.setAttribute("style","display: inline-block;"),e.appendChild(t)}),e);function W(e,t,n,r){e.transact(()=>{let o=e.getBlock(n);if(o?.type==="columnList"){let t="after"===r?e.getNextBlock(o):e.getPrevBlock(o);t&&(n=t,r="after"===r?"before":"after")}e.removeBlocks(t),e.insertBlocks(t.flatMap(e=>"column"===e.type?e.children:[e]),n,r)})}function J(e,t,n){e.transact(r=>{let o=e.getSelection()?.blocks||[e.getTextCursorPosition().block],i=e.transact(e=>{let t=(0,c.yn)(e.doc,e.selection.anchor);if(e.selection instanceof v.rn)return{type:"cell",anchorBlockId:t.node.attrs.id,anchorCellOffset:e.selection.$anchorCell.pos-t.posBeforeNode,headCellOffset:e.selection.$headCell.pos-t.posBeforeNode};if(e.selection instanceof y.nh)return{type:"node",anchorBlockId:t.node.attrs.id};{let n=(0,c.yn)(e.doc,e.selection.head);return{type:"text",anchorBlockId:t.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:e.selection.anchor-t.posBeforeNode,headOffset:e.selection.head-n.posBeforeNode}}});W(e,o,t,n),function(e,t){let n,r=(0,c.Dt)(t.anchorBlockId,e.doc)?.posBeforeNode;if(void 0===r)throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);if("cell"===t.type)n=v.rn.create(e.doc,r+t.anchorCellOffset,r+t.headCellOffset);else if("node"===t.type)n=y.nh.create(e.doc,r+1);else{let o=(0,c.Dt)(t.headBlockId,e.doc)?.posBeforeNode;if(void 0===o)throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);n=y.U3.create(e.doc,r+t.anchorOffset,o+t.headOffset)}e.setSelection(n)}(r,i)})}function G(e){return!e||"columnList"!==e.type}function q(e){return e.transact(t=>(function(e,t,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,e=>e.childCount>0&&("blockGroup"===e.type.name||"column"===e.type.name));if(!i)return!1;let l=i.startIndex;if(0===l)return!1;let s=i.parent.child(l-1);if(s.type!==t)return!1;let a=s.lastChild&&s.lastChild.type===n,c=m.FK.from(a?t.create():null),d=new m.Ji(m.FK.from(t.create(null,m.FK.from(n.create(null,c)))),a?3:1,0),u=i.start,p=i.end;return e.step(new g.Wg(u-(a?3:1),p,u,p,d,1,!0)).scrollIntoView(),!0})(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup))}function K(e,t,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,e=>e.childCount>
10&&("blockGroup"===e.type.name||"column"===e.type.name));return!!i&&r.node(i.depth-1).type===t&&function(e,t,n,r){let o=r.end,i=r.$to.end(r.depth);if(o<i){let l=r.parent.child(r.endIndex-1),s=l.lastChild&&l.lastChild.type===n;e.step(new g.Wg(o-(s?2:1),i,o,i,new m.Ji(m.FK.from(t.create(null,n.create())),s?2:1,0),+!s,!0)),r=new m.u$(e.doc.resolve(r.$from.pos),e.doc.resolve(i),r.depth)}let l=(0,g.jP)(r);if(null==l)return!1;e.lift(r,l);let s=e.doc.resolve(e.mapping.map(o,-1)-1);return(0,g.n9)(e.doc,s.pos)&&s.nodeBefore.type===s.nodeAfter.type&&e.join(s.pos),e.scrollIntoView(),!0}(e,t,n,i)}function Y(e){return e.transact(t=>K(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup))}var Z=class{constructor(e){this.editor=e}get document(){return this.editor.transact(e=>(0,c.in)(e.doc,this.editor.pmSchema))}getBlock(e){return this.editor.transact(t=>(function(e,t){let n="string"==typeof t?t:t.id,r=(0,c.fn)(e),o=(0,c.Dt)(n,e);if(o)return(0,c.an)(o.node,r)})(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>(function(e,t){let n=(0,c.Dt)("string"==typeof t?t:t.id,e),r=(0,c.fn)(e);if(!n)return;let o=e.resolve(n.posBeforeNode).nodeBefore;if(o)return(0,c.an)(o,r)})(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>(function(e,t){let n=(0,c.Dt)("string"==typeof t?t:t.id,e),r=(0,c.fn)(e);if(!n)return;let o=e.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(o)return(0,c.an)(o,r)})(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>(function(e,t){let n="string"==typeof t?t:t.id,r=(0,c.fn)(e),o=(0,c.Dt)(n,e);if(!o)return;let i=e.resolve(o.posBeforeNode),l=i.node(),s=i.node(-1),a="doc"===s.type.name?void 0:"blockGroup"===l.type.name?s:l;if(a)return(0,c.an)(a,r)})(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse(),!function n(r){for(let o of r)if(!1===e(o)||!n(t?o.children.slice().reverse():o.children))return!1;return!0}(n)}insertBlocks(e,t,n="before"){return this.editor.transact(r=>(function(e,t,n,r="before"){let o="string"==typeof n?n:n.id,i=(0,c.fn)(e),l=t.map(e=>{let t=(0,c.kt)(e,i);return t.check(),t}),s=(0,c.Dt)(o,e.doc);if(!s)throw Error(`Block with ID ${o} not found`);let a=s.posBeforeNode;return"after"===r&&(a+=s.node.nodeSize),e.step(new g.Ln(a,a,new m.Ji(m.FK.from(l),0,0))),l.map(e=>(0,c.an)(e,i))})(r,e,t,n))}updateBlock(e,t){return this.editor.transact(n=>(0,c.wt)(n,e,t))}removeBlocks(e){return this.editor.transact(t=>L(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>L(n,e,t))}canNestBlock(){return this.editor.transact(e=>{let{bnBlock:t}=(0,c._n)(e);return null!==e.doc.resolve(t.beforePos).nodeBefore})}nestBlock(){q(this.editor)}canUnnestBlock(){return this.editor.transact(e=>{let{bnBlock:t}=(0,c._n)(e);return e.doc.resolve(t.beforePos).depth>1})}unnestBlock(){Y(this.editor)}moveBlocksUp(e){var t;return t=this.editor,void t.transact(()=>{let n;if(e){if(!(n=t.getBlock(e)))return}else n=t.getSelection()?.blocks[0]||t.getTextCursorPosition().block;let r=function e(t,n,r){let o,i;if(n?n.children.length>0?(o=n.children[n.children.length-1],i="after"):(o=n,i="before"):r&&(o=r,i="before"),!o||!i)return;let l=t.getParentBlock(o);return G(l)?{referenceBlock:o,placement:i}:e(t,"after"===i?o:t.getPrevBlock(o),l)}(t,t.getPrevBlock(n),t.getParentBlock(n));r&&(e?W(t,[n],r.referenceBlock,r.placement):J(t,r.referenceBlock,r.placement))})}moveBlocksDown(e){var t;return t=this.editor,void t.transact(()=>{let n;if(e){if(!(n=t.getBlock(e)))return}else{let e=t.getSelection();n=e?.blocks[e?.blocks.length-1]||t.getTextCursorPosition().block}let r=function e(t,n,r){let o,i;if(n?n.children.length>0?(o=n.children[0],i="before"):(o=n,i="after"):r&&(o=r,i="after"),!o||!i)return;let l=t.getParentBlock(o);return G(l)?{referenceBlock:o,placement:i}:e(t,"before"===i?o:t.getNextBlock(o),l)}(t,t.getNextBlock(n),t.getParentBlock(n));r&&(e?W(t,[n],r.referenceBlock,r.placement):J(t,r.referenceBlock,r.placement))})}},X=class extends f.t{constructor(e){super(),this.editor=e,e.on("create",()=>{e._tiptapEditor.on("update",({transaction:t,appendedTransactions:n})=>{this.emit("onChange",{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on("selectionUpdate",({transaction:t})=>
1{this.emit("onSelectionChange",{editor:e,transaction:t})}),e._tiptapEditor.on("mount",()=>{this.emit("onMount",{editor:e})}),e._tiptapEditor.on("unmount",()=>{this.emit("onUnmount",{editor:e})})})}onChange(e,t=!0){let n=({transaction:n,appendedTransactions:r})=>{!t&&Q(n)||e(this.editor,{getChanges:()=>(0,d.D)(n,r)})};return this.on("onChange",n),()=>{this.off("onChange",n)}}onSelectionChange(e,t=!1){let n=n=>{!t&&Q(n.transaction)||e(this.editor)};return this.on("onSelectionChange",n),()=>{this.off("onSelectionChange",n)}}onMount(e){return this.on("onMount",e),()=>{this.off("onMount",e)}}onUnmount(e){return this.on("onUnmount",e),()=>{this.off("onUnmount",e)}}};function Q(e){return!!e.getMeta("y-sync$")}var ee=null;function et(e,t){let n=function(e){if("string"==typeof e){let t=(ee||=document.implementation.createHTMLDocument("title")).createElement("div");t.innerHTML=e,e=t}return e.querySelectorAll("li > ul, li > ol").forEach(e=>{let t=Array.prototype.indexOf.call(e.parentElement.childNodes,e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement("afterend",e),r.reverse().forEach(t=>{if(3===t.nodeType&&!/\S/.test(t.nodeValue||""))return;let n=document.createElement("li");n.append(t),e.insertAdjacentElement("afterend",n)}),0===n.childNodes.length&&n.remove()}),e.querySelectorAll("li + ul, li + ol").forEach(e=>{let t=e.previousElementSibling,n=document.createElement("div");t.insertAdjacentElement("afterend",n),n.append(t);let r=document.createElement("div");for(r.setAttribute("data-node-type","blockGroup"),n.append(r);n.nextElementSibling?.nodeName==="UL"||n.nextElementSibling?.nodeName==="OL";)r.append(n.nextElementSibling)}),e}(e);(function(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||""))return!0;return!1})(n)||function(e){let t=new Set(["PRE","CODE"]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],o;for(;o=n.nextNode();)r.push(o);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g," "))}(n);let r=m.S4.fromSchema(t).parse(n,{topNode:t.nodes.blockGroup.create()}),o=[];for(let e=0;e<r.childCount;e++)o.push((0,c.an)(r.child(e),t));return o}function en(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function er(e){return!!e&&/\w/.test(e)}function eo(e,t,n){let r=t>0?e[t-1]:void 0,o=t+n<e.length?e[t+n]:void 0;return er(r)&&er(o)}var ei=/^<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?>/,el=/^<!--[\s\S]*?-->/,es=/^<!\[CDATA\[[\s\S]*?\]\]>/,ea=/^<\?[\s\S]*?\?>/,ec=/^<![A-Za-z][\s\S]*?>/,ed=new Set("\\`![~*_\n<"),eu=[function(e,t){if("\\"!==e[t]||t+1>=e.length)return null;let n=e[t+1];return"\n"===n?{html:"<br>\n",end:t+2}:"\\`*_{}[]()#+-.!~|>".includes(n)?{html:en(n),end:t+2}:null},function(e,t){return"`"===e[t]?function(e,t){let n=0,r=t;for(;r<e.length&&"`"===e[r];)n++,r++;let o=r;for(;o<e.length;)if("`"===e[o]){let t=0,i=o;for(;o<e.length&&"`"===e[o];)t++,o++;if(t===n){let t=e.substring(r,i);return(t=t.replace(/\n/g," ")).length>=2&&" "===t[0]&&" "===t[t.length-1]&&/[^ ]/.test(t)&&(t=t.substring(1,t.length-1)),{html:`<code>${en(t)}</code>`,end:o}}}else o++;return null}(e,t):null},function(e,t){return"!"!==e[t]||"["!==e[t+1]?null:function(e,t){let n=eh(e,t+1);if(-1===n||"("!==e[n+1])return null;let r=n+2,o=ef(e,r-1);if(-1===o)return null;let i=e.substring(t+2,n),{url:l,title:s}=em(e.substring(r,o));if((0,c.jn)(l)){let e=i||s;return{html:`<video src="${en(l)}"${e?` data-name="${en(e)}"`:""} data-url="${en(l)}" controls></video>`,end:o+1}}let a=void 0===s?"":` title="${en(s)}"`;return{html:`<img src="${en(l)}" alt="${en(i)}"${a}>`,end:o+1}}(e,t)},function(e,t){return"["===e[t]?function(e,t){let n=eh(e,t);if(-1===n||"("!==e[n+1])return null;let r=n+2,o=ef(e,n+1);if(-1===o)return null;let i=e.substring(t+1,n),{url:l,title:s}=em(e.substring(r,o)),a=void 0===s?"":` title="${en(s)}"`;return{html:`<a href="${en(l)}"${a}>${ep(i)}</a>`,end:o+1}}(e,t):null},function(e,t){return"~"!==e[t]||"~"!==e[t+1]?null:eg(e,t,"~~","<del>","</del>")},function(e,t){return("*"!==e[t]||"*"!==e[t+1]||"*"!==e[t+2])&&("_"!==e[t]||"_"!==e[t+1]||"_"!==e[t+2]||eo(e,t,3))?null:eg(e,t,e.substring(t,t+3),"<strong><em>","</em></strong>")}
1,function(e,t){return("*"!==e[t]||"*"!==e[t+1])&&("_"!==e[t]||"_"!==e[t+1]||eo(e,t,2))?null:eg(e,t,e.substring(t,t+2),"<strong>","</strong>")},function(e,t){return"*"!==e[t]&&("_"!==e[t]||eo(e,t,1))?null:eg(e,t,e[t],"<em>","</em>")},function(e,t){if("<"!==e[t])return null;let n=e.substring(t);for(let e of[el,es,ea,ec,ei]){let r=n.match(e);if(r)return{html:r[0],end:t+r[0].length}}return null},function(e,t){return"\n"===e[t]?{html:"<br>\n",end:t+1}:null}];function ep(e){let t="",n=0;for(;n<e.length;){if("\n"===e[n]&&n>=2&&" "===e[n-1]&&" "===e[n-2]){t=t.replace(/ +$/,"")+"<br>\n",n++;continue}let r=!1;if(ed.has(e[n]))for(let o of eu){let i=o(e,n);if(i){t+=i.html,n=i.end,r=!0;break}}if(!r){let r=n;for(n++;n<e.length&&!ed.has(e[n]);)n++;t+=en(e.substring(r,n))}}return t}function eh(e,t){let n=0;for(let r=t;r<e.length;r++){if("\\"===e[r]&&r+1<e.length){r++;continue}if("["===e[r]&&n++,"]"===e[r]&&0==--n)return r}return -1}function ef(e,t){let n=0;for(let r=t;r<e.length;r++){if("\\"===e[r]&&r+1<e.length){r++;continue}if("("===e[r]&&n++,")"===e[r]&&0==--n)return r}return -1}function em(e){let t,n,r;if((e=e.trim()).startsWith("<")){let r=e.indexOf(">");-1===r?(t=e.substring(1),n=""):(t=e.substring(1,r),n=e.substring(r+1).trim())}else{let r=e.length;for(let t=0;t<e.length;t++){if("\\"===e[t]&&t+1<e.length){t++;continue}if(" "===e[t]||" "===e[t]||"\n"===e[t]){r=t;break}}t=e.substring(0,r),n=e.substring(r).trim()}if(n.length>0){let e=n.match(/^"([^"]*)"$|^'([^']*)'$|^\(([^)]*)\)$/);e&&(r=e[1]??e[2]??e[3])}return{url:t,title:r}}function eg(e,t,n,r,o){let i=n.length,l=t+i;if(l>=e.length||" "===e[l]||" "===e[l])return null;let s=l;for(;s<e.length;){if("\\"===e[s]&&s+1<e.length){s+=2;continue}if(e.substring(s,s+i)===n){if(" "===e[s-1]||" "===e[s-1]||1===i&&(s>0&&e[s-1]===n[0]&&!(s>=2&&"\\"===e[s-2])||s+i<e.length&&e[s+i]===n[0])){s++;continue}let t=e.substring(l,s);if(0===t.length){s++;continue}return{html:r+ep(t)+o,end:s+i}}s++}return null}var eb=new Set("address.article.aside.audio.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul".split("."));function ey(e){if(/^ {0,3}<(!--|\?|![A-Za-z]|!\[CDATA\[)/.test(e))return!0;let t=e.match(/^ {0,3}<\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s|\/?>|$)/);return!!t&&eb.has(t[1].toLowerCase())}function ev(e){let t=e.split("\n"),n=[],r=0,o=!0;for(;r<t.length;){let e=t[r];if(""===e.trim()){o=!0,r++;continue}let i=e.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(i){let e=i[1],l=e[0],s=e.length,a=i[2].trim(),c=[];for(r++;r<t.length;){if(t[r].match(RegExp(`^ {0,3}${l}{${s},}\\s*$`))){r++;break}c.push(t[r]),r++}n.push({type:"codeBlock",language:a||"",code:c.join("\n")}),o=!1;continue}let l=e.match(/^(#{1,6})\s+(.+?)(?:\s+#+\s*|\s*)$/);if(l){n.push({type:"heading",level:l[1].length,content:l[2]}),o=!1,r++;continue}if(/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)){let t=n[n.length-1];if(!o&&e.trim().match(/^-+$/)&&t&&"paragraph"===t.type){n[n.length-1]={type:"heading",level:2,content:t.content},o=!1,r++;continue}n.push({type:"hr"}),o=!1,r++;continue}if(r+1<t.length){let i=t[r+1];if(/^={1,}\s*$/.test(i)&&e.trim().length>0){n.push({type:"heading",level:1,content:e.trim()}),o=!1,r+=2;continue}}let s=function(e,t){if(t+1>=e.length)return null;let n=e[t],r=e[t+1];if(!r.includes("|")||!/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(r)||!n.includes("|"))return null;let o=ek(n),i=ek(r).map(e=>{let t=e.trim(),n=t.startsWith(":"),r=t.endsWith(":");return n&&r?"center":r?"right":n?"left":null}),l=[],s=t+2;for(;s<e.length;){let t=e[s];if(!t.includes("|"))break;l.push(ek(t)),s++}return{token:{type:"table",headers:o,rows:l,alignments:i},nextLine:s}}(t,r);if(s){n.push(s.token),r=s.nextLine,o=!1;continue}if(/^\s{0,3}>/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,"")),r++;for(;r<t.length;){let n=t[r];if(""===n.trim()||/^\s{0,3}>/.test(n)||/^(#{1,6})\s/.test(n)||/^(`{3,}|~{3,})/.test(n)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(n)||/^\s*([-*+]|\d+[.)])\s+/.test(n)||/^\s*\|(.+\|)+\s*$/.test(n))break;e.push(n),r++}n.push({type:"blockquote",content:e.join("\n")}),o=!1;continue}let a=e.match(/^(\s*)([-*+]|\d+[.)])(\s+)(\[[ xX]\] )?(.*)$/);if(a){let e=a[1].length,i=a[2],l=a[3],s=a[4],c=a[5],d,u,p;s?(d="task",p="[ ]"!==s.trim()):/^\d+[.)]$/.test(i)?(d="ordered",u=parseInt(i,10)):d="bullet";let h=e+i.length+l.length+(s?s.length:0),f=e+1,m=e=>{if(""===e.trim())return!0;let t=e.match(/^\s*/)[0].length;return!!(t>=h||t>=f&&e.match(/^\s*([-*+]|\d+[.)])\s+/))};r++;let g=[];for(;r<t.length;){let e=t[r];if(""===e.trim()){let e=r+1;for(;e<t.length&&""===t[e].trim();)e++;if(e<t.length&&m(t[e])){g.push(""),r++;continue}break}if(!m(e))break;e.match(/^\s*/)[0].length>=h?g.push(e.substring(h)):g.push(e.substring(f)),r++}let b=g.join("\n").replace(/^\n+|\n+$/g,"");n.push({type:"listItem",listType:d,indent:e,content:c.trim(),start:u,checked:p,childContent:b||void 0}),o=!1;continue}if(ey(e)){let e=[];for(;r<t.length&&""!==t[r].trim();)e.push(t[r]),r++;n.push({type:"rawHtml",content:e.join("\n")}),o=!1;continue}let c=[e];for(r++;r<t.length;){let e=t[r];if(""===e.trim()||/^(#{1,6})\s/.test(e)||/^(`{3,}|~{3,})/.test(e)||/^\s{0,3}>/.test(e)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)||/^\s*([-*+]|\d+[.)])\s+/.test(e)||/^\s*\|(.+\|)+\s*$/.test(e)||ey(e)||r+1<t.length&&/^[=-]+\s*$/.test(t[r+1])&&e.trim().length>0)break;c.push(e),r++}n.push({type:"paragraph",content:c.map(e=>e.replace(/^ {1,3}/,"")).join("\n").replace(/[ \t]+$/,"")}),o=!1}return n}function ek(e){let t=e.trim(),n=t.startsWith("|")?t.substring(1):t,r=n.endsWith("|")?n.substring(0,n.length-1):n,o=[],i="";for(let e=0;e<r.length;e++)"\\"===r[e]&&e+1<r.length&&"|"===r[e+1]?(i+="|",e++):"|"===r[e]?(o.push(i.trim()),i=""):i+=r[e];return o.push(i.trim()),o}function ew(e){return function e(t){let n="",r=0;for(;r<t.length;){let o=t[r];switch(o.type){case"heading":n+=`<h${o.level}>${ep(o.content)}</h${o.level}>`,r++;break;case"paragraph":n+=`<p>${ep(o.content)}</p>`,r++;break;case"codeBlock":{let e=o.language?` data-language="${en(o.language)}"`:"";n+=`<pre><code${e}>${en(o.code)}</code></pre>`,r++;break}case"blockquote":{let t=e(ev(o.content));n+=`<blockquote>${t}</blockquote>`,r++;break}case"hr":n+="<hr>",r++;break;case"listItem":{let o=function(t,n){let r="",o=n,i=null;for(;o<t.length&&"listItem"===t[o].type;){let n=t[o],l="ordered"===n.listType?"ordered":"bullet";if(null!==i&&i!==l&&(r+=`</${"ordered"===i?"ol":"ul"}>
1`,i=null),null===i){if("ordered"===l){let e=void 0!==n.start&&1!==n.start?` start="${n.start}"`:"";r+=`<ol${e}>`}else r+="<ul>";i=l}if("task"===n.listType){let e=n.checked?" checked":"";r+=`<li><input type="checkbox" disabled${e}><p>${ep(n.content)}</p>`}else r+=`<li><p>${ep(n.content)}</p>`;n.childContent&&(r+=e(ev(n.childContent))),r+="</li>",o++}return null!==i&&(r+=`</${"ordered"===i?"ol":"ul"}>`),{html:r,nextIndex:o}}(t,r);n+=o.html,r=o.nextIndex;break}case"table":n+=function(e){let t="<table>",n=e.headers.every(e=>""===e.trim()),r=e.headers.length;if(!n){t+="<thead><tr>";for(let n=0;n<r;n++){let r=e.alignments[n],o=r?` align="${r}"`:"";t+=`<th${o}>${ep(e.headers[n])}</th>`}t+="</tr></thead>"}if(e.rows.length>0){for(let n of(t+="<tbody>",e.rows)){t+="<tr>";for(let o=0;o<r;o++){let r=o<n.length?n[o]:"",i=e.alignments[o],l=i?` align="${i}"`:"";t+=`<td${l}>${ep(r)}</td>`}t+="</tr>"}t+="</tbody>"}return t+"</table>"}(o),r++;break;case"rawHtml":n+=o.content,r++;break;default:r++}}return n}(ev(e))}var ex=class{constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return(0,d.O)(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){var t,n;let r,o;return(t=this.editor.pmSchema,n=this.editor,r=m.ZF.fromSchema(t),o=[$,F,z,H,V,U],{serializeBlocks:(e,t)=>{let i=D(n,e,r,t);for(let e of o)i=e(i);return i.outerHTML}}).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return et(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return(0,d.u)(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){var t;return t=this.editor.pmSchema,et(ew(e),t)}pasteHTML(e,t=!1){let n=e;if(!t){let t=this.tryParseHTMLToBlocks(e);n=this.blocksToFullHTML(t)}n&&this.editor.prosemirrorView?.pasteHTML(n)}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=ew(e);return this.pasteHTML(t)}};function eC(e,t,n="start"){let r="string"==typeof t?t:t.id,o=(0,c.ln)((0,c.fn)(e.doc)),i=(0,c.Dt)(r,e.doc);if(!i)throw Error(`Block with ID ${r} not found`);let l=(0,c.mn)(i),s=o.blockSchema[l.blockNoteType].content;if(l.isBlockContainer){let t=l.blockContent;if("none"===s)return void e.setSelection(y.nh.create(e.doc,t.beforePos));if("inline"===s)"start"===n?e.setSelection(y.U3.create(e.doc,t.beforePos+1)):e.setSelection(y.U3.create(e.doc,t.afterPos-1));else if("table"===s)"start"===n?e.setSelection(y.U3.create(e.doc,t.beforePos+4)):e.setSelection(y.U3.create(e.doc,t.afterPos-4));else throw new c.zn(s)}else eC(e,("start"===n?l.childContainer.node.firstChild:l.childContainer.node.lastChild).attrs.id,n)}var eS=new Set(function(e){let t=[],n=[],r=0;for(;r<e.length;){let o=0;for(;r+o<e.length&&e.charCodeAt(r+o)>=48&&57>=e.charCodeAt(r+o);)o++;if(o>0){t.push(n.join(""));let i=parseInt(e.substring(r,r+o),10);for(;i-- >0;)n.pop();r+=o}else n.push(e[r]),r++}return t}("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
1ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),eE=new Set(["localhost"]),eM=/[.,;:!?"']+$/,eT=/(?:https?|ftp|ftps):\/\/[^\s]+/g,eA=/mailto:[^\s]+/g,eI=/[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/g,eN=/(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:[/?#][^\s]*)?/g;function ej(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function eP(e){let t,n=(t=e.split("."))[t.length-1].toLowerCase();return eS.has(n)}function e_(e,t,n){return"email"===t?"mailto:"+e:/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)||/^mailto:/i.test(e)?e:n+"://"+e}function eB(e,t){if(!e)return[];let n=t?.defaultProtocol||"http",r=[];for(let t of e.matchAll(eT))r.push({type:"url",value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(eA))r.push({type:"url",value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(eI))r.push({type:"email",value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(eN))r.push({type:"url",value:t[0],start:t.index,end:t.index+t[0].length});r.sort((e,t)=>e.start-t.start||t.end-e.end);let o=[],i=-1;for(let e of r)e.start>=i&&(o.push(e),i=e.end);let l=[];for(let e of o){let t=function(e){let t=e,n=!0;for(;n;){n=!1;let e=t;for(let[r,o]of((t=t.replace(eM,""))!==e&&(n=!0),[["(",")"],["[","]"]]))for(;t.endsWith(o);){let e=ej(t,r);if(ej(t,o)>e)t=t.slice(0,-1),n=!0;else break}}return t}(e.value);if(!t)continue;let r=e.start,o=r+t.length;if("url"===e.type&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)&&!eP(new URL("http://"+t).hostname)||"email"===e.type&&!eP(t.split("@")[1]))continue;let i=e_(t,e.type,n);l.push({type:e.type,value:t,isLink:!0,href:i,start:r,end:o})}return l}function eO(e){if(/^(?:https?|ftp|ftps):\/\/[^\s]+$/.test(e)||/^mailto:[^\s]+$/.test(e)||eE.has(e.toLowerCase()))return!0;let t=e.match(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+([a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/);if(t){let e=t[1].toLowerCase();if(eS.has(e))return!0}return!1}function eR(e,t,n,r){let o=!e.includes("@")||e.includes("://")||e.startsWith("mailto:")?"url":"email";return{type:o,value:e,isLink:!0,href:e_(e,o,r),start:t,end:n}}
1function eL(e,t,n){return{type:"text",value:e,isLink:!1,href:e,start:t,end:n}}var eD="[\0- \xa0áá â-\u2029âã]",e$=new RegExp(eD),eF=RegExp(`${eD}$`),ez=RegExp(eD,"g"),eH="https",eV=/^(?:(?:http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))/i;function eU(e){if(!e)return!0;let t=e.replace(ez,"");return eV.test(t)}function eW(e){let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}var eJ=b.CU.create({name:"link",keepOnSplit:!1,exitable:!0,inclusive:!1,addOptions:()=>({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",className:"bn-inline-content-section","data-inline-content-type":"link"},editor:void 0,onClick:void 0,isValidLink:eU}),addAttributes:()=>({href:{default:null,parseHTML:e=>e.getAttribute("href")}}),parseHTML(){let e=this.options.isValidLink;return[{tag:"a[href]",getAttrs:t=>{let n=t.getAttribute("href");return!!n&&!!e(n)&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isValidLink(e.href)?["a",(0,b.KV)(e,this.options.HTMLAttributes),0]:["a",(0,b.KV)({...e,href:""},this.options.HTMLAttributes),0]},addPasteRules(){let e=this.options.isValidLink;return[(0,b.Zc)({find:t=>{let n=[];if(t)for(let r of eB(t,{defaultProtocol:eH}).filter(t=>t.isLink&&e(t.value)))eW(r.value)&&n.push({text:r.value,data:{href:r.href},index:r.start});return n}
1,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){var e,t,n;let r=[];return r.push((e={type:this.type,defaultProtocol:eH,validate:this.options.isValidLink,shouldAutoLink:eW},new y.k_({key:new y.hs("autolink"),appendTransaction:(t,n,r)=>{let o=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),i=t.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;let{tr:l}=r;if((0,b.FF)((0,b.T7)(n.doc,[...t])).forEach(({newRange:t})=>{let n=(0,b.Nx)(r.doc,t,e=>e.isTextblock),o,i;if(n.length>1)o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(n.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!eF.test(e))return;o=n[0],i=r.doc.textBetween(o.pos,t.to,void 0," ")}if(o&&i){let t=i.split(e$).filter(Boolean);if(t.length<=0)return;let n=t[t.length-1],s=o.pos+i.lastIndexOf(n);if(!n)return;let a=function(e,t="http"){if(!e)return[eL(e,0,0)];for(let[n,r]of[["(",")"],["[","]"],["{","}"]])if(e.startsWith(n)&&e.endsWith(r)&&e.length>2){let o=e.slice(1,-1);if(eO(o))return[eL(n,0,1),eR(o,1,1+o.length,t),eL(r,1+o.length,e.length)]}if(e.endsWith(".")&&e.length>1){let n=e.slice(0,-1);if(eO(n))return[eR(n,0,n.length,t),eL(".",n.length,e.length)]}return eO(e)?[eR(e,0,e.length,t)]:[eL(e,0,e.length)]}(n,e.defaultProtocol);if(!(1===a.length?a[0].isLink:3===a.length&&!!a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return;a.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,b.hO)(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||l.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),l.steps.length)return l}}))),r.push((t={type:this.type,tiptapEditor:this.editor,editor:this.options.editor,onClick:this.options.onClick},new y.k_({key:new y.hs("handleClickLink"),props:{handleClick:(e,n,r)=>{if(0!==r.button||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement&&"link"===r.target.getAttribute("data-inline-content-type"))o=r.target;else{let e=r.target;if(!e)return!1;let n=t.tiptapEditor.view.dom;(o=e.closest('a[data-inline-content-type="link"]'))&&!n.contains(o)&&(o=null)}if(!o)return!1;if(t.onClick){if(!t.editor)throw Error("BlockNoteEditor not found in Link click handler");return t.onClick(r,t.editor)??!0}let i=(0,b.gu)(e.state,t.type.name),l=o.href??i.href,s=o.target??i.target;
1return!!l&&(window.open(l,s),!0)}}}))),r.push((n={editor:this.editor,defaultProtocol:eH,type:this.type,shouldAutoLink:eW,isValidLink:this.options.isValidLink},new y.k_({key:new y.hs("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:o,isValidLink:i}=n,{state:l}=e,{selection:s}=l,{empty:a}=s;if(a)return!1;let c="";r.content.forEach(e=>{c+=e.textContent});let d=eB(c,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!!c&&!!d&&!!i(d.value)&&(void 0===o||!!o(d.value))&&n.editor.commands.setMark(n.type,{href:d.href})}}}))),r}}),eG=(0,u.t)(({editor:e,options:t})=>({key:"link",tiptapExtensions:[eJ.configure({HTMLAttributes:t.HTMLAttributes??{},editor:e,onClick:t.onClick,...t.isValidLink?{isValidLink:t.isValidLink}:{}})]})),eq=["vscode-editor-data","blocknote/html","text/markdown","text/html","text/plain","Files"];function eK(e,t,n,r="after"){return Array.isArray(t.content)&&0===t.content.length?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id}async function eY(e,t){if(!t.uploadFile)return void console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");let n="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(null===n)return;let r=null;for(let e of eq)if(n.types.includes(e)){r=e;break}if("Files"!==r)return;let o=n.items;if(o){e.preventDefault();for(let n=0;n<o.length;n++){let r="file";for(let e of Object.values(t.schema.blockSpecs))for(let t of e.implementation.meta?.fileBlockAccept||[]){let i=t.startsWith("."),l=o[n].getAsFile();if(l&&(!i&&l.type&&function(e,t){let n=e.split("/"),r=t.split("/");if(2!==n.length)throw Error(`The string ${e} is not a valid MIME type.`);if(2!==r.length)throw Error(`The string ${t} is not a valid MIME type.`);return"*"===n[1]||"*"===r[1]?n[0]===r[0]:("*"===n[0]||"*"===r[0]||n[0]===r[0])&&n[1]===r[1]}(o[n].type,t)||i&&function(e,t){if(!e.startsWith(".")||!t.startsWith("."))throw Error("The strings provided are not valid file extensions.");return e===t}("."+l.name.split(".").pop(),t))){r=e.config.type;break}}let i=o[n].getAsFile();if(i){let n={type:r,props:{name:i.name}},o;if("paste"===e.type){let e=t.getTextCursorPosition().block;o=eK(t,e,n)}else{if("drop"!==e.type)return;let r={left:e.clientX,top:e.clientY},i=t.prosemirrorView.posAtCoords(r);if(!i)return;o=t.transact(e=>{let o=(0,c.yn)(e.doc,i.pos),l=t.domElement?.querySelector(`[data-id="${o.node.attrs.id}"]`)?.getBoundingClientRect();return eK(t,t.getBlock(o.node.attrs.id),n,l&&(l.top+l.bottom)/2>r.top?"before":"after")})}let l=await t.uploadFile(i,o),s="string"==typeof l?{props:{url:l}}:{...l};t.updateBlock(o,s)}}}}var eZ=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,eX=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,eQ=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,e0=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,e1=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,e2=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,e5=/\n{2} {0,3}-{2,48}\n{2}/,e3=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,e4=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,e9=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,e6=/^\s*\|(.+\|)+\s*$/m,e7=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,e8=/^\s*\|(.+\|)+\s*$/m;function te(e,t){"node"in e.state.selection&&"blockContent"===e.state.selection.node.type.spec.group&&t.transact(t=>t.setSelection(new y.nh(t.doc.resolve(e.state.selection.from-1))));let n=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,r=e.state.selection.content().content,o=function(e,t,n){let r=!1,o=e.state.selection instanceof v.rn;if(!o){let n=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,o=[];for(let e=0;e<n.childCount;e++)o.push(n.child(e));(r=void 0===o.find(e=>e.type.isInGroup("bnBlock")||"blockGroup"===e.type.name||"blockContent"===e.type.spec.group))&&(t=n)}let i,l=(0,d.O)(e.state.schema,n);
1if(o){t.firstChild?.type.name==="table"&&(t=t.firstChild.content);let e=(0,c.rn)(t,n.schema.inlineContentSchema,n.schema.styleSchema);i=`<table>${l.exportInlineContent(e,{})}</table>`}else if(r){let e=(0,c.nn)(t,n.schema.inlineContentSchema,n.schema.styleSchema);i=l.exportInlineContent(e,{})}else{let e=(0,d.l)(t);i=l.exportBlocks(e,{})}return i}(e,r,t),{$from:i,$to:l}=e.state.selection,s=i.parent.type.name,a=t.blockImplementations[s];return{clipboardHTML:n,externalHTML:o,markdown:i.sameParent(l)&&a?.implementation.meta?.code===!0?e.state.doc.textBetween(i.pos,l.pos):(0,d.d)(o)}}var tt=e=>{if(e.state.selection.empty)return!0;let t=window.getSelection();if(t&&!t.isCollapsed){let e=t.focusNode;for(;e;){if(e instanceof HTMLElement&&"false"===e.getAttribute("contenteditable"))return!0;e=e.parentElement}}return!1},tn=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:o,markdown:i}=te(t,e);n.clipboardData.setData("blocknote/html",r),n.clipboardData.setData("text/html",o),n.clipboardData.setData("text/plain",i)},tr=b.YY.create({name:"blockBackgroundColor",addGlobalAttributes:()=>[{types:["tableCell","tableHeader"],attributes:{backgroundColor:(0,c._t)()}}]}),to=b.bP.create({name:"hardBreak",inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,priority:10,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,b.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n"}),ti=(e,t)=>{let n=e.resolve(t),r=n.depth-1;if(r<1)return;let o=n.before(r),i=e.resolve(o).nodeAfter;if(i)return i.type.spec.group?.includes("bnBlock")?(0,c.hn)(e.resolve(o)):ti(e,o)},tl=(e,t)=>{let n=e.resolve(t),r=n.index();if(0===r)return;let o=n.posAtIndex(r-1);return(0,c.hn)(e.resolve(o))},ts=(e,t)=>{let n=e.resolve(t),r=n.index();if(r===n.node().childCount-1)return;let o=n.posAtIndex(r+1);return(0,c.hn)(e.resolve(o))},ta=(e,t)=>{for(;t.childContainer;){let n=t.childContainer.node,r=e.resolve(t.childContainer.beforePos+1).posAtIndex(n.childCount-1);t=(0,c.hn)(e.resolve(r))}return t},tc=e=>({state:t,dispatch:n})=>{let r=(0,c.hn)(t.doc.resolve(e)),o=tl(t.doc,r.bnBlock.beforePos);if(!o)return!1;let i=ta(t.doc,o);return!!i.isBlockContainer&&"inline*"===i.blockContent.node.type.spec.content&&i.blockContent.node.childCount>0&&!!r.isBlockContainer&&"inline*"===r.blockContent.node.type.spec.content&&((e,t,n,r)=>{if(!r.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but next block is not a block container`);if(r.childContainer){let n=e.doc.resolve(r.childContainer.beforePos+1),o=e.doc.resolve(r.childContainer.afterPos-1),i=n.blockRange(o);if(t){let t=e.doc.resolve(r.bnBlock.beforePos);e.tr.lift(i,t.depth)}}if(t){if(!n.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(n.blockContent.afterPos-1,r.blockContent.beforePos+1))}return!0})(t,n,i,r)},td=b.YY.create({priority:50,addKeyboardShortcuts(){let e=(e=!1)=>this.editor.commands.first(({commands:t,tr:n})=>[()=>t.command(({state:e,tr:t})=>{let n=(0,c.gn)(e);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:o}=n,{depth:i}=e.doc.resolve(r.beforePos),l=0===e.selection.$anchor.parentOffset,s=e.selection.anchor===e.selection.head,a=0===o.node.childCount;return!!l&&!!s&&!!a&&i>1&&K(t,t.doc.type.schema.nodes.blockContainer,t.doc.type.schema.nodes.blockGroup)}),()=>t.command(({state:t})=>{let r=(0,c.gn)(t),o=this.options.editor.schema.blockSchema[r.blockNoteType].meta?.hardBreakShortcut??"shift+enter";if("none"===o)return!1;if("shift+enter"===o&&e||"enter"===o){let e=n.storedMarks||n.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return n.insert(n.selection.head,n.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>t.command(({state:e,dispatch:t,tr:n})=>{let r=(0,c.gn)(e);if(!r.isBlockContainer)return!1;let{bnBlock:o,blockContent:i}=r,l=0===e.selection.$anchor.parentOffset,s=e.selection.anchor===e.selection.head,a=0===i.node.childCount;if(l&&s&&a){let i=o.afterPos;if(t){let t=e.schema.nodes.blockContainer.createAndFill(void 0,[e.schema.nodes.paragraph.createAndFill()||void 0,r.childContainer?.node].filter(e=>void 0!==e));n.insert(i,t).setSelection(new y.U3(n.doc.resolve(i+2))).scrollIntoView(),r.childContainer&&n.delete(r.childContainer.beforePos,r.childContainer.afterPos)}return!0}return!1}),()=>t.command(({state:e,chain:t})=>{let n=(0,c.gn)(e);if(!n.isBlockContainer)return!1;let{blockContent:r}=n,o=0===e.selection.$anchor.parentOffset;return 0!==r.node.childCount&&(t().deleteSelection().command((0,c.H)(e.selection.from,o,o)).run(),!0)})]);return{Backspace:()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.undoInputRule(),()=>t.command(({state:e})=>{let n=(0,c.gn)(e);if(!n.isBlockContainer)return!1;let r=e.selection.from===n.blockContent.beforePos+1,o="paragraph"===n.blockContent.node.type.n
1ame;return!!r&&!o&&t.command((0,c.Tt)(n.bnBlock.beforePos,{type:"paragraph",props:{}}))}),()=>t.command(({state:e,tr:t})=>{let n=(0,c.gn)(e);if(!n.isBlockContainer)return!1;let{blockContent:r}=n;return e.selection.from===r.beforePos+1&&K(t,t.doc.type.schema.nodes.blockContainer,t.doc.type.schema.nodes.blockGroup)}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:o}=n,i=tl(t.doc,n.bnBlock.beforePos);if(!i||!i.isBlockContainer||"inline*"!==i.blockContent.node.type.spec.content)return!1;let l=t.selection.from===o.beforePos+1,s=t.selection.empty,a=r.beforePos;return!!l&&!!s&&e().command(tc(a)).scrollIntoView().run()}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=(0,c.gn)(e);if(!r.isBlockContainer||e.selection.from!==r.blockContent.beforePos+1)return!1;let o=tl(e.doc,r.bnBlock.beforePos);if(!o||o.isBlockContainer)return!1;if(n){let e=o.bnBlock.afterPos-1,n=t.doc.resolve(e-1);return t.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),t.insert(n.pos,r.bnBlock.node),t.setSelection(y.U3.near(t.doc.resolve(n.pos+1))),!0}return!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=(0,c.gn)(e);if(!r.isBlockContainer||t.selection.from!==r.blockContent.beforePos+1)return!1;let o=t.doc.resolve(r.bnBlock.beforePos);if(o.nodeBefore||"column"!==o.node().type.name)return!1;let i=t.doc.resolve(r.bnBlock.beforePos),l=t.doc.resolve(i.before()),s=l.before();return n&&(t.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),R(t,s),l.pos===s+1?(t.insert(s,r.bnBlock.node),t.setSelection(y.U3.near(t.doc.resolve(s)))):(t.insert(l.pos-1,r.bnBlock.node),t.setSelection(y.U3.near(t.doc.resolve(l.pos))))),!0}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;if(0===n.blockContent.node.childCount&&"inline*"===n.blockContent.node.type.spec.content){let r=tl(t.doc,n.bnBlock.beforePos);if(!r)return!1;let o=ta(t.doc,r);if(!o.isBlockContainer||!o||!o.isBlockContainer)return!1;let i=e();if(n.childContainer&&i.insertContentAt(n.bnBlock.afterPos,n.childContainer?.node.content),"tableRow+"===o.blockContent.node.type.spec.content){let e=n.bnBlock.beforePos-1-1-1-1-1;i=i.setTextSelection(e)}else if(""===o.blockContent.node.type.spec.content)i=i.setNodeSelection(o.blockContent.beforePos);else{let e=o.blockContent.afterPos-1;i=i.setTextSelection(e)}return i.deleteRange({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;let r=t.selection.from===n.blockContent.beforePos+1,o=t.selection.empty,i=tl(t.doc,n.bnBlock.beforePos);if(i&&r&&o){let r=ta(t.doc,i);if(!r.isBlockContainer)return!1;if(""===r.blockContent.node.type.spec.content||"inline*"===r.blockContent.node.type.spec.content&&0===r.blockContent.node.childCount)return e().cut({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos},r.bnBlock.afterPos).deleteRange({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos}).run()}return!1})]),Delete:()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer||!n.childContainer)return!1;let{blockContent:r,childContainer:o}=n,i=t.selection.from===r.afterPos-1,l=t.selection.empty,s=(0,c.hn)(t.doc.resolve(o.beforePos+1));if(!s.isBlockContainer)return!1;if(i&&l){let n=s.blockContent.node,i="inline*"===n.type.spec.content,l="inline*"===r.node.type.spec.content;return e().insertContentAt(s.bnBlock.afterPos,s.childContainer?.node.content||m.FK.empty).deleteRange(1===o.node.childCount?{from:o.beforePos,to:o.afterPos}:{from:s.bnBlock.beforePos,to:s.bnBlock.afterPos}).insertContentAt(t.selection.from,i&&l?n.content:null).setTextSelection(t.selection.from).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:o}=n,i=ts(t.doc,n.bnBlock.beforePos);if(!i||!i.isBlockContainer)return!1;let l=t.selection.from===o.afterPos-1,s=t.selection.empty,a=r.afterPos;return!!l&&!!s&&e().command(tc(a)).scrollIntoView().run()}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=(0,c.gn)(e);if(!r.isBlockContainer||e.selection.from!==r.blockContent.afterPos-1)return!1;let o=ts(e.doc,r.bnBlock.beforePos);if(!o||o.isBlockContainer)return!1;if(n){let e=o.bnBlock.beforePos+1,n=t.doc.resolve(e+1);return t.delete(n.pos,n.pos+n.nodeAfter.nodeSize),R(t,o.bnBlock.beforePos),t.insert(r.bnBlock.afterPos,n.nodeAfter),t.setSelection(y.U3.near(t.doc.resolve(n.pos))),!0}return!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=(0,c.gn)(e);if(!r.isBlockContainer||t.selection.from!==r.blockContent.afterPos-1)return!1;let o=t.doc.resolve(r.bnBlock.afterPos);if(o.nodeAfter||"column"!==o.node().type.name)return!1;let i=t.doc.resolve(r.bnBlock.afterPos),l=t.doc.resolve(i.after()),s=l.after();if(n){let e=l.pos===s-1?s:l.pos+1,n=(0,c.hn)(t.doc.resolve(e));t.delete(n.bnBlock.beforePos,n.bnBlock.afterPos),R(t,s-l.node().nodeSize),t.insert(i.pos,n.bnBlock.node),t.setSelection(y.U3.near(t.doc.resolve(e)))}return!0}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;let{blockContent:r}=n,o=t.selection.from===r.afterPos-1,i=t.selection.empty;if(o&&i){let o=(e,t)=>{let n=ts(e,t);if(n)return n;let r=ti(e,t);if(r)return o(e,r.bnBlock.beforePos)},i=o(t.doc,n.bnBlock.beforePos);if(!i||!i.isBlockContainer)return!1;let l=i.blockContent.node,s="inline*"===l.type.spec.content,a="inline*"===r.node.type.spec.content;return e().insertContentAt(i.bnBlock.afterPos,i.childContainer?.node.content||m.FK.empty).deleteRange({from:i.bnBlock.beforePos,to:i.bnBlock.afterPos}).insertContentAt(t.selection.from,s&&a?l.content:null).setTextSelection(t.selection.from).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;if(0===n.blockContent.node.childCount&&"inline*"===n.blockContent.node.type.spec.content){let r=ts(t.doc,n.bnBlock.beforePos);if(!r||!r.isBlockContainer)return!1;let o=e();if("tableRow+"===r.blockContent.node.type.spec.content){let e=n.bnBlock.afterPos+1+1+1+1+1;o=o.setTextSelection(e)}else o=""===r.blockContent.node.type.spec.content?o.setNodeSelection(r.blockContent.beforePos):o.setTextSelection(r.blockContent.beforePos+1);return o.deleteRange({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=(0,c.gn)(t);if(!n.isBlockContainer)return!1;let r=t.selection.from===n.blockContent.afterPos-1,o=t.selection.empty,i=ts(t.doc,n.bnBlock.beforePos);if(!i||!i.isBlockContainer)return!1;if(i&&r&&o&&(""===i.blockContent.node.type.spec.content||"inline*"===i.blockContent.node.type.spec.content&&0===i.blockContent.node.childCount)){let t=i.bnBlock.node.lastChild.content;return e().deleteRange({from:i.bnBlock.beforePos,to:i.bnBlock.afterPos}).insertContentAt(n.bnBlock.afterPos,2===i.bnBlock.node.childCount?t:null).run()}return!1})]),Enter:()=>e(),"Shift-Enter":()=>e(!0),Tab:()=>!("prefer-indent"!==this.options.tabBehavior&&(this.options.editor.getExtension(c.m)?.store.state||this.options.editor.getExtension(c.mt)?.store.state!==void 0))&&q(this.options.editor),"Shift-Tab":()=>!("prefer-indent"!==this.options.tabBehavior&&(this.options.editor.getExtension(c.m)?.store.state||this.options.editor.getExtension(c.mt)?.store.state!==void 0))&&Y(this.options.editor),"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>
1this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo()}}}),tu=b.CU.create({name:"insertion",inclusive:!1,excludes:"deletion modification insertion",addAttributes:()=>({id:{default:null,validate:"number"}}),extendMarkSchema:e=>"insertion"===e.name?{blocknoteIgnore:!0,inclusive:!1,toDOM:(e,t)=>["ins",{"data-id":String(e.attrs.id),"data-inline":String(t),...!t&&{style:"display: contents"}},0],parseDOM:[{tag:"ins",getAttrs:e=>!!e.dataset.id&&{id:parseInt(e.dataset.id,10)}}]}:{}}),tp=b.CU.create({name:"deletion",inclusive:!1,excludes:"insertion modification deletion",addAttributes:()=>({id:{default:null,validate:"number"}}),extendMarkSchema:e=>"deletion"===e.name?{blocknoteIgnore:!0,inclusive:!1,toDOM:(e,t)=>["del",{"data-id":String(e.attrs.id),"data-inline":String(t),...!t&&{style:"display: contents"}},0],parseDOM:[{tag:"del",getAttrs:e=>!!e.dataset.id&&{id:parseInt(e.dataset.id,10)}}]}:{}}),th=b.CU.create({name:"modification",inclusive:!1,excludes:"deletion insertion",addAttributes:()=>({id:{default:null,validate:"number"},type:{validate:"string"},attrName:{default:null,validate:"string|null"},previousValue:{default:null},newValue:{default:null}}),extendMarkSchema:e=>"modification"===e.name?{blocknoteIgnore:!0,inclusive:!1,toDOM:(e,t)=>[t?"span":"div",{"data-type":"modification","data-id":String(e.attrs.id),"data-mod-type":e.attrs.type,"data-mod-prev-val":JSON.stringify(e.attrs.previousValue),"data-mod-new-val":JSON.stringify(e.attrs.newValue)},0],parseDOM:[{tag:"span[data-type='modification']",getAttrs:e=>!!e.dataset.id&&{id:parseInt(e.dataset.id,10),type:e.dataset.modType,previousValue:e.dataset.modPrevVal,newValue:e.dataset.modNewVal}},{tag:"div[data-type='modification']",getAttrs:e=>!!e.dataset.id&&{id:parseInt(e.dataset.id,10),type:e.dataset.modType,previousValue:e.dataset.modPrevVal}}]}:{}}),tf=b.YY.create({name:"textAlignment",addGlobalAttributes:()=>[{types:["tableCell","tableHeader"],attributes:{textAlignment:{default:"left",parseHTML:e=>e.getAttribute("data-text-alignment"),renderHTML:e=>"left"===e.textAlignment?{}:{"data-text-alignment":e.textAlignment}}}}]}),tm=b.YY.create({name:"blockTextColor",addGlobalAttributes:()=>[{types:["table","tableCell","tableHeader"],attributes:{textColor:(0,c.yt)()}}]}),tg={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},tb=b.bP.create({name:"blockContainer",group:"blockGroupChild bnBlock",content:"blockContent blockGroup?",priority:50,defining:!0,marks:"insertion modification deletion",parseHTML(){return[{tag:"div[data-node-type="+this.name+"]",getAttrs:e=>{if("string"==typeof e)return!1;let t={};for(let[n,r]of Object.entries(tg))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t}},{tag:'div[data-node-type="blockOuter"]',skip:!0}]},renderHTML({HTMLAttributes:e}){let t=document.createElement("div");for(let[n,r]of(t.className="bn-block-outer",t.setAttribute("data-node-type","blockOuter"),Object.entries(e)))"class"!==n&&t.setAttribute(n,r);let n={...this.options.domAttributes?.block||{},...e},r=document.createElement("div");for(let[e,t]of(r.className=(0,c.Rn)("bn-block",n.class),r.setAttribute("data-node-type",this.name),Object.entries(n)))"class"!==e&&r.setAttribute(e,t);return t.appendChild(r),{dom:t,contentDOM:r}}}),ty=b.bP.create({name:"blockGroup",group:"childContainer",content:"blockGroupChild+",marks:"deletion insertion modification",parseHTML:()=>[{tag:"div",getAttrs:e=>"string"!=typeof e&&"blockGroup"===e.getAttribute("data-node-type")&&null}],renderHTML({HTMLAttributes:e}){let t={...this.options.domAttributes?.blockGroup||{},...e},n=document.createElement("div");for(let[e,r]of(n.className=(0,c.Rn)("bn-block-group",t.class),n.setAttribute("data-node-type","blockGroup"),Object.entries(t)))"class"!==e&&n.setAttribute(e,r);return{dom:n,contentDOM:n}}}),tv=b.bP.create({name:"doc",topNode:!0,content:"blockGroup",marks:"insertion modification deletion"}),tk=(0,u.t)(({options:e})=>({key:"collaboration",blockNoteExtensions:[(0,d.S)(e),(0,d.T)(e),(0,d.w)(e),(0,d.C)(),(0,d.x)(e)]})),tw=class{disabledExtensions=new Set;extensions=[];abortMap=new Map;extensionFactories=new Map;extensionPlugins=new Map;constructor(e,t){for(let n of(this.editor=e,this.options=t,e.onMount(()=>{for(let t of this.extensions)if(t.mount){let n=new window.AbortController,r=t.mount({dom:e.prosemirrorView.dom,root:e.prosemirrorView.root,signal:n.signal});r&&n.signal.addEventListener("abort",()=>{r()}),this.abortMap.set(t,n)}}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]),function(e,t){let n=[(0,d.E)(),(0,d.b)(t),(0,c.mt)(t),(0,c.m)(t),eG({HTMLAttributes:t.links?.HTMLAttributes??{},onClick:t.links?.onClick,...t.links?.isValidLink?{isValidLink:t.links.isValidLink}:{}}),(0,d._)(t),(0,d.m)(),(0,d.p)(t),(0,p.t)(t),(0,d.o)(t),(0,c.f)(t),...!1===t.trailingBlock?[]:[(0,d.t)()]];return t.collaboration?n.push(tk(t.collaboration)):n.push((0,d.v)()),"table"in e.schema.blockSpecs&&n.push((0,d.n)(t)),!1!==t.animations&&n.push((0,d.f)()),n}(this.editor,this.options)))this.addExtension(n);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}
1registerExtension(e){let t=[].concat(e).filter(Boolean);if(!t.length)return void console.warn("No extensions found to register",e);let n=t.map(e=>this.addExtension(e)).filter(Boolean),r=new Set;for(let e of n)e?.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),e?.inputRules?.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{r.add(e)});this.updatePlugins(e=>[...e,...r])}addExtension(e){let t;if(!(!(t="function"==typeof e?e({editor:this.editor}):e)||this.disabledExtensions.has(t.key))){if("function"==typeof e){let e=t[u.r];"function"==typeof e&&this.extensionFactories.set(e,t)}if(this.extensions.push(t),t.blockNoteExtensions)for(let e of t.blockNoteExtensions)this.addExtension(e);return t}}resolveExtensions(e){let t=[];if("function"==typeof e){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if("object"==typeof e&&"key"in e)t.push(e);else if("string"==typeof e){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){let t=this.resolveExtensions(e);if(!t.length)return void console.warn("No extensions found to unregister",e);let n=!1,r=new Set;for(let o of t)this.extensions=this.extensions.filter(e=>e!==o),this.extensionFactories.forEach((e,t)=>{e===o&&this.extensionFactories.delete(t)}),this.abortMap.get(o)?.abort(),this.abortMap.delete(o),this.extensionPlugins.get(o)?.forEach(e=>{r.add(e)}),this.extensionPlugins.delete(o),o.tiptapExtensions&&!n&&(n=!0,console.warn(`Extension ${o.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));this.updatePlugins(e=>e.filter(e=>!r.has(e)))}updatePlugins(e){let t=this.editor.prosemirrorState,n=t.reconfigure({plugins:e(t.plugins.slice())});this.editor.prosemirrorView.updateState(n)}getTiptapExtensions(){var e,t;let n,r=(e=this.editor,t=this.options,[b.XO.ClipboardTextSerializer,b.XO.Commands,b.XO.Editable,b.XO.FocusEvents,b.XO.Tabindex,_,c.Yn.configure({types:["blockContainer","columnList","column"],setIdAttribute:t.setIdAttribute,isWithinEditor:e.isWithinEditor}),to,B,tu,tp,th,...Object.values(e.schema.styleSpecs).map(t=>t.implementation.mark.configure({editor:e})),tm,tr,tf,b.YY.create({name:"OverrideEscape",addKeyboardShortcuts:()=>({Escape:()=>!e.getExtension(c.f)?.shown()&&(e.blur(),!0)})}),tv,tb.configure({editor:e,domAttributes:t.domAttributes}),td.configure({editor:e,tabBehavior:t.tabBehavior}),ty.configure({domAttributes:t.domAttributes}),...Object.values(e.schema.inlineContentSpecs).filter(e=>"link"!==e.config&&"text"!==e.config).map(t=>t.implementation.node.configure({editor:e})),...Object.values(e.schema.blockSpecs).flatMap(n=>[..."node"in n.implementation?[n.implementation.node.configure({editor:e,domAttributes:t.domAttributes})]:[]]),b.YY.create({name:"copyToClipboard",addProseMirrorPlugins:()=>[new y.k_({props:{handleDOMEvents:{copy:(t,n)=>(tt(t)||tn(e,t,n),!0),cut:(t,n)=>!!tt(t)||(tn(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection()),!0),dragstart(t,n){if(!("node"in t.state.selection)||"blockContent"!==t.state.selection.node.type.spec.group)return;e.transact(e=>e.setSelection(new y.nh(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:o,markdown:i}=te(t,e);return n.dataTransfer.setData("blocknote/html",r),n.dataTransfer.setData("text/html",o),n.dataTransfer.setData("text/plain",i),!0}}}})]}),(n=t.pasteHandler||(e=>e.defaultPasteHandler()),b.YY.create({name:"pasteFromClipboard",addProseMirrorPlugins:()=>[new y.k_({props:{handleDOMEvents:{paste(t,r){if(r.preventDefault(),e.isEditable)return n({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>(function({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){let o;if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData("text/plain");if(n)return t.pasteText(n),!0}for(let t of eq)if(e.clipboardData.types.includes(t)){o=t;break}if(!o)return!0;
1if("vscode-editor-data"===o){if(function(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData("text/plain");if(!r||!n.nodes.codeBlock)return!1;let o=e.clipboardData.getData("vscode-editor-data"),i=(o?JSON.parse(o):void 0)?.mode;return!!i&&(t.pasteHTML(`<pre><code class="language-${i}">${r.replace(/\r\n?/g,"\n")}</code></pre>`),!0)}(e,t.prosemirrorView))return!0;o="text/plain"}if("Files"===o)return eY(e,t),!0;let i=e.clipboardData.getData(o);if("blocknote/html"===o)return t.pasteHTML(i,!0),!0;if("text/markdown"===o)return t.pasteMarkdown(i),!0;if(n){let n=e.clipboardData.getData("text/plain");if(eZ.test(n)||eX.test(n)||eQ.test(n)||e0.test(n)||e1.test(n)||e2.test(n)||e5.test(n)||e3.test(n)||e4.test(n)||e9.test(n)||e6.test(n)||e7.test(n)||e8.test(n))return t.pasteMarkdown(n),!0}return"text/html"===o?t.pasteHTML(i):r?t.pasteMarkdown(i):t.pasteText(i),!0})({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]})),b.YY.create({name:"dropFile",addProseMirrorPlugins:()=>[new y.k_({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of eq)if(n.dataTransfer.types.includes(e)){r=e;break}return null===r||"Files"===r&&(eY(n,e),!0)}}}})]})]).filter(e=>!this.disabledExtensions.has(e.name)),o=(0,c.Ut)(this.extensions),i=new Map;for(let e of this.extensions){e.tiptapExtensions&&r.push(...e.tiptapExtensions);let t=o(e.key),{plugins:n,inputRules:l}=this.getProsemirrorPluginsFromExtension(e);n.length&&r.push(b.YY.create({name:e.key,priority:t,addProseMirrorPlugins:()=>n})),l.length&&(i.has(t)||i.set(t,[]),i.get(t).push(...l))}for(let e of(r.push(b.YY.create({name:"blocknote-input-rules",addProseMirrorPlugins(){let e=[];Array.from(i.keys()).sort().reverse().forEach(t=>{e.push(...i.get(t))});let t=function({rules:e}){let t=new y.k_({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,o,i)=>x(n,r,o,i,e,t),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&x(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}({rules:e});return[t,new y.k_({props:{handleKeyDown(e,n){if("Enter"!==n.key||n.shiftKey||n.ctrlKey||n.metaKey||n.altKey)return!1;let{$cursor:r}=e.state.selection;return!!r&&!!t.props.handleTextInput?.call(t,e,r.pos,r.pos,"\n",()=>e.state.tr.insertText("\n",r.pos,r.pos))}}})]}})),this.options._tiptapOptions?.extensions??[]))r.push(e);return r}getProsemirrorPluginsFromExtension(e){let t=[...e.prosemirrorPlugins??[]],n=[];return(e.prosemirrorPlugins?.length||Object.keys(e.keyboardShortcuts||{}).length||e.inputRules?.length)&&(this.extensionPlugins.set(e,t),e.inputRules?.length&&n.push(...e.inputRules.map(e=>new w(e.find,(t,n,r,o)=>{let i=e.replace({match:n,range:{from:r,to:o},editor:this.editor});if(i){let e=t.tr,n=(0,c._n)(e);if(!n.isBlockContainer||this.editor.schema.blockSchema[n.blockNoteType]?.content!=="inline")return null;e.deleteRange(r,o),(0,c.Et)(e,n.bnBlock.beforePos,i);let l=n.bnBlock.node.attrs.id;return l&&eC(e,l,"start"),e}return null},{undoable:!0}))),Object.keys(e.keyboardShortcuts||{}).length&&t.push((0,C.w)(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e,t])=>[e,()=>t({editor:this.editor})]))))),{plugins:t,inputRules:n}}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if("string"==typeof e)return this.extensions.find(t=>t.key===e)||void 0;if("function"==typeof e)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return"string"==typeof e?this.extensions.some(t=>t.key===e):"object"==typeof e&&"key"in e?this.extensions.some(t=>t.key===e.key):"function"==typeof e&&this.extensionFactories.has(e)}},tx=class{constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>(function(e){let t=(0,c.fn)(e);if(e.selection.empty||"node"in e.selection)return;let n=e.doc.resolve((0,c.yn)(e.doc,e.selection.from).posBeforeNode),r=e.doc.resolve((0,c.yn)(e.doc,e.selection.to).posBeforeNode),o=(r,o)=>{let i=n.posAtIndex(r,o),l=e.doc.resolve(i).nodeAfter;if(!l)throw Error(`Error getting selection - node not found at position ${i}`);return(0,c.an)(l,t)},i=[],l=n.sharedDepth(r.pos),s=n.index(l),a=r.index(l);if(n.depth>l){i.push((0,c.an)(n.nodeAfter,t));for(let e=n.depth;e>l;e--)if(n.node(e).type.isInGroup("childContainer")){let t=n.index(e)+1,r=n.node(e).childCount;for(let n=t;n<r;n++)i.push(o(n,e))}}else i.push(o(s,l));for(let e=s+1;e<=a;e++)i.push(o(e,l));if(0===i.length)throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);return{blocks:i}})(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>(function(e,t=!1){let n=(0,c.fn)(e),r=t?function(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}(e.doc,e.selection):e.selection,o=r.$from,i=r.$to;for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>
10;)i=e.doc.resolve(i.pos+1);for(;0===i.parentOffset&&i.depth>0;)i=e.doc.resolve(i.pos-1);for(;0===o.parentOffset&&o.depth>0;)o=e.doc.resolve(o.pos-1);for(;o.parentOffset>=o.parent.nodeSize-2&&o.depth>0;)o=e.doc.resolve(o.pos+1);let l=(0,c.sn)(e.doc.slice(o.pos,i.pos,!0),n);return{_meta:{startPos:o.pos,endPos:i.pos},...l}})(t,e))}setSelection(e,t){return this.editor.transact(n=>(function(e,t,n){let r,o,i="string"==typeof t?t:t.id,l="string"==typeof n?n:n.id,s=(0,c.ln)((0,c.fn)(e));if(i===l)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${i})`);let a=(0,c.Dt)(i,e.doc);if(!a)throw Error(`Block with ID ${i} not found`);let d=(0,c.Dt)(l,e.doc);if(!d)throw Error(`Block with ID ${l} not found`);let u=(0,c.mn)(a),p=(0,c.mn)(d),h=s.blockSchema[u.blockNoteType],f=s.blockSchema[p.blockNoteType];if(!u.isBlockContainer||"none"===h.content)throw Error(`Attempting to set selection anchor in block without content (id ${i})`);if(!p.isBlockContainer||"none"===f.content)throw Error(`Attempting to set selection anchor in block without content (id ${l})`);if("table"===h.content){let e=v.J3.get(u.blockContent.node);r=u.blockContent.beforePos+e.positionAt(0,0,u.blockContent.node)+1+2}else r=u.blockContent.beforePos+1;if("table"===f.content){let t=v.J3.get(p.blockContent.node),n=p.blockContent.beforePos+t.positionAt(t.height-1,t.width-1,p.blockContent.node)+1;o=n+e.doc.resolve(n).nodeAfter.nodeSize-2}else o=p.blockContent.afterPos-1;
1e.setSelection(y.U3.create(e.doc,r,o))})(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>(function(e){let{bnBlock:t}=(0,c._n)(e),n=(0,c.fn)(e.doc),r=e.doc.resolve(t.beforePos),o=r.nodeBefore,i=e.doc.resolve(t.afterPos).nodeAfter,l;return r.depth>1&&((l=r.node()).type.isInGroup("bnBlock")||(l=r.node(r.depth-1))),{block:(0,c.an)(t.node,n),prevBlock:null===o?void 0:(0,c.an)(o,n),nextBlock:null===i?void 0:(0,c.an)(i,n),parentBlock:void 0===l?void 0:(0,c.an)(l,n)}})(e))}setTextCursorPosition(e,t="start"){return this.editor.transact(n=>eC(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if((0,b.BQ)(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return(0,b.MG)(this.editor.prosemirrorView,n,r).toJSON()}},tC=class{constructor(e){this.editor=e}activeTransaction=null;can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}isInCan=!1;exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");return this.isInCan?this.canExec(e):e(this.prosemirrorState,e=>this.prosemirrorView.dispatch(e),this.prosemirrorView)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");return e(this.prosemirrorState,void 0,this.prosemirrorView)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){this.prosemirrorView?.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error("no editor, but also not headless?");return!1}return void 0===this.editor._tiptapEditor.isEditable||this.editor._tiptapEditor.isEditable}set isEditable(e){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error("no editor, but also not headless?");return}this.editor._tiptapEditor.options.editable!==e&&this.editor._tiptapEditor.setEditable(e)}undo(){let e=this.editor.getExtension("yUndo");if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension("history");if(t)return this.exec(t.undoCommand);throw Error("No undo plugin found")}redo(){let e=this.editor.getExtension("yUndo");if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension("history");if(t)return this.exec(t.redoCommand);throw Error("No redo plugin found")}},tS=class{constructor(e){this.editor=e}insertInlineContent(e,{updateSelection:t=!1}={}){let n=(0,c.At)(e,this.editor.pmSchema);this.editor.transact(e=>{!function(e,t,n,r={updateSelection:!0}
1){let{from:o,to:i}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},l=!0,s=!0,a="";if(n.forEach(e=>{e.check(),l&&e.isText&&0===e.marks.length?a+=e.text:l=!1,s=!!s&&e.isBlock}),o===i&&s){let{parent:t}=e.doc.resolve(o);!t.isTextblock||t.type.spec.code||t.childCount||(--o,i+=1)}l?e.insertText(a,o,i):e.replaceWith(o,i,n),r.updateSelection&&(0,b.Ms)(e,e.steps.length-1,-1)}(e,{from:e.selection.from,to:e.selection.to},n,{updateSelection:t})})}getActiveStyles(){return this.editor.transact(e=>{let t={};for(let n of e.selection.$to.marks()){let e=this.editor.schema.styleSchema[n.type.name];if(!e){"link"===n.type.name||n.type.spec.blocknoteIgnore||console.warn("mark not found in styleschema",n.type.name);continue}"boolean"===e.propSchema?t[e.type]=!0:t[e.type]=n.attrs.stringValue}return t})}addStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if("boolean"===e.propSchema)this.editor._tiptapEditor.commands.setMark(t);else if("string"===e.propSchema)this.editor._tiptapEditor.commands.setMark(t,{stringValue:n});else throw new c.zn(e.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if("boolean"===e.propSchema)this.editor._tiptapEditor.commands.toggleMark(t);else if("string"===e.propSchema)this.editor._tiptapEditor.commands.toggleMark(t,{stringValue:n});else throw new c.zn(e.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getLinkMarkAtPos(e){return this.editor.transact(t=>{let n=t.doc.resolve(e),r=n.marks().find(e=>"link"===e.type.name);if(!r)return;let o=(0,b.ve)(n,r.type);if(o)return{href:r.attrs.href,from:o.from,to:o.to,text:t.doc.textBetween(o.from,o.to)}})}getSelectedLinkUrl(){return this.editor.transact(e=>this.getLinkMarkAtPos(e.selection.from)?.href)}createLink(e,t){""!==e&&this.editor.transact(n=>{let{from:r,to:o}=n.selection,i=this.editor.pmSchema.mark("link",{href:e});t?n.insertText(t,r,o).addMark(r,r+t.length,i):n.addMark(r,o,i)})}editLink(e,t,n=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(r=>{let{from:o,to:i}=this.getLinkMarkAtPos(n+1)||{from:r.selection.from,to:r.selection.to},l=this.editor.pmSchema.mark("link",{href:e});t!==r.doc.textBetween(o,i)&&r.insertText(t,o,i),r.addMark(o,o+t.length,l)}),this.editor.prosemirrorView.focus()}deleteLink(e=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(t=>{let{from:n,to:r}=this.getLinkMarkAtPos(e+1)||{from:t.selection.from,to:t.selection.to};t.removeMark(n,r,this.editor.pmSchema.marks.link).setMeta("preventAutolink",!0)}),this.editor.prosemirrorView.focus()}};function tE(e){return void 0!==(0,b.eL)(e.state.selection.$from,e=>"tableCell"===e.type.name||"tableHeader"===e.type.name)}function tM(e,t){let n=m.FK.from(e.content),r=function(e,t,n){if(tE(t)||t.dragging)return null;let r=(0,c.gn)(t.state),o=r.isBlockContainer?r.blockContent.node:null;if(!o||"paragraph"===o.type.name||"inline*"!==o.type.spec.content||o.childCount>0)return null;let i=e.firstChild,l=i?.firstChild,s=l?.firstChild;if(i?.type.name!=="blockGroup"||l?.type.name!=="blockContainer"||s?.type.name!=="paragraph")return null;let a=o.type.create(o.attrs,s.content),d=l.copy(l.content.replaceChild(0,a)),u=i.copy(i.content.replaceChild(0,d));return new m.Ji(e.replaceChild(0,u),n.openStart,n.openEnd)}(n=function(e,t){let n=[];for(let r=0;r<e.childCount;r++)if("tableRow"===e.child(r).type.name)if(n.length>0&&"table"===n[n.length-1].type.name){let t=n[n.length-1],o=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=o}else{let o=t.nodes.table.createChecked(void 0,e.child(r));n.push(o)}else n.push(e.child(r));return m.FK.from(n)}(n,t.state.schema),t,e);if(r)return r;if(tE(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup("tableContent")&&(e=!0)}),!e&&!t.state.schema.nodes.tableParagraph.validContent(n))return new m.Ji(function e(t,n){let r=n.nodes.hardBreak,o=m.FK.empty;return t.forEach(t=>{t.isTextblock&&t.childCount>0?o=(o=o.append(t.content)).addToEnd(r.create()):t.isText?o=o.addToEnd(t):t.isBlock&&t.childCount>0&&(o=(o=o.append(e(t.content,n))).addToEnd(r.create()))}),o.lastChild?.type===r&&(o=o.cut(0,o.size-1)),o}(n,t.state.schema),0,0)}if(!function(e,t){let n=1===e.childCount,r=e.firstChild?.type.spec.content==="inline*",o=e.firstChild?.type.spec.content==="tableRow+";if(n){if(r)return!1;if(o){let e=(0,c.gn)(t.state);if(e.isBlockContainer)return"tableRow+"!==e.blockContent.node.type.spec.content}}return!0}(n,t))return new m.Ji(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if("blockContent"===n.child(e).type.spec.group){let r=[n.child(e)];if(e+1<n.childCount&&"blockGroup"===n.child(e+1).type.name){let t=n.child(e+1).child(0).child(0);("bulletListItem"===t.type.name||"numberedListItem"===t.type.name||"checkListItem"===t.type.name)&&(r.push(n.child(e+1)),n=function(e,t){let n=[];return e.forEach((e,r,o)=>{o!==t&&n.push(e)}),m.FK.from(n)}(n,e+1))}let o=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,o)}return new m.Ji(n,e.openStart,e.openEnd)}var tT={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},tA=class e extends f.t{pmSchema;_tiptapEditor;elementRenderer=null;blockCache=new WeakMap;dictionary;schema;blockImplementations;inlineContentImplementations;styleImplementations;uploadFile;onUploadStartCallbacks=[];onUploadEndCallbacks=[];resolveFileUrl;settings;static create(t){return new e(t??{})}constructor(e){super(),this.options=e,this.dictionary=e.dictionary||h,this.settings={tables:{splitCells:e?.tables?.splitCells??!1,cellBackgroun
1dColor:e?.tables?.cellBackgroundColor??!1,cellTextColor:e?.tables?.cellTextColor??!1,headers:e?.tables?.headers??!1}};let t={defaultStyles:!0,schema:e.schema||c.t.create(),...e,placeholders:{...this.dictionary.placeholders,...e.placeholders}};if(this.schema=t.schema,this.blockImplementations=t.schema.blockSpecs,this.inlineContentImplementations=t.schema.inlineContentSpecs,this.styleImplementations=t.schema.styleSpecs,t.uploadFile){let e=t.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=t.resolveFileUrl,this._eventManager=new X(this),this._extensionManager=new tw(this,t);let n=this._extensionManager.getTiptapExtensions(),r=this._extensionManager.hasExtension("ySync")||this._extensionManager.hasExtension("liveblocksExtension");r&&t.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");let o={...tT,...t._tiptapOptions,element:null,autofocus:t.autofocus??!1,extensions:n,editorProps:{...t._tiptapOptions?.editorProps,attributes:{tabIndex:"0",...t._tiptapOptions?.editorProps?.attributes,...t.domAttributes?.editor,class:(0,c.Rn)("bn-editor",t.defaultStyles?"bn-default-styles":"",t.domAttributes?.editor?.class||"")},transformPasted:tM}};try{let e=t.initialContent||(r?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:c.Yn.options.generateID()}]);if(!Array.isArray(e)||0===e.length)throw Error("initialContent must be a non-empty array of blocks, received: "+e);let n=(0,b._w)(o.extensions),i=(0,b.ui)({type:"doc",content:[{type:"blockGroup",content:e.map(e=>(0,c.kt)(e,n,this.schema.styleSchema).toJSON())}]},n,o.parseOptions);this._tiptapEditor=new b.KE({...o,content:i.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}let i,l=this.pmSchema.nodes.doc.createAndFill;this.pmSchema.nodes.doc.createAndFill=(...e)=>{if(i)return i;let t=JSON.parse(JSON.stringify(l.apply(this.pmSchema.nodes.doc,e).toJSON()));return t.content[0].content[0].attrs.id="initialBlockId",i=m.bP.fromJSON(this.pmSchema,t)},this.pmSchema.cached.blockNoteEditor=this,this._tiptapEditor.on("mount",()=>{this.headless=!1}),this._tiptapEditor.on("unmount",()=>{this.headless=!0}),this._blockManager=new Z(this),this._exportManager=new ex(this),this._selectionManager=new tx(this),this._stateManager=new tC(this),this._styleManager=new tS(this),this.emit("create")}_blockManager;_eventManager;_exportManager;_extensionManager;_selectionManager;_stateManager;_styleManager;get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}unregisterExtension=(...e)=>this._extensionManager.unregisterExtension(...e);registerExtension=(...e)=>this._extensionManager.registerExtension(...e);getExtension=(...e)=>this._extensionManager.getExtension(...e);mount=(e,t)=>{let n=e.getRootNode(),r="u">typeof ShadowRoot&&n instanceof ShadowRoot;(t?.portalTarget??e.parentElement??(r?n:document.body)).appendChild(this.portalElement),this._tiptapEditor.mount({mount:e})};unmount=()=>{this.portalElement?.remove(),this._tiptapEditor.unmount()};get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}_portalElement;get portalElement(){if(typeof document>"u")throw Error("Portal element accessed, but not available in headless mode");return this._portalElement||=document.createElement("div"),this._portalElement}isWithinEditor=e=>!!(this.domElement?.parentElement?.contains(e)||this.portalElement?.contains(e));isFocused(){return!this.headless&&(this.prosemirrorView?.hasFocus()||!1)}headless=!0;focus(){this.headless||this.prosemirrorView.focus()}blur(){this.headless||this.domElement?.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on("update",e)}onEditorSelectionChange(e){this._tiptapEditor.on("selectionUpdate",e)}onBeforeChange(e){return this._extensionManager.getExtension(d.E).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t="start"){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n="before"){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}getLinkMarkAtPos(e){return this._styleManager.getLinkMarkAtPos(e)}editLink(e,t,n){this._styleManager.editLink(e,t,n)}deleteLink(e){this._styleManager.deleteLink(e)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(e){return this._blockManager.moveBlocksUp(e)}moveBlocksDown(e){return this._blockManager.moveBlocksDown(e)}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onMount(e){return this._eventManager.onMount(e)}onUnmount(e){return this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return 0===e.length||1===e.length&&"paragraph"===e[0].type&&0===e[0].content.length}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}},tI=n(95155),tN=n(84148),tj=(0,r.createContext)(void 0);function tP(e){return(0,r.useContext)(tj)}function t_(e){let t=tP(e);if(!t?.editor)throw Error("useBlockNoteEditor was called outside of a BlockNoteContext provider or BlockNoteView component");return t.editor}function tB(e,t){let n=(t?.editor??t_()).getExtension(e);if(!n)throw Error("Extension not found",{cause:{plugin:e}});return n}function tO(e,t){let{store:n}=tB(e,t);if(!n)throw Error("Store not found on plugin",{cause:{plugin:e}});return function(e,t=e=>e){return(0,l.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,s)}(n,t?.selector)}var tR=e=>{var t,n;let l=t_(),s=null===e.portalElement?"u">typeof document?document.body:void 0:e.portalElement??l?.portalElement;if(!s)throw Error("Portal element not found");let{whileElementsMounted:a,...c}=e.useFloatingOptions??{},{refs:d,floatingStyles:u,context:p}=(0,o.we)({whileElementsMounted:(t=i.ll,n=e.useFloatingOptions?.whileElementsMounted,t?n?(e,r,o)=>{let i=t(e,r,o),l=n(e,r,o);return()=>{i?.(),l?.()}}:t:n),...c}),{isMounted:h,styles:f}=(0,o.DL)(p,e.useTransitionStylesProps),{status:m}=(0,o.$X)(p,e.useTransitionStatusProps),{getFloatingProps:g}=(0,o.bv)([(0,o.s9)(p,e.useDismissProps),(0,o.Mk)(p,{enabled:!1,...e.useHoverProps})]),b=(0,r.useRef)(""),y=(0,r.useRef)(null),v=(0,o.SV)([y,d.setFloating]);if((0,r.useEffect)(()=>
1{if(e.reference){var t;let n,r,o="element"in e.reference?e.reference.element:void 0;void 0!==o&&(e.focusManagerProps?.disabled||!l.isWithinEditor(o))&&d.setReference(o),d.setPositionReference({getBoundingClientRect:(t=e.reference,n=new DOMRect,r="getBoundingClientRect"in t?()=>t.getBoundingClientRect():()=>t.element.getBoundingClientRect(),()=>t.element&&(t.cacheMountedBoundingClientRect??!0)?(t.element.isConnected&&(n=r()),n):r()),contextElement:o})}},[e.reference,d,e.focusManagerProps?.disabled,l]),(0,r.useEffect)(()=>{("initial"===m||"open"===m)&&y.current?.innerHTML&&(b.current=y.current.innerHTML)},[m,e.reference,e.children]),!h)return!1;let k={...e.elementProps,style:{display:"flex",...e.elementProps?.style,zIndex:`calc(var(--bn-ui-base-z-index, 0) + ${e.elementProps?.style?.zIndex||0})`,...u,...f},...g()};return"close"===m?(0,tI.jsx)(o.XF,{root:s,children:(0,tI.jsx)("div",{ref:v,...k,dangerouslySetInnerHTML:{__html:b.current}})}):e.focusManagerProps?.disabled?(0,tI.jsx)(o.XF,{root:s,children:(0,tI.jsx)("div",{ref:v,...k,children:e.children})}):(0,tI.jsx)(o.XF,{root:s,children:(0,tI.jsx)(o.s3,{...e.focusManagerProps,context:p,children:(0,tI.jsx)("div",{ref:v,...k,children:e.children})})})},tL=(0,r.createContext)(void 0);function tD(){return(0,r.useContext)(tL)}function t$(){return tP().editor.dictionary}var tF="u">typeof window?r.useLayoutEffect:r.useEffect,tz=class{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e,t){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor._tiptapEditor,r={all:["transaction","create","mount","unmount"],mount:["create","mount","unmount"],selection:["selectionUpdate"],change:["update"]};for(let o of r[t])n.on(o,e);return()=>{for(let o of r[t])n.off(o,e)}}}};function tH(e){let t=tP(),n=e.editor||t?.editor||null,o=e.on||"all",[i]=(0,r.useState)(()=>new tz(n)),s=(0,l.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,e.equalityFn??tN);return tF(()=>i.watch(n,o),[n,i,o]),(0,r.useDebugValue)(s),s}function tV(e){let t=tP();return tH({editor:e||=t?.editor,selector:e=>e.editor?.domElement,equalityFn:(e,t)=>e===t,on:"mount"})}var tU=e=>{let{position:t,children:n,portalElement:o,...i}=e,{from:l,to:s}=t||{},a=t_(),c=tV();return(0,tI.jsx)(tR,{reference:(0,r.useMemo)(()=>{if(void 0!==l&&void 0!==s)return{element:c?.firstElementChild||void 0,getBoundingClientRect:()=>(0,b.MG)(a.prosemirrorView,l,s??l)}},[a,c,l,s]),portalElement:o,...i,children:void 0!==t&&n})},tW=(e={},t=[])=>(0,r.useMemo)(()=>{let t=tA.create(e);return window&&(window.ProseMirror=t._tiptapEditor),t},t),tJ=e=>{let[t,n]=(0,r.useState)(!1),o=tH({editor:e.editor,selector:({editor:e})=>e.isEmpty}),i=tD(),l=(0,r.useCallback)(()=>{n(!0)},[]),s=(0,r.useCallback)(()=>{n(!1)},[]);return(0,r.useEffect)(()=>{e.editable&&e.autoFocus&&e.editor.focus()},[e.autoFocus,e.editable,e.editor]),(0,tI.jsxs)(tI.Fragment,{children:[(0,tI.jsx)(i.Comments.Editor,{autoFocus:e.autoFocus,className:"bn-comment-editor",editor:e.editor,onFocus:l,onBlur:s,editable:e.editable}),e.actions&&(0,tI.jsx)("div",{className:"bn-comment-actions-wrapper",children:e.actions({isFocused:t,isEmpty:o})})]})},{textColor:tG,backgroundColor:tq,...tK}=c.o,tY=c.t.create({blockSpecs:{paragraph:(0,c.A)()},styleSpecs:tK})},2371:(e,t,n)=>{n.d(t,{j:()=>o});var r=n(92248);function o(e){let{m:t,mx:n,my:o,mt:i,mb:l,ml:s,mr:a,me:c,ms:d,p:u,px:p,py:h,pt:f,pb:m,pl:g,pr:b,pe:y,ps:v,bd:k,bdrs:w,bg:x,c:C,opacity:S,ff:E,fz:M,fw:T,lts:A,ta:I,lh:N,fs:j,tt:P,td:_,w:B,miw:O,maw:R,h:L,mih:D,mah:$,bgsz:F,bgp:z,bgr:H,bga:V,pos:U,top:W,left:J,bottom:G,right:q,inset:K,display:Y,flex:Z,hiddenFrom:X,visibleFrom
1:Q,lightHidden:ee,darkHidden:et,sx:en,...er}=e;return{styleProps:(0,r.J)({m:t,mx:n,my:o,mt:i,mb:l,ml:s,mr:a,me:c,ms:d,p:u,px:p,py:h,pt:f,pb:m,pl:g,pr:b,pe:y,ps:v,bd:k,bg:x,c:C,opacity:S,ff:E,fz:M,fw:T,lts:A,ta:I,lh:N,fs:j,tt:P,td:_,w:B,miw:O,maw:R,h:L,mih:D,mah:$,bgsz:F,bgp:z,bgr:H,bga:V,pos:U,top:W,left:J,bottom:G,right:q,inset:K,display:Y,flex:Z,bdrs:w,hiddenFrom:X,visibleFrom:Q,lightHidden:ee,darkHidden:et,sx:en}),rest:er}}n(12115),n(95155)},4569:(e,t,n)=>{n.d(t,{AO:()=>I,Kr:()=>T,nq:()=>A});var r='input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),area[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)',o="u"<typeof Element,i=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,l=!o&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},s=function(e,t){void 0===t&&(t=!0);var n,r=null==e||null==(n=e.getAttribute)?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):s(e.parentNode))},a=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},c=function(e,t,n){if(s(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(r));return t&&i.call(e,r)&&o.unshift(e),o=o.filter(n)},d=function(e,t,n){for(var o=[],l=Array.from(e);l.length;){var a=l.shift();if(!s(a,!1))if("SLOT"===a.tagName){var c=a.assignedElements(),u=d(c.length?c:a.children,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:a,candidates:u})}else{i.call(a,r)&&n.filter(a)&&(t||!e.includes(a))&&o.push(a);var p=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),h=!s(p,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(p&&h){var f=d(!0===p?a.children:p.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:a,candidates:f})}else l.unshift.apply(l,a.children)}}return o},u=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},p=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||a(e))&&!u(e)?0:e.tabIndex},h=function(e,t){var n=p(e);return n<0&&t&&!u(e)?0:n},f=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},m=function(e){return"INPUT"===e.tagName},g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},b=function(e){if(!e.name)return!0;var t,n=e.form||l(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("u">typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=g(t,e.form);return!o||o===e},y=function(e){return m(e)&&"radio"===e.type&&!b(e)},v=function(e){var t,n,r,o,i,s,a,c=e&&l(e),d=null==(t=c)?void 0:t.host,u=!1;if(c&&c!==e)for(u=!!(null!=(n=d)&&null!=(r=n.ownerDocument)&&r.contains(d)||null!=e&&null!=(o=e.ownerDocument)&&o.contains(e));!u&&d;)u=!!(null!=(s=d=null==(i=c=l(d))?void 0:i.host)&&null!=(a=s.ownerDocument)&&a.contains(d));return u},k=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},w=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var o=getComputedStyle(e).visibility;if("hidden"===o||"collapse"===o)return!0;var s=i.call(e,"details>summary:first-of-type")?e.parentElement:e;if(i.call(s,"details:not([open]) *"))return!0;
1if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return k(e)}else{if("function"==typeof r){for(var a=e;e;){var c=e.parentElement,d=l(e);if(c&&!c.shadowRoot&&!0===r(c))return k(e);e=e.assignedSlot?e.assignedSlot:c||d===e.ownerDocument?c:d.host}e=a}if(v(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},x=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!i.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1},C=function(e,t){return!(t.disabled||m(t)&&"hidden"===t.type||w(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||x(t))},S=function(e,t){return!(y(t)||0>p(t))&&!!C(e,t)},E=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},M=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,l=h(i,o),s=o?M(e.candidates):i;0===l?o?t.push.apply(t,s):t.push(i):n.push({documentOrder:r,tabIndex:l,item:e,isScope:o,content:s})}),n.sort(f).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},T=function(e,t){return M((t=t||{}).getShadowRoot?d([e],t.includeContainer,{filter:S.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:E}):c(e,t.includeContainer,S.bind(null,t)))},A=function(e,t){return(t=t||{}).getShadowRoot?d([e],t.includeContainer,{filter:C.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):c(e,t.includeContainer,C.bind(null,t))},I=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==i.call(e,r)&&S(t,e)}},6494:(e,t,n)=>{n.d(t,{NP:()=>nQ});var r=n(37366),o=n(2109),i=n(61108),l=n(95155),s=n(12115),a=n(86334),c=n(25168),d=n(65214),u=n(74279),p=n(97276),h=n(69954),f={root:"m_6d731127"};let m={gap:"md",align:"stretch",justify:"flex-start"},g=(0,c.V)((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":(0,a.GY)(t),"--stack-align":n,"--stack-justify":r}})),b=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Stack",m,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,align:h,justify:b,gap:y,variant:v,attributes:k,...w}=n,x=(0,u.I)({name:"Stack",props:n,classes:f,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:k,vars:c,varsResolver:g});return(0,l.jsx)(p.a,{ref:t,...x("root"),variant:v,...w})});b.classes=f,b.displayName="@mantine/core/Stack";var y=n(99718),v=n(69458),k=n(38273),w={root:"m_b6d8b162"};let x={inherit:!1},C=(0,c.V)((e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":(0,a.ny)(o),"--text-lh":(0,a.ks)(o),"--text-gradient":"gradient"===t?(0,v.v)(r,e):void 0,"--text-line-clamp":"number"==typeof n?n.toString():void 0,"--text-color":i?(0,y.r)(i,e):void 0}})),S=(0,k.v)((e,t)=>{let n=(0,d.Y)("Text",x,e),{lineClamp:r,truncate:o,inline:i,inherit:s,gradient:a,span:c,__staticSelector:h,vars:f,className:m,style:g,classNames:b,styles:y,unstyled:v,variant:k,mod:S,size:E,attributes:M,...T}=n,A=(0,u.I)({name:["Text",h],props:n,classes:w,className:m,style:g,classNames:b,styles:y,unstyled:v,attributes:M,vars:f,varsResolver:C});return(0,l.jsx)(p.a,{...A("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:k,mod:[{"data-truncate":"start"===o?"start":"end"===o||o?"end":void 0,"data-line-clamp":"number"==typeof r,"data-inline":i,"data-inherit":s},S],size:E,...T})});S.classes=w,S.displayName="@mantine/core/Text";var E=n(67413),M=n(29722),T={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};let A=(0,s.forwardRef)(({className:e,...t},n)=>(0,l.jsxs)(p.a,{component:"span",className:(0,M.A)(T.barsLoader,e),...t,ref:n,children:[(0,l.jsx)("span",{className:T.bar}),(0,l.jsx)("span",{className:T.bar}),(0,l.jsx)("span",{className:T.bar})]}));A.displayName="@mantine/core/Bars";let I=(0,s.forwardRef)(({className:e,...t},n)=>(0,l.jsxs)(p.a,{component:"span",className:(0,M.A)(T.dotsLoader,e),...t,ref:n,children:[(0,l.jsx)("span",{className:T.dot}),(0,l.jsx)("span",{className:T.dot}),(0,l.jsx)("span",{className:T.dot})]}));I.displayName="@mantine/core/Dots";let N=(0,s.forwardRef)(({className:e,...t},n)=>
1(0,l.jsx)(p.a,{component:"span",className:(0,M.A)(T.ovalLoader,e),...t,ref:n}));N.displayName="@mantine/core/Oval";let j={bars:A,oval:N,dots:I},P={loaders:j,type:"oval"},_=(0,c.V)((e,{size:t,color:n})=>({root:{"--loader-size":(0,a.YC)(t,"loader-size"),"--loader-color":n?(0,y.r)(n,e):void 0}})),B=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Loader",P,e),{size:r,color:o,type:i,vars:s,className:a,style:c,classNames:h,styles:f,unstyled:m,loaders:g,variant:b,children:y,attributes:v,...k}=n,w=(0,u.I)({name:"Loader",props:n,classes:T,className:a,style:c,classNames:h,styles:f,unstyled:m,attributes:v,vars:s,varsResolver:_});return y?(0,l.jsx)(p.a,{...w("root"),ref:t,...k,children:y}):(0,l.jsx)(p.a,{...w("root"),ref:t,component:g[i],variant:b,size:r,...k})});B.defaultLoaders=j,B.classes=T,B.displayName="@mantine/core/Loader";var O=n(95923),R=n(57142),L={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};let D={orientation:"horizontal"},$=(0,c.V)((e,{borderWidth:t})=>({group:{"--button-border-width":(0,E.D)(t)}})),F=(0,h.P9)((e,t)=>{let n=(0,d.Y)("ButtonGroup",D,e),{className:r,style:o,classNames:i,styles:s,unstyled:a,orientation:c,vars:h,borderWidth:f,variant:m,mod:g,attributes:b,...y}=(0,d.Y)("ButtonGroup",D,e),v=(0,u.I)({name:"ButtonGroup",props:n,classes:L,className:r,style:o,classNames:i,styles:s,unstyled:a,attributes:b,vars:h,varsResolver:$,rootSelector:"group"});return(0,l.jsx)(p.a,{...v("group"),ref:t,variant:m,mod:[{"data-orientation":c},g],role:"group",...y})});F.classes=L,F.displayName="@mantine/core/ButtonGroup";let z=(0,c.V)((e,{radius:t,color:n,gradient:r,variant:o,autoContrast:i,size:l})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:i});return{groupSection:{"--section-height":(0,a.YC)(l,"section-height"),"--section-padding-x":(0,a.YC)(l,"section-padding-x"),"--section-fz":l?.includes("compact")?(0,a.ny)(l.replace("compact-","")):(0,a.ny)(l),"--section-radius":void 0===t?void 0:(0,a.nJ)(t),"--section-bg":n||o?s.background:void 0,"--section-color":s.color,"--section-bd":n||o?s.border:void 0}}}),H=(0,h.P9)((e,t)=>{let n=(0,d.Y)("ButtonGroupSection",null,e),{className:r,style:o,classNames:i,styles:s,unstyled:a,vars:c,variant:h,gradient:f,radius:m,autoContrast:g,attributes:b,...y}=n,v=(0,u.I)({name:"ButtonGroupSection",props:n,classes:L,className:r,style:o,classNames:i,styles:s,unstyled:a,attributes:b,vars:c,varsResolver:z,rootSelector:"groupSection"});return(0,l.jsx)(p.a,{...v("groupSection"),ref:t,variant:h,...y})});H.classes=L,H.displayName="@mantine/core/ButtonGroupSection";let V={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${(0,E.D)(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},U=(0,c.V)((e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:l,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{root:{"--button-justify":l,"--button-height":(0,a.YC)(i,"button-height"),"--button-padding-x":(0,a.YC)(i,"button-padding-x"),"--button-fz":i?.includes("compact")?(0,a.ny)(i.replace("compact-","")):(0,a.ny)(i),"--button-radius":void 0===t?void 0:(0,a.nJ)(t),"--button-bg":n||o?c.background:void 0,"--button-hover":n||o?c.hover:void 0,"--button-color":c.color,"--button-bd":n||o?c.border:void 0,"--button-hover-color":n||o?c.hoverColor:void 0}}}),W=(0,k.v)((e,t)=>{let n=(0,d.Y)("Button",null,e),{style:r,vars:o,className:i,color:s,disabled:a,children:c,leftSection:h,rightSection:f,fullWidth:m,variant:g,radius:b,loading:y,loaderProps:v,gradient:k,classNames:w,styles:x,unstyled:C,"data-disabled":S,autoContrast:E,mod:M,attributes:T,...A}=n,I=(0,u.I)({name:"Button",props:n,classes:L,className:i,style:r,classNames:w,styles:x,unstyled:C,attributes:T,vars:o,varsResolver:U}),N=!!h,j=!!f;return(0,l.jsxs)(R.N,{ref:t,...I("root",{active:!a&&!y&&!S}),unstyled:C,variant:g,disabled:a||y,mod:[{disabled:a||S,loading:y,block:m,"with-left-section":N,"with-right-section":j},M],...A,children:["boolean"==typeof y&&(0,l.jsx)(O.e,{mounted:y,transition:V,duration:150,children:e=>(0,l.jsx)(p.a,{component:"span",...I("loader",{style:e}
1),"aria-hidden":!0,children:(0,l.jsx)(B,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v})})}),(0,l.jsxs)("span",{...I("inner"),children:[h&&(0,l.jsx)(p.a,{component:"span",...I("section"),mod:{position:"left"},children:h}),(0,l.jsx)(p.a,{component:"span",mod:{loading:y},...I("label"),children:c}),f&&(0,l.jsx)(p.a,{component:"span",...I("section"),mod:{position:"right"},children:f})]})]})});W.classes=L,W.displayName="@mantine/core/Button",W.Group=F,W.GroupSection=H;var J={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};let G={orientation:"horizontal"},q=(0,c.V)((e,{borderWidth:t})=>({group:{"--ai-border-width":(0,E.D)(t)}})),K=(0,h.P9)((e,t)=>{let n=(0,d.Y)("ActionIconGroup",G,e),{className:r,style:o,classNames:i,styles:s,unstyled:a,orientation:c,vars:h,borderWidth:f,variant:m,mod:g,attributes:b,...y}=(0,d.Y)("ActionIconGroup",G,e),v=(0,u.I)({name:"ActionIconGroup",props:n,classes:J,className:r,style:o,classNames:i,styles:s,unstyled:a,attributes:b,vars:h,varsResolver:q,rootSelector:"group"});return(0,l.jsx)(p.a,{...v("group"),ref:t,variant:m,mod:[{"data-orientation":c},g],role:"group",...y})});K.classes=J,K.displayName="@mantine/core/ActionIconGroup";let Y=(0,c.V)((e,{radius:t,color:n,gradient:r,variant:o,autoContrast:i,size:l})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:i});return{groupSection:{"--section-height":(0,a.YC)(l,"section-height"),"--section-padding-x":(0,a.YC)(l,"section-padding-x"),"--section-fz":(0,a.ny)(l),"--section-radius":void 0===t?void 0:(0,a.nJ)(t),"--section-bg":n||o?s.background:void 0,"--section-color":s.color,"--section-bd":n||o?s.border:void 0}}}),Z=(0,h.P9)((e,t)=>{let n=(0,d.Y)("ActionIconGroupSection",null,e),{className:r,style:o,classNames:i,styles:s,unstyled:a,vars:c,variant:h,gradient:f,radius:m,autoContrast:g,attributes:b,...y}=n,v=(0,u.I)({name:"ActionIconGroupSection",props:n,classes:J,className:r,style:o,classNames:i,styles:s,unstyled:a,attributes:b,vars:c,varsResolver:Y,rootSelector:"groupSection"});return(0,l.jsx)(p.a,{...v("groupSection"),ref:t,variant:h,...y})});Z.classes=J,Z.displayName="@mantine/core/ActionIconGroupSection";let X=(0,c.V)((e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:l})=>{let s=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:l});return{root:{"--ai-size":(0,a.YC)(t,"ai-size"),"--ai-radius":void 0===n?void 0:(0,a.nJ)(n),"--ai-bg":i||r?s.background:void 0,"--ai-hover":i||r?s.hover:void 0,"--ai-hover-color":i||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":i||r?s.border:void 0}}}),Q=(0,k.v)((e,t)=>{let n=(0,d.Y)("ActionIcon",null,e),{className:r,unstyled:o,variant:i,classNames:s,styles:a,style:c,loading:h,loaderProps:f,size:m,color:g,radius:b,__staticSelector:y,gradient:v,vars:k,children:w,disabled:x,"data-disabled":C,autoContrast:S,mod:E,attributes:M,...T}=n,A=(0,u.I)({name:["ActionIcon",y],props:n,className:r,style:c,classes:J,classNames:s,styles:a,unstyled:o,attributes:M,vars:k,varsResolver:X});return(0,l.jsxs)(R.N,{...A("root",{active:!x&&!h&&!C}),...T,unstyled:o,variant:i,size:m,disabled:x||h,ref:t,mod:[{loading:h,disabled:x||C},E],children:["boolean"==typeof h&&(0,l.jsx)(O.e,{mounted:h,transition:"slide-down",duration:150,children:e=>(0,l.jsx)(p.a,{component:"span",...A("loader",{style:e}),"aria-hidden":!0,children:(0,l.jsx)(B,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...f})})}),(0,l.jsx)(p.a,{component:"span",mod:{loading:h},...A("icon"),children:w})]})});Q.classes=J,Q.displayName="@mantine/core/ActionIcon",Q.Group=K,Q.GroupSection=Z;var ee=n(84101),et=n(35624),en=n(22442),er=n(67740),eo=n(85754),ei=n(79404),el=n(87691),es=n(54169);let ea={duration:100,transition:"fade"};function ec(e,t){return{...ea,...t,...e}}var ed=n(12255),eu=n(76701),ep=n(9683),eh=n(6791),ef={tooltip:"m_1b3c8819",arrow:"m_f898399f"};let em={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:(0,et.I)("popover")},eg=(0,c.V)((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":void 0===t?void 0:(0,a.nJ)(t),"--tooltip-bg":n?(0,y.r)(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}})),eb=(0,h.P9)((e,t)=>{let n=(0,d.Y)("TooltipFloating",em,e),{children:r,refProp:o,withinPortal:i,style:a,className:c,classNames:h,styles:f,unstyled:m,radiu
1s:g,color:b,label:y,offset:v,position:k,multiline:w,zIndex:x,disabled:C,defaultOpened:S,variant:E,vars:M,portalProps:T,attributes:A,...I}=n,N=(0,ed.xd)(),j=(0,u.I)({name:"TooltipFloating",props:n,classes:ef,className:c,style:a,classNames:h,styles:f,unstyled:m,attributes:A,rootSelector:"tooltip",vars:M,varsResolver:eg}),{handleMouseMove:P,x:_,y:B,opened:O,boundaryRef:R,floating:L,setOpened:D}=function({offset:e,position:t,defaultOpened:n}){let[r,o]=(0,s.useState)(n),i=(0,s.useRef)(null),{x:l,y:a,elements:c,refs:d,update:u,placement:p}=(0,eu.we)({placement:t,middleware:[(0,ep.BN)({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?-1*e:0,f=p.includes("bottom")?e:t.includes("top")?-1*e:0,m=(0,s.useCallback)(({clientX:e,clientY:t})=>{d.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:e,y:t,left:e+h,top:t+f,right:e,bottom:t})})},[c.reference]);return(0,s.useEffect)(()=>{if(d.floating.current){let e=i.current;e.addEventListener("mousemove",m);let t=(0,eh.v9)(d.floating.current);return t.forEach(e=>{e.addEventListener("scroll",u)}),()=>{e.removeEventListener("mousemove",m),t.forEach(e=>{e.removeEventListener("scroll",u)})}}},[c.reference,d.floating.current,u,m,r]),{handleMouseMove:m,x:l,y:a,opened:r,setOpened:o,boundaryRef:i,floating:d.setFloating}}({offset:v,position:k,defaultOpened:S}),$=(0,er.D)(r);if(!$)throw Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");let F=(0,ee.pc)(R,(0,en.x)($),t),z=$.props;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(es.r,{...T,withinPortal:i,children:(0,l.jsx)(p.a,{...I,...j("tooltip",{style:{...function e(t,n){return Array.isArray(t)?[...t].reduce((t,r)=>({...t,...e(r,n)}),{}):"function"==typeof t?t(n):null==t?{}:t}(a,N),zIndex:x,display:!C&&O?"block":"none",top:(B&&Math.round(B))??"",left:(_&&Math.round(_))??""}}),variant:E,ref:L,mod:{multiline:w},children:y})}),(0,s.cloneElement)($,{...z,[o]:F,onMouseEnter:e=>{z.onMouseEnter?.(e),P(e),D(!0)},onMouseLeave:e=>{z.onMouseLeave?.(e),D(!1)}})]})});eb.classes=ef,eb.displayName="@mantine/core/TooltipFloating";let ey=(0,s.createContext)(!1),ev=ey.Provider,ek={openDelay:0,closeDelay:0};function ew(e){let{openDelay:t,closeDelay:n,children:r}=(0,d.Y)("TooltipGroup",ek,e);return(0,l.jsx)(ev,{value:!0,children:(0,l.jsx)(eu.T3,{delay:{open:t,close:n},children:r})})}ew.displayName="@mantine/core/TooltipGroup",ew.extend=e=>e;var ex=n(17294),eC=n(45535),eS=n(48219);let eE={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:(0,et.I)("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},eM=(0,c.V)((e,{radius:t,color:n,variant:r,autoContrast:o})=>{let i=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:o,variant:r||"filled"});return{tooltip:{"--tooltip-radius":void 0===t?void 0:(0,a.nJ)(t),"--tooltip-bg":n?i.background:void 0,"--tooltip-color":n?i.color:void 0}}}),eT=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Tooltip",eE,e),{children:r,position:o,refProp:i,label:a,openDelay:c,closeDelay:h,onPositionChange:f,opened:m,defaultOpened:g,withinPortal:b,radius:y,color:v,classNames:k,styles:w,unstyled:x,style:C,className:S,withArrow:E,arrowSize:T,arrowOffset:A,arrowRadius:I,arrowPosition:N,offset:j,transitionProps:P,multiline:_,events:B,zIndex:R,disabled:L,positionDependencies:D,onClick:$,onMouseEnter:F,onMouseLeave:z,inline:H,variant:V,keepMounted:U,vars:W,portalProps:J,mod:G,floatingStrategy:q,middlewares:K,autoContrast:Y,attributes:Z,target:X,...Q}=(0,d.Y)("Tooltip",eE,n),{dir:et}=(0,eo.jH)(),ea=(0,s.useRef)(null),ed=function(e){let t,n,[r,o]=(0,s.use
1State)(e.defaultOpened),i="boolean"==typeof e.opened?e.opened:r,l=(0,s.useContext)(ey),a=(0,eC.B)(),c=(0,s.useCallback)(e=>{o(e),e&&v(a)},[a]),{x:d,y:u,context:p,refs:h,placement:f,middlewareData:{arrow:{x:m,y:g}={}}}=(0,eu.we)({strategy:e.strategy,placement:e.position,open:i,onOpenChange:c,middleware:(t=function(e){if(void 0===e)return{shift:!0,flip:!0};let t={...e};return void 0===e.shift&&(t.shift=!0),void 0===e.flip&&(t.flip=!0),t}(e.middlewares),n=[(0,ep.cY)(e.offset)],t.shift&&n.push((0,ep.BN)("boolean"==typeof t.shift?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push("boolean"==typeof t.flip?(0,ep.UU)():(0,ep.UU)(t.flip)),n.push((0,ep.UE)({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push("boolean"==typeof t.inline?(0,ep.mG)():(0,ep.mG)(t.inline)):e.inline&&n.push((0,ep.mG)()),n),whileElementsMounted:ex.ll}),{delay:b,currentId:y,setCurrentId:v}=(0,eu.ck)(p,{id:a}),{getReferenceProps:k,getFloatingProps:w}=(0,eu.bv)([(0,eu.Mk)(p,{enabled:e.events?.hover,delay:l?b:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),(0,eu.iQ)(p,{enabled:e.events?.focus,visibleOnly:!0}),(0,eu.It)(p,{role:"tooltip"}),(0,eu.s9)(p,{enabled:void 0===e.opened})]);(0,eS.C)(()=>{e.onPositionChange?.(f)},[f]);let x=i&&y&&y!==a;return{x:d,y:u,arrowX:m,arrowY:g,reference:h.setReference,floating:h.setFloating,getFloatingProps:w,getReferenceProps:k,isGroupPhase:x,opened:i,placement:f}}({position:(0,el.Q)(et,o),closeDelay:h,openDelay:c,onPositionChange:f,opened:m,defaultOpened:g,events:B,arrowRef:ea,arrowOffset:A,offset:"number"==typeof j?j+(E?T/2:0):j,positionDependencies:[...D,X??r],inline:H,strategy:q,middlewares:K});(0,s.useEffect)(()=>{let e=X instanceof HTMLElement?X:"string"==typeof X?document.querySelector(X):X?.current||null;e&&ed.reference(e)},[X,ed]);let eh=(0,u.I)({name:"Tooltip",props:n,classes:ef,className:S,style:C,classNames:k,styles:w,unstyled:x,attributes:Z,rootSelector:"tooltip",vars:W,varsResolver:eM}),em=(0,er.D)(r);if(!X&&!em)return null;if(X){let e=ec(P,{duration:100,transition:"fade"});return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(es.r,{...J,withinPortal:b,children:(0,l.jsx)(O.e,{...e,keepMounted:U,mounted:!L&&!!ed.opened,duration:ed.isGroupPhase?10:e.duration,children:e=>(0,l.jsxs)(p.a,{...Q,"data-fixed":"fixed"===q||void 0,variant:V,mod:[{multiline:_},G],...ed.getFloatingProps({ref:ed.floating,className:eh("tooltip").className,style:{...eh("tooltip").style,...e,zIndex:R,top:ed.y??0,left:ed.x??0}}),children:[a,(0,l.jsx)(ei.i,{ref:ea,arrowX:ed.arrowX,arrowY:ed.arrowY,visible:E,position:ed.placement,arrowSize:T,arrowOffset:A,arrowRadius:I,arrowPosition:N,...eh("arrow")})]})})})})}let eg=em.props,eb=(0,ee.pc)(ed.reference,(0,en.x)(em),t),ev=ec(P,{duration:100,transition:"fade"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(es.r,{...J,withinPortal:b,children:(0,l.jsx)(O.e,{...ev,keepMounted:U,mounted:!L&&!!ed.opened,duration:ed.isGroupPhase?10:ev.duration,children:e=>(0,l.jsxs)(p.a,{...Q,"data-fixed":"fixed"===q||void 0,variant:V,mod:[{multiline:_},G],...ed.getFloatingProps({ref:ed.floating,className:eh("tooltip").className,style:{...eh("tooltip").style,...e,zIndex:R,top:ed.y??0,left:ed.x??0}}),children:[a,(0,l.jsx)(ei.i,{ref:ea,arrowX:ed.arrowX,arrowY:ed.arrowY,visible:E,position:ed.placement,arrowSize:T,arrowOffset:A,arrowRadius:I,arrowPosition:N,...eh("arrow")})]})})}),(0,s.cloneElement)(em,ed.getReferenceProps({onClick:$,onMouseEnter:F,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...eg,className:(0,M.A)(S,eg.className),[i]:eb}))]})});eT.classes=ef,eT.displayName="@mantine/core/Tooltip",eT.Floating=eb,eT.Group=ew;var eA=n(18507),eI=n(2371),eN=n(48513),ej=n(60744);let[eP,e_]=(0,ej.e)();function eB(e){let{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=(0,d.Y)("ChipGroup",null,e),[s,a]=(0,eA.Z)({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r});return(0,l.jsx)(eP,{value:{isChipSelected:e=>Array.isArray(s)?s.includes(e):e===s,onChange:e=>{let t=e.currentTarget.value;Array.isArray(s)?a(s.includes(t)?s.filter(e=>e!==t):[...s,t]):a(t)},multiple:o},children:i})}eB.displayName="@mantine/core/ChipGroup";var eO={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};let eR={type:"checkbox"},eL=(0,c.V)((e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{let l=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":(0,a.ny)(t),"--chip-size":(0,a.YC)(t,"chip-size"),"--chip-radius":void 0===n?void 0:(0,a.nJ)(n),"--chip-checked-padding":(0,a.YC)(t,"chip-checked-padding"),"--chip-padding":(0,a.YC)(t,"chip-padding"),"--chip-icon-size":(0,a.YC)(t,"chip-icon-size"),"--chip-bg":o||r?l.background:void 0,"--chip-hover":o||r?l.hover:void 0,"--chip-color":o||r?l.color:void 0,"--chip-bd":o||r?l.border:void 0,"--chip-spacing":(0,a.YC)(t,"chip-spacing")}}}),eD=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Chip",eR,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,id:h,checked:f,defaultChecked:m,onChange:g,value:b,wrapperProps:y,type:v,disabled:k,children:w,size:x,variant:C,icon:S,rootRef:E,autoContrast:M,mod:T,attributes:A,...I}=n,N=(0,u.I)({name:"Chip",classes:eO,props:n,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:A,vars:c,varsResolver:eL}),j=e_(),P=(0,eC.B)(h),{styleProps:_,rest:B}=(0,eI.j)(I),[O,R]=(0,eA.Z)({value:f,defaultValue:m,finalValue:!1,onChange:g}),L=j?{checked:j.isChipSelected(b),onChange:e=>{j.onChange(e),g?.(e.currentTarget.checked)},type:j.multiple?"checkbox":"radio"}:{},D=L.checked||O;return(0,l.jsxs)(p.a,{size:x,variant:C,ref:E,mod:T,...N("root"),..._,...y,children:[(0,l.jsx)("input",{type:v,...N("input"),checked:D,onChange:e=>R(e.currentTarget.checked),id:P,disabled:k,ref:t,value:b,...L,...B}),(0,l.jsxs)("label",{htmlFor:P,"data-checked":D||void 0,"data-disabled":k||void 0,...N("label",{variant:C||"filled"}),children:[D&&null!==S&&!1!==S&&(0,l.jsx)("span",{...N("iconWrapper"),children:void 0===S?(0,l.jsx)(eN.S,{...N("checkIcon")}):S}),(0,l.jsx)("span",{children:w})]})]})});eD.classes=eO,eD.displayName="@mantine/core/Chip",eD.Group=eB;var e$={root:"m_4081bf90"};let eF={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},ez=(0,c.V)((e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:l},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":(0,a.GY)(r),"--group-align":o,"--group-justify":i,"--group-wrap":l}})),eH=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Group",eF,e),{classNames:r,className:o,style:i,styles:c,unstyled:h,children:f,gap:m,align:g,justify:b,wrap:y,grow:v,preventGrowOverflow:k,vars:w,variant:x,__size:C,mod:S,attributes:E,...M}
1=n,T=s.Children.toArray(f).filter(Boolean),A=T.length,I=(0,a.GY)(m??"md"),N=`calc(${100/A}% - (${I} - ${I} / ${A}))`,j=(0,u.I)({name:"Group",props:n,stylesCtx:{childWidth:N},className:o,style:i,classes:e$,classNames:r,styles:c,unstyled:h,attributes:E,vars:w,varsResolver:ez});return(0,l.jsx)(p.a,{...j("root"),ref:t,variant:x,mod:[{grow:v},S],size:C,...M,children:T})});eH.classes=e$,eH.displayName="@mantine/core/Group";var eV={root:"m_1b7284a3"};let eU=(0,c.V)((e,{radius:t,shadow:n})=>({root:{"--paper-radius":void 0===t?void 0:(0,a.nJ)(t),"--paper-shadow":(0,a.dh)(n)}})),eW=(0,k.v)((e,t)=>{let n=(0,d.Y)("Paper",null,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,withBorder:c,vars:h,radius:f,shadow:m,variant:g,mod:b,attributes:y,...v}=n,k=(0,u.I)({name:"Paper",props:n,classes:eV,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:y,vars:h,varsResolver:eU});return(0,l.jsx)(p.a,{ref:t,mod:[{"data-with-border":c},b],...k("root"),variant:g,...v})});eW.classes=eV,eW.displayName="@mantine/core/Paper";var eJ=n(7220);let[eG,eq]=(0,eJ.F)("Card component was not found in tree");var eK={root:"m_e615b15f",section:"m_599a2148"};let eY=(0,k.v)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:s,withBorder:a,inheritPadding:c,mod:u,...h}=(0,d.Y)("CardSection",null,e),f=eq();return(0,l.jsx)(p.a,{ref:t,mod:[{"with-border":a,"inherit-padding":c},u],...f.getStyles("section",{className:r,style:o,styles:i,classNames:n}),...h})});eY.classes=eK,eY.displayName="@mantine/core/CardSection";let eZ=(0,c.V)((e,{padding:t})=>({root:{"--card-padding":(0,a.GY)(t)}})),eX=(0,k.v)((e,t)=>{let n=(0,d.Y)("Card",null,e),{classNames:r,className:o,style:i,styles:a,unstyled:c,vars:p,children:h,padding:f,attributes:m,...g}=n,b=(0,u.I)({name:"Card",props:n,classes:eK,className:o,style:i,classNames:r,styles:a,unstyled:c,attributes:m,vars:p,varsResolver:eZ}),y=s.Children.toArray(h),v=y.map((e,t)=>"object"==typeof e&&e&&"type"in e&&e.type===eY?(0,s.cloneElement)(e,{"data-first-section":0===t||void 0,"data-last-section":t===y.length-1||void 0}):e);return(0,l.jsx)(eG,{value:{getStyles:b},children:(0,l.jsx)(eW,{ref:t,unstyled:c,...b("root"),...g,children:v})})});eX.classes=eK,eX.displayName="@mantine/core/Card",eX.Section=eY;var eQ={root:"m_3eebeb36",label:"m_9e365f20"};let e0={orientation:"horizontal"},e1=(0,c.V)((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?(0,y.r)(t,e):void 0,"--divider-border-style":n,"--divider-size":(0,a.YC)(r,"divider-size")}})),e2=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Divider",e0,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,color:h,orientation:f,label:m,labelPosition:g,mod:b,attributes:y,...v}=n,k=(0,u.I)({name:"Divider",classes:eQ,props:n,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:y,vars:c,varsResolver:e1});return(0,l.jsx)(p.a,{ref:t,mod:[{orientation:f,"with-label":!!m},b],...k("root"),...v,role:"separator",children:m&&(0,l.jsx)(p.a,{component:"span",mod:{position:g},...k("label"),children:m})})});e2.classes=eQ,e2.displayName="@mantine/core/Divider";var e5={root:"m_18320242","skeleton-fade":"m_299c329c"};let e3={visible:!0,animate:!0},e4=(0,c.V)((e,{width:t,height:n,radius:r,circle:o})=>({root:{"--skeleton-height":(0,E.D)(n),"--skeleton-width":o?(0,E.D)(n):(0,E.D)(t),"--skeleton-radius":o?"1000px":void 0===r?void 0:(0,a.nJ)(r)}})),e9=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Skeleton",e3,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,width:h,height:f,circle:m,visible:g,radius:b,animate:y,mod:v,attributes:k,...w}=n,x=(0,u.I)({name:"Skeleton",classes:e5,props:n,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:k,vars:c,varsResolver:e4});return(0,l.jsx)(p.a,{ref:t,...x("root"),mod:[{visible:g,animate:y},v],...w})});e9.classes=e5,e9.displayName="@mantine/core/Skeleton";let e6=(0,s.createContext)(null),e7=e6.Provider;var e8={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};let te=(0,c.V)((e,{spacing:t})=>({group:{"--ag-spacing":(0,a.GY)(t)}})),tt=(0,h.P9)((e,t)=>{let n=(0,d.Y)("AvatarGroup",null,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,spacing:h,attributes:f,...m}=n,g=(0,u.I)({name:"AvatarGroup",classes:e8,props:n,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:f,vars:c,varsResolver:te,rootSelector:"group"});return(0,l.jsx)(e7,{value:!0,children:(0,l.jsx)(p.a,{ref:t,...g("group"),...m})})});function tn(e){return(0,l.jsx)("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.
11575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}tt.classes=e8,tt.displayName="@mantine/core/AvatarGroup";let tr=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"],to=(0,c.V)((e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:l,name:s,allowedInitialsColors:c})=>{let d="initials"===i&&"string"==typeof s?function(e,t=tr){let n=Math.abs(function(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n)|0;return t}(e))%t.length;return t[n]}(s,c):i,u=e.variantColorResolver({color:d||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:l});return{root:{"--avatar-size":(0,a.YC)(t,"avatar-size"),"--avatar-radius":void 0===n?void 0:(0,a.nJ)(n),"--avatar-bg":d||r?u.background:void 0,"--avatar-color":d||r?u.color:void 0,"--avatar-bd":d||r?u.border:void 0}}}),ti=(0,k.v)((e,t)=>{let n=(0,d.Y)("Avatar",null,e),{classNames:r,className:o,style:i,styles:a,unstyled:c,vars:h,src:f,alt:m,radius:g,color:b,gradient:y,imageProps:v,children:k,autoContrast:w,mod:x,name:C,allowedInitialsColors:S,attributes:E,...M}
1=n,T={withinGroup:!!(0,s.useContext)(e6)},[A,I]=(0,s.useState)(!f),N=(0,u.I)({name:"Avatar",props:n,classes:e8,className:o,style:i,classNames:r,styles:a,unstyled:c,attributes:E,vars:h,varsResolver:to});return(0,s.useEffect)(()=>I(!f),[f]),(0,l.jsx)(p.a,{...N("root"),mod:[{"within-group":T.withinGroup},x],ref:t,...M,children:A||!f?(0,l.jsx)("span",{...N("placeholder"),title:m,children:k||"string"==typeof C&&function(e,t=2){let n=e.split(" ");return 1===n.length?e.slice(0,t).toUpperCase():n.map(e=>e[0]).slice(0,t).join("").toUpperCase()}(C)||(0,l.jsx)(tn,{})}):(0,l.jsx)("img",{...v,...N("image"),src:f,alt:m,onError:e=>{I(!0),v?.onError?.(e)}})})});ti.classes=e8,ti.displayName="@mantine/core/Avatar",ti.Group=tt;var tl=n(42424);let ts=(0,h.P9)((e,t)=>{let n=(0,d.Y)("TextInput",null,e);return(0,l.jsx)(tl.O,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});function ta(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}ts.classes=tl.O.classes,ts.displayName="@mantine/core/TextInput";var tc=n(13494);function td({open:e,close:t,openDelay:n,closeDelay:r}){let o=(0,s.useRef)(-1),i=(0,s.useRef)(-1),l=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)};return(0,s.useEffect)(()=>l,[]),{openDropdown:()=>{l(),0===n||void 0===n?e():o.current=window.setTimeout(e,n)},closeDropdown:()=>{l(),0===r||void 0===r?t():i.current=window.setTimeout(t,r)}}}var tu=n(42931);let[tp,th]=(0,eJ.F)("Menu component was not found in the tree");var tf={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};let tm=(0,h.P9)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:s,...a}=(0,d.Y)("MenuDivider",null,e),c=th();return(0,l.jsx)(p.a,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...a}
1)});function tg(e,t){return n=>{e?.(n),t?.(n)}}tm.classes=tf,tm.displayName="@mantine/core/MenuDivider";let tb=(0,h.P9)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:c,onMouseLeave:u,onKeyDown:p,children:h,...f}=(0,d.Y)("MenuDropdown",null,e),m=(0,s.useRef)(null),g=th(),b=tg(p,e=>{("ArrowUp"===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),m.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),y=tg(c,()=>("hover"===g.trigger||"click-hover"===g.trigger)&&g.openDropdown()),v=tg(u,()=>("hover"===g.trigger||"click-hover"===g.trigger)&&g.closeDropdown());return(0,l.jsxs)(tu.A.Dropdown,{...f,onMouseEnter:y,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:(0,ee.pc)(t,m),...g.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[g.withInitialFocusPlaceholder&&(0,l.jsx)("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),h]})});function ty({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:l}){return s=>{n?.(s);let a=Array.from(ta(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>{var n;return n=s.currentTarget,ta(n,e)===ta(t,e)}),c=a.findIndex(e=>s.currentTarget===e),d=function(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e}return e}(c,a,r),u=function(e,t,n){for(let n=e-1;n>=0;n-=1)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;e-=1)if(!t[e].disabled)return e}return e}(c,a,r),p="rtl"===i?u:d,h="rtl"===i?d:u;switch(s.key){case"ArrowRight":"horizontal"===l&&(s.stopPropagation(),s.preventDefault(),a[p].focus(),o&&a[p].click());break;case"ArrowLeft":"horizontal"===l&&(s.stopPropagation(),s.preventDefault(),a[h].focus(),o&&a[h].click());break;case"ArrowUp":"vertical"===l&&(s.stopPropagation(),s.preventDefault(),a[u].focus(),o&&a[u].click());break;case"ArrowDown":"vertical"===l&&(s.stopPropagation(),s.preventDefault(),a[d].focus(),o&&a[d].click());break;case"Home":s.stopPropagation(),s.preventDefault(),a[0].disabled||a[0].focus();break;case"End":{s.stopPropagation(),s.preventDefault();let e=a.length-1;a[e].disabled||a[e].focus()}}}}tb.classes=tf,tb.displayName="@mantine/core/MenuDropdown";var tv=n(51913);let[tk,tw]=(0,ej.e)(),tx=(0,k.v)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:a,color:c,closeMenuOnClick:u,leftSection:p,rightSection:h,children:f,disabled:m,"data-disabled":g,...b}=(0,d.Y)("MenuItem",null,e),y=th(),v=tw(),k=(0,ed.xd)(),{dir:w}=(0,eo.jH)(),x=(0,s.useRef)(null),C=tg(b.onClick,()=>{!g&&("boolean"==typeof u?u&&y.closeDropdownImmediately():y.closeOnItemClick&&y.closeDropdownImmediately())}),S=c?k.variantColorResolver({color:c,theme:k,variant:"light"}):void 0,E=c?(0,tv.g)({color:c,theme:k}):null,M=tg(b.onKeyDown,e=>{"ArrowLeft"===e.key&&v&&(v.close(),v.focusParentItem())});return(0,l.jsxs)(R.N,{onMouseDown:e=>e.preventDefault(),...b,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:(0,ee.pc)(x,t),role:"menuitem",disabled:m,"data-menu-item":!0,"data-disabled":m||g||void 0,"data-mantine-stop-propagation":!0,onClick:C,onKeyDown:ty({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:y.loop,dir:w,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":E?.isThemeColor&&E?.shade===void 0?`var(--mantine-color-${E.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[p&&(0,l.jsx)("div",{...y.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:p}),f&&(0,l.jsx)("div",{...y.getStyles("itemLabel",{styles:i,classNames:n}),children:f}),h&&(0,l.jsx)("div",{...y.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:h})]})});tx.classes=tf,tx.displayName="@mantine/core/MenuItem";let tC=(0,h.P9)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:s,...a}=(0,d.Y)("MenuLabel",null,e),c=th();return(0,l.jsx)(p.a,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}
1),...a})});tC.classes=tf,tC.displayName="@mantine/core/MenuLabel";let tS=(0,h.P9)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:c,onMouseLeave:u,onKeyDown:p,children:h,...f}=(0,d.Y)("MenuSubDropdown",null,e),m=(0,s.useRef)(null),g=th(),b=tw(),y=tg(c,b?.open),v=tg(u,b?.close);return(0,l.jsx)(tu.A.Dropdown,{...f,onMouseEnter:y,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:(0,ee.pc)(t,m),...g.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:h})});function tE({style:e,size:t=16,...n}){return(0,l.jsx)("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:(0,E.D)(t),height:(0,E.D)(t),display:"block"},...n,children:(0,l.jsx)("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}tS.classes=tf,tS.displayName="@mantine/core/MenuSubDropdown",tE.displayName="@mantine/core/AccordionChevron";let tM=(0,k.v)((e,t)=>{let{classNames:n,className:r,style:o,styles:i,vars:a,color:c,leftSection:u,rightSection:p,children:h,disabled:f,"data-disabled":m,closeMenuOnClick:g,...b}=(0,d.Y)("MenuSubItem",null,e),y=th(),v=tw(),k=(0,ed.xd)(),{dir:w}=(0,eo.jH)(),x=(0,s.useRef)(null),C=c?k.variantColorResolver({color:c,theme:k,variant:"light"}):void 0,S=c?(0,tv.g)({color:c,theme:k}):null,E=tg(b.onKeyDown,e=>{"ArrowRight"===e.key&&(v?.open(),v?.focusFirstItem()),"ArrowLeft"===e.key&&v?.parentContext&&(v.parentContext.close(),v.parentContext.focusParentItem())}),M=tg(b.onClick,()=>{!m&&g&&y.closeDropdownImmediately()}),T=tg(b.onMouseEnter,v?.open),A=tg(b.onMouseLeave,v?.close);return(0,l.jsxs)(R.N,{onMouseDown:e=>e.preventDefault(),...b,unstyled:y.unstyled,tabIndex:y.menuItemTabIndex,...y.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:(0,ee.pc)(x,t),role:"menuitem",disabled:f,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":f||m||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:T,onMouseLeave:A,onClick:M,onKeyDown:ty({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:y.loop,dir:w,orientation:"vertical",onKeyDown:E}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:C?.color,"--menu-item-hover":C?.hover},children:[u&&(0,l.jsx)("div",{...y.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:u}),h&&(0,l.jsx)("div",{...y.getStyles("itemLabel",{styles:i,classNames:n}),children:h}),(0,l.jsx)("div",{...y.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:p||(0,l.jsx)(tE,{...y.getStyles("chevron"),size:14})})]})});tM.classes=tf,tM.displayName="@mantine/core/MenuSubItem";var tT=n(40772);function tA({children:e,refProp:t}){if(!(0,tT.v)(e))throw Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return th(),(0,l.jsx)(tu.A.Target,{refProp:t,popupType:"menu",children:e})}tA.displayName="@mantine/core/MenuSubTarget";let tI={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function tN(e){let{children:t,closeDelay:n,openDelay:r,...o}=(0,d.Y)("MenuSub",tI,e),i=(0,eC.B)(),[a,{open:c,close:u}]=function(e=!1,t={}){let[n,r]=(0,s.useState)(e),o=(0,s.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),i=(0,s.useCallback)(()=>{r(e=>e?(t.onClose?.(),!1):e)},[t.onClose]),l=(0,s.useCallback)(()=>{n?i():o()},[i,o,n]);return[n,{open:o,close:i,toggle:l}]}(!1),p=tw(),{openDropdown:h,closeDropdown:f}=td({open:c,close:u,closeDelay:n,openDelay:r});return(0,l.jsx)(tk,{value:{opened:a,close:f,open:h,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${i}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focu
1s()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${i}-target`)?.focus()},16),parentContext:p},children:(0,l.jsx)(tu.A,{opened:a,withinPortal:!1,withArrow:!1,id:i,...o,children:t})})}tN.extend=e=>e,tN.displayName="@mantine/core/MenuSub",tN.Target=tA,tN.Dropdown=tS,tN.Item=tM;let tj={refProp:"ref"},tP=(0,s.forwardRef)((e,t)=>{let{children:n,refProp:r,...o}=(0,d.Y)("MenuTarget",tj,e),i=(0,er.D)(n);if(!i)throw Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");let a=th(),c=i.props,u=tg(c.onClick,()=>{"click"===a.trigger?a.toggleDropdown():"click-hover"===a.trigger&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),p=tg(c.onMouseEnter,()=>("hover"===a.trigger||"click-hover"===a.trigger)&&a.openDropdown()),h=tg(c.onMouseLeave,()=>{"hover"===a.trigger?a.closeDropdown():"click-hover"!==a.trigger||a.openedViaClick||a.closeDropdown()});return(0,l.jsx)(tu.A.Target,{refProp:r,popupType:"menu",ref:t,...o,children:(0,s.cloneElement)(i,{onClick:u,onMouseEnter:p,onMouseLeave:h,"data-expanded":!!a.opened||void 0})})});tP.displayName="@mantine/core/MenuTarget";let t_={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function tB(e){let t=(0,d.Y)("Menu",t_,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:a,trapFocus:c,onChange:p,closeOnItemClick:h,loop:f,closeOnEscape:m,trigger:g,openDelay:b,closeDelay:y,classNames:v,styles:k,unstyled:w,variant:x,vars:C,menuItemTabIndex:S,keepMounted:E,withInitialFocusPlaceholder:M,attributes:T,...A}=t,I=(0,u.I)({name:"Menu",classes:tf,props:t,classNames:v,styles:k,unstyled:w,attributes:T}),[N,j]=(0,eA.Z)({value:i,defaultValue:a,finalValue:!1,onChange:p}),[P,_]=(0,s.useState)(!1),B=()=>{j(!1),_(!1),N&&o?.()},O=()=>{j(!0),N||r?.()},R=()=>{N?B():O()},{openDropdown:L,closeDropdown:D}=td({open:O,close:B,closeDelay:y,openDelay:b}),{resolvedClassNames:$,resolvedStyles:F}=(0,tc.Y)({classNames:v,styles:k,props:t});return(0,l.jsx)(tp,{value:{getStyles:I,opened:N,toggleDropdown:R,getItemIndex:e=>e?Array.from(ta(e,"[data-menu-dropdown]")?.querySelectorAll("[data-menu-item]")||[]).findIndex(t=>t===e):null,openedViaClick:P,setOpenedViaClick:_,closeOnItemClick:h,closeDropdown:"click"===g?B:D,openDropdown:"click"===g?O:L,closeDropdownImmediately:B,loop:f,trigger:g,unstyled:w,menuItemTabIndex:S,withInitialFocusPlaceholder:M},children:(0,l.jsx)(tu.A,{returnFocus:!0,...A,opened:N,onChange:R,defaultOpened:a,trapFocus:!E&&c,closeOnEscape:m,__staticSelector:"Menu",classNames:$,styles:F,unstyled:w,variant:x,keepMounted:E,children:n})})}function tO(e,t){return n=>{if("string"!=typeof n||0===n.trim().length)throw Error(t);return`${e}-${n}`}}tB.extend=e=>e,tB.withProps=(0,h.LE)(tB),tB.classes=tf,tB.displayName="@mantine/core/Menu",tB.Item=tx,tB.Label=tC,tB.Dropdown=tb,tB.Target=tP,tB.Divider=tm,tB.Sub=tN;var tR=n(27890);let[tL,tD]=(0,eJ.F)("Tabs component was not found in the tree");var t$={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};let tF=(0,h.P9)((e,t)=>{let n=(0,d.Y)("TabsList",null,e),{children:r,className:o,grow:i,justify:s,classNames:a,styles:c,style:u,mod:h,...f}=n,m=tD();return(0,l.jsx)(p.a,{...f,...m.getStyles("list",{className:o,style:u,classNames:a,styles:c,props:n,variant:m.variant}),ref:t,role:"tablist",variant:m.variant,mod:[{grow:i,orientation:m.orientation,placement:"vertical"===m.orientation&&m.placement,inverted:m.inverted},h],"aria-orientation":m.orientation,__vars:{"--tabs-justify":s},children:r})});tF.classes=t$,tF.displayName="@mantine/core/TabsList";let tz=(0,h.P9)((e,t)=>{let n=(0,d.Y)("TabsPanel",null,e),{children:r,className:o,value:i,classNames:s,styles:a,style:c,mod:u,keepMounted:h,...f}=n,m=tD(),g=m.value===i,b=m.keepMounted||h||g?r:null;return(0,l.jsx)(p.a,{...m.getStyles("panel",{className:o,classNames:s,styles:a,style:[c,g?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:m.orientation},u],role:"tabpanel",id:m.getPanelId(i),"aria-labelledby":m.getTabId(i),...f,children:b})});tz.classes=t$,tz.displayName="@mantine/core/TabsPanel";let tH=(0,h.P9)((e,t)=>{let n=(0,d.Y)("TabsTab",null,e),{className:r,children:o,rightSection:i,leftSection:s,value:a,onClick:c,onKeyDown:u,disabled:p,color:h,style:f,classNames:m,styles:g,vars:b,mod:v,tabIndex:k,...w}=n,x=(0,ed.xd)(),{dir:C}=(0,eo.jH)(),S=tD(),E=a===S.value,M={classNames:m,styles:g,props:n};return(0,l.jsxs)(R.N,{...S.getStyles("tab",{className:r,style:f,variant:S.variant,...M}),disabled:p,unstyled:S.unstyled,variant:S.variant,mod:[{active:E,disabled:p,orientation:S.orientation,inverted:S.inverted,placement:"vertical"===S.orientation&&S.placement},v],ref:t,role:"tab",id:S.getTabId(a),"aria-selected":E,tabIndex:void 0!==k?k:E||null===S.value?0:-1,"aria-controls":S.getPanelId(a),onClick:e=>{S.onChange(S.allowTabDeactivation&&a===S.value?null:a),c?.(e)},__vars:{"--tabs-color":h?(0,y.r)(h,x):void 0},onKeyDown:ty({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:S.activateTabWithKeyboard,loop:S.loop,orientation:S.orientation||"horizontal",dir:C,onKeyDown:u}),...w,children:[s&&(0,l.jsx)("span",{...S.getStyles("tabSection",M),"data-position":"left",children:s}),o&&(0,l.jsx)("span",{...S.getStyles("tabLabel",M),children:o}),i&&(0,l.jsx)("span",{...S.getStyles("tabSection",M),"data-position":"right",children:i})]})});tH.classes=t$,tH.displayName="@mantine/core/TabsTab";let tV="Tabs.Tab or Tabs.Panel component was rendered with invali
1d value or without value",tU={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},tW=(0,c.V)((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":(0,a.nJ)(t),"--tabs-color":(0,y.r)(n,e),"--tabs-text-color":("boolean"==typeof r?r:e.autoContrast)?(0,tR.w)({color:n,theme:e,autoContrast:r}):void 0}})),tJ=(0,h.P9)((e,t)=>{let n=(0,d.Y)("Tabs",tU,e),{defaultValue:r,value:o,onChange:i,orientation:s,children:a,loop:c,id:h,activateTabWithKeyboard:f,allowTabDeactivation:m,variant:g,color:b,radius:y,inverted:v,placement:k,keepMounted:w,classNames:x,styles:C,unstyled:S,className:E,style:M,vars:T,autoContrast:A,mod:I,attributes:N,...j}=n,P=(0,eC.B)(h),[_,B]=(0,eA.Z)({value:o,defaultValue:r,finalValue:null,onChange:i}),O=(0,u.I)({name:"Tabs",props:n,classes:t$,className:E,style:M,classNames:x,styles:C,unstyled:S,attributes:N,vars:T,varsResolver:tW});return(0,l.jsx)(tL,{value:{placement:k,value:_,orientation:s,id:P,loop:c,activateTabWithKeyboard:f,getTabId:tO(`${P}-tab`,tV),getPanelId:tO(`${P}-panel`,tV),onChange:B,allowTabDeactivation:m,variant:g,color:b,radius:y,inverted:v,keepMounted:w,unstyled:S,getStyles:O},children:(0,l.jsx)(p.a,{ref:t,id:P,variant:g,mod:[{orientation:s,inverted:"horizontal"===s&&v,placement:"vertical"===s&&k},I],...O("root"),...j,children:a})})});tJ.classes=t$,tJ.displayName="@mantine/core/Tabs",tJ.Tab=tH,tJ.Panel=tz,tJ.List=tF;var tG=n(18037),tq={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};let tK={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:(0,et.I)("overlay")},tY=(0,c.V)((e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}})),tZ=(0,h.P9)((e,t)=>{let n=(0,d.Y)("LoadingOverlay",tK,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,transitionProps:h,loaderProps:f,overlayProps:m,visible:g,zIndex:b,attributes:y,...v}=n,k=(0,ed.xd)(),w=(0,u.I)({name:"LoadingOverlay",classes:tq,props:n,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:y,vars:c,varsResolver:tY}),x={...tK.overlayProps,...m};return(0,l.jsx)(O.e,{transition:"fade",...h,mounted:!!g,children:e=>(0,l.jsxs)(p.a,{...w("root",{style:e}),ref:t,...v,children:[(0,l.jsx)(B,{...w("loader"),unstyled:a,...f}),(0,l.jsx)(tG.h,{...x,...w("overlay"),darkHidden:!0,unstyled:a,color:m?.color||k.white}),(0,l.jsx)(tG.h,{...x,...w("overlay"),lightHidden:!0,unstyled:a,color:m?.color||k.colors.dark[5]})]})})});tZ.classes=tq,tZ.displayName="@mantine/core/LoadingOverlay";var tX=n(62992);let tQ={multiple:!1},t0=(0,s.forwardRef)((e,t)=>{let{onChange:n,children:r,multiple:o,accept:i,name:a,form:c,resetRef:u,disabled:p,capture:h,inputProps:f,...m}=(0,d.Y)("FileButton",tQ,e),g=(0,s.useRef)(null);return(0,ee.bl)(u,()=>{g.current&&(g.current.value="")}
1),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("input",{style:{display:"none"},type:"file",accept:i,multiple:o,onChange:e=>{if(null===e.currentTarget.files)return n(o?[]:null);o?n(Array.from(e.currentTarget.files)):n(e.currentTarget.files[0]||null)},ref:(0,ee.pc)(t,g),name:a,form:c,capture:h,...f}),r({onClick:()=>{p||g.current?.click()},...m})]})});t0.displayName="@mantine/core/FileButton";var t1=n(86161);let t2={valueComponent:({value:e})=>(0,l.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(e)?e.map(e=>e.name).join(", "):e?.name}),size:"sm"},t5=(0,h.P9)((e,t)=>{let n=(0,d.Y)("FileInput",t2,e),{unstyled:r,vars:o,onChange:i,value:a,defaultValue:c,multiple:u,accept:p,name:h,form:f,valueComponent:m,clearable:g,clearButtonProps:b,readOnly:y,capture:v,fileInputProps:k,rightSection:w,size:x,placeholder:C,component:S,resetRef:E,classNames:M,styles:T,attributes:A,...I}=n,N=(0,s.useRef)(null),{resolvedClassNames:j,resolvedStyles:P}=(0,tc.Y)({classNames:M,styles:T,props:n}),[_,B]=(0,eA.Z)({value:a,defaultValue:c,onChange:i,finalValue:u?[]:null}),O=Array.isArray(_)?0!==_.length:null!==_,R=w||(g&&O&&!y?(0,l.jsx)(tX.J,{...b,variant:"subtle",onClick:()=>B(u?[]:null),size:x,unstyled:r}):null);return(0,s.useEffect)(()=>{(Array.isArray(_)&&0===_.length||null===_)&&N.current?.()},[_]),(0,l.jsx)(t0,{onChange:B,multiple:u,accept:p,name:h,form:f,resetRef:(0,ee.pc)(N,E),disabled:y,capture:v,inputProps:k,children:e=>(0,l.jsx)(tl.O,{component:S||"button",ref:t,rightSection:R,...e,...I,__staticSelector:"FileInput",multiline:!0,type:"button",pointer:!0,__stylesApiProps:n,unstyled:r,size:x,classNames:M,styles:T,attributes:A,children:O?(0,l.jsx)(m,{value:_}):(0,l.jsx)(t1.p.Placeholder,{__staticSelector:"FileInput",classNames:j,styles:P,attributes:A,children:C})})})});t5.classes=tl.O.classes,t5.displayName="@mantine/core/FileInput";var t3=n(61025),t4=n(93643),t9={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};let t6=(0,c.V)((e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:l,circle:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--badge-height":(0,a.YC)(i,"badge-height"),"--badge-padding-x":(0,a.YC)(i,"badge-padding-x"),"--badge-fz":(0,a.YC)(i,"badge-fz"),"--badge-radius":s||void 0===t?void 0:(0,a.nJ)(t),"--badge-bg":n||o?c.background:void 0,"--badge-color":n||o?c.color:void 0,"--badge-bd":n||o?c.border:void 0,"--badge-dot-color":"dot"===o?(0,y.r)(n,e):void 0}}}),t7=(0,k.v)((e,t)=>{let n=(0,d.Y)("Badge",null,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,radius:h,color:f,gradient:m,leftSection:g,rightSection:b,children:y,variant:v,fullWidth:k,autoContrast:w,circle:x,mod:C,attributes:S,...E}=n,M=(0,u.I)({name:"Badge",props:n,classes:t9,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:S,vars:c,varsResolver:t6});return(0,l.jsxs)(p.a,{variant:v,mod:[{block:k,circle:x,"with-right-section":!!b,"with-left-section":!!g},C],...M("root",{variant:v}),ref:t,...E,children:[g&&(0,l.jsx)("span",{...M("section"),"data-position":"left",children:g}),(0,l.jsx)("span",{...M("label"),children:y}),b&&(0,l.jsx)("span",{...M("section"),"data-position":"right",children:b})]})});t7.classes=t9,t7.displayName="@mantine/core/Badge";var t8=n(92248),ne=n(11455),nt=n(43689),nn=n(60572);let nr={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var no={root:"m_8bffd616"};let ni=(0,k.v)((e,t)=>{let n=(0,d.Y)("Flex",null,e),{classNames:r,className:o,style:i,styles:s,unstyled:a,vars:c,gap:h,rowGap:f,columnGap:m,align:g,justify:b,wrap:y,direction:v,attributes:k,...w}=n,x=(0,u.I)({name:"Flex",classes:no,props:n,className:o,style:i,classNames:r,styles:s,unstyled:a,attributes:k,vars:c}),C=(0,ed.xd)(),S=(0,nn.C)(),E=(0,nt.X)({styleProps:{gap:h,rowGap:f,columnGap:m,align:g,justify:b,wrap:y,direction:v},theme:C,data:nr});return(0,l.jsxs)(l.Fragment,{children:[E.hasResponsiveStyles&&(0,l.jsx)(ne.K,{selector:`.${S}`,styles:E.styles,media:E.media}),(0,l.jsx)(p.a,{ref:t,...x("root",{className:S,style:(0,t8.J)(E.inlineStyles)}),...w})]})});ni.classes=no,ni.displayName="@mantine/core/Flex";var nl=n(66629),ns=n(23168),na=n(36337),nc=n(22323),nd=n(8267),nu=(e,t,n=!1)=>((function e(r,o="--bn"){for(let i in r){let l=`${o}-${i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`;"object"==typeof r[i]?e(r[i],l):("number"==typeof r[i]&&(r[i]=`${r[i]}px`),n?t.style.removeProperty(l):t.style.setProperty(l,r[i].toString()))}})(e),[]),np={colors:{editor:{text:void 0,background:void 0},menu:{text:void 0,background:void 0},tooltip:{text:void 0,background:void 0},hovered:{text:void 0,background:void 0},selected:{text:void 0,background:void 0},disabled:{text:void 0,background:void 0},shadow:void 0,border:void 0,sideMenu:void 0,highlights:{gray:{text:void 0,background:void 0},brown:{text:void 0,background:void 0},red:{text:void 0,background:void 0},orange:{text:void 0,background:void 0},yellow:{text:void 0,background:void 0},green:{text:void 0,background:void 0},blue:{text:void 0,background:void 0},purple:{text:void 0,background:void 0},pink:{text:void 0,background:void 0}}},borderRadius:void 0,fontFamily:void 0},nh=e=>(0,l.jsxs)(b,{gap:0,className:"bn-tooltip",children:[(0,l.jsx)(S,{size:"sm",lineClamp:5,children:e.mainTooltip}),e.secondaryTooltip&&(0,l.jsx)(S,{size:"xs",lineClamp:5,children:e.secondaryTooltip})]}),nf=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,mainTooltip:i,secondaryTooltip:a,icon:c,isSelected:d,isDisabled:u,onClick:p,label:h,variant:f,...m}=e;(0,r.Bn)(m,!1);
1let[g,b]=(0,s.useState)(!1),y=o?(0,l.jsx)(W,{"aria-label":h,className:n,onMouseDown:e=>{(0,r.Ln)()&&e.currentTarget.focus()},onClick:e=>{b(!0),p?.(e)},onPointerLeave:()=>b(!1),"aria-pressed":d,"data-selected":d||void 0,"data-test":i?i.slice(0,1).toLowerCase()+i.replace(/\s+/g,"").slice(1):void 0,size:"compact"===f?"compact-xs":"xs",disabled:u||!1,ref:t,...m,children:o}):(0,l.jsx)(Q,{className:n,"aria-label":h,onMouseDown:e=>{(0,r.Ln)()&&e.currentTarget.focus()},onClick:e=>{b(!0),p?.(e)},onPointerLeave:()=>b(!1),"aria-pressed":d,"data-selected":d||void 0,"data-test":i?i.slice(0,1).toLowerCase()+i.replace(/\s+/g,"").slice(1):void 0,size:"compact"===f?20:30,disabled:u||!1,ref:t,...m,children:c});return i?(0,l.jsx)(eT,{disabled:g,withinPortal:!1,label:(0,l.jsx)(nh,{mainTooltip:i,secondaryTooltip:a}),children:y}):y}),nm=(0,s.forwardRef)((e,t)=>{let{className:n,text:o,icon:i,isSelected:a,mainTooltip:c,secondaryTooltip:d,onClick:u,onMouseEnter:p,...h}=e;(0,r.Bn)(h,!1);let[f,m]=(0,s.useState)(!1),g=(0,l.jsxs)(eD,{className:n,checked:!0===a,wrapperProps:{onMouseEnter:p,onMouseLeave:()=>m(!1),onClick:e=>{m(!0),u?.(e)}},variant:"light",icon:null,ref:t,children:[(0,l.jsx)("span",{children:i}),(0,l.jsx)("span",{children:o})]});return!c||f?g:(0,l.jsx)(eT,{refProp:"rootRef",withinPortal:!1,label:(0,l.jsx)(nh,{mainTooltip:c,secondaryTooltip:d}),children:g})}),ng=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i),(0,l.jsx)(eH,{className:n,ref:t,children:o})}),nb=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,headerText:i,selected:s,onFocus:a,onBlur:c,tabIndex:d,...u}=e;return(0,r.Bn)(u,!1),(0,l.jsxs)(eX,{className:(0,r.Rn)(n,s?"selected":""),onFocus:a,onBlur:c,tabIndex:d,ref:t,children:[i&&(0,l.jsx)(S,{className:"bn-header-text",children:i}),o]})}),ny=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i,!1),(0,l.jsx)(eX.Section,{className:n,ref:t,children:o})}),nv=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i,!1),(0,l.jsx)(e2,{className:n,label:(0,l.jsx)(S,{children:o}),ref:t})}),nk=(0,s.forwardRef)((e,t)=>{let{authorInfo:n,timeString:i,edited:s,...a}=e,c=(0,o.s)();return(0,r.Bn)(a,!1),"loading"===n?(0,l.jsxs)(eH,{children:[(0,l.jsx)(e9,{height:24,width:24}),(0,l.jsx)("div",{children:(0,l.jsx)(e9,{height:12,width:100})})]}):(0,l.jsxs)(eH,{children:[(0,l.jsx)(ti,{src:n.avatarUrl,alt:n.username,radius:"xl",size:"sm",color:"initials"}),(0,l.jsxs)(S,{fz:"sm",fw:"bold",children:[n.username,(0,l.jsxs)(S,{fz:"xs",c:"dimmed",span:!0,ml:"xs",children:[i," ",s&&`(${c.comments.edited})`]})]})]})}),nw=(0,s.forwardRef)((e,t)=>{let{className:n,showActions:o,authorInfo:a,timeString:c,edited:d,actions:u,emojiPickerOpen:p,children:h,...f}=e,{hovered:m,ref:g}=function(){let[e,t]=(0,s.useState)(!1),n=(0,s.useRef)(null),r=(0,s.useCallback)(()=>{t(!0)},[]),o=(0,s.useCallback)(()=>{t(!1)},[]);return{ref:(0,s.useCallback)(e=>{n.current&&(n.current.removeEventListener("mouseenter",r),n.current.removeEventListener("mouseleave",o)),e&&(e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",o)),n.current=e},[r,o]),hovered:e}}(),b=(0,i.Px)([t,g]);return(0,r.Bn)(f,!1),(0,l.jsxs)(eH,{pos:"relative",ref:b,className:n,children:[u&&(!0===o||void 0===o||"hover"===o&&m||p)?(0,l.jsx)(eH,{style:{position:"absolute",right:0,top:0,zIndex:10},children:u}):null,(0,l.jsx)(nk,{...e}),h]})}),nx=(0,s.forwardRef)((e,t)=>{let{className:n,autoFocus:s,onFocus:a,onBlur:c,editor:d,editable:u,...p}=e;(0,r.Bn)(p,!1);let h=(0,o.g)();return(0,l.jsx)(nQ,{autoFocus:s,className:n,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:u,theme:h?.colorSchemePreference,ref:t,onFocus:a,onBlur:c,children:(0,l.jsx)(i.T9,{formattingToolbar:nC})})}),nC=()=>(0,l.jsx)(i.PT,{blockTypeSelectItems:[],children:(0,i.Db)([]).filter(e=>"nestBlockButton"!==e.key&&"unnestBlockButton"!==e.key)}),nS=(0,s.forwardRef)((e,t)=>{let{className:n,name:o,label:i,variant:s,icon:a,value:c,autoFocus:d,placeholder:u,disabled:p,onKeyDown:h,onChange:f,onSubmit:m,autoComplete:g,"aria-activedescendant":b,rightSection:y,...v}=e;return(0,r.Bn)(v),(0,l.jsx)(ts,{size:"xs",className:(0,r.Rn)(n||"","large"===s?"bn-mt-input-large":""),ref:t,name:o,label:i,leftSection:a,value:c,autoFocus:d,"data-autofocus":d?"true":void 0,rightSection:y,placeholder:u,disabled:p,onKeyDown:h,onChange:f,onSubmit:m,autoComplete:g,"aria-activedescendant":b})}),nE=(0,s.createContext)(void 0),nM=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,icon:i,checked:s,subTrigger:a,onClick:c,...d}=e;return(0,r.Bn)(d,!1),(0,l.jsx)(a?tB.Sub.Item:tB.Item,{className:n,ref:t,leftSection:i,rightSection:s?(0,l.jsx)(eN.S,{size:10}):!1===s?(0,l.jsx)("div",{className:"bn-tick-space"}):null,onClick:c,...d,children:o})}),nT=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,sub:i,...a}=e;(0,r.Bn)(a);let c=(0,s.useContext)(nE);return(0,l.jsx)(i?tB.Sub.Dropdown:tB.Dropdown,{className:n,ref:t,onMouseOver:c?.onMenuMouseOver,onMouseLeave:c?.onMenuMouseLeave,children:o})}),nA=(0,s.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,r.Bn)(o),(0,l.jsx)(tB.Divider,{className:n,ref:t})}),nI=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i),(0,l.jsx)(tB.Label,{className:n,ref:t,children:o})}),nN=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,icon:i,onClick:s,onDragEnd:a,onDragStart:c,draggable:d,label:u,...p}=e;return(0,r.Bn)(p,!1),i?(0,l.jsx)(Q,{size:24,className:n,ref:t,onClick:s,onDragEnd:a,onDragStart:c,draggable:d,"aria-label":u,...p,children:i}):(0,l.jsx)(W,{className:n,ref:t,onClick:s,onDragEnd:a,onDragStart:c,draggable:d,"aria-label":u,...p,children:o})}),nj=(0,s.forwardRef)((e,t)=>{let{className:n,tabs:o,defaultOpenTab:i,openTab:s,setOpenTab:a,loading:c,...d}=e;return(0,r.Bn)(d),(0,l.jsx)(eH,{className:n,ref:t,children:(0,l.jsxs)(tJ,{value:s,defaultValue:i,onChange:a,children:[c&&(0,l.jsx)(tZ,{visible:c}),(0,l.jsx)(tJ.List,{children:o.map(e=>(0,l.jsx)(tJ.Tab,{"data-test":`${e.name.toLowerCase()}-tab`,value:e.name,children:e.name},e.name))}),o.map(e=>(0,l.jsx)(tJ.Panel,{value:e.name,children:e.tabPanel},e.name))]})})}),nP=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,onClick:i,label:s,...a}=e;return(0,r.Bn)(a),(0,l.jsx)(W,{size:"xs","aria-label":s,className:n,ref:t,onClick:i,...a,children:o})}),n_=(0,s.forwardRef)((e,t)=>{let{className:n,accept:o,value:i,placeholder:s,onChange:a,...c}=e;return(0,r.Bn)(c),(0,l.jsx)(t5,{size:"xs",className:n,ref:t,accept:o,value:i,placeholder:s,onChange:a,...c})}),nB=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i),(0,l.jsx)("div",{className:n,ref:t,children:o})}),nO=(0,s.forwardRef)((e,t)=>{let{className:n,value:o,placeholder:i,onKeyDown:s,onChange:a,...c}=e;return(0,r.Bn)(c),(0,l.jsx)(ts,{size:"xs","data-test":"embed-input",className:n,ref:t,value:o,placeholder:i,onKeyDown:s,onChange:a})}),nR=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,variant:i,...s}=e;return(0,r.Bn)(s),(0,l.jsx)(t4.v,{className:n,ref:t,children:o})}),nL=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i,!1),(0,l.jsx)(eH,{align:"center",gap:0,className:n,ref:t,...i,children:o})}),nD=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,icon:i,onClick:s,onDragEnd:a,onDragStart:c,draggable:d,label:u,...p}=e;return(0,r.Bn)(p,!1),i?(0,l.jsx)(Q,{size:24,className:n,ref:t,onClick:s,onDragEnd:a,onDragStart:c,draggable:d,"aria-label":u,...p,children:i}):(0,l.jsx)(W,{className:n,ref:t,onClick:s,onDragEnd:a,onDragStart:c,draggable:d,"aria-label":u,...p,children:o})}),n$=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,id:i,...s}=e;return(0,r.Bn)(s),(0,l.jsx)(b,{gap:0,className:n,ref:t,id:i,role:"listbox",children:o})}),nF=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i),(0,l.jsx)(eH,{className:n,ref:t,children:(0,l.jsx)(eH,{className:"bn-mt-suggestion-menu-item-title",children:o})})}),nz=(0,s.forwardRef)((e,t)=>{let{className:n,isSelected:o,onClick:a,item:c,id:d,...u}=e;(0,r.Bn)(u);let p=(0,s.useRef)(null);return(0,s.useEffect)(()=>{p.current&&o&&"none"!==(0,i.vZ)(p.current,p.current.closest(".bn-suggestion-menu, #ai-suggestion-menu"))&&p.current.scrollIntoView({block:"nearest"})},[o]),(0,l.jsxs)(eH,{gap:0,className:n,ref:(0,ee.Px)(t,p),id:d,role:"option",onMouseDown:e=>e.preventDefault(),onClick:a,"aria-selected":o||void 0,children:[c.icon&&(0,l.jsx)(eH,{className:"bn-mt-suggestion-menu-item-section","data-
1position":"left",children:c.icon}),(0,l.jsxs)(b,{gap:0,className:"bn-mt-suggestion-menu-item-body",children:[(0,l.jsx)(S,{className:"bn-mt-suggestion-menu-item-title",children:c.title}),(0,l.jsx)(S,{className:"bn-mt-suggestion-menu-item-subtitle",children:c.subtext})]}),c.badge&&(0,l.jsx)(eH,{"data-position":"right",className:"bn-mt-suggestion-menu-item-section",children:(0,l.jsx)(t7,{size:"xs",children:c.badge})})]})}),nH=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,...i}=e;return(0,r.Bn)(i),(0,l.jsx)(eH,{className:n,ref:t,children:o})}),nV=(0,s.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,r.Bn)(o),(0,l.jsx)("div",{ref:t,children:(0,l.jsx)(B,{className:n,type:"dots",size:16})})}),nU=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,id:i,columns:s,...a}=e;return(0,r.Bn)(a),(0,l.jsx)("div",{className:n,style:{gridTemplateColumns:`repeat(${s}, 1fr)`},ref:t,id:i,role:"grid",children:o})}),nW=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,columns:i,...s}=e;return(0,r.Bn)(s),(0,l.jsx)(eH,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:(0,l.jsx)(eH,{className:"bn-mt-suggestion-menu-item-title",children:o})})}),nJ=(0,s.forwardRef)((e,t)=>{let{className:n,isSelected:o,onClick:a,item:c,id:d,...u}=e;(0,r.Bn)(u);let p=(0,s.useRef)(null);return(0,s.useEffect)(()=>{p.current&&o&&"none"!==(0,i.vZ)(p.current,p.current.closest(".bn-grid-suggestion-menu"))&&p.current.scrollIntoView({block:"nearest"})},[o]),(0,l.jsx)("div",{className:n,ref:(0,ee.Px)(t,p),id:d,role:"option",onClick:a,"aria-selected":o||void 0,children:c.icon})}),nG=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,columns:i,...s}=e;return(0,r.Bn)(s),(0,l.jsx)("div",{style:{gridColumn:`1 / ${i+1}`},ref:t,children:(0,l.jsx)(B,{className:n,type:"dots"})})}),nq=(0,s.forwardRef)((e,t)=>{let{children:n,className:o,onMouseDown:i,onClick:s,...a}=e;return(0,r.Bn)(a,!1),(0,l.jsx)(W,{className:o,ref:t,onMouseDown:i,onClick:s,...a,children:n})}),nK=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,draggable:i,onDragStart:s,onDragEnd:a,style:c,label:d,...u}=e;return(0,r.Bn)(u,!1),(0,l.jsx)(W,{className:n,ref:t,"aria-label":d,draggable:i,onDragStart:s,onDragEnd:a,style:c,...u,children:o})}),nY=(0,s.forwardRef)((e,t)=>{let{className:n,children:o,onMouseEnter:i,onMouseLeave:a,variant:c,...d}=e;(0,r.Bn)(d);let{ref:u,focused:p}=function({onBlur:e,onFocus:t}={}){let[n,r]=(0,s.useState)(!1),o=(0,s.useRef)(!1),i=(0,s.useRef)(null),l=(0,na.c)(t),a=(0,na.c)(e),c=(0,s.useCallback)(e=>{r(e),o.current=e},[]),d=(0,s.useCallback)(e=>{o.current||(c(!0),l(e))},[]),u=(0,s.useCallback)(e=>{o.current&&!(e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement&&e.currentTarget.contains(e.relatedTarget))&&(c(!1),a(e))},[]),p=(0,s.useCallback)(e=>{e&&(i.current&&(i.current.removeEventListener("focusin",d),i.current.removeEventListener("focusout",u)),e.addEventListener("focusin",d),e.addEventListener("focusout",u),i.current=e)},[d,u]);return(0,s.useEffect)(()=>()=>{i.current&&(i.current.removeEventListener("focusin",d),i.current.removeEventListener("focusout",u))},[]),{ref:p,focused:n}}();return(0,l.jsx)(ni,{className:n,ref:(0,ee.Px)(t,u,(0,nc.r)(p)),role:"toolbar",onMouseEnter:i,onMouseLeave:a,gap:"action-toolbar"===c?2:void 0,children:o})}),nZ=(0,s.forwardRef)((e,t)=>{let{className:n,items:o,isDisabled:i,...s}=e;(0,r.Bn)(s);let a=o.filter(e=>e.isSelected)[0];return a?(0,l.jsxs)(tB,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:i,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[(0,l.jsx)(tB.Target,{children:(0,l.jsx)(W,{onMouseDown:e=>{(0,r.Ln)()&&e.currentTarget.focus()},leftSection:a.icon,rightSection:(0,l.jsx)(nd.bv7,{}),size:"xs",variant:"subtle",disabled:i,children:a.text})}),(0,l.jsx)(tB.Dropdown,{className:n,ref:t,children:o.map(e=>(0,l.jsx)(tB.Item,{onClick:e.onClick,leftSection:e.icon,rightSection:e.isSelected?(0,l.jsx)(eN.S,{size:10,className:"bn-tick-icon"}):(0,l.jsx)("div",{className:"bn-tick-space"}),disabled:e.isDisabled,children:e.text},e.text))})]}):null}),nX={FormattingToolbar:{Root:nY,Button:nf,Select:nZ},FilePanel:{Root:nj,Button:nP,FileInput:n_,TabPanel:nB,TextInput:nO},GridSuggestionMenu:{Root:nU,Item:nJ,EmptyItem:nW,Loader:nG},LinkToolbar:{Root:nY,Button:nf,Select:nZ},SideMenu:{Root:nL,Button:nD},SuggestionMenu:{Root:n$,Item:nz,EmptyItem:nF,Label:nH,Loader:nV},TableHandle:{Root:nK,ExtendButton:nq},Generic:{Badge:{Root:nm,Group:ng},Form:{Root:e=>(0,l.jsx)("div",{children:e.children}),TextInput:nS},Menu:{Root:e=>{let{children:t,onOpenChange:n,position:o,sub:i,...s}=e;return(0,r.Bn)(s),i?(0,l.jsx)(tB.Sub,{transitionProps:{duration:250,exitDelay:250},withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onChange:n,position:o,children:t}):(0,l.jsx)(tB,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onChange:n,position:o,returnFocus:!1,children:t})},Trigger:e=>{let{children:t,sub:n,...o}=e;return(0,r.Bn)(o),(0,l.jsx)(n?tB.Sub.Target:tB.Target,{children:t})}
1,Dropdown:nT,Divider:nA,Label:nI,Item:nM,Button:nN},Popover:{Root:e=>{let{open:t,onOpenChange:n,position:o,portalRoot:i,children:s,...a}=e;return(0,r.Bn)(a),(0,l.jsx)(tu.A,{middlewares:{size:{padding:20}},withinPortal:!!i,portalProps:i?{target:i}:void 0,opened:t,onChange:n,position:o,children:s})},Trigger:e=>{let{children:t,...n}=e;return(0,r.Bn)(n),(0,l.jsx)(t3.l,{children:t})},Content:nR},Toolbar:{Root:nY,Button:nf,Select:nZ}},Comments:{Comment:nw,Editor:nx,Card:nb,CardSection:ny,ExpandSectionsPrompt:nv}},nQ=e=>{let{className:t,theme:n,editor:a,...c}=e,d=(0,o.g)(),u=(0,i.dm)(),p=d?.colorSchemePreference||u,h="string"==typeof n?n:"no-preference"===p?"light":p,f=(0,s.useCallback)(e=>{if(e&&(nu(np,e,!0),"object"==typeof n)){if("light"in n&&"dark"in n)return void nu(n["dark"===p?"dark":"light"],e);return void nu(n,e)}},[p,n]);(0,s.useEffect)(()=>{if(!a.portalElement)throw Error("Portal element not found");a.portalElement.setAttribute("data-mantine-color-scheme",h),f(a.portalElement)},[a,f,h]);let m=(0,s.useContext)(nl.A$),g=(0,l.jsx)(o.c.Provider,{value:nX,children:(0,l.jsx)(i.TO,{"data-mantine-color-scheme":h,className:(0,r.Rn)("bn-mantine",t||""),theme:"object"==typeof n?void 0:n,editor:a,...c,ref:f})});return m?g:(0,l.jsx)(ns.y,{withCssVariables:!1,getRootElement:()=>void 0,children:g})},n0={colors:{editor:{text:"#3F3F3F",background:"#FFFFFF"},menu:{text:"#3F3F3F",background:"#FFFFFF"},tooltip:{text:"#3F3F3F",background:"#EFEFEF"},hovered:{text:"#3F3F3F",background:"#EFEFEF"},selected:{text:"#FFFFFF",background:"#3F3F3F"},disabled:{text:"#AFAFAF",background:"#EFEFEF"},shadow:"#CFCFCF",border:"#EFEFEF",sideMenu:"#CFCFCF",highlights:r.St},borderRadius:6,fontFamily:'"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'};r.xt,n0.borderRadius,n0.fontFamily},6648:(e,t,n)=>{n.d(t,{HT:()=>i,HV:()=>r,S2:()=>o,Si:()=>l,cy:()=>c,t8:()=>a,zN:()=>s});let r=e=>e[e.length-1],o=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},i=Array.from,l=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},s=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},a=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},c=Array.isArray},6773:(e,t,n)=>{n.d(t,{$5:()=>o,n:()=>i});let r=e=>({[Symbol.iterator](){return this},next:e}),o=(e,t)=>r(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),i=(e,t)=>r(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})},6791:(e,t,n)=>{let r;function o(){return"u">typeof window}function i(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function l(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function s(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return!!o()&&(e instanceof Node||e instanceof l(e).Node)}function c(e){return!!o()&&(e instanceof Element||e instanceof l(e).Element)}function d(e){return!!o()&&(e instanceof HTMLElement||e instanceof l(e).HTMLElement)}function u(e){return!(!o()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof l(e).ShadowRoot)}function p(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=x(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function h(e){return/^(table|td|th)$/.test(i(e))}function f(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}n.d(t,{$4:()=>S,CP:()=>C,L9:()=>x,Ll:()=>a,Lv:()=>h,Ng:()=>u,Tc:()=>k,Tf:()=>f,ZU:()=>p,_m:()=>E,ep:()=>s,eu:()=>w,gJ:()=>v,mq:()=>i,sQ:()=>y,sb:()=>d,v9:()=>function e(t,n,r){var o;void 0===n&&(n=[]),void 0===r&&(r=!0);let i=function e(t){let n=S(t);return w(n)?t.ownerDocument?t.ownerDocument.body:t.body:d(n)&&p(n)?n:e(n)}(t),s=i===(null==(o=t.ownerDocument)?void 0:o.body),a=l(i);if(!s)return n.concat(i,e(i,[],r));{let t=E(a);return n.concat(a,a.visualViewport||[],p(i)?i:[],t&&r?e(t):[])}},vq:()=>c,zk:()=>l});let m=/transform|translate|scale|rotate|perspective|filter/,g=/paint|layout|strict|content/,b=e=>!!e&&"none"!==e;function y(e){let t=c(e)?x(e):e;return b(t.transform)||b(t.translate)||b(t.scale)||b(t.rotate)||b(t.perspective)||!k()&&(b(t.backdropFilter)||b(t.filter))||m.test(t.willChange||"")||g.test(t.contain||"")}function v(e){let t=S(e);for(;d(t)&&!w(t);){if(y(t))return t;if(f(t))break;t=S(t)}return null}function k(){return null==r&&(r="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),r}function w(e){return/^(html|body|#document)$/.test(i(e))}function x(e){return l(e).getComputedStyle(e)}function C(e){return c(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function S(e){if("html"===i(e))return e;let t=e.assignedSlot||e.parentNode||u(e)&&e.host||s(e);return u(t)?t.host:t}function E(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}},7060:(e,t,n)=>{n.d(t,{B:()=>o,X:()=>i});var r=n(54826);function o(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var("))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);let{r:n,g:o,b:i}=(0,r.K)(e);return`rgba(${n}, ${o}, ${i}, ${t})`}let i=o},7220:(e,t,n)=>{n.d(t,{F:()=>i});var r=n(95155),o=n(12115);function i(e){let t=(0,o.createContext)(null);return[({children:e,value:n})=>(0,r.jsx)(t.Provider,{value:n,children:e}),()=>{let n=(0,o.useContext)(t);if(null===n)throw Error(e);return n}]}}
1,8039:(e,t,n)=>{e.exports=n(65538)},8242:(e,t,n)=>{n.d(t,{$L:()=>I,Ln:()=>m,N0:()=>T,Um:()=>A,Wg:()=>g,X9:()=>l,Ys:()=>p,dL:()=>F,jP:()=>v,n9:()=>E,oM:()=>k,zy:()=>S});var r=n(27050);class o{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class i{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&i.empty)return i.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,l=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[s+i],d=this.ranges[s+l],u=a+c;if(e<=u){let i=c?e==a?-1:e==u?1:t:t,l=a+r+(i<0?0:d);if(n)return l;let p=e==(t<0?a:u)?null:s/3+(e-a)*65536,h=e==a?2:e==u?1:4;return(t<0?e!=a:e!=u)&&(h|=8),new o(l,h,p)}r+=d-c}return n?e+r:new o(e+r,0,null)}touches(e,t){let n=0,r=65535&t,o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let l=this.ranges[t]-(this.inverted?n:0);if(l>e)break;let s=this.ranges[t+o];if(e<=l+s&&t==3*r)return!0;n+=this.ranges[t+i]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],l=i-(this.inverted?o:0),s=i+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(l,l+a,s,s+c),o+=c-a}}invert(){return new i(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?i.empty:new i(e<0?[0,-e,0]:[0,0,e])}}i.empty=new i([]);class l{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new l(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new l;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new o(e,r,null)}}let s=Object.create(null);class a{getMap(){return i.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=s[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in s)throw RangeError("Duplicate use of step JSON ID "+e);return s[e]=t,t.prototype.jsonID=e,t}}class c{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new c(e,null)}static fail(e){return new c(null,e)}static fromReplace(e,t,n,o){try{return c.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.vI)return c.fail(e.message);throw e}}}function d(e,t,n){let o=[];for(let r=0;r<e.childCount;r++){let i=e.child(r);i.content.size&&(i=i.copy(d(i.content,t,i))),i.isInline&&(i=t(i,n,r)),o.push(i)}return r.FK.fromArray(o)}class u extends a{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}
vendor: 18,270 bytes, line 1
1apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),o=n.node(n.sharedDepth(this.to)),i=new r.Ji(d(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,o),t.openStart,t.openEnd);return c.fromReplace(e,this.from,this.to,i)}invert(){return new p(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new u(t.pos,n.pos,this.mark)}merge(e){return e instanceof u&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new u(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new u(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("addMark",u);class p extends a{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.Ji(d(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return c.fromReplace(e,this.from,this.to,n)}invert(){return new u(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new p(t.pos,n.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("removeMark",p);class h extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return c.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new h(this.pos,t.marks[n]);return new h(this.pos,this.mark)}}return new f(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new h(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new h(t.pos,e.markFromJSON(t.mark))}}a.jsonID("addNodeMark",h);class f extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return c.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new h(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new f(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new f(t.pos,e.markFromJSON(t.mark))}}a.jsonID("removeNodeMark",f);class m extends a{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&b(e,this.from,this.to)?c.fail("Structure replace would overwrite content"):c.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new i([this.from,this.to-this.from,this.slice.size])}invert(e){return new m(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&m.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new m(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof m)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new m(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new m(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(t.from,t.to,r.Ji.fromJSON(e,t.slice),!!t.structure)}}m.MAP_BIAS=1,a.jsonID("replace",m);class g extends a{constructor(e,t,n,r,o,i,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=l}apply(e){if(this.structure&&(b(e,this.from,this.gapFrom)||b(e,this.gapTo,this.to)))return c.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return c.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?c.fromReplace(e,this.from,this.to,n):c.fail("Content does not fit in gap")}getMap(){return new i([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new g(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}}function b(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function y(e,t,n,o=n.contentMatch,i=!0){let l=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<l.childCount;t++){let c=l.child(t),d=a+c.nodeSize,u=o.matchType(c.type);if(u){o=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new p(a,d,c.marks[t]));if(i&&c.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,o;for(;e=t.exec(c.text);)o||(o=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new m(a+e.index,a+e.index+e[0].length,o))}}else s.push(new m(a,d,r.Ji.empty));a=d}if(!o.validEnd){let t=o.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function v(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),l=e.$from.index(n)+r,s=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(l,s,t))return n;if(0==n||i.type.spec.isolating||!((0==l||i.canReplace(l,i.childCount))&&(s==i.childCount||i.canReplace(0,s))))break;l&&(r=1),s<i.childCount&&(o=1)}return null}function k(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let l=i.length?i[0]:t;return n.canReplaceWith(r,o,l)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),l=t.contentMatch.findWrapping(i.type);if(!l)return null;let s=(l.length?l[l.length-1]:t).contentMatch;for(let e=r;s&&e<o;e++)s=s.matchType(n.child(e).type);return s&&s.validEnd?l:null}(r,t);return i?o.map(w).concat({type:t,attrs:n}).concat(i.map(w)):null}function w(e){return{type:e,attrs:null}}function x(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let l,s=/\r?\n|\r/g;for(;l=s.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+l.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function C(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function S(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,l=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!l.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let l=n.content.cutByIndex(i,n.childCount),s=r&&r[t+1];s&&(l=l.replaceChild(0,s.type.create(s.attrs)));let a=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!a.type.validContent(l))return!1}let s=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(s,s,a?a.type:o.node(i+1).type)}function E(e,t){let n=e.resolve(t),r=n.index();return M(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function M(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),l=i.type==r?e.type.schema.nodes.text:i.type;if(!(n=n.matchType(l))||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function T(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,l=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),l++,i=r.node(e).maybeChild(l)):(o=r.node(e).maybeChild(l-1),i=r.node(e+1)),o&&!o.isTextblock&&M(o,i)&&r.node(e).canReplace(l,l+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function A(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+ +(n>0),l=r.node(t),s=!1;if(1==e)s=l.canReplace(i,i,o);else{let e=l.contentMatchAt(i).findWrapping(o.firstChild.type);s=e&&l.canReplaceWith(i,i,e[0])}if(s)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function I(e,t,n=t,o=r.Ji.empty){if(t==n&&!o.size)return null;let i=e.resolve(t),l=e.resolve(n);return N(i,l,o)?new m(t,n,o):new j(i,l,o).fit()}function N(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}a.jsonID("replaceAround",g);class j{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.FK.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(e<0?this.$to:n.doc.resolve(e));if(!o)return null;let i=this.placed,l=n.depth,s=o.depth;for(;l&&s&&1==i.childCount;)i=i.firstChild.content,l--,s--;let a=new r.Ji(i,l,s);return e>-1?new g(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new m(n.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,o=(n?(e=B(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:l,match:s}=this.frontier[i],a,c=null;if(1==t&&(o?s.matchType(o.type)||(c=s.fillBefore(r.FK.from(o),!1)):e&&l.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:c};if(2==t&&o&&(a=s.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:a};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,o=B(e,t);return!!o.childCount&&!o.firstChild.isLeaf&&(this.unplaced=new r.Ji(e,t+1,Math.max(n,o.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,o=B(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new r.Ji(P(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new r.Ji(P(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let l=this.unplaced,s=n?n.content:l.content,a=l.openStart-e,c=0,d=[],{match:u,type:p}=this.frontier[t];if(o){for(let e=0;e<o.childCount;e++)d.push(o.child(e));u=u.matchFragment(o)}let h=s.size+e-(l.content.size-l.openEnd);for(;c<s.childCount;){let e=s.child(c),t=u.matchType(e.type);if(!t)break;(++c>1||0==a||e.content.size)&&(u=t,d.push(function e(t,n,o){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?o-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),o<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(r.FK.empty,!0)))),t.copy(i)}(e.mark(p.allowedMarks(e.marks)),1==c?a:0,c==s.childCount?h:-1)))}let f=c==s.childCount;f||(h=-1),this.placed=_(this.placed,t,r.FK.from(d)),this.frontier[t].match=u,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.Ji.empty:new r.Ji(P(l.content,e-1,1),e-1,h<0?l.openEnd:e-1):new r.Ji(P(l.content,e,c),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!O(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=O(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=O(e,n,r,t,!0);if(!o||o.childCount)continue t}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=_(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=_(this.placed,this.frontier.length,e))}}function P(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(P(e.firstChild.content,t-1,n)))}function _(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(_(e.lastChild.content,t-1,n)))}function B(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function O(e,t,n,r,o){let i=e.node(t),l=o?e.indexAfter(t):e.index(t);if(l==i.childCount&&!n.compatibleContent(i.type))return null;let s=r.fillBefore(i.content,!0,l);return s&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,l)?s:null}function R(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let r=e.start(o);if(r<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(r==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==r-1)&&n.push(o)}return n}class L extends a{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let o=t.type.create(n,null,t.marks);return c.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(o),0,+!t.isLeaf))}getMap(){return i.empty}invert(e){return new L(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new L(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new L(t.pos,t.attr,t.value)}}a.jsonID("attr",L);class D extends a{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return c.ok(n)}getMap(){return i.empty}invert(e){return new D(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new D(t.attr,t.value)}}a.jsonID("docAttr",D);
1let $=class extends Error{};($=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),$.prototype.constructor=$,$.prototype.name="TransformError";class F{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new $(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.Ji.empty){let o=I(this.doc,e,t,n);return o&&this.step(o),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,o){if(!o.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),l=e.doc.resolve(n);if(N(i,l,o))return e.step(new m(t,n,o));let s=R(i,l);0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let c=s.indexOf(a),d=[],u=o.openStart;for(let e=o.content,t=0;;t++){let n=e.firstChild;if(d.push(n),t==o.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){var p;let t=d[e],n=(p=t.type).spec.defining||p.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=o.openStart;t>=0;t--){let a=(t+u+1)%(o.openStart+1),p=d[a];if(p)for(let t=0;t<s.length;t++){let d=s[(t+c)%s.length],u=!0;d<0&&(u=!1,d=-d);let h=i.node(d-1),f=i.index(d-1);if(h.canReplaceWith(f,f,p.type,p.marks))return e.replace(i.before(d),u?l.after(d):n,new r.Ji(function e(t,n,o,i,l){if(n<o){let r=t.firstChild;t=t.replaceChild(0,r.copy(e(r.content,n+1,o,i,r)))}if(n>i){let e=l.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.FK.empty,!0))}return t}(o.content,0,o.openStart,a),a,o.openEnd))}}let h=e.steps.length;for(let r=s.length-1;r>=0&&(e.replace(t,n,o),!(e.steps.length>h));r--){let e=s[r];e<0||(t=i.before(e),n=l.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var o=e,i=t;if(!n.isInline&&o==i&&this.doc.resolve(o).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,o,n.type);null!=e&&(o=i=e)}return this.replaceRange(o,i,new r.Ji(r.FK.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),l=!1;for(let e=r.depth;e>i;e--)r.node(e).type.spec.isolating&&(l=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(l=!0);if(!l){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=R(r,o);for(let t=0;t<i.length;t++){let n=i[t],l=t==i.length-1;if(l&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(l||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:o,$to:i,depth:l}=t,s=o.before(l+1),a=i.after(l+1),c=s,d=a,u=r.FK.empty,p=0;for(let e=l,t=!1;e>n;e--)t||o.index(e)>
10?(t=!0,u=r.FK.from(o.node(e).copy(u)),p++):c--;let h=r.FK.empty,f=0;for(let e=l,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=r.FK.from(i.node(e).copy(h)),f++):d++;e.step(new g(c,d,s,a,new r.Ji(u.append(h),p,f),u.size-p,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let o=null,{linebreakReplacement:i}=e.doc.type.schema,l=e.doc.resolve(t-n),s=l.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?o=!1:!e&&t&&(o=!0)}let a=e.steps.length;if(!1===o){let r=e.doc.resolve(t+n);C(e,r.node(),r.before(),a)}s.inlineContent&&y(e,t+n-1,s,l.node().contentMatchAt(l.index()),null==o);let c=e.mapping.slice(a),d=c.map(t-n);if(e.step(new m(d,c.map(t+n,-1),r.Ji.empty,!0)),!0===o){let t=e.doc.resolve(d);x(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let o=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(o.size){let t=n[e].type.contentMatch.matchFragment(o);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=r.FK.from(n[e].type.create(n[e].attrs,o))}let i=t.start,l=t.end;e.step(new g(i,l,i,l,new r.Ji(o,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,o=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let l=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var s,a,c;let d,u,p="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(n,p)&&(s=i.doc,a=i.mapping.slice(l).map(t),c=n,u=(d=s.resolve(a)).index(),d.parent.canReplaceWith(u,u+1,c))){let o=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&C(i,e,t,l),y(i,i.mapping.slice(l).map(t,1),n,void 0,null===o);let s=i.mapping.slice(l),a=s.map(t,1),c=s.map(t+e.nodeSize,1);return i.step(new g(a,c,a+1,c-1,new r.Ji(r.FK.from(n.create(p,null,e.marks)),0,0),1,!0)),!0===o&&x(i,e,t,l),!1}}),this}setNodeMarkup(e,t,n=null,o){return!function(e,t,n,o,i){let l=e.doc.nodeAt(t);if(!l)throw RangeError("No node at given position");n||(n=l.type);let s=n.create(o,null,i||l.marks);if(l.isLeaf)return e.replaceWith(t,t+l.nodeSize,s);if(!n.validContent(l.content))throw RangeError("Invalid content for node type "+n.name);e.step(new g(t,t+l.nodeSize,t+1,t+l.nodeSize-1,new r.Ji(r.FK.from(s),0,0),1,!0))}(this,e,t,n,o),this}setNodeAttribute(e,t,n){return this.step(new L(e,t,n)),this}setDocAttribute(e,t){return this.step(new D(e,t)),this}addNodeMark(e,t){return this.step(new h(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof r.CU)t.isInSet(n.marks)&&this.step(new f(e,t));else{let r=n.marks,o,i=[];for(;o=t.isInSet(r);)i.push(new f(e,o)),r=o.removeFromSet(r);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return!function(e,t,n=1,o){let i=e.doc.resolve(t),l=r.FK.empty,s=r.FK.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){l=r.FK.from(i.node(e).copy(l));let t=o&&o[a];s=r.FK.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new m(t,t,new r.Ji(l.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let o,i,l,s;return r=this,l=[],s=[],r.doc.nodesBetween(e,t,(r,a,c)=>{if(!r.isInline)return;let d=r.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let c=Math.max(a,e),h=Math.min(a+r.nodeSize,t),f=n.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(f)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=h:l.push(o=new p(c,h,d[e])));i&&i.to==c?i.to=h:s.push(i=new u(c,h,n))}}),l.forEach(e=>
1r.step(e)),s.forEach(e=>r.step(e)),this}removeMark(e,t,n){var o;let i,l;return o=this,i=[],l=0,o.doc.nodesBetween(e,t,(o,s)=>{if(!o.isInline)return;l++;let a=null;if(n instanceof r.sX){let e=o.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let n=Math.min(s+o.nodeSize,t);for(let t=0;t<a.length;t++){let r=a[t],o;for(let e=0;e<i.length;e++){let t=i[e];t.step==l-1&&r.eq(i[e].style)&&(o=t)}o?(o.to=n,o.step=l):i.push({style:r,from:Math.max(s,e),to:n,step:l})}}}),i.forEach(e=>o.step(new p(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return y(this,e,t,n),this}}},8682:(e,t,n)=>{n.d(t,{Bw:()=>u,bL:()=>h,iZ:()=>d});var r=n(36158),o=n(44706),i=n(1651),l=n(87443),s=n(25775);let a=null,c=()=>{let e=a;a=null,e.forEach((e,t)=>{let n=t.state.tr,o=r.pJ.getState(t.state);o&&o.binding&&!o.binding.isDestroyed&&(e.forEach((e,t)=>{n.setMeta(t,e)}),t.dispatch(n))})},d=(e,t,n)=>{a||(a=new Map,s.wR(0,c)),l._4(a,e,l.vt).set(t,n)},u=(e,t,n)=>{if(0===e)return o.SF(t,0,0===t.length?-1:0);let r=null===t._first?null:t._first.content.type;for(;null!==r&&t!==r;){if(r instanceof o.ZQ){if(r._length>=e)return o.SF(r,e,0===t.length?-1:0);if(e-=r._length,null!==r._item&&null!==r._item.next)r=r._item.next.content.type;else{do r=null===r._item?null:r._item.parent,e--;while(r!==t&&null!==r&&null!==r._item&&null===r._item.next);null!==r&&r!==t&&(r=null===r._item?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(null!==r._first&&e<i)r=r._first.content.type,e--;else{if(1===e&&0===r._length&&i>1)return new o.QQ(null===r._item?null:r._item.id,null===r._item?o.xC(r):null,null);if(e-=i,null!==r._item&&null!==r._item.next)r=r._item.next.content.type;else{if(0===e)return r=null===r._item?r:r._item.parent,new o.QQ(null===r._item?null:r._item.id,null===r._item?o.xC(r):null,null);do r=r._item.parent,e--;while(r!==t&&null===r._item.next);r!==t&&(r=r._item.next.content.type)}}}if(null===r)throw i.Mq();if(0===e&&r.constructor!==o.ZQ&&r!==t)return p(r._item.parent,r._item)}return o.SF(t,t._length,0===t.length?-1:0)},p=(e,t)=>{let n=null,r=null;return null===e._item?r=o.xC(e):n=o.eg(e._item.id.client,e._item.id.clock),new o.QQ(n,r,t.id)},h=(e,t,n,r)=>{let i=o.IT(n,e);if(null===i||i.type!==t&&!o.Mp(t,i.type._item))return null;let l=i.type,s=0;if(l.constructor===o.ZQ)s=i.index;else if(null===l._item||!l._item.deleted){let e=l._first,t=0;for(;t<l._length&&t<i.index&&null!==e;){if(!e.deleted){let n=e.content.type;t++,n instanceof o.ZQ?s+=n._length:s+=r.get(n).nodeSize}e=e.right}s+=1}for(;l!==t&&null!==l._item;){let e=l._item.parent;if(null===e._item||!e._item.deleted){s+=1;let t=e._first;for(;null!==t;){let e=t.content.type;if(e===l)break;t.deleted||(e instanceof o.ZQ?s+=e._length:s+=r.get(e).nodeSize),t=t.right}}l=e}return s-1}},8750:(e,t,n)=>{n.d(t,{Af:()=>c,QV:()=>o,db:()=>a,jN:()=>s,tv:()=>d,ux:()=>u});var r=n(6648);let o=String.fromCharCode;o(65535);let i=/^\s*/g,l=/([A-Z])/g,s=(e,t)=>e.replace(l,e=>`${t}${e.toLowerCase()}`).replace(i,""),a="u">typeof TextEncoder?new TextEncoder:null,c=a?e=>a.encode(e):e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},d="u"<typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});d&&1===d.decode(new Uint8Array).length&&(d=null);let u=(e,t)=>r.t8(t,()=>e).join("")},9182:(e,t,n)=>{n.d(t,{$C:()=>u,Ib:()=>C,Jg:()=>v,VQ:()=>w,bo:()=>p,cQ:()=>k,cw:()=>f,t3:()=>g,xK:()=>x,xh:()=>h});var r=n(79274),o=n(62261),i=n(438),l=n(8750),s=n(1651);let a=s.vt("Unexpected end of array"),c=s.vt("Integer out of Range");class d{constructor(e){this.arr=e,this.pos=0}}let u=e=>new d(e),p=e=>{var t;let n;return t=f(e),n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t),e.pos+=t,n},h=e=>e.arr[e.pos++],f=e=>{let t=0,n=1,o=e.arr.length;for(;e.pos<o;){let o=e.arr[e.pos++];if(t+=(o&r.WD)*n,n*=128,o<r.wt)return t;if(t>i.Is)throw c}throw a},m=e=>{let t=e.arr[e.pos++],n=t&r.P1,o=64,l=(t&r.D7)>0?-1:1;if((t&r.wt)==0)return l*n;let s=e.arr.length;for(;e.pos<s;){if(n+=((t=e.arr[e.pos++])&r.WD)*o,o*=128,t<r.wt)return l*n;if(n>i.Is)throw c}throw a},g=l.tv?e=>l.tv.decode(p(e)):e=>{let t=f(e);
1if(0===t)return"";{let n=String.fromCodePoint(h(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(h(e));else for(;t>0;){let r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},b=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},y=[e=>void 0,e=>null,m,e=>b(e,4).getFloat32(0,!1),e=>b(e,8).getFloat64(0,!1),e=>b(e,8).getBigInt64(0,!1),e=>!1,e=>!0,g,e=>{let t=f(e),n={};for(let r=0;r<t;r++)n[g(e)]=v(e);return n},e=>{let t=f(e),n=[];for(let r=0;r<t;r++)n.push(v(e));return n},p],v=e=>y[127-h(e)](e);class k extends d{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){0===this.count&&(this.s=this.reader(this),this.pos!==this.arr.length?this.count=f(this)+1:this.count=-1);return this.count--,this.s}}class w extends d{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=m(this);let e=o.sj(this.s);this.count=1,e&&(this.s=-this.s,this.count=f(this)+2)}return this.count--,this.s}}class x extends d{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){let e=m(this);this.diff=o.RI(e/2),this.count=1,1&e&&(this.count=f(this)+2)}return this.s+=this.diff,this.count--,this.s}}class C{constructor(e){this.decoder=new w(e),this.str=g(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}},9683:(e,t,n)=>{n.d(t,{BN:()=>h,ER:()=>f,Ej:()=>g,RK:()=>b,UE:()=>k,UU:()=>m,cY:()=>p,jD:()=>y,mG:()=>v,we:()=>u});var r=n(17294),o=n(12115),i=n(47650),l="u">typeof document?o.useLayoutEffect:function(){};function s(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!s(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!s(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function a(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function c(e,t){let n=a(e);return Math.round(t*n)/n}function d(e){let t=o.useRef(e);return l(()=>{t.current=e}),t}function u(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:u=[],platform:p,elements:{reference:h,floating:f}={},transform:m=!0,whileElementsMounted:g,open:b}=e,[y,v]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[k,w]=o.useState(u);s(k,u)||w(u);let[x,C]=o.useState(null),[S,E]=o.useState(null),M=o.useCallback(e=>{e!==N.current&&(N.current=e,C(e))},[]),T=o.useCallback(e=>{e!==j.current&&(j.current=e,E(e))},[]),A=h||x,I=f||S,N=o.useRef(null),j=o.useRef(null),P=o.useRef(y),_=null!=g,B=d(g),O=d(p),R=d(b),L=o.useCallback(()=>{if(!N.current||!j.current)return;let e={placement:t,strategy:n,middleware:k};O.current&&(e.platform=O.current),(0,r.rD)(N.current,j.current,e).then(e=>{let t={...e,isPositioned:!1!==R.current};D.current&&!s(P.current,t)&&(P.current=t,i.flushSync(()=>{v(t)}))})},[k,t,n,O,R]);l(()=>{!1===b&&P.current.isPositioned&&(P.current.isPositioned=!1,v(e=>({...e,isPositioned:!1})))},[b]);let D=o.useRef(!1);l(()=>(D.current=!0,()=>{D.current=!1}),[]),l(()=>{if(A&&(N.current=A),I&&(j.current=I),A&&I){if(B.current)return B.current(A,I,L);L()}},[A,I,L,B,_]);let $=o.useMemo(()=>({reference:N,floating:j,setReference:M,setFloating:T}),[M,T]),F=o.useMemo(()=>({reference:A,floating:I}),[A,I]),z=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!F.floating)return e;let t=c(F.floating,y.x),r=c(F.floating,y.y);return m?{...e,transform:"translate("+t+"px, "+r+"px)",...a(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,m,F.floating,y.x,y.y]);return o.useMemo(()=>({...y,update:L,refs:$,elements:F,floatingStyles:z}),[y,L,$,F,z])}let p=(e,t)=>{let n=(0,r.cY)(e);return{name:n.name,fn:n.fn,options:[e,t]}},h=(e,t)=>{let n=(0,r.BN)(e);return{name:n.name,fn:n.fn,options:[e,t]}},f=(e,t)=>({fn:(0,r.ER)(e).fn,options:[e,t]}),m=(e,t)=>
1{let n=(0,r.UU)(e);return{name:n.name,fn:n.fn,options:[e,t]}},g=(e,t)=>{let n=(0,r.Ej)(e);return{name:n.name,fn:n.fn,options:[e,t]}},b=(e,t)=>{let n=(0,r.RK)(e);return{name:n.name,fn:n.fn,options:[e,t]}},y=(e,t)=>{let n=(0,r.jD)(e);return{name:n.name,fn:n.fn,options:[e,t]}},v=(e,t)=>{let n=(0,r.mG)(e);return{name:n.name,fn:n.fn,options:[e,t]}},k=(e,t)=>{let n={name:"arrow",options:e,fn(t){let{element:n,padding:o}="function"==typeof e?e(t):e;return n&&({}).hasOwnProperty.call(n,"current")?null!=n.current?(0,r.UE)({element:n.current,padding:o}).fn(t):{}:n?(0,r.UE)({element:n,padding:o}).fn(t):{}}};return{name:n.name,fn:n.fn,options:[e,t]}}},11455:(e,t,n)=>{n.d(t,{K:()=>s});var r=n(95155);n(12115);var o=n(66629),i=n(86530);function l(e){return(0,i.H)(e).reduce((t,n)=>void 0!==e[n]?`${t}${n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${e[n]};`:t,"").trim()}function s(e){let t=(0,o.WV)();return(0,r.jsx)("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:function({selector:e,styles:t,media:n,container:r}){let o=t?l(t):"",i=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${l(t.styles)}}}`):[],s=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${l(t.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${s.join("")}`.trim()}(e)}})}},12255:(e,t,n)=>{n.d(t,{nW:()=>u,xd:()=>d});var r=n(95155),o=n(12115),i=n(60806),l=n(56200);function s(e){return!(e<0)&&!(e>9)&&parseInt(e.toString(),10)===e}function a(e){if(!(e.primaryColor in e.colors))throw Error("[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more â https://mantine.dev/theming/colors/#primary-color");if("object"==typeof e.primaryShade&&(!s(e.primaryShade.dark)||!s(e.primaryShade.light))||"number"==typeof e.primaryShade&&!s(e.primaryShade))throw Error("[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }")}let c=(0,o.createContext)(null);function d(){let e=(0,o.useContext)(c);if(!e)throw Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function u({theme:e,children:t,inherit:n=!0}){let s=(0,o.useContext)(c)||i.S,d=(0,o.useMemo)(()=>(function(e,t){if(!t)return a(e),e;let n=(0,l.$)(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),a(n),n})(n?s:i.S,e),[e,s,n]);return(0,r.jsx)(c.Provider,{value:d,children:t})}u.displayName="@mantine/core/MantineThemeProvider"},12894:(e,t,n)=>{n.d(t,{K:()=>f,w:()=>h});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="u">typeof navigator&&/Mac/.test(navigator.platform),l="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),s=0;s<10;s++)r[48+s]=r[96+s]=String(s);for(var s=1;s<=24;s++)r[s+111]="F"+s;for(var s=65;s<=90;s++)r[s]=String.fromCharCode(s+32),o[s]=String.fromCharCode(s);for(var a in r)o.hasOwnProperty(a)||(o[a]=r[a]);var c=n(76865);let d="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),u="u">typeof navigator&&/Win/.test(navigator.platform);function p(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function h(e){return new c.k_({props:{handleKeyDown:f(e)}})}function f(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,o,i=e.split(/-(?!$)/),l=i[i.length-1];"Space"==l&&(l=" ");for(let e=0;e<i.length-1;e++){let l=i[e];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))d?o=!0:n=!0;else throw Error("Unrecognized modifier name: "+l)}return t&&(l="Alt-"+l),n&&(l="Ctrl-"+l),o&&(l="Meta-"+l),r&&(l="Shift-"+l),l}(n)]=e[n];return t}(e);return function(e,n){var s;let a=("Esc"==(s=!(i&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||l&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?o:r)[n.keyCode]||n.key||"Unidentified")&&(s="Escape"),"Del"==s&&(s="Delete"),"Left"==s&&(s="ArrowLeft"),"Up"==s&&(s="ArrowUp"),"Right"==s&&(s="ArrowRight"),"Down"==s&&(s="ArrowDown"),s),c,d=t[p(a,n)];if(d&&d(e.state,e.dispatch,e))return!0;
1if(1==a.length&&" "!=a){if(n.shiftKey){let r=t[p(a,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(u&&n.ctrlKey&&n.altKey)&&(c=r[n.keyCode])&&c!=a){let r=t[p(c,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},13015:(e,t,n)=>{n.d(t,{n:()=>h,r:()=>u,t:()=>p});class r{constructor(e){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),null==(t=(e=this.options).onUpdate)||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let e of this.options.deps)e instanceof r&&e.checkIfRecalculationNeededDeeply();let e=!1,t=this.lastSeenDepValues,{currDepVals:n}=this.getDepVals();for(let r=0;r<n.length;r++)if(n[r]!==t[r]){e=!0;break}e&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{for(let e of(this.unregisterFromGraph(),this._subscriptions))e()}),this.subscribe=e=>{var t,n;this.listeners.add(e);let r=null==(n=(t=this.options).onSubscribe)?void 0:n.call(t,e,this);return()=>{this.listeners.delete(e),null==r||r()}},this.options=e,this.state=e.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(e=this.options.deps){for(let t of e)if(t instanceof r)t.registerOnGraph(),this.registerOnGraph(t.options.deps);else if(t instanceof d){let e=o.get(t);e||(e=new Set,o.set(t,e)),e.add(this);let n=i.get(this);n||(n=new Set,i.set(this,n)),n.add(t)}}unregisterFromGraph(e=this.options.deps){for(let t of e)if(t instanceof r)this.unregisterFromGraph(t.options.deps);else if(t instanceof d){let e=o.get(t);e&&e.delete(this);let n=i.get(this);n&&n.delete(t)}}}let o=new WeakMap,i=new WeakMap,l={current:[]},s=!1,a=new Set,c=new Map;class d{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t,n;this.listeners.add(e);let r=null==(n=null==(t=this.options)?void 0:t.onSubscribe)?void 0:n.call(t,e,this);return()=>{this.listeners.delete(e),null==r||r()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n,d;(this.prevState=this.state,null==(t=this.options)?void 0:t.updateFn)?this.state=this.options.updateFn(this.prevState)(e):"function"==typeof e?this.state=e(this.prevState):this.state=e,null==(d=null==(n=this.options)?void 0:n.onUpdate)||d.call(n),function(e){if(a.add(e),!s)try{for(s=!0;a.size>0;){let e=Array.from(a);for(let t of(a.clear(),e)){let e=c.get(t)??t.prevState;t.prevState=e,function(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}(t)}for(let t of e){let e=o.get(t);e&&(l.current.push(t),function e(t){for(let n of Array.from(t).sort((e,t)=>e instanceof r&&e.options.deps.includes(t)?1:t instanceof r&&t.options.deps.includes(e)?-1:0)){if(l.current.includes(n))continue;l.current.push(n),n.recompute();let t=i.get(n);if(t)for(let n of t){let t=o.get(n);t&&e(t)}}}(e))}for(let t of e){let e=o.get(t);if(e)for(let t of e)!function(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}(t)}}}finally{s=!1,l.current=[],c.clear()}}(this)}}var u=Symbol("originalFactory");function p(e){if("object"==typeof e&&"key"in e)return function t(){return e[u]=t,e};if("function"!=typeof e)throw Error("factory must be a function");return function t(n){return r=>{let o=e({editor:r.editor,options:n});return o[u]=t,o}}}function h(e,t){return new d(e,t)}},13096:(e,t,n)=>{n.d(t,{KI:()=>m});var r=n(13015),o=n(32803),i=n(48863),l=n(82159),s=n(76865),a=(n(30200),n(63197)),c=n(36158),d=n(23549),u=n(44706),p=l.CU.create({name:"comment",excludes:"",inclusive:!1,keepOnSplit:!0,addAttributes:()=>({orphan:{parseHTML:e=>!!e.getAttribute("data-orphan"),renderHTML:e=>e.orphan?{"data-orphan":"true"}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute("data-bn-thread-id"),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:""}}),renderHTML:({HTMLAttributes:e})=>["span",(0,l.KV)(e,{class:"bn-thread-mark"})],parseHTML:()=>[{tag:"span.bn-thread-mark"}],extendMarkSchema:e=>"comment"===e.name?{blocknoteIgnore:!0}:{}}),h=class extends i.t{userCache=new Map;loadingUsers=new Set;constructor(e){super(),this.resolveUsers=e}async loadUsers(e){let t=e.filter(e=>!this.userCache.has(e)&&!this.loadingUsers.has(e));if(0!==t.length){for(let e of t)this.loadingUsers.add(e);try{for(let e of(await this.resolveUsers(t)))this.userCache.set(e.id,e);
1this.emit("update",this.userCache)}finally{for(let e of t)this.loadingUsers.delete(e)}}}getUser(e){return this.userCache.get(e)}subscribe(e){return this.on("update",e)}},f=new s.hs("blocknote-comments"),m=(0,r.t)(({editor:e,options:{schema:t,threadStore:n,resolveUsers:i}})=>{if(!i)throw Error("resolveUsers is required to be defined when using comments");if(!n)throw Error("threadStore is required to be defined when using comments");let l=p.name,u=new h(i),m=(0,r.n)({pendingComment:!1,selectedThreadId:void 0,threadPositions:new Map},{onUpdate(){m.state.selectedThreadId!==m.prevState.selectedThreadId&&e.transact(e=>e.setMeta(f,!0))}}),g=t=>{e.transact(e=>{e.doc.descendants((n,r)=>{n.marks.forEach(o=>{if(o.type.name===l){let i=o.type,l=o.attrs.threadId,s=t.get(l),a=!!(!s||s.resolved||s.deletedAt);if(a!==o.attrs.orphan){let t=Math.max(r,0),s=Math.min(r+n.nodeSize,e.doc.content.size-1,e.doc.content.size-1);e.removeMark(t,s,o),e.addMark(t,s,i.create({...o.attrs,orphan:a})),a&&m.state.selectedThreadId===l&&m.setState(e=>({...e,selectedThreadId:void 0}))}}})})})};return{key:"comments",store:m,runsBefore:["link"],tiptapExtensions:[p],prosemirrorPlugins:[new s.k_({key:f,state:{init:()=>({decorations:a.zF.empty}),apply(e,t){var n;let r,o=e.getMeta(f);if(!e.docChanged&&!o)return t;let i=e.docChanged?(n=e.doc,r=new Map,n.descendants((e,t)=>{e.marks.forEach(n=>{if(n.type.name===l){let o=n.attrs.threadId;if(!o)return;let i=t+e.nodeSize,l=r.get(o)??{from:1/0,to:0};r.set(o,{from:Math.min(t,l.from),to:Math.max(i,l.to)})}})}),r):m.state.threadPositions;(i.size>0||m.state.threadPositions.size>0)&&m.setState(e=>({...e,threadPositions:i}));let s=[];if(m.state.selectedThreadId){let e=i.get(m.state.selectedThreadId);e&&s.push(a.NZ.inline(e.from,e.to,{class:"bn-thread-mark-selected"}))}return{decorations:a.zF.create(e.doc,s)}}},props:{decorations:e=>f.getState(e)?.decorations??a.zF.empty,handleClick:(e,t,n)=>{if(0!==n.button)return!1;let r=e.state.doc.nodeAt(t);if(!r)return m.setState(e=>({...e,selectedThreadId:void 0})),!1;let o=r.marks.find(e=>e.type.name===l&&!0!==e.attrs.orphan);if(!o)return void 0!==m.state.selectedThreadId&&m.setState(e=>({...e,selectedThreadId:void 0})),!1;let i=o.attrs.threadId;return i!==m.state.selectedThreadId&&(m.setState(e=>({...e,selectedThreadId:i})),!0)}}})],threadStore:n,mount(){let t=n.subscribe(g);g(n.getThreads());let r=e.onSelectionChange(()=>{m.state.pendingComment&&m.setState(e=>({...e,pendingComment:!1}))});return()=>{t(),r()}},selectThread(t,n=!0){if(m.state.selectedThreadId!==t&&(m.setState(e=>({...e,pendingComment:!1,selectedThreadId:t})),t&&n)){let n=m.state.threadPositions.get(t);n&&e.prosemirrorView?.domAtPos(n.from).node?.scrollIntoView({behavior:"smooth",block:"center"})}},startPendingComment(){m.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!0})),e.domElement?.focus(),e.getExtension(o.t)?.showSelection(!0,"comments")},stopPendingComment(){m.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!1})),e.getExtension(o.t)?.showSelection(!1,"comments")},async createThread(t){let r=await n.createThread(t);if(n.addThreadToDocument){let t=e.prosemirrorView,o=t.state.selection,i=c.pJ.getState(t.state),l={prosemirror:{head:o.head,anchor:o.anchor},yjs:i?(0,d.Zr)(i.binding,t.state):void 0};await n.addThreadToDocument({threadId:r.id,selection:l})}else e._tiptapEditor.commands.setMark(l,{orphan:!1,threadId:r.id})},userStore:u,commentEditorSchema:t}})},13220:(e,t,n)=>{n.d(t,{k5:()=>d});var r=n(12115),o={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},i=r.createContext&&r.createContext(o),l=["attr","size","title"];function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?a(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e){return t=>r.createElement(u,s({attr:c({},e.attr)},t),function e(t){return t&&t.map((t,n)=>r.createElement(t.tag,c({key:n},t.attr),e(t.child)))}(e.child))}function u(e){var t=t=>{var n,o=e.attr,i=e.size,a=e.title,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,l),u=i||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),r.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,d,{className:n,style:c(c({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&r.createElement("title",null,a),e.children)};return void 0!==i?r.createElement(i.Consumer,null,e=>t(e)):t(o)}},13494:(e,t,n)=>{n.d(t,{Y:()=>l}),n(12115),n(95155);var r=n(12255),o=n(45917),i=n(31734);function l({classNames:e,styles:t,props:n,stylesCtx:s}){let a=(0,r.xd)();return{resolvedClassNames:(0,o.J)({theme:a,classNames:e,props:n,stylesCtx:s||void 0}),resolvedStyles:(0,i.N)({theme:a,styles:t,props:n,stylesCtx:s||void 0})}}},14214:(e,t,n)=>{n.d(t,{D$:()=>M,FA:()=>A,Fo:()=>u,Gu:()=>k,IO:()=>C,LH:()=>v,QJ:()=>h,Qj:()=>y,Sw:()=>I,cq:()=>S,lF:()=>d,xv:()=>c,zd:()=>f});var r=n(62261),o=n(438),i=n(79274),l=n(8750),s=n(6648);class a{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}let c=()=>new a,d=e=>{let t=c();return e(t),u(t)},u=e=>{let t=new Uint8Array((e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t})(e)),n=0;for(let r=0;r<e.bufs.length;r++){let o=e.bufs[r];t.set(o,n),n+=o.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},p=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},h=p,f=(e,t)=>{for(;t>i.WD;)p(e,i.wt|i.WD&t),t=r.RI(t/128);p(e,i.WD&t)},m=(e,t)=>{let n=r.sj(t);for(n&&(t=-t),p(e,(t>i.P1?i.wt:0)|(n?i.D7:0)|i.P1&t),t=r.RI(t/64);t>0;)p(e,(t>i.WD?i.wt:0)|i.WD&t),t=r.RI(t/128)},g=new Uint8Array(3e4),b=g.length/3,y=l.db&&l.db.encodeInto?(e,t)=>{if(t.length<b){let n=l.db.encodeInto(t,g).written||0;f(e,n);for(let t=0;t<n;t++)p(e,g[t])}else k(e,l.Af(t))}:(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;f(e,r);for(let t=0;t<r;t++)p(e,n.codePointAt(t))},v=(e,t)=>{let n=e.cbuf.length,o=e.cpos,i=r.jk(n-o,t.length),l=t.length-i;e.cbuf.set(t.subarray(0,i),o),e.cpos+=i,l>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(r.T9(2*n,l)),e.cbuf.set(t.subarray(i)),e.cpos=l)},k=(e,t)=>{f(e,t.byteLength),v(e,t)},w=(e,t)=>{let n;(n=e.cbuf.length)-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*r.T9(n,t)),e.cpos=0);let o=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,o},x=new DataView(new ArrayBuffer(4)),C=(e,t)=>{switch(typeof t){case"string":p(e,119),y(e,t);break;case"number":if(o.Fq(t)&&r.tn(t)<=i.vZ)p(e,125),m(e,t);else if(x.setFloat32(0,t),x.getFloat32(0)===t)p(e,124),w(e,4).setFloat32(0,t,!1);else p(e,123),w(e,8).setFloat64(0,t,!1);break;case"bigint":p(e,122),w(e,8).setBigInt64(0,t,!1);break;case"object":if(null===t)p(e,126);else if(s.cy(t)){p(e,117),f(e,t.length);for(let n=0;n<t.length;n++)C(e,t[n])}else if(t instanceof Uint8Array)p(e,116),k(e,t);else{p(e,118);let n=Object.keys(t);f(e,n.length);for(let r=0;r<n.length;r++){let o=n[r];y(e,o),C(e,t[o])}}break;case"boolean":p(e,t?120:121);break;default:p(e,127)}};class S extends a{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&f(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}let E=e=>{e.count>0&&(m(e.encoder,1===e.count?e.s:-e.s),e.count>1&&f(e.encoder,e.count-2))};class M{constructor(){this.encoder=new a,this.s=0,this.count=0}write(e){this.s===e?this.count++:(E(this),this.count=1,this.s=e)}toUint8Array(){return E(this),u(this.encoder)}}let T=e=>{if(e.count>0){let t=2*e.diff+ +(1!==e.count);m(e.encoder,t),e.count>1&&f(e.encoder,e.count-2)}};class A{constructor(){this.encoder=new a,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(T(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return T(this),u(this.encoder)}}class I{constructor(){this.sarr=[],this.s="",this.lensE=new M}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){let e=new a;return this.sarr.push(this.s),this.s="",y(e,this.sarr.join("")),v(e,this.lensE.toUint8Array()),u(e)}}},14267:(e,t,n)=>{n.d(t,{C:()=>F,D:()=>O,E:()=>R,O:()=>
1_,S:()=>z,T:()=>D,_:()=>q,a:()=>eN,b:()=>J,d:()=>eb,f:()=>er,g:()=>K,h:()=>Y,l:()=>ev,m:()=>X,n:()=>eO,o:()=>eA,p:()=>ee,t:()=>eL,u:()=>ey,v:()=>G,w:()=>$,x:()=>U});var r,o=n(37366),i=n(13015),l=n(27050),s=n(8242),a=n(82159),c=n(76865),d=n(30200),u=n(62921),p=n(63197),h=n(44706),f=n(76290),m=n(62261),g=n(80702);n(33867),g.c;var b=n(8682),y=n(36158);let v=(e,t,n)=>e!==t,k=e=>{let t=document.createElement("span");t.classList.add("ProseMirror-yjs-cursor"),t.setAttribute("style",`border-color: ${e.color}`);let n=document.createElement("div");n.setAttribute("style",`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode("â "),o=document.createTextNode("â ");return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(o,null),t},w=e=>({style:`background-color: ${e.color}70`,class:"ProseMirror-yjs-selection"}),x=/^#[0-9a-fA-F]{6}$/,C=(e,t,n,r,o)=>{let i=y.pJ.getState(e),l=i.doc,s=[];return null!=i.snapshot||null!=i.prevSnapshot||0===i.binding.mapping.size?p.zF.create(e.doc,[]):(t.getStates().forEac
1h((t,a)=>{if(n(l.clientID,a,t)&&null!=t.cursor){let n=t.user||{};null==n.color?n.color="#ffa500":x.test(n.color)||console.warn("A user uses an unsupported color format",n),null==n.name&&(n.name=`User: ${a}`);let c=(0,b.bL)(l,i.type,h.sH(t.cursor.anchor),i.binding.mapping),d=(0,b.bL)(l,i.type,h.sH(t.cursor.head),i.binding.mapping);if(null!==c&&null!==d){let t=m.T9(e.doc.content.size-1,0);c=m.jk(c,t),d=m.jk(d,t),s.push(p.NZ.widget(d,()=>r(n,a),{key:a+"",side:10}));let i=m.jk(c,d),l=m.T9(c,d);s.push(p.NZ.inline(i,l,o(n,a),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),p.zF.create(e.doc,s))};var S=n(23549);let E=(e,t)=>null==t?y.Mj.getState(e)?.undoManager?.canUndo():y.Mj.getState(e)?.undoManager?.undo()!=null,M=(e,t)=>null==t?y.Mj.getState(e)?.undoManager?.canRedo():y.Mj.getState(e)?.undoManager?.redo()!=null,T=new Set(["paragraph"]);var A=n(68054),I=n(59710);function N(e){let t=Array.from(e.classList).filter(e=>!e.startsWith("bn-"))||[];t.length>0?e.className=t.join(" "):e.removeAttribute("class")}function j(e,t,n,r){let i;if(!t)throw Error("blockContent is required");if("string"==typeof t)i=(0,o.At)([t],e.pmSchema,r?.blockType);else if(Array.isArray(t))i=(0,o.At)(t,e.pmSchema,r?.blockType);else if("tableContent"===t.type)i=(0,o.jt)(t,e.pmSchema);else throw new o.zn(t.type);let s=(r?.document??document).createDocumentFragment();for(let t of i)if("text"!==t.type.name&&e.schema.inlineContentSchema[t.type.name]){let i=e.schema.inlineContentSpecs[t.type.name].implementation;if(i){let l=(0,o.on)(t,e.schema.inlineContentSchema,e.schema.styleSchema),a=i.toExternalHTML?i.toExternalHTML(l,e):i.render.call({renderType:"dom",props:void 0},l,()=>{},e);if(a){if(s.appendChild(a.dom),a.contentDOM){let e=n.serializeFragment(t.content,r);a.contentDOM.dataset.editable="",a.contentDOM.appendChild(e)}continue}}}else if("text"===t.type.name){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=(e.schema.styleSpecs[r.type.name].implementation.toExternalHTML??e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=l.ZF.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}s.appendChild(n)}else{let e=n.serializeFragment(l.FK.from([t]),r);s.appendChild(e)}return 1===s.childNodes.length&&s.firstChild?.nodeType===1&&N(s.firstChild),s}var P=(e,t,n,r,o,i,l=0,s)=>{for(let a of n)!function(e,t,n,r,o,i,l,s){let a,c=s?.document??document,d=t.pmSchema.nodes.blockContainer,u=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))e in u||void 0===r.default||(u[e]=r.default);let p=Array.from((d.spec?.toDOM?.(d.create({id:n.id,...u}))).dom.attributes),h=t.blockImplementations[n.type].implementation,f=h.toExternalHTML?.call({},{...n,props:u},t,{nestingLevel:l})||h.render.call({},{...n,props:u},t),m=c.createDocumentFragment();if(f.dom.classList.contains("bn-block-content")){for(let e of[...p,...Array.from(f.dom.attributes)].filter(e=>e.name.startsWith("data")&&"data-content-type"!==e.name&&"data-file-block"!==e.name&&"data-node-view-wrapper"!==e.name&&"data-node-type"!==e.name&&"data-id"!==e.name&&"data-editable"!==e.name))f.dom.firstChild.setAttribute(e.name,e.value);N(f.dom.firstChild),l>0&&f.dom.firstChild.setAttribute("data-nesting-level",l.toString()),m.append(...Array.from(f.dom.childNodes))}else m.append(f.dom),l>0&&f.dom.setAttribute("data-nesting-level",l.toString());if(f.contentDOM&&n.content){let e=j(t,n.content,r,{...s,blockType:n.type});f.contentDOM.appendChild(e)}if(o.has(n.type)?a="OL":i.has(n.type)&&(a="UL"),a){if(e.lastChild?.nodeName!==a){let t=c.createElement(a);"OL"===a&&"start"in u&&u.start&&u?.start!==1&&t.setAttribute("start",u.start+""),e.append(t)}e.lastChild.appendChild(m)}else e.append(m);if(n.children&&n.children.length>0){let a=c.createDocumentFragment();if(P(a,t,n.children,r,o,i,l+1,s),e.lastChild?.nodeName==="UL"||e.lastChild?.nodeName==="OL")for(;a.firstChild?.nodeName==="UL"||a.firstChild?.nodeName==="OL";)e.lastChild.lastChild.appendChild(a.firstChild);"childrenDOM"in f&&f.childrenDOM?f.childrenDOM.append(a):t.pmSchema.nodes[n.type].isInGroup("blockContent")?e.append(a):f.contentDOM?.append(a)}}(e,t,a,r,o,i,l,s)},_=(e,t)=>
1{let n=l.ZF.fromSchema(e);return{exportBlocks:(e,r)=>{var o,i;let l,s=(o=new Set(["numberedListItem"]),i=new Set(["bulletListItem","checkListItem","toggleListItem"]),P(l=(r?.document??document).createDocumentFragment(),t,e,n,o,i,0,r),l),a=document.createElement("div");return a.append(s),a.innerHTML},exportInlineContent:(e,r)=>{let o=j(t,e,n,r),i=document.createElement("div");return i.append(o.cloneNode(!0)),i.innerHTML}}};function B(e){let t={},n={},r=(0,o.fn)(e);return e.descendants((i,l)=>{if(!(0,o.Ot)(i))return!0;let s=function(e,t){if(0===t)return;let n=e.resolve(t);for(let e=n.depth;e>0;e--){let t=n.node(e);if((0,o.Ot)(t))return t.attrs.id}}(e,l),a=s??"__root__";n[a]||(n[a]=[]);let c=(0,o.an)(i,r);return t[i.attrs.id]={block:c,parentId:s},n[a].push(i.attrs.id),!0}),{byId:t,childrenByParent:n}}function O(e,t=[]){let n=e.getMeta("paste")?{type:"paste"}:"drop"===e.getMeta("uiEvent")?{type:"drop"}:e.getMeta("history$")?{type:e.getMeta("history$").redo?"redo":"undo"}:e.getMeta("y-sync$")?e.getMeta("y-sync$").isUndoRedoOperation?{type:"undo-redo"}:{type:"yjs-remote"}:{type:"local"},r=(0,a.T7)(e.before,[e,...t]),o=B(r.before),i=B(r.doc),l=[],s=new Set;Object.keys(i.byId).filter(e=>!(e in o.byId)).forEach(e=>{l.push({type:"insert",block:i.byId[e].block,source:n,prevBlock:void 0}),s.add(e)}),Object.keys(o.byId).filter(e=>!(e in i.byId)).forEach(e=>{l.push({type:"delete",block:o.byId[e].block,source:n,prevBlock:void 0}),s.add(e)}),Object.keys(i.byId).filter(e=>e in o.byId).forEach(e=>{let t=o.byId[e],r=i.byId[e];t.parentId===r.parentId?A({...t.block,children:void 0},{...r.block,children:void 0})||(l.push({type:"update",block:r.block,prevBlock:t.block,source:n}),s.add(e)):(l.push({type:"move",block:r.block,prevBlock:t.block,source:n,prevParent:t.parentId?o.byId[t.parentId]?.block:void 0,currentParent:r.parentId?i.byId[r.parentId]?.block:void 0}),s.add(e))});let c=o.childrenByParent,d=i.childrenByParent,u=new Set([...Object.keys(c),...Object.keys(d)]),p=new Set;return u.forEach(e=>{let t=function(e,t){let n=new Set;if(!e||!t)return n;let r=new Set(e),o=t.filter(e=>r.has(e)),i=e.filter(e=>o.includes(e));if(i.length<=1||o.length<=1)return n;let l={};for(let e=0;e<i.length;e++)l[i[e]]=e;let s=o.map(e=>l[e]),a=s.length,c=[],d=[],u=Array(a).fill(-1),p=(e,t)=>{let n=0,r=e.length;for(;n<r;){let o=n+r>>>1;e[o]<t?n=o+1:r=o}return n};for(let e=0;e<a;e++){let t=s[e],n=p(c,t);n>0&&(u[e]=d[n-1]),n===c.length?(c.push(t),d.push(e)):(c[n]=t,d[n]=e)}let h=new Set,f=d[d.length-1]??-1;for(;-1!==f;)h.add(f),f=u[f];for(let e=0;e<o.length;e++)h.has(e)||n.add(o[e]);return n}(c[e],d[e]);0!==t.size&&t.forEach(t=>{let r=o.byId[t],a=i.byId[t];!r||!a||r.parentId===a.parentId&&(s.has(t)||(r.parentId??"__root__")===e&&(p.has(t)||(p.add(t),l.push({type:"move",block:a.block,prevBlock:r.block,source:n,prevParent:r.parentId?o.byId[r.parentId]?.block:void 0,currentParent:a.parentId?i.byId[a.parentId]?.block:void 0}),s.add(t))))})}),l}var R=(0,i.t)(()=>{let e=[];return{key:"blockChange",prosemirrorPlugins:[new c.k_({key:new c.hs("blockChange"),filterTransaction:t=>{let n;return e.reduce((e,r)=>!1===e?e:!1!==r({getChanges:()=>n||(n=O(t)),tr:t}),!0)}})],subscribe:t=>(e.push(t),()=>{e.splice(e.indexOf(t),1)})}});function L(e){let t="#"===e.charAt(0)?e.substring(1,7):e,n=[parseInt(t.substring(0,2),16)/255,parseInt(t.substring(2,4),16)/255,parseInt(t.substring(4,6),16)/255].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*n[0]+.7152*n[1]+.0722*n[2]<=.179}var D=(0,i.t)(({options:e})=>{let t=new Map,n=e.provider&&"awareness"in e.provider&&"object"==typeof e.provider.awareness?e.provider.awareness:void 0;return n&&("setLocalStateField"in n&&"function"==typeof n.setLocalStateField&&n.setLocalStateField("user",e.user),"on"in n&&"function"==typeof n.on&&"always"!==e.showCursorLabels&&n.on("change",({updated:e})=>{for(let n of e){let e=t.get(n);e&&(setTimeout(()=>{e.element.setAttribute("data-active","")},10),e.hideTimeout&&clearTimeout(e.hideTimeout),t.set(n,{element:e.element,hideTimeout:setTimeout(()=>{e.element.removeAttribute("data-active")},2e3)}))}})),{key:"yCursor",prosemirrorPlugins:[n?((e,{awarenessStateFilter:t=v,cursorBuilder:n=k,selectionBuilder:r=w,getSelection:o=e=>e.selection}={},i="cursor")=>new c.k_({key:y.S6,state:{init:(o,i)=>C(i,e,t,n,r),apply(o,i,l,s){let a=y.pJ.getState(s),c=o.getMeta(y.S6);return a&&a.isChangeOrigin||c&&c.awarenessUpdated?C(s,e,t,n,r):i.map(o.mapping,o.doc)}},props:{decorations:e=>y.S6.getState(e)},view:t=>{let n=()=>{t.docView&&(0,b.iZ)(t,y.S6,{awarenessUpdated:!0})},r=()=>{let n=y.pJ.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let l=o(t.state),s=(0,b.Bw)(l.anchor,n.type,n.binding.mapping),a=(0,b.Bw)(l.head,n.type,n.binding.mapping);null!=r.cursor&&h.uG(h.sH(r.cursor.anchor),s)&&h.uG(h.sH(r.cursor.head),a)||e.setLocalStateField(i,{anchor:s,head:a})}else null!=r.cursor&&null!==(0,b.bL)(n.doc,n.type,h.sH(r.cursor.anchor),n.binding.mapping)&&e.setLocalStateField(i,null)};return e.on("change",n),t.dom.addEventListener("focusin",r),t.dom.addEventListener("focusout",r),{update:r,destroy:()=>{t.dom.removeEventListener("focusin",r),t.dom.removeEventListener("focusout",r),e.off("change",n),e.setLocalStateField(i,null)}}}}))(n,{selectionBuilder:w,cursorBuilder(n,r){let o=t.get(r);if(!o){let i=(e.renderCursor??function(e){let t=document.createElement("span");t.classList.add("bn-collaboration-cursor__base");let n=document.createElement("span");n.setAttribute("contentedEditable","false"),n.classList.add("bn-collaboration-cursor__caret"),n.setAttribute("style",`background-color: ${e.color}; color: ${L(e.color)?"white":"black"}`);let r=document.createElement("span");return r.classList.add("bn-collaboration-cursor__label"),r.setAttribute("style",`background-color: ${e.color}; color: ${L(e.color)?"white":"black"}`),r.insertBefore(document.createTextNode(e.name),null),n.insertBefore(r,null),t.insertBefore(document.createTextNode("â "),null),t.insertBefore(n,null),t.insertBefore(document.createTextNode("â "),null),t})(n);"always"!==e.showCursorLabels&&(i.addEventListener("mouseenter",()=>{let e=t.get(r);e.element.setAttribute("data-active",""),e.hideTimeout&&(clearTimeout(e.hideTimeout),t.set(r,{element:e.element,hideTimeout:void 0}))}),i.addEventListener("mouseleave",()=>{let e=t.get(r);t.set(r,{element:e.element,hideTimeout:setTimeout(()=>{e.element.removeAttribute("data-active")},2e3)})}
1)),o={element:i,hideTimeout:void 0},t.set(r,o)}return o.element}}):void 0].filter(Boolean),dependsOn:["ySync"],updateUser(e){n?.setLocalStateField("user",e)}}}),$=(0,i.t)(({options:e})=>({key:"ySync",prosemirrorPlugins:[(0,S.YZ)(e.fragment)],runsBefore:["default"]})),F=(0,i.t)(()=>({key:"yUndo",prosemirrorPlugins:[(({protectedNodes:e=T,trackedOrigins:t=[],undoManager:n=null}={})=>new c.k_({key:y.Mj,state:{init:(r,o)=>{let i=y.pJ.getState(o),l=n||new h.ad(i.type,{trackedOrigins:new Set([y.pJ].concat(t)),deleteFilter:t=>!(t instanceof h.q7)||!(t.content instanceof h.cM)||!(t.content.type instanceof h.EY||t.content.type instanceof h.WF&&e.has(t.content.type.nodeName))||0===t.content.type._length,captureTransaction:e=>!1!==e.meta.get("addToHistory")});return{undoManager:l,prevSel:null,hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}},apply:(e,t,n,r)=>{let o=y.pJ.getState(r).binding,i=t.undoManager,l=i.undoStack.length>0,s=i.redoStack.length>0;return o?{undoManager:i,prevSel:(0,S.Zr)(o,n),hasUndoOps:l,hasRedoOps:s}:l!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:i.undoStack.length>0,hasRedoOps:i.redoStack.length>0}):t}},view:e=>{let t=y.pJ.getState(e.state),n=y.Mj.getState(e.state).undoManager;return n.on("stack-item-added",({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,y.Mj.getState(e.state).prevSel)}),n.on("stack-item-popped",({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}))()],dependsOn:["yCursor","ySync"],undoCommand:E,redoCommand:M})),z=(0,i.t)(({editor:e,options:t})=>{let n,r=(0,i.n)({isForked:!1});return{key:"yForkDoc",store:r,fork(){if(n)return;let o=t.fragment;if(!o)throw Error("No fragment to fork from");let i=new h.JA;h.QE(i,h.PR(o.doc));let l=function(e,t){let n=e.doc;if(null===e._item){let r=Array.from(n.share.keys()).find(t=>n.share.get(t)===e);if(null==r)throw Error("type does not exist in other ydoc");return t.get(r,e.constructor)}{let n=e._item,r=t.store.clients.get(n.id.client)??[];return r[h.A$(r,n.id.clock)].content.type}}(o,i);n={undoStack:y.Mj.getState(e.prosemirrorState).undoManager.undoStack,originalFragment:o,forkedFragment:l},e.unregisterExtension([F,D,$]);let s={...t,fragment:l};e.registerExtension([$(s),F()]),r.setState({isForked:!0})},merge({keepChanges:o}){if(!n)return;e.unregisterExtension(["ySync","yCursor","yUndo"]);let{originalFragment:i,forkedFragment:l,undoStack:s}=n;if(e.registerExtension([$(t),D(t),F()]),y.Mj.getState(e.prosemirrorState).undoManager.undoStack=s,o){let t=h.PR(l.doc,h.FX(i.doc));h.QE(i.doc,t,e)}n=void 0,r.setState({isForked:!1})}}}),H=(e,t)=>{t(e),e.forEach(e=>{e instanceof h.WF&&H(e,t)})},V=[(e,t)=>{let n=new Map;return e.forEach(e=>{e instanceof h.WF&&H(e,e=>{if("blockContainer"===e.nodeName&&e.hasAttribute("id")){let t=e.getAttribute("textColor"),r=e.getAttribute("backgroundColor"),i={textColor:t===o.gt.textColor.default?void 0:t,backgroundColor:r===o.gt.backgroundColor.default?void 0:r};(i.textColor||i.backgroundColor)&&n.set(e.getAttribute("id"),i)}})}),0!==n.size&&(t.doc.descendants((e,r)=>{if("blockContainer"===e.type.name&&n.has(e.attrs.id)){let o=t.doc.nodeAt(r+1);if(!o)throw Error("No element found");t.setNodeMarkup(r+1,void 0,{...o.attrs,...n.get(e.attrs.id)})}}),!0)}],U=(0,i.t)(({options:e})=>{let t=!1;return{key:"schemaMigration",prosemirrorPlugins:[new c.k_({key:new c.hs("schemaMigration"),appendTransaction:(n,r,o)=>{if(t||!n.some(e=>e.getMeta("y-sync$"))||n.every(e=>!e.docChanged)||!e.fragment.firstChild)return;let i=o.tr;for(let t of V)t(e.fragment,i);if(t=!0,i.docChanged)return i}})]}});function W(e,t){return!!e&&!!t&&!!e.closest(`.${t}`)}var J=(0,i.t)(({editor:e,options:t})=>{let n=null,r=null,o=-1,i=null,l={width:t.dropCursor?.width??5,color:t.dropCursor?.color??"#ddeeff",exclude:t.dropCursor?.exclude??"bn-drag-exclude",hooks:t.dropCursor?.hooks},a=e=>{e?.pos===n?.pos&&e?.orientation===n?.orientation||(n=e,null==e?(r&&r.parentNode&&r.parentNode.removeChild(r),r=null):c())},c=()=>{var t,o,i,s;let a,c;if(!n)return;let d=e.prosemirrorView,u=d.dom,p=u.getBoundingClientRect(),h=p.width/u.offsetWidth,f=p.height/u.offsetHeight,m=function(e,t,n,r,o){let i=e.state.doc.resolve(t.pos);if(i.parent.inlineContent||"inline"===t.orientation)return null;let l=i.nodeBefore,s=i.nodeAfter;if(!l&&!s)return null;let a="block-vertical-left"===t.orientation||"block-vertical-right"===t.orientation,c=a?t.pos:t.pos-(l?l.nodeSize:0),d=e.n
1odeDOM(c);if(!d)return null;let u=d.getBoundingClientRect();if(a){let e=n/2*r,o="block-vertical-left"===t.orientation?u.left:u.right;return{left:o-e,right:o+e,top:u.top,bottom:u.bottom}}let p=l?u.bottom:u.top;l&&s&&(p=(p+e.nodeDOM(t.pos).getBoundingClientRect().top)/2);let h=n/2*o;return{left:u.left,right:u.right,top:p-h,bottom:p+h}}(d,n,l.width,h,f)??(t=n,o=l.width,a=d.coordsAtPos(t.pos),c=o/2*h,{left:a.left-c,right:a.left+c,top:a.top,bottom:a.bottom}),g=d.dom.offsetParent;r||((r=g.appendChild(document.createElement("div"))).style.cssText="position: absolute; z-index: 50; pointer-events: none;",l.color&&(r.style.backgroundColor=l.color)),i=r,s=n.orientation,i.classList.toggle("prosemirror-dropcursor-inline","inline"===s),i.classList.toggle("prosemirror-dropcursor-block-horizontal","block-horizontal"===s),i.classList.toggle("prosemirror-dropcursor-block-vertical-left","block-vertical-left"===s),i.classList.toggle("prosemirror-dropcursor-block-vertical-right","block-vertical-right"===s),i.classList.toggle("prosemirror-dropcursor-block","block-horizontal"===s),i.classList.toggle("prosemirror-dropcursor-vertical","block-vertical-left"===s||"block-vertical-right"===s);let{parentLeft:b,parentTop:y}=function(e){if(!e||e===document.body&&"static"===getComputedStyle(e).position)return{parentLeft:-window.pageXOffset,parentTop:-window.pageYOffset};let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return{parentLeft:t.left-e.scrollLeft*n,parentTop:t.top-e.scrollTop*r}}(g);r.style.left=(m.left-b)/h+"px",r.style.top=(m.top-y)/f+"px",r.style.width=(m.right-m.left)/h+"px",r.style.height=(m.bottom-m.top)/f+"px"},d=e=>{clearTimeout(o),o=window.setTimeout(()=>a(null),e)},u=e=>{i=e.target instanceof Element?e.target:null},p=t=>{if(i&&W(i,l.exclude)||t.target instanceof Element&&W(t.target,l.exclude))return;let n=e.prosemirrorView;if(!n.editable)return;let r=n.posAtCoords({left:t.clientX,top:t.clientY}),o=r&&r.inside>=0&&n.state.doc.nodeAt(r.inside),c=o&&o.type.spec.disableDropCursor,u="function"==typeof c?c(n,r,t):c;if(r&&!u){let o=r.pos;if(n.dragging&&n.dragging.slice){let e=(0,s.Um)(n.state.doc,o,n.dragging.slice);null!=e&&(o=e)}let i=!n.state.doc.resolve(o).parent.inlineContent,c={pos:o,orientation:i?"block-horizontal":"inline"},u=c;if(l.hooks?.computeDropPosition){let r=l.hooks.computeDropPosition({editor:e,event:t,view:n,defaultPosition:c});if(null===r)return void a(null);u=r}a(u),d(5e3)}},h=t=>{t.relatedTarget instanceof Node&&e.prosemirrorView.dom.contains(t.relatedTarget)||a(null)},f=()=>{d(20)},m=()=>{d(20),i=null};return{key:"dropCursor",mount({signal:e,dom:t,root:n}){n.addEventListener("dragstart",u,{capture:!0,signal:e}),t.addEventListener("dragover",p,{signal:e}),t.addEventListener("dragleave",h,{signal:e}),t.addEventListener("drop",f,{signal:e}),t.addEventListener("dragend",m,{signal:e}),e.addEventListener("abort",()=>{clearTimeout(o),a(null)})}}}),G=(0,i.t)(()=>({key:"history",prosemirrorPlugins:[(0,I.b6)()],undoCommand:I.tN,redoCommand:I.ZS})),q=(0,i.t)(({editor:e})=>{function t(t){let n=e.getLinkMarkAtPos(t);if(n)return{range:{from:n.from,to:n.to},mark:{attrs:{href:n.href}},get text(){return n.text},get position(){return(0,a.MG)(e.prosemirrorView,n.from,n.to).toJSON()}}}return{key:"linkToolbar",getLinkAtSelection:function(){return e.transact(e=>{if(e.selection.empty)return t(e.selection.anchor)})},getLinkElementAtPos:function(t){let n=e.prosemirrorView.nodeDOM(t);for(;n&&n.parentElement;){if("A"===n.nodeName)return n;n=n.parentElement}return null},getMarkAtPos:(e,n)=>t(e),getLinkAtElement:n=>e.transact(()=>t(e.prosemirrorView.posAtDOM(n,0)+1)),editLink(t,n,r=e.transact(e=>e.selection.anchor)){e.editLink(t,n,r)},deleteLink(t=e.transact(e=>e.selection.anchor)){e.deleteLink(t)}}}),K=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],Y="https",Z=new c.hs("node-selection-keyboard"),X=(0,i.t)(()=>({key:"nodeSelectionKeyboard",prosemirrorPlugins:[new c.k_({key:Z,props:{handleKeyDown:(e,t)=>{if("node"in e.state.selection){if(t.ctrlKey||t.metaKey)return!1;if(1===t.key.length)return t.preventDefault(),!0;if("Enter"===t.key&&!t.isComposing&&!t.shiftKey&&!t.altKey&&!t.ctrlKey&&!t.metaKey){let t=e.state.tr;return e.dispatch(t.insert(e.state.tr.selection.$to.after(),e.state.schema.nodes.paragraph.createChecked()).setSelection(new c.U3(t.doc.resolve(e.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),Q=new c.hs("blocknote-placeholder"),ee=(0,i.t)(({editor:e,options:t})=>{let n=t.placeholders;return{key:"placeholder",prosemirrorPlugins:[new c.k_({key:Q,view:t=>{let r=`placeholder-selector-${(0,d.gZ)()}`;t.dom.classList.add(r);let o=document.createElement("style"),i=e._tiptapEditor.options.injectNonce;i&&o.setAttribute("nonce",i),t.root instanceof window.ShadowRoot?t.root.append(o):t.root.head.appendChild(o);let l=o.sheet,s=(e="")=>`.${r} .bn-block-content${e}:has(.ProseMirror-trailingBreak:only-child):after`;try{let{default:e,emptyDocument:t,...r}=n||{};for(let[e,t]of Object.entries(r)){let n=`[data-content-type="${e}"]`;l.insertRule(`${s(n)} { content: ${JSON.stringify(t)}; }`)}l.insertRule(`${s("[data-is-only-empty-block]")} { content: ${JSON.stringify(t)}; }`),l.insertRule(`${s("[data-is-empty-and-focused]")} { content: ${JSON.stringify(e)}; }`)}catch(e){console.warn("Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",e)}return{destroy:()=>{t.root instanceof window.ShadowRoot?t.root.removeChild(o):t.root.head.removeChild(o)}}},props:{decorations:t=>{let{doc:n,selection:r}=t;if(!e.isEditable||!r.empty||r.$from.parent.type.spec.code)return;let o=[];6===t.doc.content.size&&o.push(p.NZ.node(2,4,{"data-is-only-empty-block":"true"}));let i=r.$anchor,l=i.parent;if(0===l.content.size){let e=i.before();o.push(p.NZ.node(e,e+l.nodeSize,{"data-is-empty-and-focused":"true"}))}return p.zF.create(n,o)}}})]}}),et=new c.hs("previous-blocks"),en={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"},er=(0,i.t)(()=>{let e;return{key:"previousBlockType",prosemirrorPlugins:[new c.k_({key:et,view(t){return{update:async(t,n)=>{this.key?.getState(t.state).updatedBlocks.size>0&&(e=setTimeout(()=>{t.dispatch(t.state.tr.setMeta(et,{clearUpdate:!0}))},0))},destroy:()=>{e&&clearTimeout(e)}}},state:{init:()=>({prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}),apply(e,t,n,r){if(t.currentTransactionOldBlockAttrs={},t.updatedBlocks.clear(),!e.docChanged)return t;let o=e.changedRange();if(!o)return t;let i=e.mapping.invert(),l={from:i.map(o.from,-1),to:i.map(o.to,1)},s={},c=new Map((0,a.Nx)(n.doc,l,e=>e.attrs.id).map(e=>[e.node.attrs.id,e]));for(let e of(0,a.Nx)(r.doc,o,e=>e.attrs.id)){let o=c.get(e.node.attrs.id),i=o?.node.firstChild,l=e.node.firstChild;if(o&&i&&l){let a={index:l.attrs.index,level:l.attrs.level,type:l.type.n
1ame,depth:r.doc.resolve(e.pos).depth},c={index:i.attrs.index,level:i.attrs.level,type:i.type.name,depth:n.doc.resolve(o.pos).depth};s[e.node.attrs.id]=c,t.currentTransactionOldBlockAttrs[e.node.attrs.id]=c,(c.index!==a.index||c.level!==a.level||c.type!==a.type||c.depth!==a.depth)&&(c["depth-change"]=c.depth-a.depth,t.updatedBlocks.add(e.node.attrs.id))}}return t.prevTransactionOldBlockAttrs=s,t}},props:{decorations(e){let t=this.getState(e);if(0===t.updatedBlocks.size)return;let n=[];return e.doc.descendants((e,r)=>{if(!e.attrs.id||!t.updatedBlocks.has(e.attrs.id))return;let o=t.currentTransactionOldBlockAttrs[e.attrs.id],i={};for(let[e,t]of Object.entries(o))i["data-prev-"+en[e]]=t||"none";n.push(p.NZ.node(r,r+e.nodeSize,{...i}))}),p.zF.create(e.doc,n)}}})]}});function eo(e,t){for(;e&&e.parentElement&&e.parentElement!==t.dom&&e.getAttribute?.("data-node-type")!=="blockContainer";)e=e.parentElement;if(e.getAttribute?.("data-node-type")==="blockContainer")return{node:e,id:e.getAttribute("data-id")}}function ei(e,t){let n="",r=Array.from(e.childNodes);for(let e=0;e<r.length;e++)n+=el(r[e],t);return n}function el(e,t){if(3===e.nodeType)return e.textContent||"";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"p":let n;return r=e,o=t,n=em(r).replace(/^(\\\n)+/,"").replace(/(\\\n)+$/,""),o.inListItem?n:o.indent+n+"\n\n";case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return es(e,t);case"blockquote":var r,o,i,l,s,a,c,d,u,p,h,f,m=e,g=t;let b=Array.from(m.children).filter(e=>["p","ul","ol","pre","blockquote","table","hr"].includes(e.tagName.toLowerCase())),y;if(b.length>0){let e=[];for(let t of b)"p"===t.tagName.toLowerCase()?e.push(em(t)):e.push(el(t,{indent:"",inListItem:!1}).trim());y=e.join("\n\n")}else y=em(m);return y.split("\n").map(e=>g.indent+"> "+e).join("\n")+"\n\n";case"pre":return function(e,t){let n,r=e.querySelector("code");if(!r)return"";let o=r.getAttribute("data-language")||((n=r.className.match(/language-(\S+)/))?n[1]:"")||"",i=function e(t){let n="";for(let r of Array.from(t.childNodes))3===r.nodeType?n+=r.textContent||"":1===r.nodeType&&("br"===r.tagName.toLowerCase()?n+="\n":n+=e(r));return n}(r),l=Math.max(0,...(i.match(/`+/g)??[]).map(e=>e.length)),s="`".repeat(Math.max(3,l+1));return i?t.indent+s+o+"\n"+i+(i.endsWith("\n")?"":"\n")+s+"\n\n":t.indent+s+o+"\n"+s+"\n\n"}(e,t);case"ul":var v=e,k=t;let w="";for(let e of Array.from(v.children).filter(e=>"li"===e.tagName.toLowerCase()))w+=ea(e,"bullet",k);return k.inListItem||(w+="\n"),w;case"ol":return function(e,t){let n="",r=Array.from(e.children).filter(e=>"li"===e.tagName.toLowerCase()),o=parseInt(e.getAttribute("start")||"1",10);for(let e=0;e<r.length;e++){let i=o+e;n+=ea(r[e],"ordered",t,i)}return t.inListItem||(n+="\n"),n}(e,t);case"table":return function(e,t){let n=e.querySelector("colgroup"),r=0;n&&(r=n.querySelectorAll("col").length);let o=[],i=!1,l=e.querySelectorAll("tr"),s=[];for(let e of(l.forEach((e,t)=>{s[t]||(s[t]=[]);let n=e.querySelectorAll("th, td"),o=0;n.forEach(e=>{for(;void 0!==s[t][o];)o++;0===t&&"th"===e.tagName.toLowerCase()&&(i=!0);let n=em(e).trim().replace(/\|/g,"\\|"),r=parseInt(e.getAttribute("colspan")||"1",10),l=parseInt(e.getAttribute("rowspan")||"1",10);for(let e=0;e<l;e++)for(let i=0;i<r;i++){let r=t+e;s[r]||(s[r]=[]),s[r][o+i]=0===e&&0===i?n:""}o+=r}),s[t]&&(r=Math.max(r,s[t].length))}),s)){let t=[];for(let n=0;n<r;n++)t.push(e&&void 0!==e[n]?e[n]??"":"");o.push(t)}if(0===o.length)return"";let a=[];for(let e=0;e<r;e++){let t=3;for(let n of o)t=Math.max(t,e<n.length?n[e].length:0);a.push(Math.max(t,10))}let c="";if(i){c+=t.indent+ec(o[0],a,r)+"\n"+(t.indent+ed(a,r))+"\n";for(let e=1;e<o.length;e++)c+=t.indent+ec(o[e],a,r)+"\n"}else{let e=Array(r).fill("");for(let n of(c+=t.indent+ec(e,a,r)+"\n"+(t.indent+ed(a,r))+"\n",o))c+=t.indent+ec(n,a,r)+"\n"}return c+"\n"}(e,t);case"hr":return t.indent+"***\n\n";case"img":let x,C;return i=e,l=t,x=i.getAttribute("src")||"",C=i.getAttribute("alt")||"",x?l.indent+` 2 3`:"\n\n";case"video":let S,E;return s=e,a=t,S=s.getAttribute("src")||s.getAttribute("data-url")||"",E=s.getAttribute("data-name")||s.getAttribute("title")||"",S?a.indent+` 4 5`:"\n\n";case"audio":let M;return c=e,d=t,(M=c.getAttribute("src")||"")?d.indent+`<audio src="${ep(M)}" controls></audio> 6 7`:"\n\n";case"embed":let T;return u=e,p=t,(T=u.getAttribute("src")||"")?p.indent+`[](${T}) 8 9`:"\n\n";case"figure":let A,I,N,j,P;return h=e,f=t,A=h.querySelector("img"),I=h.querySelector("video"),N=h.querySelector("audio"),j=h.querySelector("a"),P=h.querySelector("figcaption")?.textContent?.trim()||"",A?eu("img",A.getAttribute("src")||"",A.getAttribute("alt")||"",P,f):I?eu("video",I.getAttribute("src")||I.getAttribute("data-url")||"",I.getAttribute("data-name")||I.getAttribute("title")||"",P,f):N?eu("audio",N.getAttribute("src")||"","",P,f):j?eh(j,f):"";case"a":return eh(e,t);case"details":var _=e,B=t;let O=_.querySelector("summary");if(!O)return ei(_,B);let R=O.querySelector("h1, h2, h3, h4, h5, h6");if(R){let e=es(R,B);for(let t of Array.from(_.children))t!==O&&(e+=el(t,B));return e}return ei(O,B);case"div":default:return ei(e,t);case"br":return""}}function es(e,t){let n=parseInt(e.tagName[1],10),r="#".repeat(n)+" ",o=em(e);return t.indent+r+o+"\n\n"}function ea(e,t,n,r){let o,i,l,s,a=null,c=null;for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();
9"input"===e&&"checkbox"===t.type&&(a=t),"details"===e&&(c=t)}if(a?(o=`* ${a.checked?"[x]":"[ ]"} `,i=2):"ordered"===t?i=(o=`${r}. `).length:(o="* ",i=2),c){let e=c.querySelector("summary")?.querySelector("p");s=c,l=e?em(e):""}else l=(s=function(e,t){for(let n of Array.from(e.children)){if(n===t||"input"===n.tagName.toLowerCase())continue;let e=n.tagName.toLowerCase();if("p"===e||"span"===e)return n}return null}(e,a))?em(s):"";let d=n.indent+o+l+"\n",u=n.indent+" ".repeat(i),p={indent:u,inListItem:!0};if(c){let e=c.querySelector("summary");for(let t of Array.from(c.children))t!==e&&("p"===t.tagName.toLowerCase()?d+="\n"+u+em(t)+"\n":d+=el(t,p))}for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();t!==s&&t!==a&&"input"!==e&&("ul"===e||"ol"===e?d+=el(t,p):"p"===e?d+="\n"+u+em(t)+"\n":d+="\n"+el(t,p))}return d}function ec(e,t,n){let r=[];for(let o=0;o<n;o++){let n=o<e.length?e[o]:"";r.push(" "+n.padEnd(t[o])+" ")}return"|"+r.join("|")+"|"}function ed(e,t){let n=[];for(let r=0;r<t;r++)n.push(" "+"-".repeat(e[r])+" ");return"|"+n.join("|")+"|"}function eu(e,t,n,r,o){if(!t)return"";if(!r&&"audio"!==e)return o.indent+` 10 11`;let i=n&&n!==r?"img"===e?` alt="${ep(n)}"`:"video"===e?` data-name="${ep(n)}"`:"":"",l="img"===e?`<img${i} src="${ep(t)}">`:`<${e} src="${ep(t)}"${i} controls></${e}>`,s=r?`<figcaption>${r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</figcaption>`:"";return o.indent+`<figure>${l}${s}</figure> 12 13`}function ep(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function eh(e,t){let n=e.getAttribute("href")||"",r=e.textContent?.trim()||"";return n?t.indent+ef(r,n)+"\n\n":t.indent+r+"\n\n"}function ef(e,t){return e&&e!==t?`[${e}](${t.replace(/[\\()]/g,"\\$&")})`:t}function em(e){let t="";for(let n of Array.from(e.childNodes))if(3===n.nodeType)t+=n.textContent||"";else if(1===n.nodeType)switch(n.tagName.toLowerCase()){case"strong":case"b":{let{content:e,trailing:r}=eg(em(n));e?t+=`**${e}**${r}`:t+=r;break}case"em":case"i":{let{content:e,trailing:r}=eg(em(n));e?t+=`*${e}*${r}`:t+=r;break}case"s":case"del":t+=`~~${em(n)}~~`;break;case"code":{let e=n.textContent||"",r=Math.max(0,...(e.match(/`+/g)??[]).map(e=>e.length)),o="`".repeat(r+1);t+=o+(e.startsWith("`")||e.endsWith("`")?` ${e} `:e)+o;break}case"u":case"span":case"p":default:t+=em(n);break;case"a":{let e=n.getAttribute("href")||"";t+=ef(em(n),e);break}case"br":t+="\\\n";break;case"img":{let e=n.getAttribute("src")||"",r=n.getAttribute("alt")||"";t+=``;break}case"video":{let e=n.getAttribute("src")||n.getAttribute("data-url")||"",r=n.getAttribute("data-name")||n.getAttribute("title")||"";t+=``}case"input":}return t}function eg(e){let t=e.match(/^(.*?)(\s*)$/);return t?{content:t[1],trailing:t[2]}:{content:e,trailing:""}}function eb(e){let t;return(t=document.createElement("div")).innerHTML=e,ei(t,{indent:"",inListItem:!1}).trim()+"\n"}function ey(e,t,n,r){return eb(_(t,n).exportBlocks(e,r))}function ev(e){let t=[];return e.descendants(e=>{let n=(0,o.fn)(e);
13return"blockContainer"===e.type.name&&e.firstChild?.type.name==="blockGroup"||("columnList"===e.type.name&&1===e.childCount?(e.firstChild?.forEach(e=>{t.push((0,o.an)(e,n))}),!1):!e.type.isInGroup("bnBlock")||(t.push((0,o.an)(e,n)),!1))}),t}var ek=class e extends c.LN{nodes;constructor(e,t){super(e,t);let n=e.node();this.nodes=[],e.doc.nodesBetween(e.pos,t.pos,(e,t,r)=>{if(null!==r&&r.eq(n))return this.nodes.push(e),!1})}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}content(){return new l.Ji(l.FK.from(this.nodes),0,0)}eq(t){if(!(t instanceof e)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let e=0;e<this.nodes.length;e++)if(!this.nodes[e].eq(t.nodes[e]))return!1;return!0}map(t,n){let r=n.mapResult(this.from),o=n.mapResult(this.to);return o.deleted?c.LN.near(t.resolve(r.pos)):r.deleted?c.LN.near(t.resolve(o.pos)):new e(t.resolve(r.pos),t.resolve(o.pos))}toJSON(){return{type:"multiple-node",anchor:this.anchor,head:this.head}}};function ew(e,t,n=t){t===n&&(n+=e.state.doc.resolve(t+1).node().nodeSize);let r=e.domAtPos(t).node.cloneNode(!0),o=e.domAtPos(t).node,i=(e,t)=>Array.prototype.indexOf.call(e.children,t),l=i(o,e.domAtPos(t+1).node.parentElement),s=i(o,e.domAtPos(n-1).node.parentElement);for(let e=o.childElementCount-1;e>=0;e--)(e>s||e<l)&&r.removeChild(r.children[e]);ex(e.root),(eS=r).querySelectorAll("iframe, embed, object").forEach(e=>e.parentElement?.removeChild(e));let a=e.dom.className.split(" ").filter(e=>"ProseMirror"!==e&&"bn-root"!==e&&"bn-editor"!==e).join(" ");eS.className=eS.className+" bn-drag-preview "+a,e.root instanceof ShadowRoot?e.root.appendChild(eS):e.root.body.appendChild(eS)}function ex(e){void 0!==eS&&(e instanceof ShadowRoot?e.removeChild(eS):e.body.removeChild(eS),eS=void 0)}function eC(e,t,n=!0){for(let r of e.root.elementsFromPoint(t.left,t.top))if(e.dom.contains(r))return n&&r.closest("[data-node-type=columnList]")?eC(e,{left:t.left+50,top:t.top},!1):eo(r,e)}c.LN.jsonID("multiple-node",ek);var eS,eE,eM=class{state;emitUpdate;mousePos;hoveredBlock;menuFrozen=!1;isDragOrigin=!1;constructor(e,t,n){this.editor=e,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw Error("Attempting to update uninitialized side menu");n(this.state)},this.pmView.root.addEventListener("dragstart",this.onDragStart),this.pmView.root.addEventListener("dragover",this.onDragOver),this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragend",this.onDragEnd,!0),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0)}updateState=e=>{this.state=e,this.emitUpdate(this.state)};updateStateFromMousePos=()=>{if(this.menuFrozen||!this.mousePos)return;let e=this.findClosestEditorElement({clientX:this.mousePos.x,clientY:this.mousePos.y});if(e?.element!==this.pmView.dom||e.distance>250){this.state?.show&&(this.state.show=!1,this.updateState(this.state));return}let t=function(e,t){if(!t.dom.firstChild)return;let n=t.dom.firstChild.getBoundingClientRect(),r=eC(t,{left:Math.min(Math.max(n.left+10,e.x),n.right-10),top:e.y});if(r)return eC(t,{left:r.node.getBoundingClientRect().right-10,top:e.y},!1)}(this.mousePos,this.pmView);if(!t||!this.editor.isEditable){this.state?.show&&(this.state.show=!1,this.updateState(this.state));return}if(!(this.state?.show&&this.hoveredBlock?.hasAttribute("data-id")&&this.hoveredBlock?.getAttribute("data-id")===t.id)&&(this.hoveredBlock=t.node,this.editor.isEditable)){let e=t.node.getBoundingClientRect(),n=t.node.closest("[data-node-type=column]");this.state={show:!0,referencePos:new DOMRect(n?n.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,e.y,e.width,e.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))},this.updateState(this.state)}};onDragStart=e=>{let t=e.dataTransfer?.getData("blocknote/html");if(!t||this.pmView.dragging)return;let n=document.createElement("div");n.innerHTML=t;let r=l.S4.fromSchema(this.pmView.state.schema).parse(n,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new l.Ji(r.content,0,0),move:!0}};findClosestEditorElement=e=>{let t=Array.from(this.pmView.root.querySelectorAll(".bn-editor"));if(0===t.length)return null;let n=t[0],r=Number.MAX_VALUE;return t.forEach(t=>
13{let o=t.querySelector(".bn-block-group").getBoundingClientRect(),i=Math.sqrt((e.clientX<o.left?o.left-e.clientX:e.clientX>o.right?e.clientX-o.right:0)**2+(e.clientY<o.top?o.top-e.clientY:e.clientY>o.bottom?e.clientY-o.bottom:0)**2);i<r&&(r=i,n=t)}),{element:n,distance:r}};onDragOver=e=>{if(e.synthetic||!(null!==this.pmView.dragging||this.isDragOrigin||e.dataTransfer?.types.includes("blocknote/html")||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=this.getDragEventContext(e);t&&t.isDropPoint?t.isDropPoint&&!t.isDropWithinEditorBounds&&this.dispatchSyntheticEvent(e):this.closeDropCursor()};closeDropCursor=()=>{let e=new Event("dragleave",{bubbles:!1});e.synthetic=!0,this.pmView.dom.dispatchEvent(e)};getDragEventContext=e=>{if(!(null!==this.pmView.dragging||this.isDragOrigin||e.dataTransfer?.types.includes("blocknote/html")||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=!e.dataTransfer?.types.includes("blocknote/html")&&!!this.pmView.dragging,n=!!this.isDragOrigin,r=t||n,o=this.findClosestEditorElement(e);if(!o||o.distance>250)return;let i=o.element===this.pmView.dom,l=i&&0===o.distance;if(!(!i&&!r))return{isDropPoint:i,isDropWithinEditorBounds:l,isDragOrigin:r}};onDrop=e=>{if(e.synthetic||!(null!==this.pmView.dragging||this.isDragOrigin||e.dataTransfer?.types.includes("blocknote/html")||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=this.getDragEventContext(e);if(!t)return void this.closeDropCursor();let{isDropPoint:n,isDropWithinEditorBounds:r,isDragOrigin:o}=t;if(!r&&n&&this.dispatchSyntheticEvent(e),n){if(this.pmView.dragging)return;this.pmView.dispatch(this.pmView.state.tr.setSelection(c.U3.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.anchor)));return}if(o)return void setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0)};onDragEnd=e=>{e.synthetic||(this.pmView.dragging=null)};onKeyDown=e=>{this.state?.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))};onMouseMove=e=>{if(this.menuFrozen)return;this.mousePos={x:e.clientX,y:e.clientY};let t=this.pmView.dom.getBoundingClientRect();if(this.mousePos.x>t.left&&this.mousePos.x<t.right&&this.mousePos.y>t.top&&this.mousePos.y<t.bottom&&e&&e.target&&!this.editor.isWithinEditor(e.target)){this.state?.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()};dispatchSyntheticEvent(e){let t=new Event(e.type,e),n=this.pmView.dom.firstChild.getBoundingClientRect();t.clientX=e.clientX,t.clientY=e.clientY,t.clientX=Math.min(Math.max(e.clientX,n.left),n.left+n.width),t.clientY=Math.min(Math.max(e.clientY,n.top),n.top+n.height),t.dataTransfer=e.dataTransfer,t.preventDefault=()=>e.preventDefault(),t.synthetic=!0,this.pmView.dom.dispatchEvent(t)}update(e,t){!t.doc.eq(this.pmView.state.doc)&&this.state?.show&&this.updateStateFromMousePos()}destroy(){this.state?.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragstart",this.onDragStart),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("dragend",this.onDragEnd,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}},eT=new c.hs("SideMenuPlugin"),eA=(0,i.t)(({editor:e})=>{let t,n=(0,i.n)(void 0);return{key:"sideMenu",store:n,prosemirrorPlugins:[new c.k_({key:eT,view:r=>t=new eM(e,r,e=>{n.setState({...e})})})],blockDragStart(n,r){t&&(t.isDragOrigin=!0),function(e,t,n){if(!e.dataTransfer||n.headless)return;let r=n.prosemirrorView,i=(0,o.Dt)(t.id,r.state.doc);if(!i)throw Error(`Block with ID ${t.id} not found`);let l=i.posBeforeNode;if(null!=l){let t=r.state.selection,o=r.state.doc,{from:i,to:s}=function(e,t){let n,r,o="blockContent"===t.resolve(e.from).node().type.spec.group,i="blockContent"===t.resolve(e.to).node().type.spec.group,l=Math.min(e.$anchor.depth,e.$head.depth);if(o&&i){let o=e.$from.start(l-1),i=e.$to.end(l-1);n=t.resolve(o-1).pos,r=t.resolve(i+1).pos}else n=e.from,r=e.to;return{from:n,to:r}}(t,o),a=i<=l&&l<s,d=t.$anchor.node()!==t.$head.node()||t instanceof ek;
13a&&d?(r.dispatch(r.state.tr.setSelection(ek.create(o,i,s))),ew(r,i,s)):(r.dispatch(r.state.tr.setSelection(c.nh.create(r.state.doc,l))),ew(r,l));let u=r.state.selection.content(),p=n.pmSchema,h=r.serializeForClipboard(u).dom.innerHTML,f=_(p,n),m=ev(u.content),g=f.exportBlocks(m,{}),b=eb(g);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",h),e.dataTransfer.setData("text/html",g),e.dataTransfer.setData("text/plain",b),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(eS,0,0)}}(n,r,e)},blockDragEnd(){ex(e.prosemirrorView.root),t&&(t.isDragOrigin=!1),e.blur()},freezeMenu(){t.menuFrozen=!0,t.state.show=!0,t.emitUpdate(t.state)},unfreezeMenu(){t.menuFrozen=!1,t.state.show=!1,t.emitUpdate(t.state)},hideMenuIfNotFrozen(){!t.menuFrozen&&t.state?.show&&(t.state.show=!1,t.emitUpdate(t.state))}}});async function eI(){return eE||(eE=(async()=>{let[e,t]=await Promise.all([n.e(4758).then(n.bind(n,69850)),n.e(234).then(n.t.bind(n,21263,17))]),r="default"in e?e.default:e,o="default"in t?t.default:t;return await r.init({data:o}),{emojiMart:r,emojiData:o}})())}async function eN(e,t){if(!("text"in e.schema.inlineContentSchema)||e.schema.inlineContentSchema.text!==o.r.text)return[];let{emojiData:n,emojiMart:r}=await eI();return(""===t.trim()?Object.values(n.emojis):await r.SearchIndex.search(t)).map(t=>({id:t.skins[0].native,onItemClick:()=>e.insertInlineContent(t.skins[0].native+" ")}))}function ej(e){r||((r=document.createElement("div")).innerHTML="_",r.style.opacity="0",r.style.height="1px",r.style.width="1px",e instanceof Document?e.body.appendChild(r):e.appendChild(r))}function eP(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}var e_=class{state;emitUpdate;tableId;tablePos;tableElement;menuFrozen=!1;mouseState="up";prevWasEditable=null;constructor(e,t,n){this.editor=e,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw Error("Attempting to update uninitialized image toolbar");n(this.state)},t.dom.addEventListener("mousemove",this.mouseMoveHandler),t.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),t.root.addEventListener("dragover",this.dragOverHandler),t.root.addEventListener("drop",this.dropHandler)}viewMousedownHandler=()=>{this.mouseState="down"};mouseUpHandler=e=>{this.mouseState="up",this.mouseMoveHandler(e)};mouseMoveHandler=e=>{if(this.menuFrozen||"selecting"===this.mouseState||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;let t=function(e){let t=e;for(;t&&"TD"!==t.nodeName&&"TH"!==t.nodeName&&!t.classList.contains("tableWrapper");){if(t.classList.contains("ProseMirror"))return;let e=t.parentNode;if(!e||!(e instanceof Element))return;t=e}return"TD"===t.nodeName||"TH"===t.nodeName?{type:"cell",domNode:t,tbodyNode:t.closest("tbody")}:{type:"wrapper",domNode:t,tbodyNode:t.querySelector("tbody")}}(e.target);if(t?.type==="cell"&&"down"===this.mouseState&&!this.state?.draggingState){this.mouseState="selecting",this.state?.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!t||!this.editor.isEditable){this.state?.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!t.tbodyNode)return;let n=t.tbodyNode.getBoundingClientRect(),r=eo(t.domNode,this.pmView);if(!r)return;this.tableElement=r.node;let i,l=this.editor.transact(e=>(0,o.Dt)(r.id,e.doc));if(!l)throw Error(`Block with ID ${r.id} not found`);let s=(0,o.an)(l.node,this.editor.pmSchema,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema);if((0,o.g)(this.editor,"table")&&(this.tablePos=l.posBeforeNode+1,i=s),!i)return;this.tableId=r.id;let a=t.domNode.closest(".tableWrapper")?.querySelector(".table-widgets-container");if(t?.type==="wrapper"){let t=e.clientY>=n.bottom-1&&e.clientY<n.bottom+20,r=e.clientX>=n.right-1&&e.clientX<n.right+20,o=this.state?.block.id!==i.id||e.clientX>n.right||e.clientY>n.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:t,showAddOrRemoveColumnsButton:r,referencePosTable:n,block:i,widgetContainer:a,colIndex:o?void 0:this.state?.colIndex,rowIndex:o?void 0:this.state?.rowIndex,referencePosCell:o?void 0:this.state?.referencePosCell}}else{let e=eP(t.domNode),o=eP(t.domNode.parentElement),l=t.domNode.getBoundingClientRect();if(void 0!==this.state&&this.state.show&&this.tableId===r.id&&this.state.rowIndex===o&&this.state.colIndex===e)return;
13this.state={show:!0,showAddOrRemoveColumnsButton:e===i.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:o===i.content.rows.length-1,referencePosTable:n,block:i,draggingState:void 0,referencePosCell:l,colIndex:e,rowIndex:o,widgetContainer:a}}return this.emitUpdate(),!1};dragOverHandler=e=>{if(this.state?.draggingState===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect="move",function(e,t){let n=t.querySelectorAll(e);for(let e=0;e<n.length;e++)n[e].style.visibility="hidden"}(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);let t={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(e=>"TD"===e.tagName||"TH"===e.tagName);if(0===n.length)return;let r=n[0],o=!1,i=eP(r.parentElement),l=eP(r),s="row"===this.state.draggingState.draggedCellOrientation?this.state.rowIndex:this.state.colIndex,a=("row"===this.state.draggingState.draggedCellOrientation?i:l)!==s;(this.state.rowIndex!==i||this.state.colIndex!==l)&&(this.state.rowIndex=i,this.state.colIndex=l,this.state.referencePosCell=r.getBoundingClientRect(),o=!0);let c="row"===this.state.draggingState.draggedCellOrientation?t.top:t.left;this.state.draggingState.mousePos!==c&&(this.state.draggingState.mousePos=c,o=!0),o&&this.emitUpdate(),a&&this.editor.transact(e=>e.setMeta(eB,!0))};dropHandler=e=>{if(this.mouseState="up",void 0===this.state||void 0===this.state.draggingState)return!1;if(void 0===this.state.rowIndex||void 0===this.state.colIndex)throw Error("Attempted to drop table row or column, but no table block was hovered prior.");e.preventDefault();let{draggingState:t,colIndex:n,rowIndex:r}=this.state;this.state.draggingState=void 0;let i=this.state.block.content.columnWidths;if("row"===t.draggedCellOrientation){if(!(0,o.Ft)(this.state.block,t.originalIndex,r))return!1;let e=(0,o.Vt)(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,rows:e}})}else{if(!(0,o.Pt)(this.state.block,t.originalIndex,n))return!1;let e=(0,o.Bt)(this.state.block,t.originalIndex,n),[r]=i.splice(t.originalIndex,1);i.splice(n,0,r),this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,columnWidths:i,rows:e}})}return this.editor.setTextCursorPosition(this.state.block.id),!0};update(){if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block||"table"!==this.state.block.type||!this.tableElement?.isConnected){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}let{height:e,width:t}=(0,o.zt)(this.state.block);void 0!==this.state.rowIndex&&void 0!==this.state.colIndex&&(this.state.rowIndex>=e&&(this.state.rowIndex=e-1),this.state.colIndex>=t&&(this.state.colIndex=t-1));let n=this.tableElement.querySelector("tbody");if(!n)throw Error("Table block does not contain a 'tbody' HTML element. This should never happen.");if(void 0!==this.state.rowIndex&&void 0!==this.state.colIndex){let e=n.children[this.state.rowIndex].children[this.state.colIndex];e?this.state.referencePosCell=e.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=n.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}},eB=new c.hs("TableHandlesPlugin"),eO=(0,i.t)(({editor:e})=>{let t,n=(0,i.n)(void 0);return{key:"tableHandles",store:n,prosemirrorPlugins:[new c.k_({key:eB,view:r=>t=new e_(e,r,e=>{n.setState(e.block?{...e,draggingState:e.draggingState?{...e.draggingState}:void 0}:void 0)}),props:{decorations:e=>{if(void 0===t||void 0===t.state||void 0===t.state.draggingState||void 0===t.tablePos)return;let n="row"===t.state.draggingState.draggedCellOrientation?t.state.rowIndex:t.state.colIndex;if(void 0===n)return;let r=[],{block:i,draggingState:l}=t.state,{originalIndex:s,draggedCellOrientation:a}=l;if(n===s||!i||"row"===a&&!(0,o.Ft)(i,s,n)||"col"===a&&!(0,o.Pt)(i,s,n))return p.zF.create(e.doc,r);let c=e.doc.resolve(t.tablePos+1);return"row"===t.state.draggingState.draggedCellOrientation?(0,o.Rt)(t.state.block,n).forEac
13h(({row:t,col:o})=>{let i=e.doc.resolve(c.posAtIndex(t)+1),l=e.doc.resolve(i.posAtIndex(o)+1),a=l.node(),d=l.pos+(n>s?a.nodeSize-2:0);r.push(p.NZ.widget(d,()=>{let e=document.createElement("div");return e.className="bn-table-drop-cursor",e.style.left="0",e.style.right="0",n>s?e.style.bottom="-2px":e.style.top="-3px",e.style.height="4px",e}))}):(0,o.Lt)(t.state.block,n).forEach(({row:t,col:o})=>{let i=e.doc.resolve(c.posAtIndex(t)+1),l=e.doc.resolve(i.posAtIndex(o)+1),a=l.node(),d=l.pos+(n>s?a.nodeSize-2:0);r.push(p.NZ.widget(d,()=>{let e=document.createElement("div");return e.className="bn-table-drop-cursor",e.style.top="0",e.style.bottom="0",n>s?e.style.right="-2px":e.style.left="-3px",e.style.width="4px",e}))}),p.zF.create(e.doc,r)}}})],colDragStart(n){if(void 0===t||void 0===t.state||void 0===t.state.colIndex)throw Error("Attempted to drag table column, but no table block was hovered prior.");t.state.draggingState={draggedCellOrientation:"col",originalIndex:t.state.colIndex,mousePos:n.clientX},t.emitUpdate(),e.transact(e=>e.setMeta(eB,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.colIndex,newIndex:t.state.colIndex,tablePos:t.tablePos})),e.headless||(ej(e.prosemirrorView.root),n.dataTransfer.setDragImage(r,0,0),n.dataTransfer.effectAllowed="move")},rowDragStart(n){if(void 0===t.state||void 0===t.state.rowIndex)throw Error("Attempted to drag table row, but no table block was hovered prior.");t.state.draggingState={draggedCellOrientation:"row",originalIndex:t.state.rowIndex,mousePos:n.clientY},t.emitUpdate(),e.transact(e=>e.setMeta(eB,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.rowIndex,newIndex:t.state.rowIndex,tablePos:t.tablePos})),e.headless||(ej(e.prosemirrorView.root),n.dataTransfer.setDragImage(r,0,0),n.dataTransfer.effectAllowed="copyMove")},dragEnd(){var n;if(void 0===t.state)throw Error("Attempted to drag table row, but no table block was hovered prior.");t.state.draggingState=void 0,t.emitUpdate(),e.transact(e=>e.setMeta(eB,null)),e.headless||(n=e.prosemirrorView.root,r&&=void(n instanceof Document?n.body.removeChild(r):n.removeChild(r)))},freezeHandles(){t.menuFrozen=!0},unfreezeHandles(){t.menuFrozen=!1},hideHandlesIfNotFrozen(){!t.menuFrozen&&t.state?.show&&(t.state.show=!1,t.state.showAddOrRemoveRowsButton=!1,t.state.showAddOrRemoveColumnsButton=!1,t.emitUpdate())},getCellsAtRowHandle:(e,t)=>(0,o.Rt)(e,t),getCellsAtColumnHandle:(e,t)=>(0,o.Lt)(e,t),setCellSelection(e,n,r=n){if(!t)throw Error("Table handles view not initialized");let o=e.doc.resolve(t.tablePos+1),i=e.doc.resolve(o.posAtIndex(n.row)+1),l=e.doc.resolve(i.posAtIndex(n.col)),s=e.doc.resolve(o.posAtIndex(r.row)+1),a=e.doc.resolve(s.posAtIndex(r.col)),c=e.tr;return c.setSelection(new u.rn(l,a)),e.apply(c)},addRowOrColumn(t,n){e.exec((e,r)=>{let o=this.setCellSelection(e,"row"===n.orientation?{row:t,col:0}:{row:0,col:t});return"row"===n.orientation?"above"===n.side?(0,u.JD)(o,r):(0,u.gC)(o,r):"left"===n.side?(0,u.RC)(o,r):(0,u.GU)(o,r)})},removeRowOrColumn(t,n){return"row"===n?e.exec((e,n)=>(0,u.aR)(this.setCellSelection(e,{row:t,col:0}),n)):e.exec((e,n)=>(0,u.gR)(this.setCellSelection(e,{row:0,col:t}),n))},mergeCells(t){return e.exec((e,n)=>(0,u.w7)(t?this.setCellSelection(e,t.relativeStartCell,t.relativeEndCell):e,n))},splitCell(t){return e.exec((e,n)=>(0,u.L0)(t?this.setCellSelection(e,t):e,n))},getCellSelection:()=>e.transact(e=>{let t=e.selection,n=t.$from,r=t.$to;if((0,o._)(t)){let{ranges:e}=t;e.forEach(e=>{n=e.$from.min(n??e.$from),r=e.$to.max(r??e.$to)})}else if(n=e.doc.resolve(t.$from.pos-t.$from.parentOffset-1),r=e.doc.resolve(t.$to.pos-t.$to.parentOffset-1),0===n.pos||0===r.pos)return;let i=e.doc.resolve(n.pos-n.parentOffset-1),l=e.doc.resolve(r.pos-r.parentOffset-1),s=e.doc.resolve(i.pos-i.parentOffset-1),a=n.index(i.depth),c=i.index(s.depth),d=r.index(l.depth),u=l.index(s.depth),p=[];for(let e=c;e<=u;e++)for(let t=a;t<=d;t++)p.push({row:e,col:t});return{from:{row:c,col:a},to:{row:u,col:d},cells:p}}),getMergeDirection(t){return e.transact(e=>{let n=(0,o._)(e.selection)?e.selection:void 0;if(!n||!t||n.ranges.length<=1)return;let r=this.getCellSelection();if(r)return(0,o.Nt)(r.from,r.to,t)?"vertical":"horizontal"})},cropEmptyRowsOrColumns:(e,t)=>(0,o.It)(e,t),addRowsOrColumns:(e,t,n)=>(0,o.Mt)(e,t,n)}}),eR=new c.hs("trailingNode"),eL=(0,i.t)(({editor:e})=>{function t(t,n,r){var o;let i=n.map(t.mapping,t.doc),l=i.find(),s=l.length>0;return s===function(e,t){if(!t)return!1;
13let n=e.lastChild?.lastChild,r=n?.firstChild;return n?.type.name!=="blockContainer"||r?.type.name!=="paragraph"||0!==r.content.size}(t.doc,r)?i:s?i.remove(l):i.add(t.doc,[(o=t.doc.content.size-1,p.NZ.widget(o,()=>{let t=document.createElement("div");return t.className="bn-trailing-block",t.contentEditable="false",t.addEventListener("mousedown",t=>{t.preventDefault(),e.transact(t=>{let[n]=e.insertBlocks([{type:"paragraph"}],e.document[e.document.length-1],"after");e.setTextCursorPosition(n,"start"),t.scrollIntoView()}),e.prosemirrorView?.focus()}),t},{side:1}))])}return{key:"trailingNode",prosemirrorPlugins:[new c.k_({key:eR,state:{init:(n,r)=>t(r.tr,p.zF.empty,e.isEditable),apply:(n,r)=>n.docChanged||n.getMeta(eR)?t(n,r,e.isEditable):r},view(e){let t=e.editable;return{update(e){e.editable!==t&&(t=e.editable,e.dispatch(e.state.tr.setMeta(eR,!0)))}}},props:{decorations:e=>eR.getState(e)}})]}})},17294:(e,t,n)=>{n.d(t,{UE:()=>er,RK:()=>X,ll:()=>Y,rD:()=>el,UU:()=>ee,jD:()=>en,mG:()=>eo,ER:()=>ei,cY:()=>Z,BN:()=>Q,Ej:()=>et});let r=["top","right","bottom","left"],o=r.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]),i=Math.min,l=Math.max,s=Math.round,a=Math.floor,c=e=>({x:e,y:e}),d={left:"right",right:"left",bottom:"top",top:"bottom"};function u(e,t){return"function"==typeof e?e(t):e}function p(e){return e.split("-")[0]}function h(e){return e.split("-")[1]}function f(e){return"x"===e?"y":"x"}function m(e){return"y"===e?"height":"width"}function g(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e,t,n){void 0===n&&(n=!1);let r=h(e),o=f(g(e)),i=m(o),l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=C(l)),[l,C(l)]}function y(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let v=["left","right"],k=["right","left"],w=["top","bottom"],x=["bottom","top"];function C(e){let t=p(e);return d[t]+e.slice(t.length)}function S(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function E(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function M(e,t,n){let r,{reference:o,floating:i}=e,l=g(t),s=f(g(t)),a=m(s),c=p(t),d="y"===l,u=o.x+o.width/2-i.width/2,b=o.y+o.height/2-i.height/2,y=o[a]/2-i[a]/2;switch(c){case"top":r={x:u,y:o.y-i.height};break;case"bottom":r={x:u,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:b};break;case"left":r={x:o.x-i.width,y:b};break;default:r={x:o.x,y:o.y}}switch(h(t)){case"start":r[s]-=y*(n&&d?-1:1);break;case"end":r[s]+=y*(n&&d?-1:1)}return r}async function T(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:f=0}=u(t,e),m=S(f),g=s[h?"floating"===p?"reference":"floating":p],b=E(await i.getClippingRect({element:null==(n=await (null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:a})),y="floating"===p?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,v=await (null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),k=await (null==i.isElement?void 0:i.isElement(v))&&await (null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:a}):y);return{top:(b.top-w.top+m.top)/k.y,bottom:(w.bottom-b.bottom+m.bottom)/k.y,left:(b.left-w.left+m.left)/k.x,right:(w.right-b.right+m.right)/k.x}}let A=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=l.detectOverflow?l:{...l,detectOverflow:T},a=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=M(c,r,a),p=r,h=0,f={};for(let n=0;n<i.length;n++){let m=i[n];if(!m)continue;let{name:g,fn:b}=m,{x:y,y:v,data:k,reset:w}=await b({x:d,y:u,initialPlacement:r,placement:p,strategy:o,middlewareData:f,re
13cts:c,platform:s,elements:{reference:e,floating:t}});d=null!=y?y:d,u=null!=v?v:u,f[g]={...f[g],...k},w&&h<50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:d,y:u}=M(c,p,a)),n=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:f}};function I(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function N(e){return r.some(t=>e[t]>=0)}function j(e){let t=i(...e.map(e=>e.left)),n=i(...e.map(e=>e.top));return{x:t,y:n,width:l(...e.map(e=>e.right))-t,height:l(...e.map(e=>e.bottom))-n}}let P=new Set(["left","top"]);async function _(e,t){let{placement:n,platform:r,elements:o}=e,i=await (null==r.isRTL?void 0:r.isRTL(o.floating)),l=p(n),s=h(n),a="y"===g(n),c=P.has(l)?-1:1,d=i&&a?-1:1,f=u(t,e),{mainAxis:m,crossAxis:b,alignmentAxis:y}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof y&&(b="end"===s?-1*y:y),a?{x:b*d,y:m*c}:{x:m*c,y:b*d}}var B=n(6791);function O(e){let t=(0,B.L9)(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=(0,B.sb)(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=s(n)!==i||s(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function R(e){return(0,B.vq)(e)?e:e.contextElement}function L(e){let t=R(e);if(!(0,B.sb)(t))return c(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=O(t),l=(i?s(n.width):n.width)/r,a=(i?s(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let D=c(0);function $(e){let t=(0,B.zk)(e);return(0,B.Tc)()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:D}function F(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),l=R(e),s=c(1);t&&(r?(0,B.vq)(r)&&(s=L(r)):s=L(e));let a=(void 0===(o=n)&&(o=!1),r&&(!o||r===(0,B.zk)(l))&&o)?$(l):c(0),d=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,p=i.width/s.x,h=i.height/s.y;if(l){let e=(0,B.zk)(l),t=r&&(0,B.vq)(r)?(0,B.zk)(r):r,n=e,o=(0,B._m)(n);for(;o&&r&&t!==n;){let e=L(o),t=o.getBoundingClientRect(),r=(0,B.L9)(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;d*=e.x,u*=e.y,p*=e.x,h*=e.y,d+=i,u+=l,n=(0,B.zk)(o),o=(0,B._m)(n)}}return E({width:p,height:h,x:d,y:u})}function z(e,t){let n=(0,B.CP)(e).scrollLeft;return t?t.left+n:F((0,B.ep)(e)).left+n}function H(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-z(e,n),y:n.top+t.scrollTop}}function V(e,t,n){var r;let o;if("viewport"===t)o=function(e,t){let n=(0,B.zk)(e),r=(0,B.ep)(e),o=n.visualViewport,i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;let e=(0,B.Tc)();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}let c=z(r);if(c<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-o);l<=25&&(i-=l)}else c<=25&&(i+=c);return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t){let t,n,i,s,a,c,d;r=(0,B.ep)(e),t=(0,B.ep)(r),n=(0,B.CP)(r),i=r.ownerDocument.body,s=l(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),a=l(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),c=-n.scrollLeft+z(r),d=-n.scrollTop,"rtl"===(0,B.L9)(i).direction&&(c+=l(t.clientWidth,i.clientWidth)-s),o={width:s,height:a,x:c,y:d}}else if((0,B.vq)(t)){let e,r,i,l,s,a;r=(e=F(t,!0,"fixed"===n)).top+t.clientTop,i=e.left+t.clientLeft,l=(0,B.sb)(t)?L(t):c(1),s=t.clientWidth*l.x,a=t.clientHeight*l.y,o={width:s,height:a,x:i*l.x,y:r*l.y}}else{let n=$(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return E(o)}function U(e){return"static"===(0,B.L9)(e).position}function W(e,t){if(!(0,B.sb)(e)||"fixed"===(0,B.L9)(e).position)return null;if(t)return t(e);let n=e.offsetParent;return(0,B.ep)(e)===n&&(n=n.ownerDocument.body),n}function J(e,t){let n=(0,B.zk)(e);if((0,B.Tf)(e))return n;if(!(0,B.sb)(e)){let t=(0,B.$4)(e);for(;t&&!(0,B.eu)(t);){if((0,B.vq)(t)&&!U(t))return t;t=(0,B.$4)(t)}return n}let r=W(e,t);for(;r&&(0,B.Lv)(r)&&U(r);)r=W(r,t);return r&&(0,B.eu)(r)&&U(r)&&!(0,B.sQ)(r)?n:r||(0,B.gJ)(e)||n}let G=async function(e){let t=this.getOffsetParent||J,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=(0,B.sb)(t),o=(0,B.ep)(t),i="fixed"===n,l=F(e,!0,i,t),s={scrollLeft:0,scrollTop:0},a=c(0);if(r||!r&&!i)if(("body"!==(0,B.mq)(t)||(0,B.ZU)(o))&&(s=(0,B.CP)(t)),r){let e=F(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=z(o));i&&!r&&o&&(a.x=z(o));let d=!o||r||i?c(0):H(o,s);return{x:l.left+s.scrollLeft-a.x-d.x,y:l.top+s.scrollTop-a.y-d.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},q={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i="fixed"===o,l=(0,B.ep)(r),s=!!t&&(0,B.Tf)(t.floating);if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},d=c(1),u=c(0),p=(0,B.sb)(r);if((p||!p&&!i)&&(("body"!==(0,B.mq)(r)||(0,B.ZU)(l))&&(a=(0,B.CP)(r)),p)){let e=F(r);d=L(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let h=!l||p||i?c(0):H(l,a);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-a.scrollTop*d.y+u.y+h.y}},getDocumentElement:B.ep,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,s=[..."clippingAncestors"===n?(0,B.Tf)(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=(0,B.v9)(e,[],!1).filter(e=>(0,B.vq)(e)&&"body"!==(0,B.mq)(e)),o=null,i="fixed"===(0,B.L9)(e).position,l=i?(0,B.$4)(e):e;for(;(0,B.vq)(l)&&!(0,B.eu)(l);){let t=(0,B.L9)(l),n=(0,B.sQ)(l);n||"fixed"!==t.position||(o=null),(i?n||o:!(!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||(0,B.ZU)(l)&&!n&&function e(t,n){let r=(0,B.$4)(t);return!(r===n||!(0,B.vq)(r)||(0,B.eu)(r))&&("fixed"===(0,B.L9)(r).position||e(r,n))}(e,l)))?o=t:r=r.filter(e=>e!==l),l=(0,B.$4)(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=V(t,s[0],o),c=a.top,d=a.right,u=a.bottom,p=a.left;for(let e=1;e<s.length;e++){let n=V(t,s[e],o);c=l(n.top,c),d=i(n.right,d),u=i(n.bottom,u),p=l(n.left,p)}return{width:d-p,height:u-c,x:p,y:c}},getOffsetParent:J,getElementRects:G,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=O(e);return{width:t,height:n}},getScale:L,isElement:B.vq,isRTL:function(e){return"rtl"===(0,B.L9)(e).direction}};function K(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Y(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:d="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:p=!1}=r,h=R(e),f=s||c?[...h?(0,B.v9)(h):[],...t?(0,B.v9)(t):[]]:[];
13f.forEach(e=>{s&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)});let m=h&&u?function(e,t){let n,r=null,o=(0,B.ep)(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function c(d,u){void 0===d&&(d=!1),void 0===u&&(u=1),s();let p=e.getBoundingClientRect(),{left:h,top:f,width:m,height:g}=p;if(d||t(),!m||!g)return;let b={rootMargin:-a(f)+"px "+-a(o.clientWidth-(h+m))+"px "+-a(o.clientHeight-(f+g))+"px "+-a(h)+"px",threshold:l(0,i(1,u))||1},y=!0;function v(t){let r=t[0].intersectionRatio;if(r!==u){if(!y)return c();r?c(!1,r):n=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==r||K(p,e.getBoundingClientRect())||c(),y=!1}try{r=new IntersectionObserver(v,{...b,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,b)}r.observe(e)}(!0),s}(h,n):null,g=-1,b=null;d&&(b=new ResizeObserver(e=>{let[r]=e;r&&r.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=b)||e.observe(t)})),n()}),h&&!p&&b.observe(h),t&&b.observe(t));let y=p?F(e):null;return p&&function t(){let r=F(e);y&&!K(y,r)&&n(),y=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{s&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=b)||e.disconnect(),b=null,p&&cancelAnimationFrame(o)}}let Z=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:l,middlewareData:s}=t,a=await _(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},X=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i,l;let{rects:s,middlewareData:a,placement:c,platform:d,elements:f}=t,{crossAxis:m=!1,alignment:g,allowedPlacements:v=o,autoAlignment:k=!0,...w}=u(e,t),x=void 0!==g||v===o?((l=g||null)?[...v.filter(e=>h(e)===l),...v.filter(e=>h(e)!==l)]:v.filter(e=>p(e)===e)).filter(e=>!l||h(e)===l||!!k&&y(e)!==e):v,C=await d.detectOverflow(t,w),S=(null==(n=a.autoPlacement)?void 0:n.index)||0,E=x[S];if(null==E)return{};let M=b(E,s,await (null==d.isRTL?void 0:d.isRTL(f.floating)));if(c!==E)return{reset:{placement:x[0]}};let T=[C[p(E)],C[M[0]],C[M[1]]],A=[...(null==(r=a.autoPlacement)?void 0:r.overflows)||[],{placement:E,overflows:T}],I=x[S+1];if(I)return{data:{index:S+1,overflows:A},reset:{placement:I}};let N=A.map(e=>{let t=h(e.placement);return[e.placement,t&&m?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),j=(null==(i=N.filter(e=>e[2].slice(0,h(e[0])?2:3).every(e=>e<=0))[0])?void 0:i[0])||N[0][0];return j!==c?{data:{index:S+1,overflows:A},reset:{placement:j}}:{}}}},Q=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...h}=u(e,t),m={x:n,y:r},b=await s.detectOverflow(t,h),y=g(p(o)),v=f(y),k=m[v],w=m[y];if(a){let e="y"===v?"top":"left",t="y"===v?"bottom":"right",n=k+b[e],r=k-b[t];k=l(n,i(k,r))}if(c){let e="y"===y?"top":"left",t="y"===y?"bottom":"right",n=w+b[e],r=w-b[t];w=l(n,i(w,r))}let x=d.fn({...t,[v]:k,[y]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:a,[y]:c}}}}}},ee=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,o,i,l;
13let s,a,c,{placement:d,middlewareData:f,rects:m,initialPlacement:S,platform:E,elements:M}=t,{mainAxis:T=!0,crossAxis:A=!0,fallbackPlacements:I,fallbackStrategy:N="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:P=!0,..._}=u(e,t);if(null!=(n=f.arrow)&&n.alignmentOffset)return{};let B=p(d),O=g(S),R=p(S)===S,L=await (null==E.isRTL?void 0:E.isRTL(M.floating)),D=I||(R||!P?[C(S)]:(s=C(S),[y(S),s,y(s)])),$="none"!==j;!I&&$&&D.push(...(a=h(S),c=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?k:v;return t?v:k;case"left":case"right":return t?w:x;default:return[]}}(p(S),"start"===j,L),a&&(c=c.map(e=>e+"-"+a),P&&(c=c.concat(c.map(y)))),c));let F=[S,...D],z=await E.detectOverflow(t,_),H=[],V=(null==(r=f.flip)?void 0:r.overflows)||[];if(T&&H.push(z[B]),A){let e=b(d,m,L);H.push(z[e[0]],z[e[1]])}if(V=[...V,{placement:d,overflows:H}],!H.every(e=>e<=0)){let e=((null==(o=f.flip)?void 0:o.index)||0)+1,t=F[e];if(t&&("alignment"!==A||O===g(t)||V.every(e=>g(e.placement)!==O||e.overflows[0]>0)))return{data:{index:e,overflows:V},reset:{placement:t}};let n=null==(i=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(N){case"bestFit":{let e=null==(l=V.filter(e=>{if($){let t=g(e.placement);return t===O||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:l[0];e&&(n=e);break}case"initialPlacement":n=S}if(d!==n)return{reset:{placement:n}}}return{}}}},et=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;let o,s,{placement:a,rects:c,platform:d,elements:f}=t,{apply:m=()=>{},...b}=u(e,t),y=await d.detectOverflow(t,b),v=p(a),k=h(a),w="y"===g(a),{width:x,height:C}=c.floating;"top"===v||"bottom"===v?(o=v,s=k===(await (null==d.isRTL?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(s=v,o="end"===k?"top":"bottom");let S=C-y.top-y.bottom,E=x-y.left-y.right,M=i(C-y[o],S),T=i(x-y[s],E),A=!t.middlewareData.shift,I=M,N=T;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(N=E),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(I=S),A&&!k){let e=l(y.left,0),t=l(y.right,0),n=l(y.top,0),r=l(y.bottom,0);w?N=x-2*(0!==e||0!==t?e+t:l(y.left,y.right)):I=C-2*(0!==n||0!==r?n+r:l(y.top,y.bottom))}await m({...t,availableWidth:N,availableHeight:I});let j=await d.getDimensions(f.floating);return x!==j.width||C!==j.height?{reset:{rects:!0}}:{}}}},en=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=u(e,t);switch(o){case"referenceHidden":{let e=I(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:N(e)}}}case"escaped":{let e=I(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:N(e)}}}default:return{}}}}},er=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:s,platform:a,elements:c,middlewareData:d}=t,{element:p,padding:b=0}=u(e,t)||{};if(null==p)return{};let y=S(b),v={x:n,y:r},k=f(g(o)),w=m(k),x=await a.getDimensions(p),C="y"===k,E=C?"clientHeight":"clientWidth",M=s.reference[w]+s.reference[k]-v[k]-s.floating[w],T=v[k]-s.reference[k],A=await (null==a.getOffsetParent?void 0:a.getOffsetParent(p)),I=A?A[E]:0;I&&await (null==a.isElement?void 0:a.isElement(A))||(I=c.floating[E]||s.floating[w]);let N=I/2-x[w]/2-1,j=i(y[C?"top":"left"],N),P=i(y[C?"bottom":"right"],N),_=I-x[w]-P,B=I/2-x[w]/2+(M/2-T/2),O=l(j,i(B,_)),R=!d.arrow&&null!=h(o)&&B!==O&&s.reference[w]/2-(B<j?j:P)-x[w]/2<0,L=R?B<j?B-j:B-_:0;return{[k]:v[k]+L,data:{[k]:O,centerOffset:B-O-L,...R&&{alignmentOffset:L}},reset:R}}}),eo=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){let{placement:n,elements:r,rects:o,platform:s,strategy:a}=t,{padding:c=2,x:d,y:h}=u(e,t),f=Array.from(await (null==s.getClientRects?void 0:s.getClientRects(r.reference))||[]),m=function(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(e=>E(j(e)))}(f),b=E(j(f)),y=S(c),v=await s.getElementRects({reference:{getBoundingClientRect:function(){if(2===m.length&&m[0].left>m[1].right&&null!=d&&null!=h)return m.find(e=>d>e.left-y.left&&d<e.right+y.right&&h>e.top-y.top&&h<e.bottom+y.bottom)||b;if(m.length>=2){if("y"===g(n)){let e=m[0],t=m[m.length-1],r="top"===p(n),o=e.top,i=t.bottom,l=r?e.left:t.left,s=r?e.right:t.right;return{top:o,bottom:i,left:l,right:s,width:s-l,height:i-o,x:l,y:o}}
13let e="left"===p(n),t=l(...m.map(e=>e.right)),r=i(...m.map(e=>e.left)),o=m.filter(n=>e?n.left===r:n.right===t),s=o[0].top,a=o[o.length-1].bottom;return{top:s,bottom:a,left:r,right:t,width:t-r,height:a-s,x:r,y:s}}return b}},floating:r.floating,strategy:a});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},ei=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:c=!0}=u(e,t),d={x:n,y:r},h=g(o),m=f(h),b=d[m],y=d[h],v=u(s,t),k="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(a){let e="y"===m?"height":"width",t=i.reference[m]-i.floating[e]+k.mainAxis,n=i.reference[m]+i.reference[e]-k.mainAxis;b<t?b=t:b>n&&(b=n)}if(c){var w,x;let e="y"===m?"width":"height",t=P.has(p(o)),n=i.reference[h]-i.floating[e]+(t&&(null==(w=l.offset)?void 0:w[h])||0)+(t?0:k.crossAxis),r=i.reference[h]+i.reference[e]+(t?0:(null==(x=l.offset)?void 0:x[h])||0)-(t?k.crossAxis:0);y<n?y=n:y>r&&(y=r)}return{[m]:b,[h]:y}}}},el=(e,t,n)=>{let r=new Map,o={platform:q,...n},i={...o.platform,_c:r};return A(e,t,{...o,platform:i})}},18037:(e,t,n)=>{n.d(t,{h:()=>g});var r=n(95155),o=n(67413);n(12115);var i=n(35624),l=n(86334),s=n(25168),a=n(7060),c=n(65214),d=n(74279),u=n(97276),p=n(38273),h={root:"m_9814e45f"};let f={zIndex:(0,i.I)("modal")},m=(0,s.V)((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(void 0!==n||void 0!==r)&&(0,a.B)(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${(0,o.D)(i)})`:void 0,"--overlay-radius":void 0===s?void 0:(0,l.nJ)(s),"--overlay-z-index":c?.toString()}})),g=(0,p.v)((e,t)=>{let n=(0,c.Y)("Overlay",f,e),{classNames:o,className:i,style:l,styles:s,unstyled:a,vars:p,fixed:g,center:b,children:y,radius:v,zIndex:k,gradient:w,blur:x,color:C,backgroundOpacity:S,mod:E,attributes:M,...T}=n,A=(0,d.I)({name:"Overlay",props:n,classes:h,className:i,style:l,classNames:o,styles:s,unstyled:a,attributes:M,vars:p,varsResolver:m});return(0,r.jsx)(u.a,{ref:t,...A("root"),mod:[{center:b,fixed:g},E],...T,children:y})});g.classes=h,g.displayName="@mantine/core/Overlay"},18507:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(12115);function o({value:e,defaultValue:t,finalValue:n,onChange:i=()=>{}}){let[l,s]=(0,r.useState)(void 0!==t?t:n);return void 0!==e?[e,i,!0]:[l,(e,...t)=>{s(e),i?.(e,...t)},!1]}},19441:(e,t,n)=>{n.d(t,{vt:()=>r});let r=()=>new Set},22323:(e,t,n)=>{n.d(t,{r:()=>c});var r=n(12115);let o=/input|select|textarea|button|object/,i="a, input, select, textarea, button, object, [tabindex]";function l(e){let t=e.getAttribute("tabindex");return null===t&&(t=void 0),parseInt(t,10)}function s(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(l(e));return(o.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&function(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||"hidden"===e.getAttribute("type"))return!1;let t=e;for(;t&&t!==document.body&&11!==t.nodeType;){if("none"===t.style.display)return!1;t=t.parentNode}return!0}(e)}function a(e){let t=l(e);return(Number.isNaN(t)||t>=0)&&s(e)}function c(e=!0){let t=(0,r.useRef)(null),n=e=>{let t=e.querySelector("[data-autofocus]");if(!t){let n=Array.from(e.querySelectorAll(i));!(t=n.find(a)||n.find(s)||null)&&s(e)&&(t=e)}t&&t.focus({preventScroll:!0})},o=(0,r.useCallback)(r=>{e&&null!==r&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,r.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));let r=e=>{"Tab"===e.key&&t.current&&function(e,t){let n=Array.from(e.querySelectorAll(i)).filter(a);if(!n.length)return t.preventDefault();let r=n[t.shiftKey?0:n.length-1],o=e.getRootNode(),l=r===o.activeElement||e===o.activeElement,s=o.activeElement;if("INPUT"===s.tagName&&"radio"===s.getAttribute("type")&&(l=n.filter(e=>"radio"===e.getAttribute("type")&&e.getAttribute("name")===s.getAttribute("name")).includes(r)),!l)return;t.preventDefault();let c=n[t.shiftKey?n.length-1:0];c&&c.focus()}(t.current,e)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),o}},22442:(e,t,n)=>{n.d(t,{x:()=>o});var r=n(12115);function o(e){let t=r.version;return"string"!=typeof r.version||t.startsWith("18.")?e?.ref:e?.props?.ref}},23168:(e,t,n)=>{n.d(t,{X:()=>E,y:()=>S});var r=n(95155);function o(e){return"auto"===e||"dark"===e||"light"===e}var i=n(66629),l=n(86530),s=n(67413),a=n(12115),c=n(12255);function d(){let e=(0,c.xd)(),t=(0,i.WV)(),n=(0,l.H)(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes("px"),o=function(e){let t="string"==typeof e&&e.includes("var(--mantine-scale)")?e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim():e;return"number"==typeof t?t:"string"==typeof t?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?16*Number(t.replace("rem","")):t.includes("em")?16*Number(t.replace("em","")):Number(t):NaN}(e.breakpoints[n]),i=r?`${o-.1}px`:(0,s.em)(o-.1),l=r?`${o}px`:(0,s.em)(o);return`${t}@media (max-width: ${i}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${l}) {.mantine-hidden-from-${n} {display: none !important;}}`},"");
13return(0,r.jsx)("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function u(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("")}function p(e,t){let n=t?[t]:[":root",":host"],r=u(e.variables),o=r?`${n.join(", ")}{${r}}`:"",i=u(e.dark),l=u(e.light),s=e=>n.map(t=>":host"===t?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(", "),a=i?`${s("dark")}{${i}}`:"",c=l?`${s("light")}{${l}}`:"";return`${o} 14 15${a} 16 17${c}`}var h=n(56200),f=n(89042),m=n(27890),g=n(7060);function b({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if("light"===n){let n=(0,f.g)(e,"light"),i={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===n?8:n+1})`,[`--mantine-color-${r}-light`]:(0,g.X)(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:(0,g.X)(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:(0,g.X)(e.colors[t][n],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...i}:i}let i=(0,f.g)(e,"dark"),l={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===i?8:i+1})`,[`--mantine-color-${r}-light`]:(0,g.X)(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:(0,g.X)(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:(0,g.X)(e.colors[t][Math.max(i-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...l}:l}function y(e,t,n){(0,l.H)(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}let v=e=>{let t=(0,f.g)(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:(0,s.D)(e.defaultRadius),r={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":(0,m.g)(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":(0,m.g)(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};y(r.variables,e.breakpoints,"breakpoint"),y(r.variables,e.spacing,"spacing"),y(r.variables,e.fontSizes,"font-size"),y(r.variables,e.lineHeights,"line-height"),y(r.variables,e.shadows,"shadow"),y(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}
17),(0,l.H)(e.colors).forEach(t=>{let n=e.colors[t];if(n&&"object"==typeof n&&"mantine-virtual-color"in n){Object.assign(r.light,b({theme:e,name:n.name,color:n.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,b({theme:e,name:n.name,color:n.dark,colorScheme:"dark",withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,b({theme:e,color:t,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,b({theme:e,color:t,colorScheme:"dark",withColorValues:!1}))});let o=e.headings.sizes;return(0,l.H)(o).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=o[t].fontSize,r.variables[`--mantine-${t}-line-height`]=o[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=o[t].fontWeight||e.headings.fontWeight}),r},k=v(n(60806).S);function w({cssVariablesSelector:e,deduplicateCssVariables:t}){let n,o=(0,c.xd)(),s=(0,i.WV)(),a=function({theme:e,generator:t}){let n=v(e),r=t?.(e);return r?(0,h.$)(n,r):n}({theme:o,generator:(0,i.OY)()}),d=(void 0===e||":root"===e||":host"===e)&&t,u=p(d?(n={variables:{},light:{},dark:{}},(0,l.H)(a.variables).forEach(e=>{k.variables[e]!==a.variables[e]&&(n.variables[e]=a.variables[e])}),(0,l.H)(a.light).forEach(e=>{k.light[e]!==a.light[e]&&(n.light[e]=a.light[e])}),(0,l.H)(a.dark).forEach(e=>{k.dark[e]!==a.dark[e]&&(n.dark[e]=a.dark[e])}),n):a,e);return u?(0,r.jsx)("style",{"data-mantine-styles":!0,nonce:s?.(),dangerouslySetInnerHTML:{__html:`${u}${d?"":p({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},e)}`}}):null}w.displayName="@mantine/CssVariables";var x=n(34259);function C(e,t){let n="u">typeof window&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches;t()?.setAttribute("data-mantine-color-scheme","auto"!==e?e:n?"dark":"light")}function S({theme:e,children:t,getStyleNonce:n,withStaticClasses:l=!0,withGlobalClasses:s=!0,deduplicateCssVariables:u=!0,withCssVariables:p=!0,cssVariablesSelector:h,classNamesPrefix:f="mantine",colorSchemeManager:m=function({key:e="mantine-color-scheme-value"}={}){let t;return{get:t=>{if("u"<typeof window)return t;try{let n=window.localStorage.getItem(e);return o(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&o(t.newValue)&&n(t.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}(),defaultColorScheme:g="light",getRootElement:b=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:v,stylesTransform:k,env:E}){let{colorScheme:M,setColorScheme:T,clearColorScheme:A}=function({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let o=(0,a.useRef)(null),[i,l]=(0,a.useState)(()=>e.get(t)),s=r||i,c=(0,a.useCallback)(t=>{r||(C(t,n),l(t),e.set(t))},[e.set,s,r]),d=(0,a.useCallback)(()=>{l(t),C(t,n),e.clear()},[e.clear,t]);return(0,a.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),(0,x.o)(()=>{C(e.get(t),n)},[]),(0,a.useEffect)(()=>{if(r)return C(r,n),()=>{};void 0===r&&C(i,n),"u">typeof window&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));let e=e=>{"auto"===i&&C(e.matches?"dark":"light",n)};return o.current?.addEventListener("change",e),()=>o.current?.removeEventListener("change",e)},[i,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:d}}({defaultColorScheme:g,forceColorScheme:v,manager:m,getRootElement:b});return!function({respectReducedMotion:e,getRootElement:t}){(0,x.o)(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:b}),(0,r.jsx)(i.A$.Provider,{value:{colorScheme:M,setColorScheme:T,clearColorScheme:A,getRootElement:b,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:h??":root",withStaticClasses:l,stylesTransform:k,env:E},children:(0,r.jsxs)(c.nW,{theme:e,children:[p&&(0,r.jsx)(w,{cssVariablesSelector:h,deduplicateCssVariables:u}),s&&(0,r.jsx)(d,{}),t]})})}function E({children:e,theme:t,env:n}){return(0,r.jsx)(i.A$.Provider,{value:{colorScheme:"auto",setColorScheme:()=>{},clearColorScheme:()=>{},getRootElement:()=>document.documentElement,classNamesPrefix:"mantine",cssVariablesSelector:":root",withStaticClasse
17s:!1,headless:!0,env:n},children:(0,r.jsx)(c.nW,{theme:t,children:e})})}S.displayName="@mantine/core/MantineProvider",E.displayName="@mantine/core/HeadlessMantineProvider"},23180:(e,t,n)=>{n.d(t,{vt:()=>r});let r=e=>new Promise(e);Promise.all.bind(Promise)},23549:(e,t,n)=>{n.d(t,{Zr:()=>P,YZ:()=>j});var r=n(27050),o=n(76865),i=n(62261),l=n(90756),s=n(19441);let a=/[\uD800-\uDBFF]/,c=/[\uDC00-\uDFFF]/;var d=n(1651),u=n(36158),p=n(44706),h=n(8682),f=n(30200),m=n(48273),g=n(84206),b=n(25775),y=n(87443),v=n(79274);let k=(e,t)=>e>>>t|e<<32-t,w=e=>k(e,2)^k(e,13)^k(e,22),x=e=>k(e,6)^k(e,11)^k(e,25),C=e=>k(e,7)^k(e,18)^e>>>3,S=e=>k(e,17)^k(e,19)^e>>>10,E=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),M=new Uint32Array([0x6a09e66
177,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]);class T{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(M),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=S(t[e-2])+t[e-7]+C(t[e-15])+t[e-16];let n=e[0],r=e[1],o=e[2],i=e[3],l=e[4],s=e[5],a=e[6],c=e[7];for(let e=0,d,u;e<64;e++)d=c+x(l)+(l&s^~l&a)+E[e]+t[e]>>>0,u=w(n)+(n&r^n&o^r&o)>>>0,c=a,a=s,s=l,l=i+d>>>0,i=o,o=r,r=n,n=d+u>>>0;e[0]+=n,e[1]+=r,e[2]+=o,e[3]+=i,e[4]+=l,e[5]+=s,e[6]+=a,e[7]+=c}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=v.wt<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<8*n;n||(this._W[r-(t%4!=0)]|=v.wt<<(3-t%4)*8),this._W[14]=e.byteLength/v.V7,this._W[15]=8*e.byteLength,this._updateHash();let o=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)o[4*e+t]=this._H[e]>>>(3-t)*8;return o}}var A=n(70489);let I=(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!p.X(t.ds,e.id),N=[{light:"#ecd44433",dark:"#ecd444"}],j=(e,{colors:t=N,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:l}={})=>{let s=!1,a=new _(e,l),c=new o.k_({props:{editable:e=>{let t=u.pJ.getState(e);return null==t.snapshot&&null==t.prevSnapshot}},key:u.pJ,state:{init:(o,i)=>({type:e,doc:e.doc,binding:a,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(u.pJ);if(void 0!==n)for(let e in t=Object.assign({},t),n)t[e]=n[e];return t.addToHistory=!1!==e.getMeta("addToHistory"),t.isChangeOrigin=void 0!==n&&!!n.isChangeOrigin,t.isUndoRedoOperation=void 0!==n&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,null!==a.prosemirrorView&&void 0!==n&&(null!=n.snapshot||null!=n.prevSnapshot)&&b.wR(0,()=>{null!=a.prosemirrorView&&(null==n.restore?a._renderSnapshot(n.snapshot,n.prevSnapshot,t):(a._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,a.mux(()=>{a._prosemirrorChanged(a.prosemirrorView.state.doc)})))}),t}},view:e=>(a.initView(e),null==l&&a._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(null==t.snapshot&&null==t.prevSnapshot&&(s||null!==e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content))){if(s=!0,!1===t.addToHistory&&!t.isChangeOrigin){let t=u.Mj.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}a.mux(()=>{t.doc.transact(n=>{n.meta.set("addToHistory",t.addToHistory),a._prosemirrorChanged(e.state.doc)},u.pJ)})}},destroy:()=>{a.destroy()}})});return c},P=(e,t)=>({type:t.selection.jsonID,anchor:(0,h.Bw)(t.selection.anchor,e.type,e.mapping),head:(0,h.Bw)(t.selection.head,e.type,e.mapping)});class _{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=(()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else void 0!==n&&n()}})(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{null===this.beforeTransactionSelection&&null!=this.prosemirrorView&&(this.beforeTransactionSelection=P(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return!!this.prosemirrorView.hasFocus()&&(m.Bd&&null===this._domSelectionInView&&(b.wR(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView)}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(null==e||null==e.anchorNode)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),0===t.getClientRects().length&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=g.H9.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||(t=p.$p(p.cU(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(u.pJ,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>O(e,this.prosemirrorView.state.schema,this)).filter(e=>
17null!==e),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new r.Ji(r.FK.from(e),0,0));t.setMeta(u.pJ,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=null!==this.beforeTransactionSelection?null:this.prosemirrorView.state.selection,t=this.type.toArray().map(e=>O(e,this.prosemirrorView.state.schema,this)).filter(e=>null!==e),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new r.Ji(r.FK.from(t),0,0));if(e){let t=i.jk(i.T9(e.anchor,0),n.doc.content.size),r=i.jk(i.T9(e.head,0),n.doc.content.size);n.setSelection(o.U3.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(u.pJ,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let o=this.doc,i=this.type;if(e||(e=p.P9(this.doc)),e instanceof Uint8Array||t instanceof Uint8Array)if(e instanceof Uint8Array&&t instanceof Uint8Array||d.Mq(),o=new p.JA({gc:!1}),p.Qs(o,t),t=p.P9(o),p.Qs(o,e),e=p.P9(o),null===i._item){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=o.getXmlFragment(e)}else{let e=o.store.clients.get(i._item.id.client)??[],t=p.A$(e,i._item.id.clock);i=e[t].content.type}this.mapping.clear(),this.mux(()=>{o.transact(o=>{let l=n.permanentUserData;l&&l.dss.forEach(e=>{p.O_(o,e,e=>{})});let a=(e,t)=>{let r="added"===e?l.getUserByClientId(t.client):l.getUserByDeletedId(t);return{user:r,type:e,color:((e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=s.vt();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,f.yL(t))}return e.get(n)})(n.colorMapping,n.colors,r)}},c=p.br(i,new p.Fm(t.ds,e.sv)).map(n=>!n._item.deleted||I(n._item,e)||I(n._item,t)?O(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,a):null).filter(e=>null!==e),d=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new r.Ji(r.FK.from(c),0,0));this.prosemirrorView.dispatch(d.setMeta(u.pJ,{isChangeOrigin:!0}))},u.pJ)})}_typeChanged(e,t){if(null==this.prosemirrorView)return;let n=u.pJ.getState(this.prosemirrorView.state);0===e.length||null!=n.snapshot||null!=n.prevSnapshot?this.renderSnapshot(n.snapshot,n.prevSnapshot):this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);p.O_(t,t.deleteSet,e=>{if(e.constructor===p.q7){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>B(e,this.prosemirrorView.state.schema,this)).filter(e=>null!==e),i=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new r.Ji(r.FK.from(n),0,0));((e,t,n)=>{if(null!==t&&null!==t.anchor&&null!==t.head)if("all"===t.type)e.setSelection(new o.i5(e.doc));else if("node"===t.type){let r=(0,h.bL)(n.doc,n.type,t.anchor,n.mapping);e.setSelection(o.nh.create(e.doc,r))}else{let r=(0,h.bL)(n.doc,n.type,t.anchor,n.mapping),i=(0,h.bL)(n.doc,n.type,t.head,n.mapping);if(null!==r&&null!==i){let t=o.U3.between(e.doc.resolve(r),e.doc.resolve(i));e.setSelection(t)}}})(i,this.beforeTransactionSelection,this),i=i.setMeta(u.pJ,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof p.ad}),null!==this.beforeTransactionSelection&&this._isLocalCursorInView()&&i.scrollIntoView(),this.prosemirrorView.dispatch(i)})}_prosemirrorChanged(e){this.doc.transact(()=>{Y(this.doc,this.type,e,this),this.beforeTransactionSelection=P(this,this.prosemirrorView.state)},u.pJ)}initView(e){null!=this.prosemirrorView&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){null!=this.prosemirrorView&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}let B=(e,t,n,r,o,i)=>{let l=n.mapping.get(e);if(void 0===l)if(e instanceof p.WF)return O(e,t,n,r,o,i);else throw d.bD();return l},O=(e,t,n,r,o,i)=>{let l=[],s=e=>{if(e instanceof p.WF){let s=B(e,t,n,r,o,i);null!==s&&l.push(s)}else{let s=e._item.right?.content?.type;s instanceof p.EY&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let a=R(e,t,n,r,o,i);
17null!==a&&a.forEach(e=>{null!==e&&l.push(e)})}};void 0===r||void 0===o?e.toArray().forEach(s):p.br(e,new p.Fm(o.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);void 0!==r&&(I(e._item,r)?I(e._item,o)||(s.ychange=i?i("added",e._item.id):{type:"added"}):s.ychange=i?i("removed",e._item.id):{type:"removed"});let a=t.node(e.nodeName,s,l);return n.mapping.set(e,a),a}catch(t){return e.doc.transact(t=>{e._item.delete(t)},u.pJ),n.mapping.delete(e),null}},R=(e,t,n,r,o,i)=>{let l=[],s=e.toDelta(r,o,i);try{for(let e=0;e<s.length;e++){let n=s[e];l.push(t.text(n.insert,q(n.attributes,t)))}}catch(t){return e.doc.transact(t=>{e._item.delete(t)},u.pJ),null}return l},L=(e,t)=>{let n,r;return e instanceof Array?(n=new p.ZQ,r=e.map(e=>({insert:e.text,attributes:K(e.marks,t)})),n.applyDelta(r),t.mapping.set(n,e),n):((e,t)=>{let n=new p.WF(e.type.name);for(let t in e.attrs){let r=e.attrs[t];null!==r&&"ychange"!==t&&n.setAttribute(t,r)}return n.insert(0,F(e).map(e=>L(e,t))),t.mapping.set(n,e),n})(e,t)},D=e=>"object"==typeof e&&null!==e,$=(e,t)=>{let n=Object.keys(e).filter(t=>null!==e[t]),r=n.length===(null==t?0:Object.keys(t).filter(e=>null!==t[e]).length);for(let o=0;o<n.length&&r;o++){let i=n[o],l=e[i],s=t[i];r="ychange"===i||l===s||D(l)&&D(s)&&$(l,s)}return r},F=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},z=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&l.HP(e.attributes||{}).length===t[n].marks.length&&l.Si(e.attributes,(e,r)=>{let o=G(r),i=t[n].marks;return $(e,i.find(e=>e.type.name===o)?.attrs)}))},H=(e,t)=>{if(e instanceof p.WF&&!(t instanceof Array)&&Z(e,t)){let n=F(t);return e._length===n.length&&$(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>H(e,n[t]))}return e instanceof p.ZQ&&t instanceof Array&&z(e,t)},V=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),U=(e,t,n)=>{let r=e.toArray(),o=F(t),l=o.length,s=r.length,a=i.jk(s,l),c=0,d=0,u=!1;for(;c<a;c++){let e=r[c],t=o[c];if(V(n.mapping.get(e),t))u=!0;else if(!H(e,t))break}for(;c+d<a;d++){let e=r[s-d-1],t=o[l-d-1];if(V(n.mapping.get(e),t))u=!0;else if(!H(e,t))break}return{equalityFactor:c+d,foundMappedChild:u}},W=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:o}=(e=>{let t="",n=e._start,r={};for(;null!==n;)!n.deleted&&(n.countable&&n.content instanceof p.DU?t+=n.content.str:n.content instanceof p.v1&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}})(e),i=t.map(e=>({insert:e.text,attributes:Object.assign({},r,K(e.marks,n))})),{insert:l,remove:s,index:d}=((e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&a.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&c.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}})(o,i.map(e=>e.insert).join(""));e.delete(d,s),e.insert(d,l),e.applyDelta(i.map(e=>({retain:e.insert.length,attributes:e.attributes})))},J=/(.*)(--[a-zA-Z0-9+/=]{8})$/,G=e=>J.exec(e)?.[1]??e,q=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(G(r),e[r]));return n},K=(e,t)=>{let n={};return e.forEach(e=>{if("ychange"!==e.type.name){var r;let o;n[y._4(t.isOMark,e.type,()=>!e.type.excludes(e.type))?`${e.type.name}--${r=e.toJSON(),A.nk((e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)})((o=A.T0(r),new T().digest(o))))}`:e.type.name]=e.attrs}}),n},Y=(e,t,n,r)=>{if(t instanceof p.WF&&t.nodeName!==n.type.name)throw Error("node name mismatch!");if(r.mapping.set(t,n),t instanceof p.WF){let e=t.getAttributes(),r=n.attrs;for(let n in r)null!==r[n]?e[n]!==r[n]&&"ychange"!==n&&t.setAttribute(n,r[n]):t.removeAttribute(n);for(let n in e)void 0===r[n]&&t.removeAttribute(n)}let o=F(n),l=o.length,s=t.toArray(),a=s.length,c=i.jk(l,a),d=0,h=0;for(;d<c;d++){let e=s[d],t=o[d];if(!V(r.mapping.get(e),t))if(H(e,t))r.mapping.set(e,t);else break}for(;h+d<c;h++){let e=s[a-h-1],t=o[l-h-1];if(!V(r.mapping.get(e),t))if(H(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;a-d-h>0&&l-d-h>0;){let n=s[d],i=o[d],c=s[a-h-1],u=o[l-h-1];if(n instanceof p.ZQ&&i instanceof Array)z(n,i)||W(n,i,r),d+=1;else{let o=n instanceof p.WF&&Z(n,i),l=c instanceof p.WF&&Z(c,u);if(o&&l){let e=U(n,i,r),t=U(c,u,r);
17e.foundMappedChild&&!t.foundMappedChild?l=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?o=!1:l=!1}o?(Y(e,n,i,r),d+=1):l?(Y(e,c,u,r),h+=1):(r.mapping.delete(t.get(d)),t.delete(d,1),t.insert(d,[L(i,r)]),d+=1)}}let n=a-d-h;if(1===a&&0===l&&s[0]instanceof p.ZQ?(r.mapping.delete(s[0]),s[0].delete(0,s[0].length)):n>0&&(t.slice(d,d+n).forEach(e=>r.mapping.delete(e)),t.delete(d,n)),d+h<l){let e=[];for(let t=d;t<l-h;t++)e.push(L(o[t],r));t.insert(d,e)}},u.pJ)},Z=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name},25168:(e,t,n)=>{n.d(t,{V:()=>r});function r(e){return e}},25775:(e,t,n)=>{n.d(t,{wR:()=>i});let r=e=>class{constructor(e){this._=e}destroy(){e(this._)}},o=r(clearTimeout),i=(e,t)=>new o(setTimeout(t,e));r(clearInterval),r(e=>"u">typeof requestAnimationFrame&&cancelAnimationFrame(e)),r(e=>"u">typeof cancelIdleCallback&&cancelIdleCallback(e))},27050:(e,t,n)=>{function r(e){this.content=e}function o(e){return e>=56320&&e<57344}function i(e){return e>=55296&&e<56320}n.d(t,{S4:()=>H,ZF:()=>Z,FK:()=>l,CU:()=>d,sX:()=>$,bP:()=>E,u$:()=>C,vI:()=>u,Sj:()=>F,Ji:()=>p}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,i=o.find(e),l=o.content.slice();return -1==i?l.push(n||e,t):(l[i+1]=t,n&&(l[i]=n)),new r(l)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var o=this.remove(t),i=o.content.slice(),l=o.find(e);return i.splice(-1==l?i.length:l,0,t,n),new r(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};class l{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,l=0;l<t;i++){let s=this.content[i],a=l+s.nodeSize;if(a>e&&!1!==n(s,r+l,o||null,i)&&s.content.size){let o=l+1;s.nodesBetween(Math.max(0,e-o),Math.min(s.content.size,t-o),n,r+o)}l=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(l,s)=>{let a=l.isText?l.text.slice(Math.max(e,s)-s,t-s):l.isLeaf?r?"function"==typeof r?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&a||l.isTextblock)&&n&&(i?i=!1:o+=n),o+=a},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new l(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let l=this.content[o],s=i+l.nodeSize;s>e&&((i<e||s>t)&&(l=l.isText?l.cut(Math.max(0,e-i),Math.min(l.text.length,t-i)):l.cut(Math.max(0,e-i-1),Math.min(l.content.size,t-i-1))),n.push(l),r+=l.nodeSize),i=s}return new l(n,r)}cutByIndex(e,t){return e==t?l.empty:0==e&&t==this.content.length?this:new l(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new l(r,o)}addToStart(e){return new l([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new l(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let l=0;;l++){if(l==t.childCount||l==n.childCount)return t.childCount==n.childCount?null:r;let s=t.child(l),a=n.child(l);if(s==a){r+=s.nodeSize;continue}if(!s.sameMarkup(a))return r;if(s.isText&&s.text!=a.text){let e=s.text,t=a.text,n=0;for(;e[n]==t[n];
17n++)r++;return n&&n<e.length&&n<t.length&&i(e.charCodeAt(n-1))&&o(e.charCodeAt(n))&&r--,r}if(s.content.size||a.content.size){let t=e(s.content,a.content,r+1);if(null!=t)return t}r+=s.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,l){for(let s=t.childCount,a=n.childCount;;){if(0==s||0==a)return s==a?null:{a:r,b:l};let c=t.child(--s),d=n.child(--a),u=c.nodeSize;if(c==d){r-=u,l-=u;continue}if(!c.sameMarkup(d))return{a:r,b:l};if(c.isText&&c.text!=d.text){let e=c.text,t=d.text,n=e.length,s=t.length;for(;n>0&&s>0&&e[n-1]==t[s-1];)n--,s--,r--,l--;return n&&s&&n<e.length&&i(e.charCodeAt(n-1))&&o(e.charCodeAt(n))&&(r++,l++),{a:r,b:l}}if(c.content.size||d.content.size){let t=e(c.content,d.content,r-1,l-1);if(t)return t}r-=u,l-=u}}(this,e,t,n)}findIndex(e){if(0==e)return a(0,e);if(e==this.size)return a(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return a(t+1,r);return a(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return l.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return l.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return l.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new l(t||e,n)}static from(e){if(!e)return l.empty;if(e instanceof l)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new l([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}l.empty=new l([],0);let s={index:0,offset:0};function a(e,t){return s.index=e,s.offset=t,s}function c(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!c(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!c(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class d{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&c(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return d.none;if(e instanceof d)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}d.none=[];class u extends Error{}class p{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,o,i,l){let{index:s,offset:a}=t.findIndex(n),c=t.maybeChild(s);if(a==n||c.isText)return l&&o<=0&&i<=0&&!l.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));let d=e(c.content,n-a-1,r,0==s?o-1:0,s==t.childCount-1?i-1:0,c);return d&&t.replaceChild(s,c.copy(d))}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new p(n,this.openStart,this.openEnd)}removeBetween(e,t){return new p(function e(t,n,r){let{index:o,offset:i}=t.findIndex(n),l=t.maybeChild(o),{index:s,offset:a}=t.findIndex(r);if(i==n||l.isText){if(a!=r&&!t.child(s).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(o!=s)throw RangeError("Removing non-flat range");return t.replaceChild(o,l.copy(e(l.content,n-i-1,r-i-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return p.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new p(l.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new p(e,n,r)}}function h(e,t){if(!t.type.compatibleContent(e.type))throw new u("Cannot join "+t.type.name+" onto "+e.type.n
vendor: 4,756 bytes, line 17
17ame)}function f(e,t,n){let r=e.node(n);return h(r,t.node(n)),r}function m(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function g(e,t,n,r){let o=(t||e).node(n),i=0,l=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(m(e.nodeAfter,r),i++));for(let e=i;e<l;e++)m(o.child(e),r);t&&t.depth==n&&t.textOffset&&m(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new u("Invalid content for node "+e.type.name);return e.copy(t)}function y(e,t,n){let r=[];return g(null,e,n,r),e.depth>n&&m(b(f(e,t,n+1),y(e,t,n+1)),r),g(t,null,n,r),new l(r)}p.empty=new p(l.empty,0,0);class v{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return d.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new C(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),l=o-i;if(n.push(t,e,r+i),!l||(t=t.child(e)).isText)break;o=l-1,r+=i+1}return new v(t,n,o)}static resolveCached(e,t){let n=x.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else x.set(e,n=new k);let r=n.elts[n.i]=v.resolve(e,t);return n.i=(n.i+1)%w,r}}class k{constructor(){this.elts=[],this.i=0}}let w=12,x=new WeakMap;class C{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let S=Object.create(null);class E{constructor(e,t,n,r=d.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||l.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}
17textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&c(this.attrs,t||e.defaultAttrs||S)&&d.sameSet(this.marks,n||d.none)}copy(e=null){return e==this.content?this:new E(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new E(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return p.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),l=r.start(i);return new p(r.node(i).content.cut(r.pos-l,o.pos-l),r.depth-i,o.depth-i)}replace(e,t,n){var r=this.resolve(e),o=this.resolve(t);if(n.openStart>r.depth)throw new u("Inserted content deeper than insertion position");if(r.depth-n.openStart!=o.depth-n.openEnd)throw new u("Inconsistent open depths");return function e(t,n,r,o){let i=t.index(o),s=t.node(o);if(i==n.index(o)&&o<t.depth-r.openStart){let l=e(t,n,r,o+1);return s.copy(s.content.replaceChild(i,l))}if(!r.content.size)return b(s,y(t,n,o));if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){let{start:e,end:i}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(l.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return b(s,function e(t,n,r,o,i){let s=t.depth>i&&f(t,n,i+1),a=o.depth>i&&f(r,o,i+1),c=[];return g(null,t,i,c),s&&a&&n.index(i)==r.index(i)?(h(s,a),m(b(s,e(t,n,r,o,i+1)),c)):(s&&m(b(s,y(t,n,i+1)),c),g(n,r,i,c),a&&m(b(a,y(r,o,i+1)),c)),g(o,null,i,c),new l(c)}(t,e,i,n,o))}{let e=t.parent,o=e.content;return b(e,o.cut(0,t.parentOffset).append(r.content).append(o.cut(n.parentOffset)))}}(r,o,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return v.resolveCached(this,e)}resolveNoCache(e){return v.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),T(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=l.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=d.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!d.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>
17e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=l.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}E.prototype.text=void 0;class M extends E{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):T(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new M(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new M(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function T(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class A{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,o=new I(e,t);if(null==o.next)return A.empty;let i=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=N(e),r=n;return e.eat(",")&&(r="}"!=e.next?N(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(o);o.next&&o.err("Unexpected trailing text");let l=(n=function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,i)),[]);if("seq"==t.type)for(let r=0;;r++){let l=e(t.exprs[r],i);if(r==t.exprs.length-1)return l;o(l,i=n())}else if("star"==t.type){let l=n();return r(i,l),o(e(t.expr,l),l),[r(l)]}else if("plus"==t.type){let l=n();return o(e(t.expr,i),l),o(e(t.expr,l),l),[r(l)]}else if("opt"==t.type)return[r(i)].concat(e(t.expr,i));else if("range"==t.type){let l=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,l),r),l=r}if(-1==t.max)o(e(t.expr,l),l);else for(let i=t.min;i<t.max;i++){let i=n();r(l,i),o(e(t.expr,l),i),l=i}return[r(l)]}else if("name"==t.type)return[r(i,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}}(i),r=Object.create(null),function e(t){let o=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);P(n,t).forEach(t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let i=r[t.join(",")]=new A(t.indexOf(n.length-1)>-1);for(let t=0;t<o.length;t++){let n=o[t][1].sort(j);i.next.push({type:o[t][0],next:r[n.join(",")]||e(n)})}return i}(P(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:l}=e.next[t];i.push(n.name),o&&!(n.isText||n.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(l)&&r.push(l)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(l,o),l}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}
vendor: 4,607 bytes, line 17
17matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return l.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:l}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!l.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}A.empty=new A(!0);class I{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function N(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function j(e,t){return t-e}function P(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(j)}function _(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function B(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(t.hasDefault)o=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function O(e,t,n,r){for(let o in t)if(!(o in e))throw RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function R(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new D(e,r,t[r]);return n}class L{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=R(e,n.attrs),this.defaultAttrs=_(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==A.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:B(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new E(this,this.computeAttrs(e),l.from(t),d.setFrom(n))}createChecked(e=null,t,n){return t=l.from(t),this.checkContent(t),new E(this,this.computeAttrs(e),t,d.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=l.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(l.empty,!0);return o?new E(this,e,t.append(o),d.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
17if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){O(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:d.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new L(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class D{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(0>r.indexOf(o))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class ${constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=R(e,r.attrs),this.excluded=null;let o=_(this.attrs);this.instance=o?new d(this,o):null}create(e=null){return!e&&this.instance?this.instance:new d(this,B(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,o)=>n[e]=new $(e,r++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){O(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class F{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=r.from(e.nodes),t.marks=r.from(e.marks||{}),this.nodes=L.compile(this.spec.nodes,this),this.marks=$.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=A.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?z(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:z(this,n.split(" "))}this.nodeFromJSON=e=>E.fromJSON(this,e),this.markFromJSON=e=>d.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof L){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new M(n,n.defaultAttrs,e,d.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function z(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],l=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(l=r)}if(!l)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class H{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];
17t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new q(this,t,!1);return n.addAll(e,d.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new q(this,t,!0);return n.addAll(e,d.none,t.from,t.to),p.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r,o;let n=this.tags[i];if(r=e,o=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,o)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(0==i.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(i.length>e.length)||61==i.charCodeAt(e.length)&&i.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=K(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=K(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new H(e,H.schemaRules(e)))}}let V={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},U={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W={ol:!0,ul:!0};function J(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class G{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=d.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(l.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=l.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(l.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!V.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class q{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,o,i=J(null,t.preserveWhitespace,0)|4*!!n;o=r?new G(r.type,r.attrs,d.none,!0,t.topMatch||r.type.contentMatch,i):n?new G(null,null,d.none,!0,null,i):new G(e.schema.topNodeType,null,d.none,!0,null,i),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),l;W.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&W.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));n:if(s?s.ignore:U.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(V.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break n}let l=s&&s.skip?t:this.readStyles(e,t);l&&this.addAll(e,l),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,!1===s.consuming?l:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let o,i;
vendor: 4,107 bytes, line 17
17if(t.node)if((i=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,l=null==r?null:e.childNodes[r];i!=l;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let l=this.nodes[t],s=l.findWrapping(e);if(s&&(!r||r.length>s.length+i)&&(r=s,o=l,!s.length))break;if(l.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=d.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Y(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let l=J(e,o,i.options);4&i.options&&0==i.content.length&&(l|=4);let s=d.none;return n=n.filter(t=>(i.type?!i.type.allowsMarkType(t.type):!Y(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new G(e,t,s,r,null,l)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+ +!r,i=(e,l)=>{for(;e>=0;e--){let s=t[e];if(""==s){if(e==t.length-1||0==e)continue;for(;l>=o;l--)if(i(e-1,l))return!0;return!1}{let e=l>0||0==l&&r?this.nodes[l].type:n&&l>=o?n.node(l-o).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;l--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];
17if(t.isTextblock&&t.defaultAttrs)return t}}}function K(e){let t={};for(let n in e)t[n]=e[n];return t}function Y(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],l=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t||0>i.indexOf(o)&&l(o))return!0}};if(l(o.contentMatch))return!0}}class Z{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Q(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(!this.marks[t.type.name]){i++;continue}if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],l=this.serializeMark(n,e.isInline,t);l&&(o.push([n,r]),r.appendChild(l.dom),r=l.contentDOM||l.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Q(t).createTextNode(e.text);let{dom:n,contentDOM:r}=et(Q(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&et(Q(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:et(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Z(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=X(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return X(e.marks)}}function X(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Q(e){return e.document||window.document}let ee=new WeakMap;function et(e,t,n,r){let o,i,l;if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let s=t[0],a;if("string"!=typeof s)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(i=ee.get(r))&&ee.set(r,(l=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])l||(l=[]),l.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),i=l)),a=i)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=s.indexOf(" ");c>0&&(n=s.slice(0,c),s=s.slice(c+1));let d=n?e.createElementNS(n,s):e.createElement(s),u=t[1],p=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in p=2,u)if(null!=u[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),u[e]):"style"==e&&d.style?d.style.cssText=u[e]:d.setAttribute(e,u[e])}}for(let i=p;i<t.length;i++){let l=t[i];if(0===l){if(i<t.length-1||i>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}if("string"==typeof l)d.appendChild(e.createTextNode(l));else{let{dom:t,contentDOM:i}=et(e,l,n,r);if(d.appendChild(t),i){if(o)throw RangeError("Multiple content holes");o=i}}}return{dom:d,contentDOM:o}}},27890:(e,t,n)=>{n.d(t,{g:()=>l,w:()=>i});var r=n(89042),o=n(51913);function i({color:e,theme:t,autoContrast:n}){return("boolean"==typeof n?n:t.autoContrast)&&(0,o.g)({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function l(e,t){return i({color:e.colors[e.primaryColor][(0,r.g)(e,t)],theme:e,autoContrast:null})}},29722:(e,t,n)=>{function r(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}(e))&&(r&&(r+=" "),r+=t);return r}n.d(t,{$:()=>r,A:()=>o});let o=r},30200:(e,t,n)=>{n.d(t,{yL:()=>s,S8:()=>l,gZ:()=>a});var r=n(62261);crypto.subtle;let o=crypto.getRandomValues.bind(crypto),i=Math.random,l=()=>o(new Uint32Array(1))[0],s=e=>e[r.RI(i()*e.length)],a=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^l()&15>>e/4).toString(16))},31734:(e,t,n)=>{n.d(t,{N:()=>r});function r({theme:e,styles:t,props:n,stylesCtx:o}){return(Array.isArray(t)?t:[t]).reduce((t,r)=>"function"==typeof r?{...t,...r(e,n,o)}:{...t,...r},{})}},32803:(e,t,n)=>{n.d(t,{t:()=>s});var r=n(13015),o=n(76865),i=n(63197),l=new o.hs("blocknote-show-selection"),s=(0,r.t)(({editor:e})=>{let t=(0,r.n)({enabledSet:new Set},{onUpdate(){e.transact(e=>e.setMeta(l,{}))}});return{key:"showSelection",store:t,prosemirrorPlugins:[new o.k_({key:l,props:{decorations:e=>{let{doc:n,selection:r}=e;if(0===t.state.enabledSet.size)return i.zF.empty;let o=i.NZ.inline(r.from,r.to,{"data-show-selection":"true"});return i.zF.create(n,[o])}}})],showSelection(e,n){t.setState({enabledSet:new Set(e?[...t.state.enabledSet,n]:[...t.state.enabledSet].filter(e=>e!==n))})}}})},33867:(e,t,n)=>{n.d(t,{EK:()=>c,OK:()=>l,id:()=>s,vo:()=>a});var r=n(6648),o=n(90756),i=n(37766);let l=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&l(e,t,n+1)}},s=e=>e,a=(e,t)=>{if(e===t)return!0;
17if(null==e||null==t||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(null!=e[i.B])return e[i.B](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!a(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(o.Ej(e)!==o.Ej(t))return!1;for(let n in e)if(!o.i5(e,n)||!a(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!a(e[n],t[n]))return!1;break;default:return!1}return!0},c=(e,t)=>t.includes(e);r.cy},34259:(e,t,n)=>{n.d(t,{o:()=>o});var r=n(12115);let o="u">typeof document?r.useLayoutEffect:r.useEffect},35416:(e,t,n)=>{n.d(t,{t:()=>o});var r=Object.defineProperty,o=(e,t)=>{let n={};for(var o in e)r(n,o,{get:e[o],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:"Module"}),n}},35624:(e,t,n)=>{n.d(t,{I:()=>o});let r={app:100,modal:200,popover:300,overlay:400,max:9999};function o(e){return r[e]}},36158:(e,t,n)=>{n.d(t,{Mj:()=>i,S6:()=>l,pJ:()=>o});var r=n(76865);let o=new r.hs("y-sync"),i=new r.hs("y-undo"),l=new r.hs("yjs-cursor")},36337:(e,t,n)=>{n.d(t,{c:()=>o});var r=n(12115);function o(e){let t=(0,r.useRef)(e);return(0,r.useEffect)(()=>{t.current=e}),(0,r.useMemo)(()=>(...e)=>t.current?.(...e),[])}},37366:(e,t,n)=>{n.d(t,{$:()=>ty,A:()=>tF,An:()=>X,At:()=>eY,Bn:()=>W,Bt:()=>eF,Dt:()=>e0,E:()=>tH,En:()=>ee,Et:()=>e5,Fn:()=>J,Ft:()=>eW,Gn:()=>$,H:()=>tj,Hn:()=>V,It:()=>eV,K:()=>tI,Ln:()=>q,Lt:()=>e$,Mt:()=>eU,Nt:()=>eG,Ot:()=>e1,Pt:()=>eJ,Rn:()=>G,Rt:()=>eD,S:()=>t0,St:()=>e9,T:()=>tV,Tt:()=>e2,Ut:()=>eN,Vn:()=>H,Vt:()=>ez,W:()=>tA,Wn:()=>z,X:()=>tE,Yn:()=>O,_:()=>t3,_n:()=>ea,_t:()=>tt,an:()=>ev,b:()=>tQ,ct:()=>td,dt:()=>tc,f:()=>ne,fn:()=>ec,g:()=>t2,gn:()=>es,gt:()=>e7,h:()=>t5,hn:()=>el,i:()=>na,in:()=>ek,jn:()=>Q,jt:()=>eZ,kn:()=>Z,kt:()=>eQ,l:()=>nr,ln:()=>eu,m:()=>t4,mn:()=>ei,mt:()=>to,n:()=>no,nn:()=>eb,o:()=>ns,on:()=>ey,r:()=>nc,rn:()=>eg,sn:()=>ew,t:()=>nd,tt:()=>tv,u:()=>nn,wt:()=>e4,xt:()=>e6,yn:()=>er,yt:()=>tn,zn:()=>U,zt:()=>eR});var r,o,i=n(13015),l=n(27050),s=n(8242),a=n(82159),c=n(76865),d=n(30200),u=n(62921),p=n(63197),h=class e{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,t,n){e<0||this.cache.set(e,[t,n])}replace(e,t,n,r){this.remove(e),this.set(t,n,r)}remove(e){this.cache.delete(e)}invalidate(t){let n=new e(this.cache),r=t.mapping;return this.cache.forEach(([e,o],i)=>{if(i<0)return;let l=r.mapResult(i),s=t.doc.nodeAt(l.pos);if(l.deleted||!s?.eq(e))n.remove(i);else if(i!==l.pos){let e=o.map(e=>e.map(r,0,0)).filter(e=>null!=e);n.replace(i,l.pos,s,e)}}),n}};function f(e,t,n,r,o){var i,l;let s,a=[],c=[],d=(i=e,l=n,s=[],i.descendants((e,t)=>{if(e.type.isTextblock&&l.includes(e.type.name))return s.push([e,t]),!1}),s);try{for(let[e,n]of d){let i=r(e),l=o.get(n);if(l){let[e,t]=l;t.length>0&&a.push(t)}else{let r=t({content:e.textContent,language:i||void 0,pos:n,size:e.nodeSize});r&&Array.isArray(r)?(o.set(n,e,r),r.length>0&&a.push(r)):r instanceof Promise?(o.remove(n),c.push(r)):console.error("[prosemirror-highlight] Invalid parser result:",r)}}}catch(e){console.error("[prosemirror-highlight] Error parsing code blocks:",e)}return[a.length>0?p.zF.create(e,a.flat()):void 0,c]}var m=n(36158),g=n(8682),b=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,v=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,w=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,x=a.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>
17e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return b("strong",{...(0,a.KV)(this.options.HTMLAttributes,e),children:b("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,a.OX)({find:y,type:this.type}),(0,a.OX)({find:k,type:this.type})]},addPasteRules(){return[(0,a.Zc)({find:v,type:this.type}),(0,a.Zc)({find:w,type:this.type})]}}),C=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&"`"===e[t.index-1]?null:{index:t.index,text:t[0],replaceWith:t[1]}},S=e=>{let t,n=/`([^`]+)`(?!`)/g,r=[];for(;null!==(t=n.exec(e));)t.index>0&&"`"===e[t.index-1]||r.push({index:t.index,text:t[0],replaceWith:t[1]});return r},E=a.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,a.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}}
17,addInputRules(){return[(0,a.OX)({find:C,type:this.type})]},addPasteRules(){return[(0,a.Zc)({find:S,type:this.type})]}}),M=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,T=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,A=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,I=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,N=a.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,a.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
17,addInputRules(){return[(0,a.OX)({find:M,type:this.type}),(0,a.OX)({find:A,type:this.type})]},addPasteRules(){return[(0,a.Zc)({find:T,type:this.type}),(0,a.Zc)({find:I,type:this.type})]}}),j=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,P=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_=a.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,a.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,a.OX)({find:j,type:this.t
17ype})]},addPasteRules(){return[(0,a.Zc)({find:P,type:this.type})]}}),B=a.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,a.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),O=a.YY.create({name:"uniqueID",priority:1e4,addOptions:()=>({attributeName:"id",types:[],setIdAttribute:!1,isWithinEditor:void 0,generateID:()=>
17{if("u">typeof window&&window.__TEST_OPTIONS){let e=window.__TEST_OPTIONS;return void 0===e.mockID?e.mockID=0:e.mockID++,e.mockID.toString()}return(0,d.gZ)()},filterTransaction:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{let t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let{isWithinEditor:e}=this.options,t=null,n=!1;return[new c.k_({key:new c.hs("uniqueID"),appendTransaction:(e,t,n)=>{let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=this.options.filterTransaction&&e.some(e=>!this.options.filterTransaction?.(e));if(!r||o)return;let{tr:i}=n,{types:l,attributeName:s,generateID:c}=this.options,d=(0,a.T7)(t.doc,e),{mapping:u}=d;if((0,a.FF)(d).forEach(({newRange:e})=>{var r;let o=(0,a.Nx)(n.doc,e,e=>l.includes(e.type.name)),d=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}((r=o.map(({node:e})=>e.attrs[s]).filter(e=>null!==e)).filter((e,t)=>r.indexOf(e)!==t));o.forEach(({node:e,pos:r})=>{let o=i.doc.nodeAt(r)?.attrs[s];if(null===o){let o=t.doc.type.createAndFill().content;if(null===t.doc.content.findDiffStart(o)){let t=JSON.parse(JSON.stringify(n.doc.toJSON()));if(t.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(t.content)===JSON.stringify(o.toJSON()))return void i.setNodeMarkup(r,void 0,{...e.attrs,[s]:"initialBlockId"})}i.setNodeMarkup(r,void 0,{...e.attrs,[s]:c()});return}let{deleted:l}=u.invert().mapResult(r);l&&d.includes(o)&&i.setNodeMarkup(r,void 0,{...e.attrs,[s]:c()})})}),i.steps.length)return i.setMeta("uniqueID",!0),i},view(n){let r=r=>{let o=n.dom.parentElement;t=o?.contains(r.target)||e?.(r.target)?o:null};return window.addEventListener("dragstart",r),{destroy(){window.removeEventListener("dragstart",r)}}},props:{handleDOMEvents:{drop:(e,r)=>(n=t!==e.dom.parentElement||r.dataTransfer?.effectAllowed==="copy",t=null,!1),paste:()=>(n=!0,!1)},transformPasted:e=>{if(!n)return e;let{types:t,attributeName:r}=this.options,o=e=>{let n=[];return e.forEach(e=>{if(e.isText)return void n.push(e);if(!t.includes(e.type.name))return void n.push(e.copy(o(e.content)));let i=e.type.create({...e.attrs,[r]:null},o(e.content),e.marks);n.push(i)}),l.FK.from(n)};return n=!1,new l.Ji(o(e.content),e.openStart,e.openEnd)}}})]}});function R(e){return"link"===e.type}function L(e){return"string"!=typeof e&&"link"===e.type}function D(e){return"string"!=typeof e&&"text"===e.type}function $(e){return z(e)?{...e}:F(e)?{type:"tableCell",content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??"default",textColor:e.props?.textColor??"default",textAlignment:e.props?.textAlignment??"left",colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:"tableCell",content:[].concat(e),props:{backgroundColor:"default",textColor:"default",textAlignment:"left",colspan:1,rowspan:1}}}function F(e){return null!=e&&"string"!=typeof e&&!Array.isArray(e)&&"tableCell"===e.type}function z(e){return F(e)&&void 0!==e.props&&void 0!==e.content}function H(e){return z(e)?e.props.colspan??1:1}function V(e){return z(e)?e.props.rowspan??1:1}var U=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}};function W(e,t=!0){let{"data-test":n,...r}=e;if(Object.keys(r).length>0&&t)throw Error("Object must be empty "+JSON.stringify(e))}function J(e,t="Ctrl"){return"u">typeof navigator&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent))?e.replace("Mod","â"):e.replace("Mod",t)}function G(...e){return[...new Set(e.filter(e=>e).join(" ").split(" "))].join(" ")}var q=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),K=(e,t)=>{let n=eQ(e,t.pmSchema);"blockContainer"===n.type.name&&(n=n.firstChild);let r=t.pmSchema.nodes[n.type.name].spec.toDOM;
17if(void 0===r)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let o=r(n);if("object"!=typeof o||!("dom"in o))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return o};function Y(e,t="<br>"){let n=e.querySelectorAll("p");if(n.length>1){let e=n[0];for(let r=1;r<n.length;r++){let o=n[r];e.innerHTML+=t+o.innerHTML,o.remove()}}}function Z(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function X(e){let t=e.split("/");return t.length&&""!==t[t.length-1]?t[t.length-1]:e}function Q(e){try{let t=new URL(e).pathname.split(".").pop()?.toLowerCase()||"";return["mp4","webm","ogg","mov","mkv","flv","avi","wmv","m4v"].includes(t)}catch{return!1}}function ee(e,t,n,r){let o=e();if(void 0===o)throw Error("Cannot find node position");let i=n.state.doc.resolve(o).node().attrs.id;if(!i)throw Error("Block doesn't have id");let l=t.getBlock(i);if(l.type!==r)throw Error("Block type does not match");return l}function et(e,t,n,r,o=!1,i){let l=document.createElement("div");if(void 0!==i)for(let[e,t]of Object.entries(i))"class"!==e&&l.setAttribute(e,t);for(let[e,o]of(l.className=G("bn-block-content",i?.class||""),l.setAttribute("data-content-type",t),Object.entries(n)))o!==r[e].default&&l.setAttribute(Z(e),o);return o&&l.setAttribute("data-file-block",""),l.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=G("bn-inline-content",e.contentDOM.className)),{...e,dom:l}}function en(e,t,n){return (r={})=>{let o="function"==typeof e?e(r):e,i="function"==typeof t?t(r):t,l=n?"function"==typeof n?n(r):n:void 0;return{config:o,implementation:{...i,toExternalHTML(e,t,n){let r=i.toExternalHTML?.call({blockContentDOMAttributes:this.blockContentDOMAttributes},e,t,n);if(void 0!==r)return et(r,e.type,e.props,o.propSchema,i.meta?.fileBlockAccept!==void 0)},render(e,t){return et(i.render.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},e,t),e.type,e.props,o.propSchema,i.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}},extensions:l}}}function er(e,t){let n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:n.pos,node:n.nodeAfter};let r=n.depth,o=n.node(r);for(;r>0;){if(o.type.isInGroup("bnBlock"))return{posBeforeNode:n.before(r),node:o};r--,o=n.node(r)}let i=[];e.descendants((e,t)=>{e.type.isInGroup("bnBlock")&&i.push(t)}),console.warn(`Position ${t} is not within a blockContainer node.`);let l=e.resolve(i.find(e=>e>=t)||i[i.length-1]);return{posBeforeNode:l.pos,node:l.nodeAfter}}function eo(e,t){if(!e.type.isInGroup("bnBlock"))throw Error(`Attempted to get bnBlock node at position but found node of different type ${e.type.name}`);let n={node:e,beforePos:t,afterPos:t+e.nodeSize};if("blockContainer"===e.type.name){let r,o;if(e.forEach((e,n)=>{if("blockContent"===e.type.spec.group){let o=t+n+1;r={node:e,beforePos:o,afterPos:o+e.nodeSize}}else if("blockGroup"===e.type.name){let r=t+n+1;o={node:e,beforePos:r,afterPos:r+e.nodeSize}}}),!r)throw Error(`blockContainer node does not contain a blockContent node in its children: ${e}`);return{isBlockContainer:!0,bnBlock:n,blockContent:r,childContainer:o,blockNoteType:r.node.type.name}}if(!n.node.type.isInGroup("childContainer"))throw Error(`bnBlock node is not in the childContainer group: ${n.node}`);return{isBlockContainer:!1,bnBlock:n,childContainer:n,blockNoteType:n.node.type.name}}function ei(e){return eo(e.node,e.posBeforeNode)}function el(e){if(!e.nodeAfter)throw Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return eo(e.nodeAfter,e.pos)}function es(e){return ei(er(e.doc,e.selection.anchor))}function ea(e){return ei(er(e.doc,e.selection.anchor))}function ec(e){return"doc"in e?e.doc.type.schema:e.type.schema}function ed(e){return e.cached.blockNoteEditor}function eu(e){return ed(e).schema}function ep(e){return eu(e).blockSchema}function eh(e){return eu(e).inlineContentSchema}function ef(e){return eu(e).styleSchema}function em(e){return ed(e).blockCache}function eg(e,t,n){let r={type:"tableContent",columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},o=[];e.content.forEach((e,i,l)=>{let s={cells:[]};
170===l&&e.content.forEach(e=>{let t=e.attrs.colwidth;t??=Array(e.attrs.colspan??1).fill(void 0),r.columnWidths.push(...t)}),s.cells=e.content.content.map((e,r)=>(o[l]||(o[l]=[]),o[l][r]="tableHeader"===e.type.name,{type:"tableCell",content:e.content.content.map(e=>eb(e,t,n)).reduce((e,t)=>{if(!e.length)return t;let n=e[e.length-1],r=t[0];return r&&D(n)&&D(r)&&JSON.stringify(n.styles)===JSON.stringify(r.styles)?(n.text+="\n"+r.text,e.push(...t.slice(1))):e.push(...t),e},[]),props:{colspan:e.attrs.colspan,rowspan:e.attrs.rowspan,backgroundColor:e.attrs.backgroundColor,textColor:e.attrs.textColor,textAlignment:e.attrs.textAlignment}})),r.rows.push(s)});for(let e=0;e<o.length;e++)o[e]?.every(e=>e)&&(r.headerRows=(r.headerRows??0)+1);for(let e=0;e<o[0]?.length;e++)o?.every(t=>t[e])&&(r.headerCols=(r.headerCols??0)+1);return r}function eb(e,t,n){let r=[],o;return e.content.forEach(e=>{if("hardBreak"===e.type.name){if(o)if(D(o))o.text+="\n";else if(R(o))o.content[o.content.length-1].text+="\n";else throw Error("unexpected");else o={type:"text",text:"\n",styles:{}};return}if("link"!==e.type.name&&"text"!==e.type.name)return t[e.type.name]?(o&&=void r.push(o),void r.push(ey(e,t,n))):void console.warn("unrecognized inline content type",e.type.name);let i={},l;for(let t of e.marks)if("link"===t.type.name)l=t;else{let e=n[t.type.name];if(!e){if(t.type.spec.blocknoteIgnore)continue;throw Error(`style ${t.type.name} not found in styleSchema`)}if("boolean"===e.propSchema)i[e.type]=!0;else if("string"===e.propSchema)i[e.type]=t.attrs.stringValue;else throw new U(e.propSchema)}o?D(o)?l?(r.push(o),o={type:"link",href:l.attrs.href,content:[{type:"text",text:e.textContent,styles:i}]}):JSON.stringify(o.styles)===JSON.stringify(i)?o.text+=e.textContent:(r.push(o),o={type:"text",text:e.textContent,styles:i}):R(o)&&(l?o.href===l.attrs.href?JSON.stringify(o.content[o.content.length-1].styles)===JSON.stringify(i)?o.content[o.content.length-1].text+=e.textContent:o.content.push({type:"text",text:e.textContent,styles:i}):(r.push(o),o={type:"link",href:l.attrs.href,content:[{type:"text",text:e.textContent,styles:i}]}):(r.push(o),o={type:"text",text:e.textContent,styles:i})):o=l?{type:"link",href:l.attrs.href,content:[{type:"text",text:e.textContent,styles:i}]}:{type:"text",text:e.textContent,styles:i}}),o&&r.push(o),r}function ey(e,t,n){let r;if("text"===e.type.name||"link"===e.type.name)throw Error("unexpected");let o={},i=t[e.type.name];for(let[t,n]of Object.entries(e.attrs)){if(!i)throw Error("ic node is of an unrecognized type: "+e.type.name);t in i.propSchema&&(o[t]=n)}return r="styled"===i.content?eb(e,t,n):void 0,{type:e.type.name,props:o,content:r}}function ev(e,t,n=ep(t),r=eh(t),o=ef(t),i=em(t)){let l;if(!e.type.isInGroup("bnBlock"))throw Error("Node should be a bnBlock, but is instead: "+e.type.name);let s=i?.get(e);if(s)return s;let a=eo(e,0),c=a.bnBlock.node.attrs.id;null===c&&(c=O.options.generateID());let d=n[a.blockNoteType];if(!d)throw Error("Block is of an unrecognized type: "+a.blockNoteType);let u={};for(let[t,n]of Object.entries({...e.attrs,...a.isBlockContainer?a.blockContent.node.attrs:{}})){let e=d.propSchema;t in e&&(void 0!==e[t].default||void 0!==n)&&(u[t]=n)}let p=n[a.blockNoteType],h=[];if(a.childContainer?.node.forEach(e=>{h.push(ev(e,t,n,r,o,i))}),"inline"===p.content){if(!a.isBlockContainer)throw Error("impossible");l=eb(a.blockContent.node,r,o)}else if("table"===p.content){if(!a.isBlockContainer)throw Error("impossible");l=eg(a.blockContent.node,r,o)}else if("none"===p.content)l=void 0;else throw new U(p.content);let f={id:c,type:p.type,props:u,content:l,children:h};return i?.set(e,f),f}function ek(e,t=ec(e),n=ep(t),r=eh(t),o=ef(t),i=em(t)){let l=[];return e.firstChild&&e.firstChild.descendants(e=>(l.push(ev(e,t,n,r,o,i)),!1)),l}function ew(e,t,n=ep(t),r=eh(t),o=ef(t),i=em(t)){if(0===e.content.childCount)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(1!==e.content.childCount)throw Error("slice must be a single block, did you forget includeParents=true?");
17return function e(l,s,a){if("blockGroup"!==l.type.name)throw Error("unexpected");let c=[],d,u;return l.forEach((p,h,f)=>{if("blockContainer"!==p.type.name)throw Error("unexpected");if(0===p.childCount)return;if(0===p.childCount||p.childCount>2)throw Error("unexpected, blockContainer.childCount: "+p.childCount);let m=0===f,g=f===l.childCount-1;if("blockGroup"===p.firstChild.type.name){if(!m)throw Error("unexpected");let t=e(p.firstChild,Math.max(0,s-1),g?Math.max(0,a-1):0);d=t.blockCutAtStart,g&&(u=t.blockCutAtEnd),c.push(...t.blocks);return}let b=ev(p,t,n,r,o,i),y=p.childCount>1?p.child(1):void 0,v=[];if(y){let t=e(y,0,g?Math.max(0,a-1):0);v=t.blocks,g&&(u=t.blockCutAtEnd)}g&&!y&&a>1&&(u=b.id),m&&s>1&&(d=b.id),c.push({...b,children:v})}),{blocks:c,blockCutAtStart:d,blockCutAtEnd:u}}(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function ex(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function eC(e,t,n,r){return e.dom.setAttribute("data-style-type",t),"string"===r&&e.dom.setAttribute("data-value",n),e.contentDOM&&e.contentDOM.setAttribute("data-editable",""),e}function eS(e,t){return{config:e,implementation:t}}function eE(e,t){return eS({type:e.name,propSchema:t},{mark:e,render(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(void 0===r)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let o=n.pmSchema.mark(e.name,{stringValue:t}),i=l.ZF.renderSpec(document,r(o,!0));if("object"!=typeof i||!("dom"in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return i},toExternalHTML(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(void 0===r)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let o=n.pmSchema.mark(e.name,{stringValue:t}),i=l.ZF.renderSpec(document,r(o,!0));if("object"!=typeof i||!("dom"in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return i}})}function eM(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function eT(e,t){let n=a.CU.create({name:e.type,addAttributes:()=>"boolean"===e.propSchema?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:e=>e.getAttribute("data-value"),renderHTML:e=>void 0===e.stringValue?{}:{"data-value":e.stringValue}}},parseHTML:()=>{var n;let r;return n=t.parse,r=[{tag:`[data-style-type="${e.type}"]`,contentElement:e=>e.matches("[data-editable]")?e:e.querySelector("[data-editable]")||e}],n&&r.push({tag:"*",consuming:!1,getAttrs(e){if("string"==typeof e)return!1;let t=n?.(e);return void 0!==t&&{stringValue:t}}}),r},renderHTML:({mark:n})=>eC((t.toExternalHTML||t.render)(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema),addMarkView:()=>({mark:n})=>eC(t.render(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)});return eS(e,{...t,mark:n,render:n=>eC(t.render(n),e.type,n,e.propSchema),toExternalHTML:n=>eC((t.toExternalHTML||t.render)(n),e.type,n,e.propSchema)})}function eA(e){let t=new Set,n=new Set;for(let[r,o]of e.entries())0===o?t.add(r):n.add(r);return{roots:t,nonRoots:n}}function eI(e,t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),e}function eN(e){let t=new Map;for(let n of e)Array.isArray(n.runsBefore)&&n.runsBefore.length>0?n.runsBefore.forEach(e=>{eI(t,n.key,e)}):eI(t,"default",n.key);let n=function(e){let t=function(e){let t=new Map;for(let[n,r]of e.entries())for(let e of(t.has(n)||t.set(n,0),r)){let n=t.get(e)??0;t.set(e,n+1)}return t}(e),{roots:n,nonRoots:r}=eA(t),o=[];for(;n.size;){o.push(n);let r=new Set;for(let o of n){let n=e.get(o);if(n)for(let e of n){let n=t.get(e);if(void 0===n)continue;let o=n-1;t.set(e,o),0===o&&r.add(e)}}n=r}if((r=eA(t).nonRoots).size)throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(", ")}`);return o}(function(e){let t=new Map;for(let[n,r]of e.entries())for(let e of(t.has(n)||t.set(n,new Set),r))t.has(e)||t.set(e,new Set),t.get(e).add(n);return t}(t)),r=n.findIndex(e=>e.has("default"));return e=>91+(n.findIndex(t=>t.has(e))+r)*10}function ej(e){return e&&Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}var eP=class{BlockNoteEditor="only for types";Block="only for types";PartialBlock="only for types";inlineContentSpecs;styleSpecs;blockSpecs;blockSchema;inlineContentSchema;styleSchema;constructor(e){this.opts=e;let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:o,inlineContentSchema:i,styleSchema:l}=this.init();this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=l,this.inlineContentSpecs=n,this.blockSchema=o,this.inlineContentSchema=i}init(){let e=eN(Object.entries({...this.opts.blockSpecs,...this.opts.inlineContentSpecs,...this.opts.styleSpecs}).map(([e,t])=>({key:e,runsBefore:t.implementation?.runsBefore??[]}))),t=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t,n])=>[t,function(e,t,n,r){let o=t.node||a.bP.create({name:e.type,content:"inline"===e.content?"inline*":"none"===e.content?"":e.content,group:"blockContent",selectable:t.meta?.selectable??!0,isolating:t.meta?.isolating??!0,code:t.meta?.code??!1,defining:t.meta?.defining??!0,priority:r,addAttributes:()=>{var t;let n;return t=e.propSchema,n={},Object.entries(t).forEach(([e,t])=>{n[e]={default:t.default,keepOnSplit:!0,parseHTML:n=>{let r=n.getAttribute(Z(e));if(null===r)return null;if(void 0===t.default&&"boolean"===t.type||void 0!==t.default&&"boolean"==typeof t.default)return"true"===r||"false"!==r&&null;if(void 0===t.default&&"number"===t.type||void 0!==t.default&&"number"==typeof t.default){let e=parseFloat(r);return!Number.isNaN(e)&&Number.isFinite(e)?e:null}return r},renderHTML:n=>n[e]===t.default?{}:{[Z(e)]:n[e]}}}),n},parseHTML:()=>{let n;return n=[{tag:"[data-content-type="+e.type+"]",contentElement:".bn-inline-content"}],t.parse&&n.push({tag:"*",getAttrs(e){if("string"==typeof e)return!1;let n=t.parse?.(e);return void 0!==n&&n},preserveWhitespace:!0,getContent:"inline"===e.content||"none"===e.content?(n,r)=>{if(t.parseContent){let e=t.parseContent({el:n,schema:r});if(void 0!==e)return e}if("inline"===e.content){let e=n.cloneNode(!0);return Y(e,t.meta?.code?"\n":"<br>"),l.S4.fromSchema(r).parse(e,{topNode:r.nodes.paragraph.create(),preserveWhitespace:!0}).content}return l.FK.empty}:void 0}),n},renderHTML({HTMLAttributes:n}
17){let r=document.createElement("div");return et({dom:r,contentDOM:"inline"===e.content?r:void 0},e.type,{},e.propSchema,t.meta?.fileBlockAccept!==void 0,n)},addNodeView(){return n=>{var r;let o=this.options.editor,i=ee(n.getPos,o,this.editor,e.type),l=this.options.domAttributes?.blockContent||{},s=t.render.call({blockContentDOMAttributes:l,props:n,renderType:"nodeView"},i,o);return t.meta?.selectable===!1&&(r=this.editor,s.stopEvent=e=>("mousedown"===e.type&&setTimeout(()=>{r.view.dom.blur()},10),!0)),s}}});if(o.name!==e.type)throw Error("Node name does not match block type. This is a bug in BlockNote.");return{config:e,implementation:{...t,node:o,render(e,n){let r=o.options.domAttributes?.blockContent||{};return t.render.call({blockContentDOMAttributes:r,props:void 0,renderType:"dom"},e,n)},toExternalHTML:(e,n,r)=>{let i=o.options.domAttributes?.blockContent||{};return t.toExternalHTML?.call({blockContentDOMAttributes:i},e,n,r)??t.render.call({blockContentDOMAttributes:i,renderType:"dom",props:void 0},e,n)}},extensions:n}}(n.config,n.implementation,n.extensions,e(t))])),n=Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t,n])=>"object"==typeof n.config?[t,{...n,implementation:{...n.implementation,node:n.implementation?.node.extend({priority:e(t)})}}]:[t,n])),r=Object.fromEntries(Object.entries(this.opts.styleSpecs).map(([t,n])=>[t,{...n,implementation:{...n.implementation,mark:n.implementation?.mark.extend({priority:e(t)})}}]));return{blockSpecs:t,blockSchema:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.config])),inlineContentSpecs:ej(n),styleSpecs:ej(r),inlineContentSchema:ex(n),styleSchema:eM(r)}}extend(e){Object.assign(this.opts.blockSpecs,e.blockSpecs),Object.assign(this.opts.inlineContentSpecs,e.inlineContentSpecs),Object.assign(this.opts.styleSpecs,e.styleSpecs);let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:o,inlineContentSchema:i,styleSchema:l}=this.init();return this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=l,this.inlineContentSpecs=n,this.blockSchema=o,this.inlineContentSchema=i,this}};function e_(e){let{height:t,width:n}=eR(e),r=Array(t).fill(!1).map(()=>Array(n).fill(null)),o=(e,o)=>{for(let i=e;i<t;i++)for(let e=o;e<n;e++)if(!r[i][e])return{row:i,col:e};throw Error("Unable to create occupancy grid for table, no more available cells")};for(let t=0;t<e.content.rows.length;t++)for(let n=0;n<e.content.rows[t].cells.length;n++){let i=$(e.content.rows[t].cells[n]),l=V(i),s=H(i),{row:a,col:c}=o(t,n);for(let e=a;e<a+l;e++)for(let o=c;o<c+s;o++){if(r[e][o])throw Error(`Unable to create occupancy grid for table, cell at ${e},${o} is already occupied`);r[e][o]={row:t,col:n,rowspan:l,colspan:s,cell:i}}}return r}function eB(e){let t=new Set;return e.map(e=>({cells:e.map(e=>!t.has(e.row+":"+e.col)&&(t.add(e.row+":"+e.col),e.cell)).filter(e=>!1!==e)}))}function eO(e,t,n=e_(t)){for(let t=0;t<n.length;t++)for(let r=0;r<n[t].length;r++){let o=n[t][r];if(o&&o.row===e.row&&o.col===e.col)return{row:t,col:r,cell:o.cell}}throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function eR(e){let t=e.content.rows.length,n=0;return e.content.rows.forEach(e=>{let t=0;e.cells.forEach(e=>{t+=H(e)}),n=Math.max(n,t)}),{height:t,width:n}}function eL(e,t,n=e_(t)){let r=n[e.row]?.[e.col];if(r)return{row:r.row,col:r.col,cell:r.cell}}function eD(e,t){let n=e_(e);if(t<0||t>=n.length)return[];let r=0;for(let e=0;e<t;e++){let e=n[r]?.[0];if(!e)return[];r+=e.rowspan}let o=Array(n[0].length).fill(!1).map((t,o)=>eL({row:r,col:o},e,n)).filter(e=>void 0!==e);return o.filter((e,t)=>o.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function e$(e,t){let n=e_(e);if(t<0||t>=n[0].length)return[];let r=0;for(let e=0;e<t;e++){let e=n[0]?.[r];if(!e)return[];r+=e.colspan}let o=Array(n.length).fill(!1).map((t,o)=>eL({row:o,col:r},e,n)).filter(e=>void 0!==e);return o.filter((e,t)=>o.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function eF(e,t,n,r=e_(e)){let{col:o}=eO({row:0,col:t},e,r),{col:i}=eO({row:0,col:n},e,r);return r.forEach(e=>{let[t]=e.splice(o,1);e.splice(i,0,t)}),eB(r)}function ez(e,t,n,r=e_(e)){let{row:o}=eO({row:t,col:0},e,r),{row:i}=eO({row:n,col:0},e,r),[l]=r.splice(o,1);return r.splice(i,0,l),eB(r)}function eH(e){return!e||(F(e)?eH(e.content):"string"==typeof e?0===e.length:!!Array.isArray(e)&&e.every(e=>"string"==typeof e?0===e.length:D(e)?0===e.text.length:!!L(e)&&("string"==typeof e.content?0===e.content.length:e.content.every(e=>0===e.text.length))))}function eV(e,t,n=e_(e)){if("columns"===t){let e=0;for(let t=n[0].length-1;t>=0&&n.every(e=>eH(e[t].cell)&&1===e[t].colspan);t--)e++;for(let t=n.length-1;t>=0;t--){let r=Math.max(n[t].length-e,1);n[t]=n[t].slice(0,r)}return eB(n)}let r=0;for(let e=n.length-1;e>=0&&n[e].every(e=>eH(e.cell)&&1===e.rowspan);e--)r++;let o=Math.min(r,n.length-1);return n.splice(n.length-o,o),eB(n)}function eU(e,t,n,r=e_(e)){let{width:o,height:i}=eR(e);if("columns"===t)r.forEach((e,t)=>{if(n>=0)for(let r=0;r<n;r++)e.push({row:t,col:Math.max(...e.map(e=>e.col))+1,rowspan:1,colspan:1,cell:$("")});else e.splice(o+n,-1*n)});else if(n>0)for(let e=0;e<n;e++){let t=Array(o).fill(null).map((t,n)=>({row:i+e,col:n,rowspan:1,colspan:1,cell:$("")}));r.push(t)}else n<0&&r.splice(i+n,-1*n);return eB(r)}function eW(e,t,n){let r=eD(e,n);if(!r.some(e=>V(e.cell)>1))return!0;let o=n,i=n;
17return r.forEach(e=>{let t=V(e.cell);o=Math.max(o,e.row+t-1),i=Math.min(i,e.row)}),t<n?n===o:n===i}function eJ(e,t,n){let r=e$(e,n);if(!r.some(e=>H(e.cell)>1))return!0;let o=n,i=n;return r.forEach(e=>{let t=H(e.cell);o=Math.max(o,e.col+t-1),i=Math.min(i,e.col)}),t<n?n===o:n===i}function eG(e,t,n){let r=eO(e,n),o=eO(t,n);return r.col===o.col}function eq(e,t,n,r){let o=[];for(let[r,i]of Object.entries(e.styles||{})){let e=n[r];if(!e)throw Error(`style ${r} not found in styleSchema`);if("boolean"===e.propSchema)i&&o.push(t.mark(r));else if("string"===e.propSchema)i&&o.push(t.mark(r,{stringValue:i}));else throw new U(e.propSchema)}return r&&t.nodes[r].spec.code?e.text.length>0?[t.text(e.text,o)]:[]:e.text.split(/(\n)/g).filter(e=>e.length>0).map(e=>"\n"===e?t.nodes.hardBreak.createChecked():t.text(e,o))}function eK(e,t,n,r){let o=[];if("string"==typeof e)return o.push(...eq({type:"text",text:e,styles:{}},t,n,r)),o;for(let i of e)o.push(...eq(i,t,n,r));return o}function eY(e,t,n,r=ef(t)){let o=[];for(let i of e)"string"==typeof i?o.push(...eK(i,t,r,n)):L(i)?o.push(...function(e,t,n){let r=t.marks.link.create({href:e.href});return eK(e.content,t,n).map(e=>{if("text"===e.type.name)return e.mark([...e.marks,r]);if("hardBreak"===e.type.name)return e;throw Error("unexpected node type")})}(i,t,r)):D(i)?o.push(...eK([i],t,r,n)):o.push(eX(i,t,r));return o}function eZ(e,t,n=ef(t)){let r=[],o=Array(e.headerRows??0).fill(!0),i=Array(e.headerCols??0).fill(!0),l=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){let a=e.rows[s],c=[],d=o[s];for(let r=0;r<a.cells.length;r++){let o=a.cells[r],u=i[r],p=null,h=eO({row:s,col:r},{type:"table",content:e}),f=l[h.col]?[l[h.col]]:null;if(o)if("string"==typeof o)p=t.text(o);else if(F(o)){o.content&&(p=eY(o.content,t,"tableParagraph",n));let e=H(o);e>1&&(f=Array(e).fill(!1).map((e,t)=>l[h.col+t]??void 0))}else p=eY(o,t,"tableParagraph",n);let m=t.nodes[u||d?"tableHeader":"tableCell"].createChecked({...F(o)?o.props:{},colwidth:f},t.nodes.tableParagraph.createChecked(void 0,p));c.push(m)}let u=t.nodes.tableRow.createChecked({},c);r.push(u)}return r}function eX(e,t,n){let r,o=e.type;if(void 0===o&&(o="paragraph"),!t.nodes[o])throw Error(`node type ${o} not found in schema`);if(e.content)if("string"==typeof e.content){let i=eY([e.content],t,o,n);r=t.nodes[o].createChecked(e.props,i)}else if(Array.isArray(e.content)){let i=eY(e.content,t,o,n);r=t.nodes[o].createChecked(e.props,i)}else if("tableContent"===e.content.type){let i=eZ(e.content,t,n);r=t.nodes[o].createChecked(e.props,i)}else throw new U(e.content.type);else r=t.nodes[o].createChecked(e.props);return r}function eQ(e,t,n=ef(t)){let r=e.id;void 0===r&&(r=O.options.generateID());let o=[];if(e.children)for(let r of e.children)o.push(eQ(r,t,n));if(!e.type||t.nodes[e.type].isInGroup("blockContent")){let i=eX(e,t,n),l=o.length>0?t.nodes.blockGroup.createChecked({},o):void 0;return t.nodes.blockContainer.createChecked({id:r,...e.props},l?[i,l]:i)}if(t.nodes[e.type].isInGroup("bnBlock"))return t.nodes[e.type].create({id:r,...e.props},o);throw Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}function e0(e,t){let n,r;if(t.firstChild.descendants((t,o)=>!n&&(!e1(t)||t.attrs.id!==e||(n=t,r=o+1,!1))),void 0!==n&&void 0!==r)return{node:n,posBeforeNode:r}}function e1(e){return e.type.isInGroup("bnBlock")}var e2=(e,t)=>({tr:n,dispatch:r})=>(r&&e5(n,e,t),!0);function e5(e,t,n,r,o){let i=el(e.doc.resolve(t)),s=null;"table"===i.blockNoteType&&(s=function(e){let t="selection"in e?e.selection:null;if(!(t instanceof c.U3))return null;let n=e.doc.resolve(t.head),r=-1,o=-1;for(let e=n.depth;e>=0;e--){let t=n.node(e).type.name;if(r<0&&("tableCell"===t||"tableHeader"===t)&&(r=e),"table"===t){o=e;break}}if(r<0||o<0)return null;let i=n.before(r),l=n.before(o),s=e.doc.nodeAt(l);if(!s||"table"!==s.type.name)return null;let a=u.J3.get(s),d=i-(l+1),p=a.map.indexOf(d);return p<0?null:{row:Math.floor(p/a.width),col:p%a.width,offset:Math.max(0,t.head-(i+1+1))}}(e));let a=ec(e);if(void 0!==r&&void 0!==o&&r>o)throw Error("Invalid replaceFromPos or replaceToPos");let d=a.nodes[i.blockNoteType],p=a.nodes[n.type||i.blockNoteType],h=p.isInGroup("bnBlock")?p:a.nodes.blockContainer;if(i.isBlockContainer&&p.isInGroup("blockContent")){let t=void 0!==r&&r>i.blockContent.beforePos&&r<i.blockContent.afterPos?r-i.blockContent.beforePos-1:void 0,s=void 0!==o&&o>i.blockContent.beforePos&&o<i.blockContent.afterPos?o-i.blockContent.beforePos-1:void 0;
17e3(n,e,i),function(e,t,n,r,o,i,s){let a=ec(t),c="keep";if(e.content)if("string"==typeof e.content)c=eY([e.content],a,r.name);else if(Array.isArray(e.content))c=eY(e.content,a,r.name);else if("tableContent"===e.content.type)c=eZ(e.content,a);else throw new U(e.content.type);else""===n.spec.content||r.spec.content!==n.spec.content&&(c=[]);if("keep"===c)t.setNodeMarkup(o.blockContent.beforePos,r,{...o.blockContent.node.attrs,...e.props});else if(void 0!==i||void 0!==s){t.setNodeMarkup(o.blockContent.beforePos,r,{...o.blockContent.node.attrs,...e.props});let n=o.blockContent.beforePos+1+(i??0),a=o.blockContent.beforePos+1+(s??o.blockContent.node.content.size),d=t.doc.resolve(o.blockContent.beforePos).depth,u=t.doc.resolve(n).depth,p=t.doc.resolve(a).depth;t.replace(n,a,new l.Ji(l.FK.from(c),u-d-1,p-d-1))}else t.replaceWith(o.blockContent.beforePos,o.blockContent.afterPos,r.createChecked({...o.blockContent.node.attrs,...e.props},c))}(n,e,d,p,i,t,s)}else if(!i.isBlockContainer&&p.isInGroup("bnBlock"))e3(n,e,i);else{let t=eQ({children:ev(i.bnBlock.node,a).children,...n},a);t.check(),e.replaceWith(i.bnBlock.beforePos,i.bnBlock.afterPos,t);return}
17e.setNodeMarkup(i.bnBlock.beforePos,h,{...i.bnBlock.node.attrs,...n.props}),s&&function(e,t,n){if("table"!==t.blockNoteType)return;let r=-1;if(t.isBlockContainer)r=e.mapping.map(t.blockContent.beforePos);else{let n=e.mapping.map(t.bnBlock.beforePos),o=n+(e.doc.nodeAt(n)?.nodeSize||0);e.doc.nodesBetween(n,o,(e,t)=>"table"!==e.type.name||(r=t,!1))}let o=r>=0?e.doc.nodeAt(r):null;if(!o||"table"!==o.type.name)return;let i=u.J3.get(o),l=Math.max(0,Math.min(n.row,i.height-1)),s=Math.max(0,Math.min(n.col,i.width-1)),a=l*i.width+s,d=i.map[a];if(null==d)return;let p=r+1+d+1,h=e.doc.nodeAt(p),f=p+1,m=h?h.content.size:0,g=f+Math.max(0,Math.min(n.offset,m));"selection"in e&&e.setSelection(c.U3.create(e.doc,g))}(e,i,s)}function e3(e,t,n){let r=ec(t);if(void 0!==e.children&&e.children.length>0){let o=e.children.map(e=>{let t=eQ(e,r);return t.check(),t});if(n.childContainer)t.step(new s.Ln(n.childContainer.beforePos+1,n.childContainer.afterPos-1,new l.Ji(l.FK.from(o),0,0)));else{if(!n.isBlockContainer)throw Error("impossible");t.insert(n.blockContent.afterPos,r.nodes.blockGroup.createChecked({},o))}}}function e4(e,t,n,r,o){let i="string"==typeof t?t:t.id,l=e0(i,e.doc);if(!l)throw Error(`Block with ID ${i} not found`);return e5(e,l.posBeforeNode,n,r,o),ev(e.doc.resolve(l.posBeforeNode+1).node(),ec(e))}var e9={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},e6={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}},e7={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},e8=e=>{let t={};return e.hasAttribute("data-background-color")?t.backgroundColor=e.getAttribute("data-background-color"):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute("data-text-color")?t.textColor=e.getAttribute("data-text-color"):e.style.color&&(t.textColor=e.style.color),t.textAlignment=e7.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},te=(e,t)=>{e.backgroundColor&&e.backgroundColor!==e7.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in e9?e9[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==e7.textColor.default&&(t.style.color=e.textColor in e9?e9[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==e7.textAlignment.default&&(t.style.textAlign=e.textAlignment)},tt=(e="backgroundColor")=>({default:e7.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):e.style.backgroundColor?e.style.backgroundColor:e7.backgroundColor.default,renderHTML:t=>t[e]===e7.backgroundColor.default?{}:{"data-background-color":t[e]}}),tn=(e="textColor")=>({default:e7.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):e.style.color?e.style.color:e7.textColor.default,renderHTML:t=>t[e]===e7.textColor.default?{}:{"data-text-color":t[e]}}),tr=(e,t)=>{let n=e.querySelector(t);if(n)return{targetElement:n,caption:e.querySelector("figcaption")?.textContent??void 0}},to=(0,i.t)(({editor:e})=>{let t=(0,i.n)(void 0);function n(){t.setState(void 0)}return{key:"filePanel",store:t,mount({signal:t}){let r=e.onChange(n,!1),o=e.onSelectionChange(n,!1);t.addEventListener("abort",()=>{r(),o()})},closeMenu:n,showMenu(e){t.setState(e)}}}),ti=(e,t,n,r)=>{let o=""!==e.props.url&&!!e.props.caption,i=document.createElement(o?"figure":"div");if(i.className="bn-file-block-content-wrapper",""===e.props.url){let n,o,l,s,a,
17c=((n=document.createElement("div")).className="bn-add-file-button",(o=document.createElement("div")).className="bn-add-file-button-icon",r?o.appendChild(r):o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',n.appendChild(o),(l=document.createElement("p")).className="bn-add-file-button-text",l.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,n.appendChild(l),s=e=>{e.preventDefault(),e.stopPropagation()},a=()=>{t.isEditable&&t.getExtension(to)?.showMenu(e.id)},n.addEventListener("mousedown",s,!0),n.addEventListener("click",a,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",s,!0),n.removeEventListener("click",a,!0)}});i.appendChild(c.dom);let d=t.onUploadStart(t=>{if(t===e.id){i.removeChild(c.dom);let e=document.createElement("div");e.className="bn-file-loading-preview",e.textContent="Loading...",i.appendChild(e)}});return{dom:i,destroy:()=>{d(),c.destroy()}}}let l={dom:i};if(!1!==e.props.showPreview&&n)i.appendChild(n.dom);else{let t,n,r,o=((t=document.createElement("div")).className="bn-file-name-with-icon",(n=document.createElement("div")).className="bn-file-icon",n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',t.appendChild(n),(r=document.createElement("p")).className="bn-file-name",r.textContent=e.props.name,t.appendChild(r),{dom:t});i.appendChild(o.dom),l.destroy=()=>{o.destroy?.()}}if(e.props.caption){let t=document.createElement("figcaption");t.className="bn-file-caption",t.textContent=e.props.caption,i.appendChild(t)}return l},tl=(e,t)=>{let n=document.createElement("figure"),r=document.createElement("figcaption");return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},ts=(e,t)=>{let n=document.createElement("div"),r=document.createElement("p");return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},ta=e=>({url:e.src||void 0}),tc=e=>({type:"audio",propSchema:{backgroundColor:e7.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},content:"none"}),td=(e={})=>e=>{if("AUDIO"===e.tagName){if(e.closest("figure"))return;let{backgroundColor:t}=e8(e);return{...ta(e),backgroundColor:t}}if("FIGURE"===e.tagName){let t=tr(e,"audio");if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:o}=e8(e);return{...ta(n),backgroundColor:o,caption:r}}},tu=en(tc,e=>({meta:{fileBlockAccept:["audio/*"]},parse:td(e),render:((e={})=>(t,n)=>{let r=document.createElement("div");r.innerHTML=e.icon??'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>';let o=document.createElement("audio");return o.className="bn-audio",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{o.src=e}):o.src=t.props.url,o.controls=!0,o.contentEditable="false",o.draggable=!1,ti(t,n,{dom:o},r.firstElementChild)})(e),toExternalHTML:((e={})=>(e,t)=>{let n;return e.props.url?(e.props.showPreview?(n=document.createElement("audio")).src=e.props.url:((n=document.createElement("a")).href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?tl(n,e.props.caption):ts(n,e.props.caption):{dom:n}):{dom:document.createElement("audio")}})(e),runsBefore:["file"]})),tp=Symbol.for("blocknote.shikiParser"),th=Symbol.for("blocknote.shikiHighlighterPromise"),tf=en(({defaultLanguage:e="text"})=>({type:"codeBlock",propSchema:{language:{default:e}},content:"inline"}),e=>({meta:{code:!0,defining:!0,isolating:!1},parse:e=>{if("PRE"!==e.tagName||1!==e.childElementCount||e.firstElementChild?.tagName!=="CODE")return;let t=e.firstElementChild;return{language:t.getAttribute("data-language")||t.className.split(" ").find(e=>e.includes("language-"))?.replace("language-","")}},parseContent:({el:e,schema:t})=>{let n=l.S4.fromSchema(t),r=e.firstElementChild;return n.parse(r,{preserveWhitespace:"full",topNode:t.nodes.codeBlock.create()}).content},render(t,n){let r,o=document.createDocumentFragment(),i=document.createElement("pre"),l=document.createElement("code");if(i.appendChild(l),e.supportedLanguages){let i=document.createElement("select");if(Object.entries(e.supportedLanguages??{}
17).forEach(([e,{name:t}])=>{let n=document.createElement("option");n.value=e,n.text=t,i.appendChild(n)}),i.value=t.props.language||e.defaultLanguage||"text",n.isEditable){let e=e=>{let r=e.target.value;n.updateBlock(t.id,{props:{language:r}})};i.addEventListener("change",e),r=()=>i.removeEventListener("change",e)}else i.disabled=!0;let l=document.createElement("div");l.contentEditable="false",l.appendChild(i),o.appendChild(l)}return o.appendChild(i),{dom:o,contentDOM:l,destroy:()=>{r?.()}}},toExternalHTML(e){let t=document.createElement("pre"),n=document.createElement("code");return n.className=`language-${e.props.language}`,n.dataset.language=e.props.language,t.appendChild(n),{dom:t,contentDOM:n}}}),e=>{let t,n,r;return[(0,i.t)({key:"code-block-highlighter",prosemirrorPlugins:[(t=globalThis,function({parser:e,nodeTypes:t=["code_block","codeBlock"],languageExtractor:n=e=>e.attrs.language}){let r=new c.hs("prosemirror-highlight");return new c.k_({key:r,state:{init(r,o){let i=new h,[l,s]=f(o.doc,e,t,n,i);return{cache:i,decorations:l,promises:s}},apply:(r,o)=>{let i=o.cache.invalidate(r),l=!!r.getMeta("prosemirror-highlight-refresh");if(!r.docChanged&&!l)return{cache:i,decorations:o.decorations?.map(r.mapping,r.doc),promises:o.promises};let[s,a]=f(r.doc,e,t,n,i);return{cache:i,decorations:s,promises:a}}},view:e=>{let t=new Set,n=()=>{if(t.size>0||e.isDestroyed)return;let n=e.state.tr.setMeta("prosemirror-highlight-refresh",!0);e.dispatch(n)},o=()=>{let o=r.getState(e.state);for(let e of o?.promises??[])t.add(e),e.then(()=>{t.delete(e),n()}).catch(n=>{console.error("[prosemirror-highlight] Error resolving parser:",n),t.delete(e)})};return o(),{update:()=>{o()}}},props:{decorations(e){return this.getState(e)?.decorations}}})}({parser:o=>{var i;if(!e.createHighlighter)return[];if(!n)return t[th]=t[th]||e.createHighlighter(),t[th].then(e=>{n=e});let l=tm(e,o.language);return l&&"text"!==l&&"none"!==l&&"plaintext"!==l&&"txt"!==l?n.getLoadedLanguages().includes(l)?(r||(r=t[tp]||(i=n,function({content:e,language:t,pos:n,size:r}){let o=[],{tokens:l,fg:s,bg:a,rootStyle:c}=i.codeToTokens(e,{lang:t,...(void 0)??{theme:i.getLoadedThemes()[0]}}),d=c||(s&&a?`--prosemirror-highlight:${s};--prosemirror-highlight-bg:${a}`:"");if(d){let e=p.NZ.node(n,n+r,{style:d});o.push(e)}let u=n+1;for(let e of l){for(let t of e){var h;let e=u+t.content.length,n=p.NZ.inline(u,e,{style:"string"==typeof(h=t.htmlStyle??`color: ${t.color}`)?h:Object.entries(h).map(([e,t])=>`${e}:${t}`).join(";"),class:"shiki"});o.push(n),u=e}u+=1}return o}),t[tp]=r),r(o)):n.loadLanguage(l):[]},languageExtractor:e=>e.attrs.language,nodeTypes:["codeBlock"]}))]}),(0,i.t)({key:"code-block-keyboard-shortcuts",keyboardShortcuts:{Delete:({editor:e})=>e.transact(t=>{let{block:n}=e.getTextCursorPosition();if("codeBlock"!==n.type)return!1;let{$from:r}=t.selection;return!r.parent.textContent&&(e.removeBlocks([n]),!0)}),Tab:({editor:t})=>!1!==e.indentLineWithTab&&t.transact(e=>{let{block:n}=t.getTextCursorPosition();return"codeBlock"===n.type&&(e.insertText(" "),!0)}),Enter:({editor:e})=>e.transact(t=>{let{block:n,nextBlock:r}=e.getTextCursorPosition();if("codeBlock"!==n.type)return!1;let{$from:o}=t.selection,i=o.parentOffset===o.parent.nodeSize-2,l=o.parent.textContent.endsWith("\n\n");if(i&&l){if(t.delete(o.pos-2,o.pos),r)return e.setTextCursorPosition(r,"start"),!0;let[i]=e.insertBlocks([{type:"paragraph"}],n,"after");return e.setTextCursorPosition(i,"start"),!0}return t.insertText("\n"),!0}),"Shift-Enter":({editor:e})=>e.transact(()=>{let{block:t}=e.getTextCursorPosition();if("codeBlock"!==t.type)return!1;let[n]=e.insertBlocks([{type:"paragraph"}],t,"after");return e.setTextCursorPosition(n,"start"),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{let n=t[1].trim();return{type:"codeBlock",props:{language:({language:tm(e,n)??n}).language},content:[]}}}]})]});function tm(e,t){return Object.entries(e.supportedLanguages??{}).find(([e,{aliases:n}])=>n?.includes(t)||e===t)?.[0]}var tg=en(()=>({type:"divider",propSchema:{},content:"none"}),{meta:{isolating:!1},parse(e){if("HR"===e.tagName)return{}},render:()=>({dom:document.createElement("hr")})},[(0,i.t)({key:"divider-block-shortcuts",inputRules:[{find:RegExp("^---$"),replace:()=>({type:"divider",props:{},content:[]})}]})]),tb=e=>({url:e.src||void 0}),ty=()=>({type:"file",propSchema:{backgroundColor:e7.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},content:"none"}),tv=()=>e=>{if("EMBED"===e.tagName){if(e.closest("figure"))return;let{backgroundColor:t}=e8(e);return{...tb(e),backgroundColor:t}}if("FIGURE"===e.tagName){let t=tr(e,"embed");if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:o}=e8(e);return{...tb(n),backgroundColor:o,caption:r}}},tk=en(ty,{meta:{fileBlockAccept:["*/*"]},parse:tv(),render:(e,t)=>ti(e,t),toExternalHTML(e){if(!e.props.url)return{dom:document.createElement("embed")};let t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?ts(t,e.props.caption):{dom:t}}});function tw(e,t,n){let r=l.S4.fromSchema(t),o=e.querySelector(":scope > summary"),i;if(o){let e=o.cloneNode(!0);Y(e),i=r.parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}else i=l.FK.empty;let s=document.createElement("div");s.setAttribute("data-node-type","blockGroup");let a=!1;for(let t of Array.from(e.childNodes))"SUMMARY"!==t.tagName&&(3!==t.nodeType||t.textContent?.trim())&&(a=!0,s.appendChild(t.cloneNode(!0)));let c=t.nodes[n].create({},i);if(!a)return c.content;let d=r.parse(s,{topNode:t.nodes.blockGroup.create()});return d.content.size>0?c.content.addToEnd(d):c.content}var tx={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?"true":"false"),get:e=>"true"===window.localStorage.getItem(`toggle-${e.id}`)},tC=(e,t,n,r=tx)=>
17{if("isToggleable"in e.props&&!e.props.isToggleable)return{dom:n};let o=document.createElement("div"),i=document.createElement("div");i.className="bn-toggle-wrapper";let l=document.createElement("button");l.className="bn-toggle-button",l.type="button",l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>';let s=e=>e.preventDefault();l.addEventListener("mousedown",s);let a=()=>{"true"===i.getAttribute("data-show-children")?(i.setAttribute("data-show-children","false"),r.set(t.getBlock(e),!1),o.contains(c)&&o.removeChild(c)):(i.setAttribute("data-show-children","true"),r.set(t.getBlock(e),!0),t.isEditable&&t.getBlock(e)?.children.length===0&&!o.contains(c)&&o.appendChild(c))};l.addEventListener("click",a),i.appendChild(l),i.appendChild(n);let c=document.createElement("button");c.className="bn-toggle-add-block-button",c.type="button",c.textContent=t.dictionary.toggle_blocks.add_block_button;let d=e=>e.preventDefault();c.addEventListener("mousedown",d);let u=()=>{t.transact(()=>{let n=t.updateBlock(e,{children:[{}]});
17t.setTextCursorPosition(n.children[0].id,"end"),t.focus()})};c.addEventListener("click",u),o.appendChild(i);let p=e.children.length,h=t.onChange(()=>{let n=t.getBlock(e)?.children.length??0;n>p?("false"===i.getAttribute("data-show-children")&&(i.setAttribute("data-show-children","true"),r.set(t.getBlock(e),!0)),o.contains(c)&&o.removeChild(c)):0===n&&n<p&&("true"===i.getAttribute("data-show-children")&&(i.setAttribute("data-show-children","false"),r.set(t.getBlock(e),!1)),o.contains(c)&&o.removeChild(c)),p=n});return r.get(e)?(i.setAttribute("data-show-children","true"),t.isEditable&&0===e.children.length&&o.appendChild(c)):i.setAttribute("data-show-children","false"),{dom:o,ignoreMutation:e=>e instanceof MutationRecord&&("attributes"===e.type&&e.target===i&&"data-show-children"===e.attributeName||"childList"===e.type&&(e.addedNodes[0]===c||e.removedNodes[0]===c)),destroy:()=>{l.removeEventListener("mousedown",s),l.removeEventListener("click",a),c.removeEventListener("mousedown",d),c.removeEventListener("click",u),h?.()}}},tS=[1,2,3,4,5,6],tE=en(({defaultLevel:e=1,levels:t=tS,allowToggleHeadings:n=!0}={})=>({type:"heading",propSchema:{...e7,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:"inline"}),({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1},parse(t){let n;if(e&&"DETAILS"===t.tagName){let e=t.querySelector(":scope > summary");if(!e)return;let n=e.querySelector("h1, h2, h3, h4, h5, h6");return n?{...e8(n),level:parseInt(n.tagName[1]),isToggleable:!0}:void 0}switch(t.tagName){case"H1":n=1;break;case"H2":n=2;break;case"H3":n=3;break;case"H4":n=4;break;case"H5":n=5;break;case"H6":n=6;break;default:return}return{...e8(t),level:n}},...e?{parseContent:({el:e,schema:t})=>{if("DETAILS"===e.tagName)return tw(e,t,"heading")}}:{},runsBefore:["toggleListItem"],render(t,n){let r=document.createElement(`h${t.props.level}`);return e?{...tC(t,n,r),contentDOM:r}:{dom:r,contentDOM:r}},toExternalHTML(t){let n=document.createElement(`h${t.props.level}`);if(te(t.props,n),e&&t.props.isToggleable){let e=document.createElement("details");e.setAttribute("open","");let t=document.createElement("summary");return t.appendChild(n),e.appendChild(t),{dom:e,contentDOM:n,childrenDOM:e}}return{dom:n,contentDOM:n}}}),({levels:e=tS}={})=>[(0,i.t)({key:"heading-shortcuts",keyboardShortcuts:Object.fromEntries(e.map(e=>[`Mod-Alt-${e}`,({editor:t})=>{let n=t.getTextCursorPosition();return"inline"===t.schema.blockSchema[n.block.type].content&&(t.updateBlock(n.block,{type:"heading",props:{level:e}}),!0)}])??[]),inputRules:e.map(e=>({find:RegExp(`^(#{${e}})\\s$`),replace:({match:e})=>({type:"heading",props:{level:e[1].length}})}))})]),tM=(e,t,n,r,o)=>{let{dom:i,destroy:l}=ti(e,t,n,o);i.style.position="relative",e.props.url&&e.props.showPreview&&(e.props.previewWidth?i.style.width=`${e.props.previewWidth}px`:i.style.width="fit-content");let s=document.createElement("div");s.className="bn-resize-handle",s.style.left="4px",s.style.display="none",r.appendChild(s);let a=document.createElement("div");a.className="bn-resize-handle",a.style.right="4px",a.style.display="none",r.appendChild(a);let c=document.createElement("div");c.style.position="absolute",c.style.height="100%",c.style.width="100%";let d,u=e.props.previewWidth,p=n=>{if(!d){t.isEditable||(s.style.display="none",a.style.display="none");return}let r="touches"in n?n.touches[0].clientX:n.clientX;u=Math.min(Math.max("center"===e.props.textAlignment?"left"===d.handleUsed?d.initialWidth+(d.initialClientX-r)*2:d.initialWidth+(r-d.initialClientX)*2:"left"===d.handleUsed?d.initialWidth+d.initialClientX-r:d.initialWidth+r-d.initialClientX,64),t.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE),i.style.width=`${u}px`},h=n=>{n.target&&i.contains(n.target)&&t.isEditable||(s.style.display="none",a.style.display="none"),d&&(d=void 0,i.contains(c)&&i.removeChild(c),t.updateBlock(e,{props:{previewWidth:u}}))},f=()=>{t.isEditable&&(s.style.display="",a.style.display="")},m=e=>{e.relatedTarget===s||e.relatedTarget===a||d||t.isEditable&&(s.style.display="none",a.style.display="none")},g=e=>{e.preventDefault(),i.contains(c)||i.appendChild(c);let t="touches"in e?e.touches[0].clientX:e.clientX;d={handleUsed:"left",initialWidth:i.clientWidth,initialClientX:t}},b=e=>{e.preventDefault(),i.contains(c)||i.appendChild(c);let t="touches"in e?e.touches[0].clientX:e.clientX;d={handleUsed:"right",initialWidth:i.clientWidth,initialClientX:t}};return window.addEventListener("mousemove",p),window.addEventListener("touchmove",p),window.addEventListener("mouseup",h),window.addEventListener("touchend",h),i.addEventListener("mouseenter",f),i.addEventListener("mouseleave",m),s.addEventListener("mousedown",g),s.addEventListener("touchstart",g),a.addEventListener("mousedown",b),a.addEventListener("touchstart",b),{dom:i,destroy:()=>{l?.(),window.removeEventListener("mousemove",p),window.removeEventListener("touchmove",p),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h),i.removeEventListener("mouseenter",f),i.removeEventListener("mouseleave",m),s.removeEventListener("mousedown",g),s.removeEventListener("touchstart",g),a.removeEventListener("mousedown",b),a.removeEventListener("touchstart",b)}}},tT=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.alt||void 0}),tA=(e={})=>({type:"image",propSchema:{textAlignment:e7.textAlignment,backgroundColor:e7.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:void 0,type:"number"}},content:"none"}),tI=(e={})=>e=>{if("IMG"===e.tagName){if(e.closest("figure"))return;let{backgroundColor:t}=e8(e);return{...tT(e),backgroundColor:t}}if("FIGURE"===e.tagName){let t=tr(e,"img");if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:o}=e8(e);return{...tT(n),backgroundColor:o,caption:r}}},tN=en(tA,e=>({meta:{fileBlockAccept:["image/*"]},parse:tI(e),render:((e={})=>(t,n)=>{let r=document.createElement("div");r.innerHTML=e.icon??'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>';let o=document.createElement("div");o.className="bn-visual-media-wrapper";let i=document.createElement("img");return i.className="bn-visual-media",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.alt=t.props.name||"",i.contentEditable="false",i.draggable=!1,t.props.previewWidth&&(i.width=t.props.previewWidth),o.appendChild(i),tM(t,n,{dom:o},o,r.firstElementChild)})(e),toExternalHTML:((e={})=>(e,t)=>{let n;return e.props.url?(e.props.showPreview?((n=document.createElement("img")).src=e.props.url,n.alt=e.props.name||"",e.props.previewWidth&&(n.width=e.props.previewWidth)):((n=document.createElement("a")).href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?tl(n,e.props.caption):ts(n,e.props.caption):{dom:n}):{dom:document.createElement("img")}})(e),runsBefore:["file"]})),tj=(e,t,n)=>({state:r,dispatch:o})=>!o||tP(r.tr,e,t,n),tP=(e,t,n,r)=>{let o=ei(er(e.doc,t));if(!o.isBlockContainer)return!1;let i=ec(e),l=[{type:o.bnBlock.node.type,attrs:r?{...o.bnBlock.node.attrs,id:void 0}:{}},{type:n?o.blockContent.node.type:i.nodes.paragraph,attrs:r?{...o.blockContent.node.attrs}:{}}];return e.split(t,2,l),!0},t_=(e,t)=>
17{let{blockInfo:n,selectionEmpty:r}=e.transact(e=>({blockInfo:ea(e),selectionEmpty:e.selection.anchor===e.selection.head}));if(!n.isBlockContainer)return!1;let{bnBlock:o,blockContent:i}=n;return i.node.type.name===t&&!!r&&(0===i.node.childCount?(e.transact(e=>{e5(e,o.beforePos,{type:"paragraph",props:{}})}),!0):i.node.childCount>0&&e.transact(e=>(e.deleteSelection(),tP(e,e.selection.from,!0))))};function tB(e,t,n){let r=l.S4.fromSchema(t),o=document.createElement("div");for(let t of(o.setAttribute("data-node-type","blockGroup"),Array.from(e.childNodes)))o.appendChild(t.cloneNode(!0));let i=r.parse(o,{topNode:t.nodes.blockGroup.create()});i.firstChild?.firstChild?.type.name==="checkListItem"&&(i=i.copy(i.content.cut(i.firstChild.firstChild.nodeSize+2)));let s=i.firstChild?.firstChild;if(!s?.isTextblock)return l.FK.from(i);let a=t.nodes[n].create({},s.content),c=i.content.cut(s.nodeSize+2);if(c.size>0){let e=i.copy(c);return a.content.addToEnd(e)}return a.content}var tO=en(()=>({type:"bulletListItem",propSchema:{...e7},content:"inline"}),{meta:{isolating:!1},parse(e){if("LI"!==e.tagName)return;let t=e.parentElement;if(null===t||"UL"===t.tagName||"DIV"===t.tagName&&t.parentElement?.tagName==="UL"||!e.closest("ul, ol"))return e8(e)},parseContent:({el:e,schema:t})=>tB(e,t,"bulletListItem"),render(){let e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement("li"),n=document.createElement("p");return te(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[(0,i.t)({key:"bullet-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>t_(e,"bulletListItem"),"Mod-Shift-8":({editor:e})=>{let t=e.getTextCursorPosition();return"inline"===e.schema.blockSchema[t.block.type].content&&(e.updateBlock(t.block,{type:"bulletListItem",props:{}}),!0)}},inputRules:[{find:/^\s?[-+*]\s$/,replace({editor:e}){if("heading"!==es(e.prosemirrorState).blockNoteType)return{type:"bulletListItem",props:{}}}}]})]),tR=en(()=>({type:"checkListItem",propSchema:{...e7,checked:{default:!1,type:"boolean"}},content:"inline"}),{meta:{isolating:!1},parse(e){if("input"===e.tagName)return e.closest("[data-content-type]")||e.closest("li")?void 0:"checkbox"===e.type?{checked:e.checked}:void 0;if("LI"!==e.tagName)return;let t=e.parentElement;if(null!==t&&("UL"===t.tagName||"DIV"===t.tagName&&t.parentElement?.tagName==="UL")){let t=e.querySelector("input[type=checkbox]")||null;return null===t?void 0:{...e8(e),checked:t.checked}}},parseContent:({el:e,schema:t})=>tB(e,t,"checkListItem"),render(e,t){let n=document.createDocumentFragment(),r=document.createElement("input");r.type="checkbox",r.checked=e.props.checked,e.props.checked&&r.setAttribute("checked",""),r.disabled=!t.isEditable,r.addEventListener("change",()=>{t.isEditable&&t.updateBlock(e,{props:{checked:!e.props.checked}})});let o=document.createElement("p"),i=document.createElement("div");return i.contentEditable="false",i.appendChild(r),n.appendChild(i),n.appendChild(o),{dom:n,contentDOM:o}},toExternalHTML(e){let t=document.createElement("li"),n=document.createElement("input");n.type="checkbox",n.checked=e.props.checked,e.props.checked&&n.setAttribute("checked","");let r=document.createElement("p");return te(e.props,t),t.appendChild(n),t.appendChild(r),{dom:t,contentDOM:r}},runsBefore:["bulletListItem"]},[(0,i.t)({key:"check-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>t_(e,"checkListItem"),"Mod-Shift-9":({editor:e})=>{let t=e.getTextCursorPosition();return"inline"===e.schema.blockSchema[t.block.type].content&&(e.updateBlock(t.block,{type:"checkListItem",props:{}}),!0)}},inputRules:[{find:/^\s?\[\s*\]\s$/,replace:()=>({type:"checkListItem",props:{checked:!1}})},{find:/^\s?\[[Xx]\]\s$/,replace:()=>({type:"checkListItem",props:{checked:!0}})}]})]);function tL(e,t){let n=new Map,r=t.decorations.map(e.mapping,e.doc),o=e.changedRange()??{from:0,to:e.doc.nodeSize-2},i=[],l=new Set;e.doc.nodesBetween(o.from,e.doc.nodeSize-2,(t,s,a)=>{if(a&&l.has(a))return!1;if("blockContainer"===t.type.name&&"numberedListItem"===t.firstChild.type.name){let{index:c,isFirst:d,hasStart:u}=function(e,t,n,r){let o=!!e.firstChild.attrs.start,i=ei({posBeforeNode:t,node:e});if(!i.isBlockContainer)throw Error("impossible");let l=n.doc.resolve(i.bnBlock.beforePos).nodeBefore,s=l?r.get(l):void 0;if(void 0!==s){let t=s+1;return r.set(e,t),{index:t,isFirst:!1,hasStart:o}}let a=[{node:e,pos:t}],c=l,d=i.bnBlock.beforePos;for(;c&&void 0===r.get(c);){let e=ei({posBeforeNode:d-c.nodeSize,node:c});if("numberedListItem"!==e.blockNoteType)break;a.push({node:c,pos:d-c.nodeSize});let t=n.doc.resolve(e.bnBlock.beforePos).nodeBefore;d=e.bnBlock.beforePos,c=t}let u,p,h=a[a.length-1],f=ei({posBeforeNode:h.pos,node:h.node});if(!f.isBlockContainer)throw Error("impossible");let m=n.doc.resolve(f.bnBlock.beforePos).nodeBefore,g=m?r.get(m):void 0;void 0===g?(u=(h.node.firstChild.attrs.start||1)-1,p=!0):(u=g,p=!1);for(let e=a.length-1;e>=0;e--){let t=a[e];p&&e<a.length-1&&(p=!1),u++,r.set(t.node,u)}return{index:u,isFirst:1===a.length&&(p||void 0===g),hasStart:o}}(t,s,e,n),h=e.doc.nodeAt(s+1);if(0===r.find(s+1,s+1+h.nodeSize,e=>e.index===c&&e.isFirst===d&&e.hasStart===u).length)i.push(p.NZ.node(s+1,s+1+h.nodeSize,{"data-index":c.toString()},{index:c,isFirst:d,hasStart:u}));else if(s>=o.to&&a)return l.add(a),!1}});let s=i.flatMap(e=>r.find(e.from,e.to));return{decorations:r.remove(s).add(e.doc,i)}}var tD=en(()=>({type:"numberedListItem",propSchema:{...e7,start:{default:void 0,type:"number"}},content:"inline"}),{meta:{isolating:!1},parse(e){if("LI"!==e.tagName)return;let t=e.parentElement;if(null!==t&&("OL"===t.tagName||"DIV"===t.tagName&&t.parentElement?.tagName==="OL")){let n=parseInt(t.getAttribute("start")||"1"),r=e8(e);return e.previousElementSibling||1===n?r:{...r,start:n}}},parseContent:({el:e,schema:t})=>tB(e,t,"numberedListItem"),render(){let e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement("li"),n=document.createElement("p");return te(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[(0,i.t)({key:"numbered-list-item-shortcuts",inputRules:[{find:/^\s?(\d+)\.\s$/,replace({match:e,editor:t}){if("heading"===es(t.prosemirrorState).blockNoteType)return;let n=parseInt(e[1]);return{type:"numberedListItem",props:{start:1===n?void 0:n}}}}],keyboardShortcuts:{Enter:({editor:e})=>
17t_(e,"numberedListItem"),"Mod-Shift-7":({editor:e})=>{let t=e.getTextCursorPosition();return"inline"===e.schema.blockSchema[t.block.type].content&&(e.updateBlock(t.block,{type:"numberedListItem",props:{}}),!0)}},prosemirrorPlugins:[new c.k_({key:new c.hs("numbered-list-indexing-decorations"),state:{init:(e,t)=>tL(t.tr,{decorations:p.zF.empty}),apply:(e,t)=>!e.docChanged&&t.decorations?t:tL(e,t)},props:{decorations(e){return this.getState(e)?.decorations??p.zF.empty}}})]})]),t$=en(()=>({type:"toggleListItem",propSchema:{...e7},content:"inline"}),{meta:{isolating:!1},parse(e){if("DETAILS"===e.tagName)return e8(e);if("LI"===e.tagName){let t=e.parentElement;if(t&&("UL"===t.tagName||"DIV"===t.tagName&&t.parentElement?.tagName==="UL")&&e.querySelector(":scope > details"))return e8(e)}},parseContent:({el:e,schema:t})=>{let n="DETAILS"===e.tagName?e:e.querySelector(":scope > details");if(!n)throw Error("No details found in toggleListItem parseContent");return tw(n,t,"toggleListItem")},runsBefore:["bulletListItem"],render(e,t){let n=document.createElement("p");return{...tC(e,t,n),contentDOM:n}},toExternalHTML(e){let t=document.createElement("li"),n=document.createElement("details");n.setAttribute("open","");let r=document.createElement("summary"),o=document.createElement("p");return r.appendChild(o),n.appendChild(r),te(e.props,t),t.appendChild(n),{dom:t,contentDOM:o,childrenDOM:n}}},[(0,i.t)({key:"toggle-list-item-shortcuts",keyboardShortcuts:{Enter:({editor:e})=>t_(e,"toggleListItem"),"Mod-Shift-6":({editor:e})=>{let t=e.getTextCursorPosition();return"inline"===e.schema.blockSchema[t.block.type].content&&(e.updateBlock(t.block,{type:"toggleListItem",props:{}}),!0)}}})]),tF=(en(()=>({type:"pageBreak",propSchema:{},content:"none"}),{parse(e){if("DIV"===e.tagName&&e.hasAttribute("data-page-break"))return{}},render(){let e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}},toExternalHTML(){let e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}}}),en(()=>({type:"paragraph",propSchema:e7,content:"inline"}),{meta:{isolating:!1},parse:e=>{if("P"===e.tagName&&e.textContent?.trim())return e8(e)},render:()=>{let e=document.createElement("p");return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement("p");return te(e.props,t),{dom:t,contentDOM:t}},runsBefore:["default","heading"]},[(0,i.t)({key:"paragraph-shortcuts",keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{let t=e.getTextCursorPosition();return"inline"===e.schema.blockSchema[t.block.type].content&&(e.updateBlock(t.block,{type:"paragraph",props:{}}),!0)}}})])),tz=en(()=>({type:"quote",propSchema:{backgroundColor:e7.backgroundColor,textColor:e7.textColor},content:"inline"}),{meta:{isolating:!1},parse(e){if("BLOCKQUOTE"===e.tagName){let{backgroundColor:t,textColor:n}=e8(e);return{backgroundColor:t,textColor:n}}},render(){let e=document.createElement("blockquote");return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement("blockquote");return te(e.props,t),{dom:t,contentDOM:t}}},[(0,i.t)({key:"quote-block-shortcuts",keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{let t=e.getTextCursorPosition();return"inline"===e.schema.blockSchema[t.block.type].content&&(e.updateBlock(t.block,{type:"quote",props:{}}),!0)}},inputRules:[{find:RegExp("^>\\s$"),replace:()=>({type:"quote",props:{}})},{find:RegExp("^\\p{Quotation_Mark}\\s$","u"),replace:()=>({type:"quote",props:{}})}]})]),tH=120,tV=31,tU=a.YY.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[(0,u.AL)({cellMinWidth:35,defaultCellMinWidth:120,View:null}),(0,u.LF)()],addKeyboardShortcuts(){return{Enter:()=>!!(0,u.aH)(this.editor.state)&&this.editor.commands.command(({state:e,dispatch:t})=>{let n=(0,u.t6)(e),r=n?(0,u.oD)(n,"vert",1):null;return r&&t&&t(e.tr.setSelection(c.U3.between(r,(0,u.fx)(r))).scrollIntoView()),!0}),Backspace:()=>{let e=this.editor.state.selection,t=e.empty,n=0===e.$head.parentOffset,r="tableParagraph"===e.$head.node().type.name;return t&&n&&r},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>
17(0,u.D8)(1)(e,t,n)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>(0,u.D8)(-1)(e,t,n))}},extendNodeSchema:e=>({tableRole:(0,a.gk)((0,a.iI)(e,"tableRole",{name:e.name,options:e.options,storage:e.storage}))})}),tW={textColor:e7.textColor},tJ=a.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"tableContent+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th",getContent:(e,t)=>tZ(e,t)}],renderHTML({HTMLAttributes:e}){return["th",(0,a.KV)(this.options.HTMLAttributes,e),0]}}),tG=a.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"tableContent+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td",getContent:(e,t)=>tZ(e,t)}],renderHTML({HTMLAttributes:e}){return["td",(0,a.KV)(this.options.HTMLAttributes,e),0]}}),tq=a.bP.create({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",marks:"deletion insertion modification",isolating:!0,parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:t}){let n=function(e,t,n,r){let o=document.createElement("div");for(let[t,r]of(o.className=G("bn-block-content",n.class),o.setAttribute("data-content-type",e),Object.entries(n)))"class"!==t&&o.setAttribute(t,r);let i=document.createElement(t);for(let[e,t]of(i.className=G("bn-inline-content",r.class),Object.entries(r)))"class"!==e&&i.setAttribute(e,t);return o.appendChild(i),{dom:o,contentDOM:i}}(this.name,"table",{...this.options.domAttributes?.blockContent||{},...t},this.options.domAttributes?.inlineContent||{}),r=document.createElement("colgroup");for(let t of e.children[0].children)if(t.attrs.colwidth)for(let e of t.attrs.colwidth){let t=document.createElement("col");e&&(t.style=`width: ${e}px`),r.appendChild(t)}else r.appendChild(document.createElement("col"));return n.dom.firstChild?.appendChild(r),n},addNodeView(){return({node:e,HTMLAttributes:t})=>{class n extends u.Qg{constructor(e,t,n){super(e,t),this.node=e,this.cellMinWidth=t,this.blockContentHTMLAttributes=n;let r=document.createElement("div");for(let[e,t]of(r.className=G("bn-block-content",n.class),r.setAttribute("data-content-type","table"),Object.entries(n)))"class"!==e&&r.setAttribute(e,t);let o=this.dom,i=document.createElement("div");i.className="tableWrapper-inner",i.appendChild(o.firstChild),o.appendChild(i),r.appendChild(o);let l=document.createElement("div");l.className="table-widgets-container",l.style.position="relative",o.appendChild(l),this.dom=r}ignoreMutation(e){return!e.target.closest(".tableWrapper-inner")||super.ignoreMutation(e)}update(e){if(!super.update(e))return!1;for(let[t,n]of Object.entries(tW)){let r=Z(t),o=e.attrs[t];o===n.default?this.dom.removeAttribute(r):this.dom.setAttribute(r,String(o))}return!0}}return new n(e,120,{...this.options.domAttributes?.blockContent||{},...t})}}}),tK=a.bP.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML:()=>[{tag:"p",getAttrs:e=>{if("string"==typeof e||!e.textContent||!e.closest("[data-content-type]"))return!1;let t=e.parentElement;return null!==t&&("TD"===t.tagName||"TH"===t.tagName)&&{}},node:"tableParagraph"}],renderHTML:({HTMLAttributes:e})=>["p",e,0]}),tY=a.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)+",tableRole:"row",marks:"deletion insertion modification",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,a.KV)(this.options.HTMLAttributes,e),0]}});function tZ(e,t){let n=l.S4.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return n.content.descendants(e=>{if(e.isInline)return r.push(e),!1}),l.FK.fromArray(r)}var tX=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.getAttribute("data-name")||void 0}),tQ=e=>({type:"video",propSchema:{textAlignment:e7.textAlignment,backgroundColor:e7.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:void 0,type:"number"}},content:"none"}),t0=e=>e=>{if("VIDEO"===e.tagName){if(e.closest("figure"))return;let{backgroundColor:t}=e8(e);return{...tX(e),backgroundColor:t}}if("FIGURE"===e.tagName){let t=tr(e,"video");if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:o}=e8(e);return{...tX(n),backgroundColor:o,caption:r}}},t1=en(tQ,e=>({meta:{fileBlockAccept:["video/*"]},parse:t0(e),render(t,n){let r=document.createElement("div");r.innerHTML=e.icon??'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>';let o=document.createElement("div");o.className="bn-visual-media-wrapper";let i=document.createElement("video");return i.className="bn-visual-media",n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,t.props.previewWidth&&(i.width=t.props.previewWidth),o.appendChild(i),tM(t,n,{dom:o},o,r.firstElementChild)},toExternalHTML(e){let t;return e.props.url?(e.props.showPreview?((t=document.createElement("video")).src=e.props.url,e.props.previewWidth&&(t.width=e.props.previewWidth)):((t=document.createElement("a")).href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?tl(t,e.props.caption):ts(t,e.props.caption):{dom:t}):{dom:document.createElement("video")}},runsBefore:["file"]}));
17function t2(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(let[r,o]of Object.entries(n)){if(!(r in e.schema.blockSpecs[t].config.propSchema))return!1;if("string"==typeof o){if(void 0!==e.schema.blockSpecs[t].config.propSchema[r].default&&typeof e.schema.blockSpecs[t].config.propSchema[r].default!==o||void 0!==e.schema.blockSpecs[t].config.propSchema[r].type&&e.schema.blockSpecs[t].config.propSchema[r].type!==o)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[r].default!==o.default||void 0===e.schema.blockSpecs[t].config.propSchema[r].default&&void 0===o.default&&e.schema.blockSpecs[t].config.propSchema[r].type!==o.type||typeof e.schema.blockSpecs[t].config.propSchema[r].values!=typeof o.values)return!1;if("object"==typeof e.schema.blockSpecs[t].config.propSchema[r].values&&"object"==typeof o.values){for(let n of o.values)if(!e.schema.blockSpecs[t].config.propSchema[r].values.includes(n))return!1}}}return!0}function t5(e,t,n,r){return t2(t,n,r)&&e.type===n}function t3(e){return e instanceof u.rn}var t4=(0,i.t)(({editor:e})=>{let t=(0,i.n)(!1),n=()=>e.transact(e=>{if(e.selection.empty||e.selection instanceof c.U3&&0===e.doc.textBetween(e.selection.from,e.selection.to).length)return!1;let t=!1;return e.selection.content().content.descendants(e=>(e.type.spec.code&&(t=!0),!t)),!t});return{key:"formattingToolbar",store:t,mount({dom:r,signal:o}
17){let i=!1,l=!1,s=e.onChange(()=>{i||l||t.setState(n())}),a=e.onSelectionChange(()=>{i||l||t.setState(n())});r.addEventListener("pointerdown",()=>{i=!0,t.setState(!1)},{signal:o}),e.prosemirrorView.root.addEventListener("pointerup",()=>{i=!1,e.isFocused()&&t.setState(n())},{signal:o,capture:!0}),r.addEventListener("pointercancel",()=>{i=!0},{signal:o,capture:!0}),e.prosemirrorView.root.addEventListener("dragstart",()=>{l=!0,t.setState(!1)},{signal:o}),e.prosemirrorView.root.addEventListener("dragend",()=>{l=!1},{signal:o}),o.addEventListener("abort",()=>{s(),a()})}}}),t9=new Map,t6=(0,a.KP)(e=>"blockContainer"===e.type.name),t7=class{state;emitUpdate;rootEl;pluginState;constructor(e,t,n){this.editor=e,this.pluginState=void 0,this.emitUpdate=e=>{if(!this.state)throw Error("Attempting to update uninitialized suggestions menu");t(e,{...this.state,ignoreQueryLength:this.pluginState?.ignoreQueryLength})},this.rootEl=n.root,this.rootEl?.addEventListener("scroll",this.handleScroll,!0)}handleScroll=()=>{if(this.state?.show){let e=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);e&&(this.state.referencePos=e.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter))}};update(e,t){let n=t8.getState(t),r=t8.getState(e.state),o=void 0!==n&&void 0===r;if((void 0!==n||void 0===r)&&(void 0===n||void 0===r)&&!o)return;if(this.pluginState=o?n:r,o||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}let i=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&i&&(this.state={show:!0,referencePos:i.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){this.rootEl?.removeEventListener("scroll",this.handleScroll,!0)}closeMenu=()=>{this.editor.transact(e=>e.setMeta(t8,null))};clearQuery=()=>{void 0!==this.pluginState&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(e=>e.selection.from)}).run()}},t8=new c.hs("SuggestionMenuPlugin"),ne=(0,i.t)(({editor:e})=>{let t=new Map,n,r=(0,i.n)(void 0);return{key:"suggestionMenu",store:r,addSuggestionMenu:e=>{t.set(e.triggerCharacter,e)},removeSuggestionMenu:e=>{t.delete(e)},closeMenu:()=>{n?.closeMenu()},clearQuery:()=>{n?.clearQuery()},shown:()=>n?.state?.show||!1,openSuggestionMenu:(t,n)=>{e.headless||(e.focus(),e.transact(e=>{n?.deleteTriggerCharacter&&e.insertText(t),e.scrollIntoView().setMeta(t8,{triggerCharacter:t,deleteTriggerCharacter:n?.deleteTriggerCharacter||!1,ignoreQueryLength:n?.ignoreQueryLength||!1})}))},prosemirrorPlugins:[new c.k_({key:t8,view:t=>n=new t7(e,(e,t)=>{r.setState({...t,triggerCharacter:e})},t),state:{init(){},apply:(t,r,o,i)=>{if(t.selection.$from.parent.type.spec.code)return r;let l=t.getMeta(t8);if("object"==typeof l&&l){r&&n?.closeMenu();let t=function(e,t,n="left"){let r=m.pJ.getState(e.prosemirrorState);if(!r){let r=function(e){if(t9.has(e))return t9.get(e);let t=new s.X9;return e._tiptapEditor.on("transaction",({transaction:e})=>{t.appendMapping(e.mapping)}),e._tiptapEditor.on("destroy",()=>{t9.delete(e)}),t9.set(e,t),t}(e),o=r.maps.length;return()=>r.slice(o).map(t,"left"===n?-1:1)}let o=(0,g.Bw)(t+("right"===n?1:-1),r.binding.type,r.binding.mapping);return()=>{let t=m.pJ.getState(e.prosemirrorState),r=(0,g.bL)(t.doc,t.binding.type,o,t.binding.mapping);if(null===r)throw Error("Position not found, cannot track positions");return r+("right"===n?-1:1)}}(e,i.selection.from-l.triggerCharacter.length);return{triggerCharacter:l.triggerCharacter,deleteTriggerCharacter:!1!==l.deleteTriggerCharacter,queryStartPos:()=>t()+l.triggerCharacter.length,query:"",decorationId:`id_${Math.floor(0xffffffff*Math.random())}`,ignoreQueryLength:l?.ignoreQueryLength}}if(void 0===r)return r;if(i.selection.from!==i.selection.to||null===l||t.getMeta("focus")||t.getMeta("blur")||t.getMeta("pointer")||void 0!==r.triggerCharacter&&i.selection.from<r.queryStartPos()||!i.selection.$from.sameParent(i.doc.resolve(r.queryStartPos())))return;let a={...r};return a.query=i.doc.textBetween(r.queryStartPos(),i.selection.from),a}},props:{handleTextInput(e,n,r,o){if(n===r){let r=e.state.doc;for(let[i,l]of t){let t=i.length>1?r.textBetween(n-i.length,n)+o:o;if(i===t){if(l.shouldOpen&&!l.shouldOpen(e.state.tr))continue;return e.dispatch(e.state.tr.insertText(o)),e.dispatch(e.state.tr.setMeta(t8,{triggerCharacter:t}).scrollIntoView()),!0}}}return!1},decorations(e){let t=this.getState(e);if(void 0===t)return null;if(!t.deleteTriggerCharacter){let n=t6(e.selection);if(n)return p.zF.create(e.doc,[p.NZ.node(n.pos,n.pos+n.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":t.decorationId})])}return p.zF.create(e.doc,[p.NZ.inline(t.queryStartPos()-t.triggerCharacter.length,t.queryStartPos(),{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":t.decorationId})])}}})]}});function nt(e,t){let n,r=e.getTextCursorPosition().block;
17if(void 0===r.content)throw Error("Slash Menu open in a block that doesn't contain content.");return Array.isArray(r.content)&&(1===r.content.length&&D(r.content[0])&&"text"===r.content[0].type&&"/"===r.content[0].text||0===r.content.length)?(n=e.updateBlock(r,t),e.setTextCursorPosition(n)):(n=e.insertBlocks([t],r,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),function(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;"none"===n;){if(void 0===(t=e.getTextCursorPosition().nextBlock))return;n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}}(e),n}function nn(e){let t=[];return t2(e,"heading",{level:"number"})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e<=3).forEach(n=>{t.push({onItemClick:()=>{nt(e,{type:"heading",props:{level:n}})},badge:J(`Mod-Alt-${n}`),key:1===n?"heading":`heading_${n}`,...e.dictionary.slash_menu[1===n?"heading":`heading_${n}`]})}),t2(e,"quote")&&t.push({onItemClick:()=>{nt(e,{type:"quote"})},key:"quote",...e.dictionary.slash_menu.quote}),t2(e,"toggleListItem")&&t.push({onItemClick:()=>{nt(e,{type:"toggleListItem"})},badge:J("Mod-Shift-6"),key:"toggle_list",...e.dictionary.slash_menu.toggle_list}),t2(e,"numberedListItem")&&t.push({onItemClick:()=>{nt(e,{type:"numberedListItem"})},badge:J("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),t2(e,"bulletListItem")&&t.push({onItemClick:()=>{nt(e,{type:"bulletListItem"})},badge:J("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),t2(e,"checkListItem")&&t.push({onItemClick:()=>{nt(e,{type:"checkListItem"})},badge:J("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),t2(e,"paragraph")&&t.push({onItemClick:()=>{nt(e,{type:"paragraph"})},badge:J("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),t2(e,"codeBlock")&&t.push({onItemClick:()=>{nt(e,{type:"codeBlock"})},badge:J("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),t2(e,"divider")&&t.push({onItemClick:()=>{nt(e,{type:"divider"})},key:"divider",...e.dictionary.slash_menu.divider}),t2(e,"table")&&t.push({onItemClick:()=>{nt(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),t2(e,"image",{url:"string"})&&t.push({onItemClick:()=>{let t=nt(e,{type:"image"});e.getExtension(to)?.showMenu(t.id),e.getExtension(t4)?.store.setState(!1)},key:"image",...e.dictionary.slash_menu.image}),t2(e,"video",{url:"string"})&&t.push({onItemClick:()=>{let t=nt(e,{type:"video"});e.getExtension(to)?.showMenu(t.id),e.getExtension(t4)?.store.setState(!1)},key:"video",...e.dictionary.slash_menu.video}),t2(e,"audio",{url:"string"})&&t.push({onItemClick:()=>{let t=nt(e,{type:"audio"});e.getExtension(to)?.showMenu(t.id),e.getExtension(t4)?.store.setState(!1)},key:"audio",...e.dictionary.slash_menu.audio}),t2(e,"file",{url:"string"})&&t.push({onItemClick:()=>{let t=nt(e,{type:"file"});e.getExtension(to)?.showMenu(t.id),e.getExtension(t4)?.store.setState(!1)},key:"file",...e.dictionary.slash_menu.file}),t2(e,"heading",{level:"number",isToggleable:"boolean"})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e<=3).forEach(n=>{t.push({onItemClick:()=>{nt(e,{type:"heading",props:{level:n,isToggleable:!0}})},key:1===n?"toggle_heading":`toggle_heading_${n}`,...e.dictionary.slash_menu[1===n?"toggle_heading":`toggle_heading_${n}`]})}),t2(e,"heading",{level:"number"})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e>3).forEach(n=>{t.push({onItemClick:()=>{nt(e,{type:"heading",props:{level:n}})},badge:J(`Mod-Alt-${n}`),key:`heading_${n}`,...e.dictionary.slash_menu[`heading_${n}`]})}),t.push({onItemClick:()=>{e.getExtension(ne)?.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function nr(e,t){return e.filter(({title:e,aliases:n})=>e.toLowerCase().includes(t.toLowerCase())||n&&0!==n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).length)}var no={audio:tu(),bulletListItem:tO(),checkListItem:tR(),codeBlock:tf(),divider:tg(),file:tk(),heading:tE(),image:tN(),numberedListItem:tD(),paragraph:tF(),quote:tz(),table:(r={node:tq,type:"table",content:"table"},o=[(0,i.t)({key:"table-extensions",tiptapExtensions:[tU,tK,tJ,tG,tY]}
17),(0,i.t)({key:"table-keyboard-delete",keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof u.rn))return!1;let t=e.getTextCursorPosition().block,n=t.content,r=0;for(let e of n.rows)for(let t of e.cells){if("type"in t&&t.content.length>0||!("type"in t)&&t.length>0)return!1;r++}let o=0;return e.prosemirrorState.selection.forEachCell(()=>{o++}),!(o<r)&&(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})],{config:{type:r.type,content:r.content,propSchema:tW},implementation:{node:r.node,render:K,toExternalHTML:K},extensions:o}),toggleListItem:t$(),video:t1()},ni=eT({type:"textColor",propSchema:"string"},{render:()=>{let e=document.createElement("span");return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement("span");return e!==e7.textColor.default&&(t.style.color=e in e9?e9[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if("SPAN"===e.tagName&&e.style.color)return e.style.color}}),nl=eT({type:"backgroundColor",propSchema:"string"},{render:()=>{let e=document.createElement("span");return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement("span");return e!==e7.backgroundColor.default&&(t.style.backgroundColor=e in e9?e9[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if("SPAN"===e.tagName&&e.style.backgroundColor)return e.style.backgroundColor}}),ns={bold:eE(x,"boolean"),italic:eE(N,"boolean"),underline:eE(B,"boolean"),strike:eE(_,"boolean"),code:eE(E.extend({addInputRules(){return[(0,a.OX)({find:/(^|[^`])`([^`]+)`(?!`)$/,type:this.t
17ype}),new a.fV({find:/(^|[^`])`([^`]+)`(?!`) $/,handler:({state:e,range:t,match:n})=>{let{tr:r,schema:o}=e,i=n[1],l=n[2];r.replaceWith(t.from+i.length,t.to,[o.text(l,[this.type.create()]),o.text(" ")])}})]}}),"boolean"),textColor:ni,backgroundColor:nl},na=(eM(ns),{text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}}),nc=ex(na),nd=class e extends eP{static create(t){return new e({blockSpecs:t?.blockSpecs??no,inlineContentSpecs:t?.inlineContentSpecs??na,styleSpecs:t?.styleSpecs??ns})}}},37766:(e,t,n)=>{n.d(t,{B:()=>r,a:()=>o});let r=Symbol("Equality"),o=(e,t)=>e===t||!!e?.[r]?.(t)},38273:(e,t,n)=>{n.d(t,{v:()=>l});var r=n(95155),o=n(12115),i=n(69954);function l(e){let t=(0,o.forwardRef)(e);return t.withProps=e=>{let n=(0,o.forwardRef)((n,o)=>(0,r.jsx)(t,{...e,...n,ref:o}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=i.D_,t}},38356:(e,t,n)=>{n.d(t,{C:()=>i,w:()=>o}),n(12115);var r=n(7220);n(95155);let[o,i]=(0,r.F)("Popover component was not found in the tree")}
17,40772:(e,t,n)=>{n.d(t,{v:()=>o});var r=n(12115);function o(e){return!Array.isArray(e)&&null!==e&&"object"==typeof e&&e.type!==r.Fragment}},42080:(e,t,n)=>{n.d(t,{$B:()=>s,Sd:()=>i,T2:()=>l});var r=n(8242),o=n(27050);function i(e,t=null){return function(n,i){let{$from:l,$to:s}=n.selection,a=l.blockRange(s);if(!a)return!1;let c=i?n.tr:null;return!!function(e,t,n,i=null){let l=!1,s=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=a.resolve(t.start-2);s=new o.u$(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new o.u$(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),l=!0}let c=(0,r.oM)(s,n,i,t);return!!c&&(e&&function(e,t,n,i,l){let s=o.FK.empty;for(let e=n.length-1;e>=0;e--)s=o.FK.from(n[e].type.create(n[e].attrs,s));e.step(new r.Wg(t.start-2*!!i,t.end,t.start,t.end,new o.Ji(s,0,0),n.length,!0));let a=0;for(let e=0;e<n.length;e++)n[e].type==l&&(a=e+1);let c=n.length-a,d=t.start+n.length-2*!!i,u=t.parent;for(let n=t.startIndex,o=t.endIndex,i=!0;n<o;n++,i=!1)!i&&(0,r.zy)(e.doc,d,c)&&(e.split(d,c),d+=2*c),d+=u.child(n).nodeSize}(e,t,c,l,n),!0)}(c,a,e,t)&&(i&&i(c.scrollIntoView()),!0)}}function l(e){return function(t,n){let{$from:i,$to:l}=t.selection,s=i.blockRange(l,t=>t.childCount>0&&t.firstChild.type==e);return!!s&&(!n||(i.node(s.depth-1).type==e?function(e,t,n,i){let l=e.tr,s=i.end,a=i.$to.end(i.depth);s<a&&(l.step(new r.Wg(s-1,a,s,a,new o.Ji(o.FK.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.u$(l.doc.resolve(i.$from.pos),l.doc.resolve(a),i.depth));let c=(0,r.jP)(i);if(null==c)return!1;l.lift(i,c);let d=l.doc.resolve(l.mapping.map(s,-1)-1);return(0,r.n9)(l.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&l.join(d.pos),t(l.scrollIntoView()),!0}(t,n,e,s):function(e,t,n){let i=e.tr,l=n.parent;for(let e=n.end,t=n.endIndex-1,r=n.startIndex;t>r;t--)e-=l.child(t).nodeSize,i.delete(e-1,e+1);let s=i.doc.resolve(n.start),a=s.nodeAfter;if(i.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,d=n.endIndex==l.childCount,u=s.node(-1),p=s.index(-1);if(!u.canReplace(p+ +!c,p+1,a.content.append(d?o.FK.empty:o.FK.from(l))))return!1;let h=s.pos,f=h+a.nodeSize;return i.step(new r.Wg(h-!!c,f+ +!!d,h+1,f-1,new o.Ji((c?o.FK.empty:o.FK.from(l.copy(o.FK.empty))).append(d?o.FK.empty:o.FK.from(l.copy(o.FK.empty))),+!c,+!d),+!c)),t(i.scrollIntoView()),!0}(t,n,s)))}}function s(e){return function(t,n){let{$from:i,$to:l}=t.selection,s=i.blockRange(l,t=>t.childCount>0&&t.firstChild.type==e);if(!s)return!1;let a=s.startIndex;if(0==a)return!1;let c=s.parent,d=c.child(a-1);if(d.type!=e)return!1;if(n){let i=d.lastChild&&d.lastChild.type==c.type,l=o.FK.from(i?e.create():null),a=new o.Ji(o.FK.from(e.create(null,o.FK.from(c.type.create(null,l)))),i?3:1,0),u=s.start,p=s.end;n(t.tr.step(new r.Wg(u-(i?3:1),p,u,p,a,1,!0)).scrollIntoView())}return!0}}},42424:(e,t,n)=>{n.d(t,{O:()=>c});var r=n(95155);n(12115);var o=n(38273),i=n(86161),l=n(65214),s=n(2371);let a={__staticSelector:"InputBase",withAria:!0,size:"sm"},c=(0,o.v)((e,t)=>{let{inputProps:n,wrapperProps:o,...c}=function(e,t,n){let r=(0,l.Y)(e,t,n),{label:o,description:i,error:a,required:c,classNames:d,styles:u,className:p,unstyled:h,__staticSelector:f,__stylesApiProps:m,errorProps:g,labelProps:b,descriptionProps:y,wrapperProps:v,id:k,size:w,style:x,inputContainer:C,inputWrapperOrder:S,withAsterisk:E,variant:M,vars:T,mod:A,attributes:I,...N}=r,{styleProps:j,rest:P}=(0,s.j)(N),_={label:o,description:i,error:a,required:c,classNames:d,className:p,__staticSelector:f,__stylesApiProps:m||r,errorProps:g,labelProps:b,descriptionProps:y,unstyled:h,styles:u,size:w,style:x,inputContainer:C,inputWrapperOrder:S,withAsterisk:E,variant:M,id:k,mod:A,attributes:I,...v};return{...P,classNames:d,styles:u,unstyled:h,wrapperProps:{..._,...j},inputProps:{required:c,classNames:d,styles:u,unstyled:h,size:w,__staticSelector:f,__stylesApiProps:m||r,error:a,variant:M,id:k,attributes:I}}}("InputBase",a,e);return(0,r.jsx)(i.p.Wrapper,{...o,children:(0,r.jsx)(i.p,{...n,...c,ref:t})})});c.classes={...i.p.classes,...i.p.Wrapper.classes},c.displayName="@mantine/core/InputBase"},42931:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(95155),o=n(12115),i=n(45535);let l=["mousedown","touchstart"];var s=n(35624),a=n(86334),c=n(25168),d=n(13494),u=n(74279),p=n(66629),h=n(65214),f=n(85754),m=n(87691),g=n(18037),b=n(54169),y=n(95923),v=n(38356),k=n(93643),w=n(61025),x=n(9683),C=n(76701),S=n(17294),E=n(18507),M=n(48219),T=n(34259),A=n(81038);let I={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:(0,s.I)("popover"),__staticSelector:"Popover",width:"max-content"},N=(0,c.V)((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":void 0===t?void 0:(0,a.nJ)(t),"--popover-shadow":(0,a.dh)(n)}}));function j(e){var t,n;let s,a,c=(0,h.Y)("Popover",I,e),{children:k,position:w,offset:j,onPositionChange:P,positionDependencies:_,opened:B,transitionProps:O,onExitTransitionEnd:R,onEnterTransitionEnd:L,width:D,middlewares:$,withArrow:F,arrowSize:z,arrowOffset:H,arrowRadius:V,arrowPosition:U,unstyled:W,classNames:J,styles:G,closeOnClickOutside:q,withinPortal:K,portalProps:Y,closeOnEscape:Z,clickOutsideEvents:X,trapFocus:Q,onClose:ee,onDismiss:et,onOpen:en,onChange:er,zIndex:eo,radius:ei,shadow:el,id:es,defaultOpened:ea,__staticSelector:ec,withRoles:ed,disabled:eu,returnFocus:ep,variant:eh,keepMounted:ef,vars:em,floatingStrategy:eg,withOverlay:eb,overlayProps:ey,hideDetached:ev,attributes:ek,preventPositionChangeWhenVisible:ew,...ex}=c,eC=(0,u.I)({name:ec,props:c,classes:A.A,classNames:J,styles:G,unstyled:W,attributes:ek,rootSelector:"dropdown",vars:em,varsResolver:N}),{resolvedStyles:eS}=(0,d.Y)({classNames:J,styles:G,props:c}),[eE,eM]=(0,o.useState)(B??ea??!1),eT=(0,o.useRef)(w),eA=(0,o.useRef)(null),[eI,eN]=(0,o.useState)(null),[ej,eP]=(0,o.useState)(null),{dir:e_}=(0,f.jH)(),eB=(0,p.bv)(),eO=(0,i.B)(es),eR=function(e){var t;let n,r,i=(0,p.bv)(),[l,s]=(0,E.Z)({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),a=(0,o.useRef)(l),c=(0,C.we)({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:(t=()=>c,n=function(e){if(void 0===e)return{shift:!0,flip:!0};let t={...e};return void 0===e.shift&&(t.shift=!0),void 0===e.flip&&(t.flip=!0),t}(e.middlewares),r=[(0,x.cY)(e.offset),(0,x.jD)()],e.dropdownVisible&&"test"!==i&&e.preventPositionChangeWhenVisible&&(n.flip=!1),n.shift&&r.push((0,x.BN)("boolean"==typeof n.shift?{limiter:(0,x.ER)(),padding:5}:{limiter:(0,x.ER)(),padding:5,...n.shift})),n.flip&&r.push("boolean"==typeof n.flip?(0,x.UU)():(0,x.UU)(n.flip)),n.inline&&r.push("boolean"==typeof n.inline?(0,x.mG)():(0,x.mG)(n.inline)),r.push((0,x.UE)({element:e.arrowRef,padding:e.arrowOffset})),(n.size||"target"===e.width)&&r.push((0,x.Ej)({..."boolean"==typeof n.size?{}:n.size,apply({rects:r,availableWidth:o,availableHeight:i,...l}){let s=t(),a=s.refs.floating.current?.style??{};n.size&&("object"==typeof n.size&&n.size.apply?n.size.apply({rects:r,availableWidth:o,availableHeight:i,...l}):Object.assign(a,{maxWidth:`${o}px`,maxHeight:`${i}px`})),"target"===e.width&&Object.assign(a,{width:`${r.reference.width}px`})}})),r),whileElementsMounted:e.keepMounted?void 0:S.ll});return(0,o.useEffect)(()=>
17{if(c.refs.reference.current&&c.refs.floating.current&&l)return(0,S.ll)(c.refs.reference.current,c.refs.floating.current,c.update)},[l,c.update]),(0,M.C)(()=>{e.onPositionChange?.(c.placement),e.positionRef.current=c.placement},[c.placement,e.preventPositionChangeWhenVisible]),(0,M.C)(()=>{l!==a.current&&(l?e.onOpen?.():e.onClose?.()),a.current=l},[l,e.onClose,e.onOpen]),(0,T.o)(()=>{let t=-1;return l&&(t=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(t)}},[l,e.position]),{floating:c,controlled:"boolean"==typeof e.opened,opened:l,onClose:()=>{l&&!e.disabled&&s(!1)},onToggle:()=>{e.disabled||s(!l)}}}({middlewares:$,width:D,position:(0,m.Q)(e_,w),offset:"number"==typeof j?j+(F?z/2:0):j,arrowRef:eA,arrowOffset:H,onPositionChange:P,positionDependencies:_,opened:B,defaultOpened:ea,onChange:er,onOpen:en,onClose:ee,onDismiss:et,strategy:eg,dropdownVisible:eE,setDropdownVisible:eM,positionRef:eT,disabled:eu,preventPositionChangeWhenVisible:ew,keepMounted:ef});t=()=>{q&&(eR.onClose(),et?.())},n=[eI,ej],s=(0,o.useRef)(null),a=X||l,(0,o.useEffect)(()=>{let e=e=>{let{target:r}=e??{};if(Array.isArray(n)){let o=!document.body.contains(r)&&r?.tagName!=="HTML";n.every(t=>!!t&&!e.composedPath().includes(t))&&!o&&t()}else s.current&&!s.current.contains(r)&&t()};return a.forEach(t=>document.addEventListener(t,e)),()=>{a.forEach(t=>document.removeEventListener(t,e))}},[s,t,n]);let eL=(0,o.useCallback)(e=>{eN(e),eR.floating.refs.setReference(e)},[eR.floating.refs.setReference]),eD=(0,o.useCallback)(e=>{eP(e),eR.floating.refs.setFloating(e)},[eR.floating.refs.setFloating]),e$=(0,o.useCallback)(()=>{O?.onExited?.(),R?.(),eM(!1),ew||(eT.current=w)},[O?.onExited,R,ew,w]),eF=(0,o.useCallback)(()=>{O?.onEntered?.(),L?.()},[O?.onEntered,L]);return(0,r.jsxs)(v.w,{value:{returnFocus:ep,disabled:eu,controlled:eR.controlled,reference:eL,floating:eD,x:eR.floating.x,y:eR.floating.y,arrowX:eR.floating?.middlewareData?.arrow?.x,arrowY:eR.floating?.middlewareData?.arrow?.y,opened:eR.opened,arrowRef:eA,transitionProps:{...O,onExited:e$,onEntered:eF},width:D,withArrow:F,arrowSize:z,arrowOffset:H,arrowRadius:V,arrowPosition:U,placement:eR.floating.placement,trapFocus:Q,withinPortal:K,portalProps:Y,zIndex:eo,radius:ei,shadow:el,closeOnEscape:Z,onDismiss:et,onClose:eR.onClose,onToggle:eR.onToggle,getTargetId:()=>`${eO}-target`,getDropdownId:()=>`${eO}-dropdown`,withRoles:ed,targetProps:ex,__staticSelector:ec,classNames:J,styles:G,unstyled:W,variant:eh,keepMounted:ef,getStyles:eC,resolvedStyles:eS,floatingStrategy:eg,referenceHidden:!!ev&&"test"!==eB&&eR.floating.middlewareData.hide?.referenceHidden},children:[k,eb&&(0,r.jsx)(y.e,{transition:"fade",mounted:eR.opened,duration:O?.duration||250,exitDuration:O?.exitDuration||250,children:e=>(0,r.jsx)(b.r,{withinPortal:K,children:(0,r.jsx)(g.h,{...ey,...eC("overlay",{className:ey?.className,style:[e,ey?.style]})})})})]})}j.Target=w.l,j.Dropdown=k.v,j.displayName="@mantine/core/Popover",j.extend=e=>e},43689:(e,t,n)=>{n.d(t,{X:()=>p});var r=n(86530);n(12115),n(95155);var o=n(67413),i=n(51913);function l(e,t){let n=(0,i.g)({color:e,theme:t});return"dimmed"===n.color?"var(--mantine-color-dimmed)":"bright"===n.color?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}let s={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"},a=["h1","h2","h3","h4","h5","h6"],c=["h1","h2","h3","h4","h5","h6"],d={color:l,textColor:function(e,t){let n=(0,i.g)({color:e,theme:t});return n.isThemeColor&&void 0===n.shade?`var(--mantine-color-${n.color}-text)`:l(e,t)},fontSize:function(e,t){return"string"==typeof e&&e in t.fontSizes?`var(--mantine-font-size-${e})`:"string"==typeof e&&a.includes(e)?`var(--mantine-${e}-font-size)`:"number"==typeof e||"string"==typeof e?(0,o.D)(e):e},spacing:function(e,t){if("number"==typeof e)return(0,o.D)(e);if("string"==typeof e){let n=e.replace("-","");if(!(n in t.spacing))return(0,o.D)(e);let r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e},radius:function(e,t){return"string"==typeof e&&e in t.radius?`var(--mantine-radius-${e})`:"number"==typeof e||"string"==typeof e?(0,o.D)(e):e},identity:function(e){return e},size:function(e){return"number"==typeof e?(0,o.D)(e):e},lineHeight:function(e,t){return"string"==typeof e&&e in t.lineHeights?`var(--mantine-line-height-${e})`:"string"==typeof e&&c.includes(e)?`var(--mantine-${e}-line-height)`:e},fontFamily:function(e){return"string"==typeof e&&e in s?s[e]:e},border:function(e,t){if("number"==typeof e)return(0,o.D)(e);if("string"==typeof e){let[n,r,...i]=e.split(" ").filter(e=>""!==e.trim()),s=`${(0,o.D)(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${l(i.join(" "),t)}`),s.trim()}return e}};function u(e){return e.replace("(min-width: ","").replace("em)","")}function p({styleProps:e,data:t,theme:n}){return function({media:e,...t}){let n=Object.keys(e).sort((e,t)=>
17Number(u(e))-Number(u(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}((0,r.H)(e).reduce((o,i)=>{var l,s;if("hiddenFrom"===i||"visibleFrom"===i||"sx"===i)return o;let a=t[i],c=Array.isArray(a.property)?a.property:[a.property],u="object"==typeof(s=e[i])&&null!==s?"base"in s?s.base:void 0:s;if(!function(e){if("object"!=typeof e||null===e)return!1;let t=Object.keys(e);return 1!==t.length||"base"!==t[0]}(e[i]))return c.forEach(e=>{o.inlineStyles[e]=d[a.type](u,n)}),o;o.hasResponsiveStyles=!0;let p="object"==typeof(l=e[i])&&null!==l?(0,r.H)(l).filter(e=>"base"!==e):[];return c.forEach(t=>{null!=u&&(o.styles[t]=d[a.type](u,n)),p.forEach(r=>{var l;let s=`(min-width: ${n.breakpoints[r]})`;o.media[s]={...o.media[s],[t]:d[a.type]((l=e[i],"object"==typeof l&&null!==l&&r in l?l[r]:l),n)}})}),o},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}},45535:(e,t,n)=>{n.d(t,{B:()=>l});var r=n(12115),o=n(34259);let i=r["useId".toString()]||(()=>void 0);function l(e){let t,n=(t=i())?`mantine-${t.replace(/:/g,"")}`:"",[l,s]=(0,r.useState)(n);return((0,o.o)(()=>{s(function(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}())},[]),"string"==typeof e)?e:"u"<typeof window?n:l}},45917:(e,t,n)=>{n.d(t,{J:()=>i});var r=n(29722);let o={};function i({theme:e,classNames:t,props:n,stylesCtx:l}){let s;return s={},(Array.isArray(t)?t:[t]).map(t=>"function"==typeof t?t(e,n,l):t||o).forEach(e=>{Object.entries(e).forEach(([e,t])=>{s[e]?s[e]=(0,r.A)(s[e],t):s[e]=t})}),s}},48219:(e,t,n)=>{n.d(t,{C:()=>o});var r=n(12115);function o(e,t){let n=(0,r.useRef)(!1);(0,r.useEffect)(()=>()=>{n.current=!1},[]),(0,r.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}},48273:(e,t,n)=>{let r;n.d(t,{dn:()=>g,Bd:()=>h,IA:()=>y,WI:()=>v});var o=n(87443),i=n(8750);let l=e=>void 0===e?null:e;class s{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let a=new s;try{"u">typeof localStorage&&localStorage&&(a=localStorage)}catch(e){}let c=a;var d=n(33867),u=n(41463);let p=void 0!==u&&u.release&&/node|io\.js/.test(u.release.name)&&"[object process]"===Object.prototype.toString.call(void 0!==u?u:0),h="u">typeof window&&"u">typeof document&&!p;"u">typeof navigator&&/Mac/.test(navigator.platform);let f=[],m=e=>(()=>{if(void 0===r)if(p){r=o.vt();let e=u.argv,t=null;for(let n=0;n<e.length;n++){let o=e[n];"-"===o[0]?(null!==t&&r.set(t,""),t=o):null!==t?(r.set(t,o),t=null):f.push(o)}null!==t&&r.set(t,"")}else"object"==typeof location?(r=o.vt(),(location.search||"?").slice(1).split("&").forEach(e=>{if(0!==e.length){let[t,n]=e.split("=");r.set(`--${i.jN(t,"-")}`,n),r.set(`-${i.jN(t,"-")}`,n)}})):r=o.vt();return r})().has(e),g=e=>p?l(u.env[e.toUpperCase().replaceAll("-","_")]):l(c.getItem(e)),b=e=>m("--"+e)||null!==g(e),y=b("production"),v=p&&d.EK(u.env.FORCE_COLOR,["true","1","2"])||!m("--no-colors")&&!b("no-color")&&(!p||u.stdout.isTTY)&&(!p||m("--color")||null!==g("COLORTERM")||(g("TERM")||"").includes("color"))},48513:(e,t,n)=>{n.d(t,{S:()=>i});var r=n(95155),o=n(67413);function i({size:e,style:t,...n}){let l=void 0!==e?{width:(0,o.D)(e),height:(0,o.D)(e),...t}:t;return(0,r.jsx)("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:l,"aria-hidden":!0,...n,children:(0,r.jsx)("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}n(12115)},48863:(e,t,n)=>{n.d(t,{t:()=>r});var r=class{callbacks={};on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}}},50947:(e,t,n)=>{n.d(t,{yy:()=>p,R8:()=>h});var r=n(48273),o=n(19441);class i{constructor(e,t){this.left=e,this.right=t}}let l=(e,t)=>new i(e,t);var s=n(84206),a=n(87443),c=n(63758);let d={[c.Y]:l("font-weight","bold"),[c.Ny]:l("font-weight","normal"),[c.ft]:l("color","blue"),[c.AV]:l("color","green"),[c.Qu]:l("color","grey"),[c.UH]:l("color","red"),[c.hr]:l("color","purple"),[c.hN]:l("color","orange"),[c.Tx]:l("color","black")},u=r.WI?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=a.vt(),o=[],i=0;for(;i<e.length;i++){let o=e[i],l=d[o];if(void 0!==l)r.set(l.left,l.right);else{if(void 0===o)break;if(o.constructor===String||o.constructor===Number){let e=s.OW(r);i>0||e.length>
170?(t.push("%c"+o),n.push(e)):t.push(o)}else break}}for(i>0&&(o=n).unshift(t.join(""));i<e.length;i++){let t=e[i];t instanceof Symbol||o.push(t)}return o}:c.ET,p=(...e)=>{console.log(...u(e)),f.forEach(t=>t.print(e))},h=(...e)=>{console.warn(...u(e)),e.unshift(c.hN),f.forEach(t=>t.print(e))},f=o.vt()},51913:(e,t,n)=>{n.d(t,{g:()=>s});var r=n(89042),o=n(54826);function i(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function l(e,t=.179){return!e.startsWith("var(")&&function(e){if(e.startsWith("oklch(")){let t;return(((t=e.match(/oklch\((.*?)%\s/))?parseFloat(t[1]):null)||0)/100}let{r:t,g:n,b:r}=(0,o.K)(e);return .2126*i(t/255)+.7152*i(n/255)+.0722*i(r/255)}(e)>t}function s({color:e,theme:t,colorScheme:n}){if("string"!=typeof e)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if("bright"===e)return{color:e,value:"dark"===n?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:l("dark"===n?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if("dimmed"===e)return{color:e,value:"dark"===n?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:l("dark"===n?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if("white"===e||"black"===e)return{color:e,value:"white"===e?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:l("white"===e?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[o,i]=e.split("."),a=i?Number(i):void 0,c=o in t.colors;if(c){let e=void 0!==a?t.colors[o][a]:t.colors[o][(0,r.g)(t,n||"light")];return{color:o,value:e,shade:a,isThemeColor:c,isLight:l(e,t.luminanceThreshold),variable:i?`--mantine-color-${o}-${a}`:`--mantine-color-${o}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:l(e,t.luminanceThreshold),shade:a,variable:void 0}}},54169:(e,t,n)=>{n.d(t,{r:()=>f});var r=n(95155),o=n(12115),i=n(66629),l=n(69954),s=n(47650),a=n(34259),c=n(84101),d=n(65214);function u(e){let t=document.createElement("div");return t.setAttribute("data-portal","true"),"string"==typeof e.className&&t.classList.add(...e.className.split(" ").filter(Boolean)),"object"==typeof e.style&&Object.assign(t.style,e.style),"string"==typeof e.id&&t.setAttribute("id",e.id),t}let p={reuseTargetNode:!0},h=(0,l.P9)((e,t)=>{let{children:n,target:i,reuseTargetNode:l,...h}=(0,d.Y)("Portal",p,e),[f,m]=(0,o.useState)(!1),g=(0,o.useRef)(null);return((0,a.o)(()=>(m(!0),g.current=function({target:e,reuseTargetNode:t,...n}){if(e)return"string"==typeof e?document.querySelector(e)||u(n):e;if(t){let e=document.querySelector("[data-mantine-shared-portal-node]");if(e)return e;let t=u(n);return t.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(t),t}return u(n)}({target:i,reuseTargetNode:l,...h}),(0,c.bl)(t,g.current),i||l||!g.current||document.body.appendChild(g.current),()=>{i||l||!g.current||document.body.removeChild(g.current)}),[i]),f&&g.current)?(0,s.createPortal)((0,r.jsx)(r.Fragment,{children:n}),g.current):null});h.displayName="@mantine/core/Portal";let f=(0,l.P9)(({withinPortal:e=!0,children:t,...n},o)=>"test"!==(0,i.bv)()&&e?(0,r.jsx)(h,{ref:o,...n,children:t}):(0,r.jsx)(r.Fragment,{children:t}));f.displayName="@mantine/core/OptionalPortal"},54826:(e,t,n)=>{n.d(t,{K:()=>r});function r(e){if(/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)){let t=e.replace("#","");if(3===t.length){let e=t.split("");t=[e[0],e[0],e[1],e[1],e[2],e[2]].join("")}if(8===t.length){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n,a:1}}return e.startsWith("rgb")?function(e){let[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:void 0===o?1:o}}(e):e.startsWith("hsl")?function(e){let t,n,r,o=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!o)return{r:0,g:0,b:0,a:1};let i=parseInt(o[1],10),l=parseInt(o[2],10)/100,s=parseInt(o[3],10)/100,a=o[5]?parseFloat(o[5]):void 0,c=(1-Math.abs(2*s-1))*l,d=i/60,u=c*(1-Math.abs(d%2-1)),p=s-c/2;return d>=0&&d<1?(t=c,n=u,r=0):d>=1&&d<2?(t=u,n=c,r=0):d>=2&&d<3?(t=0,n=c,r=u):d>=3&&d<4?(t=0,n=u,r=c):d>=4&&d<5?(t=u,n=0,r=c):(t=c,n=0,r=u),{r:Math.round((t+p)*255),g:Math.round((n+p
17)*255),b:Math.round((r+p)*255),a:a||1}}(e):{r:0,g:0,b:0,a:1}}},56200:(e,t,n)=>{function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}n.d(t,{$:()=>function e(t,n){let o={...t};return r(t)&&r(n)&&Object.keys(n).forEach(i=>{r(n[i])&&i in t?o[i]=e(o[i],n[i]):o[i]=n[i]}),o}})},57142:(e,t,n)=>{n.d(t,{N:()=>d});var r=n(95155);n(12115);var o=n(65214),i=n(74279),l=n(97276),s=n(38273),a={root:"m_87cf2631"};let c={__staticSelector:"UnstyledButton"},d=(0,s.v)((e,t)=>{let n=(0,o.Y)("UnstyledButton",c,e),{className:s,component:d="button",__staticSelector:u,unstyled:p,classNames:h,styles:f,style:m,attributes:g,...b}=n,y=(0,i.I)({name:u,props:n,classes:a,className:s,style:m,classNames:h,styles:f,unstyled:p,attributes:g});return(0,r.jsx)(l.a,{...y("root",{focusable:!0}),component:d,ref:t,type:"button"===d?"button":void 0,...b})});d.classes=a,d.displayName="@mantine/core/UnstyledButton"},59710:(e,t,n)=>{n.d(t,{xq:()=>b,b6:()=>k,ZS:()=>C,tN:()=>x});var r=function(){};r.prototype.append=function(e){return e.length?(e=r.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},r.prototype.prepend=function(e){return e.length?r.from(e).append(this):this},r.prototype.appendInner=function(e){return new i(this,e)},r.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?r.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},r.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},r.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},r.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},r.from=function(e){return e instanceof r?e:e&&e.length?new o(e):r.empty};var o=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(r);r.empty=new o([]);var i=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;if(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r)||n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;if(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o)||n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(r),l=n(8242),s=n(76865);class a{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,o,i;if(0==this.eventCount)return null;let l=this.items.length;for(;;l--)if(this.items.get(l-1).selection){--l;break}t&&(r=(n=this.remapping(l,this.items.length)).maps.length);let s=e.tr,d=[],u=[];
17return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(l,t+1)).maps.length),r--,u.push(e);return}if(n){u.push(new c(e.map));let t=e.step.map(n.slice(r)),o;t&&s.maybeStep(t).doc&&(o=s.mapping.maps[s.mapping.maps.length-1],d.push(new c(o,void 0,void 0,d.length+u.length))),r--,o&&n.appendMap(o,r)}else s.maybeStep(e.step);if(e.selection)return o=n?e.selection.map(n.slice(r)):e.selection,i=new a(this.items.slice(0,l).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:i,transform:s,selection:o}}addTransform(e,t,n,r){var o,i;let l,s=[],d=this.eventCount,p=this.items,h=!r&&p.length?p.get(p.length-1):null;for(let n=0;n<e.steps.length;n++){let o=e.steps[n].invert(e.docs[n]),i=new c(e.mapping.maps[n],o,t),l;(l=h&&h.merge(i))&&(i=l,n?s.pop():p=p.slice(0,p.length-1)),s.push(i),t&&(d++,t=void 0),r||(h=i)}let f=d-n.depth;return f>u&&(o=p,i=f,o.forEach((e,t)=>{if(e.selection&&0==i--)return l=t,!1}),p=o.slice(l),d-=f),new a(p.append(s),d)}remapping(e,t){let n=new l.X9;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(e){return 0==this.eventCount?this:new a(this.items.append(e.map(e=>new c(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(e=>{e.selection&&l--},r);let s=t;this.items.forEach(t=>{let r=o.getMirror(--s);if(null==r)return;i=Math.min(i,r);let a=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(o.slice(s+1,r));d&&l++,n.push(new c(a,i,d))}else n.push(new c(a))},r);let d=[];for(let e=t;e<i;e++)d.push(new c(o.maps[e]));let u=new a(this.items.slice(0,r).append(d).append(n),l);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,o=[],i=0;return this.items.forEach((r,l)=>{if(l>=e)o.push(r),r.selection&&i++;else if(r.step){let e=r.step.map(t.slice(n)),l=e&&e.getMap();if(n--,l&&t.appendMap(l,n),e){let s=r.selection&&r.selection.map(t.slice(n));s&&i++;let a=new c(l.invert(),e,s),d,u=o.length-1;(d=o.length&&o[u].merge(a))?o[u]=d:o.push(a)}}else r.map&&n--},this.items.length,0),new a(r.from(o.reverse()),i)}}a.empty=new a(r.empty,0);class c{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new c(t.getMap().invert(),t,this.selection)}}}class d{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}let u=20;function p(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,o)=>t.push(r,o));return t}function h(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let f=!1,m=null;function g(e){let t=e.plugins;if(m!=t){f=!1,m=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){f=!0;break}}return f}function b(e){return e.setMeta(v,!0)}let y=new s.hs("history"),v=new s.hs("closeHistory");function k(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new s.k_({key:y,state:{init:()=>new d(a.empty,a.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let o=n.getMeta(y),i;if(o)return o.historyState;n.getMeta(v)&&(e=new d(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(l&&l.getMeta(y))if(l.getMeta(y).redo)return new d(e.done.addTransform(n,void 0,r,g(t)),e.undone,p(n.mapping.maps),e.prevTime,e.prevComposition);else return new d(e.done,e.undone.addTransform(n,void 0,r,g(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))if(i=n.getMeta("rebased"))return new d(e.done.rebased(n,i),e.undone.rebased(n,i),h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new d(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!l&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;
17return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),s=l?h(e.prevRanges,n.mapping):p(n.mapping.maps);return new d(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,g(t)),a.empty,s,n.time,null==o?e.prevComposition:o)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?x:"historyRedo"==n?C:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function w(e,t){return(n,r)=>{let o=y.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=g(t),o=y.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let l=i.selection.resolve(i.transform.doc),s=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),a=new d(n?s:i.remaining,n?i.remaining:s,null,0,-1);return i.transform.setSelection(l).setMeta(y,{redo:n,historyState:a})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}let x=w(!1,!0),C=w(!0,!0);w(!1,!1),w(!0,!1)},60572:(e,t,n)=>{n.d(t,{C:()=>o});var r=n(12115);function o(){let e=(0,r.useId)().replace(/[:«»]/g,"");return`__m__-${e}`}},60744:(e,t,n)=>{n.d(t,{e:()=>i});var r=n(95155),o=n(12115);function i(e=null){let t=(0,o.createContext)(e);return[({children:e,value:n})=>(0,r.jsx)(t.Provider,{value:n,children:e}),()=>(0,o.useContext)(t)]}},60806:(e,t,n)=>{n.d(t,{S:()=>d});var r=n(67413);n(12115),n(95155);var o=n(54826);function i(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${100*t}%)`;let{r:n,g:r,b:i,a:l}=(0,o.K)(e),s=1-t,a=e=>Math.round(e*s);return`rgba(${a(n)}, ${a(r)}, ${a(i)}, ${l})`}var l=n(69458),s=n(51913),a=n(7060);let c="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",d={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:{dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:({color:e,theme:t,variant:n,gradient:o,autoContrast:c})=>{let d=(0,s.g)({color:e,theme:t}),u="boolean"==typeof c?c:t.autoContrast;if("none"===n)return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if("filled"===n){let t=u&&d.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return d.isThemeColor?void 0===d.shade?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${(0,r.D)(1)} solid transparent`}:{background:`var(--mantine-color-${d.color}-${d.shade})`,hover:`var(--mantine-color-${d.color}-${9===d.shade?8:d.shade+1})`,color:t,border:`${(0,r.D)(1)} solid transparent`}:{background:e,hover:i(e,.1),color:t,border:`${(0,r.D)(1)} solid transparent`}}if("light"===n){if(d.isThemeColor){if(void 0===d.shade)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${(0,r.D)(1)} solid transparent`};let n=t.colors[d.color][d.shade];return{background:(0,a.B)(n,.1),hover:(0,a.B)(n,.12),color:`var(--mantine-color-${d.color}-${Math.min(d.shade,6)})`,border:`${(0,r.D)(1)} solid transparent`}}return{background:(0,a.B)(e,.1),hover:(0,a.B)(e,.12),color:e,border:`${(0,r.D)(1)} solid transparent`}}if("outline"===n)return d.isThemeColor?void 0===d.shade?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${(0,r.D)(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:(0,a.B)(t.colors[d.color][d.shade],.05),color:`var(--mantine-color-${d.color}-${d.shade})`,border:`${(0,r.D)(1)} solid var(--mantine-color-${d.color}-${d.shade})`}:{background:"transparent",hover:(0,a.B)(e,.05),color:e,border:`${(0,r.D)(1)} solid ${e}`};if("subtle"===n){if(d.isThemeColor){if(void 0===d.shade)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${(0,r.D)(1)} solid transparent`};let n=t.colors[d.color][d.shade];return{background:"transparent",hover:(0,a.B)(n,.12),color:`var(--mantine-color-${d.color}-${Math.min(d.shade,6)})`,border:`${(0,r.D)(1)} solid transparent`}}return{background:"transparent",hover:(0,a.B)(e,.12),color:e,border:`${(0,r.D)(1)} solid transparent`}}if("transparent"===n)return d.isThemeColor?void 0===d.shade?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${(0,r.D)(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${d.color}-${Math.min(d.shade,6)})`,border:`${(0,r.D)(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${(0,r.D)(1)} solid transparent`};if("white"===n)return d.isThemeColor?void 0===d.shade?{background:"var(--mantine-color-white)",hover:i(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${(0,r.D)(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:i(t.white,.01),color:`var(--mantine-color-${d.color}-${d.shade})`,border:`${(0,r.D)(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:i(t.white,.01),color:e,border:`${(0,r.D)(1)} solid transparent`};return"gradient"===n?{background:(0,l.v)(o,t),hover:(0,l.v)(o,t),color:"var(--mantine-color-white)",border:"none"}:"default"===n?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${(0,r.D)(1)} solid var(--mantine-color-default-border)`}:{}},autoContrast:!1,luminanceThreshold:.3,fontFamily:c,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:c,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:(0,r.D)(34),lineHeight:"1.3"},h2:{fontSize:(0,r.D)(26),lineHeight:"1.35"},h3:{fontSize:(0,r.D)(22),lineHeight:"1.4"},h4:{fontSize:(0,r.D)(18),lineHeight:"1.45"},h5:{fontSize:(0,r.D)(16),lineHeight:"1.5"},h6:{fontSize:(0,r.D)(14),lineHeight:"1.5"}}},fontSizes:{xs:(0,r.D)(12),sm:(0,r.D)(14),md:(0,r.D)(16),lg:(0,r.D)(18),xl:(0,r.D)(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:(0,r.D)(2),sm:(0,r.D)(4),md:(0,r.D)(8),lg:(0,r.D)(16),xl:(0,r.D)(32)},spacing:{xs:(0,r.D)(10),sm:(0,r.D)(12),md:(0,r.D)(16),lg:(0,r.D)(20),xl:(0,r.D)(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${(0,r.D)(1)} ${(0,r.D)(3)} rgba(0, 0, 0, 0.05), 0 ${(0,r.D)(1)} ${(0,r.D)(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${(0,r.D)(1)} ${(0,r.D)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.D)(10)} ${(0,r.D)(15)} ${(0,r.D)(-5)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.D)(7)} ${(0,r.D)(7)} ${(0,r.D)(-5)}`,md:`0 ${(0,r.D)(1)} ${(0,r.D)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.D)(20)} ${(0,r.D)(25)} ${(0,r.D)(-5)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.D)(10)} ${(0,r.D)(10)} ${(0,r.D)(-5)}`,lg:`0 ${(0,r.D)(1)} ${(0,r.D)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.D)(28)} ${(0,r.D)(23)} ${(0,r.D)(-7)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.D)(12)} ${(0,r.D)(12)} ${(0,r.D)(-7)}`,xl:`0 ${(0,r.D)(1)} ${(0,r.D)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.D)(36)} ${(0,r.D)(28)} ${(0,r.D)(-7)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.D)(17)} ${(0,r.D)(17)} ${(0,r.D)(-7)}`},other:{},components:{}}},61025:(e,t,n)=>{n.d(t,{l:()=>p});var r=n(12115),o=n(29722),i=n(84101);n(95155);var l=n(22442),s=n(67740),a=n(65214),c=n(69954),d=n(38356);let u={refProp:"ref",popupType:"dialog"},p=(0,c.P9)((e,t)=>{let{children:n,refProp:c,popupType:p,...h}=(0,a.Y)("PopoverTarget",u,e),f=(0,s.D)(n);if(!f)throw Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, str
17ings, numbers and other primitive values are not supported");let m=(0,d.C)(),g=(0,i.pc)(m.reference,(0,l.x)(f),t),b=m.withRoles?{"aria-haspopup":p,"aria-expanded":m.opened,"aria-controls":m.getDropdownId(),id:m.getTargetId()}:{},y=f.props;return(0,r.cloneElement)(f,{...h,...b,...m.targetProps,className:(0,o.A)(m.targetProps.className,h.className,y.className),[c]:g,...!m.controlled?{onClick:()=>{m.onToggle(),y.onClick?.()}}:null})});p.displayName="@mantine/core/PopoverTarget"},61108:(e,t,n)=>{n.d(t,{dX:()=>V,TO:()=>tr,_x:()=>ei,Fq:()=>Z,Ui:()=>eI,PT:()=>eb,T9:()=>ey,T5:()=>eM,pg:()=>ej,p4:()=>eP,ge:()=>eV,gc:()=>eo,vZ:()=>tM,HN:()=>eH,Db:()=>eg,Px:()=>tT,dm:()=>e6});var r=n(2109),o=n(76291),i=n(12115),l=n(13096),s=n(37366),a=n(14267),c=n(32803),d=n(9683),u=n(76701),p=n(17294),h=n(95155),f=n(30821),m=n(1480),g=n(74473),b=n(47650),y=n(8039);n(94577);var v=n(82159),k=({contentComponent:e})=>{let t=(0,y.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,h.jsx)(h.Fragment,{children:Object.values(t)})},w=class extends i.Component{constructor(e){super(e),this.editorContentRef=i.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,n;if(t.contentComponent)return;let r=this.editorContentRef.current;r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r}),e=new Set,n={},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(t,r){n={...n,[t]:b.createPortal(r.reactElement,r.element,t)},e.forEach(e=>e())},removeRenderer(t){let r={...n};delete r[t],n=r,e.forEach(e=>e())}},t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,h.jsx)(k,{contentComponent:e.contentComponent})]})}},x=(0,i.forwardRef)((e,t)=>{let n=i.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return i.createElement(w,{key:n,innerRef:t,...e})}),C=i.memo(x);"u">typeof window?i.useLayoutEffect:i.useEffect,"u"<typeof window||"u">typeof window&&window.next;var S=(0,i.createContext)({editor:null});S.Consumer;var E=(0,i.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),M=()=>(0,i.useContext)(E),T=i.forwardRef((e,t)=>{let{onDragStart:n}=M(),r=e.as||"div";return(0,h.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function A(e){return!!("function"==typeof e&&e.prototype&&e.prototype.isReactComponent)}function I(e){return!!("object"==typeof e&&e.$$typeof&&("Symbol(react.forward_ref)"===e.$$typeof.toString()||"react.forward_ref"===e.$$typeof.description))}var N=class{constructor(e,{editor:t,props:n={},as:r="div",className:o=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(0xffffffff*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isEditorContentInitialized?(0,b.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,o=function(){try{if(i.version)return parseInt(i.version.split(".")[0],10)>=19}catch{}return!1}(),l=function(e){if(A(e)||I(e))return!0;if("object"==typeof e&&e.$$typeof&&("Symbol(react.memo)"===e.$$typeof.toString()||"react.memo"===e.$$typeof.description)){let t=e.type;if(t)return A(t)||I(t)}return!1}(t),s={...n};s.ref&&!(o||l)&&delete s.ref,!s.ref&&(o||l)&&(s.ref=e=>{this.ref=e}),this.reactElement=(0,h.jsx)(t,{...s}),null==(e=null==r?void 0:r.contentComponent)||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let o=n[r];if(e[o]!==this.props[o]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;null==(e=null==t?void 0:t.contentComponent)||e.removeRenderer(this.id
17);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};i.createContext({markViewContentRef:()=>{}}),v.Db;var j=class extends v.Yv{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.handlePositionUpdate=()=>{let e=this.getPos();"number"==typeof e&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),"function"==typeof this.options.attrs&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const e=this.dom.querySelector("[data-node-view-content]");if(!e)return;e.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,o){var i;return"storage"===r?null!=(i=e.storage[t.name])?i:{}:Reflect.get(n,r,o)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,i.createRef)()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute("data-node-view-wrapper")&&e.removeAttribute("data-node-view-wrapper"),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,i.memo)(e=>(0,h.jsx)(E.Provider,{value:t,children:(0,i.createElement)(n,e)}));r.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);let{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new N(r,{editor:this.editor,props:e,as:o,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let e=this.currentPos;if("number"==typeof e)if((0,v.FA)({selection:this.editor.state.selection,pos:e,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let o=this.node,i=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:o,oldDecorations:i,newNode:e,newDecorations:t,oldInnerDecorations:l,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let o=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=o;let i={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(i.getPos=()=>this.getPos()),r(i),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if("function"==typeof this.options.attrs){let t=this.editor.extensionManager.attributes,n=(0,v.zU)(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n}
17)}else e=this.options.attrs;this.renderer.updateAttributes(e)}}},P=(0,i.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function _({editor:e,instance:t,children:n}){let r=null!=e?e:t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let o=(0,i.useMemo)(()=>({editor:r}),[r]),l=(0,i.useMemo)(()=>({editor:r}),[r]);return(0,h.jsx)(S.Provider,{value:l,children:(0,h.jsx)(P.Provider,{value:o,children:n})})}function B({...e}){let{editor:t}=(0,i.useContext)(P);return(0,h.jsx)(C,{editor:t,...e})}P.displayName="TiptapContext",_.displayName="Tiptap",B.displayName="Tiptap.Content",Object.assign(_,{Content:B});var O=n(12669),R=n(67564),L=e=>{let{blockId:t,children:n,portalElement:o,...l}=e,a=(0,r.m)();return(0,h.jsx)(r.u,{reference:(0,i.useMemo)(()=>a.transact(e=>{if(!t)return;let n=(0,s.Dt)(t,e.doc);if(!n)return;let{node:r}=a.prosemirrorView.domAtPos(n.posBeforeNode+1);if(r instanceof Element)return{element:r}}),[a,t]),portalElement:o,...l,children:void 0!==t&&n})},D=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),l=o.getBlock(e.blockId),[a,c]=(0,i.useState)(""),d=(0,i.useCallback)(e=>{c(e.currentTarget.value)},[]),u=(0,i.useCallback)(e=>{"Enter"!==e.key||e.nativeEvent.isComposing||(e.preventDefault(),o.updateBlock(l.id,{props:{name:(0,s.An)(a),url:a}}))},[o,l.id,a]),p=(0,i.useCallback)(()=>{o.updateBlock(l.id,{props:{name:(0,s.An)(a),url:a}})},[o,l.id,a]);return(0,h.jsxs)(t.FilePanel.TabPanel,{className:"bn-tab-panel",children:[(0,h.jsx)(t.FilePanel.TextInput,{className:"bn-text-input",placeholder:n.file_panel.embed.url_placeholder,value:a,onChange:d,onKeyDown:u,"data-test":"embed-input"}),(0,h.jsx)(t.FilePanel.Button,{className:"bn-button",onClick:p,"data-test":"embed-input-button",children:n.file_panel.embed.embed_button[l.type]||n.file_panel.embed.embed_button.file})]})},$=e=>{let t=(0,r.l)(),n=(0,r.s)(),{setLoading:o}=e,l=(0,r.m)(),s=l.getBlock(e.blockId),[a,c]=(0,i.useState)(!1);(0,i.useEffect)(()=>{a&&setTimeout(()=>{c(!1)},3e3)},[a]);let d=(0,i.useCallback)(t=>{null!==t&&n(t);async function n(t){if(o(!0),void 0!==l.uploadFile)try{let n=await l.uploadFile(t,e.blockId);"string"==typeof n&&(n={props:{name:t.name,url:n}}),l.updateBlock(e.blockId,n)}catch{c(!0)}finally{o(!1)}}},[e.blockId,l,o]),u=l.schema.blockSpecs[s.type],p=u.implementation.meta?.fileBlockAccept?.length?u.implementation.meta.fileBlockAccept.join(","):"*/*";return(0,h.jsxs)(t.FilePanel.TabPanel,{className:"bn-tab-panel",children:[(0,h.jsx)(t.FilePanel.FileInput,{className:"bn-file-input","data-test":"upload-input",accept:p,placeholder:n.file_panel.upload.file_placeholder[s.type]||n.file_panel.upload.file_placeholder.file,value:null,onChange:d}),a&&(0,h.jsx)("div",{className:"bn-error-text",children:n.file_panel.upload.upload_error})]})},F=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),[l,s]=(0,i.useState)(!1),a=e.tabs??[...void 0===o.uploadFile?[]:[{name:n.file_panel.upload.title,tabPanel:(0,h.jsx)($,{blockId:e.blockId,setLoading:s})}],{name:n.file_panel.embed.title,tabPanel:(0,h.jsx)(D,{blockId:e.blockId})}],[c,d]=(0,i.useState)(e.defaultOpenTab||a[0].name);return(0,h.jsx)(t.FilePanel.Root,{className:"bn-panel",defaultOpenTab:c,openTab:c,setOpenTab:d,tabs:a,loading:l})},z=e=>{let t=(0,r.m)(),n=(0,r.f)(s.mt),o=(0,r.p)(s.mt),l=(0,i.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!o,onOpenChange:(e,r,o)=>{e||n.closeMenu(),"escape-key"===o&&t.focus()},middleware:[(0,d.cY)(10),(0,d.UU)()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:90},...e.floatingUIOptions?.elementProps}}),[o,t,n,e.floatingUIOptions]),a=e.filePanel||F;return(0,h.jsx)(L,{blockId:o,portalElement:e.portalElement,...l,children:o&&(0,h.jsx)(a,{blockId:o})})},H={bold:f.L0M,italic:f.Adp,underline:f.UtK,strike:f.zUW,code:f.Kav},V=e=>{let t=(0,r.s)(),n=(0,r.l)(),o=(0,r.m)(),l=(0,r.o)({editor:o,selector:({editor:t})=>{var n;if(!(!t.isEditable||!((n=e.basicTextStyle)in t.schema.styleSchema)||t.schema.styleSchema[n].type!==n||"boolean"!==t.schema.styleSchema[n].propSchema||!(t.getSelection()?.blocks||[t.getTextCursorPosition().block]).find(e=>void 0!==e.content)))return e.basicTextStyle in t.getActiveStyles()?{active:!0}:{active:!1}}}),a=(0,i.useCallback)(e=>{o.focus(),o.toggleStyles({[e]:!0})},[o,e]);if(void 0===l)return null;
17let c=H[e.basicTextStyle];return(0,h.jsx)(n.FormattingToolbar.Button,{className:"bn-button","data-test":e.basicTextStyle,onClick:()=>a(e.basicTextStyle),isSelected:l.active,label:t.formatting_toolbar[e.basicTextStyle].tooltip,mainTooltip:t.formatting_toolbar[e.basicTextStyle].tooltip,secondaryTooltip:(0,s.Fn)(t.formatting_toolbar[e.basicTextStyle].secondary_tooltip,t.generic.ctrl_shortcut),icon:(0,h.jsx)(c,{})})},U=e=>{let t=e.textColor||"default",n=e.backgroundColor||"default",r=e.size||16;return(0,h.jsx)("div",{className:"bn-color-icon","data-background-color":n,"data-text-color":t,style:(0,i.useMemo)(()=>({pointerEvents:"none",fontSize:(.75*r).toString()+"px",height:r.toString()+"px",lineHeight:r.toString()+"px",textAlign:"center",width:r.toString()+"px"}),[r]),children:"A"})},W=["default","gray","brown","red","orange","yellow","green","blue","purple","pink"],J=e=>{let t=(0,r.l)(),n=(0,r.s)();return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(()=>e.text?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(t.Generic.Menu.Label,{children:n.color_picker.text_title}),W.map(r=>(0,h.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick&&e.onClick(),e.text.setColor(r)},"data-test":"text-color-"+r,icon:(0,h.jsx)(U,{textColor:r,size:e.iconSize}),checked:e.text.color===r,children:n.color_picker.colors[r]},"text-color-"+r))]}):null,{}),(0,h.jsx)(()=>e.background?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(t.Generic.Menu.Label,{children:n.color_picker.background_title}),W.map(r=>(0,h.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick&&e.onClick(),e.background.setColor(r)},"data-test":"background-color-"+r,icon:(0,h.jsx)(U,{backgroundColor:r,size:e.iconSize}),checked:e.background.color===r,children:n.color_picker.colors[r]},"background-color-"+r))]}):null,{})]})};function G(e,t){return`${e}Color`in t.schema.styleSchema&&t.schema.styleSchema[`${e}Color`].type===`${e}Color`&&"string"===t.schema.styleSchema[`${e}Color`].propSchema}var q=()=>{let e=(0,r.l)(),t=(0,r.s)(),n=(0,r.m)(),o=G("text",n),l=G("background",n),s=(0,r.o)({editor:n,selector:({editor:e})=>{if(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>void 0!==e.content))return;let t=G("text",e),n=G("background",e);if(!(!t&&!n))return{textColor:t?e.getActiveStyles().textColor||"default":void 0,backgroundColor:n?e.getActiveStyles().backgroundColor||"default":void 0}}}),a=(0,i.useCallback)(e=>{if(!o)throw Error("Tried to set text color, but style does not exist in editor schema.");"default"===e?n.removeStyles({textColor:e}):n.addStyles({textColor:e}),setTimeout(()=>{n.focus()})},[n,o]),c=(0,i.useCallback)(e=>{if(!l)throw Error("Tried to set background color, but style does not exist in editor schema.");"default"===e?n.removeStyles({backgroundColor:e}):n.addStyles({backgroundColor:e}),setTimeout(()=>{n.focus()})},[l,n]);return void 0===s?null:(0,h.jsxs)(e.Generic.Menu.Root,{children:[(0,h.jsx)(e.Generic.Menu.Trigger,{children:(0,h.jsx)(e.FormattingToolbar.Button,{className:"bn-button","data-test":"colors",label:t.formatting_toolbar.colors.tooltip,mainTooltip:t.formatting_toolbar.colors.tooltip,icon:(0,h.jsx)(U,{textColor:s.textColor,backgroundColor:s.backgroundColor,size:20})})}),(0,h.jsx)(e.Generic.Menu.Dropdown,{className:"bn-menu-dropdown bn-color-picker-dropdown",children:(0,h.jsx)(J,{text:s.textColor?{color:s.textColor,setColor:a}:void 0,background:s.backgroundColor?{color:s.backgroundColor,setColor:c}:void 0})})]})},K=e=>{for(let t of a.g)if(e.startsWith(t))return e;return`${a.h}://${e}`},Y=e=>{let t=(0,r.l)(),n=(0,r.s)(),{editLink:o}=(0,r.f)(a._),{url:l,text:s,showTextField:c}=e,[d,u]=(0,i.useState)(l),[p,m]=(0,i.useState)(s);(0,i.useEffect)(()=>{u(l),m(s)},[s,l]);let g=(0,i.useCallback)(t=>{"Enter"!==t.key||t.nativeEvent.isComposing||(t.preventDefault(),o(K(d),p,e.range.from),e.setToolbarOpen?.(!1),e.setToolbarPositionFrozen?.(!1))},[o,d,p,e]),b=(0,i.useCallback)(e=>u(e.currentTarget.value),[]),y=(0,i.useCallback)(e=>m(e.currentTarget.value),[]),v=(0,i.useCallback)(()=>{o(K(d),p,e.range.from),e.setToolbarOpen?.(!1),e.setToolbarPositionFrozen?.(!1)},[o,d,p,e]);return(0,h.jsxs)(t.Generic.Form.Root,{children:[(0,h.jsx)(t.Generic.Form.TextInput,{className:"bn-text-input",n
17ame:"url",icon:(0,h.jsx)(f.Y$G,{}),autoFocus:!0,placeholder:n.link_toolbar.form.url_placeholder,value:d,onKeyDown:g,onChange:b,onSubmit:v}),!1!==c&&(0,h.jsx)(t.Generic.Form.TextInput,{className:"bn-text-input",name:"title",icon:(0,h.jsx)(f.NtT,{}),placeholder:n.link_toolbar.form.title_placeholder,value:p,onKeyDown:g,onChange:y,onSubmit:v})]})},Z=()=>{let e=(0,r.m)(),t=(0,r.a)(),n=(0,r.l)(),o=(0,r.s)(),l=(0,r.f)(s.m),{showSelection:a}=(0,r.f)(c.t),[d,u]=(0,i.useState)(!1);(0,i.useEffect)(()=>(a(d,"createLinkButton"),()=>a(!1,"createLinkButton")),[d,a]);let p=(0,r.o)({editor:e,selector:({editor:e})=>{if(!(!e.isEditable||!("link"in e.schema.inlineContentSchema&&"link"===e.schema.inlineContentSchema.link)||(0,s._)(e.prosemirrorState.selection)||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>void 0!==e.content)))return{url:e.getSelectedLinkUrl(),text:e.getSelectedText(),range:{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}}}});return(0,i.useEffect)(()=>{u(!1)},[p]),(0,i.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(u(!0),e.preventDefault())};return t?.addEventListener("keydown",e),()=>{t?.removeEventListener("keydown",e)}},[t]),void 0===p?null:(0,h.jsxs)(n.Generic.Popover.Root,{open:d,onOpenChange:u,children:[(0,h.jsx)(n.Generic.Popover.Trigger,{children:(0,h.jsx)(n.FormattingToolbar.Button,{className:"bn-button","data-test":"createLink",label:o.formatting_toolbar.link.tooltip,mainTooltip:o.formatting_toolbar.link.tooltip,secondaryTooltip:(0,s.Fn)(o.formatting_toolbar.link.secondary_tooltip,o.generic.ctrl_shortcut),icon:(0,h.jsx)(f.Y$G,{}),onClick:()=>u(e=>!e)})}),(0,h.jsx)(n.Generic.Popover.Content,{className:"bn-popover-content bn-form-popover",variant:"form-popover",children:(0,h.jsx)(Y,{url:p.url||"",text:p.text,range:p.range,showTextField:!1,setToolbarOpen:e=>l.store.setState(e)})})]})},X=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if((0,s.h)(n,e,n.type,{url:"string",caption:"string"}))return n}}),[l,a]=(0,i.useState)(!1),c=(0,i.useCallback)(e=>{void 0!==o&&(0,s.g)(n,o.type,{caption:"string"})&&n.updateBlock(o.id,{props:{caption:e.currentTarget.value}})},[o,n]),d=(0,i.useCallback)(e=>{"Enter"!==e.key||e.nativeEvent.isComposing||(e.preventDefault(),a(!1))},[]);return void 0===o?null:(0,h.jsxs)(t.Generic.Popover.Root,{open:l,onOpenChange:a,children:[(0,h.jsx)(t.Generic.Popover.Trigger,{children:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.file_caption.tooltip,mainTooltip:e.formatting_toolbar.file_caption.tooltip,icon:(0,h.jsx)(f.YhY,{}),onClick:()=>a(e=>!e)})}),(0,h.jsx)(t.Generic.Popover.Content,{className:"bn-popover-content bn-form-popover",variant:"form-popover",children:(0,h.jsx)(t.Generic.Form.Root,{children:(0,h.jsx)(t.Generic.Form.TextInput,{name:"file-caption",icon:(0,h.jsx)(f.YhY,{}),value:o.props.caption,autoFocus:!0,placeholder:e.formatting_toolbar.file_caption.input_placeholder,onKeyDown:d,onChange:c})})})]})},Q=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if((0,s.h)(n,e,n.type,{url:"string"}))return n}}),l=(0,i.useCallback)(()=>{void 0!==o&&(n.focus(),n.removeBlocks([o.id]))},[o,n]);return void 0===o?null:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.file_delete.tooltip[o.type]||e.formatting_toolbar.file_delete.tooltip.file,mainTooltip:e.formatting_toolbar.file_delete.tooltip[o.type]||e.formatting_toolbar.file_delete.tooltip.file,icon:(0,h.jsx)(f.lzB,{}),onClick:l})},ee=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if((0,s.h)(n,e,n.type,{url:"string",name:"string"}))return n}}),[l,a]=(0,i.useState)(!1),c=(0,i.useCallback)(e=>{void 0!==o&&(0,s.g)(n,o.type,{name:"string"})&&n.updateBlock(o.id,{props:{name:e.currentTarget.value}})},[o,n]),d=(0,i.useCallback)(e=>{"Enter"!==e.key||e.nativeEvent.isComposing||(e.preventDefault(),a(!1))},[]);return void 0===o?null:(0,h.jsxs)(t.Generic.Popover.Root,{open:l,onOpenChange:a,children:[(0,h.jsx)(t.Generic.Popover.Trigger,{children:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.file_rename.tooltip[o.type]||e.formatting_toolbar.file_rename.tooltip.file,mainTooltip:e.formatting_toolbar.file_rename.tooltip[o.type]||e.formatting_toolbar.file_rename.tooltip.file,icon:(0,h.jsx)(f.b5M,{}),onClick:()=>a(e=>!e)})}),(0,h.jsx)(t.Generic.Popover.Content,{className:"bn-popover-content bn-form-popover",variant:"form-popover",children:(0,h.jsx)(t.Generic.Form.Root,{children:(0,h.jsx)(t.Generic.Form.TextInput,{name:"file-name",icon:(0,h.jsx)(f.b5M,{}
17),value:o.props.name,autoFocus:!0,placeholder:e.formatting_toolbar.file_rename.input_placeholder[o.type]||e.formatting_toolbar.file_rename.input_placeholder.file,onKeyDown:d,onChange:c})})})]})},et=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.o)({editor:(0,r.m)(),selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if((0,s.h)(n,e,n.type,{url:"string"}))return n}});return void 0===n?null:(0,h.jsxs)(t.Generic.Popover.Root,{position:"bottom",children:[(0,h.jsx)(t.Generic.Popover.Trigger,{children:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",mainTooltip:e.formatting_toolbar.file_replace.tooltip[n.type]||e.formatting_toolbar.file_replace.tooltip.file,label:e.formatting_toolbar.file_replace.tooltip[n.type]||e.formatting_toolbar.file_replace.tooltip.file,icon:(0,h.jsx)(f.opn,{})})}),(0,h.jsx)(t.Generic.Popover.Content,{className:"bn-popover-content bn-panel-popover",variant:"panel-popover",children:(0,h.jsx)(F,{blockId:n.id})})]})},en=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>{if(!(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>void 0!==e.content)))return{canNestBlock:e.canNestBlock()}}}),l=(0,i.useCallback)(()=>{void 0!==o&&o.canNestBlock&&(n.focus(),n.nestBlock())},[n,o]);return void 0===o?null:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button","data-test":"nestBlock",onClick:l,isDisabled:!o.canNestBlock,label:e.formatting_toolbar.nest.tooltip,mainTooltip:e.formatting_toolbar.nest.tooltip,secondaryTooltip:(0,s.Fn)(e.formatting_toolbar.nest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,h.jsx)(f.cUm,{})})},er=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>{if(!(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>void 0!==e.content)))return{canUnnestBlock:e.canUnnestBlock()}}}),l=(0,i.useCallback)(()=>{void 0!==o&&o.canUnnestBlock&&(n.focus(),n.unnestBlock())},[n,o]);return void 0===o?null:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button","data-test":"unnestBlock",onClick:l,isDisabled:!o.canUnnestBlock,label:e.formatting_toolbar.unnest.tooltip,mainTooltip:e.formatting_toolbar.unnest.tooltip,secondaryTooltip:(0,s.Fn)(e.formatting_toolbar.unnest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,h.jsx)(f.oaB,{})})},eo=e=>[{name:e.slash_menu.paragraph.title,type:"paragraph",icon:f.NtT},{name:e.slash_menu.heading.title,type:"heading",props:{level:1,isToggleable:!1},icon:f.vmM},{name:e.slash_menu.heading_2.title,type:"heading",props:{level:2,isToggleable:!1},icon:f.Qkt},{name:e.slash_menu.heading_3.title,type:"heading",props:{level:3,isToggleable:!1},icon:f.JIf},{name:e.slash_menu.heading_4.title,type:"heading",props:{level:4,isToggleable:!1},icon:f.QzB},{name:e.slash_menu.heading_5.title,type:"heading",props:{level:5,isToggleable:!1},icon:f.JXn},{name:e.slash_menu.heading_6.title,type:"heading",props:{level:6,isToggleable:!1},icon:f.Qep},{name:e.slash_menu.toggle_heading.title,type:"heading",props:{level:1,isToggleable:!0},icon:f.vmM},{name:e.slash_menu.toggle_heading_2.title,type:"heading",props:{level:2,isToggleable:!0},icon:f.Qkt},{name:e.slash_menu.toggle_heading_3.title,type:"heading",props:{level:3,isToggleable:!0},icon:f.JIf},{name:e.slash_menu.quote.title,type:"quote",icon:f.h1p},{name:e.slash_menu.toggle_list.title,type:"toggleListItem",icon:f.xU9},{name:e.slash_menu.bullet_list.title,type:"bulletListItem",icon:f.wR2},{name:e.slash_menu.numbered_list.title,type:"numberedListItem",icon:f.jPQ},{name:e.slash_menu.check_list.title,type:"checkListItem",icon:f.t6L}],ei=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>e.getSelection()?.blocks||[e.getTextCursorPosition().block]}),l=o[0],a=(0,i.useMemo)(()=>(e.items||eo(n.dictionary)).filter(e=>(0,s.g)(n,e.type,Object.fromEntries(Object.entries(e.props||{}).map(([e,t])=>[e,typeof t])))),[n,e.items]),c=(0,i.useMemo)(()=>a.map(e=>{let t=e.icon,r=e.type===l.type,i=0===Object.entries(e.props||{}).filter(([e,t])=>t!==l.props[e]).length;return{text:e.name,icon:(0,h.jsx)(t,{size:16}),onClick:()=>{n.focus(),n.transact(()=>{for(let t of o)n.updateBlock(t,{type:e.type,props:e.props})})},isSelected:r&&i}}),[n,a,l.props,l.type,o]);return(0,i.useMemo)(()=>void 0!==c.find(e=>e.isSelected),[c])&&n.isEditable?(0,h.jsx)(t.FormattingToolbar.Select,{className:"bn-select",items:c}):null},el=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.f)("comments"),{store:o}=(0,r.f)(s.m),l=(0,i.useCallback)(()=>{n.startPendingComment(),o.setState(!1)},[n,o]);return(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,h.jsx)(f.Z0O,{}),onClick:l})},es=()=>(0,r.m)().getExtension("comments")?(0,h.jsx)(el,{}):null,ea=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,i.useCallback)(()=>{n._tiptapEditor.chain().focus().addPendingComment().run()},[n]);return n._tiptapEditor.commands.addPendingComment&&n.isEditable?(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,h.jsx)(f.Z0O,{}),onClick:o}):null};function ec(e,t){try{let n=new URL(e,t);if("javascript:"!==n.protocol)return n.href}catch{}return"#"}var ed=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>{let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if((0,s.h)(n,e,n.type,{url:"string"}))return n}}),l=(0,i.useCallback)(()=>{void 0!==o&&(n.focus(),n.resolveFileUrl?n.resolveFileUrl(o.props.url).then(e=>window.open(ec(e,window.location.href))):window.open(ec(o.props.url,window.location.href)))},[o,n]);return void 0===o?null:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.file_download.tooltip[o.type]||e.formatting_toolbar.file_download.tooltip.file,mainTooltip:e.formatting_toolbar.file_download.tooltip[o.type]||e.formatting_toolbar.file_download.tooltip.file,icon:(0,h.jsx)(f.BVt,{}),onClick:l})},eu=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.o)({editor:n,selector:({editor:e})=>
17{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if((0,s.h)(n,e,n.type,{url:"string",showPreview:"boolean"}))return n}}),l=(0,i.useCallback)(()=>{void 0!==o&&(0,s.g)(n,o.type,{showPreview:"boolean"})&&n.updateBlock(o.id,{props:{showPreview:!o.props.showPreview}})},[o,n]);return void 0===o?null:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:"Toggle preview",mainTooltip:e.formatting_toolbar.file_preview_toggle.tooltip,icon:(0,h.jsx)(f.vzv,{}),isSelected:o.props.showPreview,onClick:l})},ep=()=>{let e=(0,r.s)(),t=(0,r.l)(),n=(0,r.m)(),o=(0,r.f)(a.n),l=(0,r.o)({editor:n,selector:({editor:e})=>{if(!e.isEditable||!e.settings.tables.splitCells)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(1!==t.length)return;let n=t[0];if("table"===n.type)return{mergeDirection:o.getMergeDirection(n)}}}),s=(0,i.useCallback)(()=>{o?.mergeCells()},[o]);return void 0===l?null:(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button",label:e.formatting_toolbar.table_cell_merge.tooltip,mainTooltip:e.formatting_toolbar.table_cell_merge.tooltip,icon:"horizontal"===l.mergeDirection?(0,h.jsx)(f.xoy,{}):(0,h.jsx)(f.pBE,{}),onClick:s})},eh=()=>(0,r.m)().getExtension(a.n)?(0,h.jsx)(ep,{}):null,ef={left:f.eih,center:f.svU,right:f.fzT,justify:f.J9e},em=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),l=(0,r.o)({editor:o,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block],n=t[0];return(0,s.h)(n,e,n.type,{textAlignment:s.gt.textAlignment})?{textAlignment:n.props.textAlignment,blocks:t}:1===t.length&&(0,s.h)(n,e,"table")&&e.getExtension(a.n)?.getCellSelection()?{textAlignment:(0,s.Gn)(n.content.rows[0].cells[0]).props.textAlignment,blocks:[n]}:void 0}}),c=(0,i.useCallback)(e=>{if(void 0!==l){for(let t of(o.focus(),l.blocks))if((0,s.h)(t,o,t.type,{textAlignment:s.gt.textAlignment})&&(0,s.g)(o,t.type,{textAlignment:s.gt.textAlignment}))o.updateBlock(t,{props:{textAlignment:e}});else if("table"===t.type){let n=o.getExtension(a.n)?.getCellSelection();if(!n)continue;let r=t.content.rows.map(e=>({...e,cells:e.cells.map(e=>(0,s.Gn)(e))}));n.cells.forEach(({row:t,col:n})=>{r[t].cells[n].props.textAlignment=e}),o.updateBlock(t,{type:"table",content:{...t.content,type:"tableContent",rows:r}}),o.setTextCursorPosition(t)}}},[o,l]);if(void 0===l)return null;let d=ef[e.textAlignment];return(0,h.jsx)(t.FormattingToolbar.Button,{className:"bn-button","data-test":`alignText${e.textAlignment.slice(0,1).toUpperCase()+e.textAlignment.slice(1)}`,onClick:()=>c(e.textAlignment),isSelected:l.textAlignment===e.textAlignment,label:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,mainTooltip:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,icon:(0,h.jsx)(d,{})})},eg=e=>[(0,h.jsx)(ei,{items:e},"blockTypeSelect"),(0,h.jsx)(eh,{},"tableCellMergeButton"),(0,h.jsx)(X,{},"fileCaptionButton"),(0,h.jsx)(et,{},"replaceFileButton"),(0,h.jsx)(ee,{},"fileRenameButton"),(0,h.jsx)(Q,{},"fileDeleteButton"),(0,h.jsx)(ed,{},"fileDownloadButton"),(0,h.jsx)(eu,{},"filePreviewButton"),(0,h.jsx)(V,{basicTextStyle:"bold"},"boldStyleButton"),(0,h.jsx)(V,{basicTextStyle:"italic"},"italicStyleButton"),(0,h.jsx)(V,{basicTextStyle:"underline"},"underlineStyleButton"),(0,h.jsx)(V,{basicTextStyle:"strike"},"strikeStyleButton"),(0,h.jsx)(em,{textAlignment:"left"},"textAlignLeftButton"),(0,h.jsx)(em,{textAlignment:"center"},"textAlignCenterButton"),(0,h.jsx)(em,{textAlignment:"right"},"textAlignRightButton"),(0,h.jsx)(q,{},"colorStyleButton"),(0,h.jsx)(en,{},"nestBlockButton"),(0,h.jsx)(er,{},"unnestBlockButton"),(0,h.jsx)(Z,{},"createLinkButton"),(0,h.jsx)(es,{},"addCommentButton"),(0,h.jsx)(ea,{},"addTiptapCommentButton")],eb=e=>(0,h.jsx)((0,r.l)().FormattingToolbar.Root,{className:"bn-toolbar bn-formatting-toolbar",children:e.children||eg(e.blockTypeSelectItems)}),ey=e=>{let t=(0,r.m)(),n=(0,r.f)(s.m,{editor:t}),o=(0,r.p)(s.m,{editor:t}),l=(0,r.o)({editor:t,selector:({editor:e})=>n.store.state?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=(0,r.o)({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block;return(0,s.h)(t,e,t.type,{textAlignment:s.gt.textAlignment})?(e=>{switch(e){case"left":default:return"top-start";case"center":return"top";case"right":return"top-end"}})(t.props.textAlignment):"top-start"}}),c=(0,i.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:o,onOpenChange:(e,r,o)=>
17{n.store.setState(e),"escape-key"===o&&t.focus()},placement:a,middleware:[(0,d.cY)(10),(0,d.BN)(),(0,d.UU)()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:40},...e.floatingUIOptions?.elementProps}}),[o,a,e.floatingUIOptions,n.store,t]),u=e.formattingToolbar||eb;return(0,h.jsx)(r.i,{position:l,portalElement:e.portalElement,...c,children:o&&(0,h.jsx)(u,{})})},ev=e=>{let t=(0,r.l)(),n=(0,r.s)(),{deleteLink:o}=(0,r.f)(a._);return(0,h.jsx)(t.LinkToolbar.Button,{className:"bn-button",label:n.link_toolbar.delete.tooltip,mainTooltip:n.link_toolbar.delete.tooltip,isSelected:!1,onClick:()=>{o(e.range.from),e.setToolbarOpen?.(!1)},icon:(0,h.jsx)(f.p7n,{})})},ek=e=>{let t=(0,r.l)(),n=(0,r.s)();return(0,h.jsxs)(t.Generic.Popover.Root,{onOpenChange:e.setToolbarPositionFrozen,children:[(0,h.jsx)(t.Generic.Popover.Trigger,{children:(0,h.jsx)(t.LinkToolbar.Button,{className:"bn-button",mainTooltip:n.link_toolbar.edit.tooltip,isSelected:!1,children:n.link_toolbar.edit.text})}),(0,h.jsx)(t.Generic.Popover.Content,{className:"bn-popover-content bn-form-popover",variant:"form-popover",children:(0,h.jsx)(Y,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen})})]})},ew=e=>{let t=(0,r.l)(),n=(0,r.s)();return(0,h.jsx)(t.LinkToolbar.Button,{className:"bn-button",mainTooltip:n.link_toolbar.open.tooltip,label:n.link_toolbar.open.tooltip,isSelected:!1,onClick:()=>{window.open(ec(e.url,window.location.href),"_blank")},icon:(0,h.jsx)(f.kyj,{})})},ex=e=>(0,h.jsx)((0,r.l)().LinkToolbar.Root,{className:"bn-toolbar bn-link-toolbar",children:e.children||(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ek,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen}),(0,h.jsx)(ew,{url:e.url}),(0,h.jsx)(ev,{range:e.range,setToolbarOpen:e.setToolbarOpen})]})}),eC=e=>{let t=(0,r.m)(),[n,o]=(0,i.useState)(!1),[l,s]=(0,i.useState)(!1),c=(0,r.a)(),p=(0,r.f)(a._),[f,m]=(0,i.useState)(void 0);(0,i.useEffect)(()=>{let e=()=>{let e=p.getLinkAtSelection();if(!e){m(void 0),l||o(!1);return}m({cursorType:"text",url:e.mark.attrs.href,text:e.text,range:e.range,element:p.getLinkElementAtPos(e.range.from)}),l||o(!0)},n=e=>{if(void 0!==f&&"text"===f.cursorType||!(e.target instanceof HTMLElement))return;let t=p.getLinkAtElement(e.target);t&&m({cursorType:"mouse",url:t.mark.attrs.href,text:t.text,range:t.range,element:p.getLinkElementAtPos(t.range.from)})},r=t.onChange(e),i=t.onSelectionChange(e);return c?.addEventListener("mouseover",n),()=>{r(),i(),c?.removeEventListener("mouseover",n)}},[t,c,p,f,l]);let g=(0,i.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,onOpenChange:(e,n,r)=>{l||void 0!==f&&"text"===f.cursorType&&"hover"===r||("escape-key"===r&&t.focus(),o(e))},placement:"top-start",middleware:[(0,d.cY)(10),(0,d.UU)()],...e.floatingUIOptions?.useFloatingOptions},useHoverProps:{enabled:void 0!==f&&"mouse"===f.cursorType,delay:{open:250,close:250},handleClose:(0,u.iB)(),...e.floatingUIOptions?.useHoverProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:50},...e.floatingUIOptions?.elementProps}}),[t,f,e.floatingUIOptions,n,l]),b=(0,i.useMemo)(()=>f?.element?{element:f.element}:void 0,[f?.element]);if(!t.isEditable)return null;let y=e.linkToolbar||ex;return(0,h.jsx)(r.u,{reference:b,portalElement:e.portalElement,...g,children:f&&(0,h.jsx)(y,{url:f.url,text:f.text,range:f.range,setToolbarOpen:o,setToolbarPositionFrozen:s})})},eS=()=>{let e=(0,r.l)(),t=(0,r.s)(),n=(0,r.m)(),o=(0,r.f)(s.f),l=(0,r.p)(a.o,{editor:n,selector:e=>e?.block}),c=(0,i.useCallback)(()=>{if(void 0===l)return;let e=l.content;if(void 0!==e&&Array.isArray(e)&&0===e.length)n.setTextCursorPosition(l),o.openSuggestionMenu("/");else{let e=n.insertBlocks([{type:"paragraph"}],l,"after")[0];n.setTextCursorPosition(e),o.openSuggestionMenu("/")}},[l,n,o]);return void 0===l?null:(0,h.jsx)(e.SideMenu.Button,{className:"bn-button",label:t.side_menu.add_block_label,icon:(0,h.jsx)(m.tNe,{size:24,onClick:c,"data-test":"dragHandleAdd"})})},eE=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.p)(a.o,{editor:n,selector:e=>e?.block});return void 0!==o&&((0,s.h)(o,n,o.type,{textColor:"string"})||(0,s.h)(o,n,o.type,{backgroundColor:"string"}))?(0,h.jsxs)(t.Generic.Menu.Root,{position:"right",sub:!0,children:[(0,h.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",subTrigger:!0,children:e.children})}),(0,h.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:"bn-menu-dropdown bn-color-picker-dropdown",children:(0,h.jsx)(J,{iconSize:18,text:(0,s.h)(o,n,o.type,{textColor:"string"})&&(0,s.g)(n,o.type,{textColor:"string"})?{color:o.props.textColor,setColor:e=>n.updateBlock(o,{type:o.type,props:{textColor:e}})}:void 0,background:(0,s.h)(o,n,o.type,{backgroundColor:"string"})&&(0,s.g)(n,o.type,{backgroundColor:"string"})?{color:o.props.backgroundColor,setColor:e=>n.updateBlock(o,{props:{backgroundColor:e}})}:void 0})})]}):null},eM=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.p)(a.o,{editor:n,selector:e=>e?.block});return void 0===o?null:(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",onClick:()=>{let e=n.getSelection()?.blocks,t=e&&e.some(e=>e.id===o.id)?e:[o];n.removeBlocks(t)},children:e.children})},eT=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.p)(a.o,{editor:n,selector:e=>e?.block});if(void 0===o||"table"!==o.type||!n.settings.tables.headers)return null;let i=!!o.content.headerRows;return(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",checked:i,onClick:()=>{n.updateBlock(o,{content:{...o.content,headerRows:i?void 0:1}})},children:e.children})},eA=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.p)(a.o,{editor:n,selector:e=>e?.block});if(void 0===o||"table"!==o.type||!n.settings.tables.headers)return null;let i=!!o.content.headerCols;return(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",checked:i,onClick:()=>{n.updateBlock(o,{content:{...o.content,headerCols:i?void 0:1}})},children:e.children})},eI=e=>{let t=(0,r.l)(),n=(0,r.s)();return(0,h.jsx)(t.Generic.Menu.Dropdown,{className:"bn-menu-dropdown bn-drag-handle-menu",children:e.children||(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eM,{children:n.drag_handle.delete_menuitem}),(0,h.jsx)(eE,{children:n.drag_handle.colors_menuitem}),(0,h.jsx)(eT,{children:n.drag_handle.header_row_menuitem}),(0,h.jsx)(eA,{children:n.drag_handle.header_column_menuitem})]})})},eN=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.f)(a.o),i=(0,r.p)(a.o,{selector:e=>e?.block});if(void 0===i)return null;let l=e.dragHandleMenu||eI;return(0,h.jsxs)(t.Generic.Menu.Root,{onOpenChange:e=>{e?o.freezeMenu():o.unfreezeMenu()},position:"left",children:[(0,h.jsx)(t.Generic.Menu.Trigger,{children:(0,h.jsx)(t.SideMenu.Button,{label:n.side_menu.drag_handle_label,draggable:!0,onDragStart:e=>o.blockDragStart(e,i),onDragEnd:o.blockDragEnd,className:"bn-button",icon:(0,h.jsx)(g.LUV,{size:24,"data-test":"dragHandle"})})}),(0,h.jsx)(l,{children:e.children})]})},ej=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.p)(a.o,{editor:n,selector:e=>e?.block}),l=(0,i.useMemo)(()=>
17{if(void 0===o)return{};let e={"data-block-type":o.type};return"heading"===o.type&&(e["data-level"]=o.props.level.toString()),n.schema.blockSpecs[o.type].implementation.meta?.fileBlockAccept&&(o.props.url?e["data-url"]="true":e["data-url"]="false"),e},[o,n.schema.blockSpecs]);return(0,h.jsx)(t.SideMenu.Root,{className:"bn-side-menu",...l,children:e.children||(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eS,{}),(0,h.jsx)(eN,{dragHandleMenu:e.dragHandleMenu})]})})},eP=e=>{let t=(0,r.m)(),{show:n,block:o}=(0,r.p)(a.o,{selector:e=>void 0===e?void 0:{show:e.show,block:e.block}})||{},l=(0,i.useCallback)((e,n,r)=>{let o=!1;return(0,p.ll)(e,n,()=>{if(!o){o=!0;return}t.getExtension(a.o)?.hideMenuIfNotFrozen()},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1})},[t]),s=(0,i.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,placement:"left-start",whileElementsMounted:l,...e.floatingUIOptions?.useFloatingOptions},useDismissProps:{enabled:!1,...e.floatingUIOptions?.useDismissProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:20},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,n,l]),c=e.sideMenu||ej;return(0,h.jsx)(L,{blockId:n?o?.id:void 0,portalElement:e.portalElement,...s,children:o?.id&&(0,h.jsx)(c,{})})};async function e_(e,t){return(await (0,a.a)(e,t)).map(({id:e,onItemClick:t})=>({id:e,onItemClick:t,icon:e}))}function eB(e){let t=(0,r.l)(),n=(0,r.s)(),{items:o,loadingState:l,selectedIndex:s,onItemClick:a,columns:c}=e,d="loading-initial"===l||"loading"===l?(0,h.jsx)(t.GridSuggestionMenu.Loader,{className:"bn-grid-suggestion-menu-loader",columns:c}):null,u=(0,i.useMemo)(()=>{let e=[];for(let n=0;n<o.length;n++){let r=o[n];e.push((0,h.jsx)(t.GridSuggestionMenu.Item,{className:"bn-grid-suggestion-menu-item",item:r,id:`bn-grid-suggestion-menu-item-${n}`,isSelected:n===s,onClick:()=>a?.(r)},r.id))}return e},[t,o,a,s]);return(0,h.jsxs)(t.GridSuggestionMenu.Root,{id:"bn-grid-suggestion-menu",columns:c,className:"bn-grid-suggestion-menu",children:[d,u,0===u.length&&"loaded"===e.loadingState&&(0,h.jsx)(t.GridSuggestionMenu.EmptyItem,{className:"bn-grid-suggestion-menu-empty-item",columns:c,children:n.suggestion_menu.no_items_title})]})}function eO(e,t,n,r=3){let o=(0,i.useRef)(0);(0,i.useEffect)(()=>{void 0!==t&&(e.length>0?o.current=t.length:t.length-o.current>r&&n())},[n,r,e.length,t])}function eR(e,t){let[n,r]=(0,i.useState)([]),[o,l]=(0,i.useState)(!1),s=(0,i.useRef)(void 0),a=(0,i.useRef)(void 0);return(0,i.useEffect)(()=>{s.current=e,l(!0),t(e).then(t=>{s.current===e&&(r(t),l(!1),a.current=e)})},[e,t]),{items:n||[],usedQuery:a.current,loadingState:void 0===a.current?"loading-initial":o?"loading":"loaded"}}function eL(e){let t=(0,r.g)().setContentEditableProps,n=(0,r.m)(),{getItems:o,gridSuggestionMenuComponent:l,query:s,clearQuery:a,closeMenu:c,onItemClick:d,columns:u}=e,p=(0,i.useCallback)(e=>{c(),a(),d?.(e)},[d,c,a]),{items:f,usedQuery:m,loadingState:g}=eR(s,o);eO(f,m,c);let{selectedIndex:b}=function(e,t,n,o,l){let s=(0,r.a)(e),[a,c]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let e=e=>("ArrowLeft"===e.key&&(e.preventDefault(),n.length&&c((a-1+n.length)%n.length)),"ArrowRight"===e.key&&(e.preventDefault(),n.length&&c((a+1+n.length)%n.length)),"ArrowUp"===e.key?(e.preventDefault(),n.length&&c((a-o+n.length)%n.length),!0):"ArrowDown"===e.key?(e.preventDefault(),n.length&&c((a+o)%n.length),!0):"Enter"===e.key&&!e.isComposing&&(e.stopPropagation(),e.preventDefault(),n.length&&l?.(n[a]),!0));return s?.addEventListener("keydown",e,!0),()=>{s?.removeEventListener("keydown",e,!0)}},[s,n,a,l,o,void 0!==o&&o>1]),(0,i.useEffect)(()=>{c(0)},[t]),{selectedIndex:0===n.length?void 0:a}}(n,s,f,u,p);return(0,i.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":"bn-suggestion-menu"})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,i.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":b?"bn-suggestion-menu-item-"+b:void 0})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,b]),(0,h.jsx)(l,{items:f,onItemClick:p,loadingState:g,selectedIndex:b,columns:u})}function eD(e){let t=(0,r.m)(),n=(0,r.a)(),{triggerCharacter:o,gridSuggestionMenuComponent:l,columns:a,shouldOpen:c,minQueryLength:u,onItemClick:p,getItems:f}=e,m=(0,i.useMemo)(()=>p||(e=>{e.onItemClick(t)}
17),[t,p]),g=(0,i.useMemo)(()=>f||(async e=>await e_(t,e)),[t,f]),b=(0,r.f)(s.f);(0,i.useEffect)(()=>{b.addSuggestionMenu({triggerCharacter:o,shouldOpen:c})},[b,o,c]);let y=(0,r.p)(s.f),v=(0,r.p)(s.f,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),k=(0,i.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:y?.show&&y?.triggerCharacter===o,onOpenChange:e=>{e||b.closeMenu()},placement:"bottom-start",middleware:[(0,d.cY)(10),(0,d.RK)({allowedPlacements:["bottom-start","top-start"],padding:10}),(0,d.BN)(),(0,d.Ej)({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,t)}px`},padding:10})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:70},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,y?.show,y?.triggerCharacter,b,o]);return!y||!y.ignoreQueryLength&&u&&(y.query.startsWith(" ")||y.query.length<u)?null:(0,h.jsx)(r.u,{reference:v,portalElement:e.portalElement,...k,children:o&&(0,h.jsx)(eL,{query:y.query,closeMenu:b.closeMenu,clearQuery:b.clearQuery,getItems:g,columns:a,gridSuggestionMenuComponent:l||eB,onItemClick:m})})}function e$(e){let t=(0,r.l)(),n=(0,r.s)(),{items:o,loadingState:l,selectedIndex:a,onItemClick:c}=e,d="loading-initial"===l||"loading"===l?(0,h.jsx)(t.SuggestionMenu.Loader,{className:"bn-suggestion-menu-loader"}):null,u=(0,i.useMemo)(()=>{let e,n=[];for(let r=0;r<o.length;r++){let i=o[r];i.group!==e&&(e=i.group,n.push((0,h.jsx)(t.SuggestionMenu.Label,{className:"bn-suggestion-menu-label",children:e},e))),n.push((0,h.jsx)(t.SuggestionMenu.Item,{className:(0,s.Rn)("bn-suggestion-menu-item","small"===i.size?"bn-suggestion-menu-item-small":""),item:i,id:`bn-suggestion-menu-item-${r}`,isSelected:r===a,onClick:()=>c?.(i)},i.title))}return n},[t,o,c,a]);return(0,h.jsxs)(t.SuggestionMenu.Root,{id:"bn-suggestion-menu",className:"bn-suggestion-menu",children:[u,0===u.length&&("loading"===e.loadingState||"loaded"===e.loadingState)&&(0,h.jsx)(t.SuggestionMenu.EmptyItem,{className:"bn-suggestion-menu-item",children:n.suggestion_menu.no_items_title}),d]})}function eF(e){let t=(0,r.g)().setContentEditableProps,{getItems:n,suggestionMenuComponent:o,query:l,clearQuery:s,closeMenu:a,onItemClick:c}=((0,r.m)(),e),d=(0,i.useCallback)(e=>{a(),s(),c?.(e)},[c,a,s]),{items:u,usedQuery:p,loadingState:f}=eR(l,n);eO(u,p,a);let{selectedIndex:m}=function(e,t,n){let o=(0,r.a)(),{selectedIndex:l,setSelectedIndex:s,handler:a}=function(e,t){let[n,r]=(0,i.useState)(0);return{selectedIndex:n,setSelectedIndex:r,handler:o=>{if("ArrowUp"===o.key)return o.preventDefault(),e.length&&r((n-1+e.length)%e.length),!0;if("ArrowDown"===o.key)return o.preventDefault(),e.length&&r((n+1)%e.length),!0;if("PageUp"===o.key)return o.preventDefault(),e.length&&r(0),!0;if("PageDown"===o.key)return o.preventDefault(),e.length&&r(e.length-1),!0;let i=void 0!==o.nativeEvent?o.nativeEvent.isComposing:o.isComposing;return"Enter"===o.key&&!i&&(o.preventDefault(),o.stopPropagation(),e.length&&t?.(e[n]),!0)}}}(t,n);return(0,i.useEffect)(()=>(o?.addEventListener("keydown",a,!0),()=>{o?.removeEventListener("keydown",a,!0)}),[o,t,l,n,void 0,a]),(0,i.useEffect)(()=>{s(0)},[e,s]),{selectedIndex:0===t.length?void 0:l}}(l,u,d);return(0,i.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":"bn-suggestion-menu"})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,i.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":m?"bn-suggestion-menu-item-"+m:void 0})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,m]),(0,h.jsx)(o,{items:u,onItemClick:d,loadingState:f,selectedIndex:m})}var ez={heading:f.vmM,heading_2:f.Qkt,heading_3:f.JIf,heading_4:f.QzB,heading_5:f.JXn,heading_6:f.Qep,toggle_heading:f.vmM,toggle_heading_2:f.Qkt,toggle_heading_3:f.JIf,quote:f.h1p,toggle_list:f.xU9,numbered_list:f.jPQ,bullet_list:f.wR2,check_list:f.t6L,paragraph:f.NtT,table:f.Iuy,image:f.cVZ,video:f.K_G,audio:f.M0i,file:f.KFs,emoji:f.kpC,code_block:f.YqU,divider:f.oev};function eH(e){return(0,s.u)(e).map(e=>{let t=ez[e.key];return{...e,icon:(0,h.jsx)(t,{size:18})}})}function eV(e){let t=(0,r.m)(),n=(0,r.a)(),{triggerCharacter:o,suggestionMenuComponent:l,shouldOpen:a,minQueryLength:c,onItemClick:u,getItems:p}=e,f=(0,i.useMemo)(()=>u||(e=>{e.onItemClick(t)}),[t,u]),m=(0,i.useMemo)(()=>p||(async e=>(0,s.l)(eH(t),e)),[t,p]),g=(0,r.f)(s.f);(0,i.useEffect)(()=>{g.addSuggestionMenu({triggerCharacter:o,shouldOpen:a})},[g,o,a]);let b=(0,r.p)(s.f),y=(0,r.p)(s.f,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),v=(0,i.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:b?.show&&b?.triggerCharacter===o,onOpenChange:e=>{e||g.closeMenu()},placement:"bottom-start",middleware:[(0,d.cY)(10),(0,d.RK)({allowedPlacements:["bottom-start","to
17p-start"],padding:10}),(0,d.BN)(),(0,d.Ej)({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,t)}px`},padding:10})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:80},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,b?.show,b?.triggerCharacter,g,o]);return!b||!b.ignoreQueryLength&&c&&(b.query.startsWith(" ")||b.query.length<c)?null:(0,h.jsx)(r.u,{reference:y,portalElement:e.portalElement,...v,children:o&&(0,h.jsx)(eF,{query:b.query,closeMenu:g.closeMenu,clearQuery:g.clearQuery,getItems:m,suggestionMenuComponent:l||e$,onItemClick:f})})}var eU=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.f)(a.n),l=(0,r.p)(a.n,{selector:e=>e?.block}),c=(0,i.useRef)(!1),[d,u]=(0,i.useState)(),p=(0,i.useCallback)(t=>{o.freezeHandles(),e.hideOtherElements(!0),l&&(u({originalContent:l.content,originalCroppedContent:{rows:o.cropEmptyRowsOrColumns(l,"addOrRemoveColumns"===e.orientation?"columns":"rows")},startPos:"addOrRemoveColumns"===e.orientation?t.clientX:t.clientY}),c.current=!1,t.preventDefault())},[l,e,o]),m=(0,i.useCallback)(()=>{!l||c.current||n.updateBlock(l,{type:"table",content:{...l.content,rows:"addOrRemoveColumns"===e.orientation?o.addRowsOrColumns(l,"columns",1):o.addRowsOrColumns(l,"rows",1)}})},[l,n,e.orientation,o]);return(0,i.useEffect)(()=>{let t=t=>{if(!l)return;if(!d)throw Error("editingState is undefined");c.current=!0;let r=("addOrRemoveColumns"===e.orientation?t.clientX:t.clientY)-d.startPos,i="addOrRemoveColumns"===e.orientation?d.originalCroppedContent.rows[0]?.cells.length??0:d.originalCroppedContent.rows.length,a="addOrRemoveColumns"===e.orientation?d.originalContent.rows[0]?.cells.length??0:d.originalContent.rows.length,u="addOrRemoveColumns"===e.orientation?l.content.rows[0].cells.length:l.content.rows.length,p=a+((e,t=.3)=>{let n=Math.floor(e)+t,r=Math.ceil(e)-t;return e>=n&&e<=r?Math.round(e):e<n?Math.floor(e):Math.ceil(e)})(r/("addOrRemoveColumns"===e.orientation?s.E:s.T),.3);p>=i&&p>0&&p!==u&&(n.updateBlock(l,{type:"table",content:{...l.content,rows:"addOrRemoveColumns"===e.orientation?o.addRowsOrColumns({type:"table",content:d.originalCroppedContent},"columns",p-i):o.addRowsOrColumns({type:"table",content:d.originalCroppedContent},"rows",p-i)}}),l.content&&n.setTextCursorPosition(l))};return d&&window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[l,d,n,e.orientation,o]),(0,i.useEffect)(()=>{let t=()=>{e.hideOtherElements(!1),o.unfreezeHandles(),u(void 0)};return d&&window.addEventListener("mouseup",t),()=>{window.removeEventListener("mouseup",t)}},[d,e,o]),n.isEditable?(0,h.jsx)(t.TableHandle.ExtendButton,{className:(0,s.Rn)("bn-extend-button","addOrRemoveColumns"===e.orientation?"bn-extend-button-add-remove-columns":"bn-extend-button-add-remove-rows",null===d?"":"bn-extend-button-editing"),onClick:m,onMouseDown:p,children:e.children||(0,h.jsx)(f.G7L,{size:18,"data-test":"extendButton"})}):null},eW=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),{block:i,colIndex:l,rowIndex:c}=(0,r.p)(a.n,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})}),d=(e,t)=>{if(void 0===i||void 0===l||void 0===c)return;let n=i.content.rows.map(e=>({...e,cells:e.cells.map(e=>(0,s.Gn)(e))}));"text"===t?n[c].cells[l].props.textColor=e:n[c].cells[l].props.backgroundColor=e,o.updateBlock(i,{type:"table",content:{...i.content,rows:n}}),o.setTextCursorPosition(i)};if(void 0===i||void 0===l||void 0===c)return null;let u=i.content.rows[c]?.cells?.[l];return u&&(!1!==o.settings.tables.cellTextColor||!1!==o.settings.tables.cellBackgroun
17dColor)?(0,h.jsxs)(t.Generic.Menu.Root,{position:"right",sub:!0,children:[(0,h.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",subTrigger:!0,children:e.children||n.drag_handle.colors_menuitem})}),(0,h.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:"bn-menu-dropdown bn-color-picker-dropdown",children:(0,h.jsx)(J,{iconSize:18,text:o.settings.tables.cellTextColor?{color:(0,s.Wn)(u)?u.props.textColor:"default",setColor:e=>d(e,"text")}:void 0,background:o.settings.tables.cellBackgroundColor?{color:(0,s.Wn)(u)?u.props.backgroundColor:"default",setColor:e=>d(e,"background")}:void 0})})]}):null},eJ=()=>{let e=(0,r.l)(),t=(0,r.s)(),n=(0,r.m)(),o=(0,r.f)(a.n),{block:i,colIndex:l,rowIndex:c}=(0,r.p)(a.n,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})});if(void 0===i||void 0===l||void 0===c)return null;let d=i.content.rows[c]?.cells?.[l];return d&&(0,s.Wn)(d)&&(1!==(0,s.Hn)(d)||1!==(0,s.Vn)(d))&&n.settings.tables.splitCells?(0,h.jsx)(e.Generic.Menu.Item,{onClick:()=>{o.splitCell({row:c,col:l})},children:t.table_handle.split_cell_menuitem}):null},eG=e=>(0,h.jsx)((0,r.l)().Generic.Menu.Dropdown,{className:"bn-menu-dropdown bn-table-handle-menu",children:e.children||(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eJ,{}),(0,h.jsx)(eW,{})]})}),eq=e=>{let t=(0,r.l)(),n=(0,r.m)(),o=(0,r.f)(a.n),i=e.tableCellMenu||eG;return n.settings.tables.splitCells||n.settings.tables.cellBackgroun
17dColor||n.settings.tables.cellTextColor?(0,h.jsxs)(t.Generic.Menu.Root,{onOpenChange:t=>{t?(o.freezeHandles(),e.hideOtherElements(!0)):(o.unfreezeHandles(),e.hideOtherElements(!1),n.focus())},position:"right",children:[(0,h.jsx)(t.Generic.Menu.Trigger,{children:(0,h.jsx)(t.Generic.Menu.Button,{className:"bn-table-cell-handle",children:e.children||(0,h.jsx)(g.q0c,{size:12,"data-test":"tableCellHandle"})})}),(0,h.jsx)(i,{})]}):null},eK=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.f)(a.n),i=(0,r.p)(a.n,{selector:t=>"column"===e.orientation?t?.colIndex:t?.rowIndex});return void 0===o||void 0===i?null:(0,h.jsx)(t.Generic.Menu.Item,{onClick:()=>{o.addRowOrColumn(i,"row"===e.orientation?{orientation:"row",side:e.side}:{orientation:"column",side:e.side})},children:n.table_handle[`add_${e.side}_menuitem`]})},eY=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.f)(a.n),i=(0,r.p)(a.n,{selector:t=>"column"===e.orientation?t?.colIndex:t?.rowIndex});return void 0===o||void 0===i?null:(0,h.jsx)(t.Generic.Menu.Item,{onClick:()=>o.removeRowOrColumn(i,e.orientation),children:"row"===e.orientation?n.table_handle.delete_row_menuitem:n.table_handle.delete_column_menuitem})},eZ=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),l=(0,r.f)(a.n),{block:c,index:d}=(0,r.p)(a.n,{selector:t=>({block:t?.block,index:"column"===e.orientation?t?.colIndex:t?.rowIndex})}),u=(0,i.useMemo)(()=>void 0===l||void 0===c||void 0===d?[]:"row"===e.orientation?l.getCellsAtRowHandle(c,d):l.getCellsAtColumnHandle(c,d),[c,d,e.orientation,l]),p=(e,t)=>{if(void 0===c)return;let n=c.content.rows.map(e=>({...e,cells:e.cells.map(e=>(0,s.Gn)(e))}));u.forEach(({row:r,col:o})=>{"text"===t?n[r].cells[o].props.textColor=e:n[r].cells[o].props.backgroundColor=e}),o.updateBlock(c,{type:"table",content:{...c.content,rows:n}}),o.setTextCursorPosition(c)};if(!u||!u[0]||!l||!1===o.settings.tables.cellTextColor&&!1===o.settings.tables.cellBackgroun
17dColor)return null;let f=(0,s.Gn)(u[0].cell);return(0,h.jsxs)(t.Generic.Menu.Root,{position:"right",sub:!0,children:[(0,h.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",subTrigger:!0,children:e.children||n.drag_handle.colors_menuitem})}),(0,h.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:"bn-menu-dropdown bn-color-picker-dropdown",children:(0,h.jsx)(J,{iconSize:18,text:o.settings.tables.cellTextColor?{color:u.every(({cell:e})=>(0,s.Wn)(e)&&e.props.textColor===f.props.textColor)?f.props.textColor:"default",setColor:e=>{p(e,"text")}}:void 0,background:o.settings.tables.cellBackgroundColor?{color:u.every(({cell:e})=>(0,s.Wn)(e)&&e.props.backgroundColor===f.props.backgroundColor)?f.props.backgroundColor:"default",setColor:e=>p(e,"background")}:void 0})})]})},eX=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),i=(0,r.f)(a.n),{block:l,index:s}=(0,r.p)(a.n,{selector:t=>({block:t?.block,index:"column"===e.orientation?t?.colIndex:t?.rowIndex})});if(void 0===i||void 0===l||0!==s||"row"!==e.orientation||!o.settings.tables.headers)return null;let c=!!l.content.headerRows;return(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",checked:c,onClick:()=>{o.updateBlock(l,{...l,content:{...l.content,headerRows:c?void 0:1}})},children:n.drag_handle.header_row_menuitem})},eQ=e=>{let t=(0,r.l)(),n=(0,r.s)(),o=(0,r.m)(),i=(0,r.f)(a.n),l=(0,r.p)(a.n,{selector:e=>e?.block}),s=(0,r.p)(a.n,{selector:t=>"column"===e.orientation?t?.colIndex:t?.rowIndex});if(!i||0!==s||!l||"column"!==e.orientation||!o.settings.tables.headers)return null;let c=!!l.content.headerCols;return(0,h.jsx)(t.Generic.Menu.Item,{className:"bn-menu-item",checked:c,onClick:()=>{o.updateBlock(l,{...l,content:{...l.content,headerCols:c?void 0:1}})},children:n.drag_handle.header_column_menuitem})},e0=e=>(0,h.jsx)((0,r.l)().Generic.Menu.Dropdown,{className:"bn-table-handle-menu",children:e.children||(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eY,{orientation:e.orientation}),(0,h.jsx)(eK,{orientation:e.orientation,side:"row"===e.orientation?"above":"left"}),(0,h.jsx)(eK,{orientation:e.orientation,side:"row"===e.orientation?"below":"right"}),(0,h.jsx)(eX,{orientation:e.orientation}),(0,h.jsx)(eQ,{orientation:e.orientation}),(0,h.jsx)(eZ,{orientation:e.orientation})]})}),e1=e=>{let t=(0,r.m)(),n=(0,r.l)(),[o,l]=(0,i.useState)(!1),c=e.tableHandleMenu||e0,d=(0,r.f)(a.n),u=(0,r.p)(a.n),p=(0,i.useMemo)(()=>!!d&&!!u&&!!u.block&&"table"===u.block.type&&("column"===e.orientation?d.getCellsAtColumnHandle(u.block,u.colIndex).every(({cell:e})=>1===(0,s.Vn)(e)):d.getCellsAtRowHandle(u.block,u.rowIndex).every(({cell:e})=>1===(0,s.Hn)(e))),[e.orientation,u,d]);return u?(0,h.jsxs)(n.Generic.Menu.Root,{onOpenChange:n=>{n?(d.freezeHandles(),e.hideOtherElements(!0)):(d.unfreezeHandles(),e.hideOtherElements(!1),t.focus())},position:"right",children:[(0,h.jsx)(n.Generic.Menu.Trigger,{children:(0,h.jsx)(n.TableHandle.Root,{className:(0,s.Rn)("bn-table-handle",o?"bn-table-handle-dragging":"",p?"":"bn-table-handle-not-draggable"),draggable:p,onDragStart:t=>{l(!0),e.hideOtherElements(!0),"column"===e.orientation?d.colDragStart(t):d.rowDragStart(t)},onDragEnd:()=>{d.dragEnd(),e.hideOtherElements(!1),l(!1)},style:"column"===e.orientation?{transform:"rotate(0.25turn)"}:void 0,children:e.children||(0,h.jsx)(g.LUV,{size:24,"data-test":"tableHandle"})})}),(0,h.jsx)(c,{orientation:e.orientation})]}):null},e2=e=>{let t=(0,r.m)(),[n,o]=(0,i.useState)(),l=(0,r.p)(a.n),c=(0,i.useMemo)(()=>{let e={};if(void 0===l)return{};let n=(0,s.Dt)(l.block.id,t.prosemirrorState.doc);if(!n)return{};let r=n.posBeforeNode+1,o=t.prosemirrorView.domAtPos(r+1).node;if(!(o instanceof Element))return{};if(e.tableReference={element:o},void 0===l.rowIndex||void 0===l.colIndex)return e;let i=t.prosemirrorState.doc.resolve(r+1).posAtIndex(l.rowIndex),a=t.prosemirrorState.doc.resolve(i+1).posAtIndex(l.colIndex),c=t.prosemirrorView.domAtPos(a+1).node;return c instanceof Element?(e.cellReference={element:c},e.rowReference={element:o,getBoundingClientRect:()=>{let e=o.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(e.x,l.draggingState&&"row"===l.draggingState.draggedCellOrientation?l.draggingState.mousePos-t.height/2:t.y,e.width,t.height)}},e.columnReference={element:o,getBoundingClientRect:()=>{let e=o.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(l.draggingState&&"col"===l.draggingState.draggedCellOrientation?l.draggingState.mousePos-t.width/2:t.x,e.y,t.width,e.height)}},e):{}},[t,l]),u=(0,i.useCallback)((e,n,r)=>{let o=!1;return(0,p.ll)(e,n,()=>{if(!o){o=!0;return}t.getExtension(a.n)?.hideHandlesIfNotFrozen()},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1})},[t]),f=(0,i.useMemo)(()=>void 0===l?void 0:{rowTableHandle:{useFloatingOptions:{open:l.show&&void 0!==l.rowIndex&&(!n||"rowTableHandle"===n),placement:"left",middleware:[(0,d.cY)(-10)],whileElementsMounted:u},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},columnTableHandle:{useFloatingOptions:{open:l.show&&void 0!==l.colIndex&&(!n||"columnTableHandle"===n),placement:"top",middleware:[(0,d.cY)(-12)],whileElementsMounted:u},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},tableCellHandle:{useFloatingOptions:{open:l.show&&void 0!==l.rowIndex&&void 0!==l.colIndex&&(!n||"tableCellHandle"===n),placement:"top-end",middleware:[(0,d.cY)({mainAxis:-15,crossAxis:-1})],whileElementsMounted:u},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendRowsButton:{useFloatingOptions:{open:l.show&&l.showAddOrRemoveRowsButton&&(!n||"extendRowsButton"===n),placement:"bottom",whileElementsMounted:u,middleware:[(0,d.Ej)({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendColumnsButton:{useFloatingOptions:{open:l.show&&l.showAddOrRemoveColumnsButton&&(!n||"extendColumnsButton"===n),placement:"right",whileElementsMounted:u,middleware:[(0,d.Ej)({apply({rects:e,elements:t}){Object.assign(t.floating.style,{height:`${e.reference.height}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}}},[n,l,u]);if(!l)return null;let m=e.tableHandle||e1,g=e.extendButton||eU,b=e.tableCellHandle||eq;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(r.u,{reference:c?.rowReference,portalElement:e.portalElement,...f?.rowTableHandle,children:l.show&&void 0!==l.rowIndex&&(!n||"rowTableHandle"===n)&&(0,h.jsx)(m,{orientation:"row",hideOtherElements:e=>o(e?"rowTableHandle":void 0)})}),(0,h.jsx)(r.u,{reference:c?.columnReference,portalElement:e.portalElement,...f?.columnTableHandle,children:l.show&&void 0!==l.colIndex&&(!n||"columnTableHandle"===n)&&(0,h.jsx)(m,{orientation:"column",hideOtherElements:e=>o(e?"columnTableHandle":void 0)})}),(0,h.jsx)(r.u,{reference:c?.cellReference,portalElement:e.portalElement,...f?.tableCellHandle,children:l.show&&void 0!==l.rowIndex&&void 0!==l.colIndex&&(!n||"tableCellHandle"===n)&&(0,h.jsx)(b,{hideOtherElements:e=>o(e?"tableCellHandle":void 0)})}),(0,h.jsx)(r.u,{reference:c?.tableReference,portalElement:e.portalElement,...f?.extendRowsButton,children:l.show&&l.showAddOrRemoveRowsButton&&(!n||"extendRowsButton"===n)&&(0,h.jsx)(g,{orientation:"addOrRemoveRows",hideOtherElements:e=>o(e?"extendRowsButton":void 0)})}),(0,h.jsx)(r.u,{reference:c?.tableReference,portalElement:e.portalElement,...f?.extendColumnsButton,children:l.show&&l.showAddOrRemoveColumnsButton&&(!n||"extendColumnsButton"===n)&&(0,h.jsx)(g,{orientation:"addOrRemoveColumns",hideOtherElements:e=>o(e?"extendColumnsButton":void 0)})})]})};function e5(e){if(void 0!==e){if(null===e)return"u">typeof document?document.body:void 0;if("string"==typeof e){if(typeof document>"u")return;let t=document.querySelector(e);return t||void console.warn(`[BlockNote] portalElements selector "${e}
17" did not match any element`)}return e}}var e3=(0,i.lazy)(()=>n.e(4110).then(n.bind(n,44110)).then(e=>e.n)),e4=(0,i.lazy)(()=>Promise.resolve().then(n.bind(n,76291)).then(e=>e.n));function e9(e){let t=(0,r.m)();if(!t)throw Error("BlockNoteDefaultUI must be used within a BlockNoteContext.Provider");let n=e.portalElements,o=e5(n?.formattingToolbar),c=e5(n?.linkToolbar),d=e5(n?.slashMenu),u=e5(n?.emojiPicker),p=e5(n?.sideMenu),f=e5(n?.filePanel),m=e5(n?.tableHandles),g=e5(n?.comments);return(0,h.jsxs)(h.Fragment,{children:[t.getExtension(s.m)&&!1!==e.formattingToolbar&&(0,h.jsx)(ey,{portalElement:o}),t.getExtension(a._)&&!1!==e.linkToolbar&&(0,h.jsx)(eC,{portalElement:c}),t.getExtension(s.f)&&!1!==e.slashMenu&&(0,h.jsx)(eV,{triggerCharacter:"/",shouldOpen:e=>!e.selection.$from.parent.type.isInGroup("tableContent"),portalElement:d}),t.getExtension(s.f)&&!1!==e.emojiPicker&&(0,h.jsx)(eD,{triggerCharacter:":",columns:10,minQueryLength:2,portalElement:u}),t.getExtension(a.o)&&!1!==e.sideMenu&&(0,h.jsx)(eP,{portalElement:p}),t.getExtension(s.mt)&&!1!==e.filePanel&&(0,h.jsx)(z,{portalElement:f}),t.getExtension(a.n)&&!1!==e.tableHandles&&(0,h.jsx)(e2,{portalElement:m}),t.getExtension(l.KI)&&!1!==e.comments&&(0,h.jsxs)(i.Suspense,{children:[(0,h.jsx)(e3,{portalElement:g}),(0,h.jsx)(e4,{portalElement:g})]})]})}var e6=()=>{let e=(0,i.useMemo)(()=>window.matchMedia?.("(prefers-color-scheme: dark)"),[]),t=(0,i.useMemo)(()=>window.matchMedia?.("(prefers-color-scheme: light)"),[]),n=e?.matches,r=t?.matches,[o,l]=(0,i.useState)(n?"dark":r?"light":"no-preference");return(0,i.useEffect)(()=>
17{l(n?"dark":r?"light":"no-preference")},[n,r]),(0,i.useEffect)(()=>{if("function"==typeof e?.addEventListener){let n=({matches:e})=>e&&l("dark"),r=({matches:e})=>e&&l("light");return e?.addEventListener("change",n),t?.addEventListener("change",r),()=>{e?.removeEventListener("change",n),t?.removeEventListener("change",r)}}{let n=()=>l(e.matches?"dark":t.matches?"light":"no-preference");return e?.addEventListener("change",n),t?.addEventListener("change",n),()=>{e?.removeEventListener("change",n),t?.removeEventListener("change",n)}}},[e,t]),window.matchMedia,o},e7=(0,i.createContext)(void 0),e8=({contentComponent:e})=>{let t=(0,i.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,h.jsx)(h.Fragment,{children:Object.values(t)})},te=(0,i.forwardRef)((e,t)=>{let[n,r]=(0,i.useState)();return(0,i.useImperativeHandle)(t,()=>(e,t)=>{(0,b.flushSync)(()=>{r({node:e,container:t})}),r(void 0)},[]),(0,h.jsx)(h.Fragment,{children:n&&(0,b.createPortal)(n.node,n.container)})}),tt=()=>{},tn=i.forwardRef(({className:e,renderEditor:t,editorColorScheme:n,children:r,...o},i)=>(0,h.jsx)("div",{className:(0,s.Rn)("bn-root","bn-container",n,e),"data-color-scheme":n,...o,ref:i,children:t?(0,h.jsx)(to,{children:r}):r})),tr=i.forwardRef(function(e,t){var n,o,l,a;let c,d,{editor:u,className:p,theme:f,children:m,editable:g,onSelectionChange:b,onChange:y,formattingToolbar:v,linkToolbar:k,slashMenu:w,emojiPicker:x,sideMenu:C,filePanel:S,tableHandles:E,comments:M,portalElements:T,autoFocus:A,renderEditor:I=!0,...N}=e,j=(0,i.useMemo)(()=>e5(T?.default)??null,[T?.default]),[P,_]=(0,i.useState)(),B=(0,r.g)(),O=e6(),R=B?.colorSchemePreference||O,L=f||("dark"===R?"dark":"light"),D=(0,r.l)(),$=(0,i.useMemo)(()=>({formattingToolbar:!!D&&v,linkToolbar:!!D&&k,sideMenu:!!D&&C,slashMenu:!!D&&w,filePanel:!!D&&S,tableHandles:!!D&&E,emojiPicker:!!D&&x,comments:!!D&&M,portalElements:T}),[M,D,x,S,v,k,C,w,E,T]);n=y||tt,o=u,c=(0,r.g)(),o||=c?.editor,(0,i.useEffect)(()=>{if(!o)throw Error("'editor' is required, either from BlockNoteContext or as a function argument");return o.onChange(n)},[n,o]),l=b||tt,a=u,d=(0,r.g)(),a||=d?.editor,(0,i.useEffect)(()=>{if(!a)throw Error("'editor' is required, either from BlockNoteContext or as a function argument");return a.onSelectionChange(l,void 0)},[l,a,void 0]);let F=(0,i.useCallback)(e=>{u.elementRenderer=e},[u]);(0,i.useEffect)(()=>{if(!u.portalElement)throw Error("Portal element not found");u.portalElement.className=(0,s.Rn)("bn-root",L,p||""),u.portalElement.setAttribute("data-color-scheme",L)},[u,L,p]);let z=(0,i.useMemo)(()=>({...B,editor:u,setContentEditableProps:_,colorSchemePreference:L}),[B,u,L]),H=(0,i.useMemo)(()=>({editorProps:{autoFocus:A,contentEditableProps:P,editable:g,portalTarget:j},defaultUIProps:$}),[A,P,g,$,j]);return(0,h.jsx)(r.h.Provider,{value:z,children:(0,h.jsxs)(e7.Provider,{value:H,children:[(0,h.jsx)(te,{ref:F}),(0,h.jsx)(tn,{className:p,renderEditor:I,editorColorScheme:L,ref:t,...N,children:m})]})})}),to=e=>{let t=(0,i.useContext)(e7),n=(0,r.m)(),o=(0,i.useMemo)(()=>{let e,t;return e=new Set,t={},{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:(0,b.createPortal)(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}},[]),l=t.editorProps.portalTarget,s=(0,i.useCallback)(e=>{n.isEditable=!1!==t.editorProps.editable,n._tiptapEditor.contentComponent=o,e?n.mount(e,{portalTarget:l}):n.unmount()},[t.editorProps.editable,n,o,l]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(e8,{contentComponent:o}),(0,h.jsx)(ti,{...t.editorProps,...e,mount:s}),(0,h.jsx)(e9,{...t.defaultUIProps}),e.children]})},ti=e=>{let{autoFocus:t,mount:n,contentEditableProps:r}=e;return(0,h.jsx)("div",{"aria-autocomplete":"list","aria-haspopup":"listbox","data-bn-autofocus":t,ref:n,...r})};function tl(e,t){let n,r=document.createElement("div"),o;if(t?.elementRenderer)t.elementRenderer(e(e=>n=e||void 0),r);else{if(!t?.headless)throw Error("elementRenderer not available, expected headless editor");o=(0,O.createRoot)(r),(0,b.flushSync)(()=>{o.render(e(e=>n=e||void 0))})}if(!r.childElementCount)return console.warn("ReactInlineContentSpec: renderHTML() failed"),{dom:document.createElement("span")};n?.setAttribute("data-tmp-find","true");let i=r.cloneNode(!0),l=i.firstElementChild,s=i.querySelector("[data-tmp-find]");return s?.removeAttribute("data-tmp-find"),o?.unmount(),{dom:l,contentDOM:s||void 0}}function ts(e){return(0,h.jsx)(T,{onDragOver:e=>e.preventDefault(),...Object.fromEntries(Object.entries(e.domAttributes||{}).filter(([e])=>"class"!==e)),className:(0,s.Rn)("bn-block-content",e.domAttributes?.class||""),"data-content-type":e.blockType,...Object.fromEntries(Object.entries(e.blockProps).filter(([t,n])=>n!==e.propSchema[t].default).map(([e,t])=>[(0,s.kn)(e),t])),"data-file-block":!0===e.isFileBlock||void 0,children:e.children})}function ta(e,t,n){return (r={})=>{let o="function"==typeof e?e(r):e,i="function"==typeof t?t(r):t,l=n?"function"==typeof n?n(r):n:void 0;return{config:o,implementation:{...i,toExternalHTML(e,t,n){let r=i.toExternalHTML||i.render;return tl(l=>(0,h.jsx)(ts,{blockType:e.type,blockProps:e.props,propSchema:o.propSchema,domAttributes:this.blockContentDOMAttributes,isFileBlock:i.meta?.fileBlockAccept!==void 0,children:(0,h.jsx)(r,{block:e,editor:t,contentRef:e=>{l(e),e&&(e.className=(0,s.Rn)("bn-inline-content",e.className))},context:n})}),t)},render(e,t){if("nodeView"===this.renderType){var n,r;return(n=e=>{let n=(0,s.En)(e.getPos,t,e.editor,o.type),r=M().nodeViewContentRef;if(!r)throw Error("nodeViewContentRef is not set");let l=i.render;return(0,h.jsx)(ts,{blockType:n.type,blockProps:n.props,propSchema:o.propSchema,isFileBlock:!!i.meta?.fileBlockAccept,domAttributes:this.blockContentDOMAttributes,children:(0,h.jsx)(l,{block:n,editor:t,contentRef:e=>{r(e),e&&(e.className=(0,s.Rn)("bn-inline-content",e.className),e.dataset.nodeViewContent="")}})})},r={className:"bn-react-node-view-renderer"},e=>e.editor.contentComponent?new j(n,e,r):{})(this.props)}{let n=i.render;return tl(r=>(0,h.jsx)(ts,{blockType:e.type,blockProps:e.props,propSchema:o.propSchema,domAttributes:this.blockContentDOMAttributes,children:(0,h.jsx)(n,{block:e,editor:t,contentRef:e=>{r(e),e&&(e.className=(0,s.Rn)("bn-inline-content",e.className))}})}),t)}}},extensions:l}}}function tc(e){let t=(0,r.m)(),[n,o]=(0,i.useState)("loading"),[l,s]=(0,i.useState)();if((0,i.useEffect)(()=>{let n=!0;return(async()=>{let r="";o("loading");try{r=t.resolveFileUrl?await t.resolveFileUrl(e):e}catch{o("error");return}n&&(o("loaded"),s(r))})(),()=>{n=!1}},[t,e]),"loaded"!==n)return{loadingState:n};if(!l)throw Error("Finished fetching file but did not get download URL.");return{loadingState:n,downloadUrl:l}}var td=e=>(0,h.jsxs)("figure",{children:[e.children,(0,h.jsx)("figcaption",{children:e.caption})]});function tu(e){var t,n;let o,l,[s,a]=(0,i.useState)(!1);return t=t=>{t===e&&a(!0)},o=(0,r.m)(),(0,i.useEffect)(()=>o.onUploadStart(t),[t,o]),n=t=>{t===e&&a(!1)},l=(0,r.m)(),(0,i.useEffect)(()=>l.onUploadEnd(n),[n,l]),s}var tp=e=>{let t=(0,r.m)(),n=(0,r.s)(),o=(0,r.f)(s.mt);return(0,h.jsxs)("div",{className:"bn-add-file-button",onMouseDown:(0,i.useCallback)(e=>{e.preventDefault()},[]),onClick:(0,i.useCallback)(()=>{t.isEditable&&e.editor.transact(()=>o.showMenu(e.block.id))},[t.isEditable,o,e.block.id,e.editor]),children:[(0,h.jsx)("div",{className:"bn-add-file-button-icon",children:e.buttonIcon||(0,h.jsx)(f.KFs,{size:24})}),(0,h.jsx)("div",{className:"bn-add-file-button-text",children:e.block.type in n.file_blocks.add_button_text?n.file_blocks.add_button_text[e.block.type]:n.file_blocks.add_button_text.file})]})},th=e=>(0,h.jsxs)("div",{className:"bn-file-name-with-icon",contentEditable:!1,draggable:!1,
17children:[(0,h.jsx)("div",{className:"bn-file-icon",children:(0,h.jsx)(f.KFs,{size:24})}),(0,h.jsx)("p",{className:"bn-file-name",children:e.block.props.name})]}),tf=e=>{let t=tu(e.block.id);return(0,h.jsx)(""!==e.block.props.url&&e.block.props.caption&&!t?"figure":"div",{className:"bn-file-block-content-wrapper",onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,style:e.style,children:t?(0,h.jsx)("div",{className:"bn-file-loading-preview",children:"Loading..."}):""===e.block.props.url?(0,h.jsx)(tp,{...e}):(0,h.jsxs)(h.Fragment,{children:[!1!==e.block.props.showPreview&&e.children?e.children:(0,h.jsx)(th,{...e}),e.block.props.caption&&(0,h.jsx)("figcaption",{className:"bn-file-caption",children:e.block.props.caption})]})})},tm=e=>(0,h.jsxs)("div",{children:[e.children,(0,h.jsx)("p",{children:e.caption})]}),tg=e=>{let t=tc(e.block.props.url);return(0,h.jsx)("audio",{className:"bn-audio",src:"loading"===t.loadingState?e.block.props.url:t.downloadUrl,controls:!0,contentEditable:!1,draggable:!1})},tb=e=>{if(!e.block.props.url)return(0,h.jsx)("p",{children:"Add audio"});let t=e.block.props.showPreview?(0,h.jsx)("audio",{src:e.block.props.url}):(0,h.jsx)("a",{href:e.block.props.url,children:e.block.props.name||e.block.props.url});return e.block.props.caption?e.block.props.showPreview?(0,h.jsx)(td,{caption:e.block.props.caption,children:t}):(0,h.jsx)(tm,{caption:e.block.props.caption,children:t}):t},ty=e=>(0,h.jsx)(tf,{...e,buttonIcon:(0,h.jsx)(f.M0i,{size:24}),children:(0,h.jsx)(tg,{...e})}),tv=(ta(s.dt,e=>({meta:{fileBlockAccept:["audio/*"]},render:ty,parse:(0,s.ct)(e),toExternalHTML:tb,runsBefore:["file"]})),ta(s.$,{render:e=>(0,h.jsx)(tf,{...e}),parse:(0,s.tt)(),toExternalHTML:e=>{if(!e.block.props.url)return(0,h.jsx)("p",{children:"Add file"});let t=(0,h.jsx)("a",{href:e.block.props.url,children:e.block.props.name||e.block.props.url});return e.block.props.caption?(0,h.jsx)(tm,{caption:e.block.props.caption,children:t}):t}}),e=>{let[t,n]=(0,i.useState)(void 0),[r,o]=(0,i.useState)(e.block.props.previewWidth),[l,s]=(0,i.useState)(!1),a=(0,i.useRef)(null);(0,i.useEffect)(()=>{let i=n=>{let r="touches"in n?n.touches[0].clientX:n.clientX;o(Math.min(Math.max("center"===e.block.props.textAlignment?"left"===t.handleUsed?t.initialWidth+(t.initialClientX-r)*2:t.initialWidth+(r-t.initialClientX)*2:"left"===t.handleUsed?t.initialWidth+t.initialClientX-r:t.initialWidth+r-t.initialClientX,64),e.editor.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE))},l=()=>{n(void 0),e.editor.updateBlock(e.block,{props:{previewWidth:r}})};return t&&(window.addEventListener("mousemove",i),window.addEventListener("touchmove",i),window.addEventListener("mouseup",l),window.addEventListener("touchend",l)),()=>{window.removeEventListener("mousemove",i),window.removeEventListener("touchmove",i),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}},[e,t,r]);let c=(0,i.useCallback)(()=>{e.editor.isEditable&&s(!0)},[e.editor.isEditable]),d=(0,i.useCallback)(()=>{s(!1)},[]),u=(0,i.useCallback)(e=>{e.preventDefault();let t="touches"in e?e.touches[0].clientX:e.clientX;n({handleUsed:"left",initialWidth:a.current.clientWidth,initialClientX:t})},[]),p=(0,i.useCallback)(e=>{e.preventDefault();let t="touches"in e?e.touches[0].clientX:e.clientX;n({handleUsed:"right",initialWidth:a.current.clientWidth,initialClientX:t})},[]),f=tu(e.block.id);return(0,h.jsx)(tf,{...e,onMouseEnter:c,onMouseLeave:d,style:e.block.props.url&&!f&&e.block.props.showPreview?{width:r?`${r}px`:"fit-content"}:void 0,children:(0,h.jsxs)("div",{className:"bn-visual-media-wrapper",style:{position:"relative"},ref:a,children:[e.children,(0,h.jsx)("div",{className:"bn-resize-handle",style:{left:"4px",display:l||t?"initial":"none"},onMouseDown:u,onTouchStart:u}),(0,h.jsx)("div",{className:"bn-resize-handle",style:{right:"4px",display:l||t?"initial":"none"},onMouseDown:p,onTouchStart:p}),t&&(0,h.jsx)("div",{style:{position:"absolute",height:"100%",width:"100%"}})]})})}),tk=e=>{let t=tc(e.block.props.url),n=e.block.props.name||"";return(0,h.jsx)("img",{className:"bn-visual-media",src:"loading"===t.loadingState?e.block.props.url:t.downloadUrl,alt:n,width:e.block.props.previewWidth,contentEditable:!1,draggable:!1})},tw=e=>{if(!e.block.props.url)return(0,h.jsx)("p",{children:"Add image"});let t=e.block.props.name||"",n=e.block.props.showPreview?(0,h.jsx)("img",{src:e.block.props.url,alt:t,width:e.block.props.previewWidth}):(0,h.jsx)("a",{href:e.block.props.url,children:e.block.props.name||e.block.props.url});return e.block.props.caption?e.block.props.showPreview?(0,h.jsx)(td,{caption:e.block.props.caption,children:n}):(0,h.jsx)(tm,{caption:e.block.props.caption,children:n}):n},tx=e=>(0,h.jsx)(tv,{...e,buttonIcon:(0,h.jsx)(f.cVZ,{size:24}),children:(0,h.jsx)(tk,{...e})});ta(s.W,e=>({meta:{fileBlockAccept:["image/*"]},render:tx,parse:(0,s.K)(e),toExternalHTML:tw,runsBefore:["file"]})),R.tZj;var tC=e=>{let t=tc(e.block.props.url);return(0,h.jsx)("video",{className:"bn-visual-media",src:"loading"===t.loadingState?e.block.props.url:t.downloadUrl,controls:!0,width:e.block.props.previewWidth||void 0,contentEditable:!1,draggable:!1})},tS=e=>{if(!e.block.props.url)return(0,h.jsx)("p",{children:"Add video"});let t=e.block.props.showPreview?(0,h.jsx)("video",{src:e.block.props.url,width:e.block.props.previewWidth||void 0}):(0,h.jsx)("a",{href:e.block.props.url,children:e.block.props.name||e.block.props.url});return e.block.props.caption?e.block.props.showPreview?(0,h.jsx)(td,{caption:e.block.props.caption,children:t}):(0,h.jsx)(tm,{caption:e.block.props.caption,children:t}):t},tE=e=>(0,h.jsx)(tv,{...e,buttonIcon:(0,h.jsx)(f.saC,{size:24}),children:(0,h.jsx)(tC,{...e})});function tM(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=n.top<r.top,i=n.bottom>r.bottom;return o&&i?"both":o?"top":i?"bottom":"none"}function tT(e){return t=>
17{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}ta(s.b,e=>({meta:{fileBlockAccept:["video/*"]},render:tE,parse:(0,s.S)(e),toExternalHTML:tS,runsBefore:["file"]})),i.memo(({thread:e,selectedThreadId:t,maxCommentsBeforeCollapse:n,referenceText:s,orphaned:a})=>{let c=(0,r.f)(l.KI),d=(0,i.useCallback)(t=>{t.target.closest(".bn-action-toolbar")||c.selectThread(e.id)},[c,e.id]),u=(0,i.useCallback)(e=>{if(!e.relatedTarget||e.relatedTarget.closest(".bn-action-toolbar"))return;let t=e.target instanceof Node?e.target:null,n=e.relatedTarget instanceof Node?e.relatedTarget.closest(".bn-thread"):null;t&&n&&n.contains(t)||c.selectThread(void 0)},[c]);return(0,h.jsx)(o.i,{thread:e,selected:e.id===t,orphaned:a,referenceText:s,maxCommentsBeforeCollapse:n,onFocus:d,onBlur:u,tabIndex:0})})},62261:(e,t,n)=>{n.d(t,{RI:()=>r,T9:()=>l,jk:()=>i,sj:()=>s,tn:()=>o});let r=Math.floor,o=Math.abs,i=(e,t)=>e<t?e:t,l=(e,t)=>e>t?e:t,s=e=>0!==e?e<0:1/e<0},62921:(e,t,n)=>{let r,o;n.d(t,{AL:()=>ei,D8:()=>F,GU:()=>I,J3:()=>d,JD:()=>P,L0:()=>L,LF:()=>eu,Qg:()=>en,RC:()=>A,aH:()=>f,aR:()=>B,fx:()=>b,gC:()=>_,gR:()=>N,oD:()=>v,rn:()=>x,t6:()=>m,w7:()=>R});var i=n(76865),l=n(27050),s=n(63197),a=n(12894),c=n(8242);if("u">typeof WeakMap){let e=new WeakMap;r=t=>e.get(t),o=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;r=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},o=(n,r)=>(10==t&&(t=0),e[t++]=n,e[t++]=r)}var d=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,o=t/this.width|0,i=r+1,l=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;l<this.height&&this.map[t+this.width*e]==n;e++)l++;return{left:r,top:o,right:i,bottom:l}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:o,top:i,bottom:l}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:l==this.height)?null:this.map[r+this.width*(n<0?i-1:l)]}rectBetween(e,t){let{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:l,right:s,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(o,a),right:Math.max(r,s),bottom:Math.max(i,c)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){let i=r*this.width+o,l=this.map[i];!n[l]&&(n[l]=!0,o==e.left&&o&&this.map[i-1]==l||r==e.top&&r&&this.map[i-this.width]==l||t.push(l))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){let i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,l=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let s=0,a=0;s<n;s++){let c=e.child(s);a++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;let d=c.child(e),{colspan:u,rowspan:p,colwidth:h}=d.attrs;for(let e=0;e<p;e++){if(e+s>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:a,n:p-e});break}let c=o+e*t;for(let e=0;e<u;e++){0==r[c+e]?r[c+e]=a:(i||(i=[])).push({type:"collision",row:s,pos:a,n:u-e});let n=h&&h[e];if(n){let r=(c+e)%t*2,o=l[r];null==o||o!=n&&1==l[r+1]?(l[r]=n,l[r+1]=1):o==n&&l[r+1]++}}}o+=u,a+=d.nodeSize}let d=(s+1)*t,u=0;for(;o<d;)0==r[o++]&&u++;u&&(i||(i=[])).push({type:"missing",row:s,n:u}),a++}(0===t||0===n)&&(i||(i=[])).push({type:"zero_sized"});let s=new d(t,n,r,i),a=!1;for(let e=0;!a&&e<l.length;e+=2)null!=l[e]&&l[e+1]<n&&(a=!0);return a&&function(e,t,n){e.problems||(e.problems=[]);let r={};for(let o=0;o<e.map.length;o++){let i=e.map[o];if(r[i])continue;
17r[i]=!0;let l=n.nodeAt(i);if(!l)throw RangeError(`No cell with offset ${i} found`);let s=null,a=l.attrs;for(let n=0;n<a.colspan;n++){let r=t[(o+n)%e.width*2];null==r||a.colwidth&&a.colwidth[n]==r||((s||(s=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}(a)))[n]=r)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}(s,l,e),s}(e))}};function u(e){let t=e.cached.tableNodeTypes;if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}let p=new i.hs("selectingCells");function h(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function f(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function m(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;let n=h(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function g(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function b(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function y(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function v(e,t,n){let r=e.node(-1),o=d.get(r),i=e.start(-1),l=o.nextCell(e.pos-i,t,n);return null==l?null:e.node(0).resolve(i+l)}function k(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function w(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var x=class e extends i.LN{constructor(e,t=e){const n=e.node(-1),r=d.get(n),o=e.start(-1),l=r.rectBetween(e.pos-o,t.pos-o),s=e.node(0),a=r.cellsInRect(l).filter(e=>e!=t.pos-o);a.unshift(t.pos-o);const c=a.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=o+e+1;return new i.yn(s.resolve(r),s.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(g(r)&&g(o)&&y(r,o)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,o):t&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return i.U3.between(r,o)}content(){let e=this.$anchorCell.node(-1),t=d.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let n=r.top;n<r.bottom;n++){let s=[];for(let i=n*t.width+r.left,l=r.left;l<r.right;l++,i++){let n=t.map[i];if(o[n])continue;o[n]=!0;let l=t.findCell(n),a=e.nodeAt(n);if(!a)throw RangeError(`No cell with offset ${n} found`);let c=r.left-l.left,d=l.right-r.right;if(c>0||d>0){let e=a.attrs;if(c>0&&(e=k(e,0,c)),d>0&&(e=k(e,e.colspan-d,d)),l.left<r.left){if(!(a=a.type.createAndFill(e)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else a=a.type.create(e,a.content)}if(l.top<r.top||l.bottom>r.bottom){let e={...a.attrs,rowspan:Math.min(l.bottom,r.bottom)-Math.max(l.top,r.top)};a=l.top<r.top?a.type.createAndFill(e):a.type.create(e,a.content)}s.push(a)}i.push(e.child(n).copy(l.FK.from(s)))}let s=this.isColSelection()&&this.isRowSelection()?e:i;return new l.Ji(l.FK.from(s),1,1)}replace(e,t=l.Ji.empty){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n);e.replace(a.map(i.pos),a.map(s.pos),o?l.Ji.empty:t)}let o=i.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new l.Ji(l.FK.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=d.get(t),r=this.$anchorCell.start(-1),o=n.cells
17InRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),r+o[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);return!(Math.min(e,t)>0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),o=d.get(r),i=t.start(-1),l=o.findCell(t.pos-i),s=o.findCell(n.pos-i),a=t.node(0);return l.top<=s.top?(l.top>0&&(t=a.resolve(i+o.map[l.left])),s.bottom<o.height&&(n=a.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))):(s.top>0&&(n=a.resolve(i+o.map[s.left])),l.bottom<o.height&&(t=a.resolve(i+o.map[o.width*(o.height-1)+l.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=d.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);return!(Math.min(r,o)>0)&&Math.max(r+this.$anchorCell.nodeAfter.attrs.colspan,o+this.$headCell.nodeAfter.attrs.colspan)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),o=d.get(r),i=t.start(-1),l=o.findCell(t.pos-i),s=o.findCell(n.pos-i),a=t.node(0);return l.left<=s.left?(l.left>0&&(t=a.resolve(i+o.map[l.top*o.width])),s.right<o.width&&(n=a.resolve(i+o.map[o.width*(s.top+1)-1]))):(s.left>0&&(n=a.resolve(i+o.map[s.top*o.width])),l.right<o.width&&(t=a.resolve(i+o.map[o.width*(l.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new C(this.$anchorCell.pos,this.$headCell.pos)}};x.prototype.visible=!1,i.LN.jsonID("cell",x);
17var C=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&y(t,n)?new x(t,n):i.LN.near(n,1)}};function S(e){if(!(e.selection instanceof x))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(s.NZ.node(n,n+e.nodeSize,{class:"selectedCell"}))}),s.zF.create(e.doc,t)}let E=new i.hs("fix-tables");function M(e){let t=e.selection,n=m(e),r=n.node(-1),o=n.start(-1),i=d.get(r);return{...t instanceof x?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function T(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){let r=u(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let l=0;l<t.height;l++){let s=l*t.width+o;if(o>0&&o<t.width&&t.map[s-1]==t.map[s]){let i=t.map[s],a=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,w(a.attrs,o-t.colCount(i))),l+=a.attrs.rowspan-1}else{let a=null==i?u(r.type.schema).cell:r.nodeAt(t.map[s+i]).type,c=t.positionAt(l,o,r);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function A(e,t){if(!f(e))return!1;if(t){let n=M(e);t(T(e.tr,n,n.left))}return!0}function I(e,t){if(!f(e))return!1;if(t){let n=M(e);t(T(e.tr,n,n.right))}return!0}function N(e,t){if(!f(e))return!1;if(t){let n=M(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;!function(e,{map:t,table:n,tableStart:r},o){let i=e.mapping.maps.length;for(let l=0;l<t.height;){let s=l*t.width+o,a=t.map[s],c=n.nodeAt(a),d=c.attrs;if(o>0&&t.map[s-1]==a||o<t.width-1&&t.map[s+1]==a)e.setNodeMarkup(e.mapping.slice(i).map(r+a),null,k(d,o-t.colCount(a)));else{let t=e.mapping.slice(i).map(r+a);e.delete(t,t+c.nodeSize)}l+=d.rowspan}}(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=d.get(e)}t(r)}return!0}function j(e,{map:t,tableStart:n,table:r},o){let i=n;for(let e=0;e<o;e++)i+=r.child(e).nodeSize;let l=[],s=o>0?-1:0;(function(e,t,n){var r;let o=u(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if((null==(r=t.nodeAt(e.map[i+n*e.width]))?void 0:r.type)!=o)return!1;return!0})(t,r,o+s)&&(s=0==o||o==t.height?null:0);for(let i=0,c=t.width*o;i<t.width;i++,c++)if(o>0&&o<t.height&&t.map[c]==t.map[c-t.width]){let o=t.map[c],l=r.nodeAt(o).attrs;e.setNodeMarkup(n+o,null,{...l,rowspan:l.rowspan+1}),i+=l.colspan-1}else{var a;let e=null==s?u(r.type.schema).cell:null==(a=r.nodeAt(t.map[c+s*t.width]))?void 0:a.type,n=null==e?void 0:e.createAndFill();n&&l.push(n)}return e.insert(i,u(r.type.schema).row.create(null,l)),e}function P(e,t){if(!f(e))return!1;if(t){let n=M(e);t(j(e.tr,n,n.top))}return!0}function _(e,t){if(!f(e))return!1;if(t){let n=M(e);t(j(e.tr,n,n.bottom))}return!0}function B(e,t){if(!f(e))return!1;if(t){let n=M(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;!function(e,{map:t,table:n,tableStart:r},o){let i=0;for(let e=0;e<o;e++)i+=n.child(e).nodeSize;let l=i+n.child(o).nodeSize,s=e.mapping.maps.length;e.delete(i+r,l+r);let a=new Set;for(let i=0,l=o*t.width;i<t.width;i++,l++){let c=t.map[l];if(!a.has(c)){if(a.add(c),o>0&&c==t.map[l-t.width]){let t=n.nodeAt(c).attrs;e.setNodeMarkup(e.mapping.slice(s).map(c+r),null,{...t,rowspan:t.rowspan-1}),i+=t.colspan-1}else if(o<t.height&&c==t.map[l+t.width]){let l=n.nodeAt(c),a=l.attrs,d=l.type.create({...a,rowspan:l.attrs.rowspan-1},l.content),u=t.positionAt(o+1,i,n);e.insert(e.mapping.slice(s).map(r+u),d),i+=a.colspan-1}}}}(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=d.get(n.table)}t(r)}return!0}function O(e){let t=e.content;return 1==t.childCount&&t.child(0).isTextblock&&0==t.child(0).childCount}function R(e,t){let n=e.selection;if(!(n instanceof x)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=M(e),{map:o}=r;if(function({width:e,height:t,map:n},r){let o=r.top*e+r.left,i=o,l=(r.bottom-1)*e+r.left,s=o+(r.right-r.left-1);for(let t=r.top;t<r.bottom;
17t++){if(r.left>0&&n[i]==n[i-1]||r.right<e&&n[s]==n[s+1])return!0;i+=e,s+=e}for(let i=r.left;i<r.right;i++){if(r.top>0&&n[o]==n[o-e]||r.bottom<t&&n[l]==n[l+e])return!0;o++,l++}return!1}(o,r))return!1;if(t){let n,i,s=e.tr,a={},c=l.FK.empty;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=o.map[e*o.width+t],d=r.table.nodeAt(l);if(!a[l]&&d)if(a[l]=!0,null==n)n=l,i=d;else{O(d)||(c=c.append(d.content));let e=s.mapping.map(l+r.tableStart);s.delete(e,e+d.nodeSize)}}if(null==n||null==i)return!0;if(s.setNodeMarkup(n+r.tableStart,null,{...w(i.attrs,i.attrs.colspan,r.right-r.left-i.attrs.colspan),rowspan:r.bottom-r.top}),c.size>0){let e=n+1+i.content.size,t=O(i)?n+1:e;s.replaceWith(t+r.tableStart,e+r.tableStart,c)}s.setSelection(new x(s.doc.resolve(n+r.tableStart))),t(s)}return!0}function L(e,t){var n;let r=u(e.schema);return(n=({node:e})=>r[e.type.spec.tableRole],(e,t)=>{let r,o,i=e.selection;if(i instanceof x){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{var l;if(!(r=function(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=null==(l=h(i.$from))?void 0:l.pos}if(null==r||null==o||1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(t){let l,s=r.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});let d=M(e),u=e.tr;for(let e=0;e<d.right-d.left;e++)a.push(c?{...s,colwidth:c&&c[e]?[c[e]]:null}:s);for(let e=d.top;e<d.bottom;e++){let t=d.map.positionAt(e,d.left,d.table);e==d.top&&(t+=r.nodeSize);for(let o=d.left,i=0;o<d.right;o++,i++)(o!=d.left||e!=d.top)&&u.insert(l=u.mapping.map(t+d.tableStart,1),n({node:r,row:e,col:o}).createAndFill(a[i]))}u.setNodeMarkup(o,n({node:r,row:d.top,col:d.left}),a[0]),i instanceof x&&u.setSelection(new x(u.doc.resolve(i.$anchorCell.pos),l?u.doc.resolve(l):void 0)),t(u)}return!0})(e,t)}function D(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){let o=t.table.nodeAt(r[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function $(e,t){if((t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic)return function(t,n){if(!f(t))return!1;if(n){let r=u(t.schema),o=M(t),i=t.tr,l=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),s=l.map(e=>o.table.nodeAt(e));for(let e=0;e<l.length;e++)s[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+l[e],r.cell,s[e].attrs);if(0===i.steps.length)for(let e=0;e<l.length;e++)i.setNodeMarkup(o.tableStart+l[e],r.header_cell,s[e].attrs);n(i)}return!0};return function(t,n){if(!f(t))return!1;if(n){let r=u(t.schema),o=M(t),i=t.tr,l=D("row",o,r),s=D("column",o,r),a=+("column"===e?!!l:"row"===e&&!!s),c="column"==e?{left:0,top:a,right:1,bottom:o.map.height}:"row"==e?{left:a,top:0,right:o.map.width,bottom:1}:o,d="column"==e?s?r.cell:r.header_cell:"row"==e?l?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(e=>{let t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)}),n(i)}return!0}}function F(e){return function(t,n){if(!f(t))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),o=r.lastChild;if(o)return n-1-o.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(m(t),e);if(null==r)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(i.U3.between(e,b(e))).scrollIntoView())}return!0}}function z(e,t){let n=e.selection;if(!(n instanceof x))return!1;if(t){let r=e.tr,o=u(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new l.Ji(o,0,0))}),r.docChanged&&t(r)}return!0}function H(e,t){let n=e.createAndFill();return new c.dL(n).replace(0,n.content.size,t).doc}function V(e,t,n,r,o,i,l,s){if(0==l||l==t.height)return!1;let a=!1;for(let c=o;c<i;c++){let o=l*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){a=!0;let o=n.nodeAt(i),{top:d,left:u}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...o.attrs,rowspan:l-d}
17),e.insert(e.mapping.slice(s).map(t.positionAt(l,u,n)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-l})),c+=o.attrs.colspan-1}}return a}function U(e,t,n,r,o,i,l,s){if(0==l||l==t.width)return!1;let a=!1;for(let c=o;c<i;c++){let o=c*t.width+l,i=t.map[o];if(t.map[o-1]==i){a=!0;let o=n.nodeAt(i),d=t.colCount(i),u=e.mapping.slice(s).map(i+r);e.setNodeMarkup(u,null,k(o.attrs,l-d,o.attrs.colspan-(l-d))),e.insert(u+o.nodeSize,o.type.createAndFill(k(o.attrs,0,l-d))),c+=o.attrs.rowspan-1}}return a}function W(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw Error("No table found");let s=d.get(i),{top:a,left:c}=r,p=c+o.width,h=a+o.height,f=e.tr,m=0;function g(){if(!(i=n?f.doc.nodeAt(n-1):f.doc))throw Error("No table found");s=d.get(i),m=f.mapping.maps.length}(function(e,t,n,r,o,i){let s,a,c=u(e.doc.type.schema);if(o>t.width)for(let i=0,l=0;i<t.height;i++){let d,u=n.child(i);l+=u.nodeSize;let p=[];d=null==u.lastChild||u.lastChild.type==c.cell?s||(s=c.cell.createAndFill()):a||(a=c.header_cell.createAndFill());for(let e=t.width;e<o;e++)p.push(d);e.insert(e.mapping.slice(0).map(l-1+r),p)}if(i>t.height){let d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){let o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==c.header_cell;d.push(o?a||(a=c.header_cell.createAndFill()):s||(s=c.cell.createAndFill()))}let u=c.row.create(null,l.FK.from(d)),p=[];for(let e=t.height;e<i;e++)p.push(u);e.insert(e.mapping.slice(0).map(r+n.nodeSize-2),p)}return!!(s||a)})(f,s,i,n,p,h)&&g(),V(f,s,i,n,c,p,a,m)&&g(),V(f,s,i,n,c,p,h,m)&&g(),U(f,s,i,n,a,h,c,m)&&g(),U(f,s,i,n,a,h,p,m)&&g();for(let e=a;e<h;e++){let t=s.positionAt(e,c,i),r=s.positionAt(e,p,i);f.replace(f.mapping.slice(m).map(t+n),f.mapping.slice(m).map(r+n),new l.Ji(o.rows[e-a],0,0))}g(),f.setSelection(new x(f.doc.resolve(n+s.positionAt(a,c,i)),f.doc.resolve(n+s.positionAt(h-1,p-1,i)))),t(f)}$("row",{useDeprecatedLogic:!0}),$("column",{useDeprecatedLogic:!0}),$("cell",{useDeprecatedLogic:!0});let J=(0,a.K)({ArrowLeft:q("horiz",-1),ArrowRight:q("horiz",1),ArrowUp:q("vert",-1),ArrowDown:q("vert",1),"Shift-ArrowLeft":K("horiz",-1),"Shift-ArrowRight":K("horiz",1),"Shift-ArrowUp":K("vert",-1),"Shift-ArrowDown":K("vert",1),Backspace:z,"Mod-Backspace":z,Delete:z,"Mod-Delete":z});function G(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function q(e,t){return(n,r,o)=>{if(!o)return!1;let l=n.selection;if(l instanceof x)return G(n,r,i.LN.near(l.$headCell,t));if("horiz"!=e&&!l.empty)return!1;let s=Q(o,e,t);if(null==s)return!1;if("horiz"==e)return G(n,r,i.LN.near(n.doc.resolve(l.head+t),t));{let o,l=n.doc.resolve(s),a=v(l,e,t);return o=a?i.LN.near(a,1):t<0?i.LN.near(n.doc.resolve(l.before(-1)),-1):i.LN.near(n.doc.resolve(l.after(-1)),1),G(n,r,o)}}}function K(e,t){return(n,r,o)=>{let i;if(!o)return!1;let l=n.selection;if(l instanceof x)i=l;else{let r=Q(o,e,t);if(null==r)return!1;i=new x(n.doc.resolve(r))}let s=v(i.$headCell,e,t);return!!s&&G(n,r,new x(i.$anchorCell,s))}}function Y(e,t){let n=h(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new x(n))),!0)}function Z(e,t,n){if(!f(e.state))return!1;let r=function(e){if(0===e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;let o=t.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if("row"==i)for(let e=0;e<t.childCount;e++){let o=t.child(e).content,i=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);
17(i||c)&&(o=H(u(s).row,new l.Ji(o,i,c)).content),a.push(o)}else{if("cell"!=i&&"header_cell"!=i)return null;a.push(n||r?H(u(s).row,new l.Ji(t,n,r)).content:t)}return function(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:o,colspan:i}=r.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+i}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(l.FK.empty),n[o]<r){let i=u(e).cell.createAndFill(),s=[];for(let e=n[o];e<r;e++)s.push(i);t[o]=t[o].append(l.FK.from(s))}return{height:t.length,width:r,rows:t}}(s,a)}(n),o=e.state.selection;if(o instanceof x){r||(r={width:1,height:1,rows:[l.FK.from(H(u(e.state.schema).cell,n))]});let t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),s=d.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){let t=[],o=[];for(let e=0;e<n.length;e++){let i=n[e],s=[];for(let n=t[e]||0,o=0;n<r;o++){let l=i.child(o%i.childCount);n+l.attrs.colspan>r&&(l=l.type.createChecked(k(l.attrs,l.attrs.colspan,n+l.attrs.colspan-r),l.content)),s.push(l),n+=l.attrs.colspan;for(let n=1;n<l.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+l.attrs.colspan}o.push(l.FK.from(s))}n=o,e=r}if(t!=o){let e=[];for(let r=0,i=0;r<o;r++,i++){let s=[],a=n[i%t];for(let e=0;e<a.childCount;e++){let t=a.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),s.push(t)}e.push(l.FK.from(s))}n=e,t=o}return{width:e,height:t,rows:n}}(r,s.right-s.left,s.bottom-s.top),W(e.state,e.dispatch,i,s,r),!0}if(!r)return!1;{let t=m(e.state),n=t.start(-1);return W(e.state,e.dispatch,n,d.get(t.node(-1)).findCell(t.pos-n),r),!0}}function X(e,t){var n;let r;if(0!=t.button||t.ctrlKey||t.metaKey)return;let o=ee(e,t.target);if(t.shiftKey&&e.state.selection instanceof x)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&null!=(r=h(e.state.selection.$anchor))&&(null==(n=et(e,t))?void 0:n.pos)!=r.pos)i(r,t),t.preventDefault();else if(!o)return;function i(t,n){let r=et(e,n),o=null==p.getState(e.state);if(!r||!y(t,r))if(!o)return;else r=t;let i=new x(t,r);if(o||!e.state.selection.eq(i)){let n=e.state.tr.setSelection(i);o&&n.setMeta(p,t.pos),e.dispatch(n)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",s),null!=p.getState(e.state)&&e.dispatch(e.state.tr.setMeta(p,-1))}function s(n){let r,s=p.getState(e.state);if(null!=s)r=e.state.doc.resolve(s);else if(ee(e,n.target)!=o&&!(r=et(e,t)))return l();r&&i(r,n)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",s)}function Q(e,t,n){if(!(e.state.selection instanceof i.U3))return null;let{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){let i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))break;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){let i=r.before(o),l="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?i:null}}return null}function ee(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function et(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:o}=n;return r>=0&&h(e.state.doc.resolve(r))||h(e.state.doc.resolve(o))}var en=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),er(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,er(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function er(e,t,n,r,o,i){let l=0,s=!0,a=t.firstChild,c=e.firstChild;if(c){for(let e=0,n=0;e<c.childCount;e++){let{colspan:d,colwidth:u}=c.child(e).attrs;for(let e=0;e<d;e++,n++){let c=o==n?i:u&&u[e],d=c?c+"px":"";if(l+=c||r,c||(s=!1),a)a.style.width!=d&&(a.style.width=d),a=a.nextSibling;else{let e=document.createElement("col");e.style.width=d,t.appendChild(e)}}}for(;a;){var d;let e=a.nextSibling;null==(d=a.parentNode)||d.removeChild(a),a=e}s?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}let eo=new i.hs("tableColumnResizing");function ei({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=en,lastColumnResizable:o=!0}={}){let l=new i.k_({key:eo,state:{init(e,t){var o;let i=null==(o=l.spec)||null==(o=o.props)?void 0:o.nodeViews,s=u(t.schema).table.name;return r&&i&&(i[s]=(e,t)=>new r(e,n,t)),new el(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{let t=eo.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r){if(!e.editable)return;
17let o=eo.getState(e.state);if(o&&!o.dragging){let i=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),l=-1;if(i){let{left:r,right:o}=i.getBoundingClientRect();t.clientX-r<=n?l=es(e,t,"left",n):o-t.clientX<=n&&(l=es(e,t,"right",n))}if(l!=o.activeHandle){if(!r&&-1!==l){let t=e.state.doc.resolve(l),n=t.node(-1),r=d.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}ec(e,l)}}}(t,n,e,o)},mouseleave:e=>{!function(e){if(!e.editable)return;let t=eo.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&ec(e,-1)}(e)},mousedown:(e,r)=>{!function(e,t,n,r){var o;if(!e.editable)return;let i=null!=(o=e.dom.ownerDocument.defaultView)?o:window,l=eo.getState(e.state);if(!l||-1==l.activeHandle||l.dragging)return;let s=e.state.doc.nodeAt(l.activeHandle),a=function(e,t,{colspan:n,colwidth:r}){let o=r&&r[r.length-1];if(o)return o;let i=e.domAtPos(t),l=i.node.childNodes[i.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(l-=r[e],s--);return l/s}(e,l.activeHandle,s.attrs);function c(t){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);let r=eo.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){let r=e.state.doc.resolve(t),o=r.node(-1),i=d.get(o),l=r.start(-1),s=i.colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let e=0;e<i.height;e++){let t=e*i.width+s;if(e&&i.map[t]==i.map[t-i.width])continue;let r=i.map[t],c=o.nodeAt(r).attrs,d=1==c.colspan?0:s-i.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let u=c.colwidth?c.colwidth.slice():Array(c.colspan).fill(0);u[d]=n,a.setNodeMarkup(l+r,null,{...c,colwidth:u})}a.docChanged&&e.dispatch(a)}(e,r.activeHandle,ea(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(eo,{setDragging:null})))}function u(t){if(!t.which)return c(t);let o=eo.getState(e.state);if(o&&o.dragging){let i=ea(o.dragging,t,n);ed(e,o.activeHandle,i,r)}}e.dispatch(e.state.tr.setMeta(eo,{setDragging:{startX:t.clientX,startWidth:a}})),ed(e,l.activeHandle,a,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),t.preventDefault()}(e,r,t,n)}},decorations:e=>{let t=eo.getState(e);if(t&&t.activeHandle>-1)return function(e,t){let n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return s.zF.empty;let i=d.get(o),l=r.start(-1),a=i.colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<i.height;t++){let r=a+t*i.width;if((a==i.width-1||i.map[r]!=i.map[r+1])&&(0==t||i.map[r]!=i.map[r-i.width])){var c;let t=i.map[r],a=l+t+o.nodeAt(t).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",(null==(c=eo.getState(e))?void 0:c.dragging)&&n.push(s.NZ.node(l+t,l+t+o.nodeAt(t).nodeSize,{class:"column-resize-dragging"})),n.push(s.NZ.widget(a,d))}}return s.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return l}var el=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=t.getMeta(eo);if(n&&null!=n.setHandle)return new e(n.setHandle,!1);if(n&&void 0!==n.setDragging)return new e(this.activeHandle,n.setDragging);if(this.activeHandle>-1&&t.docChanged){let n=t.mapping.map(this.activeHandle,-1);return g(t.doc.resolve(n))||(n=-1),new e(n,this.dragging)}return this}};function es(e,t,n,r){let o=e.posAtCoords({left:t.clientX+("right"==n?-r:r),top:t.clientY});if(!o)return -1;let{pos:i}=o,l=h(e.state.doc.resolve(i));if(!l)return -1;if("right"==n)return l.pos;let s=d.get(l.node(-1)),a=l.start(-1),c=s.map.indexOf(l.pos-a);return c%s.width==0?-1:a+s.map[c-1]}function ea(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function ec(e,t){e.dispatch(e.state.tr.setMeta(eo,{setHandle:t}))}function ed(e,t,n,r){let o=e.state.doc.resolve(t),i=o.node(-1),l=o.start(-1),s=d.get(i).colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.domAtPos(o.start(-1)).node;for(;a&&"TABLE"!=a.nodeName;)a=a.parentNode;a&&er(i,a.firstChild,a,r,s,n)}function eu({allowTableNodeSelection:e=!1}={}){return new i.k_({key:p,state:{init:()=>null,apply(e,t){let n=e.getMeta(p);if(null!=n)return -1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:S,handleDOMEvents:{mousedown:X},createSelectionBetween:e=>null!=p.getState(e.state)?e.state.selection:null,handleTripleClick:Y,handleKeyDown:J,handlePaste:Z},appendTransaction:(t,n,r)=>{let o,l;return function(e,t,n){let r,o,l=(t||e).selection,s=(t||e).doc;if(l instanceof i.nh&&(o=l.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=x.create(s,l.from);else if("row"==o){let e=s.resolve(l.from+1);r=x.rowSelection(e,e)}else if(!n){let e=d.get(l.node),t=l.from+1,n=t+e.map[e.width*e.height-1];r=x.create(s,t+1,n)}}else l instanceof i.U3&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(l)?r=i.U3.create(s,l.from):l instanceof i.U3&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(l)&&(r=i.U3.create(s,l.$from.start(),l.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,(l=(e,t)=>{"table"==e.type.spec.tableRole&&(o=function(e,t,n,r){let o,i,l=d.get(t);if(!l.problems)return r;r||(r=e.tr);let s=[];for(let e=0;e<l.height;e++)s.push(0);for(let e=0;e<l.problems.length;e++){let o=l.problems[e];if("collision"==o.type){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)s[o.row+e]+=o.n;
17r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,k(i,i.colspan-o.n,o.n))}else if("missing"==o.type)s[o.row]+=o.n;else if("overlong_rowspan"==o.type){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if("colwidth mismatch"==o.type){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if("zero_sized"==o.type){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}for(let e=0;e<s.length;e++)s[e]&&(null==o&&(o=e),i=e);for(let a=0,c=n+1;a<l.height;a++){let n=t.child(a),l=c+n.nodeSize,d=s[a];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let s=[];for(let n=0;n<d;n++){let n=u(e.schema)[t].createAndFill();n&&s.push(n)}let p=(0==a||o==a-1)&&i==a?c+1:l-1;r.insert(r.mapping.map(p),s)}c=l}return r.setMeta(E,{fixTables:!0})}(r,e,t,o))},n?n.doc!=r.doc&&function e(t,n,r,o){let i=t.childCount,l=n.childCount;r:for(let s=0,a=0;s<l;s++){let l=n.child(s);for(let e=a,n=Math.min(i,s+3);e<n;e++)if(t.child(e)==l){a=e+1,r+=l.nodeSize;continue r}o(l,r),a<i&&t.child(a).sameMarkup(l)?e(t.child(a),l,r+1,o):l.nodesBetween(0,l.content.size,o,r+1),r+=l.nodeSize}}(n.doc,r.doc,0,l):r.doc.descendants(l),o),e)}})}},62992:(e,t,n)=>{n.d(t,{J:()=>g});var r=n(95155),o=n(67413),i=n(12115),l=n(86334),s=n(25168),a=n(65214),c=n(74279),d=n(38273),u=n(57142);let p=(0,i.forwardRef)(({size:e="var(--cb-icon-size, 70%)",style:t,...n},o)=>(0,r.jsx)("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:o,...n,children:(0,r.jsx)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));p.displayName="@mantine/core/CloseIcon";var h={root:"m_86a44da5","root--subtle":"m_220c80f2"};let f={variant:"subtle"},m=(0,s.V)((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":(0,l.YC)(t,"cb-size"),"--cb-radius":void 0===n?void 0:(0,l.nJ)(n),"--cb-icon-size":(0,o.D)(r)}})),g=(0,d.v)((e,t)=>{let n=(0,a.Y)("CloseButton",f,e),{iconSize:o,children:i,vars:l,radius:s,className:d,classNames:g,style:b,styles:y,unstyled:v,"data-disabled":k,disabled:w,variant:x,icon:C,mod:S,attributes:E,__staticSelector:M,...T}=n,A=(0,c.I)({name:M||"CloseButton",props:n,className:d,style:b,classes:h,classNames:g,styles:y,unstyled:v,attributes:E,vars:l,varsResolver:m});return(0,r.jsxs)(u.N,{ref:t,...T,unstyled:v,variant:x,disabled:w,mod:[{disabled:w||k},S],...A("root",{variant:x,active:!w&&!k}),children:[C||(0,r.jsx)(p,{}),i]})});g.classes=h,g.displayName="@mantine/core/CloseButton"},63056:(e,t,n)=>{n.d(t,{$4:()=>S,$u:()=>k,CM:()=>function e(t,n,r){return void 0===r&&(r=!0),t.filter(e=>{var t;return e.parentId===n&&(!r||(null==(t=e.context)?void 0:t.open))}).flatMap(n=>[n,...e(t,n.id,r)])},EW:()=>g,F2:()=>b,Go:()=>I,Jt:()=>_,N:()=>$,OS:()=>N,O_:()=>M,Pg:()=>A,Qp:()=>D,RS:()=>f,SE:()=>j,WZ:()=>w,XJ:()=>L,YE:()=>v,YF:()=>T,cX:()=>u,em:()=>x,gR:()=>m,jo:()=>E,kQ:()=>B,nd:()=>C,nr:()=>c,tZ:()=>y,vF:()=>R,yV:()=>F});var r,o=n(6791),i=n(12115),l=n(4569);function s(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function a(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function c(){return/apple/i.test(navigator.vendor)}function d(){let e=/android/i;return e.test(s())||e.test(a())}function u(){return s().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function p(){return a().includes("jsdom/")}let h="data-floating-ui-focusable";function f(e){let t=e.activeElement;for(;(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function m(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;
17if(n&&(0,o.Ng)(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function g(e){return"composedPath"in e?e.composedPath()[0]:e.target}function b(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function y(e){return e.matches("html,body")}function v(e){return(null==e?void 0:e.ownerDocument)||document}function k(e){return(0,o.sb)(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function w(e){return!!e&&"combobox"===e.getAttribute("role")&&k(e)}function x(e){if(!e||p())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}function C(e){return e?e.hasAttribute(h)?e:e.querySelector("["+h+"]")||e:null}function S(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){let t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function E(e){e.preventDefault(),e.stopPropagation()}function M(e){return"nativeEvent"in e}function T(e){return 0===e.mozInputSource&&!!e.isTrusted||(d()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function A(e){return!p()&&(!d()&&0===e.width&&0===e.height||d()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function I(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var N="u">typeof document?i.useLayoutEffect:function(){};function j(e){let t=i.useRef(e);return N(()=>{t.current=e}),t}let P={...r||(r=n.t(i,2))}.useInsertionEffect||(e=>e());function _(e){let t=i.useRef(()=>{});return P(()=>{t.current=e}),i.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}let B=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function O(e,t){let n=(0,l.Kr)(e,B()),r=n.length;if(0===r)return;let o=f(v(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function R(e){return O(v(e).body,1)||e}function L(e){return O(v(e).body,-1)||e}function D(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!m(n,r)}function $(e){(0,l.Kr)(e,B()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function F(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}},63758:(e,t,n)=>{n.d(t,{ft:()=>s,Y:()=>i,AV:()=>c,Qu:()=>a,hN:()=>p,hr:()=>u,UH:()=>d,Ny:()=>l,Tx:()=>h,ET:()=>f});let r=Symbol;var o=n(76290);let i=r(),l=r(),s=r(),a=r(),c=r(),d=r(),u=r(),p=r(),h=r(),f=e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(void 0===n)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(""));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n};o._g()},65214:(e,t,n)=>{n.d(t,{Y:()=>i});var r=n(92248);n(12115),n(95155);var o=n(12255);function i(e,t,n){let i=(0,o.xd)(),l=i.components[e]?.defaultProps,s="function"==typeof l?l(i):l;return{...t,...s,...(0,r.J)(n)}}}
17,65538:(e,t,n)=>{var r=n(12115),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,l=r.useEffect,s=r.useLayoutEffect,a=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var d="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,d=r[1];return s(function(){o.value=n,o.getSnapshot=t,c(o)&&d({inst:o})},[e,n,t]),l(function(){return c(o)&&d({inst:o}),e(function(){c(o)&&d({inst:o})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d},66629:(e,t,n)=>{n.d(t,{A$:()=>o,AI:()=>s,FI:()=>d,If:()=>c,NL:()=>u,OY:()=>l,WV:()=>a,bv:()=>h,m6:()=>p});var r=n(12115);let o=(0,r.createContext)(null);function i(){let e=(0,r.useContext)(o);if(!e)throw Error("[@mantine/core] MantineProvider was not found in tree");return e}function l(){return i().cssVariablesResolver}function s(){return i().classNamesPrefix}function a(){return i().getStyleNonce}function c(){return i().withStaticClasses}function d(){return i().headless}function u(){return i().stylesTransform?.sx}function p(){return i().stylesTransform?.styles}function h(){return i().env||"default"}},67413:(e,t,n)=>{function r(e){return"0rem"===e?"0rem":`calc(${e} * var(--mantine-scale))`}function o(e,{shouldScale:t=!1}={}){return function n(o){if(0===o||"0"===o)return`0${e}`;if("number"==typeof o){let n=`${o/16}${e}`;return t?r(n):n}if("string"==typeof o){if(""===o||o.startsWith("calc(")||o.startsWith("clamp(")||o.includes("rgba("))return o;if(o.includes(","))return o.split(",").map(e=>n(e)).join(",");if(o.includes(" "))return o.split(" ").map(e=>n(e)).join(" ");let i=o.replace("px","");if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?r(n):n}}return o}}n.d(t,{D:()=>i,em:()=>l});let i=o("rem",{shouldScale:!0}),l=o("em")},67740:(e,t,n)=>{n.d(t,{D:()=>i});var r=n(12115),o=n(40772);function i(e){let t=r.Children.toArray(e);return 1===t.length&&(0,o.v)(t[0])?t[0]:null}},68054:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var r,o,i,l=i[o];if(!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}},69458:(e,t,n)=>{n.d(t,{v:()=>o});var r=n(99718);function o(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},o=(0,r.r)(n.from,t),i=(0,r.r)(n.to,t);return`linear-gradient(${n.deg}deg, ${o} 0%, ${i} 100%)`}},69954:(e,t,n)=>{n.d(t,{D_:()=>i,LE:()=>l,P9:()=>s});var r=n(95155),o=n(12115);function i(e){return e}function l(e){return t=>{let n=(0,o.forwardRef)((n,o)=>(0,r.jsx)(e,{...t,...n,ref:o}));return n.extend=e.extend,n.displayName=`WithProps(${e.displayName})`,n}}function s(e){let t=(0,o.forwardRef)(e);return t.extend=i,t.withProps=e=>{let n=(0,o.forwardRef)((n,o)=>(0,r.jsx)(t,{...e,...n,ref:o}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}},70489:(e,t,n)=>{n.d(t,{HR:()=>a,T0:()=>c,nk:()=>s});var r=n(8750),o=n(48273),i=n(14214),l=n(92619).Buffer;let s=o.Bd?e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=r.QV(e[n]);return btoa(t)}:e=>l.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");o.Bd;let a=e=>{let t=new Uint8Array(e.byteLength);return t.set(e),t},c=e=>i.lF(t=>i.IO(t,e))},74279:(e,t,n)=>{n.d(t,{I:()=>p}),n(12115),n(95155);var r=n(66629),o=n(12255),i=n(29722);let l={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};var s=n(45917);
17function a({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return(0,s.J)({theme:n,classNames:r,props:o,stylesCtx:t})[e]}var c=n(31734);function d({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...d({style:n,theme:t})}),{}):"function"==typeof e?e(t):null==e?{}:e}var u=n(92248);function p({name:e,classes:t,props:n,stylesCtx:h,className:f,style:m,rootSelector:g="root",unstyled:b,classNames:y,styles:v,vars:k,varsResolver:w,attributes:x}){let C=(0,o.xd)(),S=(0,r.AI)(),E=(0,r.If)(),M=(0,r.FI)(),T=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:A,getTransformedStyles:I}=function({props:e,stylesCtx:t,themeName:n}){let i=(0,o.xd)(),l=(0,r.m6)()?.();return{getTransformedStyles:r=>l?[...r.map(n=>l(n,{props:e,theme:i,ctx:t})),...n.map(n=>l(i.components[n]?.styles,{props:e,theme:i,ctx:t}))].filter(Boolean):[],withStylesTransform:!!l}}({props:n,stylesCtx:h,themeName:T});return(e,r)=>({className:function({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:c,classes:d,unstyled:u,className:p,rootSelector:h,props:f,stylesCtx:m,withStaticClasses:g,headless:b,transformedStyles:y}){return(0,i.A)(function({theme:e,options:t,unstyled:n}){return(0,i.A)(t?.focusable&&!n&&(e.focusClassName||l[e.focusRing]),t?.active&&!n&&e.activeClassName)}({theme:e,options:t,unstyled:u||b}),function({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(e=>(0,s.J)({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:o})?.[n])}({theme:e,themeName:n,selector:r,props:f,stylesCtx:m}),function({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}({options:t,classes:d,selector:r,unstyled:u}),a({selector:r,stylesCtx:m,theme:e,classNames:c,props:f}),a({selector:r,stylesCtx:m,theme:e,classNames:y,props:f}),function({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return(0,s.J)({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}({selector:r,stylesCtx:m,options:t,props:f,theme:e}),function({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}({rootSelector:h,selector:r,className:p}),function({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}({selector:r,classes:d,unstyled:u||b}),g&&!b&&function({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return!1===r?[]:e.map(e=>`${t}-${e}-${n}`)}({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}({theme:C,options:r,themeName:T,selector:e,classNamesPrefix:S,classNames:y,classes:t,unstyled:b,className:f,rootSelector:g,props:n,stylesCtx:h,withStaticClasses:E,headless:M,transformedStyles:I([r?.styles,v])}),style:function({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:l,styles:s,style:a,vars:p,varsResolver:h,headless:f,withStylesTransform:m}){return{...!m&&function({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(t=>(0,c.N)({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[o]).reduce((e,t)=>({...e,...t}),{})}({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!m&&(0,c.N)({theme:e,styles:s,props:o,stylesCtx:i})[n],...!m&&(0,c.N)({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:i})[n],...function({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:l,headless:s}){return[s?{}:t?.(n,r,o),...l.map(e=>n.components?.[e]?.vars?.(n,r,o)),e?.(n,r,o)].reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...(0,u.J)(t[n])}}),e),{})?.[i]}({theme:e,props:o,stylesCtx:i,vars:p,varsResolver:h,selector:n,themeName:t,headless:f}),...l===n?d({style:a,theme:e}):null,...d({style:r?.style,theme:e})}}({theme:C,themeName:T,selector:e,options:r,props:n,stylesCtx:h,rootSelector:g,styles:v,style:m,vars:k,varsResolver:w,headless:M,withStylesTransform:A}),...x?.[e]})}},76290:(e,t,n)=>{n.d(t,{_g:()=>r});let r=Date.now},76291:(e,t,n)=>{n.r(t),n.d(t,{a:()=>k,c:()=>g,i:()=>x,n:()=>S,o:()=>v,r:()=>C,s:()=>m,t:()=>E});var r,o=n(35416),i=n(2109),l=n(12115),s=n(13096),a=n(9683),c=n(37366),d=n(95155),u=n(30821);async function p(){return r||(r=(async()=>{let[e,t]=await Promise.all([n.e(4758).then(n.bind(n,69850)),n.e(234).then(n.t.bind(n,21263,17))]),r
17="default"in e?e.default:e,o="default"in t?t.default:t;return await r.init({data:o}),{emojiMart:r,emojiData:o}})())}function h(e){let t=(0,l.useRef)(null),n=(0,l.useRef)(null);return n.current&&n.current.update(e),(0,l.useEffect)(()=>((async()=>{let{emojiMart:r}=await p();n.current=new r.Picker({...e,ref:t})})(),()=>{n.current=null}),[]),l.createElement("div",{ref:t})}var f=e=>{let[t,n]=(0,l.useState)(!1),r=(0,i.l)(),o=(0,i.g)(),s=o.editor?.portalElement;if(!s)throw Error("Portal root not found");return(0,d.jsxs)(r.Generic.Popover.Root,{open:t,portalRoot:s,children:[(0,d.jsx)(r.Generic.Popover.Trigger,{children:(0,d.jsx)("div",{onClick:r=>{r.preventDefault(),r.stopPropagation(),n(!t),e.onOpenChange?.(!t)},style:{display:"flex",justifyContent:"center",alignItems:"center"},children:e.children})}),(0,d.jsx)(r.Generic.Popover.Content,{className:"bn-emoji-picker-popover",variant:"panel-popover",children:(0,d.jsx)(h,{perLine:7,onClickOutside:()=>{n(!1),e.onOpenChange?.(!1)},onEmojiSelect:t=>{e.onEmojiSelect(t),n(!1),e.onOpenChange?.(!1)},theme:o?.colorSchemePreference})})]})};function m(e){return g([e]).get(e)}function g(e){let t=(0,i.f)(s.KI).userStore,n=(0,l.useCallback)(()=>{let n=new Map;for(let r of e){let e=t.getUser(r);e&&n.set(r,e)}return n},[t,e]),r=(0,l.useMemo)(()=>({current:n()}),[n]);return(0,l.useSyncExternalStore)((0,l.useCallback)(o=>{let i=t.subscribe(e=>{r.current=n(),o()});return t.loadUsers(e),i},[t,n,e,r]),()=>r.current)}var b=e=>{let t=(0,i.l)(),n=(0,i.s)(),r=(0,i.f)(s.KI),o=e.comment.reactions.find(t=>t.emoji===e.emoji);if(!o)throw Error("Trying to render reaction badge for non-existing reaction");let[a,u]=(0,l.useState)([]),p=g(a);return(0,d.jsx)(t.Generic.Badge.Root,{className:(0,c.Rn)("bn-badge","bn-comment-reaction"),text:o.userIds.length.toString(),icon:o.emoji,isSelected:r.threadStore.auth.canDeleteReaction(e.comment,o.emoji),onClick:()=>e.onReactionSelect(o.emoji),onMouseEnter:()=>u(o.userIds),mainTooltip:n.comments.reactions.reacted_by,secondaryTooltip:`${Array.from(p.values()).map(e=>e.username).join("\n")}`},o.emoji)},y=(0,l.memo)(({isEmpty:e,comment:t,isEditing:n,threadStore:r,onReactionSelect:o,onEditSubmit:i,onEditCancel:l,onEmojiPickerOpenChange:s,Components:a,dict:p})=>{let h=r.auth.canAddReaction(t);return(0,d.jsxs)(d.Fragment,{children:[t.reactions.length>0&&!n&&(0,d.jsxs)(a.Generic.Badge.Group,{className:(0,c.Rn)("bn-badge-group","bn-comment-reactions"),children:[t.reactions.map(e=>(0,d.jsx)(b,{comment:t,emoji:e.emoji,onReactionSelect:o},e.emoji)),h&&(0,d.jsx)(f,{onEmojiSelect:e=>o(e.native),onOpenChange:s,children:(0,d.jsx)(a.Generic.Badge.Root,{className:(0,c.Rn)("bn-badge","bn-comment-add-reaction"),text:"+",icon:(0,d.jsx)(u.TEC,{size:16}),mainTooltip:p.comments.actions.add_reaction})})]}),n&&(0,d.jsxs)(a.Generic.Toolbar.Root,{variant:"action-toolbar",className:(0,c.Rn)("bn-action-toolbar","bn-comment-actions"),children:[(0,d.jsx)(a.Generic.Toolbar.Button,{mainTooltip:p.comments.save_button_text,variant:"compact",onClick:i,isDisabled:e,children:p.comments.save_button_text}),(0,d.jsx)(a.Generic.Toolbar.Button,{className:"bn-button",mainTooltip:p.comments.cancel_button_text,variant:"compact",onClick:l,children:p.comments.cancel_button_text})]})]})}),v=({comment:e,thread:t,showResolveButton:n})=>{let r=(0,i.f)(s.KI),o=(0,i.s)(),a=(0,i.r)({initialContent:e.body,trailingBlock:!1,dictionary:{...o,placeholders:{emptyDocument:o.placeholders.edit_comment}},schema:r.commentEditorSchema||i.t}),p=(0,i.l)(),[h,g]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1),k=r.threadStore,w=(0,l.useCallback)(()=>{g(!0)},[]),x=(0,l.useCallback)(()=>{a.replaceBlocks(a.document,e.body),g(!1)},[a,e.body]),C=(0,l.useCallback)(async n=>{await k.updateComment({commentId:e.id,comment:{body:a.document},threadId:t.id}),g(!1)},[e,t.id,a,k]),S=(0,l.useCallback)(async()=>{await k.deleteComment({commentId:e.id,threadId:t.id})},[e,t.id,k]),E=(0,l.useCallback)(async n=>{k.auth.canAddReaction(e,n)?await k.addReaction({threadId:t.id,commentId:e.id,emoji:n}):k.auth.canDeleteReaction(e,n)&&await k.deleteReaction({threadId:t.id,commentId:e.id,emoji:n})},[k,e,t.id]),M=(0,l.useCallback)(async()=>{await k.resolveThread({threadId:t.id})},[t.id,k]),T=(0,l.useCallback)(async()=>{await k.unresolveThread({threadId:t.id})},[t.id,k]),A=m(e.userId);if(!e.body)return null;let I,N=k.auth.canAddReaction(e),j=k.auth.canDeleteComment(e),P=k.auth.canUpdateComment(e),_=n&&(t.resolved?k.auth.canUnresolveThread(t):k.auth.canResolveThread(t));
17h||(I=(0,d.jsxs)(p.Generic.Toolbar.Root,{className:(0,c.Rn)("bn-action-toolbar","bn-comment-actions"),variant:"action-toolbar",children:[N&&(0,d.jsx)(f,{onEmojiSelect:e=>E(e.native),onOpenChange:v,children:(0,d.jsx)(p.Generic.Toolbar.Button,{mainTooltip:o.comments.actions.add_reaction,variant:"compact",children:(0,d.jsx)(u.TEC,{size:16})},"add-reaction")}),_&&(t.resolved?(0,d.jsx)(p.Generic.Toolbar.Button,{mainTooltip:o.comments.actions.reopen,variant:"compact",onClick:T,children:(0,d.jsx)(u.NGV,{size:16})},"reopen"):(0,d.jsx)(p.Generic.Toolbar.Button,{mainTooltip:o.comments.actions.resolve,variant:"compact",onClick:M,children:(0,d.jsx)(u.hm8,{size:16})},"resolve")),(j||P)&&(0,d.jsxs)(p.Generic.Menu.Root,{position:"bottom-start",children:[(0,d.jsx)(p.Generic.Menu.Trigger,{children:(0,d.jsx)(p.Generic.Toolbar.Button,{mainTooltip:o.comments.actions.more_actions,variant:"compact",children:(0,d.jsx)(u.QXe,{size:16})},"more-actions")}),(0,d.jsxs)(p.Generic.Menu.Dropdown,{className:"bn-menu-dropdown",children:[P&&(0,d.jsx)(p.Generic.Menu.Item,{icon:(0,d.jsx)(u.VM$,{}),onClick:w,children:o.comments.actions.edit_comment},"edit-comment"),j&&(0,d.jsx)(p.Generic.Menu.Item,{icon:(0,d.jsx)(u.HDo,{}),onClick:S,children:o.comments.actions.delete_comment},"delete-comment")]})]})]}));let B=e.createdAt.toLocaleDateString(void 0,{month:"short",day:"numeric"});if(!e.body)throw Error("soft deletes are not yet supported");return(0,d.jsx)(p.Comments.Comment,{authorInfo:A??"loading",timeString:B,edited:e.updatedAt.getTime()!==e.createdAt.getTime(),showActions:"hover",actions:I,className:"bn-thread-comment",emojiPickerOpen:b,children:(0,d.jsx)(i.n,{autoFocus:h,editor:a,editable:h,actions:e.reactions.length>0||h?({isFocused:t,isEmpty:n})=>(0,d.jsx)(y,{isFocused:t,isEmpty:n,comment:e,isEditing:h,threadStore:k,onReactionSelect:E,onEditSubmit:C,onEditCancel:x,onEmojiPickerOpenChange:v,Components:p,dict:o}):void 0})})},k=({thread:e,maxCommentsBeforeCollapse:t})=>{let n=(0,i.l)(),r=(0,i.s)(),o=g(e.resolvedBy?[e.resolvedBy]:[]),l=e.comments.map((t,n)=>(0,d.jsx)(v,{thread:e,comment:t,showResolveButton:0===n},t.id+JSON.stringify(t.body||"{}")));if(e.resolved&&e.resolvedUpdatedAt&&e.resolvedBy){if(!o.get(e.resolvedBy))throw Error(`User ${e.resolvedBy} resolved thread ${e.id}, but their data could not be found.`);let t=e.comments.findLastIndex(t=>e.resolvedUpdatedAt.getTime()>t.createdAt.getTime())+1;l.splice(t,0,(0,d.jsx)(n.Comments.Comment,{className:"bn-thread-comment",authorInfo:e.resolvedBy&&o.get(e.resolvedBy)||"loading",timeString:e.resolvedUpdatedAt.toLocaleDateString(void 0,{month:"short",day:"numeric"}),edited:!1,showActions:!1,children:(0,d.jsx)("div",{className:"bn-resolved-text",children:r.comments.sidebar.marked_as_resolved})},"resolved-comment"))}return t&&l.length>t&&l.splice(1,l.length-2,(0,d.jsx)(n.Comments.ExpandSectionsPrompt,{className:"bn-thread-expand-prompt",children:r.comments.sidebar.more_replies(e.comments.length-2)},"expand-prompt")),l},w=(0,l.memo)(({isEmpty:e,onNewCommentSave:t,Components:n,dict:r})=>e?null:(0,d.jsx)(n.Generic.Toolbar.Root,{variant:"action-toolbar",className:(0,c.Rn)("bn-action-toolbar","bn-comment-actions"),children:(0,d.jsx)(n.Generic.Toolbar.Button,{mainTooltip:r.comments.save_button_text,variant:"compact",isDisabled:e,onClick:t,children:r.comments.save_button_text})})),x=({thread:e,selected:t,orphaned:n,referenceText:r,maxCommentsBeforeCollapse:o,onFocus:a,onBlur:u,tabIndex:p})=>{let h=(0,i.l)(),f=(0,i.s)(),m=(0,i.f)(s.KI),g=(0,i.r)({trailingBlock:!1,dictionary:{...f,placeholders:{emptyDocument:f.placeholders.comment_reply}},schema:m.commentEditorSchema||i.t}),b=(0,l.useCallback)(async()=>{await m.threadStore.addComment({comment:{body:g.document},threadId:e.id}),g.removeBlocks(g.document)},[m,g,e.id]);return(0,d.jsxs)(h.Comments.Card,{className:(0,c.Rn)("bn-thread",n&&"bn-thread-orphaned"),headerText:r,onFocus:a,onBlur:u,selected:t,tabIndex:p,children:[(0,d.jsx)(h.Comments.CardSection,{className:"bn-thread-comments",children:(0,d.jsx)(k,{thread:e,maxCommentsBeforeCollapse:t?void 0:o||5})}),t&&(0,d.jsx)(h.Comments.CardSection,{className:"bn-thread-composer",children:(0,d.jsx)(i.n,{autoFocus:!1,editable:!0,editor:g,actions:({isFocused:e,isEmpty:t})=>(0,d.jsx)(w,{isFocused:e,isEmpty:t,onNewCommentSave:b,Components:h,dict:f})})})]})};function C(){let e=(0,i.f)(s.KI).threadStore,t=(0,l.useRef)(void 0);return t.current||=e.getThreads(),(0,l.useSyncExternalStore)((0,l.useCallback)(n=>e.subscribe(e=>{t.current=e,n()}),[e]),()=>t.current)}var S=(0,o.t)({default:()=>E});function E(e){let t=(0,i.m)(),n=(0,i.f)(s.KI),r=(0,i.p)(s.KI,{editor:t,selector:e=>e.selectedThreadId?{id:e.selectedThreadId,position:e.threadPositions.get(e.selectedThreadId)}:void 0}),o=C(),c=(0,l.useMemo)(()=>r?o.get(r.id):void 0,[r,o]),u=(0,l.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,o)=>
17{"escape-key"===o&&t.focus(),e||n.selectThread(void 0)},placement:"bottom",middleware:[(0,a.cY)(10),(0,a.BN)(),(0,a.UU)()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:30},...e.floatingUIOptions?.elementProps}}),[n,t,e.floatingUIOptions,r]),p=e.floatingThread||x;return(0,d.jsx)(i.i,{position:r?.position,portalElement:e.portalElement,...u,children:c&&(0,d.jsx)(p,{thread:c,selected:!0})})}},76865:(e,t,n)=>{n.d(t,{$t:()=>C,LN:()=>l,U3:()=>d,hs:()=>T,i5:()=>f,k_:()=>S,nh:()=>p,yn:()=>s});var r=n(27050),o=n(8242);let i=Object.create(null);class l{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new s(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=r.Ji.empty){let n=t.content.lastChild,o=null;for(let e=0;e<t.openEnd;e++)o=n,n=n.lastChild;let i=e.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){let{$from:a,$to:c}=l[s],d=e.mapping.slice(i);e.replaceRange(d.map(a.pos),d.map(c.pos),s?r.Ji.empty:t),0==s&&b(e,i,(n?n.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:l}=r[o],s=e.mapping.slice(n),a=s.map(i.pos),c=s.map(l.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),b(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new d(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}
17static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=i[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in i)throw RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t}getBookmark(){return d.between(this.$anchor,this.$head).getBookmark()}}l.prototype.visible=!0;class s{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function c(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class d extends l{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return l.near(n);let r=e.resolve(t.map(this.anchor));return new d(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof d&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new d(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=l.findFrom(t,n,!0)||l.findFrom(t,-n,!0);if(!e)return l.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(l.findFrom(e,-n,!0)||l.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new d(e,t)}}l.jsonID("text",d);class u{constructor(e,t){this.anchor=e,this.head=t}map(e){return new u(e.map(this.anchor),e.map(this.head))}resolve(e){return d.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends l{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?l.near(o):new p(o)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new h(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}p.prototype.visible=!1,l.jsonID("node",p);class h{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new u(n,n):new h(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):l.near(t)}}class f extends l{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.Ji.empty){if(t==r.Ji.empty){e.delete(0,e.doc.content.size);let t=l.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}l.jsonID("all",f);let m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,o,i=!1){if(t.inlineContent)return d.create(e,n);for(let l=r-(o>0?0:1);o>0?l<t.childCount:l>=0;l+=o){let r=t.child(l);if(r.isAtom){if(!i&&p.isSelectable(r))return p.create(e,n-(o<0?r.nodeSize:0))}else{let t=g(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function b(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let s=e.steps[i];(s instanceof o.Ln||s instanceof o.Wg)&&(e.mapping.maps[i].forEach((e,t,n,o)=>{null==r&&(r=o)}),e.setSelection(l.near(e.doc.resolve(r),n)))}class y extends o.dL{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(l.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function v(e,t){return t&&e?e.bind(t):e}
17class k{constructor(e,t,n){this.name=e,this.init=v(t.init,n),this.apply=v(t.apply,n)}}let w=[new k("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new k("selection",{init:(e,t)=>e.selection||l.atStart(t.doc),apply:e=>e.selection}),new k("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new k("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class x{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=w.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new k(e.key,e.spec.state,e))})}}class C{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let l=this.config.plugins[i];if(l.spec.appendTransaction){let s=r?r[i].n:0,a=r?r[i].state:this,c=s<t.length&&l.spec.appendTransaction.call(l,s?t.slice(s):t,a,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new C(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new y(this)}static create(e){let t=new x(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new C(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new x(this.schema,e.plugins),n=t.fields,r=new C(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let o=new x(e.schema,e.plugins),i=new C(o);return o.fields.forEach(o=>{if("doc"==o.name)i.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=l.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let l=n[r],s=l.spec.state;if(l.key==o.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r)){i[o.name]=s.fromJSON.call(l,e,t[r],i);return}}i[o.name]=o.init(e,i)}}),i}}class S{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.key=e.key?e.key.key:M("plugin")}getState(e){return e[this.key]}}let E=Object.create(null);function M(e){return e in E?e+"$"+ ++E[e]:(E[e]=0,e+"$")}class T{constructor(e="key"){this.key=M(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},79274:(e,t,n)=>{n.d(t,{CW:()=>m,D1:()=>i,D7:()=>a,Dk:()=>r,KD:()=>o,KJ:()=>s,P1:()=>p,V7:()=>d,WD:()=>h,WY:()=>u,vZ:()=>f,wn:()=>l,wt:()=>c});let r=1,o=2,i=4,l=8,s=32,a=64,c=128,d=0x20000000,u=31,p=63,h=127,f=0x7fffffff,m=0xffffffff}
17,79404:(e,t,n)=>{n.d(t,{i:()=>c});var r=n(95155),o=n(12115),i=n(85754);function l(e,t,n,r){return"center"===e||"center"===r?{top:t}:"end"===e?{bottom:n}:"start"===e?{top:n}:{}}function s(e,t,n,r,o){return"center"===e||"center"===r?{left:t}:"end"===e?{["ltr"===o?"right":"left"]:n}:"start"===e?{["ltr"===o?"left":"right"]:n}:{}}let a={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"},c=(0,o.forwardRef)(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:o,arrowPosition:c,visible:d,arrowX:u,arrowY:p,style:h,...f},m)=>{let{dir:g}=(0,i.jH)();return d?(0,r.jsx)("div",{...f,ref:m,style:{...h,...function({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:c,dir:d}){let[u,p="center"]=e.split("-"),h={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[a[u]]:r},f=-t/2;return"left"===u?{...h,...l(p,c,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:"right"===u?{...h,...l(p,c,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:"top"===u?{...h,...s(p,i,n,o,d),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:"bottom"===u?{...h,...s(p,i,n,o,d),top:f,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}({position:e,arrowSize:t,arrowOffset:n,arrowRadius:o,arrowPosition:c,dir:g,arrowX:u,arrowY:p})}}):null});c.displayName="@mantine/core/FloatingArrow"},80702:(e,t,n)=>{n.d(t,{W:()=>l,c:()=>s});var r=n(87443),o=n(19441),i=n(6648);class l{constructor(){this._observers=r.vt()}on(e,t){return r._4(this._observers,e,o.vt).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return i.HT((this._observers.get(e)||r.vt()).values()).forEach(e=>e(...t))}destroy(){this._observers=r.vt()}}class s{constructor(){this._observers=r.vt()}on(e,t){r._4(this._observers,e,o.vt).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return i.HT((this._observers.get(e)||r.vt()).values()).forEach(e=>e(...t))}destroy(){this._observers=r.vt()}}},81038:(e,t,n)=>{n.d(t,{A:()=>r});var r={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"}},84101:(e,t,n)=>{n.d(t,{Px:()=>i,bl:()=>o,pc:()=>l});var r=n(12115);function o(e,t){if("function"==typeof e)return e(t);"object"==typeof e&&null!==e&&"current"in e&&(e.current=t)}function i(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=o(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&"function"==typeof n?n():o(e,null)}),t.clear()}}}function l(...e){return(0,r.useCallback)(i(...e),e)}},84148:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var r,o,i,l=i[o];if(("_owner"!==l||!t.$$typeof)&&!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}},84206:(e,t,n)=>{let r,o,i;n.d(t,{H9:()=>eM,OW:()=>eT});var l=n(87443),s=n(90756),a=n(6648),c=n(1651),d=n(48273),u=n(37766),p=n(33867),h=n(8750),f=n(62261);let m=e=>e.next()>=.5,g=(e,t,n)=>f.RI(e.next()*(n+1-t)+t),b=(e,t,n)=>f.RI(e.next()*(n+1-t)+t),y=e=>(0,h.QV)(b(e,97,122)),v=(e,t)=>
17t[b(e,0,t.length-1)];var k=n(438);let w=Symbol("0schema");class x{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(h.ux(" ",(this._rerrs.length-t)*2)+`${null!=n.path?`[${n.path}] `:""}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join("\n")}}let C=(e,t)=>e===t||null!=e&&null!=t&&e.constructor===t.constructor&&(e[u.B]?u.a(e,t):a.cy(e)?a.Si(e,e=>a.zN(t,t=>C(e,t))):!!s.Gv(e)&&s.Si(e,(e,n)=>C(e,t[n])));class S{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),C(t,n)}equals(e){return this.constructor===e.constructor&&p.vo(this.shape,e.shape)}[w](){return!0}[u.B](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){c.bD()}get nullable(){return er(this,ey)}get optional(){return new R(this)}cast(e){return ex(e,this),e}expect(e){return ex(e,this),e}}class E extends S{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e?.constructor===this.shape&&(null==this._c||this._c(e));return n||t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),n}}let M=(e,t=null)=>new E(e,t);M(E);class T extends S{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return n||t?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),n}}let A=e=>new T(e);M(T);class I extends S{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return n||t?.extend(null,this.shape.join(" | "),e.toString()),n}}let N=(...e)=>new I(e),j=M(I),P=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),_=e=>eh.check(e)?[P(e)]:j.check(e)?e.shape.map(e=>e+""):ep.check(e)?["[+-]?\\d+.?\\d*"]:ef.check(e)?[".*"]:eo.check(e)?e.shape.map(_).flat(1):void c.Mq();class B extends S{constructor(e){super(),this.shape=e,this._r=RegExp("^"+e.map(_).map(e=>`(${e.join("|")})`).join("")+"$")}check(e,t){let n=null!=this._r.exec(e);return n||t?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),n}}M(B);let O=Symbol("optional");class R extends S{constructor(e){super(),this.shape=e}check(e,t){let n=void 0===e||this.shape.check(e);return n||t?.extend(null,"undefined (optional)","()"),n}get[O](){return!0}}let L=M(R);class D extends S{check(e,t){return t?.extend(null,"never",typeof e),!1}}new D,M(D);class $ extends S{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new $(this.shape,!0)}check(e,t){return null==e?(t?.extend(null,"object","null"),!1):s.Si(this.shape,(n,r)=>{let o=this._isPartial&&!s.i5(e,r)||n.check(e[r],t);return o||t?.extend(r.toString(),n.toString(),typeof e[r],"Object property does not match"),o})}}let F=M($),z=A(e=>null!=e&&(e.constructor===Object||null==e.constructor));class H extends S{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return null!=e&&s.Si(e,(n,r)=>{let o=this.shape.keys.check(r,t);return o||t?.extend(r+"","Record",typeof e,o?"Key doesn't match schema":"Value doesn't match value"),o&&this.shape.values.check(n,t)})}}let V=(e,t)=>new H(e,t),U=M(H);class W extends S{constructor(e){super(),this.shape=e}check(e,t){return null!=e&&s.Si(this.shape,(n,r)=>{let o=n.check(e[r],t);return o||t?.extend(r.toString(),"Tuple",typeof n),o})}}M(W);class J extends S{constructor(e){super(),this.shape=1===e.length?e[0]:new en(e)}check(e,t){let n=a.cy(e)&&a.Si(e,e=>this.shape.check(e));return n||t?.extend(null,"Array",""),n}}let G=(...e)=>new J(e),q=M(J),K=A(e=>a.cy(e));class Y extends S{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(null==this._c||this._c(e));return n||t?.extend(null,this.shape.name,e?.constructor.name),n}}M(Y);let Z=((e,t=null)=>new Y(e,t))(S);class X extends S{constructor(e){super(),this.len=e.length-1,this.args=((...e)=>new W(e))(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return n||t?.extend(null,"function",typeof e),n}}let Q=M(X),ee=A(e=>"function"==typeof e);class et extends S{constructor(e){super(),this.shape=e}check(e,t){let n=a.Si(this.shape,n=>n.check(e,t));return n||t?.extend(null,"Intersectinon",typeof e),n}}M(et,e=>e.shape.length>0);class en extends S{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=a.zN(this.shape,n=>n.check(e,t));return t?.extend(null,"Union",typeof e),n}}let er=(...e)=>e.findIndex(e=>eo.check(e))>=0?er(...e.map(e=>ew(e)).map(e=>eo.check(e)?e.shape:[e]).flat(1)):1===e.length?e[0]:new en(e),eo=M(en),ei=()=>!0,el=A(ei),es=M(T,e=>e.shape===ei),ea=A(e=>"bigint"==typeof e),ec=A(e=>e===ea),ed=A(e=>"symbol"==typeof e);A(e=>e===ed);let eu=A(e=>"number"==typeof e),ep=A(e=>e===eu),eh=A(e=>"string"==typeof e),ef=A(e=>e===eh),em=A(e=>"boolean"==typeof e),eg=A(e=>e===em),eb=N(void 0);M(I,e=>1===e.shape.length&&void 0===e.shape[0]),N(void 0);let ey=N(null),ev=M(I,e=>1===e.shape.length&&null===e.shape[0]);M(Uint8Array),M(E,e=>e.shape===Uint8Array);let ek=er(eu,eh,ey,eb,ea,em,ed);r=G(el),o=V(eh,el),i=er(eu,eh,ey,em,r,o),r.shape=i,o.shape.values=i;let ew=e=>{if(Z.check(e))return e;if(z.check(e)){let t={};for(let n in e)t[n]=ew(e[n]);return new $(t)}if(K.check(e))return er(...e.map(ew));if(ek.check(e))return N(e);if(ee.check(e))return M(e);c.Mq()},ex=d.IA?()=>{}:(e,t)=>{let n=new x;if(!t.check(e,n))throw c.vt(`Expected value to be of type ${t.constructor.name}. 18${n.toString()}`)};class eC{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:ew(e),h:t}),this}else(e){return this.if(el,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw c.vt("Unhandled pattern")}}}let eS=new eC(el).if(ep,(e,t)=>g(t,k.YH,k.Is)).if(ef,(e,t)=>((e,t=0,n=20)=>
18{let r=b(e,t,n),o="";for(let t=0;t<r;t++)o+=y(e);return o})(t)).if(eg,(e,t)=>m(t)).if(ec,(e,t)=>BigInt(g(t,k.YH,k.Is))).if(eo,(e,t)=>eE(t,v(t,e.shape))).if(F,(e,t)=>{let n={};for(let r in e.shape){let o=e.shape[r];if(L.check(o)){if(m(t))continue;o=o.shape}n[r]=eS(o,t)}return n}).if(q,(e,t)=>{let n=[],r=b(t,0,42);for(let o=0;o<r;o++)n.push(eE(t,e.shape));return n}).if(j,(e,t)=>v(t,e.shape)).if(ev,(e,t)=>null).if(Q,(e,t)=>{let n=eE(t,e.res);return()=>n}).if(es,(e,t)=>eE(t,v(t,[eu,eh,ey,eb,ea,em,G(eu),V(er("a","b","c"),eu)]))).if(U,(e,t)=>{let n={},r=g(t,0,3);for(let o=0;o<r;o++){let r=eE(t,e.shape.keys),o=eE(t,e.shape.values);n[r]=o}return n}).done(),eE=(e,t)=>eS(ew(t),e),eM="u">typeof document?document:{};A(e=>e.nodeType===ej),"u">typeof DOMParser&&new DOMParser,A(e=>e.nodeType===eA),A(e=>e.nodeType===eI);let eT=e=>l.Tj(e,(e,t)=>`${t}:${e};`).join(""),eA=eM.ELEMENT_NODE,eI=eM.TEXT_NODE;eM.CDATA_SECTION_NODE,eM.COMMENT_NODE;let eN=eM.DOCUMENT_NODE;eM.DOCUMENT_TYPE_NODE;let ej=eM.DOCUMENT_FRAGMENT_NODE;A(e=>e.nodeType===eN)},85754:(e,t,n)=>{n.d(t,{jH:()=>i}),n(95155);var r=n(12115);let o=(0,r.createContext)({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function i(){return(0,r.useContext)(o)}},86161:(e,t,n)=>{n.d(t,{p:()=>D});var r=n(95155),o=n(67413),i=n(12115),l=n(86334),s=n(25168),a=n(65214),c=n(74279),d=n(2371),u=n(97276),p=n(38273),h=n(60744);let[f,m]=(0,h.e)({size:"sm"});var g=n(13494),b=n(69954),y=n(62992);let v=(0,b.P9)((e,t)=>{let n=(0,a.Y)("InputClearButton",null,e),{size:o,variant:i,vars:l,classNames:s,styles:c,...d}=n,u=m(),{resolvedClassNames:p,resolvedStyles:h}=(0,g.Y)({classNames:s,styles:c,props:n});return(0,r.jsx)(y.J,{variant:i||"transparent",ref:t,size:o||u?.size||"sm",classNames:p,styles:h,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...d.style},...d})});v.displayName="@mantine/core/InputClearButton";let k={xs:7,sm:8,md:10,lg:12,xl:15},[w,x]=(0,h.e)({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var C={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};let S=(0,s.V)((e,{size:t})=>({description:{"--input-description-size":void 0===t?void 0:`calc(${(0,l.ny)(t)} - ${(0,o.D)(2)})`}})),E=(0,b.P9)((e,t)=>{let n=(0,a.Y)("InputDescription",null,e),{classNames:o,className:i,style:l,styles:s,unstyled:d,vars:p,size:h,__staticSelector:f,__inheritStyles:m=!0,attributes:g,variant:b,...y}=(0,a.Y)("InputDescription",null,n),v=x(),k=(0,c.I)({name:["InputWrapper",f],props:n,classes:C,className:i,style:l,classNames:o,styles:s,unstyled:d,attributes:g,rootSelector:"description",vars:p,varsResolver:S}),w=m&&v?.getStyles||k;return(0,r.jsx)(u.a,{component:"p",ref:t,variant:b,size:h,...w("description",v?.getStyles?{className:i,style:l}:void 0),...y})});E.classes=C,E.displayName="@mantine/core/InputDescription";let M=(0,s.V)((e,{size:t})=>({error:{"--input-error-size":void 0===t?void 0:`calc(${(0,l.ny)(t)} - ${(0,o.D)(2)})`}})),T=(0,b.P9)((e,t)=>{let n=(0,a.Y)("InputError",null,e),{classNames:o,className:i,style:l,styles:s,unstyled:d,vars:p,size:h,attributes:f,__staticSelector:m,__inheritStyles:g=!0,variant:b,...y}=n,v=(0,c.I)({name:["InputWrapper",m],props:n,classes:C,className:i,style:l,classNames:o,styles:s,unstyled:d,attributes:f,rootSelector:"error",vars:p,varsResolver:M}),k=x(),w=g&&k?.getStyles||v;return(0,r.jsx)(u.a,{component:"p",ref:t,variant:b,size:h,...w("error",k?.getStyles?{className:i,style:l}:void 0),...y})});T.classes=C,T.displayName="@mantine/core/InputError";let A={labelElement:"label"},I=(0,s.V)((e,{size:t})=>({label:{"--input-label-size":(0,l.ny)(t),"--input-asterisk-color":void 0}})),N=(0,b.P9)((e,t)=>{let n=(0,a.Y)("InputLabel",A,e),{classNames:o,className:i,style:l,styles:s,unstyled:d,vars:p,labelElement:h,size:f,required:m,htmlFor:g,onMouseDown:b,children:y,__staticSelector:v,variant:k,mod:w,attributes:S,...E}=(0,a.Y)("InputLabel",A,n),M=(0,c.I)({name:["InputWrapper",v],props:n,classes:C,className:i,style:l,classNames:o,styles:s,unstyled:d,attributes:S,rootSelector:"label",vars:p,varsResolver:I}),T=x(),N=T?.getStyles||M;return(0,r.jsxs)(u.a,{...N("label",T?.getStyles?{className:i,style:l}:void 0),component:h,variant:k,size:f,ref:t,htmlFor:"label"===h?g:void 0,mod:[{required:m},w],onMouseDown:e=>{b?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...E,children:[y,m&&(0,r.jsx)("span",{...N("required"),"aria-hidden":!0,
18children:" *"})]})});N.classes=C,N.displayName="@mantine/core/InputLabel";let j=(0,b.P9)((e,t)=>{let n=(0,a.Y)("InputPlaceholder",null,e),{classNames:o,className:i,style:l,styles:s,unstyled:d,vars:p,__staticSelector:h,variant:f,error:m,mod:g,attributes:b,...y}=n,v=(0,c.I)({name:["InputPlaceholder",h],props:n,classes:C,className:i,style:l,classNames:o,styles:s,unstyled:d,attributes:b,rootSelector:"placeholder"});return(0,r.jsx)(u.a,{...v("placeholder"),mod:[{error:!!m},g],component:"span",variant:f,ref:t,...y})});j.classes=C,j.displayName="@mantine/core/InputPlaceholder";var P=n(45535);let _={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},B=(0,s.V)((e,{size:t})=>({label:{"--input-label-size":(0,l.ny)(t),"--input-asterisk-color":void 0},error:{"--input-error-size":void 0===t?void 0:`calc(${(0,l.ny)(t)} - ${(0,o.D)(2)})`},description:{"--input-description-size":void 0===t?void 0:`calc(${(0,l.ny)(t)} - ${(0,o.D)(2)})`}})),O=(0,b.P9)((e,t)=>{let n=(0,a.Y)("InputWrapper",_,e),{classNames:o,className:l,style:s,styles:d,unstyled:p,vars:h,size:f,variant:m,__staticSelector:g,inputContainer:b,inputWrapperOrder:y,label:v,error:k,description:x,labelProps:S,descriptionProps:M,errorProps:A,labelElement:I,children:j,withAsterisk:O,id:R,required:L,__stylesApiProps:D,mod:$,attributes:F,...z}=n,H=(0,c.I)({name:["InputWrapper",g],props:D||n,classes:C,className:l,style:s,classNames:o,styles:d,unstyled:p,attributes:F,vars:h,varsResolver:B}),V={size:f,variant:m,__staticSelector:g},U=(0,P.B)(R),W=A?.id||`${U}-error`,J=M?.id||`${U}-description`,G=!!k&&"boolean"!=typeof k,q=!!x,K=`${G?W:""} ${q?J:""}`,Y=K.trim().length>0?K.trim():void 0,Z=S?.id||`${U}-label`,X=v&&(0,r.jsx)(N,{labelElement:I,id:Z,htmlFor:U,required:"boolean"==typeof O?O:L,...V,...S,children:v},"label"),Q=q&&(0,r.jsx)(E,{...M,...V,size:M?.size||V.size,id:M?.id||J,children:x},"description"),ee=(0,r.jsx)(i.Fragment,{children:b(j)},"input"),et=G&&(0,i.createElement)(T,{...A,...V,size:A?.size||V.size,key:"error",id:A?.id||W},k),en=y.map(e=>{switch(e){case"label":return X;case"input":return ee;case"description":return Q;case"error":return et;default:return null}});return(0,r.jsx)(w,{value:{getStyles:H,describedBy:Y,inputId:U,labelId:Z,...function(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>"input"===e),o=e.slice(0,r),i=e.slice(r+1),l=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:l}}(y,{hasDescription:q,hasError:G})},children:(0,r.jsx)(u.a,{ref:t,variant:m,size:f,mod:[{error:!!k},$],...H("root"),...z,children:en})})});O.classes=C,O.displayName="@mantine/core/InputWrapper";let R={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},L=(0,s.V)((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":(0,l.YC)(t.size,"input-height"),"--input-fz":(0,l.ny)(t.size),"--input-radius":void 0===t.radius?void 0:(0,l.nJ)(t.radius),"--input-left-section-width":void 0!==t.leftSectionWidth?(0,o.D)(t.leftSectionWidth):void 0,"--input-right-section-width":void 0!==t.rightSectionWidth?(0,o.D)(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?(0,l.YC)(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),D=(0,p.v)((e,t)=>{let n=(0,a.Y)("Input",R,e),{classNames:o,className:i,style:l,styles:s,unstyled:p,required:h,__staticSelector:m,__stylesApiProps:g,size:b,wrapperProps:y,error:v,disabled:w,leftSection:S,leftSectionProps:E,leftSectionWidth:M,rightSection:T,rightSectionProps:A,rightSectionWidth:I,rightSectionPointerEvents:N,leftSectionPointerEvents:j,variant:P,vars:_,pointer:B,multiline:O,radius:D,id:$,withAria:F,withErrorStyles:z,mod:H,inputSize:V,attributes:U,__clearSection:W,__clearable:J,__defaultRightSection:G,...q}=n,{styleProps:K,rest:Y}=(0,d.j)(q),Z=x(),X={offsetBottom:Z?.offsetBottom,offsetTop:Z?.offsetTop},Q=(0,c.I)({name:["Input",m],props:g||n,classes:C,className:i,style:l,classNames:o,styles:s,unstyled:p,attributes:U,stylesCtx:X,rootSelector:"wrapper",vars:_,varsResolver:L}),ee=F?{required:h,disabled:w,"aria-invalid":!!v,"aria-describedby":Z?.describedBy,id:Z?.inputId||$}:{},et=function({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:o,size:i="sm"}){let l=e&&t;return l&&(n||o)?(0,r.jsxs)("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:k[i]},children:[l,n||o]}):null===n?null:n||l||o}({__clearable:J,__clearSection:W,rightSection:T,__defaultRightSection:G,size:b});return(0,r.jsx)(f,{value:{size:b||"sm"},children:(0,r.jsxs)(u.a,{...Q("wrapper"),...K,...y,mod:[{error:!!v&&z,pointer:B,disabled:w,multiline:O,"data-with-right-section":!!et,"data-with-left-section":!!S},H],variant:P,size:b,children:[S&&(0,r.jsx)("div",{...E,"data-position":"left",...Q("section",{className:E?.className,style:E?.style}),children:S}),(0,r.jsx)(u.a,{component:"input",...Y,...ee,ref:t,required:h,mod:{disabled:w,error:!!v&&z},variant:P,__size:V,...Q("input")}
18),et&&(0,r.jsx)("div",{...A,"data-position":"right",...Q("section",{className:A?.className,style:A?.style}),children:et})]})})});D.classes=C,D.Wrapper=O,D.Label=N,D.Error=T,D.Description=E,D.Placeholder=j,D.ClearButton=v,D.displayName="@mantine/core/Input"},86334:(e,t,n)=>{n.d(t,{GY:()=>l,YC:()=>i,dh:()=>d,ks:()=>c,nJ:()=>s,ny:()=>a});var r=n(91654),o=n(67413);function i(e,t="size",n=!0){if(void 0!==e)return(0,r.t)(e)?n?(0,o.D)(e):e:`var(--${t}-${e})`}function l(e){return i(e,"mantine-spacing")}function s(e){return void 0===e?"var(--mantine-radius-default)":i(e,"mantine-radius")}function a(e){return i(e,"mantine-font-size")}function c(e){return i(e,"mantine-line-height",!1)}function d(e){if(e)return i(e,"mantine-shadow",!1)}},86530:(e,t,n)=>{n.d(t,{H:()=>r});function r(e){return Object.keys(e)}},87443:(e,t,n)=>{n.d(t,{C:()=>o,Tj:()=>l,_4:()=>i,bz:()=>s,vt:()=>r});let r=()=>new Map,o=e=>{let t=r();return e.forEach((e,n)=>{t.set(n,e)}),t},i=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},l=(e,t)=>{let n=[];for(let[r,o]of e)n.push(t(o,r));return n},s=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}},87691:(e,t,n)=>{n.d(t,{Q:()=>r});function r(e,t){if("rtl"===e&&(t.includes("right")||t.includes("left"))){let[e,n]=t.split("-"),r="right"===e?"left":"right";return void 0===n?r:`${r}-${n}`}return t}},89042:(e,t,n)=>{n.d(t,{g:()=>r});function r(e,t){return"number"==typeof e.primaryShade?e.primaryShade:"dark"===t?e.primaryShade.dark:e.primaryShade.light}},90756:(e,t,n)=>{n.d(t,{Ej:()=>a,Gv:()=>o,HP:()=>l,Im:()=>c,SQ:()=>p,Si:()=>d,i5:()=>u,jJ:()=>s,kp:()=>i,ol:()=>f});var r=n(37766);let o=e=>"object"==typeof e,i=Object.assign,l=Object.keys,s=(e,t)=>{for(let n in e)t(e[n],n)},a=e=>l(e).length,c=e=>{for(let t in e)return!1;return!0},d=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p=(e,t)=>e===t||a(e)===a(t)&&d(e,(e,n)=>(void 0!==e||u(t,n))&&r.a(t[n],e)),h=Object.freeze,f=e=>{for(let t in e){let n=e[t];("object"==typeof n||"function"==typeof n)&&f(e[t])}return h(e)}},91654:(e,t,n)=>{n.d(t,{t:()=>r});function r(e){if("number"==typeof e)return!0;if("string"==typeof e){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&""!==e.trim())return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}}
18,92248:(e,t,n)=>{n.d(t,{J:()=>r});function r(e){return Object.keys(e).reduce((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t),{})}},93643:(e,t,n)=>{n.d(t,{v:()=>S});var r=n(95155),o=n(12115),i=n(48219),l=n(84101),s=n(67413);let a=()=>{};var c=n(65214),d=n(97276),u=n(69954),p=n(79404),h=n(22323),f=n(67740),m=n(74279),g={root:"m_515a97f8"};let b=(0,u.P9)((e,t)=>{let n=(0,c.Y)("VisuallyHidden",null,e),{classNames:o,className:i,style:l,styles:s,unstyled:a,vars:u,attributes:p,...h}=n,f=(0,m.I)({name:"VisuallyHidden",classes:g,props:n,className:i,style:l,classNames:o,styles:s,unstyled:a,attributes:p});return(0,r.jsx)(d.a,{component:"span",ref:t,...f("root"),...h})});function y({children:e,active:t=!0,refProp:n="ref",innerRef:r}){let i=(0,h.r)(t),s=(0,l.pc)(i,r),a=(0,f.D)(e);return a?(0,o.cloneElement)(a,{[n]:s}):e}function v(e){return(0,r.jsx)(b,{tabIndex:-1,"data-autofocus":!0,...e})}b.classes=g,b.displayName="@mantine/core/VisuallyHidden",y.displayName="@mantine/core/FocusTrap",v.displayName="@mantine/core/FocusTrapInitialFocus",y.InitialFocus=v;var k=n(54169),w=n(95923),x=n(38356),C=n(81038);let S=(0,u.P9)((e,t)=>{let n=(0,c.Y)("PopoverDropdown",null,e),{className:u,style:h,vars:f,children:m,onKeyDownCapture:g,variant:b,classNames:v,styles:C,...S}=n,E=(0,x.C)(),M=function({opened:e,shouldReturnFocus:t=!0}){let n=(0,o.useRef)(null),r=()=>{n.current&&"focus"in n.current&&"function"==typeof n.current.focus&&n.current?.focus({preventScroll:!0})};return(0,i.C)(()=>{let o=-1,i=e=>{"Tab"===e.key&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}({opened:E.opened,shouldReturnFocus:E.returnFocus}),T=E.withRoles?{"aria-labelledby":E.getTargetId(),id:E.getDropdownId(),role:"dialog",tabIndex:-1}:{},A=(0,l.pc)(t,E.floating);return E.disabled?null:(0,r.jsx)(k.r,{...E.portalProps,withinPortal:E.withinPortal,children:(0,r.jsx)(w.e,{mounted:E.opened,...E.transitionProps,transition:E.transitionProps?.transition||"fade",duration:E.transitionProps?.duration??150,keepMounted:E.keepMounted,exitDuration:"number"==typeof E.transitionProps?.exitDuration?E.transitionProps.exitDuration:E.transitionProps?.duration,children:e=>(0,r.jsx)(y,{active:E.trapFocus&&E.opened,innerRef:A,children:(0,r.jsxs)(d.a,{...T,...S,variant:b,onKeyDownCapture:function(e,t={active:!0}){return"function"==typeof e&&t.active?n=>{"Escape"===n.key&&(e(n),t.onTrigger?.())}:t.onKeyDown||a}(()=>{E.onClose?.(),E.onDismiss?.()},{active:E.closeOnEscape,onTrigger:M,onKeyDown:g}),"data-position":E.placement,"data-fixed":"fixed"===E.floatingStrategy||void 0,...E.getStyles("dropdown",{className:u,props:n,classNames:v,styles:C,style:[{...e,zIndex:E.zIndex,top:E.y??0,left:E.x??0,width:"target"===E.width?void 0:(0,s.D)(E.width),...E.referenceHidden?{display:"none"}:null},E.resolvedStyles.dropdown,C?.dropdown,h]}),children:[m,(0,r.jsx)(p.i,{ref:E.arrowRef,arrowX:E.arrowX,arrowY:E.arrowY,visible:E.withArrow,position:E.placement,arrowSize:E.arrowSize,arrowRadius:E.arrowRadius,arrowOffset:E.arrowOffset,arrowPosition:E.arrowPosition,...E.getStyles("arrow",{props:n,classNames:v,styles:C})})]})})})})});S.classes=C.A,S.displayName="@mantine/core/PopoverDropdown"},94577:(e,t,n)=>{e.exports=n(99617)},95923:(e,t,n)=>{n.d(t,{e:()=>p});var r=n(95155),o=n(12115),i=n(66629);let l=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${"bottom"===e?10:-10}px)`},transitionProperty:"transform, opacity"}),s={fade:{in:{opacity:1},out:{opacity:0}
18,transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...l("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...l("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...l("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...l("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...l("top"),common:{transformOrigin:"top right"}}},a={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};var c=n(47650),d=n(48219),u=n(12255);function p({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:l=n,mounted:h,children:f,timingFunction:m="ease",onExit:g,onEntered:b,onEnter:y,onExited:v,enterDelay:k,exitDelay:w}){let x=(0,i.bv)(),{transitionDuration:C,transitionStatus:S,transitionTimingFunction:E}=function({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:l,onEntered:s,onExited:a,enterDelay:p,exitDelay:h}){let f=(0,u.xd)(),m=function(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,o.useState)(n?t:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,o.useEffect)(()=>{try{let n=window.matchMedia(e);i(n.matches);var t=e=>i(e.matches);try{return n.addEventListener("change",t),()=>n.removeEventListener("change",t)}catch(e){return n.addListener(t),()=>n.removeListener(t)}}catch(e){return}},[e]),r||!1}("(prefers-reduced-motion: reduce)",void 0,void 0),g=!!f.respectReducedMotion&&m,[b,y]=(0,o.useState)(g?0:e),[v,k]=(0,o.useState)(r?"entered":"exited"),w=(0,o.useRef)(-1),x=(0,o.useRef)(-1),C=(0,o.useRef)(-1);function S(){window.clearTimeout(w.current),window.clearTimeout(x.current),cancelAnimationFrame(C.current)}let E=n=>{S();let r=n?i:l,o=n?s:a,d=g?0:n?e:t;y(d),0===d?("function"==typeof r&&r(),"function"==typeof o&&o(),k(n?"entered":"exited")):C.current=requestAnimationFrame(()=>{c.flushSync(()=>{k(n?"pre-entering":"pre-exiting")}),C.current=requestAnimationFrame(()=>{"function"==typeof r&&r(),k(n?"entering":"exiting"),w.current=window.setTimeout(()=>{"function"==typeof o&&o(),k(n?"entered":"exited")},d)})})};return(0,d.C)(()=>{(S(),"number"!=typeof(r?p:h))?E(r):x.current=window.setTimeout(()=>{E(r)},r?p:h)},[r]),(0,o.useEffect)(()=>()=>{S()},[]),{transitionDuration:b,transitionStatus:v,transitionTimingFunction:n||"ease"}}({mounted:h,exitDuration:l,duration:n,timingFunction:m,onExit:g,onEntered:b,onEnter:y,onExited:v,enterDelay:k,exitDelay:w});return 0===C||"test"===x?h?(0,r.jsx)(r.Fragment,{children:f({})}):e?f({display:"none"}):null:"exited"===S?e?f({display:"none"}):null:(0,r.jsx)(r.Fragment,{children:f(function({transition:e,state:t,duration:n,timingFunction:r}){let o={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return"string"==typeof e?e in s?{transitionProperty:s[e].transitionProperty,...o,...s[e].common,...s[e][a[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[a[t]]}}({transition:t,duration:C,state:S,timingFunction:E}))})}p.displayName="@mantine/core/Transition"},97144:(e,t,n)=>{n.d(t,{$f:()=>N,G2:()=>v,I$:()=>S,Im:()=>P,Qv:()=>a,Sd:()=>b,Z1:()=>E,_G:()=>d,_e:()=>h,bh:()=>k,eB:()=>c,eT:()=>g,ec:()=>j,hy:()=>T,iz:()=>M,pC:()=>x,yY:()=>w,y_:()=>_});var r=n(8242),o=n(27050),i=n(76865);let l=(e,t)=>
18!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function s(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let a=(e,t,n)=>{let l=s(e,n);if(!l)return!1;let a=f(l);if(!a){let n=l.blockRange(),o=n&&(0,r.jP)(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let c=a.nodeBefore;if(A(e,a,t,-1))return!0;if(0==l.parent.content.size&&(p(c,"end")||i.nh.isSelectable(c)))for(let n=l.depth;;n--){let s=(0,r.$L)(e.doc,l.before(n),l.after(n),o.Ji.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(p(c,"end")?i.LN.findFrom(n.doc.resolve(n.mapping.map(a.pos,-1)),-1):i.nh.create(n.doc,a.pos-c.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||l.node(n-1).childCount>1)break}return!!c.isAtom&&a.depth==l.depth-1&&(t&&t(e.tr.delete(a.pos-c.nodeSize,a.pos).scrollIntoView()),!0)},c=(e,t,n)=>{let r=s(e,n);if(!r)return!1;let o=f(r);return!!o&&u(e,o,t)},d=(e,t,n)=>{let r=m(e,n);if(!r)return!1;let o=y(r);return!!o&&u(e,o,t)};function u(e,t,n){let l=t.nodeBefore,s=t.pos-1;for(;!l.isTextblock;s--){if(l.type.spec.isolating)return!1;let e=l.lastChild;if(!e)return!1;l=e}let a=t.nodeAfter,c=t.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let d=(0,r.$L)(e.doc,s,c,o.Ji.empty);if(!d||d.from!=s||d instanceof r.Ln&&d.slice.size>=c-s)return!1;if(n){let t=e.tr.step(d);t.setSelection(i.U3.create(t.doc,s)),n(t.scrollIntoView())}return!0}function p(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let h=(e,t,n)=>{let{$head:r,empty:o}=e.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;l=f(r)}let s=l&&l.nodeBefore;return!!s&&!!i.nh.isSelectable(s)&&(t&&t(e.tr.setSelection(i.nh.create(e.doc,l.pos-s.nodeSize)).scrollIntoView()),!0)};function f(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function m(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let g=(e,t,n)=>{let l=m(e,n);if(!l)return!1;let s=y(l);if(!s)return!1;let a=s.nodeAfter;if(A(e,s,t,1))return!0;if(0==l.parent.content.size&&(p(a,"start")||i.nh.isSelectable(a))){let n=(0,r.$L)(e.doc,l.before(),l.after(),o.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(p(a,"start")?i.LN.findFrom(r.doc.resolve(r.mapping.map(s.pos)),1):i.nh.create(r.doc,r.mapping.map(s.pos))),t(r.scrollIntoView())}return!0}}return!!a.isAtom&&s.depth==l.depth-1&&(t&&t(e.tr.delete(s.pos,s.pos+a.nodeSize).scrollIntoView()),!0)},b=(e,t,n)=>{let{$head:r,empty:o}=e.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;l=y(r)}let s=l&&l.nodeAfter;return!!s&&!!i.nh.isSelectable(s)&&(t&&t(e.tr.setSelection(i.nh.create(e.doc,l.pos)).scrollIntoView()),!0)};function y(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let v=(e,t)=>{let n=e.selection,o=n instanceof i.nh,l;if(o){if(n.node.isTextblock||!(0,r.n9)(e.doc,n.from))return!1;l=n.from}else if(null==(l=(0,r.N0)(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(l);o&&n.setSelection(i.nh.create(n.doc,l-e.doc.resolve(l).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},k=(e,t)=>{let n=e.selection,o;if(n instanceof i.nh){if(n.node.isTextblock||!(0,r.n9)(e.doc,n.to))return!1;o=n.to}else if(null==(o=(0,r.N0)(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(o).scrollIntoView()),!0},w=(e,t)=>{let{$from:n,$to:o}=e.selection,i=n.blockRange(o),l=i&&(0,r.jP)(i);return null!=l&&(t&&t(e.tr.lift(i,l).scrollIntoView()),!0)},x=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function C(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let S=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),l=n.indexAfter(-1),s=C(o.contentMatchAt(l));if(!s||!o.canReplaceWith(l,l,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(i.LN.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},E=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof i.i5||r.parent.inlineContent||o.parent.inlineContent)return!1;let l=C(o.parent.contentMatchAt(o.indexAfter()));if(!l||!l.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,l.createAndFill());s.setSelection(i.U3.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},M=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if((0,r.zy)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let o=n.blockRange(),i=o&&(0,r.jP)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},T=(e,t)=>
18{let{$from:n,to:r}=e.selection,o,l=n.sharedDepth(r);return 0!=l&&(o=n.before(l),t&&t(e.tr.setSelection(i.nh.create(e.doc,o))),!0)};function A(e,t,n,l){let s,a,c,d=t.nodeBefore,u=t.nodeAfter,h,f,m=d.type.spec.isolating||u.type.spec.isolating;if(!m&&(s=t.nodeBefore,a=t.nodeAfter,c=t.index(),s&&a&&s.type.compatibleContent(a.type)&&(!s.content.size&&t.parent.canReplace(c-1,c)?(n&&n(e.tr.delete(t.pos-s.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(c,c+1)&&!!(a.isTextblock||(0,r.n9)(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let g=!m&&t.parent.canReplace(t.index(),t.index()+1);if(g&&(h=(f=d.contentMatchAt(d.childCount)).findWrapping(u.type))&&f.matchType(h[0]||u.type).validEnd){if(n){let i=t.pos+u.nodeSize,l=o.FK.empty;for(let e=h.length-1;e>=0;e--)l=o.FK.from(h[e].create(null,l));l=o.FK.from(d.copy(l));let s=e.tr.step(new r.Wg(t.pos-1,i,t.pos,i,new o.Ji(l,1,0),h.length,!0)),a=s.doc.resolve(i+2*h.length);a.nodeAfter&&a.nodeAfter.type==d.type&&(0,r.n9)(s.doc,a.pos)&&s.join(a.pos),n(s.scrollIntoView())}return!0}let b=u.type.spec.isolating||l>0&&m?null:i.LN.findFrom(t,1),y=b&&b.$from.blockRange(b.$to),v=y&&(0,r.jP)(y);if(null!=v&&v>=t.depth)return n&&n(e.tr.lift(y,v).scrollIntoView()),!0;if(g&&p(u,"start",!0)&&p(d,"end")){let i=d,l=[];for(;l.push(i),!i.isTextblock;)i=i.lastChild;let s=u,a=1;for(;!s.isTextblock;s=s.firstChild)a++;if(i.canReplace(i.childCount,i.childCount,s.content)){if(n){let i=o.FK.empty;for(let e=l.length-1;e>=0;e--)i=o.FK.from(l[e].copy(i));n(e.tr.step(new r.Wg(t.pos-l.length,t.pos+u.nodeSize,t.pos+a,t.pos+u.nodeSize-a,new o.Ji(i,l.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function I(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,l=o.depth;for(;o.node(l).isInline;){if(!l)return!1;l--}return!!o.node(l).isTextblock&&(n&&n(t.tr.setSelection(i.U3.create(t.doc,e<0?o.start(l):o.end(l)))),!0)}}let N=I(-1),j=I(1);function P(e,t=null){return function(n,o){let{$from:i,$to:l}=n.selection,s=i.blockRange(l),a=s&&(0,r.oM)(s,e,t);return!!a&&(o&&o(n.tr.wrap(s,a).scrollIntoView()),!0)}}function _(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[r];n.doc.nodesBetween(i,l,(r,i)=>{if(o)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[r];o.setBlockType(i,l,e,t)}r(o.scrollIntoView())}return!0}}function B(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let O=B(l,a,h),R=B(l,g,b),L={Enter:B(x,E,M,(e,t)=>{let{$from:n,$to:o}=e.selection;if(e.selection instanceof i.nh&&e.selection.node.isBlock)return!!n.parentOffset&&!!(0,r.zy)(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let l=[],s,a,c=!1,d=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;c=n.end(e)==n.pos+(n.depth-e),d=n.start(e)==n.pos-(n.depth-e),a=C(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));l.unshift(t||(c&&a?{type:a}:null)),s=e;break}if(1==e)return!1;l.unshift(null)}let u=e.tr;(e.selection instanceof i.U3||e.selection instanceof i.i5)&&u.deleteSelection();let p=u.mapping.map(n.pos),h=(0,r.zy)(u.doc,p,l.length,l);if(h||(l[0]=a?{type:a}:null,h=(0,r.zy)(u.doc,p,l.length,l)),!h)return!1;if(u.split(p,l.length,l),!c&&d&&n.node(s).type!=a){let e=u.mapping.map(n.before(s)),t=u.doc.resolve(e);a&&n.node(s-1).canReplaceWith(t.index(),t.index()+1,a)&&u.setNodeMarkup(u.mapping.map(n.before(s)),a)}return t&&t(u.scrollIntoView()),!0}),"Mod-Enter":S,Backspace:O,"Mod-Backspace":O,"Shift-Backspace":O,Delete:R,"Mod-Delete":R,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new i.i5(e.doc))),!0)},D={"Ctrl-h":L.Backspace,"Alt-Backspace":L["Mod-Backspace"],"Ctrl-d":L.Delete,"Ctrl-Alt-Backspace":L["Mod-Delete"],"Alt-Delete":L["Mod-Delete"],"Alt-d":L["Mod-Delete"],"Ctrl-a":N,"Ctrl-e":j};for(let e in L)D[e]=L[e];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform()},97276:(e,t,n)=>{n.d(t,{a:()=>b});var r=n(95155),o=n(12115),i=n(29722),l=n(11455),s=n(91654),a=n(66629),c=n(12255);function d(e){return e.startsWith("data-")?e:`data-${e}`}function u(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...u(n,t)}),{}):"function"==typeof e?e(t):null==e?{}:e}var p=n(2371);let h={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};var f=n(43689),m=n(60572);let g=(0,o.forwardRef)(({component:e,style:t,__vars:n,className:o,variant:g,mod:b,size:y,hiddenFrom:v,visibleFrom
18:k,lightHidden:w,darkHidden:x,renderRoot:C,__size:S,...E},M)=>{let T=(0,c.xd)(),{styleProps:A,rest:I}=(0,p.j)(E),N=(0,a.NL)(),j=N?.()?.(A.sx),P=(0,m.C)(),_=(0,f.X)({styleProps:A,theme:T,data:h}),B={ref:M,style:function({theme:e,style:t,vars:n,styleProps:r}){let o=u(t,e),i=u(n,e);return{...o,...i,...r}}({theme:T,style:t,vars:n,styleProps:_.inlineStyles}),className:(0,i.A)(o,j,{[P]:_.hasResponsiveStyles,"mantine-light-hidden":w,"mantine-dark-hidden":x,[`mantine-hidden-from-${v}`]:v,[`mantine-visible-from-${k}`]:k}),"data-variant":g,"data-size":(0,s.t)(y)?void 0:y||void 0,size:S,...function e(t){return t?"string"==typeof t?{[d(t)]:!0}:Array.isArray(t)?[...t].reduce((t,n)=>({...t,...e(n)}),{}):Object.keys(t).reduce((e,n)=>{let r=t[n];return void 0===r||""===r||!1===r||null===r||(e[d(n)]=t[n]),e},{}):null}(b),...I};return(0,r.jsxs)(r.Fragment,{children:[_.hasResponsiveStyles&&(0,r.jsx)(l.K,{selector:`.${P}`,styles:_.styles,media:_.media}),"function"==typeof C?C(B):(0,r.jsx)(e||"div",{...B})]})});g.displayName="@mantine/core/Box";let b=g},99617:(e,t,n)=>{var r=n(12115),o=n(8039),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=o.useSyncExternalStore,s=r.useRef,a=r.useEffect,c=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var u=s(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;var h=l(e,(u=c(function(){function e(e){if(!a){if(a=!0,l=e,e=r(e),void 0!==o&&p.hasValue){var t=p.value;if(o(t,e))return s=t}return s=e}if(t=s,i(l,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(l=e,t):(l=e,s=n)}var l,s,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]))[0],u[1]);return a(function(){p.hasValue=!0,p.value=h},[h]),d(h),h}},99718:(e,t,n)=>{n.d(t,{r:()=>o});var r=n(51913);function o(e,t){let n=(0,r.g)({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.