@qwanyx/stack 0.2.33 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var Pa=Object.defineProperty;var Oa=(r,e,t)=>e in r?Pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Fr=(r,e,t)=>Oa(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),Ri=require("react-dom");function Ma(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const bs=Ma(w);class $a{constructor(e){Fr(this,"config");Fr(this,"defaultUploadOptions",{maxSizeMB:10,maxImageDimension:0,imageQuality:.9});if(!e.system_id)throw new Error("GraphClient: system_id is REQUIRED. No system_id → No start.");this.config=e}async callGraph(e,t={}){const n={coprocessor:"graph",method:e,system_id:this.config.system_id,params:t};try{const s=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(n)});if(!s.ok){const i=await s.text();throw new Error(`API error (${s.status}): ${i}`)}const o=await s.json();if(!o.success&&o.error)throw new Error(o.error);return o}catch(s){throw console.error("Graph API call failed:",s),s}}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getChildren(e){return(await this.callGraph("get_children",{parent_id:e})).result||[]}async getNode(e){return(await this.callGraph("get_node",{node_id:e})).result||null}async addNode(e){const t={...e,created:e.created||new Date().toISOString(),modified:new Date().toISOString()},n=await this.callGraph("add_node",t);if(!n.result)throw new Error("Failed to add node");return n.result}async updateNode(e,t){const n={node_id:e,updates:{...t,modified:new Date().toISOString()}},s=await this.callGraph("update_node",n);if(!s.result)throw new Error("Failed to update node");return s.result}async deleteNode(e,t=!1){return(await this.callGraph("delete_node",{node_id:e,cascade:t})).success===!0}async getChildrenWithEdges(e,t="children",n,s){return(await this.callGraph("get_children_with_edges",{node_id:e,display_mode:t,edge_type:n,node_type:s})).result||[]}async addEdge(e,t,n="link",s){return await this.callGraph("add_edge",{source_id:e,target_id:t,edge_type:n,data:s})}async deleteEdge(e,t,n){return await this.callGraph("delete_edge",{source_id:e,target_id:t,edge_type:n})}async getEdges(e,t,n){return(await this.callGraph("get_edges",{source_id:e,edge_type:t,target_id:n})).result||[]}async getAncestors(e){return(await this.callGraph("get_ancestors",{node_id:e})).ancestors||[]}async getTree(e,t=10){return(await this.callGraph("get_tree",{root_id:e,max_depth:t})).tree||[]}async moveNode(e,t){const n=await this.callGraph("move",{node_id:e,new_parent_id:t});if(!n.node)throw new Error("Failed to move node");return n.node}async searchNodes(e,t){return(await this.callGraph("search",{query:e,type:t})).nodes||[]}async getNodesByType(e){return(await this.callGraph("get_nodes_by_type",{type:e})).result||[]}fileToBase64(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const i=s.result.split(",")[1];t(i)},s.onerror=()=>n(new Error("Failed to read file")),s.readAsDataURL(e)})}async resizeImage(e,t,n){return e.type.startsWith("image/")?new Promise(s=>{const o=new Image,i=URL.createObjectURL(e);o.onload=()=>{if(URL.revokeObjectURL(i),o.width<=t&&o.height<=t){s(e);return}let l,a;o.width>o.height?(l=t,a=Math.round(o.height/o.width*t)):(a=t,l=Math.round(o.width/o.height*t));const u=document.createElement("canvas");u.width=l,u.height=a;const c=u.getContext("2d");if(!c){s(e);return}c.drawImage(o,0,0,l,a);const d=e.type==="image/png"?"image/png":"image/jpeg";u.toBlob(f=>{if(f){const h=new File([f],e.name,{type:d});s(h)}else s(e)},d,n)},o.onerror=()=>{URL.revokeObjectURL(i),s(e)},o.src=i}):e}async uploadFile(e,t,n,s={}){const o={...this.defaultUploadOptions,...s};try{let i=n;o.maxImageDimension>0&&n.type.startsWith("image/")&&(i=await this.resizeImage(n,o.maxImageDimension,o.imageQuality));const l=o.maxSizeMB*1024*1024;if(i.size>l)return{success:!1,error:`File too large (${(i.size/1024/1024).toFixed(1)} MB). Max: ${o.maxSizeMB} MB`};const a=await this.fileToBase64(i),u=await this.callGraph("upload_file",{node_id:e,filename:t,content:a});return u.success?{success:!0,path:u.path}:{success:!1,error:u.error||"Upload failed"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Upload failed"}}}async listFiles(e){var s;return(((s=(await this.callGraph("list_files",{node_id:e})).result)==null?void 0:s.files)||[]).map(o=>({filename:o.name,path:o.path}))}async deleteFile(e,t){return{success:(await this.callGraph("delete_file",{node_id:e,filename:t})).success||!1}}getFileUrl(e,t){return`${this.config.baseUrl}/files/${this.config.system_id}/${e}/${t}`}}const Cr=new TextEncoder,Pi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir=new Uint8Array(256);for(var vn=0;vn<Pi.length;vn++)Ir[Pi.charCodeAt(vn)]=vn;function Rs(r){let e=Math.ceil(r.length/4)*3;const t=r.length;let n=0;r.length%4===3?e--:r.length%4===2?e-=2:r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const s=new ArrayBuffer(e),o=new Uint8Array(s);for(let i=0;i<t;i+=4){let l=Ir[r.charCodeAt(i)],a=Ir[r.charCodeAt(i+1)],u=Ir[r.charCodeAt(i+2)],c=Ir[r.charCodeAt(i+3)];o[n++]=l<<2|a>>4,o[n++]=(a&15)<<4|u>>2,o[n++]=(u&3)<<6|c&63}return s}function Wr(r){r=r||"utf8";let e;try{e=new TextDecoder(r)}catch{e=new TextDecoder("windows-1252")}return e}async function es(r){if("arrayBuffer"in r)return await r.arrayBuffer();const e=new FileReader;return new Promise((t,n)=>{e.onload=function(s){t(s.target.result)},e.onerror=function(s){n(e.error)},e.readAsArrayBuffer(r)})}function Oi(r){return r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70?String.fromCharCode(r):!1}function Ia(r,e,t){let n=r.indexOf("*");n>=0&&(r=r.substr(0,n)),e=e.toUpperCase();let s;if(e==="Q"){t=t.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=Cr.encode(t),i=[];for(let a=0,u=o.length;a<u;a++){let c=o[a];if(a<=u-2&&c===61){let d=Oi(o[a+1]),f=Oi(o[a+2]);if(d&&f){let h=parseInt(d+f,16);i.push(h),a+=2;continue}}i.push(c)}s=new ArrayBuffer(i.length);let l=new DataView(s);for(let a=0,u=i.length;a<u;a++)l.setUint8(a,i[a])}else e==="B"?s=Rs(t.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=Cr.encode(t);return Wr(r).decode(s)}function Gr(r){let e=!0;for(;;){let t=(r||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,s,o,i,l)=>e&&o===l&&i.length%4===0&&!/=$/.test(i)?s+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,s,o,i)=>e&&o===i?s+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,s,o,i)=>Ia(s,o,i));if(e&&t.indexOf("�")>=0)e=!1;else return t}}function za(r,e){e=e||"utf-8";let t=[];for(let o=0;o<r.length;o++){let i=r.charAt(o);if(i==="%"&&/^[a-f0-9]{2}/i.test(r.substr(o+1,2))){let l=r.substr(o+1,2);o+=2,t.push(parseInt(l,16))}else if(i.charCodeAt(0)>126){i=Cr.encode(i);for(let l=0;l<i.length;l++)t.push(i[l])}else t.push(i.charCodeAt(0))}const n=new ArrayBuffer(t.length),s=new DataView(n);for(let o=0,i=t.length;o<i;o++)s.setUint8(o,t[o]);return Wr(e).decode(n)}function qa(r){let e=new Map;Object.keys(r.params).forEach(t=>{let n=t.match(/\*((\d+)\*?)?$/);if(!n)return;let s=t.substr(0,n.index).toLowerCase(),o=Number(n[2])||0,i;e.has(s)?i=e.get(s):(i={charset:!1,values:[]},e.set(s,i));let l=r.params[t];o===0&&n[0].charAt(n[0].length-1)==="*"&&(n=l.match(/^([^']*)'[^']*'(.*)$/))&&(i.charset=n[1]||"utf-8",l=n[2]),i.values.push({nr:o,value:l}),delete r.params[t]}),e.forEach((t,n)=>{r.params[n]=za(t.values.sort((s,o)=>s.nr-o.nr).map(s=>s.value).join(""),t.charset)})}class Ua{constructor(){this.chunks=[]}update(e){this.chunks.push(e),this.chunks.push(`
2
- `)}finalize(){return es(new Blob(this.chunks,{type:"application/octet-stream"}))}}class Wa{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(e){let t=this.decoder.decode(e);if(/[^a-zA-Z0-9+\/]/.test(t)&&(t=t.replace(/[^a-zA-Z0-9+\/]+/g,"")),this.remainder+=t,this.remainder.length>=this.maxChunkSize){let n=Math.floor(this.remainder.length/4)*4,s;n===this.remainder.length?(s=this.remainder,this.remainder=""):(s=this.remainder.substr(0,n),this.remainder=this.remainder.substr(n)),s.length&&this.chunks.push(Rs(s))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(Rs(this.remainder)),es(new Blob(this.chunks,{type:"application/octet-stream"}))}}const Mi=/^=[a-f0-9]{2}$/i,Ga=/(?==[a-f0-9]{2})/i,Ka=/=\r?\n/g,Va=/=[a-fA-F0-9]?$/;class Ha{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(e){let t=new ArrayBuffer(e.length),n=new DataView(t);for(let s=0,o=e.length;s<o;s++)n.setUint8(s,parseInt(e[s],16));return t}decodeChunks(e){e=e.replace(Ka,"");let t=e.split(Ga),n=[];for(let s of t){if(s.charAt(0)!=="="){n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s);continue}if(s.length===3){Mi.test(s)?n.push(s.substr(1)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s));continue}if(s.length>3){const o=s.substr(0,3);Mi.test(o)?(n.push(s.substr(1,2)),this.chunks.push(this.decodeQPBytes(n)),n=[],s=s.substr(3),this.chunks.push(s)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s))}}n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[])}update(e){let t=this.decoder.decode(e)+`
3
- `;if(t=this.remainder+t,t.length<this.maxChunkSize){this.remainder=t;return}this.remainder="";let n=t.match(Va);if(n){if(n.index===0){this.remainder=t;return}this.remainder=t.substr(n.index),t=t.substr(0,n.index)}this.decodeChunks(t)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),es(new Blob(this.chunks,{type:"application/octet-stream"}))}}class $i{constructor(e){if(this.options=e||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0,this.contentType={value:"text/plain",default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(e){/base64/i.test(e)?this.contentDecoder=new Wa:/quoted-printable/i.test(e)?this.contentDecoder=new Ha({decoder:Wr(this.contentType.parsed.params.charset)}):this.contentDecoder=new Ua}async finalize(){if(this.state==="finished")return;this.state==="header"&&this.processHeaders();let e=this.postalMime.boundaries;for(let t=e.length-1;t>=0;t--)if(e[t].node===this){e.splice(t,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let e of this.childNodes)await e.finalize()}parseStructuredHeader(e){let t={value:!1,params:{}},n=!1,s="",o="value",i=!1,l=!1,a;for(let u=0,c=e.length;u<c;u++)switch(a=e.charAt(u),o){case"key":if(a==="="){n=s.trim().toLowerCase(),o="value",s="";break}s+=a;break;case"value":if(l)s+=a;else if(a==="\\"){l=!0;continue}else i&&a===i?i=!1:!i&&a==='"'?i=a:!i&&a===";"?(n===!1?t.value=s.trim():t.params[n]=s.trim(),o="key",s=""):s+=a;l=!1;break}return s=s.trim(),o==="value"?n===!1?t.value=s:t.params[n]=s:s&&(t.params[s.toLowerCase()]=""),t.value&&(t.value=t.value.toLowerCase()),qa(t),t}decodeFlowedText(e,t){return e.split(/\r?\n/).reduce((n,s)=>/ $/.test(n)&&!/(^|\n)-- $/.test(n)?t?n.slice(0,-1)+s:n+s:n+`
4
- `+s).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=Wr(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(e=this.decodeFlowedText(e,/^yes$/i.test(this.contentType.parsed.params.delsp))),e}processHeaders(){for(let e=this.headerLines.length-1;e>=0;e--){let t=this.headerLines[e];if(e&&/^\s/.test(t))this.headerLines[e-1]+=`
5
- `+t,this.headerLines.splice(e,1);else{t=t.replace(/\s+/g," ");let n=t.indexOf(":"),s=n<0?t.trim():t.substr(0,n).trim(),o=n<0?"":t.substr(n+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:o}),s.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:o,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:o,parsed:{}};break;case"content-disposition":this.contentDisposition={value:o,parsed:{}};break;case"content-id":this.contentId=o;break;case"content-description":this.contentDescription=o;break}}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:Cr.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(e){switch(this.state){case"header":if(!e.length)return this.state="body",this.processHeaders();if(this.headerSize+=e.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(Wr().decode(e));break;case"body":this.contentDecoder.update(e)}}}const Ii={"&AElig":"Æ","&AElig;":"Æ","&AMP":"&","&AMP;":"&","&Aacute":"Á","&Aacute;":"Á","&Abreve;":"Ă","&Acirc":"Â","&Acirc;":"Â","&Acy;":"А","&Afr;":"𝔄","&Agrave":"À","&Agrave;":"À","&Alpha;":"Α","&Amacr;":"Ā","&And;":"⩓","&Aogon;":"Ą","&Aopf;":"𝔸","&ApplyFunction;":"⁡","&Aring":"Å","&Aring;":"Å","&Ascr;":"𝒜","&Assign;":"≔","&Atilde":"Ã","&Atilde;":"Ã","&Auml":"Ä","&Auml;":"Ä","&Backslash;":"∖","&Barv;":"⫧","&Barwed;":"⌆","&Bcy;":"Б","&Because;":"∵","&Bernoullis;":"ℬ","&Beta;":"Β","&Bfr;":"𝔅","&Bopf;":"𝔹","&Breve;":"˘","&Bscr;":"ℬ","&Bumpeq;":"≎","&CHcy;":"Ч","&COPY":"©","&COPY;":"©","&Cacute;":"Ć","&Cap;":"⋒","&CapitalDifferentialD;":"ⅅ","&Cayleys;":"ℭ","&Ccaron;":"Č","&Ccedil":"Ç","&Ccedil;":"Ç","&Ccirc;":"Ĉ","&Cconint;":"∰","&Cdot;":"Ċ","&Cedilla;":"¸","&CenterDot;":"·","&Cfr;":"ℭ","&Chi;":"Χ","&CircleDot;":"⊙","&CircleMinus;":"⊖","&CirclePlus;":"⊕","&CircleTimes;":"⊗","&ClockwiseContourIntegral;":"∲","&CloseCurlyDoubleQuote;":"”","&CloseCurlyQuote;":"’","&Colon;":"∷","&Colone;":"⩴","&Congruent;":"≡","&Conint;":"∯","&ContourIntegral;":"∮","&Copf;":"ℂ","&Coproduct;":"∐","&CounterClockwiseContourIntegral;":"∳","&Cross;":"⨯","&Cscr;":"𝒞","&Cup;":"⋓","&CupCap;":"≍","&DD;":"ⅅ","&DDotrahd;":"⤑","&DJcy;":"Ђ","&DScy;":"Ѕ","&DZcy;":"Џ","&Dagger;":"‡","&Darr;":"↡","&Dashv;":"⫤","&Dcaron;":"Ď","&Dcy;":"Д","&Del;":"∇","&Delta;":"Δ","&Dfr;":"𝔇","&DiacriticalAcute;":"´","&DiacriticalDot;":"˙","&DiacriticalDoubleAcute;":"˝","&DiacriticalGrave;":"`","&DiacriticalTilde;":"˜","&Diamond;":"⋄","&DifferentialD;":"ⅆ","&Dopf;":"𝔻","&Dot;":"¨","&DotDot;":"⃜","&DotEqual;":"≐","&DoubleContourIntegral;":"∯","&DoubleDot;":"¨","&DoubleDownArrow;":"⇓","&DoubleLeftArrow;":"⇐","&DoubleLeftRightArrow;":"⇔","&DoubleLeftTee;":"⫤","&DoubleLongLeftArrow;":"⟸","&DoubleLongLeftRightArrow;":"⟺","&DoubleLongRightArrow;":"⟹","&DoubleRightArrow;":"⇒","&DoubleRightTee;":"⊨","&DoubleUpArrow;":"⇑","&DoubleUpDownArrow;":"⇕","&DoubleVerticalBar;":"∥","&DownArrow;":"↓","&DownArrowBar;":"⤓","&DownArrowUpArrow;":"⇵","&DownBreve;":"̑","&DownLeftRightVector;":"⥐","&DownLeftTeeVector;":"⥞","&DownLeftVector;":"↽","&DownLeftVectorBar;":"⥖","&DownRightTeeVector;":"⥟","&DownRightVector;":"⇁","&DownRightVectorBar;":"⥗","&DownTee;":"⊤","&DownTeeArrow;":"↧","&Downarrow;":"⇓","&Dscr;":"𝒟","&Dstrok;":"Đ","&ENG;":"Ŋ","&ETH":"Ð","&ETH;":"Ð","&Eacute":"É","&Eacute;":"É","&Ecaron;":"Ě","&Ecirc":"Ê","&Ecirc;":"Ê","&Ecy;":"Э","&Edot;":"Ė","&Efr;":"𝔈","&Egrave":"È","&Egrave;":"È","&Element;":"∈","&Emacr;":"Ē","&EmptySmallSquare;":"◻","&EmptyVerySmallSquare;":"▫","&Eogon;":"Ę","&Eopf;":"𝔼","&Epsilon;":"Ε","&Equal;":"⩵","&EqualTilde;":"≂","&Equilibrium;":"⇌","&Escr;":"ℰ","&Esim;":"⩳","&Eta;":"Η","&Euml":"Ë","&Euml;":"Ë","&Exists;":"∃","&ExponentialE;":"ⅇ","&Fcy;":"Ф","&Ffr;":"𝔉","&FilledSmallSquare;":"◼","&FilledVerySmallSquare;":"▪","&Fopf;":"𝔽","&ForAll;":"∀","&Fouriertrf;":"ℱ","&Fscr;":"ℱ","&GJcy;":"Ѓ","&GT":">","&GT;":">","&Gamma;":"Γ","&Gammad;":"Ϝ","&Gbreve;":"Ğ","&Gcedil;":"Ģ","&Gcirc;":"Ĝ","&Gcy;":"Г","&Gdot;":"Ġ","&Gfr;":"𝔊","&Gg;":"⋙","&Gopf;":"𝔾","&GreaterEqual;":"≥","&GreaterEqualLess;":"⋛","&GreaterFullEqual;":"≧","&GreaterGreater;":"⪢","&GreaterLess;":"≷","&GreaterSlantEqual;":"⩾","&GreaterTilde;":"≳","&Gscr;":"𝒢","&Gt;":"≫","&HARDcy;":"Ъ","&Hacek;":"ˇ","&Hat;":"^","&Hcirc;":"Ĥ","&Hfr;":"ℌ","&HilbertSpace;":"ℋ","&Hopf;":"ℍ","&HorizontalLine;":"─","&Hscr;":"ℋ","&Hstrok;":"Ħ","&HumpDownHump;":"≎","&HumpEqual;":"≏","&IEcy;":"Е","&IJlig;":"IJ","&IOcy;":"Ё","&Iacute":"Í","&Iacute;":"Í","&Icirc":"Î","&Icirc;":"Î","&Icy;":"И","&Idot;":"İ","&Ifr;":"ℑ","&Igrave":"Ì","&Igrave;":"Ì","&Im;":"ℑ","&Imacr;":"Ī","&ImaginaryI;":"ⅈ","&Implies;":"⇒","&Int;":"∬","&Integral;":"∫","&Intersection;":"⋂","&InvisibleComma;":"⁣","&InvisibleTimes;":"⁢","&Iogon;":"Į","&Iopf;":"𝕀","&Iota;":"Ι","&Iscr;":"ℐ","&Itilde;":"Ĩ","&Iukcy;":"І","&Iuml":"Ï","&Iuml;":"Ï","&Jcirc;":"Ĵ","&Jcy;":"Й","&Jfr;":"𝔍","&Jopf;":"𝕁","&Jscr;":"𝒥","&Jsercy;":"Ј","&Jukcy;":"Є","&KHcy;":"Х","&KJcy;":"Ќ","&Kappa;":"Κ","&Kcedil;":"Ķ","&Kcy;":"К","&Kfr;":"𝔎","&Kopf;":"𝕂","&Kscr;":"𝒦","&LJcy;":"Љ","&LT":"<","&LT;":"<","&Lacute;":"Ĺ","&Lambda;":"Λ","&Lang;":"⟪","&Laplacetrf;":"ℒ","&Larr;":"↞","&Lcaron;":"Ľ","&Lcedil;":"Ļ","&Lcy;":"Л","&LeftAngleBracket;":"⟨","&LeftArrow;":"←","&LeftArrowBar;":"⇤","&LeftArrowRightArrow;":"⇆","&LeftCeiling;":"⌈","&LeftDoubleBracket;":"⟦","&LeftDownTeeVector;":"⥡","&LeftDownVector;":"⇃","&LeftDownVectorBar;":"⥙","&LeftFloor;":"⌊","&LeftRightArrow;":"↔","&LeftRightVector;":"⥎","&LeftTee;":"⊣","&LeftTeeArrow;":"↤","&LeftTeeVector;":"⥚","&LeftTriangle;":"⊲","&LeftTriangleBar;":"⧏","&LeftTriangleEqual;":"⊴","&LeftUpDownVector;":"⥑","&LeftUpTeeVector;":"⥠","&LeftUpVector;":"↿","&LeftUpVectorBar;":"⥘","&LeftVector;":"↼","&LeftVectorBar;":"⥒","&Leftarrow;":"⇐","&Leftrightarrow;":"⇔","&LessEqualGreater;":"⋚","&LessFullEqual;":"≦","&LessGreater;":"≶","&LessLess;":"⪡","&LessSlantEqual;":"⩽","&LessTilde;":"≲","&Lfr;":"𝔏","&Ll;":"⋘","&Lleftarrow;":"⇚","&Lmidot;":"Ŀ","&LongLeftArrow;":"⟵","&LongLeftRightArrow;":"⟷","&LongRightArrow;":"⟶","&Longleftarrow;":"⟸","&Longleftrightarrow;":"⟺","&Longrightarrow;":"⟹","&Lopf;":"𝕃","&LowerLeftArrow;":"↙","&LowerRightArrow;":"↘","&Lscr;":"ℒ","&Lsh;":"↰","&Lstrok;":"Ł","&Lt;":"≪","&Map;":"⤅","&Mcy;":"М","&MediumSpace;":" ","&Mellintrf;":"ℳ","&Mfr;":"𝔐","&MinusPlus;":"∓","&Mopf;":"𝕄","&Mscr;":"ℳ","&Mu;":"Μ","&NJcy;":"Њ","&Nacute;":"Ń","&Ncaron;":"Ň","&Ncedil;":"Ņ","&Ncy;":"Н","&NegativeMediumSpace;":"​","&NegativeThickSpace;":"​","&NegativeThinSpace;":"​","&NegativeVeryThinSpace;":"​","&NestedGreaterGreater;":"≫","&NestedLessLess;":"≪","&NewLine;":`
6
- `,"&Nfr;":"𝔑","&NoBreak;":"⁠","&NonBreakingSpace;":" ","&Nopf;":"ℕ","&Not;":"⫬","&NotCongruent;":"≢","&NotCupCap;":"≭","&NotDoubleVerticalBar;":"∦","&NotElement;":"∉","&NotEqual;":"≠","&NotEqualTilde;":"≂̸","&NotExists;":"∄","&NotGreater;":"≯","&NotGreaterEqual;":"≱","&NotGreaterFullEqual;":"≧̸","&NotGreaterGreater;":"≫̸","&NotGreaterLess;":"≹","&NotGreaterSlantEqual;":"⩾̸","&NotGreaterTilde;":"≵","&NotHumpDownHump;":"≎̸","&NotHumpEqual;":"≏̸","&NotLeftTriangle;":"⋪","&NotLeftTriangleBar;":"⧏̸","&NotLeftTriangleEqual;":"⋬","&NotLess;":"≮","&NotLessEqual;":"≰","&NotLessGreater;":"≸","&NotLessLess;":"≪̸","&NotLessSlantEqual;":"⩽̸","&NotLessTilde;":"≴","&NotNestedGreaterGreater;":"⪢̸","&NotNestedLessLess;":"⪡̸","&NotPrecedes;":"⊀","&NotPrecedesEqual;":"⪯̸","&NotPrecedesSlantEqual;":"⋠","&NotReverseElement;":"∌","&NotRightTriangle;":"⋫","&NotRightTriangleBar;":"⧐̸","&NotRightTriangleEqual;":"⋭","&NotSquareSubset;":"⊏̸","&NotSquareSubsetEqual;":"⋢","&NotSquareSuperset;":"⊐̸","&NotSquareSupersetEqual;":"⋣","&NotSubset;":"⊂⃒","&NotSubsetEqual;":"⊈","&NotSucceeds;":"⊁","&NotSucceedsEqual;":"⪰̸","&NotSucceedsSlantEqual;":"⋡","&NotSucceedsTilde;":"≿̸","&NotSuperset;":"⊃⃒","&NotSupersetEqual;":"⊉","&NotTilde;":"≁","&NotTildeEqual;":"≄","&NotTildeFullEqual;":"≇","&NotTildeTilde;":"≉","&NotVerticalBar;":"∤","&Nscr;":"𝒩","&Ntilde":"Ñ","&Ntilde;":"Ñ","&Nu;":"Ν","&OElig;":"Œ","&Oacute":"Ó","&Oacute;":"Ó","&Ocirc":"Ô","&Ocirc;":"Ô","&Ocy;":"О","&Odblac;":"Ő","&Ofr;":"𝔒","&Ograve":"Ò","&Ograve;":"Ò","&Omacr;":"Ō","&Omega;":"Ω","&Omicron;":"Ο","&Oopf;":"𝕆","&OpenCurlyDoubleQuote;":"“","&OpenCurlyQuote;":"‘","&Or;":"⩔","&Oscr;":"𝒪","&Oslash":"Ø","&Oslash;":"Ø","&Otilde":"Õ","&Otilde;":"Õ","&Otimes;":"⨷","&Ouml":"Ö","&Ouml;":"Ö","&OverBar;":"‾","&OverBrace;":"⏞","&OverBracket;":"⎴","&OverParenthesis;":"⏜","&PartialD;":"∂","&Pcy;":"П","&Pfr;":"𝔓","&Phi;":"Φ","&Pi;":"Π","&PlusMinus;":"±","&Poincareplane;":"ℌ","&Popf;":"ℙ","&Pr;":"⪻","&Precedes;":"≺","&PrecedesEqual;":"⪯","&PrecedesSlantEqual;":"≼","&PrecedesTilde;":"≾","&Prime;":"″","&Product;":"∏","&Proportion;":"∷","&Proportional;":"∝","&Pscr;":"𝒫","&Psi;":"Ψ","&QUOT":'"',"&QUOT;":'"',"&Qfr;":"𝔔","&Qopf;":"ℚ","&Qscr;":"𝒬","&RBarr;":"⤐","&REG":"®","&REG;":"®","&Racute;":"Ŕ","&Rang;":"⟫","&Rarr;":"↠","&Rarrtl;":"⤖","&Rcaron;":"Ř","&Rcedil;":"Ŗ","&Rcy;":"Р","&Re;":"ℜ","&ReverseElement;":"∋","&ReverseEquilibrium;":"⇋","&ReverseUpEquilibrium;":"⥯","&Rfr;":"ℜ","&Rho;":"Ρ","&RightAngleBracket;":"⟩","&RightArrow;":"→","&RightArrowBar;":"⇥","&RightArrowLeftArrow;":"⇄","&RightCeiling;":"⌉","&RightDoubleBracket;":"⟧","&RightDownTeeVector;":"⥝","&RightDownVector;":"⇂","&RightDownVectorBar;":"⥕","&RightFloor;":"⌋","&RightTee;":"⊢","&RightTeeArrow;":"↦","&RightTeeVector;":"⥛","&RightTriangle;":"⊳","&RightTriangleBar;":"⧐","&RightTriangleEqual;":"⊵","&RightUpDownVector;":"⥏","&RightUpTeeVector;":"⥜","&RightUpVector;":"↾","&RightUpVectorBar;":"⥔","&RightVector;":"⇀","&RightVectorBar;":"⥓","&Rightarrow;":"⇒","&Ropf;":"ℝ","&RoundImplies;":"⥰","&Rrightarrow;":"⇛","&Rscr;":"ℛ","&Rsh;":"↱","&RuleDelayed;":"⧴","&SHCHcy;":"Щ","&SHcy;":"Ш","&SOFTcy;":"Ь","&Sacute;":"Ś","&Sc;":"⪼","&Scaron;":"Š","&Scedil;":"Ş","&Scirc;":"Ŝ","&Scy;":"С","&Sfr;":"𝔖","&ShortDownArrow;":"↓","&ShortLeftArrow;":"←","&ShortRightArrow;":"→","&ShortUpArrow;":"↑","&Sigma;":"Σ","&SmallCircle;":"∘","&Sopf;":"𝕊","&Sqrt;":"√","&Square;":"□","&SquareIntersection;":"⊓","&SquareSubset;":"⊏","&SquareSubsetEqual;":"⊑","&SquareSuperset;":"⊐","&SquareSupersetEqual;":"⊒","&SquareUnion;":"⊔","&Sscr;":"𝒮","&Star;":"⋆","&Sub;":"⋐","&Subset;":"⋐","&SubsetEqual;":"⊆","&Succeeds;":"≻","&SucceedsEqual;":"⪰","&SucceedsSlantEqual;":"≽","&SucceedsTilde;":"≿","&SuchThat;":"∋","&Sum;":"∑","&Sup;":"⋑","&Superset;":"⊃","&SupersetEqual;":"⊇","&Supset;":"⋑","&THORN":"Þ","&THORN;":"Þ","&TRADE;":"™","&TSHcy;":"Ћ","&TScy;":"Ц","&Tab;":" ","&Tau;":"Τ","&Tcaron;":"Ť","&Tcedil;":"Ţ","&Tcy;":"Т","&Tfr;":"𝔗","&Therefore;":"∴","&Theta;":"Θ","&ThickSpace;":"  ","&ThinSpace;":" ","&Tilde;":"∼","&TildeEqual;":"≃","&TildeFullEqual;":"≅","&TildeTilde;":"≈","&Topf;":"𝕋","&TripleDot;":"⃛","&Tscr;":"𝒯","&Tstrok;":"Ŧ","&Uacute":"Ú","&Uacute;":"Ú","&Uarr;":"↟","&Uarrocir;":"⥉","&Ubrcy;":"Ў","&Ubreve;":"Ŭ","&Ucirc":"Û","&Ucirc;":"Û","&Ucy;":"У","&Udblac;":"Ű","&Ufr;":"𝔘","&Ugrave":"Ù","&Ugrave;":"Ù","&Umacr;":"Ū","&UnderBar;":"_","&UnderBrace;":"⏟","&UnderBracket;":"⎵","&UnderParenthesis;":"⏝","&Union;":"⋃","&UnionPlus;":"⊎","&Uogon;":"Ų","&Uopf;":"𝕌","&UpArrow;":"↑","&UpArrowBar;":"⤒","&UpArrowDownArrow;":"⇅","&UpDownArrow;":"↕","&UpEquilibrium;":"⥮","&UpTee;":"⊥","&UpTeeArrow;":"↥","&Uparrow;":"⇑","&Updownarrow;":"⇕","&UpperLeftArrow;":"↖","&UpperRightArrow;":"↗","&Upsi;":"ϒ","&Upsilon;":"Υ","&Uring;":"Ů","&Uscr;":"𝒰","&Utilde;":"Ũ","&Uuml":"Ü","&Uuml;":"Ü","&VDash;":"⊫","&Vbar;":"⫫","&Vcy;":"В","&Vdash;":"⊩","&Vdashl;":"⫦","&Vee;":"⋁","&Verbar;":"‖","&Vert;":"‖","&VerticalBar;":"∣","&VerticalLine;":"|","&VerticalSeparator;":"❘","&VerticalTilde;":"≀","&VeryThinSpace;":" ","&Vfr;":"𝔙","&Vopf;":"𝕍","&Vscr;":"𝒱","&Vvdash;":"⊪","&Wcirc;":"Ŵ","&Wedge;":"⋀","&Wfr;":"𝔚","&Wopf;":"𝕎","&Wscr;":"𝒲","&Xfr;":"𝔛","&Xi;":"Ξ","&Xopf;":"𝕏","&Xscr;":"𝒳","&YAcy;":"Я","&YIcy;":"Ї","&YUcy;":"Ю","&Yacute":"Ý","&Yacute;":"Ý","&Ycirc;":"Ŷ","&Ycy;":"Ы","&Yfr;":"𝔜","&Yopf;":"𝕐","&Yscr;":"𝒴","&Yuml;":"Ÿ","&ZHcy;":"Ж","&Zacute;":"Ź","&Zcaron;":"Ž","&Zcy;":"З","&Zdot;":"Ż","&ZeroWidthSpace;":"​","&Zeta;":"Ζ","&Zfr;":"ℨ","&Zopf;":"ℤ","&Zscr;":"𝒵","&aacute":"á","&aacute;":"á","&abreve;":"ă","&ac;":"∾","&acE;":"∾̳","&acd;":"∿","&acirc":"â","&acirc;":"â","&acute":"´","&acute;":"´","&acy;":"а","&aelig":"æ","&aelig;":"æ","&af;":"⁡","&afr;":"𝔞","&agrave":"à","&agrave;":"à","&alefsym;":"ℵ","&aleph;":"ℵ","&alpha;":"α","&amacr;":"ā","&amalg;":"⨿","&amp":"&","&amp;":"&","&and;":"∧","&andand;":"⩕","&andd;":"⩜","&andslope;":"⩘","&andv;":"⩚","&ang;":"∠","&ange;":"⦤","&angle;":"∠","&angmsd;":"∡","&angmsdaa;":"⦨","&angmsdab;":"⦩","&angmsdac;":"⦪","&angmsdad;":"⦫","&angmsdae;":"⦬","&angmsdaf;":"⦭","&angmsdag;":"⦮","&angmsdah;":"⦯","&angrt;":"∟","&angrtvb;":"⊾","&angrtvbd;":"⦝","&angsph;":"∢","&angst;":"Å","&angzarr;":"⍼","&aogon;":"ą","&aopf;":"𝕒","&ap;":"≈","&apE;":"⩰","&apacir;":"⩯","&ape;":"≊","&apid;":"≋","&apos;":"'","&approx;":"≈","&approxeq;":"≊","&aring":"å","&aring;":"å","&ascr;":"𝒶","&ast;":"*","&asymp;":"≈","&asympeq;":"≍","&atilde":"ã","&atilde;":"ã","&auml":"ä","&auml;":"ä","&awconint;":"∳","&awint;":"⨑","&bNot;":"⫭","&backcong;":"≌","&backepsilon;":"϶","&backprime;":"‵","&backsim;":"∽","&backsimeq;":"⋍","&barvee;":"⊽","&barwed;":"⌅","&barwedge;":"⌅","&bbrk;":"⎵","&bbrktbrk;":"⎶","&bcong;":"≌","&bcy;":"б","&bdquo;":"„","&becaus;":"∵","&because;":"∵","&bemptyv;":"⦰","&bepsi;":"϶","&bernou;":"ℬ","&beta;":"β","&beth;":"ℶ","&between;":"≬","&bfr;":"𝔟","&bigcap;":"⋂","&bigcirc;":"◯","&bigcup;":"⋃","&bigodot;":"⨀","&bigoplus;":"⨁","&bigotimes;":"⨂","&bigsqcup;":"⨆","&bigstar;":"★","&bigtriangledown;":"▽","&bigtriangleup;":"△","&biguplus;":"⨄","&bigvee;":"⋁","&bigwedge;":"⋀","&bkarow;":"⤍","&blacklozenge;":"⧫","&blacksquare;":"▪","&blacktriangle;":"▴","&blacktriangledown;":"▾","&blacktriangleleft;":"◂","&blacktriangleright;":"▸","&blank;":"␣","&blk12;":"▒","&blk14;":"░","&blk34;":"▓","&block;":"█","&bne;":"=⃥","&bnequiv;":"≡⃥","&bnot;":"⌐","&bopf;":"𝕓","&bot;":"⊥","&bottom;":"⊥","&bowtie;":"⋈","&boxDL;":"╗","&boxDR;":"╔","&boxDl;":"╖","&boxDr;":"╓","&boxH;":"═","&boxHD;":"╦","&boxHU;":"╩","&boxHd;":"╤","&boxHu;":"╧","&boxUL;":"╝","&boxUR;":"╚","&boxUl;":"╜","&boxUr;":"╙","&boxV;":"║","&boxVH;":"╬","&boxVL;":"╣","&boxVR;":"╠","&boxVh;":"╫","&boxVl;":"╢","&boxVr;":"╟","&boxbox;":"⧉","&boxdL;":"╕","&boxdR;":"╒","&boxdl;":"┐","&boxdr;":"┌","&boxh;":"─","&boxhD;":"╥","&boxhU;":"╨","&boxhd;":"┬","&boxhu;":"┴","&boxminus;":"⊟","&boxplus;":"⊞","&boxtimes;":"⊠","&boxuL;":"╛","&boxuR;":"╘","&boxul;":"┘","&boxur;":"└","&boxv;":"│","&boxvH;":"╪","&boxvL;":"╡","&boxvR;":"╞","&boxvh;":"┼","&boxvl;":"┤","&boxvr;":"├","&bprime;":"‵","&breve;":"˘","&brvbar":"¦","&brvbar;":"¦","&bscr;":"𝒷","&bsemi;":"⁏","&bsim;":"∽","&bsime;":"⋍","&bsol;":"\\","&bsolb;":"⧅","&bsolhsub;":"⟈","&bull;":"•","&bullet;":"•","&bump;":"≎","&bumpE;":"⪮","&bumpe;":"≏","&bumpeq;":"≏","&cacute;":"ć","&cap;":"∩","&capand;":"⩄","&capbrcup;":"⩉","&capcap;":"⩋","&capcup;":"⩇","&capdot;":"⩀","&caps;":"∩︀","&caret;":"⁁","&caron;":"ˇ","&ccaps;":"⩍","&ccaron;":"č","&ccedil":"ç","&ccedil;":"ç","&ccirc;":"ĉ","&ccups;":"⩌","&ccupssm;":"⩐","&cdot;":"ċ","&cedil":"¸","&cedil;":"¸","&cemptyv;":"⦲","&cent":"¢","&cent;":"¢","&centerdot;":"·","&cfr;":"𝔠","&chcy;":"ч","&check;":"✓","&checkmark;":"✓","&chi;":"χ","&cir;":"○","&cirE;":"⧃","&circ;":"ˆ","&circeq;":"≗","&circlearrowleft;":"↺","&circlearrowright;":"↻","&circledR;":"®","&circledS;":"Ⓢ","&circledast;":"⊛","&circledcirc;":"⊚","&circleddash;":"⊝","&cire;":"≗","&cirfnint;":"⨐","&cirmid;":"⫯","&cirscir;":"⧂","&clubs;":"♣","&clubsuit;":"♣","&colon;":":","&colone;":"≔","&coloneq;":"≔","&comma;":",","&commat;":"@","&comp;":"∁","&compfn;":"∘","&complement;":"∁","&complexes;":"ℂ","&cong;":"≅","&congdot;":"⩭","&conint;":"∮","&copf;":"𝕔","&coprod;":"∐","&copy":"©","&copy;":"©","&copysr;":"℗","&crarr;":"↵","&cross;":"✗","&cscr;":"𝒸","&csub;":"⫏","&csube;":"⫑","&csup;":"⫐","&csupe;":"⫒","&ctdot;":"⋯","&cudarrl;":"⤸","&cudarrr;":"⤵","&cuepr;":"⋞","&cuesc;":"⋟","&cularr;":"↶","&cularrp;":"⤽","&cup;":"∪","&cupbrcap;":"⩈","&cupcap;":"⩆","&cupcup;":"⩊","&cupdot;":"⊍","&cupor;":"⩅","&cups;":"∪︀","&curarr;":"↷","&curarrm;":"⤼","&curlyeqprec;":"⋞","&curlyeqsucc;":"⋟","&curlyvee;":"⋎","&curlywedge;":"⋏","&curren":"¤","&curren;":"¤","&curvearrowleft;":"↶","&curvearrowright;":"↷","&cuvee;":"⋎","&cuwed;":"⋏","&cwconint;":"∲","&cwint;":"∱","&cylcty;":"⌭","&dArr;":"⇓","&dHar;":"⥥","&dagger;":"†","&daleth;":"ℸ","&darr;":"↓","&dash;":"‐","&dashv;":"⊣","&dbkarow;":"⤏","&dblac;":"˝","&dcaron;":"ď","&dcy;":"д","&dd;":"ⅆ","&ddagger;":"‡","&ddarr;":"⇊","&ddotseq;":"⩷","&deg":"°","&deg;":"°","&delta;":"δ","&demptyv;":"⦱","&dfisht;":"⥿","&dfr;":"𝔡","&dharl;":"⇃","&dharr;":"⇂","&diam;":"⋄","&diamond;":"⋄","&diamondsuit;":"♦","&diams;":"♦","&die;":"¨","&digamma;":"ϝ","&disin;":"⋲","&div;":"÷","&divide":"÷","&divide;":"÷","&divideontimes;":"⋇","&divonx;":"⋇","&djcy;":"ђ","&dlcorn;":"⌞","&dlcrop;":"⌍","&dollar;":"$","&dopf;":"𝕕","&dot;":"˙","&doteq;":"≐","&doteqdot;":"≑","&dotminus;":"∸","&dotplus;":"∔","&dotsquare;":"⊡","&doublebarwedge;":"⌆","&downarrow;":"↓","&downdownarrows;":"⇊","&downharpoonleft;":"⇃","&downharpoonright;":"⇂","&drbkarow;":"⤐","&drcorn;":"⌟","&drcrop;":"⌌","&dscr;":"𝒹","&dscy;":"ѕ","&dsol;":"⧶","&dstrok;":"đ","&dtdot;":"⋱","&dtri;":"▿","&dtrif;":"▾","&duarr;":"⇵","&duhar;":"⥯","&dwangle;":"⦦","&dzcy;":"џ","&dzigrarr;":"⟿","&eDDot;":"⩷","&eDot;":"≑","&eacute":"é","&eacute;":"é","&easter;":"⩮","&ecaron;":"ě","&ecir;":"≖","&ecirc":"ê","&ecirc;":"ê","&ecolon;":"≕","&ecy;":"э","&edot;":"ė","&ee;":"ⅇ","&efDot;":"≒","&efr;":"𝔢","&eg;":"⪚","&egrave":"è","&egrave;":"è","&egs;":"⪖","&egsdot;":"⪘","&el;":"⪙","&elinters;":"⏧","&ell;":"ℓ","&els;":"⪕","&elsdot;":"⪗","&emacr;":"ē","&empty;":"∅","&emptyset;":"∅","&emptyv;":"∅","&emsp13;":" ","&emsp14;":" ","&emsp;":" ","&eng;":"ŋ","&ensp;":" ","&eogon;":"ę","&eopf;":"𝕖","&epar;":"⋕","&eparsl;":"⧣","&eplus;":"⩱","&epsi;":"ε","&epsilon;":"ε","&epsiv;":"ϵ","&eqcirc;":"≖","&eqcolon;":"≕","&eqsim;":"≂","&eqslantgtr;":"⪖","&eqslantless;":"⪕","&equals;":"=","&equest;":"≟","&equiv;":"≡","&equivDD;":"⩸","&eqvparsl;":"⧥","&erDot;":"≓","&erarr;":"⥱","&escr;":"ℯ","&esdot;":"≐","&esim;":"≂","&eta;":"η","&eth":"ð","&eth;":"ð","&euml":"ë","&euml;":"ë","&euro;":"€","&excl;":"!","&exist;":"∃","&expectation;":"ℰ","&exponentiale;":"ⅇ","&fallingdotseq;":"≒","&fcy;":"ф","&female;":"♀","&ffilig;":"ffi","&fflig;":"ff","&ffllig;":"ffl","&ffr;":"𝔣","&filig;":"fi","&fjlig;":"fj","&flat;":"♭","&fllig;":"fl","&fltns;":"▱","&fnof;":"ƒ","&fopf;":"𝕗","&forall;":"∀","&fork;":"⋔","&forkv;":"⫙","&fpartint;":"⨍","&frac12":"½","&frac12;":"½","&frac13;":"⅓","&frac14":"¼","&frac14;":"¼","&frac15;":"⅕","&frac16;":"⅙","&frac18;":"⅛","&frac23;":"⅔","&frac25;":"⅖","&frac34":"¾","&frac34;":"¾","&frac35;":"⅗","&frac38;":"⅜","&frac45;":"⅘","&frac56;":"⅚","&frac58;":"⅝","&frac78;":"⅞","&frasl;":"⁄","&frown;":"⌢","&fscr;":"𝒻","&gE;":"≧","&gEl;":"⪌","&gacute;":"ǵ","&gamma;":"γ","&gammad;":"ϝ","&gap;":"⪆","&gbreve;":"ğ","&gcirc;":"ĝ","&gcy;":"г","&gdot;":"ġ","&ge;":"≥","&gel;":"⋛","&geq;":"≥","&geqq;":"≧","&geqslant;":"⩾","&ges;":"⩾","&gescc;":"⪩","&gesdot;":"⪀","&gesdoto;":"⪂","&gesdotol;":"⪄","&gesl;":"⋛︀","&gesles;":"⪔","&gfr;":"𝔤","&gg;":"≫","&ggg;":"⋙","&gimel;":"ℷ","&gjcy;":"ѓ","&gl;":"≷","&glE;":"⪒","&gla;":"⪥","&glj;":"⪤","&gnE;":"≩","&gnap;":"⪊","&gnapprox;":"⪊","&gne;":"⪈","&gneq;":"⪈","&gneqq;":"≩","&gnsim;":"⋧","&gopf;":"𝕘","&grave;":"`","&gscr;":"ℊ","&gsim;":"≳","&gsime;":"⪎","&gsiml;":"⪐","&gt":">","&gt;":">","&gtcc;":"⪧","&gtcir;":"⩺","&gtdot;":"⋗","&gtlPar;":"⦕","&gtquest;":"⩼","&gtrapprox;":"⪆","&gtrarr;":"⥸","&gtrdot;":"⋗","&gtreqless;":"⋛","&gtreqqless;":"⪌","&gtrless;":"≷","&gtrsim;":"≳","&gvertneqq;":"≩︀","&gvnE;":"≩︀","&hArr;":"⇔","&hairsp;":" ","&half;":"½","&hamilt;":"ℋ","&hardcy;":"ъ","&harr;":"↔","&harrcir;":"⥈","&harrw;":"↭","&hbar;":"ℏ","&hcirc;":"ĥ","&hearts;":"♥","&heartsuit;":"♥","&hellip;":"…","&hercon;":"⊹","&hfr;":"𝔥","&hksearow;":"⤥","&hkswarow;":"⤦","&hoarr;":"⇿","&homtht;":"∻","&hookleftarrow;":"↩","&hookrightarrow;":"↪","&hopf;":"𝕙","&horbar;":"―","&hscr;":"𝒽","&hslash;":"ℏ","&hstrok;":"ħ","&hybull;":"⁃","&hyphen;":"‐","&iacute":"í","&iacute;":"í","&ic;":"⁣","&icirc":"î","&icirc;":"î","&icy;":"и","&iecy;":"е","&iexcl":"¡","&iexcl;":"¡","&iff;":"⇔","&ifr;":"𝔦","&igrave":"ì","&igrave;":"ì","&ii;":"ⅈ","&iiiint;":"⨌","&iiint;":"∭","&iinfin;":"⧜","&iiota;":"℩","&ijlig;":"ij","&imacr;":"ī","&image;":"ℑ","&imagline;":"ℐ","&imagpart;":"ℑ","&imath;":"ı","&imof;":"⊷","&imped;":"Ƶ","&in;":"∈","&incare;":"℅","&infin;":"∞","&infintie;":"⧝","&inodot;":"ı","&int;":"∫","&intcal;":"⊺","&integers;":"ℤ","&intercal;":"⊺","&intlarhk;":"⨗","&intprod;":"⨼","&iocy;":"ё","&iogon;":"į","&iopf;":"𝕚","&iota;":"ι","&iprod;":"⨼","&iquest":"¿","&iquest;":"¿","&iscr;":"𝒾","&isin;":"∈","&isinE;":"⋹","&isindot;":"⋵","&isins;":"⋴","&isinsv;":"⋳","&isinv;":"∈","&it;":"⁢","&itilde;":"ĩ","&iukcy;":"і","&iuml":"ï","&iuml;":"ï","&jcirc;":"ĵ","&jcy;":"й","&jfr;":"𝔧","&jmath;":"ȷ","&jopf;":"𝕛","&jscr;":"𝒿","&jsercy;":"ј","&jukcy;":"є","&kappa;":"κ","&kappav;":"ϰ","&kcedil;":"ķ","&kcy;":"к","&kfr;":"𝔨","&kgreen;":"ĸ","&khcy;":"х","&kjcy;":"ќ","&kopf;":"𝕜","&kscr;":"𝓀","&lAarr;":"⇚","&lArr;":"⇐","&lAtail;":"⤛","&lBarr;":"⤎","&lE;":"≦","&lEg;":"⪋","&lHar;":"⥢","&lacute;":"ĺ","&laemptyv;":"⦴","&lagran;":"ℒ","&lambda;":"λ","&lang;":"⟨","&langd;":"⦑","&langle;":"⟨","&lap;":"⪅","&laquo":"«","&laquo;":"«","&larr;":"←","&larrb;":"⇤","&larrbfs;":"⤟","&larrfs;":"⤝","&larrhk;":"↩","&larrlp;":"↫","&larrpl;":"⤹","&larrsim;":"⥳","&larrtl;":"↢","&lat;":"⪫","&latail;":"⤙","&late;":"⪭","&lates;":"⪭︀","&lbarr;":"⤌","&lbbrk;":"❲","&lbrace;":"{","&lbrack;":"[","&lbrke;":"⦋","&lbrksld;":"⦏","&lbrkslu;":"⦍","&lcaron;":"ľ","&lcedil;":"ļ","&lceil;":"⌈","&lcub;":"{","&lcy;":"л","&ldca;":"⤶","&ldquo;":"“","&ldquor;":"„","&ldrdhar;":"⥧","&ldrushar;":"⥋","&ldsh;":"↲","&le;":"≤","&leftarrow;":"←","&leftarrowtail;":"↢","&leftharpoondown;":"↽","&leftharpoonup;":"↼","&leftleftarrows;":"⇇","&leftrightarrow;":"↔","&leftrightarrows;":"⇆","&leftrightharpoons;":"⇋","&leftrightsquigarrow;":"↭","&leftthreetimes;":"⋋","&leg;":"⋚","&leq;":"≤","&leqq;":"≦","&leqslant;":"⩽","&les;":"⩽","&lescc;":"⪨","&lesdot;":"⩿","&lesdoto;":"⪁","&lesdotor;":"⪃","&lesg;":"⋚︀","&lesges;":"⪓","&lessapprox;":"⪅","&lessdot;":"⋖","&lesseqgtr;":"⋚","&lesseqqgtr;":"⪋","&lessgtr;":"≶","&lesssim;":"≲","&lfisht;":"⥼","&lfloor;":"⌊","&lfr;":"𝔩","&lg;":"≶","&lgE;":"⪑","&lhard;":"↽","&lharu;":"↼","&lharul;":"⥪","&lhblk;":"▄","&ljcy;":"љ","&ll;":"≪","&llarr;":"⇇","&llcorner;":"⌞","&llhard;":"⥫","&lltri;":"◺","&lmidot;":"ŀ","&lmoust;":"⎰","&lmoustache;":"⎰","&lnE;":"≨","&lnap;":"⪉","&lnapprox;":"⪉","&lne;":"⪇","&lneq;":"⪇","&lneqq;":"≨","&lnsim;":"⋦","&loang;":"⟬","&loarr;":"⇽","&lobrk;":"⟦","&longleftarrow;":"⟵","&longleftrightarrow;":"⟷","&longmapsto;":"⟼","&longrightarrow;":"⟶","&looparrowleft;":"↫","&looparrowright;":"↬","&lopar;":"⦅","&lopf;":"𝕝","&loplus;":"⨭","&lotimes;":"⨴","&lowast;":"∗","&lowbar;":"_","&loz;":"◊","&lozenge;":"◊","&lozf;":"⧫","&lpar;":"(","&lparlt;":"⦓","&lrarr;":"⇆","&lrcorner;":"⌟","&lrhar;":"⇋","&lrhard;":"⥭","&lrm;":"‎","&lrtri;":"⊿","&lsaquo;":"‹","&lscr;":"𝓁","&lsh;":"↰","&lsim;":"≲","&lsime;":"⪍","&lsimg;":"⪏","&lsqb;":"[","&lsquo;":"‘","&lsquor;":"‚","&lstrok;":"ł","&lt":"<","&lt;":"<","&ltcc;":"⪦","&ltcir;":"⩹","&ltdot;":"⋖","&lthree;":"⋋","&ltimes;":"⋉","&ltlarr;":"⥶","&ltquest;":"⩻","&ltrPar;":"⦖","&ltri;":"◃","&ltrie;":"⊴","&ltrif;":"◂","&lurdshar;":"⥊","&luruhar;":"⥦","&lvertneqq;":"≨︀","&lvnE;":"≨︀","&mDDot;":"∺","&macr":"¯","&macr;":"¯","&male;":"♂","&malt;":"✠","&maltese;":"✠","&map;":"↦","&mapsto;":"↦","&mapstodown;":"↧","&mapstoleft;":"↤","&mapstoup;":"↥","&marker;":"▮","&mcomma;":"⨩","&mcy;":"м","&mdash;":"—","&measuredangle;":"∡","&mfr;":"𝔪","&mho;":"℧","&micro":"µ","&micro;":"µ","&mid;":"∣","&midast;":"*","&midcir;":"⫰","&middot":"·","&middot;":"·","&minus;":"−","&minusb;":"⊟","&minusd;":"∸","&minusdu;":"⨪","&mlcp;":"⫛","&mldr;":"…","&mnplus;":"∓","&models;":"⊧","&mopf;":"𝕞","&mp;":"∓","&mscr;":"𝓂","&mstpos;":"∾","&mu;":"μ","&multimap;":"⊸","&mumap;":"⊸","&nGg;":"⋙̸","&nGt;":"≫⃒","&nGtv;":"≫̸","&nLeftarrow;":"⇍","&nLeftrightarrow;":"⇎","&nLl;":"⋘̸","&nLt;":"≪⃒","&nLtv;":"≪̸","&nRightarrow;":"⇏","&nVDash;":"⊯","&nVdash;":"⊮","&nabla;":"∇","&nacute;":"ń","&nang;":"∠⃒","&nap;":"≉","&napE;":"⩰̸","&napid;":"≋̸","&napos;":"ʼn","&napprox;":"≉","&natur;":"♮","&natural;":"♮","&naturals;":"ℕ","&nbsp":" ","&nbsp;":" ","&nbump;":"≎̸","&nbumpe;":"≏̸","&ncap;":"⩃","&ncaron;":"ň","&ncedil;":"ņ","&ncong;":"≇","&ncongdot;":"⩭̸","&ncup;":"⩂","&ncy;":"н","&ndash;":"–","&ne;":"≠","&neArr;":"⇗","&nearhk;":"⤤","&nearr;":"↗","&nearrow;":"↗","&nedot;":"≐̸","&nequiv;":"≢","&nesear;":"⤨","&nesim;":"≂̸","&nexist;":"∄","&nexists;":"∄","&nfr;":"𝔫","&ngE;":"≧̸","&nge;":"≱","&ngeq;":"≱","&ngeqq;":"≧̸","&ngeqslant;":"⩾̸","&nges;":"⩾̸","&ngsim;":"≵","&ngt;":"≯","&ngtr;":"≯","&nhArr;":"⇎","&nharr;":"↮","&nhpar;":"⫲","&ni;":"∋","&nis;":"⋼","&nisd;":"⋺","&niv;":"∋","&njcy;":"њ","&nlArr;":"⇍","&nlE;":"≦̸","&nlarr;":"↚","&nldr;":"‥","&nle;":"≰","&nleftarrow;":"↚","&nleftrightarrow;":"↮","&nleq;":"≰","&nleqq;":"≦̸","&nleqslant;":"⩽̸","&nles;":"⩽̸","&nless;":"≮","&nlsim;":"≴","&nlt;":"≮","&nltri;":"⋪","&nltrie;":"⋬","&nmid;":"∤","&nopf;":"𝕟","&not":"¬","&not;":"¬","&notin;":"∉","&notinE;":"⋹̸","&notindot;":"⋵̸","&notinva;":"∉","&notinvb;":"⋷","&notinvc;":"⋶","&notni;":"∌","&notniva;":"∌","&notnivb;":"⋾","&notnivc;":"⋽","&npar;":"∦","&nparallel;":"∦","&nparsl;":"⫽⃥","&npart;":"∂̸","&npolint;":"⨔","&npr;":"⊀","&nprcue;":"⋠","&npre;":"⪯̸","&nprec;":"⊀","&npreceq;":"⪯̸","&nrArr;":"⇏","&nrarr;":"↛","&nrarrc;":"⤳̸","&nrarrw;":"↝̸","&nrightarrow;":"↛","&nrtri;":"⋫","&nrtrie;":"⋭","&nsc;":"⊁","&nsccue;":"⋡","&nsce;":"⪰̸","&nscr;":"𝓃","&nshortmid;":"∤","&nshortparallel;":"∦","&nsim;":"≁","&nsime;":"≄","&nsimeq;":"≄","&nsmid;":"∤","&nspar;":"∦","&nsqsube;":"⋢","&nsqsupe;":"⋣","&nsub;":"⊄","&nsubE;":"⫅̸","&nsube;":"⊈","&nsubset;":"⊂⃒","&nsubseteq;":"⊈","&nsubseteqq;":"⫅̸","&nsucc;":"⊁","&nsucceq;":"⪰̸","&nsup;":"⊅","&nsupE;":"⫆̸","&nsupe;":"⊉","&nsupset;":"⊃⃒","&nsupseteq;":"⊉","&nsupseteqq;":"⫆̸","&ntgl;":"≹","&ntilde":"ñ","&ntilde;":"ñ","&ntlg;":"≸","&ntriangleleft;":"⋪","&ntrianglelefteq;":"⋬","&ntriangleright;":"⋫","&ntrianglerighteq;":"⋭","&nu;":"ν","&num;":"#","&numero;":"№","&numsp;":" ","&nvDash;":"⊭","&nvHarr;":"⤄","&nvap;":"≍⃒","&nvdash;":"⊬","&nvge;":"≥⃒","&nvgt;":">⃒","&nvinfin;":"⧞","&nvlArr;":"⤂","&nvle;":"≤⃒","&nvlt;":"<⃒","&nvltrie;":"⊴⃒","&nvrArr;":"⤃","&nvrtrie;":"⊵⃒","&nvsim;":"∼⃒","&nwArr;":"⇖","&nwarhk;":"⤣","&nwarr;":"↖","&nwarrow;":"↖","&nwnear;":"⤧","&oS;":"Ⓢ","&oacute":"ó","&oacute;":"ó","&oast;":"⊛","&ocir;":"⊚","&ocirc":"ô","&ocirc;":"ô","&ocy;":"о","&odash;":"⊝","&odblac;":"ő","&odiv;":"⨸","&odot;":"⊙","&odsold;":"⦼","&oelig;":"œ","&ofcir;":"⦿","&ofr;":"𝔬","&ogon;":"˛","&ograve":"ò","&ograve;":"ò","&ogt;":"⧁","&ohbar;":"⦵","&ohm;":"Ω","&oint;":"∮","&olarr;":"↺","&olcir;":"⦾","&olcross;":"⦻","&oline;":"‾","&olt;":"⧀","&omacr;":"ō","&omega;":"ω","&omicron;":"ο","&omid;":"⦶","&ominus;":"⊖","&oopf;":"𝕠","&opar;":"⦷","&operp;":"⦹","&oplus;":"⊕","&or;":"∨","&orarr;":"↻","&ord;":"⩝","&order;":"ℴ","&orderof;":"ℴ","&ordf":"ª","&ordf;":"ª","&ordm":"º","&ordm;":"º","&origof;":"⊶","&oror;":"⩖","&orslope;":"⩗","&orv;":"⩛","&oscr;":"ℴ","&oslash":"ø","&oslash;":"ø","&osol;":"⊘","&otilde":"õ","&otilde;":"õ","&otimes;":"⊗","&otimesas;":"⨶","&ouml":"ö","&ouml;":"ö","&ovbar;":"⌽","&par;":"∥","&para":"¶","&para;":"¶","&parallel;":"∥","&parsim;":"⫳","&parsl;":"⫽","&part;":"∂","&pcy;":"п","&percnt;":"%","&period;":".","&permil;":"‰","&perp;":"⊥","&pertenk;":"‱","&pfr;":"𝔭","&phi;":"φ","&phiv;":"ϕ","&phmmat;":"ℳ","&phone;":"☎","&pi;":"π","&pitchfork;":"⋔","&piv;":"ϖ","&planck;":"ℏ","&planckh;":"ℎ","&plankv;":"ℏ","&plus;":"+","&plusacir;":"⨣","&plusb;":"⊞","&pluscir;":"⨢","&plusdo;":"∔","&plusdu;":"⨥","&pluse;":"⩲","&plusmn":"±","&plusmn;":"±","&plussim;":"⨦","&plustwo;":"⨧","&pm;":"±","&pointint;":"⨕","&popf;":"𝕡","&pound":"£","&pound;":"£","&pr;":"≺","&prE;":"⪳","&prap;":"⪷","&prcue;":"≼","&pre;":"⪯","&prec;":"≺","&precapprox;":"⪷","&preccurlyeq;":"≼","&preceq;":"⪯","&precnapprox;":"⪹","&precneqq;":"⪵","&precnsim;":"⋨","&precsim;":"≾","&prime;":"′","&primes;":"ℙ","&prnE;":"⪵","&prnap;":"⪹","&prnsim;":"⋨","&prod;":"∏","&profalar;":"⌮","&profline;":"⌒","&profsurf;":"⌓","&prop;":"∝","&propto;":"∝","&prsim;":"≾","&prurel;":"⊰","&pscr;":"𝓅","&psi;":"ψ","&puncsp;":" ","&qfr;":"𝔮","&qint;":"⨌","&qopf;":"𝕢","&qprime;":"⁗","&qscr;":"𝓆","&quaternions;":"ℍ","&quatint;":"⨖","&quest;":"?","&questeq;":"≟","&quot":'"',"&quot;":'"',"&rAarr;":"⇛","&rArr;":"⇒","&rAtail;":"⤜","&rBarr;":"⤏","&rHar;":"⥤","&race;":"∽̱","&racute;":"ŕ","&radic;":"√","&raemptyv;":"⦳","&rang;":"⟩","&rangd;":"⦒","&range;":"⦥","&rangle;":"⟩","&raquo":"»","&raquo;":"»","&rarr;":"→","&rarrap;":"⥵","&rarrb;":"⇥","&rarrbfs;":"⤠","&rarrc;":"⤳","&rarrfs;":"⤞","&rarrhk;":"↪","&rarrlp;":"↬","&rarrpl;":"⥅","&rarrsim;":"⥴","&rarrtl;":"↣","&rarrw;":"↝","&ratail;":"⤚","&ratio;":"∶","&rationals;":"ℚ","&rbarr;":"⤍","&rbbrk;":"❳","&rbrace;":"}","&rbrack;":"]","&rbrke;":"⦌","&rbrksld;":"⦎","&rbrkslu;":"⦐","&rcaron;":"ř","&rcedil;":"ŗ","&rceil;":"⌉","&rcub;":"}","&rcy;":"р","&rdca;":"⤷","&rdldhar;":"⥩","&rdquo;":"”","&rdquor;":"”","&rdsh;":"↳","&real;":"ℜ","&realine;":"ℛ","&realpart;":"ℜ","&reals;":"ℝ","&rect;":"▭","&reg":"®","&reg;":"®","&rfisht;":"⥽","&rfloor;":"⌋","&rfr;":"𝔯","&rhard;":"⇁","&rharu;":"⇀","&rharul;":"⥬","&rho;":"ρ","&rhov;":"ϱ","&rightarrow;":"→","&rightarrowtail;":"↣","&rightharpoondown;":"⇁","&rightharpoonup;":"⇀","&rightleftarrows;":"⇄","&rightleftharpoons;":"⇌","&rightrightarrows;":"⇉","&rightsquigarrow;":"↝","&rightthreetimes;":"⋌","&ring;":"˚","&risingdotseq;":"≓","&rlarr;":"⇄","&rlhar;":"⇌","&rlm;":"‏","&rmoust;":"⎱","&rmoustache;":"⎱","&rnmid;":"⫮","&roang;":"⟭","&roarr;":"⇾","&robrk;":"⟧","&ropar;":"⦆","&ropf;":"𝕣","&roplus;":"⨮","&rotimes;":"⨵","&rpar;":")","&rpargt;":"⦔","&rppolint;":"⨒","&rrarr;":"⇉","&rsaquo;":"›","&rscr;":"𝓇","&rsh;":"↱","&rsqb;":"]","&rsquo;":"’","&rsquor;":"’","&rthree;":"⋌","&rtimes;":"⋊","&rtri;":"▹","&rtrie;":"⊵","&rtrif;":"▸","&rtriltri;":"⧎","&ruluhar;":"⥨","&rx;":"℞","&sacute;":"ś","&sbquo;":"‚","&sc;":"≻","&scE;":"⪴","&scap;":"⪸","&scaron;":"š","&sccue;":"≽","&sce;":"⪰","&scedil;":"ş","&scirc;":"ŝ","&scnE;":"⪶","&scnap;":"⪺","&scnsim;":"⋩","&scpolint;":"⨓","&scsim;":"≿","&scy;":"с","&sdot;":"⋅","&sdotb;":"⊡","&sdote;":"⩦","&seArr;":"⇘","&searhk;":"⤥","&searr;":"↘","&searrow;":"↘","&sect":"§","&sect;":"§","&semi;":";","&seswar;":"⤩","&setminus;":"∖","&setmn;":"∖","&sext;":"✶","&sfr;":"𝔰","&sfrown;":"⌢","&sharp;":"♯","&shchcy;":"щ","&shcy;":"ш","&shortmid;":"∣","&shortparallel;":"∥","&shy":"­","&shy;":"­","&sigma;":"σ","&sigmaf;":"ς","&sigmav;":"ς","&sim;":"∼","&simdot;":"⩪","&sime;":"≃","&simeq;":"≃","&simg;":"⪞","&simgE;":"⪠","&siml;":"⪝","&simlE;":"⪟","&simne;":"≆","&simplus;":"⨤","&simrarr;":"⥲","&slarr;":"←","&smallsetminus;":"∖","&smashp;":"⨳","&smeparsl;":"⧤","&smid;":"∣","&smile;":"⌣","&smt;":"⪪","&smte;":"⪬","&smtes;":"⪬︀","&softcy;":"ь","&sol;":"/","&solb;":"⧄","&solbar;":"⌿","&sopf;":"𝕤","&spades;":"♠","&spadesuit;":"♠","&spar;":"∥","&sqcap;":"⊓","&sqcaps;":"⊓︀","&sqcup;":"⊔","&sqcups;":"⊔︀","&sqsub;":"⊏","&sqsube;":"⊑","&sqsubset;":"⊏","&sqsubseteq;":"⊑","&sqsup;":"⊐","&sqsupe;":"⊒","&sqsupset;":"⊐","&sqsupseteq;":"⊒","&squ;":"□","&square;":"□","&squarf;":"▪","&squf;":"▪","&srarr;":"→","&sscr;":"𝓈","&ssetmn;":"∖","&ssmile;":"⌣","&sstarf;":"⋆","&star;":"☆","&starf;":"★","&straightepsilon;":"ϵ","&straightphi;":"ϕ","&strns;":"¯","&sub;":"⊂","&subE;":"⫅","&subdot;":"⪽","&sube;":"⊆","&subedot;":"⫃","&submult;":"⫁","&subnE;":"⫋","&subne;":"⊊","&subplus;":"⪿","&subrarr;":"⥹","&subset;":"⊂","&subseteq;":"⊆","&subseteqq;":"⫅","&subsetneq;":"⊊","&subsetneqq;":"⫋","&subsim;":"⫇","&subsub;":"⫕","&subsup;":"⫓","&succ;":"≻","&succapprox;":"⪸","&succcurlyeq;":"≽","&succeq;":"⪰","&succnapprox;":"⪺","&succneqq;":"⪶","&succnsim;":"⋩","&succsim;":"≿","&sum;":"∑","&sung;":"♪","&sup1":"¹","&sup1;":"¹","&sup2":"²","&sup2;":"²","&sup3":"³","&sup3;":"³","&sup;":"⊃","&supE;":"⫆","&supdot;":"⪾","&supdsub;":"⫘","&supe;":"⊇","&supedot;":"⫄","&suphsol;":"⟉","&suphsub;":"⫗","&suplarr;":"⥻","&supmult;":"⫂","&supnE;":"⫌","&supne;":"⊋","&supplus;":"⫀","&supset;":"⊃","&supseteq;":"⊇","&supseteqq;":"⫆","&supsetneq;":"⊋","&supsetneqq;":"⫌","&supsim;":"⫈","&supsub;":"⫔","&supsup;":"⫖","&swArr;":"⇙","&swarhk;":"⤦","&swarr;":"↙","&swarrow;":"↙","&swnwar;":"⤪","&szlig":"ß","&szlig;":"ß","&target;":"⌖","&tau;":"τ","&tbrk;":"⎴","&tcaron;":"ť","&tcedil;":"ţ","&tcy;":"т","&tdot;":"⃛","&telrec;":"⌕","&tfr;":"𝔱","&there4;":"∴","&therefore;":"∴","&theta;":"θ","&thetasym;":"ϑ","&thetav;":"ϑ","&thickapprox;":"≈","&thicksim;":"∼","&thinsp;":" ","&thkap;":"≈","&thksim;":"∼","&thorn":"þ","&thorn;":"þ","&tilde;":"˜","&times":"×","&times;":"×","&timesb;":"⊠","&timesbar;":"⨱","&timesd;":"⨰","&tint;":"∭","&toea;":"⤨","&top;":"⊤","&topbot;":"⌶","&topcir;":"⫱","&topf;":"𝕥","&topfork;":"⫚","&tosa;":"⤩","&tprime;":"‴","&trade;":"™","&triangle;":"▵","&triangledown;":"▿","&triangleleft;":"◃","&trianglelefteq;":"⊴","&triangleq;":"≜","&triangleright;":"▹","&trianglerighteq;":"⊵","&tridot;":"◬","&trie;":"≜","&triminus;":"⨺","&triplus;":"⨹","&trisb;":"⧍","&tritime;":"⨻","&trpezium;":"⏢","&tscr;":"𝓉","&tscy;":"ц","&tshcy;":"ћ","&tstrok;":"ŧ","&twixt;":"≬","&twoheadleftarrow;":"↞","&twoheadrightarrow;":"↠","&uArr;":"⇑","&uHar;":"⥣","&uacute":"ú","&uacute;":"ú","&uarr;":"↑","&ubrcy;":"ў","&ubreve;":"ŭ","&ucirc":"û","&ucirc;":"û","&ucy;":"у","&udarr;":"⇅","&udblac;":"ű","&udhar;":"⥮","&ufisht;":"⥾","&ufr;":"𝔲","&ugrave":"ù","&ugrave;":"ù","&uharl;":"↿","&uharr;":"↾","&uhblk;":"▀","&ulcorn;":"⌜","&ulcorner;":"⌜","&ulcrop;":"⌏","&ultri;":"◸","&umacr;":"ū","&uml":"¨","&uml;":"¨","&uogon;":"ų","&uopf;":"𝕦","&uparrow;":"↑","&updownarrow;":"↕","&upharpoonleft;":"↿","&upharpoonright;":"↾","&uplus;":"⊎","&upsi;":"υ","&upsih;":"ϒ","&upsilon;":"υ","&upuparrows;":"⇈","&urcorn;":"⌝","&urcorner;":"⌝","&urcrop;":"⌎","&uring;":"ů","&urtri;":"◹","&uscr;":"𝓊","&utdot;":"⋰","&utilde;":"ũ","&utri;":"▵","&utrif;":"▴","&uuarr;":"⇈","&uuml":"ü","&uuml;":"ü","&uwangle;":"⦧","&vArr;":"⇕","&vBar;":"⫨","&vBarv;":"⫩","&vDash;":"⊨","&vangrt;":"⦜","&varepsilon;":"ϵ","&varkappa;":"ϰ","&varnothing;":"∅","&varphi;":"ϕ","&varpi;":"ϖ","&varpropto;":"∝","&varr;":"↕","&varrho;":"ϱ","&varsigma;":"ς","&varsubsetneq;":"⊊︀","&varsubsetneqq;":"⫋︀","&varsupsetneq;":"⊋︀","&varsupsetneqq;":"⫌︀","&vartheta;":"ϑ","&vartriangleleft;":"⊲","&vartriangleright;":"⊳","&vcy;":"в","&vdash;":"⊢","&vee;":"∨","&veebar;":"⊻","&veeeq;":"≚","&vellip;":"⋮","&verbar;":"|","&vert;":"|","&vfr;":"𝔳","&vltri;":"⊲","&vnsub;":"⊂⃒","&vnsup;":"⊃⃒","&vopf;":"𝕧","&vprop;":"∝","&vrtri;":"⊳","&vscr;":"𝓋","&vsubnE;":"⫋︀","&vsubne;":"⊊︀","&vsupnE;":"⫌︀","&vsupne;":"⊋︀","&vzigzag;":"⦚","&wcirc;":"ŵ","&wedbar;":"⩟","&wedge;":"∧","&wedgeq;":"≙","&weierp;":"℘","&wfr;":"𝔴","&wopf;":"𝕨","&wp;":"℘","&wr;":"≀","&wreath;":"≀","&wscr;":"𝓌","&xcap;":"⋂","&xcirc;":"◯","&xcup;":"⋃","&xdtri;":"▽","&xfr;":"𝔵","&xhArr;":"⟺","&xharr;":"⟷","&xi;":"ξ","&xlArr;":"⟸","&xlarr;":"⟵","&xmap;":"⟼","&xnis;":"⋻","&xodot;":"⨀","&xopf;":"𝕩","&xoplus;":"⨁","&xotime;":"⨂","&xrArr;":"⟹","&xrarr;":"⟶","&xscr;":"𝓍","&xsqcup;":"⨆","&xuplus;":"⨄","&xutri;":"△","&xvee;":"⋁","&xwedge;":"⋀","&yacute":"ý","&yacute;":"ý","&yacy;":"я","&ycirc;":"ŷ","&ycy;":"ы","&yen":"¥","&yen;":"¥","&yfr;":"𝔶","&yicy;":"ї","&yopf;":"𝕪","&yscr;":"𝓎","&yucy;":"ю","&yuml":"ÿ","&yuml;":"ÿ","&zacute;":"ź","&zcaron;":"ž","&zcy;":"з","&zdot;":"ż","&zeetrf;":"ℨ","&zeta;":"ζ","&zfr;":"𝔷","&zhcy;":"ж","&zigrarr;":"⇝","&zopf;":"𝕫","&zscr;":"𝓏","&zwj;":"‍","&zwnj;":"‌"};function Ja(r){return r.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,t)=>{if(typeof Ii[e]=="string")return Ii[e];if(t.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;t.charAt(1)==="x"?n=parseInt(t.substr(2),16):n=parseInt(t.substr(1),10);var s="";return n>=55296&&n<=57343||n>1114111?"�":(n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}function Zt(r){return r.trim().replace(/[<>"'?&]/g,e=>{let t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),"&#x"+t.toUpperCase()+";"})}function Qa(r){return"<div>"+Zt(r).replace(/\n/g,"<br />")+"</div>"}function Ya(r){return r=r.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
1
+ "use strict";var Pa=Object.defineProperty;var Oa=(r,e,t)=>e in r?Pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Lr=(r,e,t)=>Oa(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),Pi=require("react-dom");function Ma(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const _s=Ma(w);class $a{constructor(e){Lr(this,"config");Lr(this,"defaultUploadOptions",{maxSizeMB:10,maxImageDimension:0,imageQuality:.9});if(!e.system_id)throw new Error("GraphClient: system_id is REQUIRED. No system_id → No start.");this.config=e}async callGraph(e,t={}){const n={coprocessor:"graph",method:e,system_id:this.config.system_id,params:t};try{const s=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(n)});if(!s.ok){const i=await s.text();throw new Error(`API error (${s.status}): ${i}`)}const o=await s.json();if(!o.success&&o.error)throw new Error(o.error);return o}catch(s){throw console.error("Graph API call failed:",s),s}}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getChildren(e){return(await this.callGraph("get_children",{parent_id:e})).result||[]}async getNode(e){return(await this.callGraph("get_node",{node_id:e})).result||null}async addNode(e){const t={...e,created:e.created||new Date().toISOString(),modified:new Date().toISOString()},n=await this.callGraph("add_node",t);if(!n.result)throw new Error("Failed to add node");return n.result}async updateNode(e,t){const n={node_id:e,updates:{...t,modified:new Date().toISOString()}},s=await this.callGraph("update_node",n);if(!s.result)throw new Error("Failed to update node");return s.result}async deleteNode(e,t=!1){return(await this.callGraph("delete_node",{node_id:e,cascade:t})).success===!0}async getChildrenWithEdges(e,t="children",n,s){return(await this.callGraph("get_children_with_edges",{node_id:e,display_mode:t,edge_type:n,node_type:s})).result||[]}async addEdge(e,t,n="link",s){return await this.callGraph("add_edge",{source_id:e,target_id:t,edge_type:n,data:s})}async deleteEdge(e,t,n){return await this.callGraph("delete_edge",{source_id:e,target_id:t,edge_type:n})}async getEdges(e,t,n){return(await this.callGraph("get_edges",{source_id:e,edge_type:t,target_id:n})).result||[]}async getAncestors(e){return(await this.callGraph("get_ancestors",{node_id:e})).ancestors||[]}async getTree(e,t=10){return(await this.callGraph("get_tree",{root_id:e,max_depth:t})).tree||[]}async moveNode(e,t){const n=await this.callGraph("move",{node_id:e,new_parent_id:t});if(!n.node)throw new Error("Failed to move node");return n.node}async searchNodes(e,t){return(await this.callGraph("search",{query:e,type:t})).nodes||[]}async getNodesByType(e){return(await this.callGraph("get_nodes_by_type",{type:e})).result||[]}fileToBase64(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const i=s.result.split(",")[1];t(i)},s.onerror=()=>n(new Error("Failed to read file")),s.readAsDataURL(e)})}async resizeImage(e,t,n){return e.type.startsWith("image/")?new Promise(s=>{const o=new Image,i=URL.createObjectURL(e);o.onload=()=>{if(URL.revokeObjectURL(i),o.width<=t&&o.height<=t){s(e);return}let l,a;o.width>o.height?(l=t,a=Math.round(o.height/o.width*t)):(a=t,l=Math.round(o.width/o.height*t));const u=document.createElement("canvas");u.width=l,u.height=a;const c=u.getContext("2d");if(!c){s(e);return}c.drawImage(o,0,0,l,a);const d=e.type==="image/png"?"image/png":"image/jpeg";u.toBlob(f=>{if(f){const h=new File([f],e.name,{type:d});s(h)}else s(e)},d,n)},o.onerror=()=>{URL.revokeObjectURL(i),s(e)},o.src=i}):e}async uploadFile(e,t,n,s={}){const o={...this.defaultUploadOptions,...s};try{let i=n;o.maxImageDimension>0&&n.type.startsWith("image/")&&(i=await this.resizeImage(n,o.maxImageDimension,o.imageQuality));const l=o.maxSizeMB*1024*1024;if(i.size>l)return{success:!1,error:`File too large (${(i.size/1024/1024).toFixed(1)} MB). Max: ${o.maxSizeMB} MB`};const a=await this.fileToBase64(i),u=await this.callGraph("upload_file",{node_id:e,filename:t,content:a});return u.success?{success:!0,path:u.path}:{success:!1,error:u.error||"Upload failed"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Upload failed"}}}async listFiles(e){var s;return(((s=(await this.callGraph("list_files",{node_id:e})).result)==null?void 0:s.files)||[]).map(o=>({filename:o.name,path:o.path}))}async deleteFile(e,t){return{success:(await this.callGraph("delete_file",{node_id:e,filename:t})).success||!1}}getFileUrl(e,t){return`${this.config.baseUrl}/files/${this.config.system_id}/${e}/${t}`}}const Dr=new TextEncoder,Oi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zr=new Uint8Array(256);for(var vn=0;vn<Oi.length;vn++)zr[Oi.charCodeAt(vn)]=vn;function Ps(r){let e=Math.ceil(r.length/4)*3;const t=r.length;let n=0;r.length%4===3?e--:r.length%4===2?e-=2:r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const s=new ArrayBuffer(e),o=new Uint8Array(s);for(let i=0;i<t;i+=4){let l=zr[r.charCodeAt(i)],a=zr[r.charCodeAt(i+1)],u=zr[r.charCodeAt(i+2)],c=zr[r.charCodeAt(i+3)];o[n++]=l<<2|a>>4,o[n++]=(a&15)<<4|u>>2,o[n++]=(u&3)<<6|c&63}return s}function Gr(r){r=r||"utf8";let e;try{e=new TextDecoder(r)}catch{e=new TextDecoder("windows-1252")}return e}async function es(r){if("arrayBuffer"in r)return await r.arrayBuffer();const e=new FileReader;return new Promise((t,n)=>{e.onload=function(s){t(s.target.result)},e.onerror=function(s){n(e.error)},e.readAsArrayBuffer(r)})}function Mi(r){return r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70?String.fromCharCode(r):!1}function Ia(r,e,t){let n=r.indexOf("*");n>=0&&(r=r.substr(0,n)),e=e.toUpperCase();let s;if(e==="Q"){t=t.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=Dr.encode(t),i=[];for(let a=0,u=o.length;a<u;a++){let c=o[a];if(a<=u-2&&c===61){let d=Mi(o[a+1]),f=Mi(o[a+2]);if(d&&f){let h=parseInt(d+f,16);i.push(h),a+=2;continue}}i.push(c)}s=new ArrayBuffer(i.length);let l=new DataView(s);for(let a=0,u=i.length;a<u;a++)l.setUint8(a,i[a])}else e==="B"?s=Ps(t.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):s=Dr.encode(t);return Gr(r).decode(s)}function Kr(r){let e=!0;for(;;){let t=(r||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,s,o,i,l)=>e&&o===l&&i.length%4===0&&!/=$/.test(i)?s+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,s,o,i)=>e&&o===i?s+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,s,o,i)=>Ia(s,o,i));if(e&&t.indexOf("�")>=0)e=!1;else return t}}function za(r,e){e=e||"utf-8";let t=[];for(let o=0;o<r.length;o++){let i=r.charAt(o);if(i==="%"&&/^[a-f0-9]{2}/i.test(r.substr(o+1,2))){let l=r.substr(o+1,2);o+=2,t.push(parseInt(l,16))}else if(i.charCodeAt(0)>126){i=Dr.encode(i);for(let l=0;l<i.length;l++)t.push(i[l])}else t.push(i.charCodeAt(0))}const n=new ArrayBuffer(t.length),s=new DataView(n);for(let o=0,i=t.length;o<i;o++)s.setUint8(o,t[o]);return Gr(e).decode(n)}function qa(r){let e=new Map;Object.keys(r.params).forEach(t=>{let n=t.match(/\*((\d+)\*?)?$/);if(!n)return;let s=t.substr(0,n.index).toLowerCase(),o=Number(n[2])||0,i;e.has(s)?i=e.get(s):(i={charset:!1,values:[]},e.set(s,i));let l=r.params[t];o===0&&n[0].charAt(n[0].length-1)==="*"&&(n=l.match(/^([^']*)'[^']*'(.*)$/))&&(i.charset=n[1]||"utf-8",l=n[2]),i.values.push({nr:o,value:l}),delete r.params[t]}),e.forEach((t,n)=>{r.params[n]=za(t.values.sort((s,o)=>s.nr-o.nr).map(s=>s.value).join(""),t.charset)})}class Ua{constructor(){this.chunks=[]}update(e){this.chunks.push(e),this.chunks.push(`
2
+ `)}finalize(){return es(new Blob(this.chunks,{type:"application/octet-stream"}))}}class Wa{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(e){let t=this.decoder.decode(e);if(/[^a-zA-Z0-9+\/]/.test(t)&&(t=t.replace(/[^a-zA-Z0-9+\/]+/g,"")),this.remainder+=t,this.remainder.length>=this.maxChunkSize){let n=Math.floor(this.remainder.length/4)*4,s;n===this.remainder.length?(s=this.remainder,this.remainder=""):(s=this.remainder.substr(0,n),this.remainder=this.remainder.substr(n)),s.length&&this.chunks.push(Ps(s))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(Ps(this.remainder)),es(new Blob(this.chunks,{type:"application/octet-stream"}))}}const $i=/^=[a-f0-9]{2}$/i,Ga=/(?==[a-f0-9]{2})/i,Ka=/=\r?\n/g,Va=/=[a-fA-F0-9]?$/;class Ha{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(e){let t=new ArrayBuffer(e.length),n=new DataView(t);for(let s=0,o=e.length;s<o;s++)n.setUint8(s,parseInt(e[s],16));return t}decodeChunks(e){e=e.replace(Ka,"");let t=e.split(Ga),n=[];for(let s of t){if(s.charAt(0)!=="="){n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s);continue}if(s.length===3){$i.test(s)?n.push(s.substr(1)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s));continue}if(s.length>3){const o=s.substr(0,3);$i.test(o)?(n.push(s.substr(1,2)),this.chunks.push(this.decodeQPBytes(n)),n=[],s=s.substr(3),this.chunks.push(s)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(s))}}n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[])}update(e){let t=this.decoder.decode(e)+`
3
+ `;if(t=this.remainder+t,t.length<this.maxChunkSize){this.remainder=t;return}this.remainder="";let n=t.match(Va);if(n){if(n.index===0){this.remainder=t;return}this.remainder=t.substr(n.index),t=t.substr(0,n.index)}this.decodeChunks(t)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),es(new Blob(this.chunks,{type:"application/octet-stream"}))}}class Ii{constructor(e){if(this.options=e||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0,this.contentType={value:"text/plain",default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(e){/base64/i.test(e)?this.contentDecoder=new Wa:/quoted-printable/i.test(e)?this.contentDecoder=new Ha({decoder:Gr(this.contentType.parsed.params.charset)}):this.contentDecoder=new Ua}async finalize(){if(this.state==="finished")return;this.state==="header"&&this.processHeaders();let e=this.postalMime.boundaries;for(let t=e.length-1;t>=0;t--)if(e[t].node===this){e.splice(t,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let e of this.childNodes)await e.finalize()}parseStructuredHeader(e){let t={value:!1,params:{}},n=!1,s="",o="value",i=!1,l=!1,a;for(let u=0,c=e.length;u<c;u++)switch(a=e.charAt(u),o){case"key":if(a==="="){n=s.trim().toLowerCase(),o="value",s="";break}s+=a;break;case"value":if(l)s+=a;else if(a==="\\"){l=!0;continue}else i&&a===i?i=!1:!i&&a==='"'?i=a:!i&&a===";"?(n===!1?t.value=s.trim():t.params[n]=s.trim(),o="key",s=""):s+=a;l=!1;break}return s=s.trim(),o==="value"?n===!1?t.value=s:t.params[n]=s:s&&(t.params[s.toLowerCase()]=""),t.value&&(t.value=t.value.toLowerCase()),qa(t),t}decodeFlowedText(e,t){return e.split(/\r?\n/).reduce((n,s)=>/ $/.test(n)&&!/(^|\n)-- $/.test(n)?t?n.slice(0,-1)+s:n+s:n+`
4
+ `+s).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=Gr(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(e=this.decodeFlowedText(e,/^yes$/i.test(this.contentType.parsed.params.delsp))),e}processHeaders(){for(let e=this.headerLines.length-1;e>=0;e--){let t=this.headerLines[e];if(e&&/^\s/.test(t))this.headerLines[e-1]+=`
5
+ `+t,this.headerLines.splice(e,1);else{t=t.replace(/\s+/g," ");let n=t.indexOf(":"),s=n<0?t.trim():t.substr(0,n).trim(),o=n<0?"":t.substr(n+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:o}),s.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:o,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:o,parsed:{}};break;case"content-disposition":this.contentDisposition={value:o,parsed:{}};break;case"content-id":this.contentId=o;break;case"content-description":this.contentDescription=o;break}}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:Dr.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(e){switch(this.state){case"header":if(!e.length)return this.state="body",this.processHeaders();if(this.headerSize+=e.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(Gr().decode(e));break;case"body":this.contentDecoder.update(e)}}}const zi={"&AElig":"Æ","&AElig;":"Æ","&AMP":"&","&AMP;":"&","&Aacute":"Á","&Aacute;":"Á","&Abreve;":"Ă","&Acirc":"Â","&Acirc;":"Â","&Acy;":"А","&Afr;":"𝔄","&Agrave":"À","&Agrave;":"À","&Alpha;":"Α","&Amacr;":"Ā","&And;":"⩓","&Aogon;":"Ą","&Aopf;":"𝔸","&ApplyFunction;":"⁡","&Aring":"Å","&Aring;":"Å","&Ascr;":"𝒜","&Assign;":"≔","&Atilde":"Ã","&Atilde;":"Ã","&Auml":"Ä","&Auml;":"Ä","&Backslash;":"∖","&Barv;":"⫧","&Barwed;":"⌆","&Bcy;":"Б","&Because;":"∵","&Bernoullis;":"ℬ","&Beta;":"Β","&Bfr;":"𝔅","&Bopf;":"𝔹","&Breve;":"˘","&Bscr;":"ℬ","&Bumpeq;":"≎","&CHcy;":"Ч","&COPY":"©","&COPY;":"©","&Cacute;":"Ć","&Cap;":"⋒","&CapitalDifferentialD;":"ⅅ","&Cayleys;":"ℭ","&Ccaron;":"Č","&Ccedil":"Ç","&Ccedil;":"Ç","&Ccirc;":"Ĉ","&Cconint;":"∰","&Cdot;":"Ċ","&Cedilla;":"¸","&CenterDot;":"·","&Cfr;":"ℭ","&Chi;":"Χ","&CircleDot;":"⊙","&CircleMinus;":"⊖","&CirclePlus;":"⊕","&CircleTimes;":"⊗","&ClockwiseContourIntegral;":"∲","&CloseCurlyDoubleQuote;":"”","&CloseCurlyQuote;":"’","&Colon;":"∷","&Colone;":"⩴","&Congruent;":"≡","&Conint;":"∯","&ContourIntegral;":"∮","&Copf;":"ℂ","&Coproduct;":"∐","&CounterClockwiseContourIntegral;":"∳","&Cross;":"⨯","&Cscr;":"𝒞","&Cup;":"⋓","&CupCap;":"≍","&DD;":"ⅅ","&DDotrahd;":"⤑","&DJcy;":"Ђ","&DScy;":"Ѕ","&DZcy;":"Џ","&Dagger;":"‡","&Darr;":"↡","&Dashv;":"⫤","&Dcaron;":"Ď","&Dcy;":"Д","&Del;":"∇","&Delta;":"Δ","&Dfr;":"𝔇","&DiacriticalAcute;":"´","&DiacriticalDot;":"˙","&DiacriticalDoubleAcute;":"˝","&DiacriticalGrave;":"`","&DiacriticalTilde;":"˜","&Diamond;":"⋄","&DifferentialD;":"ⅆ","&Dopf;":"𝔻","&Dot;":"¨","&DotDot;":"⃜","&DotEqual;":"≐","&DoubleContourIntegral;":"∯","&DoubleDot;":"¨","&DoubleDownArrow;":"⇓","&DoubleLeftArrow;":"⇐","&DoubleLeftRightArrow;":"⇔","&DoubleLeftTee;":"⫤","&DoubleLongLeftArrow;":"⟸","&DoubleLongLeftRightArrow;":"⟺","&DoubleLongRightArrow;":"⟹","&DoubleRightArrow;":"⇒","&DoubleRightTee;":"⊨","&DoubleUpArrow;":"⇑","&DoubleUpDownArrow;":"⇕","&DoubleVerticalBar;":"∥","&DownArrow;":"↓","&DownArrowBar;":"⤓","&DownArrowUpArrow;":"⇵","&DownBreve;":"̑","&DownLeftRightVector;":"⥐","&DownLeftTeeVector;":"⥞","&DownLeftVector;":"↽","&DownLeftVectorBar;":"⥖","&DownRightTeeVector;":"⥟","&DownRightVector;":"⇁","&DownRightVectorBar;":"⥗","&DownTee;":"⊤","&DownTeeArrow;":"↧","&Downarrow;":"⇓","&Dscr;":"𝒟","&Dstrok;":"Đ","&ENG;":"Ŋ","&ETH":"Ð","&ETH;":"Ð","&Eacute":"É","&Eacute;":"É","&Ecaron;":"Ě","&Ecirc":"Ê","&Ecirc;":"Ê","&Ecy;":"Э","&Edot;":"Ė","&Efr;":"𝔈","&Egrave":"È","&Egrave;":"È","&Element;":"∈","&Emacr;":"Ē","&EmptySmallSquare;":"◻","&EmptyVerySmallSquare;":"▫","&Eogon;":"Ę","&Eopf;":"𝔼","&Epsilon;":"Ε","&Equal;":"⩵","&EqualTilde;":"≂","&Equilibrium;":"⇌","&Escr;":"ℰ","&Esim;":"⩳","&Eta;":"Η","&Euml":"Ë","&Euml;":"Ë","&Exists;":"∃","&ExponentialE;":"ⅇ","&Fcy;":"Ф","&Ffr;":"𝔉","&FilledSmallSquare;":"◼","&FilledVerySmallSquare;":"▪","&Fopf;":"𝔽","&ForAll;":"∀","&Fouriertrf;":"ℱ","&Fscr;":"ℱ","&GJcy;":"Ѓ","&GT":">","&GT;":">","&Gamma;":"Γ","&Gammad;":"Ϝ","&Gbreve;":"Ğ","&Gcedil;":"Ģ","&Gcirc;":"Ĝ","&Gcy;":"Г","&Gdot;":"Ġ","&Gfr;":"𝔊","&Gg;":"⋙","&Gopf;":"𝔾","&GreaterEqual;":"≥","&GreaterEqualLess;":"⋛","&GreaterFullEqual;":"≧","&GreaterGreater;":"⪢","&GreaterLess;":"≷","&GreaterSlantEqual;":"⩾","&GreaterTilde;":"≳","&Gscr;":"𝒢","&Gt;":"≫","&HARDcy;":"Ъ","&Hacek;":"ˇ","&Hat;":"^","&Hcirc;":"Ĥ","&Hfr;":"ℌ","&HilbertSpace;":"ℋ","&Hopf;":"ℍ","&HorizontalLine;":"─","&Hscr;":"ℋ","&Hstrok;":"Ħ","&HumpDownHump;":"≎","&HumpEqual;":"≏","&IEcy;":"Е","&IJlig;":"IJ","&IOcy;":"Ё","&Iacute":"Í","&Iacute;":"Í","&Icirc":"Î","&Icirc;":"Î","&Icy;":"И","&Idot;":"İ","&Ifr;":"ℑ","&Igrave":"Ì","&Igrave;":"Ì","&Im;":"ℑ","&Imacr;":"Ī","&ImaginaryI;":"ⅈ","&Implies;":"⇒","&Int;":"∬","&Integral;":"∫","&Intersection;":"⋂","&InvisibleComma;":"⁣","&InvisibleTimes;":"⁢","&Iogon;":"Į","&Iopf;":"𝕀","&Iota;":"Ι","&Iscr;":"ℐ","&Itilde;":"Ĩ","&Iukcy;":"І","&Iuml":"Ï","&Iuml;":"Ï","&Jcirc;":"Ĵ","&Jcy;":"Й","&Jfr;":"𝔍","&Jopf;":"𝕁","&Jscr;":"𝒥","&Jsercy;":"Ј","&Jukcy;":"Є","&KHcy;":"Х","&KJcy;":"Ќ","&Kappa;":"Κ","&Kcedil;":"Ķ","&Kcy;":"К","&Kfr;":"𝔎","&Kopf;":"𝕂","&Kscr;":"𝒦","&LJcy;":"Љ","&LT":"<","&LT;":"<","&Lacute;":"Ĺ","&Lambda;":"Λ","&Lang;":"⟪","&Laplacetrf;":"ℒ","&Larr;":"↞","&Lcaron;":"Ľ","&Lcedil;":"Ļ","&Lcy;":"Л","&LeftAngleBracket;":"⟨","&LeftArrow;":"←","&LeftArrowBar;":"⇤","&LeftArrowRightArrow;":"⇆","&LeftCeiling;":"⌈","&LeftDoubleBracket;":"⟦","&LeftDownTeeVector;":"⥡","&LeftDownVector;":"⇃","&LeftDownVectorBar;":"⥙","&LeftFloor;":"⌊","&LeftRightArrow;":"↔","&LeftRightVector;":"⥎","&LeftTee;":"⊣","&LeftTeeArrow;":"↤","&LeftTeeVector;":"⥚","&LeftTriangle;":"⊲","&LeftTriangleBar;":"⧏","&LeftTriangleEqual;":"⊴","&LeftUpDownVector;":"⥑","&LeftUpTeeVector;":"⥠","&LeftUpVector;":"↿","&LeftUpVectorBar;":"⥘","&LeftVector;":"↼","&LeftVectorBar;":"⥒","&Leftarrow;":"⇐","&Leftrightarrow;":"⇔","&LessEqualGreater;":"⋚","&LessFullEqual;":"≦","&LessGreater;":"≶","&LessLess;":"⪡","&LessSlantEqual;":"⩽","&LessTilde;":"≲","&Lfr;":"𝔏","&Ll;":"⋘","&Lleftarrow;":"⇚","&Lmidot;":"Ŀ","&LongLeftArrow;":"⟵","&LongLeftRightArrow;":"⟷","&LongRightArrow;":"⟶","&Longleftarrow;":"⟸","&Longleftrightarrow;":"⟺","&Longrightarrow;":"⟹","&Lopf;":"𝕃","&LowerLeftArrow;":"↙","&LowerRightArrow;":"↘","&Lscr;":"ℒ","&Lsh;":"↰","&Lstrok;":"Ł","&Lt;":"≪","&Map;":"⤅","&Mcy;":"М","&MediumSpace;":" ","&Mellintrf;":"ℳ","&Mfr;":"𝔐","&MinusPlus;":"∓","&Mopf;":"𝕄","&Mscr;":"ℳ","&Mu;":"Μ","&NJcy;":"Њ","&Nacute;":"Ń","&Ncaron;":"Ň","&Ncedil;":"Ņ","&Ncy;":"Н","&NegativeMediumSpace;":"​","&NegativeThickSpace;":"​","&NegativeThinSpace;":"​","&NegativeVeryThinSpace;":"​","&NestedGreaterGreater;":"≫","&NestedLessLess;":"≪","&NewLine;":`
6
+ `,"&Nfr;":"𝔑","&NoBreak;":"⁠","&NonBreakingSpace;":" ","&Nopf;":"ℕ","&Not;":"⫬","&NotCongruent;":"≢","&NotCupCap;":"≭","&NotDoubleVerticalBar;":"∦","&NotElement;":"∉","&NotEqual;":"≠","&NotEqualTilde;":"≂̸","&NotExists;":"∄","&NotGreater;":"≯","&NotGreaterEqual;":"≱","&NotGreaterFullEqual;":"≧̸","&NotGreaterGreater;":"≫̸","&NotGreaterLess;":"≹","&NotGreaterSlantEqual;":"⩾̸","&NotGreaterTilde;":"≵","&NotHumpDownHump;":"≎̸","&NotHumpEqual;":"≏̸","&NotLeftTriangle;":"⋪","&NotLeftTriangleBar;":"⧏̸","&NotLeftTriangleEqual;":"⋬","&NotLess;":"≮","&NotLessEqual;":"≰","&NotLessGreater;":"≸","&NotLessLess;":"≪̸","&NotLessSlantEqual;":"⩽̸","&NotLessTilde;":"≴","&NotNestedGreaterGreater;":"⪢̸","&NotNestedLessLess;":"⪡̸","&NotPrecedes;":"⊀","&NotPrecedesEqual;":"⪯̸","&NotPrecedesSlantEqual;":"⋠","&NotReverseElement;":"∌","&NotRightTriangle;":"⋫","&NotRightTriangleBar;":"⧐̸","&NotRightTriangleEqual;":"⋭","&NotSquareSubset;":"⊏̸","&NotSquareSubsetEqual;":"⋢","&NotSquareSuperset;":"⊐̸","&NotSquareSupersetEqual;":"⋣","&NotSubset;":"⊂⃒","&NotSubsetEqual;":"⊈","&NotSucceeds;":"⊁","&NotSucceedsEqual;":"⪰̸","&NotSucceedsSlantEqual;":"⋡","&NotSucceedsTilde;":"≿̸","&NotSuperset;":"⊃⃒","&NotSupersetEqual;":"⊉","&NotTilde;":"≁","&NotTildeEqual;":"≄","&NotTildeFullEqual;":"≇","&NotTildeTilde;":"≉","&NotVerticalBar;":"∤","&Nscr;":"𝒩","&Ntilde":"Ñ","&Ntilde;":"Ñ","&Nu;":"Ν","&OElig;":"Œ","&Oacute":"Ó","&Oacute;":"Ó","&Ocirc":"Ô","&Ocirc;":"Ô","&Ocy;":"О","&Odblac;":"Ő","&Ofr;":"𝔒","&Ograve":"Ò","&Ograve;":"Ò","&Omacr;":"Ō","&Omega;":"Ω","&Omicron;":"Ο","&Oopf;":"𝕆","&OpenCurlyDoubleQuote;":"“","&OpenCurlyQuote;":"‘","&Or;":"⩔","&Oscr;":"𝒪","&Oslash":"Ø","&Oslash;":"Ø","&Otilde":"Õ","&Otilde;":"Õ","&Otimes;":"⨷","&Ouml":"Ö","&Ouml;":"Ö","&OverBar;":"‾","&OverBrace;":"⏞","&OverBracket;":"⎴","&OverParenthesis;":"⏜","&PartialD;":"∂","&Pcy;":"П","&Pfr;":"𝔓","&Phi;":"Φ","&Pi;":"Π","&PlusMinus;":"±","&Poincareplane;":"ℌ","&Popf;":"ℙ","&Pr;":"⪻","&Precedes;":"≺","&PrecedesEqual;":"⪯","&PrecedesSlantEqual;":"≼","&PrecedesTilde;":"≾","&Prime;":"″","&Product;":"∏","&Proportion;":"∷","&Proportional;":"∝","&Pscr;":"𝒫","&Psi;":"Ψ","&QUOT":'"',"&QUOT;":'"',"&Qfr;":"𝔔","&Qopf;":"ℚ","&Qscr;":"𝒬","&RBarr;":"⤐","&REG":"®","&REG;":"®","&Racute;":"Ŕ","&Rang;":"⟫","&Rarr;":"↠","&Rarrtl;":"⤖","&Rcaron;":"Ř","&Rcedil;":"Ŗ","&Rcy;":"Р","&Re;":"ℜ","&ReverseElement;":"∋","&ReverseEquilibrium;":"⇋","&ReverseUpEquilibrium;":"⥯","&Rfr;":"ℜ","&Rho;":"Ρ","&RightAngleBracket;":"⟩","&RightArrow;":"→","&RightArrowBar;":"⇥","&RightArrowLeftArrow;":"⇄","&RightCeiling;":"⌉","&RightDoubleBracket;":"⟧","&RightDownTeeVector;":"⥝","&RightDownVector;":"⇂","&RightDownVectorBar;":"⥕","&RightFloor;":"⌋","&RightTee;":"⊢","&RightTeeArrow;":"↦","&RightTeeVector;":"⥛","&RightTriangle;":"⊳","&RightTriangleBar;":"⧐","&RightTriangleEqual;":"⊵","&RightUpDownVector;":"⥏","&RightUpTeeVector;":"⥜","&RightUpVector;":"↾","&RightUpVectorBar;":"⥔","&RightVector;":"⇀","&RightVectorBar;":"⥓","&Rightarrow;":"⇒","&Ropf;":"ℝ","&RoundImplies;":"⥰","&Rrightarrow;":"⇛","&Rscr;":"ℛ","&Rsh;":"↱","&RuleDelayed;":"⧴","&SHCHcy;":"Щ","&SHcy;":"Ш","&SOFTcy;":"Ь","&Sacute;":"Ś","&Sc;":"⪼","&Scaron;":"Š","&Scedil;":"Ş","&Scirc;":"Ŝ","&Scy;":"С","&Sfr;":"𝔖","&ShortDownArrow;":"↓","&ShortLeftArrow;":"←","&ShortRightArrow;":"→","&ShortUpArrow;":"↑","&Sigma;":"Σ","&SmallCircle;":"∘","&Sopf;":"𝕊","&Sqrt;":"√","&Square;":"□","&SquareIntersection;":"⊓","&SquareSubset;":"⊏","&SquareSubsetEqual;":"⊑","&SquareSuperset;":"⊐","&SquareSupersetEqual;":"⊒","&SquareUnion;":"⊔","&Sscr;":"𝒮","&Star;":"⋆","&Sub;":"⋐","&Subset;":"⋐","&SubsetEqual;":"⊆","&Succeeds;":"≻","&SucceedsEqual;":"⪰","&SucceedsSlantEqual;":"≽","&SucceedsTilde;":"≿","&SuchThat;":"∋","&Sum;":"∑","&Sup;":"⋑","&Superset;":"⊃","&SupersetEqual;":"⊇","&Supset;":"⋑","&THORN":"Þ","&THORN;":"Þ","&TRADE;":"™","&TSHcy;":"Ћ","&TScy;":"Ц","&Tab;":" ","&Tau;":"Τ","&Tcaron;":"Ť","&Tcedil;":"Ţ","&Tcy;":"Т","&Tfr;":"𝔗","&Therefore;":"∴","&Theta;":"Θ","&ThickSpace;":"  ","&ThinSpace;":" ","&Tilde;":"∼","&TildeEqual;":"≃","&TildeFullEqual;":"≅","&TildeTilde;":"≈","&Topf;":"𝕋","&TripleDot;":"⃛","&Tscr;":"𝒯","&Tstrok;":"Ŧ","&Uacute":"Ú","&Uacute;":"Ú","&Uarr;":"↟","&Uarrocir;":"⥉","&Ubrcy;":"Ў","&Ubreve;":"Ŭ","&Ucirc":"Û","&Ucirc;":"Û","&Ucy;":"У","&Udblac;":"Ű","&Ufr;":"𝔘","&Ugrave":"Ù","&Ugrave;":"Ù","&Umacr;":"Ū","&UnderBar;":"_","&UnderBrace;":"⏟","&UnderBracket;":"⎵","&UnderParenthesis;":"⏝","&Union;":"⋃","&UnionPlus;":"⊎","&Uogon;":"Ų","&Uopf;":"𝕌","&UpArrow;":"↑","&UpArrowBar;":"⤒","&UpArrowDownArrow;":"⇅","&UpDownArrow;":"↕","&UpEquilibrium;":"⥮","&UpTee;":"⊥","&UpTeeArrow;":"↥","&Uparrow;":"⇑","&Updownarrow;":"⇕","&UpperLeftArrow;":"↖","&UpperRightArrow;":"↗","&Upsi;":"ϒ","&Upsilon;":"Υ","&Uring;":"Ů","&Uscr;":"𝒰","&Utilde;":"Ũ","&Uuml":"Ü","&Uuml;":"Ü","&VDash;":"⊫","&Vbar;":"⫫","&Vcy;":"В","&Vdash;":"⊩","&Vdashl;":"⫦","&Vee;":"⋁","&Verbar;":"‖","&Vert;":"‖","&VerticalBar;":"∣","&VerticalLine;":"|","&VerticalSeparator;":"❘","&VerticalTilde;":"≀","&VeryThinSpace;":" ","&Vfr;":"𝔙","&Vopf;":"𝕍","&Vscr;":"𝒱","&Vvdash;":"⊪","&Wcirc;":"Ŵ","&Wedge;":"⋀","&Wfr;":"𝔚","&Wopf;":"𝕎","&Wscr;":"𝒲","&Xfr;":"𝔛","&Xi;":"Ξ","&Xopf;":"𝕏","&Xscr;":"𝒳","&YAcy;":"Я","&YIcy;":"Ї","&YUcy;":"Ю","&Yacute":"Ý","&Yacute;":"Ý","&Ycirc;":"Ŷ","&Ycy;":"Ы","&Yfr;":"𝔜","&Yopf;":"𝕐","&Yscr;":"𝒴","&Yuml;":"Ÿ","&ZHcy;":"Ж","&Zacute;":"Ź","&Zcaron;":"Ž","&Zcy;":"З","&Zdot;":"Ż","&ZeroWidthSpace;":"​","&Zeta;":"Ζ","&Zfr;":"ℨ","&Zopf;":"ℤ","&Zscr;":"𝒵","&aacute":"á","&aacute;":"á","&abreve;":"ă","&ac;":"∾","&acE;":"∾̳","&acd;":"∿","&acirc":"â","&acirc;":"â","&acute":"´","&acute;":"´","&acy;":"а","&aelig":"æ","&aelig;":"æ","&af;":"⁡","&afr;":"𝔞","&agrave":"à","&agrave;":"à","&alefsym;":"ℵ","&aleph;":"ℵ","&alpha;":"α","&amacr;":"ā","&amalg;":"⨿","&amp":"&","&amp;":"&","&and;":"∧","&andand;":"⩕","&andd;":"⩜","&andslope;":"⩘","&andv;":"⩚","&ang;":"∠","&ange;":"⦤","&angle;":"∠","&angmsd;":"∡","&angmsdaa;":"⦨","&angmsdab;":"⦩","&angmsdac;":"⦪","&angmsdad;":"⦫","&angmsdae;":"⦬","&angmsdaf;":"⦭","&angmsdag;":"⦮","&angmsdah;":"⦯","&angrt;":"∟","&angrtvb;":"⊾","&angrtvbd;":"⦝","&angsph;":"∢","&angst;":"Å","&angzarr;":"⍼","&aogon;":"ą","&aopf;":"𝕒","&ap;":"≈","&apE;":"⩰","&apacir;":"⩯","&ape;":"≊","&apid;":"≋","&apos;":"'","&approx;":"≈","&approxeq;":"≊","&aring":"å","&aring;":"å","&ascr;":"𝒶","&ast;":"*","&asymp;":"≈","&asympeq;":"≍","&atilde":"ã","&atilde;":"ã","&auml":"ä","&auml;":"ä","&awconint;":"∳","&awint;":"⨑","&bNot;":"⫭","&backcong;":"≌","&backepsilon;":"϶","&backprime;":"‵","&backsim;":"∽","&backsimeq;":"⋍","&barvee;":"⊽","&barwed;":"⌅","&barwedge;":"⌅","&bbrk;":"⎵","&bbrktbrk;":"⎶","&bcong;":"≌","&bcy;":"б","&bdquo;":"„","&becaus;":"∵","&because;":"∵","&bemptyv;":"⦰","&bepsi;":"϶","&bernou;":"ℬ","&beta;":"β","&beth;":"ℶ","&between;":"≬","&bfr;":"𝔟","&bigcap;":"⋂","&bigcirc;":"◯","&bigcup;":"⋃","&bigodot;":"⨀","&bigoplus;":"⨁","&bigotimes;":"⨂","&bigsqcup;":"⨆","&bigstar;":"★","&bigtriangledown;":"▽","&bigtriangleup;":"△","&biguplus;":"⨄","&bigvee;":"⋁","&bigwedge;":"⋀","&bkarow;":"⤍","&blacklozenge;":"⧫","&blacksquare;":"▪","&blacktriangle;":"▴","&blacktriangledown;":"▾","&blacktriangleleft;":"◂","&blacktriangleright;":"▸","&blank;":"␣","&blk12;":"▒","&blk14;":"░","&blk34;":"▓","&block;":"█","&bne;":"=⃥","&bnequiv;":"≡⃥","&bnot;":"⌐","&bopf;":"𝕓","&bot;":"⊥","&bottom;":"⊥","&bowtie;":"⋈","&boxDL;":"╗","&boxDR;":"╔","&boxDl;":"╖","&boxDr;":"╓","&boxH;":"═","&boxHD;":"╦","&boxHU;":"╩","&boxHd;":"╤","&boxHu;":"╧","&boxUL;":"╝","&boxUR;":"╚","&boxUl;":"╜","&boxUr;":"╙","&boxV;":"║","&boxVH;":"╬","&boxVL;":"╣","&boxVR;":"╠","&boxVh;":"╫","&boxVl;":"╢","&boxVr;":"╟","&boxbox;":"⧉","&boxdL;":"╕","&boxdR;":"╒","&boxdl;":"┐","&boxdr;":"┌","&boxh;":"─","&boxhD;":"╥","&boxhU;":"╨","&boxhd;":"┬","&boxhu;":"┴","&boxminus;":"⊟","&boxplus;":"⊞","&boxtimes;":"⊠","&boxuL;":"╛","&boxuR;":"╘","&boxul;":"┘","&boxur;":"└","&boxv;":"│","&boxvH;":"╪","&boxvL;":"╡","&boxvR;":"╞","&boxvh;":"┼","&boxvl;":"┤","&boxvr;":"├","&bprime;":"‵","&breve;":"˘","&brvbar":"¦","&brvbar;":"¦","&bscr;":"𝒷","&bsemi;":"⁏","&bsim;":"∽","&bsime;":"⋍","&bsol;":"\\","&bsolb;":"⧅","&bsolhsub;":"⟈","&bull;":"•","&bullet;":"•","&bump;":"≎","&bumpE;":"⪮","&bumpe;":"≏","&bumpeq;":"≏","&cacute;":"ć","&cap;":"∩","&capand;":"⩄","&capbrcup;":"⩉","&capcap;":"⩋","&capcup;":"⩇","&capdot;":"⩀","&caps;":"∩︀","&caret;":"⁁","&caron;":"ˇ","&ccaps;":"⩍","&ccaron;":"č","&ccedil":"ç","&ccedil;":"ç","&ccirc;":"ĉ","&ccups;":"⩌","&ccupssm;":"⩐","&cdot;":"ċ","&cedil":"¸","&cedil;":"¸","&cemptyv;":"⦲","&cent":"¢","&cent;":"¢","&centerdot;":"·","&cfr;":"𝔠","&chcy;":"ч","&check;":"✓","&checkmark;":"✓","&chi;":"χ","&cir;":"○","&cirE;":"⧃","&circ;":"ˆ","&circeq;":"≗","&circlearrowleft;":"↺","&circlearrowright;":"↻","&circledR;":"®","&circledS;":"Ⓢ","&circledast;":"⊛","&circledcirc;":"⊚","&circleddash;":"⊝","&cire;":"≗","&cirfnint;":"⨐","&cirmid;":"⫯","&cirscir;":"⧂","&clubs;":"♣","&clubsuit;":"♣","&colon;":":","&colone;":"≔","&coloneq;":"≔","&comma;":",","&commat;":"@","&comp;":"∁","&compfn;":"∘","&complement;":"∁","&complexes;":"ℂ","&cong;":"≅","&congdot;":"⩭","&conint;":"∮","&copf;":"𝕔","&coprod;":"∐","&copy":"©","&copy;":"©","&copysr;":"℗","&crarr;":"↵","&cross;":"✗","&cscr;":"𝒸","&csub;":"⫏","&csube;":"⫑","&csup;":"⫐","&csupe;":"⫒","&ctdot;":"⋯","&cudarrl;":"⤸","&cudarrr;":"⤵","&cuepr;":"⋞","&cuesc;":"⋟","&cularr;":"↶","&cularrp;":"⤽","&cup;":"∪","&cupbrcap;":"⩈","&cupcap;":"⩆","&cupcup;":"⩊","&cupdot;":"⊍","&cupor;":"⩅","&cups;":"∪︀","&curarr;":"↷","&curarrm;":"⤼","&curlyeqprec;":"⋞","&curlyeqsucc;":"⋟","&curlyvee;":"⋎","&curlywedge;":"⋏","&curren":"¤","&curren;":"¤","&curvearrowleft;":"↶","&curvearrowright;":"↷","&cuvee;":"⋎","&cuwed;":"⋏","&cwconint;":"∲","&cwint;":"∱","&cylcty;":"⌭","&dArr;":"⇓","&dHar;":"⥥","&dagger;":"†","&daleth;":"ℸ","&darr;":"↓","&dash;":"‐","&dashv;":"⊣","&dbkarow;":"⤏","&dblac;":"˝","&dcaron;":"ď","&dcy;":"д","&dd;":"ⅆ","&ddagger;":"‡","&ddarr;":"⇊","&ddotseq;":"⩷","&deg":"°","&deg;":"°","&delta;":"δ","&demptyv;":"⦱","&dfisht;":"⥿","&dfr;":"𝔡","&dharl;":"⇃","&dharr;":"⇂","&diam;":"⋄","&diamond;":"⋄","&diamondsuit;":"♦","&diams;":"♦","&die;":"¨","&digamma;":"ϝ","&disin;":"⋲","&div;":"÷","&divide":"÷","&divide;":"÷","&divideontimes;":"⋇","&divonx;":"⋇","&djcy;":"ђ","&dlcorn;":"⌞","&dlcrop;":"⌍","&dollar;":"$","&dopf;":"𝕕","&dot;":"˙","&doteq;":"≐","&doteqdot;":"≑","&dotminus;":"∸","&dotplus;":"∔","&dotsquare;":"⊡","&doublebarwedge;":"⌆","&downarrow;":"↓","&downdownarrows;":"⇊","&downharpoonleft;":"⇃","&downharpoonright;":"⇂","&drbkarow;":"⤐","&drcorn;":"⌟","&drcrop;":"⌌","&dscr;":"𝒹","&dscy;":"ѕ","&dsol;":"⧶","&dstrok;":"đ","&dtdot;":"⋱","&dtri;":"▿","&dtrif;":"▾","&duarr;":"⇵","&duhar;":"⥯","&dwangle;":"⦦","&dzcy;":"џ","&dzigrarr;":"⟿","&eDDot;":"⩷","&eDot;":"≑","&eacute":"é","&eacute;":"é","&easter;":"⩮","&ecaron;":"ě","&ecir;":"≖","&ecirc":"ê","&ecirc;":"ê","&ecolon;":"≕","&ecy;":"э","&edot;":"ė","&ee;":"ⅇ","&efDot;":"≒","&efr;":"𝔢","&eg;":"⪚","&egrave":"è","&egrave;":"è","&egs;":"⪖","&egsdot;":"⪘","&el;":"⪙","&elinters;":"⏧","&ell;":"ℓ","&els;":"⪕","&elsdot;":"⪗","&emacr;":"ē","&empty;":"∅","&emptyset;":"∅","&emptyv;":"∅","&emsp13;":" ","&emsp14;":" ","&emsp;":" ","&eng;":"ŋ","&ensp;":" ","&eogon;":"ę","&eopf;":"𝕖","&epar;":"⋕","&eparsl;":"⧣","&eplus;":"⩱","&epsi;":"ε","&epsilon;":"ε","&epsiv;":"ϵ","&eqcirc;":"≖","&eqcolon;":"≕","&eqsim;":"≂","&eqslantgtr;":"⪖","&eqslantless;":"⪕","&equals;":"=","&equest;":"≟","&equiv;":"≡","&equivDD;":"⩸","&eqvparsl;":"⧥","&erDot;":"≓","&erarr;":"⥱","&escr;":"ℯ","&esdot;":"≐","&esim;":"≂","&eta;":"η","&eth":"ð","&eth;":"ð","&euml":"ë","&euml;":"ë","&euro;":"€","&excl;":"!","&exist;":"∃","&expectation;":"ℰ","&exponentiale;":"ⅇ","&fallingdotseq;":"≒","&fcy;":"ф","&female;":"♀","&ffilig;":"ffi","&fflig;":"ff","&ffllig;":"ffl","&ffr;":"𝔣","&filig;":"fi","&fjlig;":"fj","&flat;":"♭","&fllig;":"fl","&fltns;":"▱","&fnof;":"ƒ","&fopf;":"𝕗","&forall;":"∀","&fork;":"⋔","&forkv;":"⫙","&fpartint;":"⨍","&frac12":"½","&frac12;":"½","&frac13;":"⅓","&frac14":"¼","&frac14;":"¼","&frac15;":"⅕","&frac16;":"⅙","&frac18;":"⅛","&frac23;":"⅔","&frac25;":"⅖","&frac34":"¾","&frac34;":"¾","&frac35;":"⅗","&frac38;":"⅜","&frac45;":"⅘","&frac56;":"⅚","&frac58;":"⅝","&frac78;":"⅞","&frasl;":"⁄","&frown;":"⌢","&fscr;":"𝒻","&gE;":"≧","&gEl;":"⪌","&gacute;":"ǵ","&gamma;":"γ","&gammad;":"ϝ","&gap;":"⪆","&gbreve;":"ğ","&gcirc;":"ĝ","&gcy;":"г","&gdot;":"ġ","&ge;":"≥","&gel;":"⋛","&geq;":"≥","&geqq;":"≧","&geqslant;":"⩾","&ges;":"⩾","&gescc;":"⪩","&gesdot;":"⪀","&gesdoto;":"⪂","&gesdotol;":"⪄","&gesl;":"⋛︀","&gesles;":"⪔","&gfr;":"𝔤","&gg;":"≫","&ggg;":"⋙","&gimel;":"ℷ","&gjcy;":"ѓ","&gl;":"≷","&glE;":"⪒","&gla;":"⪥","&glj;":"⪤","&gnE;":"≩","&gnap;":"⪊","&gnapprox;":"⪊","&gne;":"⪈","&gneq;":"⪈","&gneqq;":"≩","&gnsim;":"⋧","&gopf;":"𝕘","&grave;":"`","&gscr;":"ℊ","&gsim;":"≳","&gsime;":"⪎","&gsiml;":"⪐","&gt":">","&gt;":">","&gtcc;":"⪧","&gtcir;":"⩺","&gtdot;":"⋗","&gtlPar;":"⦕","&gtquest;":"⩼","&gtrapprox;":"⪆","&gtrarr;":"⥸","&gtrdot;":"⋗","&gtreqless;":"⋛","&gtreqqless;":"⪌","&gtrless;":"≷","&gtrsim;":"≳","&gvertneqq;":"≩︀","&gvnE;":"≩︀","&hArr;":"⇔","&hairsp;":" ","&half;":"½","&hamilt;":"ℋ","&hardcy;":"ъ","&harr;":"↔","&harrcir;":"⥈","&harrw;":"↭","&hbar;":"ℏ","&hcirc;":"ĥ","&hearts;":"♥","&heartsuit;":"♥","&hellip;":"…","&hercon;":"⊹","&hfr;":"𝔥","&hksearow;":"⤥","&hkswarow;":"⤦","&hoarr;":"⇿","&homtht;":"∻","&hookleftarrow;":"↩","&hookrightarrow;":"↪","&hopf;":"𝕙","&horbar;":"―","&hscr;":"𝒽","&hslash;":"ℏ","&hstrok;":"ħ","&hybull;":"⁃","&hyphen;":"‐","&iacute":"í","&iacute;":"í","&ic;":"⁣","&icirc":"î","&icirc;":"î","&icy;":"и","&iecy;":"е","&iexcl":"¡","&iexcl;":"¡","&iff;":"⇔","&ifr;":"𝔦","&igrave":"ì","&igrave;":"ì","&ii;":"ⅈ","&iiiint;":"⨌","&iiint;":"∭","&iinfin;":"⧜","&iiota;":"℩","&ijlig;":"ij","&imacr;":"ī","&image;":"ℑ","&imagline;":"ℐ","&imagpart;":"ℑ","&imath;":"ı","&imof;":"⊷","&imped;":"Ƶ","&in;":"∈","&incare;":"℅","&infin;":"∞","&infintie;":"⧝","&inodot;":"ı","&int;":"∫","&intcal;":"⊺","&integers;":"ℤ","&intercal;":"⊺","&intlarhk;":"⨗","&intprod;":"⨼","&iocy;":"ё","&iogon;":"į","&iopf;":"𝕚","&iota;":"ι","&iprod;":"⨼","&iquest":"¿","&iquest;":"¿","&iscr;":"𝒾","&isin;":"∈","&isinE;":"⋹","&isindot;":"⋵","&isins;":"⋴","&isinsv;":"⋳","&isinv;":"∈","&it;":"⁢","&itilde;":"ĩ","&iukcy;":"і","&iuml":"ï","&iuml;":"ï","&jcirc;":"ĵ","&jcy;":"й","&jfr;":"𝔧","&jmath;":"ȷ","&jopf;":"𝕛","&jscr;":"𝒿","&jsercy;":"ј","&jukcy;":"є","&kappa;":"κ","&kappav;":"ϰ","&kcedil;":"ķ","&kcy;":"к","&kfr;":"𝔨","&kgreen;":"ĸ","&khcy;":"х","&kjcy;":"ќ","&kopf;":"𝕜","&kscr;":"𝓀","&lAarr;":"⇚","&lArr;":"⇐","&lAtail;":"⤛","&lBarr;":"⤎","&lE;":"≦","&lEg;":"⪋","&lHar;":"⥢","&lacute;":"ĺ","&laemptyv;":"⦴","&lagran;":"ℒ","&lambda;":"λ","&lang;":"⟨","&langd;":"⦑","&langle;":"⟨","&lap;":"⪅","&laquo":"«","&laquo;":"«","&larr;":"←","&larrb;":"⇤","&larrbfs;":"⤟","&larrfs;":"⤝","&larrhk;":"↩","&larrlp;":"↫","&larrpl;":"⤹","&larrsim;":"⥳","&larrtl;":"↢","&lat;":"⪫","&latail;":"⤙","&late;":"⪭","&lates;":"⪭︀","&lbarr;":"⤌","&lbbrk;":"❲","&lbrace;":"{","&lbrack;":"[","&lbrke;":"⦋","&lbrksld;":"⦏","&lbrkslu;":"⦍","&lcaron;":"ľ","&lcedil;":"ļ","&lceil;":"⌈","&lcub;":"{","&lcy;":"л","&ldca;":"⤶","&ldquo;":"“","&ldquor;":"„","&ldrdhar;":"⥧","&ldrushar;":"⥋","&ldsh;":"↲","&le;":"≤","&leftarrow;":"←","&leftarrowtail;":"↢","&leftharpoondown;":"↽","&leftharpoonup;":"↼","&leftleftarrows;":"⇇","&leftrightarrow;":"↔","&leftrightarrows;":"⇆","&leftrightharpoons;":"⇋","&leftrightsquigarrow;":"↭","&leftthreetimes;":"⋋","&leg;":"⋚","&leq;":"≤","&leqq;":"≦","&leqslant;":"⩽","&les;":"⩽","&lescc;":"⪨","&lesdot;":"⩿","&lesdoto;":"⪁","&lesdotor;":"⪃","&lesg;":"⋚︀","&lesges;":"⪓","&lessapprox;":"⪅","&lessdot;":"⋖","&lesseqgtr;":"⋚","&lesseqqgtr;":"⪋","&lessgtr;":"≶","&lesssim;":"≲","&lfisht;":"⥼","&lfloor;":"⌊","&lfr;":"𝔩","&lg;":"≶","&lgE;":"⪑","&lhard;":"↽","&lharu;":"↼","&lharul;":"⥪","&lhblk;":"▄","&ljcy;":"љ","&ll;":"≪","&llarr;":"⇇","&llcorner;":"⌞","&llhard;":"⥫","&lltri;":"◺","&lmidot;":"ŀ","&lmoust;":"⎰","&lmoustache;":"⎰","&lnE;":"≨","&lnap;":"⪉","&lnapprox;":"⪉","&lne;":"⪇","&lneq;":"⪇","&lneqq;":"≨","&lnsim;":"⋦","&loang;":"⟬","&loarr;":"⇽","&lobrk;":"⟦","&longleftarrow;":"⟵","&longleftrightarrow;":"⟷","&longmapsto;":"⟼","&longrightarrow;":"⟶","&looparrowleft;":"↫","&looparrowright;":"↬","&lopar;":"⦅","&lopf;":"𝕝","&loplus;":"⨭","&lotimes;":"⨴","&lowast;":"∗","&lowbar;":"_","&loz;":"◊","&lozenge;":"◊","&lozf;":"⧫","&lpar;":"(","&lparlt;":"⦓","&lrarr;":"⇆","&lrcorner;":"⌟","&lrhar;":"⇋","&lrhard;":"⥭","&lrm;":"‎","&lrtri;":"⊿","&lsaquo;":"‹","&lscr;":"𝓁","&lsh;":"↰","&lsim;":"≲","&lsime;":"⪍","&lsimg;":"⪏","&lsqb;":"[","&lsquo;":"‘","&lsquor;":"‚","&lstrok;":"ł","&lt":"<","&lt;":"<","&ltcc;":"⪦","&ltcir;":"⩹","&ltdot;":"⋖","&lthree;":"⋋","&ltimes;":"⋉","&ltlarr;":"⥶","&ltquest;":"⩻","&ltrPar;":"⦖","&ltri;":"◃","&ltrie;":"⊴","&ltrif;":"◂","&lurdshar;":"⥊","&luruhar;":"⥦","&lvertneqq;":"≨︀","&lvnE;":"≨︀","&mDDot;":"∺","&macr":"¯","&macr;":"¯","&male;":"♂","&malt;":"✠","&maltese;":"✠","&map;":"↦","&mapsto;":"↦","&mapstodown;":"↧","&mapstoleft;":"↤","&mapstoup;":"↥","&marker;":"▮","&mcomma;":"⨩","&mcy;":"м","&mdash;":"—","&measuredangle;":"∡","&mfr;":"𝔪","&mho;":"℧","&micro":"µ","&micro;":"µ","&mid;":"∣","&midast;":"*","&midcir;":"⫰","&middot":"·","&middot;":"·","&minus;":"−","&minusb;":"⊟","&minusd;":"∸","&minusdu;":"⨪","&mlcp;":"⫛","&mldr;":"…","&mnplus;":"∓","&models;":"⊧","&mopf;":"𝕞","&mp;":"∓","&mscr;":"𝓂","&mstpos;":"∾","&mu;":"μ","&multimap;":"⊸","&mumap;":"⊸","&nGg;":"⋙̸","&nGt;":"≫⃒","&nGtv;":"≫̸","&nLeftarrow;":"⇍","&nLeftrightarrow;":"⇎","&nLl;":"⋘̸","&nLt;":"≪⃒","&nLtv;":"≪̸","&nRightarrow;":"⇏","&nVDash;":"⊯","&nVdash;":"⊮","&nabla;":"∇","&nacute;":"ń","&nang;":"∠⃒","&nap;":"≉","&napE;":"⩰̸","&napid;":"≋̸","&napos;":"ʼn","&napprox;":"≉","&natur;":"♮","&natural;":"♮","&naturals;":"ℕ","&nbsp":" ","&nbsp;":" ","&nbump;":"≎̸","&nbumpe;":"≏̸","&ncap;":"⩃","&ncaron;":"ň","&ncedil;":"ņ","&ncong;":"≇","&ncongdot;":"⩭̸","&ncup;":"⩂","&ncy;":"н","&ndash;":"–","&ne;":"≠","&neArr;":"⇗","&nearhk;":"⤤","&nearr;":"↗","&nearrow;":"↗","&nedot;":"≐̸","&nequiv;":"≢","&nesear;":"⤨","&nesim;":"≂̸","&nexist;":"∄","&nexists;":"∄","&nfr;":"𝔫","&ngE;":"≧̸","&nge;":"≱","&ngeq;":"≱","&ngeqq;":"≧̸","&ngeqslant;":"⩾̸","&nges;":"⩾̸","&ngsim;":"≵","&ngt;":"≯","&ngtr;":"≯","&nhArr;":"⇎","&nharr;":"↮","&nhpar;":"⫲","&ni;":"∋","&nis;":"⋼","&nisd;":"⋺","&niv;":"∋","&njcy;":"њ","&nlArr;":"⇍","&nlE;":"≦̸","&nlarr;":"↚","&nldr;":"‥","&nle;":"≰","&nleftarrow;":"↚","&nleftrightarrow;":"↮","&nleq;":"≰","&nleqq;":"≦̸","&nleqslant;":"⩽̸","&nles;":"⩽̸","&nless;":"≮","&nlsim;":"≴","&nlt;":"≮","&nltri;":"⋪","&nltrie;":"⋬","&nmid;":"∤","&nopf;":"𝕟","&not":"¬","&not;":"¬","&notin;":"∉","&notinE;":"⋹̸","&notindot;":"⋵̸","&notinva;":"∉","&notinvb;":"⋷","&notinvc;":"⋶","&notni;":"∌","&notniva;":"∌","&notnivb;":"⋾","&notnivc;":"⋽","&npar;":"∦","&nparallel;":"∦","&nparsl;":"⫽⃥","&npart;":"∂̸","&npolint;":"⨔","&npr;":"⊀","&nprcue;":"⋠","&npre;":"⪯̸","&nprec;":"⊀","&npreceq;":"⪯̸","&nrArr;":"⇏","&nrarr;":"↛","&nrarrc;":"⤳̸","&nrarrw;":"↝̸","&nrightarrow;":"↛","&nrtri;":"⋫","&nrtrie;":"⋭","&nsc;":"⊁","&nsccue;":"⋡","&nsce;":"⪰̸","&nscr;":"𝓃","&nshortmid;":"∤","&nshortparallel;":"∦","&nsim;":"≁","&nsime;":"≄","&nsimeq;":"≄","&nsmid;":"∤","&nspar;":"∦","&nsqsube;":"⋢","&nsqsupe;":"⋣","&nsub;":"⊄","&nsubE;":"⫅̸","&nsube;":"⊈","&nsubset;":"⊂⃒","&nsubseteq;":"⊈","&nsubseteqq;":"⫅̸","&nsucc;":"⊁","&nsucceq;":"⪰̸","&nsup;":"⊅","&nsupE;":"⫆̸","&nsupe;":"⊉","&nsupset;":"⊃⃒","&nsupseteq;":"⊉","&nsupseteqq;":"⫆̸","&ntgl;":"≹","&ntilde":"ñ","&ntilde;":"ñ","&ntlg;":"≸","&ntriangleleft;":"⋪","&ntrianglelefteq;":"⋬","&ntriangleright;":"⋫","&ntrianglerighteq;":"⋭","&nu;":"ν","&num;":"#","&numero;":"№","&numsp;":" ","&nvDash;":"⊭","&nvHarr;":"⤄","&nvap;":"≍⃒","&nvdash;":"⊬","&nvge;":"≥⃒","&nvgt;":">⃒","&nvinfin;":"⧞","&nvlArr;":"⤂","&nvle;":"≤⃒","&nvlt;":"<⃒","&nvltrie;":"⊴⃒","&nvrArr;":"⤃","&nvrtrie;":"⊵⃒","&nvsim;":"∼⃒","&nwArr;":"⇖","&nwarhk;":"⤣","&nwarr;":"↖","&nwarrow;":"↖","&nwnear;":"⤧","&oS;":"Ⓢ","&oacute":"ó","&oacute;":"ó","&oast;":"⊛","&ocir;":"⊚","&ocirc":"ô","&ocirc;":"ô","&ocy;":"о","&odash;":"⊝","&odblac;":"ő","&odiv;":"⨸","&odot;":"⊙","&odsold;":"⦼","&oelig;":"œ","&ofcir;":"⦿","&ofr;":"𝔬","&ogon;":"˛","&ograve":"ò","&ograve;":"ò","&ogt;":"⧁","&ohbar;":"⦵","&ohm;":"Ω","&oint;":"∮","&olarr;":"↺","&olcir;":"⦾","&olcross;":"⦻","&oline;":"‾","&olt;":"⧀","&omacr;":"ō","&omega;":"ω","&omicron;":"ο","&omid;":"⦶","&ominus;":"⊖","&oopf;":"𝕠","&opar;":"⦷","&operp;":"⦹","&oplus;":"⊕","&or;":"∨","&orarr;":"↻","&ord;":"⩝","&order;":"ℴ","&orderof;":"ℴ","&ordf":"ª","&ordf;":"ª","&ordm":"º","&ordm;":"º","&origof;":"⊶","&oror;":"⩖","&orslope;":"⩗","&orv;":"⩛","&oscr;":"ℴ","&oslash":"ø","&oslash;":"ø","&osol;":"⊘","&otilde":"õ","&otilde;":"õ","&otimes;":"⊗","&otimesas;":"⨶","&ouml":"ö","&ouml;":"ö","&ovbar;":"⌽","&par;":"∥","&para":"¶","&para;":"¶","&parallel;":"∥","&parsim;":"⫳","&parsl;":"⫽","&part;":"∂","&pcy;":"п","&percnt;":"%","&period;":".","&permil;":"‰","&perp;":"⊥","&pertenk;":"‱","&pfr;":"𝔭","&phi;":"φ","&phiv;":"ϕ","&phmmat;":"ℳ","&phone;":"☎","&pi;":"π","&pitchfork;":"⋔","&piv;":"ϖ","&planck;":"ℏ","&planckh;":"ℎ","&plankv;":"ℏ","&plus;":"+","&plusacir;":"⨣","&plusb;":"⊞","&pluscir;":"⨢","&plusdo;":"∔","&plusdu;":"⨥","&pluse;":"⩲","&plusmn":"±","&plusmn;":"±","&plussim;":"⨦","&plustwo;":"⨧","&pm;":"±","&pointint;":"⨕","&popf;":"𝕡","&pound":"£","&pound;":"£","&pr;":"≺","&prE;":"⪳","&prap;":"⪷","&prcue;":"≼","&pre;":"⪯","&prec;":"≺","&precapprox;":"⪷","&preccurlyeq;":"≼","&preceq;":"⪯","&precnapprox;":"⪹","&precneqq;":"⪵","&precnsim;":"⋨","&precsim;":"≾","&prime;":"′","&primes;":"ℙ","&prnE;":"⪵","&prnap;":"⪹","&prnsim;":"⋨","&prod;":"∏","&profalar;":"⌮","&profline;":"⌒","&profsurf;":"⌓","&prop;":"∝","&propto;":"∝","&prsim;":"≾","&prurel;":"⊰","&pscr;":"𝓅","&psi;":"ψ","&puncsp;":" ","&qfr;":"𝔮","&qint;":"⨌","&qopf;":"𝕢","&qprime;":"⁗","&qscr;":"𝓆","&quaternions;":"ℍ","&quatint;":"⨖","&quest;":"?","&questeq;":"≟","&quot":'"',"&quot;":'"',"&rAarr;":"⇛","&rArr;":"⇒","&rAtail;":"⤜","&rBarr;":"⤏","&rHar;":"⥤","&race;":"∽̱","&racute;":"ŕ","&radic;":"√","&raemptyv;":"⦳","&rang;":"⟩","&rangd;":"⦒","&range;":"⦥","&rangle;":"⟩","&raquo":"»","&raquo;":"»","&rarr;":"→","&rarrap;":"⥵","&rarrb;":"⇥","&rarrbfs;":"⤠","&rarrc;":"⤳","&rarrfs;":"⤞","&rarrhk;":"↪","&rarrlp;":"↬","&rarrpl;":"⥅","&rarrsim;":"⥴","&rarrtl;":"↣","&rarrw;":"↝","&ratail;":"⤚","&ratio;":"∶","&rationals;":"ℚ","&rbarr;":"⤍","&rbbrk;":"❳","&rbrace;":"}","&rbrack;":"]","&rbrke;":"⦌","&rbrksld;":"⦎","&rbrkslu;":"⦐","&rcaron;":"ř","&rcedil;":"ŗ","&rceil;":"⌉","&rcub;":"}","&rcy;":"р","&rdca;":"⤷","&rdldhar;":"⥩","&rdquo;":"”","&rdquor;":"”","&rdsh;":"↳","&real;":"ℜ","&realine;":"ℛ","&realpart;":"ℜ","&reals;":"ℝ","&rect;":"▭","&reg":"®","&reg;":"®","&rfisht;":"⥽","&rfloor;":"⌋","&rfr;":"𝔯","&rhard;":"⇁","&rharu;":"⇀","&rharul;":"⥬","&rho;":"ρ","&rhov;":"ϱ","&rightarrow;":"→","&rightarrowtail;":"↣","&rightharpoondown;":"⇁","&rightharpoonup;":"⇀","&rightleftarrows;":"⇄","&rightleftharpoons;":"⇌","&rightrightarrows;":"⇉","&rightsquigarrow;":"↝","&rightthreetimes;":"⋌","&ring;":"˚","&risingdotseq;":"≓","&rlarr;":"⇄","&rlhar;":"⇌","&rlm;":"‏","&rmoust;":"⎱","&rmoustache;":"⎱","&rnmid;":"⫮","&roang;":"⟭","&roarr;":"⇾","&robrk;":"⟧","&ropar;":"⦆","&ropf;":"𝕣","&roplus;":"⨮","&rotimes;":"⨵","&rpar;":")","&rpargt;":"⦔","&rppolint;":"⨒","&rrarr;":"⇉","&rsaquo;":"›","&rscr;":"𝓇","&rsh;":"↱","&rsqb;":"]","&rsquo;":"’","&rsquor;":"’","&rthree;":"⋌","&rtimes;":"⋊","&rtri;":"▹","&rtrie;":"⊵","&rtrif;":"▸","&rtriltri;":"⧎","&ruluhar;":"⥨","&rx;":"℞","&sacute;":"ś","&sbquo;":"‚","&sc;":"≻","&scE;":"⪴","&scap;":"⪸","&scaron;":"š","&sccue;":"≽","&sce;":"⪰","&scedil;":"ş","&scirc;":"ŝ","&scnE;":"⪶","&scnap;":"⪺","&scnsim;":"⋩","&scpolint;":"⨓","&scsim;":"≿","&scy;":"с","&sdot;":"⋅","&sdotb;":"⊡","&sdote;":"⩦","&seArr;":"⇘","&searhk;":"⤥","&searr;":"↘","&searrow;":"↘","&sect":"§","&sect;":"§","&semi;":";","&seswar;":"⤩","&setminus;":"∖","&setmn;":"∖","&sext;":"✶","&sfr;":"𝔰","&sfrown;":"⌢","&sharp;":"♯","&shchcy;":"щ","&shcy;":"ш","&shortmid;":"∣","&shortparallel;":"∥","&shy":"­","&shy;":"­","&sigma;":"σ","&sigmaf;":"ς","&sigmav;":"ς","&sim;":"∼","&simdot;":"⩪","&sime;":"≃","&simeq;":"≃","&simg;":"⪞","&simgE;":"⪠","&siml;":"⪝","&simlE;":"⪟","&simne;":"≆","&simplus;":"⨤","&simrarr;":"⥲","&slarr;":"←","&smallsetminus;":"∖","&smashp;":"⨳","&smeparsl;":"⧤","&smid;":"∣","&smile;":"⌣","&smt;":"⪪","&smte;":"⪬","&smtes;":"⪬︀","&softcy;":"ь","&sol;":"/","&solb;":"⧄","&solbar;":"⌿","&sopf;":"𝕤","&spades;":"♠","&spadesuit;":"♠","&spar;":"∥","&sqcap;":"⊓","&sqcaps;":"⊓︀","&sqcup;":"⊔","&sqcups;":"⊔︀","&sqsub;":"⊏","&sqsube;":"⊑","&sqsubset;":"⊏","&sqsubseteq;":"⊑","&sqsup;":"⊐","&sqsupe;":"⊒","&sqsupset;":"⊐","&sqsupseteq;":"⊒","&squ;":"□","&square;":"□","&squarf;":"▪","&squf;":"▪","&srarr;":"→","&sscr;":"𝓈","&ssetmn;":"∖","&ssmile;":"⌣","&sstarf;":"⋆","&star;":"☆","&starf;":"★","&straightepsilon;":"ϵ","&straightphi;":"ϕ","&strns;":"¯","&sub;":"⊂","&subE;":"⫅","&subdot;":"⪽","&sube;":"⊆","&subedot;":"⫃","&submult;":"⫁","&subnE;":"⫋","&subne;":"⊊","&subplus;":"⪿","&subrarr;":"⥹","&subset;":"⊂","&subseteq;":"⊆","&subseteqq;":"⫅","&subsetneq;":"⊊","&subsetneqq;":"⫋","&subsim;":"⫇","&subsub;":"⫕","&subsup;":"⫓","&succ;":"≻","&succapprox;":"⪸","&succcurlyeq;":"≽","&succeq;":"⪰","&succnapprox;":"⪺","&succneqq;":"⪶","&succnsim;":"⋩","&succsim;":"≿","&sum;":"∑","&sung;":"♪","&sup1":"¹","&sup1;":"¹","&sup2":"²","&sup2;":"²","&sup3":"³","&sup3;":"³","&sup;":"⊃","&supE;":"⫆","&supdot;":"⪾","&supdsub;":"⫘","&supe;":"⊇","&supedot;":"⫄","&suphsol;":"⟉","&suphsub;":"⫗","&suplarr;":"⥻","&supmult;":"⫂","&supnE;":"⫌","&supne;":"⊋","&supplus;":"⫀","&supset;":"⊃","&supseteq;":"⊇","&supseteqq;":"⫆","&supsetneq;":"⊋","&supsetneqq;":"⫌","&supsim;":"⫈","&supsub;":"⫔","&supsup;":"⫖","&swArr;":"⇙","&swarhk;":"⤦","&swarr;":"↙","&swarrow;":"↙","&swnwar;":"⤪","&szlig":"ß","&szlig;":"ß","&target;":"⌖","&tau;":"τ","&tbrk;":"⎴","&tcaron;":"ť","&tcedil;":"ţ","&tcy;":"т","&tdot;":"⃛","&telrec;":"⌕","&tfr;":"𝔱","&there4;":"∴","&therefore;":"∴","&theta;":"θ","&thetasym;":"ϑ","&thetav;":"ϑ","&thickapprox;":"≈","&thicksim;":"∼","&thinsp;":" ","&thkap;":"≈","&thksim;":"∼","&thorn":"þ","&thorn;":"þ","&tilde;":"˜","&times":"×","&times;":"×","&timesb;":"⊠","&timesbar;":"⨱","&timesd;":"⨰","&tint;":"∭","&toea;":"⤨","&top;":"⊤","&topbot;":"⌶","&topcir;":"⫱","&topf;":"𝕥","&topfork;":"⫚","&tosa;":"⤩","&tprime;":"‴","&trade;":"™","&triangle;":"▵","&triangledown;":"▿","&triangleleft;":"◃","&trianglelefteq;":"⊴","&triangleq;":"≜","&triangleright;":"▹","&trianglerighteq;":"⊵","&tridot;":"◬","&trie;":"≜","&triminus;":"⨺","&triplus;":"⨹","&trisb;":"⧍","&tritime;":"⨻","&trpezium;":"⏢","&tscr;":"𝓉","&tscy;":"ц","&tshcy;":"ћ","&tstrok;":"ŧ","&twixt;":"≬","&twoheadleftarrow;":"↞","&twoheadrightarrow;":"↠","&uArr;":"⇑","&uHar;":"⥣","&uacute":"ú","&uacute;":"ú","&uarr;":"↑","&ubrcy;":"ў","&ubreve;":"ŭ","&ucirc":"û","&ucirc;":"û","&ucy;":"у","&udarr;":"⇅","&udblac;":"ű","&udhar;":"⥮","&ufisht;":"⥾","&ufr;":"𝔲","&ugrave":"ù","&ugrave;":"ù","&uharl;":"↿","&uharr;":"↾","&uhblk;":"▀","&ulcorn;":"⌜","&ulcorner;":"⌜","&ulcrop;":"⌏","&ultri;":"◸","&umacr;":"ū","&uml":"¨","&uml;":"¨","&uogon;":"ų","&uopf;":"𝕦","&uparrow;":"↑","&updownarrow;":"↕","&upharpoonleft;":"↿","&upharpoonright;":"↾","&uplus;":"⊎","&upsi;":"υ","&upsih;":"ϒ","&upsilon;":"υ","&upuparrows;":"⇈","&urcorn;":"⌝","&urcorner;":"⌝","&urcrop;":"⌎","&uring;":"ů","&urtri;":"◹","&uscr;":"𝓊","&utdot;":"⋰","&utilde;":"ũ","&utri;":"▵","&utrif;":"▴","&uuarr;":"⇈","&uuml":"ü","&uuml;":"ü","&uwangle;":"⦧","&vArr;":"⇕","&vBar;":"⫨","&vBarv;":"⫩","&vDash;":"⊨","&vangrt;":"⦜","&varepsilon;":"ϵ","&varkappa;":"ϰ","&varnothing;":"∅","&varphi;":"ϕ","&varpi;":"ϖ","&varpropto;":"∝","&varr;":"↕","&varrho;":"ϱ","&varsigma;":"ς","&varsubsetneq;":"⊊︀","&varsubsetneqq;":"⫋︀","&varsupsetneq;":"⊋︀","&varsupsetneqq;":"⫌︀","&vartheta;":"ϑ","&vartriangleleft;":"⊲","&vartriangleright;":"⊳","&vcy;":"в","&vdash;":"⊢","&vee;":"∨","&veebar;":"⊻","&veeeq;":"≚","&vellip;":"⋮","&verbar;":"|","&vert;":"|","&vfr;":"𝔳","&vltri;":"⊲","&vnsub;":"⊂⃒","&vnsup;":"⊃⃒","&vopf;":"𝕧","&vprop;":"∝","&vrtri;":"⊳","&vscr;":"𝓋","&vsubnE;":"⫋︀","&vsubne;":"⊊︀","&vsupnE;":"⫌︀","&vsupne;":"⊋︀","&vzigzag;":"⦚","&wcirc;":"ŵ","&wedbar;":"⩟","&wedge;":"∧","&wedgeq;":"≙","&weierp;":"℘","&wfr;":"𝔴","&wopf;":"𝕨","&wp;":"℘","&wr;":"≀","&wreath;":"≀","&wscr;":"𝓌","&xcap;":"⋂","&xcirc;":"◯","&xcup;":"⋃","&xdtri;":"▽","&xfr;":"𝔵","&xhArr;":"⟺","&xharr;":"⟷","&xi;":"ξ","&xlArr;":"⟸","&xlarr;":"⟵","&xmap;":"⟼","&xnis;":"⋻","&xodot;":"⨀","&xopf;":"𝕩","&xoplus;":"⨁","&xotime;":"⨂","&xrArr;":"⟹","&xrarr;":"⟶","&xscr;":"𝓍","&xsqcup;":"⨆","&xuplus;":"⨄","&xutri;":"△","&xvee;":"⋁","&xwedge;":"⋀","&yacute":"ý","&yacute;":"ý","&yacy;":"я","&ycirc;":"ŷ","&ycy;":"ы","&yen":"¥","&yen;":"¥","&yfr;":"𝔶","&yicy;":"ї","&yopf;":"𝕪","&yscr;":"𝓎","&yucy;":"ю","&yuml":"ÿ","&yuml;":"ÿ","&zacute;":"ź","&zcaron;":"ž","&zcy;":"з","&zdot;":"ż","&zeetrf;":"ℨ","&zeta;":"ζ","&zfr;":"𝔷","&zhcy;":"ж","&zigrarr;":"⇝","&zopf;":"𝕫","&zscr;":"𝓏","&zwj;":"‍","&zwnj;":"‌"};function Ja(r){return r.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,t)=>{if(typeof zi[e]=="string")return zi[e];if(t.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;t.charAt(1)==="x"?n=parseInt(t.substr(2),16):n=parseInt(t.substr(1),10);var s="";return n>=55296&&n<=57343||n>1114111?"�":(n>65535&&(n-=65536,s+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),s+=String.fromCharCode(n),s)})}function er(r){return r.trim().replace(/[<>"'?&]/g,e=>{let t=e.charCodeAt(0).toString(16);return t.length<2&&(t="0"+t),"&#x"+t.toUpperCase()+";"})}function Qa(r){return"<div>"+er(r).replace(/\n/g,"<br />")+"</div>"}function Ya(r){return r=r.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
7
7
  `).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
8
8
 
9
9
  `).replace(/<script\b[^>]*>.*?<\/script\b[^>]*>/gi," ").replace(/^.*<body\b[^>]*>/i,"").replace(/^.*<\/head\b[^>]*>/i,"").replace(/^.*<\!doctype\b[^>]*>/i,"").replace(/<\/body\b[^>]*>.*$/i,"").replace(/<\/html\b[^>]*>.*$/i,"").replace(/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/gi," ($1) ").replace(/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,"").replace(/<li\b[^>]*>[\n\u0001\s]*/gi,"* ").replace(/<hr\b[^>]*>/g,`
@@ -13,19 +13,19 @@
13
13
 
14
14
  `).replace(/^\n+/,`
15
15
  `).replace(/\n+$/,`
16
- `),r=Ja(r),r}function nl(r){return[].concat(r.name||[]).concat(r.name?`<${r.address}>`:r.address).join(" ")}function _s(r){let e=[],t=(n,s)=>{if(s&&e.push(", "),n.group){let o=`${n.name}:`,i=";";e.push(o),n.group.forEach(t),e.push(i)}else e.push(nl(n))};return r.forEach(t),e.join("")}function sl(r){return`<a href="mailto:${Zt(r.address)}" class="postal-email-address">${Zt(r.name||`<${r.address}>`)}</a>`}function vs(r){let e=[],t=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${Zt(n.name)}:</span>`,i='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(t),e.push(i)}else e.push(sl(n))};return r.forEach(t),e.join(" ")}function Xa(r,e,t){r=(r||"").toString(),e=e||76;let n=0,s=r.length,o="",i,l;for(;n<s;){if(i=r.substr(n,e),i.length<e){o+=i;break}if(l=i.match(/^[^\n\r]*(\r?\n|\r)/)){i=l[0],o+=i,n+=i.length;continue}else(l=i.match(/(\s+)[^\s]*$/))&&l[0].length-(l[1]||"").length<i.length?i=i.substr(0,i.length-(l[0].length-(l[1]||"").length)):(l=r.substr(n+i.length).match(/^[^\s]+(\s*)/))&&(i=i+l[0].substr(0,l[0].length-0));o+=i,n+=i.length,n<s&&(o+=`\r
17
- `)}return o}function zi(r){let e=[];if(r.from&&e.push({key:"From",val:nl(r.from)}),r.subject&&e.push({key:"Subject",val:r.subject}),r.date){let i={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},l=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",i).format(new Date(r.date));e.push({key:"Date",val:l})}r.to&&r.to.length&&e.push({key:"To",val:_s(r.to)}),r.cc&&r.cc.length&&e.push({key:"Cc",val:_s(r.cc)}),r.bcc&&r.bcc.length&&e.push({key:"Bcc",val:_s(r.bcc)});let t=e.map(i=>i.key.length).reduce((i,l)=>l>i?l:i,0);e=e.flatMap(i=>{let l=t-i.key.length,a=`${i.key}: ${" ".repeat(l)}`,u=`${" ".repeat(i.key.length+1)} ${" ".repeat(l)}`;return Xa(i.val,80).split(/\r?\n/).map(d=>d.trim()).map((d,f)=>`${f?u:a}${d}`)});let n=e.map(i=>i.length).reduce((i,l)=>l>i?l:i,0),s="-".repeat(n);return`
16
+ `),r=Ja(r),r}function sl(r){return[].concat(r.name||[]).concat(r.name?`<${r.address}>`:r.address).join(" ")}function vs(r){let e=[],t=(n,s)=>{if(s&&e.push(", "),n.group){let o=`${n.name}:`,i=";";e.push(o),n.group.forEach(t),e.push(i)}else e.push(sl(n))};return r.forEach(t),e.join("")}function il(r){return`<a href="mailto:${er(r.address)}" class="postal-email-address">${er(r.name||`<${r.address}>`)}</a>`}function Cs(r){let e=[],t=(n,s)=>{if(s&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${er(n.name)}:</span>`,i='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(t),e.push(i)}else e.push(il(n))};return r.forEach(t),e.join(" ")}function Xa(r,e,t){r=(r||"").toString(),e=e||76;let n=0,s=r.length,o="",i,l;for(;n<s;){if(i=r.substr(n,e),i.length<e){o+=i;break}if(l=i.match(/^[^\n\r]*(\r?\n|\r)/)){i=l[0],o+=i,n+=i.length;continue}else(l=i.match(/(\s+)[^\s]*$/))&&l[0].length-(l[1]||"").length<i.length?i=i.substr(0,i.length-(l[0].length-(l[1]||"").length)):(l=r.substr(n+i.length).match(/^[^\s]+(\s*)/))&&(i=i+l[0].substr(0,l[0].length-0));o+=i,n+=i.length,n<s&&(o+=`\r
17
+ `)}return o}function qi(r){let e=[];if(r.from&&e.push({key:"From",val:sl(r.from)}),r.subject&&e.push({key:"Subject",val:r.subject}),r.date){let i={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},l=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",i).format(new Date(r.date));e.push({key:"Date",val:l})}r.to&&r.to.length&&e.push({key:"To",val:vs(r.to)}),r.cc&&r.cc.length&&e.push({key:"Cc",val:vs(r.cc)}),r.bcc&&r.bcc.length&&e.push({key:"Bcc",val:vs(r.bcc)});let t=e.map(i=>i.key.length).reduce((i,l)=>l>i?l:i,0);e=e.flatMap(i=>{let l=t-i.key.length,a=`${i.key}: ${" ".repeat(l)}`,u=`${" ".repeat(i.key.length+1)} ${" ".repeat(l)}`;return Xa(i.val,80).split(/\r?\n/).map(d=>d.trim()).map((d,f)=>`${f?u:a}${d}`)});let n=e.map(i=>i.length).reduce((i,l)=>l>i?l:i,0),s="-".repeat(n);return`
18
18
  ${s}
19
19
  ${e.join(`
20
20
  `)}
21
21
  ${s}
22
- `}function qi(r){let e=[];if(r.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${sl(r.from)}</div>`),r.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${Zt(r.subject)}</div>`),r.date){let n={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},s=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",n).format(new Date(r.date));e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${Zt(r.date)}">${Zt(s)}</div>`)}return r.to&&r.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${vs(r.to)}</div>`),r.cc&&r.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${vs(r.cc)}</div>`),r.bcc&&r.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${vs(r.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
23
- <div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}function Za(r,e){let t=!1,n="text",s,o=[],i={address:[],comment:[],group:[],text:[],textWasQuoted:[]},l,a,u=!1;for(l=0,a=r.length;l<a;l++){let c=r[l],d=l?r[l-1]:null;if(c.type==="operator")switch(c.value){case"<":n="address",u=!1;break;case"(":n="comment",u=!1;break;case":":n="group",t=!0,u=!1;break;case'"':u=!u,n="text";break;default:n="text",u=!1;break}else c.value&&(n==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),d&&d.noBreak&&i[n].length?(i[n][i[n].length-1]+=c.value,n==="text"&&u&&(i.textWasQuoted[i.textWasQuoted.length-1]=!0)):(i[n].push(c.value),n==="text"&&i.textWasQuoted.push(u)))}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),t){i.text=i.text.join(" ");let c=[];i.group.length&&Kr(i.group.join(","),{_depth:e+1}).forEach(f=>{f.group?c=c.concat(f.group):c.push(f)}),o.push({name:Gr(i.text||s&&s.name),group:c})}else{if(!i.address.length&&i.text.length){for(l=i.text.length-1;l>=0;l--)if(!i.textWasQuoted[l]&&i.text[l].match(/^[^@\s]+@[^@\s]+$/)){i.address=i.text.splice(l,1),i.textWasQuoted.splice(l,1);break}let c=function(d){return i.address.length?d:(i.address=[d.trim()]," ")};if(!i.address.length)for(l=i.text.length-1;l>=0&&!(!i.textWasQuoted[l]&&(i.text[l]=i.text[l].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),i.address.length));l--);}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),i.address.length>1&&(i.text=i.text.concat(i.address.splice(1))),i.text=i.text.join(" "),i.address=i.address.join(" "),!i.address&&/^=\?[^=]+?=$/.test(i.text.trim())){const c=Kr(Gr(i.text));if(c&&c.length)return c}if(!i.address&&t)return[];s={address:i.address||i.text||"",name:Gr(i.text||i.address||"")},s.address===s.name&&((s.address||"").match(/@/)?s.name="":s.address=""),o.push(s)}return o}class eu{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e=[];for(let t=0,n=this.str.length;t<n;t++){let s=this.str.charAt(t),o=t<n-1?this.str.charAt(t+1):null;this.checkChar(s,o)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(!this.escaped){if(e===this.operatorExpecting){this.node={type:"operator",value:e},t&&![" "," ","\r",`
22
+ `}function Ui(r){let e=[];if(r.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${il(r.from)}</div>`),r.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${er(r.subject)}</div>`),r.date){let n={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},s=typeof Intl>"u"?r.date:new Intl.DateTimeFormat("default",n).format(new Date(r.date));e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${er(r.date)}">${er(s)}</div>`)}return r.to&&r.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${Cs(r.to)}</div>`),r.cc&&r.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Cs(r.cc)}</div>`),r.bcc&&r.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Cs(r.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
23
+ <div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}function Za(r,e){let t=!1,n="text",s,o=[],i={address:[],comment:[],group:[],text:[],textWasQuoted:[]},l,a,u=!1;for(l=0,a=r.length;l<a;l++){let c=r[l],d=l?r[l-1]:null;if(c.type==="operator")switch(c.value){case"<":n="address",u=!1;break;case"(":n="comment",u=!1;break;case":":n="group",t=!0,u=!1;break;case'"':u=!u,n="text";break;default:n="text",u=!1;break}else c.value&&(n==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),d&&d.noBreak&&i[n].length?(i[n][i[n].length-1]+=c.value,n==="text"&&u&&(i.textWasQuoted[i.textWasQuoted.length-1]=!0)):(i[n].push(c.value),n==="text"&&i.textWasQuoted.push(u)))}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),t){i.text=i.text.join(" ");let c=[];i.group.length&&Vr(i.group.join(","),{_depth:e+1}).forEach(f=>{f.group?c=c.concat(f.group):c.push(f)}),o.push({name:Kr(i.text||s&&s.name),group:c})}else{if(!i.address.length&&i.text.length){for(l=i.text.length-1;l>=0;l--)if(!i.textWasQuoted[l]&&i.text[l].match(/^[^@\s]+@[^@\s]+$/)){i.address=i.text.splice(l,1),i.textWasQuoted.splice(l,1);break}let c=function(d){return i.address.length?d:(i.address=[d.trim()]," ")};if(!i.address.length)for(l=i.text.length-1;l>=0&&!(!i.textWasQuoted[l]&&(i.text[l]=i.text[l].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),i.address.length));l--);}if(!i.text.length&&i.comment.length&&(i.text=i.comment,i.comment=[]),i.address.length>1&&(i.text=i.text.concat(i.address.splice(1))),i.text=i.text.join(" "),i.address=i.address.join(" "),!i.address&&/^=\?[^=]+?=$/.test(i.text.trim())){const c=Vr(Kr(i.text));if(c&&c.length)return c}if(!i.address&&t)return[];s={address:i.address||i.text||"",name:Kr(i.text||i.address||"")},s.address===s.name&&((s.address||"").match(/@/)?s.name="":s.address=""),o.push(s)}return o}class eu{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e=[];for(let t=0,n=this.str.length;t<n;t++){let s=this.str.charAt(t),o=t<n-1?this.str.charAt(t+1):null;this.checkChar(s,o)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(!this.escaped){if(e===this.operatorExpecting){this.node={type:"operator",value:e},t&&![" "," ","\r",`
24
24
  `,",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&e in this.operators){this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],this.escaped=!1;return}else if(['"',"'"].includes(this.operatorExpecting)&&e==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),e===`
25
- `&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}}const tu=50;function Kr(r,e){e=e||{};let t=e._depth||0;if(t>tu)return[];let s=new eu(r).tokenize(),o=[],i=[],l=[];if(s.forEach(a=>{a.type==="operator"&&(a.value===","||a.value===";")?(i.length&&o.push(i),i=[]):i.push(a)}),i.length&&o.push(i),o.forEach(a=>{a=Za(a,t),a.length&&(l=l.concat(a))}),e.flatten){let a=[],u=c=>{c.forEach(d=>{if(d.group)return u(d.group);a.push(d)})};return u(l),a}return l}function ru(r){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(r),s=n.byteLength,o=s%3,i=s-o,l,a,u,c,d,f=0;f<i;f=f+3)d=n[f]<<16|n[f+1]<<8|n[f+2],l=(d&16515072)>>18,a=(d&258048)>>12,u=(d&4032)>>6,c=d&63,e+=t[l]+t[a]+t[u]+t[c];return o==1?(d=n[i],l=(d&252)>>2,a=(d&3)<<4,e+=t[l]+t[a]+"=="):o==2&&(d=n[i]<<8|n[i+1],l=(d&64512)>>10,a=(d&1008)>>4,u=(d&15)<<2,e+=t[l]+t[a]+t[u]+"="),e}const nu=256,su=2*1024*1024;class Ln{static parse(e,t){return new Ln(t).parse(e)}constructor(e){this.options=e||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||nu,maxHeadersSize:this.options.maxHeadersSize||su},this.root=this.currentNode=new $i({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,t){let n=this.boundaries;if(n.length&&e.length>2&&e[0]===45&&e[1]===45)for(let s=n.length-1;s>=0;s--){let o=n[s];if(e.length!==o.value.length+2&&e.length!==o.value.length+4)continue;let i=e.length===o.value.length+4;if(i&&(e[e.length-2]!==45||e[e.length-1]!==45))continue;let l=!0;for(let a=0;a<o.value.length;a++)if(e[a+2]!==o.value[a]){l=!1;break}if(l)return i?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new $i({postalMime:this,parentNode:o.node,...this.mimeOptions})),t?this.finalize():void 0}if(this.currentNode.feed(e),t)return this.finalize()}readLine(){let e=this.readPos,t=this.readPos,n=()=>({bytes:new Uint8Array(this.buf,e,t-e),done:this.readPos>=this.av.length});for(;this.readPos<this.av.length;){const s=this.av[this.readPos++];if(s!==13&&s!==10&&(t=this.readPos),s===10)return n()}return n()}async processNodeTree(){let e={},t=new Set,n=this.textMap=new Map,s=this.forceRfc822Attachments(),o=async(i,l,a)=>{if(l=l||!1,a=a||!1,i.contentType.multipart)i.contentType.multipart==="alternative"?l=i:i.contentType.multipart==="related"&&(a=i);else if(this.isInlineMessageRfc822(i)&&!s){const u=new Ln;i.subMessage=await u.parse(i.content),n.has(i)||n.set(i,{});let c=n.get(i);(i.subMessage.text||!i.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:i.subMessage}),t.add("plain")),i.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:i.subMessage}),t.add("html")),u.textMap&&u.textMap.forEach((d,f)=>{n.set(f,d)});for(let d of i.subMessage.attachments||[])this.attachments.push(d)}else if(this.isInlineTextNode(i)){let u=i.contentType.parsed.value.substr(i.contentType.parsed.value.indexOf("/")+1),c=l||i;n.has(c)||n.set(c,{});let d=n.get(c);d[u]=d[u]||[],d[u].push({type:"text",value:i.getTextContent()}),t.add(u)}else if(i.content){const u=i.contentDisposition.parsed.params.filename||i.contentType.parsed.params.name||null,c={filename:u?Gr(u):null,mimeType:i.contentType.parsed.value,disposition:i.contentDisposition.parsed.value||null};switch(a&&i.contentId&&(c.related=!0),i.contentDescription&&(c.description=i.contentDescription),i.contentId&&(c.contentId=i.contentId),i.contentType.parsed.value){case"text/calendar":case"application/ics":{i.contentType.parsed.params.method&&(c.method=i.contentType.parsed.params.method.toString().toUpperCase().trim());const d=i.getTextContent().replace(/\r?\n/g,`
25
+ `&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}}const tu=50;function Vr(r,e){e=e||{};let t=e._depth||0;if(t>tu)return[];let s=new eu(r).tokenize(),o=[],i=[],l=[];if(s.forEach(a=>{a.type==="operator"&&(a.value===","||a.value===";")?(i.length&&o.push(i),i=[]):i.push(a)}),i.length&&o.push(i),o.forEach(a=>{a=Za(a,t),a.length&&(l=l.concat(a))}),e.flatten){let a=[],u=c=>{c.forEach(d=>{if(d.group)return u(d.group);a.push(d)})};return u(l),a}return l}function ru(r){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(r),s=n.byteLength,o=s%3,i=s-o,l,a,u,c,d,f=0;f<i;f=f+3)d=n[f]<<16|n[f+1]<<8|n[f+2],l=(d&16515072)>>18,a=(d&258048)>>12,u=(d&4032)>>6,c=d&63,e+=t[l]+t[a]+t[u]+t[c];return o==1?(d=n[i],l=(d&252)>>2,a=(d&3)<<4,e+=t[l]+t[a]+"=="):o==2&&(d=n[i]<<8|n[i+1],l=(d&64512)>>10,a=(d&1008)>>4,u=(d&15)<<2,e+=t[l]+t[a]+t[u]+"="),e}const nu=256,su=2*1024*1024;class Ln{static parse(e,t){return new Ln(t).parse(e)}constructor(e){this.options=e||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||nu,maxHeadersSize:this.options.maxHeadersSize||su},this.root=this.currentNode=new Ii({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,t){let n=this.boundaries;if(n.length&&e.length>2&&e[0]===45&&e[1]===45)for(let s=n.length-1;s>=0;s--){let o=n[s];if(e.length!==o.value.length+2&&e.length!==o.value.length+4)continue;let i=e.length===o.value.length+4;if(i&&(e[e.length-2]!==45||e[e.length-1]!==45))continue;let l=!0;for(let a=0;a<o.value.length;a++)if(e[a+2]!==o.value[a]){l=!1;break}if(l)return i?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new Ii({postalMime:this,parentNode:o.node,...this.mimeOptions})),t?this.finalize():void 0}if(this.currentNode.feed(e),t)return this.finalize()}readLine(){let e=this.readPos,t=this.readPos,n=()=>({bytes:new Uint8Array(this.buf,e,t-e),done:this.readPos>=this.av.length});for(;this.readPos<this.av.length;){const s=this.av[this.readPos++];if(s!==13&&s!==10&&(t=this.readPos),s===10)return n()}return n()}async processNodeTree(){let e={},t=new Set,n=this.textMap=new Map,s=this.forceRfc822Attachments(),o=async(i,l,a)=>{if(l=l||!1,a=a||!1,i.contentType.multipart)i.contentType.multipart==="alternative"?l=i:i.contentType.multipart==="related"&&(a=i);else if(this.isInlineMessageRfc822(i)&&!s){const u=new Ln;i.subMessage=await u.parse(i.content),n.has(i)||n.set(i,{});let c=n.get(i);(i.subMessage.text||!i.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:i.subMessage}),t.add("plain")),i.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:i.subMessage}),t.add("html")),u.textMap&&u.textMap.forEach((d,f)=>{n.set(f,d)});for(let d of i.subMessage.attachments||[])this.attachments.push(d)}else if(this.isInlineTextNode(i)){let u=i.contentType.parsed.value.substr(i.contentType.parsed.value.indexOf("/")+1),c=l||i;n.has(c)||n.set(c,{});let d=n.get(c);d[u]=d[u]||[],d[u].push({type:"text",value:i.getTextContent()}),t.add(u)}else if(i.content){const u=i.contentDisposition.parsed.params.filename||i.contentType.parsed.params.name||null,c={filename:u?Kr(u):null,mimeType:i.contentType.parsed.value,disposition:i.contentDisposition.parsed.value||null};switch(a&&i.contentId&&(c.related=!0),i.contentDescription&&(c.description=i.contentDescription),i.contentId&&(c.contentId=i.contentId),i.contentType.parsed.value){case"text/calendar":case"application/ics":{i.contentType.parsed.params.method&&(c.method=i.contentType.parsed.params.method.toString().toUpperCase().trim());const d=i.getTextContent().replace(/\r?\n/g,`
26
26
  `).replace(/\n*$/,`
27
- `);c.content=Cr.encode(d);break}default:c.content=i.content}this.attachments.push(c)}for(let u of i.childNodes)await o(u,l,a)};await o(this.root,!1,[]),n.forEach(i=>{t.forEach(l=>{if(e[l]||(e[l]=[]),i[l])i[l].forEach(a=>{switch(a.type){case"text":e[l].push(a.value);break;case"subMessage":switch(l){case"html":e[l].push(qi(a.value));break;case"plain":e[l].push(zi(a.value));break}break}});else{let a;switch(l){case"html":a="plain";break;case"plain":a="html";break}(i[a]||[]).forEach(u=>{switch(u.type){case"text":switch(l){case"html":e[l].push(Qa(u.value));break;case"plain":e[l].push(Ya(u.value));break}break;case"subMessage":switch(l){case"html":e[l].push(qi(u.value));break;case"plain":e[l].push(zi(u.value));break}break}})}})}),Object.keys(e).forEach(i=>{e[i]=e[i].join(`
28
- `)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed.value!=="message/rfc822"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,t=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)t(s)};return t(this.root),e}async resolveStream(e){let t=0,n=[];const s=e.getReader();for(;;){const{done:l,value:a}=await s.read();if(l)break;n.push(a),t+=a.length}const o=new Uint8Array(t);let i=0;for(let l of n)o.set(l,i),i+=l.length;return o}async parse(e){var s,o;if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=Cr.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await es(e)),e.buffer instanceof ArrayBuffer&&(e=new Uint8Array(e).buffer),this.buf=e,this.av=new Uint8Array(e),this.readPos=0;this.readPos<this.av.length;){const i=this.readLine();await this.processLine(i.bytes,i.done)}await this.processNodeTree();const t={headers:this.root.headers.map(i=>({key:i.key,value:i.value})).reverse()};for(const i of["from","sender"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Kr(l.value);a&&a.length&&(t[i]=a[0])}}for(const i of["delivered-to","return-path"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Kr(l.value);if(a&&a.length&&a[0].address){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a[0].address}}}for(const i of["to","cc","bcc","reply-to"]){const l=this.root.headers.filter(u=>u.key===i);let a=[];if(l.filter(u=>u&&u.value).map(u=>Kr(u.value)).forEach(u=>a=a.concat(u||[])),a&&a.length){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a}}for(const i of["subject","message-id","in-reply-to","references"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=i.replace(/\-(.)/g,(u,c)=>c.toUpperCase());t[a]=Gr(l.value)}}let n=this.root.headers.find(i=>i.key==="date");if(n){let i=new Date(n.value);!i||i.toString()==="Invalid Date"?i=n.value:i=i.toISOString(),t.date=i}switch((s=this.textContent)!=null&&s.html&&(t.html=this.textContent.html),(o=this.textContent)!=null&&o.plain&&(t.text=this.textContent.plain),t.attachments=this.attachments,this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let l of t.attachments||[])l!=null&&l.content&&(l.content=ru(l.content),l.encoding="base64");break;case"utf8":let i=new TextDecoder("utf8");for(let l of t.attachments||[])l!=null&&l.content&&(l.content=i.decode(l.content),l.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return t}}class il{constructor(e){Fr(this,"config");if(!e.system_id)throw new Error("MailClient: system_id is REQUIRED");this.config=e}async callCoprocessor(e,t,n={}){const s={coprocessor:e,method:t,system_id:this.config.system_id,params:{user_id:this.config.system_id,...n}};try{const o=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(s)});if(!o.ok){const l=await o.text();throw new Error(`API error (${o.status}): ${l}`)}const i=await o.json();if(!i.success&&i.error)throw new Error(i.error);return i.result}catch(o){throw console.error("API call failed:",o),o}}async callMail(e,t={}){return this.callCoprocessor("mail",e,t)}async callEmail(e,t={}){return this.callCoprocessor("email",e,t)}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getSettings(){try{return await this.callMail("get_email_settings")||{accounts:[]}}catch{return{accounts:[]}}}async saveSettings(e){await this.callMail("save_email_settings",{accounts:e})}async listEmails(e,t=150,n){return this.callMail("list_emails",{account_id:e,limit:t,folder:n})}async deleteEmails(e,t,n=!0){return this.callMail("delete_emails",{account_id:e,uids:t,expunge:n})}async imapExec(e,t){return this.callMail("imap_exec",{account_id:e,commands:t})}async trashEmails(e,t,n="INBOX"){const s=["[Gmail]/Trash","[Gmail]/Corbeille","[Gmail]/Bin","Trash"];for(const o of s){const i=[`SELECT "${n}"`,...t.map(u=>`UID MOVE ${u} "${o}"`)],a=(await this.imapExec(e,i)).responses.filter(u=>u.ok&&u.command==="UID MOVE").length;if(a>0)return{success:!0,moved:a}}return{success:!1,moved:0}}async archiveEmails(e,t,n="INBOX"){const s=[`SELECT "${n}"`,...t.map(l=>`UID STORE ${l} +FLAGS (\\Deleted)`),"EXPUNGE"],i=(await this.imapExec(e,s)).responses.filter(l=>l.ok&&l.command==="UID STORE").length;return{success:i>0,archived:i}}async listFolders(e){const n=(await this.imapExec(e,['LIST "" *'])).responses.find(s=>s.command==="LIST");return n!=null&&n.ok&&n.folders?{success:!0,folders:n.folders}:{success:!1,folders:[]}}async listEmailsSorted(e,t="INBOX",n=150){const s=await this.imapExec(e,[`SELECT ${t}`,"FETCH 1:* (UID INTERNALDATE)"]),o=s.responses.find(h=>h.command==="SELECT");if(!(o!=null&&o.ok))throw new Error(`Failed to select folder: ${(o==null?void 0:o.error)||"Unknown error"}`);const i=s.responses.find(h=>h.command==="FETCH");if(!(i!=null&&i.ok)||!i.messages)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const a=[...i.messages].sort((h,p)=>{const m=h.internalDate?new Date(h.internalDate).getTime():0;return(p.internalDate?new Date(p.internalDate).getTime():0)-m}).slice(0,n).map(h=>h.uid).filter(Boolean);if(a.length===0)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const c=(await this.imapExec(e,[`SELECT ${t}`,`UID FETCH ${a.join(",")} (UID FLAGS ENVELOPE)`])).responses.find(h=>h.command==="UID FETCH");if(!(c!=null&&c.ok)||!c.messages)throw new Error(`Failed to fetch details: ${(c==null?void 0:c.error)||"Unknown error"}`);const d=new Map;for(const h of c.messages)h.uid&&d.set(h.uid,h);const f=a.map(h=>{var A,_,E,C,v;const p=d.get(h);if(!p)return null;const m=((A=p.flags)==null?void 0:A.some(S=>S.includes("Seen")))||!1,b=((E=(_=p.envelope)==null?void 0:_.from)==null?void 0:E.email)||"Unknown",D=((C=p.envelope)==null?void 0:C.subject)||"(No subject)",y=((v=p.envelope)==null?void 0:v.date)||"";return{uid:h,from:b,subject:D,date:y,seen:m}}).filter(Boolean);return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:f}}async getEmail(e,t,n="INBOX"){return this.callMail("get_email",{account_id:e,uid:t,folder:n})}async getAttachment(e,t,n,s="INBOX"){return this.callMail("get_attachment",{account_id:e,uid:t,attachment_index:n,folder:s})}async searchContactEmails(e,t,n=50){return this.callMail("search_contact_emails",{account_id:e,contact_email:t,limit:n})}async getEmailParsed(e,t,n="INBOX"){var p,m,b,D,y,A;const o=(await this.imapExec(e,[`SELECT "${n}"`,`UID FETCH ${t} (FLAGS BODY[])`])).responses.find(_=>_.command==="UID FETCH");if(!(o!=null&&o.ok)||!((p=o.messages)!=null&&p[0]))return console.error("Failed to fetch raw email:",o==null?void 0:o.error),null;const i=o.messages[0],l=i.body||i.raw;if(!l)return console.error("No raw email content in response"),null;const u=await new Ln().parse(l);console.log("[MailClient] Parsed email - attachments count:",((m=u.attachments)==null?void 0:m.length)||0),console.log("[MailClient] Parsed attachments:",(b=u.attachments)==null?void 0:b.map(_=>({filename:_.filename,mimeType:_.mimeType,contentId:_.contentId})));const c=new Map;for(const _ of u.attachments||[])if(_.contentId){const E=this.contentToBase64(_.content),C=`data:${_.mimeType};base64,${E}`,v=_.contentId.replace(/^<|>$/g,"");c.set(v,C),c.set(`<${v}>`,C)}let d=u.html||"";d&&c.size>0&&(d=d.replace(/src=["']cid:([^"']+)["']/gi,(_,E)=>{const C=c.get(E)||c.get(`<${E}>`);return C?`src="${C}"`:_}));const f=((D=i.flags)==null?void 0:D.some(_=>_.toLowerCase().includes("seen")))||!1,h=((y=u.from)==null?void 0:y.address)||((A=u.from)==null?void 0:A.name)||"Unknown";return{uid:t,from:h,subject:u.subject||"(No subject)",date:u.date||"",body:d||u.text||"",html:d,text:u.text||"",seen:f,attachments:(u.attachments||[]).map(_=>({filename:_.filename||"attachment",mimeType:_.mimeType||"application/octet-stream",size:this.getContentSize(_.content)}))}}contentToBase64(e){if(typeof e=="string")try{return btoa(e)}catch{return e}const t=e instanceof Uint8Array?e:new Uint8Array(e);let n="";for(let s=0;s<t.byteLength;s++)n+=String.fromCharCode(t[s]);return btoa(n)}getContentSize(e){return e?typeof e=="string"?e.length:(e instanceof Uint8Array,e.byteLength):0}async sendMail(e){const t={to:e.to,subject:e.subject,body:e.body};return e.html&&(t.html=e.html),e.from&&(t.from=e.from),e.smtpConfig&&(t.smtp_config=e.smtpConfig),this.callEmail("send",t)}async sendEmail(e,t){var n,s;try{const o=await this.getSettings(),i=((n=o.accounts)==null?void 0:n.find(u=>u.id===e))||((s=o.accounts)==null?void 0:s[0]);if(!(i!=null&&i.smtp))return{success:!1,error:"No SMTP configuration found for account"};const l={to:Array.isArray(t.to)?t.to:[t.to],subject:t.subject,body:t.text||"",html:t.html,from:i.email,smtp_config:{host:i.smtp.host,port:parseInt(i.smtp.port,10)||587,username:i.smtp.user,password:i.smtp.password}};t.in_reply_to&&(l.in_reply_to=t.in_reply_to),t.attachments&&t.attachments.length>0&&(l.attachments=t.attachments);const a=await this.callEmail("send",l);return{success:(a==null?void 0:a.sent)??!1,message_id:a==null?void 0:a.message_id,error:a==null?void 0:a.error}}catch(o){return{success:!1,error:o instanceof Error?o.message:String(o)}}}}const Cs="qwanyx_auth_token",ws="qwanyx_refresh_token";class ol{static setToken(e){typeof window<"u"&&localStorage.setItem(Cs,e)}static getToken(){return typeof window<"u"?localStorage.getItem(Cs):null}static clearToken(){typeof window<"u"&&(localStorage.removeItem(Cs),localStorage.removeItem(ws))}static setRefreshToken(e){typeof window<"u"&&localStorage.setItem(ws,e)}static getRefreshToken(){return typeof window<"u"?localStorage.getItem(ws):null}static isAuthenticated(){return!!this.getToken()}static getAuthHeader(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}}class ll{constructor(e){Fr(this,"config");this.config={timeout:3e4,headers:{"Content-Type":"application/json"},...e}}buildQueryString(e){if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o!=null&&t.append(s,String(o))});const n=t.toString();return n?`?${n}`:""}async request(e,t={}){const{method:n="GET",headers:s={},body:o,params:i}=t,l=`${this.config.baseUrl}/${e}${this.buildQueryString(i)}`,a={...this.config.headers,...ol.getAuthHeader(),...s},u={method:n,headers:a};o&&n!=="GET"&&(u.body=JSON.stringify(o));try{const c=new AbortController,d=setTimeout(()=>c.abort(),this.config.timeout),f=await fetch(l,{...u,signal:c.signal});if(clearTimeout(d),!f.ok){const h=await f.json().catch(()=>({message:f.statusText}));throw new Error(h.message||`HTTP ${f.status}`)}return await f.json()}catch(c){throw c instanceof Error?c:new Error("An unexpected error occurred")}}async get(e,t){return this.request(e,{method:"GET",params:t})}async post(e,t,n){return this.request(e,{method:"POST",body:t,params:n})}async put(e,t,n){return this.request(e,{method:"PUT",body:t,params:n})}async patch(e,t,n){return this.request(e,{method:"PATCH",body:t,params:n})}async delete(e,t){return this.request(e,{method:"DELETE",params:t})}setBaseUrl(e){this.config.baseUrl=e}getBaseUrl(){return this.config.baseUrl}}let jn=null;function iu(r){return jn=new ll(r),jn}function ii(){if(!jn)throw new Error("API client not initialized. Call initializeApiClient() first.");return jn}function al(r,e,t={}){const{enabled:n=!0,refetchOnMount:s=!0,onSuccess:o,onError:i}=t,[l,a]=w.useState(null),[u,c]=w.useState(n),[d,f]=w.useState(null),h=w.useCallback(async()=>{if(n){c(!0),f(null);try{const m=await ii().get(r,e);a(m),o==null||o(m)}catch(p){const m=p instanceof Error?p:new Error("Unknown error");f(m),i==null||i(m)}finally{c(!1)}}},[r,JSON.stringify(e),n,o,i]);return w.useEffect(()=>{s&&h()},[h,s]),{data:l,loading:u,error:d,refetch:h}}function ou(r,e="POST",t={}){const{onSuccess:n,onError:s}=t,[o,i]=w.useState(null),[l,a]=w.useState(!1),[u,c]=w.useState(null),d=w.useCallback(async h=>{a(!0),c(null);try{const p=ii();let m;switch(e){case"POST":m=await p.post(r,h);break;case"PUT":m=await p.put(r,h);break;case"PATCH":m=await p.patch(r,h);break;case"DELETE":m=await p.delete(r);break;default:throw new Error(`Unsupported method: ${e}`)}return i(m),n==null||n(m,h),m}catch(p){const m=p instanceof Error?p:new Error("Unknown error");return c(m),s==null||s(m,h),null}finally{a(!1)}},[r,e,n,s]),f=w.useCallback(()=>{i(null),c(null),a(!1)},[]);return{data:o,loading:l,error:u,mutate:d,reset:f}}var Ps={exports:{}},Lr={};/**
27
+ `);c.content=Dr.encode(d);break}default:c.content=i.content}this.attachments.push(c)}for(let u of i.childNodes)await o(u,l,a)};await o(this.root,!1,[]),n.forEach(i=>{t.forEach(l=>{if(e[l]||(e[l]=[]),i[l])i[l].forEach(a=>{switch(a.type){case"text":e[l].push(a.value);break;case"subMessage":switch(l){case"html":e[l].push(Ui(a.value));break;case"plain":e[l].push(qi(a.value));break}break}});else{let a;switch(l){case"html":a="plain";break;case"plain":a="html";break}(i[a]||[]).forEach(u=>{switch(u.type){case"text":switch(l){case"html":e[l].push(Qa(u.value));break;case"plain":e[l].push(Ya(u.value));break}break;case"subMessage":switch(l){case"html":e[l].push(Ui(u.value));break;case"plain":e[l].push(qi(u.value));break}break}})}})}),Object.keys(e).forEach(i=>{e[i]=e[i].join(`
28
+ `)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition.parsed.value==="attachment")return!1;switch(e.contentType.parsed.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed.value!=="message/rfc822"?!1:(e.contentDisposition.parsed.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,t=n=>{n.contentType.multipart||["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let s of n.childNodes)t(s)};return t(this.root),e}async resolveStream(e){let t=0,n=[];const s=e.getReader();for(;;){const{done:l,value:a}=await s.read();if(l)break;n.push(a),t+=a.length}const o=new Uint8Array(t);let i=0;for(let l of n)o.set(l,i),i+=l.length;return o}async parse(e){var s,o;if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=Dr.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await es(e)),e.buffer instanceof ArrayBuffer&&(e=new Uint8Array(e).buffer),this.buf=e,this.av=new Uint8Array(e),this.readPos=0;this.readPos<this.av.length;){const i=this.readLine();await this.processLine(i.bytes,i.done)}await this.processNodeTree();const t={headers:this.root.headers.map(i=>({key:i.key,value:i.value})).reverse()};for(const i of["from","sender"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Vr(l.value);a&&a.length&&(t[i]=a[0])}}for(const i of["delivered-to","return-path"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=Vr(l.value);if(a&&a.length&&a[0].address){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a[0].address}}}for(const i of["to","cc","bcc","reply-to"]){const l=this.root.headers.filter(u=>u.key===i);let a=[];if(l.filter(u=>u&&u.value).map(u=>Vr(u.value)).forEach(u=>a=a.concat(u||[])),a&&a.length){const u=i.replace(/\-(.)/g,(c,d)=>d.toUpperCase());t[u]=a}}for(const i of["subject","message-id","in-reply-to","references"]){const l=this.root.headers.find(a=>a.key===i);if(l&&l.value){const a=i.replace(/\-(.)/g,(u,c)=>c.toUpperCase());t[a]=Kr(l.value)}}let n=this.root.headers.find(i=>i.key==="date");if(n){let i=new Date(n.value);!i||i.toString()==="Invalid Date"?i=n.value:i=i.toISOString(),t.date=i}switch((s=this.textContent)!=null&&s.html&&(t.html=this.textContent.html),(o=this.textContent)!=null&&o.plain&&(t.text=this.textContent.plain),t.attachments=this.attachments,this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let l of t.attachments||[])l!=null&&l.content&&(l.content=ru(l.content),l.encoding="base64");break;case"utf8":let i=new TextDecoder("utf8");for(let l of t.attachments||[])l!=null&&l.content&&(l.content=i.decode(l.content),l.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return t}}class ol{constructor(e){Lr(this,"config");if(!e.system_id)throw new Error("MailClient: system_id is REQUIRED");this.config=e}async callCoprocessor(e,t,n={}){const s={coprocessor:e,method:t,system_id:this.config.system_id,params:{user_id:this.config.system_id,...n}};try{const o=await fetch(`${this.config.baseUrl}/spu/invoke`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.getToken()}`},body:JSON.stringify(s)});if(!o.ok){const l=await o.text();throw new Error(`API error (${o.status}): ${l}`)}const i=await o.json();if(!i.success&&i.error)throw new Error(i.error);return i.result}catch(o){throw console.error("API call failed:",o),o}}async callMail(e,t={}){return this.callCoprocessor("mail",e,t)}async callEmail(e,t={}){return this.callCoprocessor("email",e,t)}getToken(){return typeof window<"u"&&window.localStorage&&localStorage.getItem("qwanyx_token")||""}async getSettings(){try{return await this.callMail("get_email_settings")||{accounts:[]}}catch{return{accounts:[]}}}async saveSettings(e){await this.callMail("save_email_settings",{accounts:e})}async listEmails(e,t=150,n){return this.callMail("list_emails",{account_id:e,limit:t,folder:n})}async deleteEmails(e,t,n=!0){return this.callMail("delete_emails",{account_id:e,uids:t,expunge:n})}async imapExec(e,t){return this.callMail("imap_exec",{account_id:e,commands:t})}async trashEmails(e,t,n="INBOX"){const s=["[Gmail]/Trash","[Gmail]/Corbeille","[Gmail]/Bin","Trash"];for(const o of s){const i=[`SELECT "${n}"`,...t.map(u=>`UID MOVE ${u} "${o}"`)],a=(await this.imapExec(e,i)).responses.filter(u=>u.ok&&u.command==="UID MOVE").length;if(a>0)return{success:!0,moved:a}}return{success:!1,moved:0}}async archiveEmails(e,t,n="INBOX"){const s=[`SELECT "${n}"`,...t.map(l=>`UID STORE ${l} +FLAGS (\\Deleted)`),"EXPUNGE"],i=(await this.imapExec(e,s)).responses.filter(l=>l.ok&&l.command==="UID STORE").length;return{success:i>0,archived:i}}async listFolders(e){const n=(await this.imapExec(e,['LIST "" *'])).responses.find(s=>s.command==="LIST");return n!=null&&n.ok&&n.folders?{success:!0,folders:n.folders}:{success:!1,folders:[]}}async listEmailsSorted(e,t="INBOX",n=150){const s=await this.imapExec(e,[`SELECT ${t}`,"FETCH 1:* (UID INTERNALDATE)"]),o=s.responses.find(h=>h.command==="SELECT");if(!(o!=null&&o.ok))throw new Error(`Failed to select folder: ${(o==null?void 0:o.error)||"Unknown error"}`);const i=s.responses.find(h=>h.command==="FETCH");if(!(i!=null&&i.ok)||!i.messages)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const a=[...i.messages].sort((h,p)=>{const m=h.internalDate?new Date(h.internalDate).getTime():0;return(p.internalDate?new Date(p.internalDate).getTime():0)-m}).slice(0,n).map(h=>h.uid).filter(Boolean);if(a.length===0)return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:[]};const c=(await this.imapExec(e,[`SELECT ${t}`,`UID FETCH ${a.join(",")} (UID FLAGS ENVELOPE)`])).responses.find(h=>h.command==="UID FETCH");if(!(c!=null&&c.ok)||!c.messages)throw new Error(`Failed to fetch details: ${(c==null?void 0:c.error)||"Unknown error"}`);const d=new Map;for(const h of c.messages)h.uid&&d.set(h.uid,h);const f=a.map(h=>{var A,C,E,v,_;const p=d.get(h);if(!p)return null;const m=((A=p.flags)==null?void 0:A.some(S=>S.includes("Seen")))||!1,x=((E=(C=p.envelope)==null?void 0:C.from)==null?void 0:E.email)||"Unknown",D=((v=p.envelope)==null?void 0:v.subject)||"(No subject)",y=((_=p.envelope)==null?void 0:_.date)||"";return{uid:h,from:x,subject:D,date:y,seen:m}}).filter(Boolean);return{account:{id:e,label:"",email:""},mailbox:{name:t,total:o.exists||0},messages:f}}async getEmail(e,t,n="INBOX"){return this.callMail("get_email",{account_id:e,uid:t,folder:n})}async getAttachment(e,t,n,s="INBOX"){return this.callMail("get_attachment",{account_id:e,uid:t,attachment_index:n,folder:s})}async searchContactEmails(e,t,n=50){return this.callMail("search_contact_emails",{account_id:e,contact_email:t,limit:n})}async getEmailParsed(e,t,n="INBOX"){var p,m,x,D,y,A;const o=(await this.imapExec(e,[`SELECT "${n}"`,`UID FETCH ${t} (FLAGS BODY[])`])).responses.find(C=>C.command==="UID FETCH");if(!(o!=null&&o.ok)||!((p=o.messages)!=null&&p[0]))return console.error("Failed to fetch raw email:",o==null?void 0:o.error),null;const i=o.messages[0],l=i.body||i.raw;if(!l)return console.error("No raw email content in response"),null;const u=await new Ln().parse(l);console.log("[MailClient] Parsed email - attachments count:",((m=u.attachments)==null?void 0:m.length)||0),console.log("[MailClient] Parsed attachments:",(x=u.attachments)==null?void 0:x.map(C=>({filename:C.filename,mimeType:C.mimeType,contentId:C.contentId})));const c=new Map;for(const C of u.attachments||[])if(C.contentId){const E=this.contentToBase64(C.content),v=`data:${C.mimeType};base64,${E}`,_=C.contentId.replace(/^<|>$/g,"");c.set(_,v),c.set(`<${_}>`,v)}let d=u.html||"";d&&c.size>0&&(d=d.replace(/src=["']cid:([^"']+)["']/gi,(C,E)=>{const v=c.get(E)||c.get(`<${E}>`);return v?`src="${v}"`:C}));const f=((D=i.flags)==null?void 0:D.some(C=>C.toLowerCase().includes("seen")))||!1,h=((y=u.from)==null?void 0:y.address)||((A=u.from)==null?void 0:A.name)||"Unknown";return{uid:t,from:h,subject:u.subject||"(No subject)",date:u.date||"",body:d||u.text||"",html:d,text:u.text||"",seen:f,attachments:(u.attachments||[]).map(C=>({filename:C.filename||"attachment",mimeType:C.mimeType||"application/octet-stream",size:this.getContentSize(C.content)}))}}contentToBase64(e){if(typeof e=="string")try{return btoa(e)}catch{return e}const t=e instanceof Uint8Array?e:new Uint8Array(e);let n="";for(let s=0;s<t.byteLength;s++)n+=String.fromCharCode(t[s]);return btoa(n)}getContentSize(e){return e?typeof e=="string"?e.length:(e instanceof Uint8Array,e.byteLength):0}async sendMail(e){const t={to:e.to,subject:e.subject,body:e.body};return e.html&&(t.html=e.html),e.from&&(t.from=e.from),e.smtpConfig&&(t.smtp_config=e.smtpConfig),this.callEmail("send",t)}async sendEmail(e,t){var n,s;try{const o=await this.getSettings(),i=((n=o.accounts)==null?void 0:n.find(u=>u.id===e))||((s=o.accounts)==null?void 0:s[0]);if(!(i!=null&&i.smtp))return{success:!1,error:"No SMTP configuration found for account"};const l={to:Array.isArray(t.to)?t.to:[t.to],subject:t.subject,body:t.text||"",html:t.html,from:i.email,smtp_config:{host:i.smtp.host,port:parseInt(i.smtp.port,10)||587,username:i.smtp.user,password:i.smtp.password}};t.in_reply_to&&(l.in_reply_to=t.in_reply_to),t.attachments&&t.attachments.length>0&&(l.attachments=t.attachments);const a=await this.callEmail("send",l);return{success:(a==null?void 0:a.sent)??!1,message_id:a==null?void 0:a.message_id,error:a==null?void 0:a.error}}catch(o){return{success:!1,error:o instanceof Error?o.message:String(o)}}}}const ws="qwanyx_auth_token",Ds="qwanyx_refresh_token";class ll{static setToken(e){typeof window<"u"&&localStorage.setItem(ws,e)}static getToken(){return typeof window<"u"?localStorage.getItem(ws):null}static clearToken(){typeof window<"u"&&(localStorage.removeItem(ws),localStorage.removeItem(Ds))}static setRefreshToken(e){typeof window<"u"&&localStorage.setItem(Ds,e)}static getRefreshToken(){return typeof window<"u"?localStorage.getItem(Ds):null}static isAuthenticated(){return!!this.getToken()}static getAuthHeader(){const e=this.getToken();return e?{Authorization:`Bearer ${e}`}:{}}}class al{constructor(e){Lr(this,"config");this.config={timeout:3e4,headers:{"Content-Type":"application/json"},...e}}buildQueryString(e){if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([s,o])=>{o!=null&&t.append(s,String(o))});const n=t.toString();return n?`?${n}`:""}async request(e,t={}){const{method:n="GET",headers:s={},body:o,params:i}=t,l=`${this.config.baseUrl}/${e}${this.buildQueryString(i)}`,a={...this.config.headers,...ll.getAuthHeader(),...s},u={method:n,headers:a};o&&n!=="GET"&&(u.body=JSON.stringify(o));try{const c=new AbortController,d=setTimeout(()=>c.abort(),this.config.timeout),f=await fetch(l,{...u,signal:c.signal});if(clearTimeout(d),!f.ok){const h=await f.json().catch(()=>({message:f.statusText}));throw new Error(h.message||`HTTP ${f.status}`)}return await f.json()}catch(c){throw c instanceof Error?c:new Error("An unexpected error occurred")}}async get(e,t){return this.request(e,{method:"GET",params:t})}async post(e,t,n){return this.request(e,{method:"POST",body:t,params:n})}async put(e,t,n){return this.request(e,{method:"PUT",body:t,params:n})}async patch(e,t,n){return this.request(e,{method:"PATCH",body:t,params:n})}async delete(e,t){return this.request(e,{method:"DELETE",params:t})}setBaseUrl(e){this.config.baseUrl=e}getBaseUrl(){return this.config.baseUrl}}let jn=null;function iu(r){return jn=new al(r),jn}function oi(){if(!jn)throw new Error("API client not initialized. Call initializeApiClient() first.");return jn}function ul(r,e,t={}){const{enabled:n=!0,refetchOnMount:s=!0,onSuccess:o,onError:i}=t,[l,a]=w.useState(null),[u,c]=w.useState(n),[d,f]=w.useState(null),h=w.useCallback(async()=>{if(n){c(!0),f(null);try{const m=await oi().get(r,e);a(m),o==null||o(m)}catch(p){const m=p instanceof Error?p:new Error("Unknown error");f(m),i==null||i(m)}finally{c(!1)}}},[r,JSON.stringify(e),n,o,i]);return w.useEffect(()=>{s&&h()},[h,s]),{data:l,loading:u,error:d,refetch:h}}function ou(r,e="POST",t={}){const{onSuccess:n,onError:s}=t,[o,i]=w.useState(null),[l,a]=w.useState(!1),[u,c]=w.useState(null),d=w.useCallback(async h=>{a(!0),c(null);try{const p=oi();let m;switch(e){case"POST":m=await p.post(r,h);break;case"PUT":m=await p.put(r,h);break;case"PATCH":m=await p.patch(r,h);break;case"DELETE":m=await p.delete(r);break;default:throw new Error(`Unsupported method: ${e}`)}return i(m),n==null||n(m,h),m}catch(p){const m=p instanceof Error?p:new Error("Unknown error");return c(m),s==null||s(m,h),null}finally{a(!1)}},[r,e,n,s]),f=w.useCallback(()=>{i(null),c(null),a(!1)},[]);return{data:o,loading:l,error:u,mutate:d,reset:f}}var Os={exports:{}},jr={};/**
29
29
  * @license React
30
30
  * react-jsx-runtime.production.min.js
31
31
  *
@@ -33,7 +33,7 @@ ${s}
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
- */var Ui;function lu(){if(Ui)return Lr;Ui=1;var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(l,a,u){var c,d={},f=null,h=null;u!==void 0&&(f=""+u),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(c in a)n.call(a,c)&&!o.hasOwnProperty(c)&&(d[c]=a[c]);if(l&&l.defaultProps)for(c in a=l.defaultProps,a)d[c]===void 0&&(d[c]=a[c]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:s.current}}return Lr.Fragment=t,Lr.jsx=i,Lr.jsxs=i,Lr}var jr={};/**
36
+ */var Wi;function lu(){if(Wi)return jr;Wi=1;var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function i(l,a,u){var c,d={},f=null,h=null;u!==void 0&&(f=""+u),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(c in a)n.call(a,c)&&!o.hasOwnProperty(c)&&(d[c]=a[c]);if(l&&l.defaultProps)for(c in a=l.defaultProps,a)d[c]===void 0&&(d[c]=a[c]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:s.current}}return jr.Fragment=t,jr.jsx=i,jr.jsxs=i,jr}var Rr={};/**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
39
39
  *
@@ -41,40 +41,40 @@ ${s}
41
41
  *
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
- */var Wi;function au(){return Wi||(Wi=1,process.env.NODE_ENV!=="production"&&function(){var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function b(x){if(x===null||typeof x!="object")return null;var O=p&&x[p]||x[m];return typeof O=="function"?O:null}var D=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(x){{for(var O=arguments.length,K=new Array(O>1?O-1:0),X=1;X<O;X++)K[X-1]=arguments[X];A("error",x,K)}}function A(x,O,K){{var X=D.ReactDebugCurrentFrame,ce=X.getStackAddendum();ce!==""&&(O+="%s",K=K.concat([ce]));var pe=K.map(function(ie){return String(ie)});pe.unshift("Warning: "+O),Function.prototype.apply.call(console[x],console,pe)}}var _=!1,E=!1,C=!1,v=!1,S=!1,k;k=Symbol.for("react.module.reference");function q(x){return!!(typeof x=="string"||typeof x=="function"||x===n||x===o||S||x===s||x===u||x===c||v||x===h||_||E||C||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===d||x.$$typeof===i||x.$$typeof===l||x.$$typeof===a||x.$$typeof===k||x.getModuleId!==void 0))}function B(x,O,K){var X=x.displayName;if(X)return X;var ce=O.displayName||O.name||"";return ce!==""?K+"("+ce+")":K}function F(x){return x.displayName||"Context"}function j(x){if(x==null)return null;if(typeof x.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case n:return"Fragment";case t:return"Portal";case o:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case l:var O=x;return F(O)+".Consumer";case i:var K=x;return F(K._context)+".Provider";case a:return B(x,x.render,"ForwardRef");case d:var X=x.displayName||null;return X!==null?X:j(x.type)||"Memo";case f:{var ce=x,pe=ce._payload,ie=ce._init;try{return j(ie(pe))}catch{return null}}}return null}var L=Object.assign,P=0,Z,ue,fe,we,Ae,Ve,qe;function $e(){}$e.__reactDisabledLog=!0;function Be(){{if(P===0){Z=console.log,ue=console.info,fe=console.warn,we=console.error,Ae=console.group,Ve=console.groupCollapsed,qe=console.groupEnd;var x={configurable:!0,enumerable:!0,value:$e,writable:!0};Object.defineProperties(console,{info:x,log:x,warn:x,error:x,group:x,groupCollapsed:x,groupEnd:x})}P++}}function Re(){{if(P--,P===0){var x={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},x,{value:Z}),info:L({},x,{value:ue}),warn:L({},x,{value:fe}),error:L({},x,{value:we}),group:L({},x,{value:Ae}),groupCollapsed:L({},x,{value:Ve}),groupEnd:L({},x,{value:qe})})}P<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=D.ReactCurrentDispatcher,Ie;function Ne(x,O,K){{if(Ie===void 0)try{throw Error()}catch(ce){var X=ce.stack.trim().match(/\n( *(at )?)/);Ie=X&&X[1]||""}return`
45
- `+Ie+x}}var ge=!1,He;{var ct=typeof WeakMap=="function"?WeakMap:Map;He=new ct}function Et(x,O){if(!x||ge)return"";{var K=He.get(x);if(K!==void 0)return K}var X;ge=!0;var ce=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var pe;pe=he.current,he.current=null,Be();try{if(O){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Ye){X=Ye}Reflect.construct(x,[],ie)}else{try{ie.call()}catch(Ye){X=Ye}x.call(ie.prototype)}}else{try{throw Error()}catch(Ye){X=Ye}x()}}catch(Ye){if(Ye&&X&&typeof Ye.stack=="string"){for(var se=Ye.stack.split(`
46
- `),Ue=X.stack.split(`
47
- `),Ce=se.length-1,De=Ue.length-1;Ce>=1&&De>=0&&se[Ce]!==Ue[De];)De--;for(;Ce>=1&&De>=0;Ce--,De--)if(se[Ce]!==Ue[De]){if(Ce!==1||De!==1)do if(Ce--,De--,De<0||se[Ce]!==Ue[De]){var at=`
48
- `+se[Ce].replace(" at new "," at ");return x.displayName&&at.includes("<anonymous>")&&(at=at.replace("<anonymous>",x.displayName)),typeof x=="function"&&He.set(x,at),at}while(Ce>=1&&De>=0);break}}}finally{ge=!1,he.current=pe,Re(),Error.prepareStackTrace=ce}var fr=x?x.displayName||x.name:"",Qt=fr?Ne(fr):"";return typeof x=="function"&&He.set(x,Qt),Qt}function ot(x,O,K){return Et(x,!1)}function kt(x){var O=x.prototype;return!!(O&&O.isReactComponent)}function xt(x,O,K){if(x==null)return"";if(typeof x=="function")return Et(x,kt(x));if(typeof x=="string")return Ne(x);switch(x){case u:return Ne("Suspense");case c:return Ne("SuspenseList")}if(typeof x=="object")switch(x.$$typeof){case a:return ot(x.render);case d:return xt(x.type,O,K);case f:{var X=x,ce=X._payload,pe=X._init;try{return xt(pe(ce),O,K)}catch{}}}return""}var Je=Object.prototype.hasOwnProperty,tt={},Tt=D.ReactDebugCurrentFrame;function H(x){if(x){var O=x._owner,K=xt(x.type,x._source,O?O.type:null);Tt.setExtraStackFrame(K)}else Tt.setExtraStackFrame(null)}function Pe(x,O,K,X,ce){{var pe=Function.call.bind(Je);for(var ie in x)if(pe(x,ie)){var se=void 0;try{if(typeof x[ie]!="function"){var Ue=Error((X||"React class")+": "+K+" type `"+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof x[ie]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ue.name="Invariant Violation",Ue}se=x[ie](O,ie,X,K,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){se=Ce}se&&!(se instanceof Error)&&(H(ce),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",X||"React class",K,ie,typeof se),H(null)),se instanceof Error&&!(se.message in tt)&&(tt[se.message]=!0,H(ce),y("Failed %s type: %s",K,se.message),H(null))}}}var rt=Array.isArray;function Ee(x){return rt(x)}function Qe(x){{var O=typeof Symbol=="function"&&Symbol.toStringTag,K=O&&x[Symbol.toStringTag]||x.constructor.name||"Object";return K}}function Jt(x){try{return W(x),!1}catch{return!0}}function W(x){return""+x}function T(x){if(Jt(x))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qe(x)),W(x)}var Y=D.ReactCurrentOwner,Q={key:!0,ref:!0,__self:!0,__source:!0},z,R;function $(x){if(Je.call(x,"ref")){var O=Object.getOwnPropertyDescriptor(x,"ref").get;if(O&&O.isReactWarning)return!1}return x.ref!==void 0}function J(x){if(Je.call(x,"key")){var O=Object.getOwnPropertyDescriptor(x,"key").get;if(O&&O.isReactWarning)return!1}return x.key!==void 0}function te(x,O){typeof x.ref=="string"&&Y.current}function ne(x,O){{var K=function(){z||(z=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};K.isReactWarning=!0,Object.defineProperty(x,"key",{get:K,configurable:!0})}}function ee(x,O){{var K=function(){R||(R=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};K.isReactWarning=!0,Object.defineProperty(x,"ref",{get:K,configurable:!0})}}var re=function(x,O,K,X,ce,pe,ie){var se={$$typeof:e,type:x,key:O,ref:K,props:ie,_owner:pe};return se._store={},Object.defineProperty(se._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(se,"_self",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.defineProperty(se,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ce}),Object.freeze&&(Object.freeze(se.props),Object.freeze(se)),se};function be(x,O,K,X,ce){{var pe,ie={},se=null,Ue=null;K!==void 0&&(T(K),se=""+K),J(O)&&(T(O.key),se=""+O.key),$(O)&&(Ue=O.ref,te(O,ce));for(pe in O)Je.call(O,pe)&&!Q.hasOwnProperty(pe)&&(ie[pe]=O[pe]);if(x&&x.defaultProps){var Ce=x.defaultProps;for(pe in Ce)ie[pe]===void 0&&(ie[pe]=Ce[pe])}if(se||Ue){var De=typeof x=="function"?x.displayName||x.name||"Unknown":x;se&&ne(ie,De),Ue&&ee(ie,De)}return re(x,se,Ue,ce,X,Y.current,ie)}}var ye=D.ReactCurrentOwner,me=D.ReactDebugCurrentFrame;function oe(x){if(x){var O=x._owner,K=xt(x.type,x._source,O?O.type:null);me.setExtraStackFrame(K)}else me.setExtraStackFrame(null)}var Oe;Oe=!1;function Fe(x){return typeof x=="object"&&x!==null&&x.$$typeof===e}function nt(){{if(ye.current){var x=j(ye.current.type);if(x)return`
44
+ */var Gi;function au(){return Gi||(Gi=1,process.env.NODE_ENV!=="production"&&function(){var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function x(b){if(b===null||typeof b!="object")return null;var O=p&&b[p]||b[m];return typeof O=="function"?O:null}var D=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(b){{for(var O=arguments.length,G=new Array(O>1?O-1:0),Y=1;Y<O;Y++)G[Y-1]=arguments[Y];A("error",b,G)}}function A(b,O,G){{var Y=D.ReactDebugCurrentFrame,ce=Y.getStackAddendum();ce!==""&&(O+="%s",G=G.concat([ce]));var pe=G.map(function(se){return String(se)});pe.unshift("Warning: "+O),Function.prototype.apply.call(console[b],console,pe)}}var C=!1,E=!1,v=!1,_=!1,S=!1,T;T=Symbol.for("react.module.reference");function z(b){return!!(typeof b=="string"||typeof b=="function"||b===n||b===o||S||b===s||b===u||b===c||_||b===h||C||E||v||typeof b=="object"&&b!==null&&(b.$$typeof===f||b.$$typeof===d||b.$$typeof===i||b.$$typeof===l||b.$$typeof===a||b.$$typeof===T||b.getModuleId!==void 0))}function N(b,O,G){var Y=b.displayName;if(Y)return Y;var ce=O.displayName||O.name||"";return ce!==""?G+"("+ce+")":G}function L(b){return b.displayName||"Context"}function P(b){if(b==null)return null;if(typeof b.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case n:return"Fragment";case t:return"Portal";case o:return"Profiler";case s:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof b=="object")switch(b.$$typeof){case l:var O=b;return L(O)+".Consumer";case i:var G=b;return L(G._context)+".Provider";case a:return N(b,b.render,"ForwardRef");case d:var Y=b.displayName||null;return Y!==null?Y:P(b.type)||"Memo";case f:{var ce=b,pe=ce._payload,se=ce._init;try{return P(se(pe))}catch{return null}}}return null}var j=Object.assign,R=0,X,ge,ie,De,Ce,Ie,ze;function Me(){}Me.__reactDisabledLog=!0;function Ve(){{if(R===0){X=console.log,ge=console.info,ie=console.warn,De=console.error,Ce=console.group,Ie=console.groupCollapsed,ze=console.groupEnd;var b={configurable:!0,enumerable:!0,value:Me,writable:!0};Object.defineProperties(console,{info:b,log:b,warn:b,error:b,group:b,groupCollapsed:b,groupEnd:b})}R++}}function be(){{if(R--,R===0){var b={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},b,{value:X}),info:j({},b,{value:ge}),warn:j({},b,{value:ie}),error:j({},b,{value:De}),group:j({},b,{value:Ce}),groupCollapsed:j({},b,{value:Ie}),groupEnd:j({},b,{value:ze})})}R<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=D.ReactCurrentDispatcher,Le;function je(b,O,G){{if(Le===void 0)try{throw Error()}catch(ce){var Y=ce.stack.trim().match(/\n( *(at )?)/);Le=Y&&Y[1]||""}return`
45
+ `+Le+b}}var me=!1,He;{var Tt=typeof WeakMap=="function"?WeakMap:Map;He=new Tt}function bt(b,O){if(!b||me)return"";{var G=He.get(b);if(G!==void 0)return G}var Y;me=!0;var ce=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var pe;pe=he.current,he.current=null,Ve();try{if(O){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Ye){Y=Ye}Reflect.construct(b,[],se)}else{try{se.call()}catch(Ye){Y=Ye}b.call(se.prototype)}}else{try{throw Error()}catch(Ye){Y=Ye}b()}}catch(Ye){if(Ye&&Y&&typeof Ye.stack=="string"){for(var ne=Ye.stack.split(`
46
+ `),Ue=Y.stack.split(`
47
+ `),we=ne.length-1,Ae=Ue.length-1;we>=1&&Ae>=0&&ne[we]!==Ue[Ae];)Ae--;for(;we>=1&&Ae>=0;we--,Ae--)if(ne[we]!==Ue[Ae]){if(we!==1||Ae!==1)do if(we--,Ae--,Ae<0||ne[we]!==Ue[Ae]){var at=`
48
+ `+ne[we].replace(" at new "," at ");return b.displayName&&at.includes("<anonymous>")&&(at=at.replace("<anonymous>",b.displayName)),typeof b=="function"&&He.set(b,at),at}while(we>=1&&Ae>=0);break}}}finally{me=!1,he.current=pe,be(),Error.prepareStackTrace=ce}var pr=b?b.displayName||b.name:"",Yt=pr?je(pr):"";return typeof b=="function"&&He.set(b,Yt),Yt}function Mt(b,O,G){return bt(b,!1)}function it(b){var O=b.prototype;return!!(O&&O.isReactComponent)}function ot(b,O,G){if(b==null)return"";if(typeof b=="function")return bt(b,it(b));if(typeof b=="string")return je(b);switch(b){case u:return je("Suspense");case c:return je("SuspenseList")}if(typeof b=="object")switch(b.$$typeof){case a:return Mt(b.render);case d:return ot(b.type,O,G);case f:{var Y=b,ce=Y._payload,pe=Y._init;try{return ot(pe(ce),O,G)}catch{}}}return""}var Je=Object.prototype.hasOwnProperty,tt={},Bt=D.ReactDebugCurrentFrame;function V(b){if(b){var O=b._owner,G=ot(b.type,b._source,O?O.type:null);Bt.setExtraStackFrame(G)}else Bt.setExtraStackFrame(null)}function Be(b,O,G,Y,ce){{var pe=Function.call.bind(Je);for(var se in b)if(pe(b,se)){var ne=void 0;try{if(typeof b[se]!="function"){var Ue=Error((Y||"React class")+": "+G+" type `"+se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof b[se]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ue.name="Invariant Violation",Ue}ne=b[se](O,se,Y,G,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(we){ne=we}ne&&!(ne instanceof Error)&&(V(ce),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Y||"React class",G,se,typeof ne),V(null)),ne instanceof Error&&!(ne.message in tt)&&(tt[ne.message]=!0,V(ce),y("Failed %s type: %s",G,ne.message),V(null))}}}var rt=Array.isArray;function ct(b){return rt(b)}function qe(b){{var O=typeof Symbol=="function"&&Symbol.toStringTag,G=O&&b[Symbol.toStringTag]||b.constructor.name||"Object";return G}}function Qe(b){try{return $t(b),!1}catch{return!0}}function $t(b){return""+b}function U(b){if(Qe(b))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(b)),$t(b)}var B=D.ReactCurrentOwner,Z={key:!0,ref:!0,__self:!0,__source:!0},J,k;function $(b){if(Je.call(b,"ref")){var O=Object.getOwnPropertyDescriptor(b,"ref").get;if(O&&O.isReactWarning)return!1}return b.ref!==void 0}function H(b){if(Je.call(b,"key")){var O=Object.getOwnPropertyDescriptor(b,"key").get;if(O&&O.isReactWarning)return!1}return b.key!==void 0}function Q(b,O){typeof b.ref=="string"&&B.current}function ee(b,O){{var G=function(){J||(J=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};G.isReactWarning=!0,Object.defineProperty(b,"key",{get:G,configurable:!0})}}function oe(b,O){{var G=function(){k||(k=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};G.isReactWarning=!0,Object.defineProperty(b,"ref",{get:G,configurable:!0})}}var re=function(b,O,G,Y,ce,pe,se){var ne={$$typeof:e,type:b,key:O,ref:G,props:se,_owner:pe};return ne._store={},Object.defineProperty(ne._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ne,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Y}),Object.defineProperty(ne,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ce}),Object.freeze&&(Object.freeze(ne.props),Object.freeze(ne)),ne};function te(b,O,G,Y,ce){{var pe,se={},ne=null,Ue=null;G!==void 0&&(U(G),ne=""+G),H(O)&&(U(O.key),ne=""+O.key),$(O)&&(Ue=O.ref,Q(O,ce));for(pe in O)Je.call(O,pe)&&!Z.hasOwnProperty(pe)&&(se[pe]=O[pe]);if(b&&b.defaultProps){var we=b.defaultProps;for(pe in we)se[pe]===void 0&&(se[pe]=we[pe])}if(ne||Ue){var Ae=typeof b=="function"?b.displayName||b.name||"Unknown":b;ne&&ee(se,Ae),Ue&&oe(se,Ae)}return re(b,ne,Ue,ce,Y,B.current,se)}}var ye=D.ReactCurrentOwner,Se=D.ReactDebugCurrentFrame;function fe(b){if(b){var O=b._owner,G=ot(b.type,b._source,O?O.type:null);Se.setExtraStackFrame(G)}else Se.setExtraStackFrame(null)}var ue;ue=!1;function Re(b){return typeof b=="object"&&b!==null&&b.$$typeof===e}function Pe(){{if(ye.current){var b=P(ye.current.type);if(b)return`
49
49
 
50
- Check the render method of \``+x+"`."}return""}}function Bt(x){return""}var lt={};function Ot(x){{var O=nt();if(!O){var K=typeof x=="string"?x:x.displayName||x.name;K&&(O=`
50
+ Check the render method of \``+b+"`."}return""}}function lt(b){return""}var _t={};function dt(b){{var O=Pe();if(!O){var G=typeof b=="string"?b:b.displayName||b.name;G&&(O=`
51
51
 
52
- Check the top-level render call using <`+K+">.")}return O}}function dr(x,O){{if(!x._store||x._store.validated||x.key!=null)return;x._store.validated=!0;var K=Ot(O);if(lt[K])return;lt[K]=!0;var X="";x&&x._owner&&x._owner!==ye.current&&(X=" It was passed a child from "+j(x._owner.type)+"."),oe(x),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',K,X),oe(null)}}function Mt(x,O){{if(typeof x!="object")return;if(Ee(x))for(var K=0;K<x.length;K++){var X=x[K];Fe(X)&&dr(X,O)}else if(Fe(x))x._store&&(x._store.validated=!0);else if(x){var ce=b(x);if(typeof ce=="function"&&ce!==x.entries)for(var pe=ce.call(x),ie;!(ie=pe.next()).done;)Fe(ie.value)&&dr(ie.value,O)}}}function ys(x){{var O=x.type;if(O==null||typeof O=="string")return;var K;if(typeof O=="function")K=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===a||O.$$typeof===d))K=O.propTypes;else return;if(K){var X=j(O);Pe(K,x.props,"prop",X,x)}else if(O.PropTypes!==void 0&&!Oe){Oe=!0;var ce=j(O);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ce||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Br(x){{for(var O=Object.keys(x.props),K=0;K<O.length;K++){var X=O[K];if(X!=="children"&&X!=="key"){oe(x),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",X),oe(null);break}}x.ref!==null&&(oe(x),y("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}}var Nr={};function _n(x,O,K,X,ce,pe){{var ie=q(x);if(!ie){var se="";(x===void 0||typeof x=="object"&&x!==null&&Object.keys(x).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ue=Bt();Ue?se+=Ue:se+=nt();var Ce;x===null?Ce="null":Ee(x)?Ce="array":x!==void 0&&x.$$typeof===e?(Ce="<"+(j(x.type)||"Unknown")+" />",se=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof x,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,se)}var De=be(x,O,K,ce,pe);if(De==null)return De;if(ie){var at=O.children;if(at!==void 0)if(X)if(Ee(at)){for(var fr=0;fr<at.length;fr++)Mt(at[fr],x);Object.freeze&&Object.freeze(at)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Mt(at,x)}if(Je.call(O,"key")){var Qt=j(x),Ye=Object.keys(O).filter(function(Ra){return Ra!=="key"}),xs=Ye.length>0?"{key: someKey, "+Ye.join(": ..., ")+": ...}":"{key: someKey}";if(!Nr[Qt+xs]){var ja=Ye.length>0?"{"+Ye.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
52
+ Check the top-level render call using <`+G+">.")}return O}}function Nt(b,O){{if(!b._store||b._store.validated||b.key!=null)return;b._store.validated=!0;var G=dt(O);if(_t[G])return;_t[G]=!0;var Y="";b&&b._owner&&b._owner!==ye.current&&(Y=" It was passed a child from "+P(b._owner.type)+"."),fe(b),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',G,Y),fe(null)}}function fr(b,O){{if(typeof b!="object")return;if(ct(b))for(var G=0;G<b.length;G++){var Y=b[G];Re(Y)&&Nt(Y,O)}else if(Re(b))b._store&&(b._store.validated=!0);else if(b){var ce=x(b);if(typeof ce=="function"&&ce!==b.entries)for(var pe=ce.call(b),se;!(se=pe.next()).done;)Re(se.value)&&Nt(se.value,O)}}}function Qt(b){{var O=b.type;if(O==null||typeof O=="string")return;var G;if(typeof O=="function")G=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===a||O.$$typeof===d))G=O.propTypes;else return;if(G){var Y=P(O);Be(G,b.props,"prop",Y,b)}else if(O.PropTypes!==void 0&&!ue){ue=!0;var ce=P(O);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ce||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ys(b){{for(var O=Object.keys(b.props),G=0;G<O.length;G++){var Y=O[G];if(Y!=="children"&&Y!=="key"){fe(b),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Y),fe(null);break}}b.ref!==null&&(fe(b),y("Invalid attribute `ref` supplied to `React.Fragment`."),fe(null))}}var hr={};function Fr(b,O,G,Y,ce,pe){{var se=z(b);if(!se){var ne="";(b===void 0||typeof b=="object"&&b!==null&&Object.keys(b).length===0)&&(ne+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ue=lt();Ue?ne+=Ue:ne+=Pe();var we;b===null?we="null":ct(b)?we="array":b!==void 0&&b.$$typeof===e?(we="<"+(P(b.type)||"Unknown")+" />",ne=" Did you accidentally export a JSX literal instead of a component?"):we=typeof b,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",we,ne)}var Ae=te(b,O,G,ce,pe);if(Ae==null)return Ae;if(se){var at=O.children;if(at!==void 0)if(Y)if(ct(at)){for(var pr=0;pr<at.length;pr++)fr(at[pr],b);Object.freeze&&Object.freeze(at)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else fr(at,b)}if(Je.call(O,"key")){var Yt=P(b),Ye=Object.keys(O).filter(function(Ra){return Ra!=="key"}),bs=Ye.length>0?"{key: someKey, "+Ye.join(": ..., ")+": ...}":"{key: someKey}";if(!hr[Yt+bs]){var ja=Ye.length>0?"{"+Ye.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
53
53
  let props = %s;
54
54
  <%s {...props} />
55
55
  React keys must be passed directly to JSX without using spread:
56
56
  let props = %s;
57
- <%s key={someKey} {...props} />`,xs,Qt,ja,Qt),Nr[Qt+xs]=!0}}return x===n?Br(De):ys(De),De}}function Ba(x,O,K){return _n(x,O,K,!0)}function Na(x,O,K){return _n(x,O,K,!1)}var Fa=Na,La=Ba;jr.Fragment=n,jr.jsx=Fa,jr.jsxs=La}()),jr}process.env.NODE_ENV==="production"?Ps.exports=lu():Ps.exports=au();var g=Ps.exports;class Bn{static filter(e,t){return e.filter(t)}static filterBy(e,t,n){return e.filter(s=>s[t]===n)}static filterByFields(e,t){return e.filter(n=>Object.entries(t).every(([s,o])=>n[s]===o))}static sort(e,t,n="asc"){return[...e].sort((s,o)=>{const i=s[t],l=o[t];if(i===l)return 0;let a=0;return i>l&&(a=1),i<l&&(a=-1),n==="asc"?a:-a})}static search(e,t,n){if(!t.trim())return e;const s=t.toLowerCase();return e.filter(o=>n.some(i=>{const l=o[i];return l==null?!1:String(l).toLowerCase().includes(s)}))}static paginate(e,t,n){const s=(t-1)*n,o=s+n;return{data:e.slice(s,o),total:e.length,page:t,totalPages:Math.ceil(e.length/n)}}static groupBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]||(n[o]=[]),n[o].push(s),n},{})}static unique(e,t){const n=e.map(s=>s[t]);return[...new Set(n)]}static countBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]=(n[o]||0)+1,n},{})}static pipe(e,t){return t.reduce((n,s)=>s(n),e)}}function uu({endpoint:r,params:e,layout:t="list",title:n,emptyMessage:s="No items found",renderItem:o,keyExtractor:i=(m,b)=>m.id||m._id||String(b),searchable:l=!1,searchFields:a=[],searchPlaceholder:u="Search...",filters:c=[],pageSize:d=20,onItemClick:f,onRefresh:h,theme:p={}}){const{data:m,loading:b,error:D,refetch:y}=al(r,e),[A,_]=w.useState(""),[E,C]=w.useState({}),[v,S]=w.useState(1),k=w.useMemo(()=>{if(!m)return{data:[],total:0,totalPages:0};let L=m;return l&&A&&a.length>0&&(L=Bn.search(L,A,a)),Object.keys(E).length>0&&(L=Bn.filterByFields(L,E)),Bn.paginate(L,v,d)},[m,A,E,v,d,l,a]);w.useEffect(()=>{S(1)},[A,E]);const q=()=>{_(""),C({}),S(1),y(),h==null||h()},B={background:p.background||"#ffffff",cardBackground:p.cardBackground||"#f9fafb",text:p.text||"#111827",textSecondary:p.textSecondary||"#6b7280",border:p.border||"#e5e7eb",primary:p.primary||"#3b82f6"},j=o||(L=>g.jsxs("div",{style:{padding:"16px",cursor:f?"pointer":"default"},children:[g.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:B.text},children:L.title||L.name||L.label||"Untitled"}),L.description&&g.jsx("div",{style:{fontSize:"13px",color:B.textSecondary,marginTop:"4px"},children:L.description})]}));return b&&!m?g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"48px",color:B.textSecondary},children:"Loading..."}):D?g.jsxs("div",{style:{padding:"24px",textAlign:"center",color:"#ef4444"},children:[g.jsx("div",{style:{fontWeight:500,marginBottom:"8px"},children:"Error"}),g.jsx("div",{style:{fontSize:"14px"},children:D.message}),g.jsx("button",{onClick:q,style:{marginTop:"16px",padding:"8px 16px",background:B.primary,color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Retry"})]}):g.jsxs("div",{style:{background:B.background,borderRadius:"12px",overflow:"hidden"},children:[(n||l||c.length>0)&&g.jsxs("div",{style:{padding:"16px",borderBottom:`1px solid ${B.border}`},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:l||c.length>0?"12px":"0"},children:[n&&g.jsx("h2",{style:{margin:0,fontSize:"18px",fontWeight:600,color:B.text},children:n}),g.jsx("button",{onClick:q,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${B.border}`,borderRadius:"6px",color:B.textSecondary,cursor:"pointer",fontSize:"13px"},children:"Refresh"})]}),l&&g.jsx("input",{type:"text",placeholder:u,value:A,onChange:L=>_(L.target.value),style:{width:"100%",padding:"8px 12px",border:`1px solid ${B.border}`,borderRadius:"8px",fontSize:"14px",outline:"none"}})]}),g.jsx("div",{style:{display:t==="grid"?"grid":"flex",flexDirection:t==="list"?"column":void 0,gridTemplateColumns:t==="grid"?"repeat(auto-fill, minmax(250px, 1fr))":void 0,gap:t==="list"?"0":"16px",padding:t==="list"?"0":"16px"},children:k.data.length===0?g.jsx("div",{style:{padding:"48px",textAlign:"center",color:B.textSecondary},children:s}):k.data.map((L,P)=>g.jsx("div",{onClick:()=>f==null?void 0:f(L),style:{background:B.cardBackground,borderRadius:t==="list"?"0":"8px",borderBottom:t==="list"?`1px solid ${B.border}`:"none",transition:"all 0.15s ease"},onMouseEnter:Z=>{f&&(Z.currentTarget.style.background=B.border)},onMouseLeave:Z=>{Z.currentTarget.style.background=B.cardBackground},children:j(L,P)},i(L,P)))}),k.totalPages>1&&g.jsxs("div",{style:{padding:"16px",borderTop:`1px solid ${B.border}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[g.jsxs("div",{style:{fontSize:"13px",color:B.textSecondary},children:["Page ",v," of ",k.totalPages]}),g.jsxs("div",{style:{display:"flex",gap:"8px"},children:[g.jsx("button",{onClick:()=>S(L=>Math.max(1,L-1)),disabled:v===1,style:{padding:"6px 12px",border:`1px solid ${B.border}`,borderRadius:"6px",background:"white",cursor:v===1?"not-allowed":"pointer",opacity:v===1?.5:1},children:"Previous"}),g.jsx("button",{onClick:()=>S(L=>Math.min(k.totalPages,L+1)),disabled:v===k.totalPages,style:{padding:"6px 12px",border:`1px solid ${B.border}`,borderRadius:"6px",background:"white",cursor:v===k.totalPages?"not-allowed":"pointer",opacity:v===k.totalPages?.5:1},children:"Next"})]})]})]})}function cu({item:r,onClick:e,title:t=i=>i.title||i.name||i.label||"Untitled",subtitle:n=i=>i.description||i.subtitle||"",image:s=i=>i.image||i.thumbnail||i.photo,badge:o=i=>i.badge||i.tag||i.type}){const i=t(r),l=n(r),a=s(r),u=o(r);return g.jsxs("div",{onClick:e,className:`
57
+ <%s key={someKey} {...props} />`,bs,Yt,ja,Yt),hr[Yt+bs]=!0}}return b===n?ys(Ae):Qt(Ae),Ae}}function xs(b,O,G){return Fr(b,O,G,!0)}function Na(b,O,G){return Fr(b,O,G,!1)}var Fa=Na,La=xs;Rr.Fragment=n,Rr.jsx=Fa,Rr.jsxs=La}()),Rr}process.env.NODE_ENV==="production"?Os.exports=lu():Os.exports=au();var g=Os.exports;class Bn{static filter(e,t){return e.filter(t)}static filterBy(e,t,n){return e.filter(s=>s[t]===n)}static filterByFields(e,t){return e.filter(n=>Object.entries(t).every(([s,o])=>n[s]===o))}static sort(e,t,n="asc"){return[...e].sort((s,o)=>{const i=s[t],l=o[t];if(i===l)return 0;let a=0;return i>l&&(a=1),i<l&&(a=-1),n==="asc"?a:-a})}static search(e,t,n){if(!t.trim())return e;const s=t.toLowerCase();return e.filter(o=>n.some(i=>{const l=o[i];return l==null?!1:String(l).toLowerCase().includes(s)}))}static paginate(e,t,n){const s=(t-1)*n,o=s+n;return{data:e.slice(s,o),total:e.length,page:t,totalPages:Math.ceil(e.length/n)}}static groupBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]||(n[o]=[]),n[o].push(s),n},{})}static unique(e,t){const n=e.map(s=>s[t]);return[...new Set(n)]}static countBy(e,t){return e.reduce((n,s)=>{const o=String(s[t]);return n[o]=(n[o]||0)+1,n},{})}static pipe(e,t){return t.reduce((n,s)=>s(n),e)}}function uu({endpoint:r,params:e,layout:t="list",title:n,emptyMessage:s="No items found",renderItem:o,keyExtractor:i=(m,x)=>m.id||m._id||String(x),searchable:l=!1,searchFields:a=[],searchPlaceholder:u="Search...",filters:c=[],pageSize:d=20,onItemClick:f,onRefresh:h,theme:p={}}){const{data:m,loading:x,error:D,refetch:y}=ul(r,e),[A,C]=w.useState(""),[E,v]=w.useState({}),[_,S]=w.useState(1),T=w.useMemo(()=>{if(!m)return{data:[],total:0,totalPages:0};let j=m;return l&&A&&a.length>0&&(j=Bn.search(j,A,a)),Object.keys(E).length>0&&(j=Bn.filterByFields(j,E)),Bn.paginate(j,_,d)},[m,A,E,_,d,l,a]);w.useEffect(()=>{S(1)},[A,E]);const z=()=>{C(""),v({}),S(1),y(),h==null||h()},N={background:p.background||"#ffffff",cardBackground:p.cardBackground||"#f9fafb",text:p.text||"#111827",textSecondary:p.textSecondary||"#6b7280",border:p.border||"#e5e7eb",primary:p.primary||"#3b82f6"},P=o||(j=>g.jsxs("div",{style:{padding:"16px",cursor:f?"pointer":"default"},children:[g.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:N.text},children:j.title||j.name||j.label||"Untitled"}),j.description&&g.jsx("div",{style:{fontSize:"13px",color:N.textSecondary,marginTop:"4px"},children:j.description})]}));return x&&!m?g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"48px",color:N.textSecondary},children:"Loading..."}):D?g.jsxs("div",{style:{padding:"24px",textAlign:"center",color:"#ef4444"},children:[g.jsx("div",{style:{fontWeight:500,marginBottom:"8px"},children:"Error"}),g.jsx("div",{style:{fontSize:"14px"},children:D.message}),g.jsx("button",{onClick:z,style:{marginTop:"16px",padding:"8px 16px",background:N.primary,color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Retry"})]}):g.jsxs("div",{style:{background:N.background,borderRadius:"12px",overflow:"hidden"},children:[(n||l||c.length>0)&&g.jsxs("div",{style:{padding:"16px",borderBottom:`1px solid ${N.border}`},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:l||c.length>0?"12px":"0"},children:[n&&g.jsx("h2",{style:{margin:0,fontSize:"18px",fontWeight:600,color:N.text},children:n}),g.jsx("button",{onClick:z,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${N.border}`,borderRadius:"6px",color:N.textSecondary,cursor:"pointer",fontSize:"13px"},children:"Refresh"})]}),l&&g.jsx("input",{type:"text",placeholder:u,value:A,onChange:j=>C(j.target.value),style:{width:"100%",padding:"8px 12px",border:`1px solid ${N.border}`,borderRadius:"8px",fontSize:"14px",outline:"none"}})]}),g.jsx("div",{style:{display:t==="grid"?"grid":"flex",flexDirection:t==="list"?"column":void 0,gridTemplateColumns:t==="grid"?"repeat(auto-fill, minmax(250px, 1fr))":void 0,gap:t==="list"?"0":"16px",padding:t==="list"?"0":"16px"},children:T.data.length===0?g.jsx("div",{style:{padding:"48px",textAlign:"center",color:N.textSecondary},children:s}):T.data.map((j,R)=>g.jsx("div",{onClick:()=>f==null?void 0:f(j),style:{background:N.cardBackground,borderRadius:t==="list"?"0":"8px",borderBottom:t==="list"?`1px solid ${N.border}`:"none",transition:"all 0.15s ease"},onMouseEnter:X=>{f&&(X.currentTarget.style.background=N.border)},onMouseLeave:X=>{X.currentTarget.style.background=N.cardBackground},children:P(j,R)},i(j,R)))}),T.totalPages>1&&g.jsxs("div",{style:{padding:"16px",borderTop:`1px solid ${N.border}`,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[g.jsxs("div",{style:{fontSize:"13px",color:N.textSecondary},children:["Page ",_," of ",T.totalPages]}),g.jsxs("div",{style:{display:"flex",gap:"8px"},children:[g.jsx("button",{onClick:()=>S(j=>Math.max(1,j-1)),disabled:_===1,style:{padding:"6px 12px",border:`1px solid ${N.border}`,borderRadius:"6px",background:"white",cursor:_===1?"not-allowed":"pointer",opacity:_===1?.5:1},children:"Previous"}),g.jsx("button",{onClick:()=>S(j=>Math.min(T.totalPages,j+1)),disabled:_===T.totalPages,style:{padding:"6px 12px",border:`1px solid ${N.border}`,borderRadius:"6px",background:"white",cursor:_===T.totalPages?"not-allowed":"pointer",opacity:_===T.totalPages?.5:1},children:"Next"})]})]})]})}function cu({item:r,onClick:e,title:t=i=>i.title||i.name||i.label||"Untitled",subtitle:n=i=>i.description||i.subtitle||"",image:s=i=>i.image||i.thumbnail||i.photo,badge:o=i=>i.badge||i.tag||i.type}){const i=t(r),l=n(r),a=s(r),u=o(r);return g.jsxs("div",{onClick:e,className:`
58
58
  flex items-center gap-4 p-4 border-b border-gray-200
59
59
  hover:bg-gray-50 transition-colors
60
60
  ${e?"cursor-pointer":""}
61
- `,children:[a&&g.jsx("div",{className:"flex-shrink-0",children:g.jsx("img",{src:a,alt:i,className:"w-16 h-16 object-cover rounded-lg"})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("h3",{className:"font-medium text-gray-900 truncate",children:i}),u&&g.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:u})]}),l&&g.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:l})]}),e&&g.jsx("div",{className:"flex-shrink-0 text-gray-400",children:g.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function du({item:r,onClose:e,title:t=o=>o.title||o.name||o.label||"Detail",image:n=o=>o.image||o.thumbnail||o.photo,fields:s=[]}){if(!r)return null;const o=t(r),i=n(r);return g.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:g.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[g.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[g.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),e&&g.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:g.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),g.jsxs("div",{className:"p-6",children:[i&&g.jsx("div",{className:"mb-6",children:g.jsx("img",{src:i,alt:o,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&g.jsx("div",{className:"space-y-4",children:s.map((l,a)=>{const u=l.value(r);return u==null||u===""?null:g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:l.label}),g.jsx("div",{className:"text-base text-gray-900",children:typeof u=="object"?JSON.stringify(u,null,2):String(u)})]},a)})}),s.length===0&&g.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&g.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:g.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const fu={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function hu({nodes:r,cardCount:e=2,minInterval:t=1e3,maxInterval:n=3e3,onCardClick:s,cardSize:o="medium",className:i=""}){const l=Math.min(Math.max(e,1),5),[a,u]=w.useState([]),[c,d]=w.useState([]),[f,h]=w.useState(Array(l).fill(!1)),[p,m]=w.useState(Array(l).fill(!1)),b=w.useRef([]),D=w.useCallback(C=>{const v=r.filter(k=>!C.includes(k._id));if(v.length===0)return null;const S=Math.floor(Math.random()*v.length);return v[S]},[r]),y=w.useCallback(()=>Math.random()*(n-t)+t,[t,n]);w.useEffect(()=>{if(r.length===0){u([]),d([]);return}const C=[],v=[],S=[];for(let k=0;k<l&&k<r.length;k++){const q=D(S);q&&(C.push(q),S.push(q._id))}for(let k=0;k<C.length;k++){const q=[C[k]._id,...C.filter((F,j)=>j!==k).map(F=>F._id)],B=D(q);B?v.push(B):v.push(C[k])}u(C),d(v)},[r,l,D]);const A=w.useCallback(C=>{const v=y(),S=setTimeout(()=>{h(k=>{const q=[...k];return q[C]=!q[C],q}),setTimeout(()=>{m(k=>{const q=[...k];return q[C]=!q[C],q}),setTimeout(()=>{const k=!p[C];k&&u(q=>{const B=[...q];return B[C]=c[C],B}),d(q=>{const B=[...q],j=[(k?c[C]:a[C])._id,...a.filter((P,Z)=>Z!==C).map(P=>P._id),...q.filter((P,Z)=>Z!==C).map(P=>P._id)],L=D(j);return L&&(B[C]=L),B}),setTimeout(()=>{A(C)},150)},200)},150)},v);b.current[C]=S},[y,D,a,c,p]),_=w.useRef(!1);w.useEffect(()=>{if(!(a.length===0||r.length<=1)&&!_.current){_.current=!0;for(let C=0;C<a.length;C++)A(C);return()=>{b.current.forEach(C=>clearTimeout(C)),b.current=[],_.current=!1}}},[a.length,r.length]);const E=C=>{s&&s(C)};return r.length===0?g.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:g.jsx("p",{className:"text-gray-500",children:"No nodes available"})}):a.length===0?g.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:g.jsx("p",{className:"text-gray-500",children:"Loading..."})}):g.jsx("div",{className:`flex gap-4 justify-center items-center flex-wrap ${i}`,children:a.map((C,v)=>{const S=c[v],k=p[v];return g.jsx("div",{className:`relative ${fu[o]}`,style:{perspective:"1000px"},onClick:()=>E(k?S:C),children:g.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${f[v]?180:0}deg)`,transition:"transform 0.5s",transformStyle:"preserve-3d"},children:[g.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:k?0:1},children:g.jsxs("div",{style:{transform:f[v]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[g.jsx("img",{src:C.data.image,alt:C.title,className:"w-full h-full object-cover"}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:g.jsx("p",{className:"text-white text-sm font-medium truncate",children:C.title})})]})}),S&&g.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:k?1:0},children:g.jsxs("div",{style:{transform:f[v]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[g.jsx("img",{src:S.data.image,alt:S.title,className:"w-full h-full object-cover"}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:g.jsx("p",{className:"text-white text-sm font-medium truncate",children:S.title})})]})})]})},`slot-${v}`)})})}function hr(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,o)=>{try{if(s.toUpperCase()==="B"){const i=atob(o);return decodeURIComponent(escape(i))}else if(s.toUpperCase()==="Q"){const i=o.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(l,a)=>String.fromCharCode(parseInt(a,16)));return decodeURIComponent(escape(i))}}catch(i){console.warn("MIME decode error:",i)}return t}).replace(/\s+/g," ").trim()}const pu={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function gu({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:o=!0,showDetail:i=!1,showSearch:l=!0,searchQuery:a,onSearchChange:u,emptyMessage:c="No emails",autoLoad:d=!0,onSelect:f,onSelectionChange:h,onDelete:p,onError:m,onLoad:b,renderItem:D,renderDetail:y,renderActions:A,renderEmpty:_,renderLoading:E,theme:C={}}){const v={...pu,...C},[S,k]=w.useState([]),[q,B]=w.useState(!1),[F,j]=w.useState(null),[L,P]=w.useState(new Set),[Z,ue]=w.useState(null),[fe,we]=w.useState(null),[Ae,Ve]=w.useState(null),[qe,$e]=w.useState(!1),[Be,Re]=w.useState(""),he=a!==void 0?a:Be,Ie=R=>{u?u(R):Re(R)},Ne=w.useMemo(()=>{if(!he.trim())return S;const R=he.toLowerCase();return S.filter($=>hr($.from).toLowerCase().includes(R)||hr($.subject).toLowerCase().includes(R))},[S,he]),ge=w.useMemo(()=>e?new il({baseUrl:r,system_id:e}):null,[r,e]),He=w.useCallback(async()=>{if(ge){B(!0),j(null);try{const R=await ge.listEmails(t,n,s);R!=null&&R.messages&&(k(R.messages),b==null||b(R.messages))}catch(R){const $=R instanceof Error?R:new Error("Failed to fetch emails");j($.message),m==null||m($)}B(!1)}},[ge,t,n,s,m,b]);w.useEffect(()=>{k([]),P(new Set),we(null),j(null),a===void 0&&Re(""),d&&He()},[s,d]);const ct=w.useCallback(async R=>{if(ge){we(R),Ve(null),$e(!0);try{const $=await ge.getEmailParsed(t,R.uid,s||"INBOX");$!=null&&$.body&&Ve($.body)}catch($){console.error("Failed to fetch email body:",$)}$e(!1)}},[ge,t,s]),Et=w.useCallback(R=>{f==null||f(R),i&&ct(R)},[f,i,ct]),ot=w.useCallback((R,$,J)=>{if(!o){f==null||f(R),i&&ct(R);return}const te=R.uid;if(J.shiftKey&&Z!==null){const ne=Math.min(Z,$),ee=Math.max(Z,$),re=S.slice(ne,ee+1).map(ye=>ye.uid),be=new Set(re);P(be),h==null||h(Array.from(be))}else if(J.ctrlKey||J.metaKey)P(ne=>{const ee=new Set(ne);return ee.has(te)?ee.delete(te):ee.add(te),h==null||h(Array.from(ee)),ee}),ue($);else{const ne=new Set([te]);P(ne),ue($),h==null||h(Array.from(ne))}},[o,Z,S,L,f,h,i]),kt=w.useCallback(async()=>{if(!ge||L.size===0)return;const R=s||"INBOX";try{const $=await ge.trashEmails(t,Array.from(L),R);if(console.log("Trash result:",$),$.success&&$.moved>0){k(te=>te.filter(ne=>!L.has(ne.uid)));const J=Array.from(L);P(new Set),p==null||p(J)}else j("Failed to move emails to trash")}catch($){const J=$ instanceof Error?$:new Error("Trash failed");console.error("Trash error:",J),j(J.message),m==null||m(J)}},[ge,t,L,s,p,m]),xt=w.useCallback(async()=>{if(!ge||L.size===0)return;const R=s||"INBOX";try{const $=await ge.archiveEmails(t,Array.from(L),R);if(console.log("Archive result:",$),$.success&&$.archived>0){k(te=>te.filter(ne=>!L.has(ne.uid)));const J=Array.from(L);P(new Set),p==null||p(J)}else j("Failed to archive emails")}catch($){const J=$ instanceof Error?$:new Error("Archive failed");console.error("Archive error:",J),j(J.message),m==null||m(J)}},[ge,t,L,s,p,m]),Je=w.useCallback(()=>{if(L.size===S.length)P(new Set),h==null||h([]);else{const R=new Set(S.map($=>$.uid));P(R),h==null||h(Array.from(R))}},[S,L.size,h]),tt=w.useCallback(()=>{P(new Set),h==null||h([])},[h]),Tt={delete:kt,archive:xt,refresh:He,selectAll:Je,clearSelection:tt},H=R=>{if(!R)return"";const $=new Date(R),J=new Date;return $.toDateString()===J.toDateString()?$.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):$.toLocaleDateString([],{month:"short",day:"numeric"})},Pe=(R,$)=>g.jsx("div",{style:{padding:"12px 16px",background:$?v.selectedBackground:R.seen?v.cardBackground:v.unreadBackground,borderBottom:`1px solid ${v.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:"14px",fontWeight:R.seen?400:600,color:v.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:hr(R.from).split("@")[0]}),g.jsx("div",{style:{fontSize:"14px",fontWeight:R.seen?400:500,color:R.seen?v.textSecondary:v.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:hr(R.subject)||"(No subject)"})]}),g.jsx("div",{style:{fontSize:"12px",color:v.textSecondary,flexShrink:0},children:H(R.date)})]})}),rt=R=>g.jsxs("div",{style:{padding:"24px"},children:[g.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:v.text},children:hr(R.subject)||"(No subject)"}),g.jsxs("div",{style:{fontSize:"14px",color:v.textSecondary,marginBottom:"16px"},children:["From: ",hr(R.from)," • ",new Date(R.date).toLocaleString()]}),qe?g.jsx("div",{style:{fontSize:"14px",color:v.textSecondary},children:"Loading..."}):Ae?g.jsx("div",{style:{fontSize:"14px",color:v.text},dangerouslySetInnerHTML:{__html:Ae}}):g.jsx("div",{style:{fontSize:"14px",color:v.textSecondary},children:"No content available"})]}),Ee=(R,$)=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:v.cardBackground,borderBottom:`1px solid ${v.border}`},children:[g.jsx("button",{onClick:$.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${v.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:v.text},children:R.length===S.length?"Deselect All":"Select All"}),R.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("span",{style:{fontSize:"13px",color:v.textSecondary},children:[R.length," selected"]}),g.jsx("button",{onClick:$.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${v.border}`,borderRadius:"6px",cursor:"pointer",color:v.textSecondary},children:g.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),g.jsx("button",{onClick:$.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${v.border}`,borderRadius:"6px",cursor:"pointer",color:v.textSecondary},children:g.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),g.jsx("div",{style:{flex:1}}),g.jsx("button",{onClick:$.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${v.border}`,borderRadius:"6px",cursor:"pointer",color:v.textSecondary},children:g.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),Qe=()=>g.jsx("div",{style:{padding:"48px",textAlign:"center",color:v.textSecondary},children:c}),Jt=()=>g.jsx("div",{style:{padding:"48px",textAlign:"center",color:v.textSecondary},children:"Loading..."}),W=D||Pe,T=y||rt,Y=A||Ee,Q=_||Qe,z=E||Jt;return q&&S.length===0?g.jsx("div",{style:{background:v.background,width:"100%",height:"100%"},children:z()}):g.jsxs("div",{style:{display:"flex",background:v.background,width:"100%",height:"100%"},children:[g.jsxs("div",{style:{flex:i&&fe?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:i&&fe?`1px solid ${v.border}`:"none",overflow:"hidden"},children:[o&&Y(Array.from(L),Tt),l&&g.jsx("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${v.border}`,background:v.background},children:g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",background:"#f5f5f5",borderRadius:"6px"},children:[g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:v.textSecondary,strokeWidth:"2",children:[g.jsx("circle",{cx:"11",cy:"11",r:"8"}),g.jsx("path",{d:"M21 21l-4.35-4.35"})]}),g.jsx("input",{type:"text",placeholder:"Search by email or subject...",value:he,onChange:R=>Ie(R.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:"13px",color:v.text}}),he&&g.jsx("button",{onClick:()=>Ie(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:v.textSecondary,strokeWidth:"2",children:g.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}),F&&g.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:v.danger,fontSize:"14px",borderBottom:`1px solid ${v.border}`},children:F}),g.jsx("div",{style:{flex:1,overflowY:"auto"},children:Ne.length===0?Q():Ne.map((R,$)=>g.jsx("div",{onClick:J=>ot(R,$,J),onDoubleClick:()=>Et(R),children:W(R,L.has(R.uid))},R.uid))})]}),i&&fe&&g.jsx("div",{style:{flex:1,overflowY:"auto"},children:T(fe)})]})}function mu({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:o=[],emptyMessage:i="No items",showSelectAll:l=!0,className:a=""}){const[u,c]=w.useState(new Set),[d,f]=w.useState(-1),h=r.filter(_=>u.has(_.id)),p=d>=0&&d<h.length?h[d]:null,m=w.useCallback(_=>{c(E=>{const C=new Set(E);return C.has(_)?C.delete(_):C.add(_),t==null||t(Array.from(C)),C})},[t]),b=w.useCallback(()=>{if(u.size===r.length)c(new Set),f(-1),t==null||t([]);else{const _=new Set(r.map(E=>E.id));c(_),r.length>0&&(f(0),n==null||n(r[0],0)),t==null||t(r.map(E=>E.id))}},[r,u.size,t,n]),D=w.useCallback(()=>{if(h.length===0)return;const _=d<=0?h.length-1:d-1;f(_),n==null||n(h[_],_)},[h,d,n]),y=w.useCallback(()=>{if(h.length===0)return;const _=d>=h.length-1?0:d+1;f(_),n==null||n(h[_],_)},[h,d,n]),A=w.useCallback(_=>{s==null||s(_,h,p)},[s,h,p]);return w.useEffect(()=>{h.length===0?f(-1):d>=h.length?f(h.length-1):d<0&&h.length>0&&(f(0),n==null||n(h[0],0))},[h.length,d,n]),r.length===0?g.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${a}`,children:i}):g.jsxs("div",{className:`space-y-2 ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[l&&g.jsxs("button",{onClick:b,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[g.jsx("span",{className:"material-icons text-sm",children:u.size===r.length?"check_box":u.size>0?"indeterminate_check_box":"check_box_outline_blank"}),g.jsx("span",{children:u.size===r.length?"Deselect all":"Select all"})]}),u.size>0&&g.jsxs("span",{className:"text-neutral-400",children:["(",u.size," selected)"]})]}),h.length>1&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{onClick:D,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:g.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),g.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[d+1," / ",h.length]}),g.jsx("button",{onClick:y,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:g.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),g.jsx("div",{className:"space-y-1",children:r.map(_=>{const E=u.has(_.id),C=(p==null?void 0:p.id)===_.id;return g.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${C?"bg-blue-50 ring-1 ring-blue-200":E?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>m(_.id),children:[g.jsx("span",{className:`material-icons text-lg ${E?"text-blue-500":"text-neutral-300"}`,children:E?"check_box":"check_box_outline_blank"}),g.jsx("div",{className:"flex-1 min-w-0",children:e(_,E,C)})]},_.id)})}),o.length>0&&u.size>0&&g.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:o.map(_=>{var C;const E=((C=_.disabled)==null?void 0:C.call(_,h))??!1;return g.jsxs("button",{onClick:()=>A(_.id),disabled:E,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${E?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[_.icon&&g.jsx("span",{className:"material-icons text-sm",children:_.icon}),_.label]},_.id)})})]})}function yu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xu=yu(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ul=w.createContext(null);function bu(r,e){return{getTheme:function(){return e??null}}}function mt(){const r=w.useContext(ul);return r==null&&xu(8),r}function ln(r){return{}}const oi={},_u={},cl={},er={},br={},Zr={},_r={},ts={},Os={},en={},tn={},pt={},li={},ai={},vu={},dl={},Cu={},fl={},wu={},hl={},pl={},Rn={},Du={},gl={},ml={},yl={},Su={},Au={},Eu={},Gi={},xl={},ku={},bl={},_l={},Tu={},rs={},ui={},Ms={},Bu={},Nu={},Cn={},wn={},Fu={},Lu={},ju={},yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ru=yt&&"documentMode"in document?document.documentMode:null,dt=yt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Gt=yt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Pn=!(!yt||!("InputEvent"in window)||Ru)&&"getTargetRanges"in new window.InputEvent("input"),ns=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),an=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pu=yt&&/Android/.test(navigator.userAgent),vl=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ou=yt&&Pu&&vl,ci=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!vl,un=1,Vt=3,nr=0,Cl=1,wr=2,Mu=0,$u=1,Iu=2,On=4,Mn=8,di=128,zu=112|(3|On|Mn)|di,fi=1,hi=2,pi=3,gi=4,mi=5,yi=6,ss=ns||an||ci?" ":"​",Lt=`
61
+ `,children:[a&&g.jsx("div",{className:"flex-shrink-0",children:g.jsx("img",{src:a,alt:i,className:"w-16 h-16 object-cover rounded-lg"})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("h3",{className:"font-medium text-gray-900 truncate",children:i}),u&&g.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:u})]}),l&&g.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:l})]}),e&&g.jsx("div",{className:"flex-shrink-0 text-gray-400",children:g.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function du({item:r,onClose:e,title:t=o=>o.title||o.name||o.label||"Detail",image:n=o=>o.image||o.thumbnail||o.photo,fields:s=[]}){if(!r)return null;const o=t(r),i=n(r);return g.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:g.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[g.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[g.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),e&&g.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:g.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),g.jsxs("div",{className:"p-6",children:[i&&g.jsx("div",{className:"mb-6",children:g.jsx("img",{src:i,alt:o,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&g.jsx("div",{className:"space-y-4",children:s.map((l,a)=>{const u=l.value(r);return u==null||u===""?null:g.jsxs("div",{children:[g.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:l.label}),g.jsx("div",{className:"text-base text-gray-900",children:typeof u=="object"?JSON.stringify(u,null,2):String(u)})]},a)})}),s.length===0&&g.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&g.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:g.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const fu={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function hu({nodes:r,cardCount:e=2,minInterval:t=1e3,maxInterval:n=3e3,onCardClick:s,cardSize:o="medium",className:i=""}){const l=Math.min(Math.max(e,1),5),[a,u]=w.useState([]),[c,d]=w.useState([]),[f,h]=w.useState(Array(l).fill(!1)),[p,m]=w.useState(Array(l).fill(!1)),x=w.useRef([]),D=w.useCallback(v=>{const _=r.filter(T=>!v.includes(T._id));if(_.length===0)return null;const S=Math.floor(Math.random()*_.length);return _[S]},[r]),y=w.useCallback(()=>Math.random()*(n-t)+t,[t,n]);w.useEffect(()=>{if(r.length===0){u([]),d([]);return}const v=[],_=[],S=[];for(let T=0;T<l&&T<r.length;T++){const z=D(S);z&&(v.push(z),S.push(z._id))}for(let T=0;T<v.length;T++){const z=[v[T]._id,...v.filter((L,P)=>P!==T).map(L=>L._id)],N=D(z);N?_.push(N):_.push(v[T])}u(v),d(_)},[r,l,D]);const A=w.useCallback(v=>{const _=y(),S=setTimeout(()=>{h(T=>{const z=[...T];return z[v]=!z[v],z}),setTimeout(()=>{m(T=>{const z=[...T];return z[v]=!z[v],z}),setTimeout(()=>{const T=!p[v];T&&u(z=>{const N=[...z];return N[v]=c[v],N}),d(z=>{const N=[...z],P=[(T?c[v]:a[v])._id,...a.filter((R,X)=>X!==v).map(R=>R._id),...z.filter((R,X)=>X!==v).map(R=>R._id)],j=D(P);return j&&(N[v]=j),N}),setTimeout(()=>{A(v)},150)},200)},150)},_);x.current[v]=S},[y,D,a,c,p]),C=w.useRef(!1);w.useEffect(()=>{if(!(a.length===0||r.length<=1)&&!C.current){C.current=!0;for(let v=0;v<a.length;v++)A(v);return()=>{x.current.forEach(v=>clearTimeout(v)),x.current=[],C.current=!1}}},[a.length,r.length]);const E=v=>{s&&s(v)};return r.length===0?g.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:g.jsx("p",{className:"text-gray-500",children:"No nodes available"})}):a.length===0?g.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:g.jsx("p",{className:"text-gray-500",children:"Loading..."})}):g.jsx("div",{className:`flex gap-4 justify-center items-center flex-wrap ${i}`,children:a.map((v,_)=>{const S=c[_],T=p[_];return g.jsx("div",{className:`relative ${fu[o]}`,style:{perspective:"1000px"},onClick:()=>E(T?S:v),children:g.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${f[_]?180:0}deg)`,transition:"transform 0.5s",transformStyle:"preserve-3d"},children:[g.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:T?0:1},children:g.jsxs("div",{style:{transform:f[_]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[g.jsx("img",{src:v.data.image,alt:v.title,className:"w-full h-full object-cover"}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:g.jsx("p",{className:"text-white text-sm font-medium truncate",children:v.title})})]})}),S&&g.jsx("div",{className:"absolute inset-0 transition-opacity duration-200",style:{opacity:T?1:0},children:g.jsxs("div",{style:{transform:f[_]?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[g.jsx("img",{src:S.data.image,alt:S.title,className:"w-full h-full object-cover"}),g.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:g.jsx("p",{className:"text-white text-sm font-medium truncate",children:S.title})})]})})]})},`slot-${_}`)})})}function gr(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,o)=>{try{if(s.toUpperCase()==="B"){const i=atob(o);return decodeURIComponent(escape(i))}else if(s.toUpperCase()==="Q"){const i=o.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(l,a)=>String.fromCharCode(parseInt(a,16)));return decodeURIComponent(escape(i))}}catch(i){console.warn("MIME decode error:",i)}return t}).replace(/\s+/g," ").trim()}const pu={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function gu({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:o=!0,showDetail:i=!1,showSearch:l=!0,searchQuery:a,onSearchChange:u,emptyMessage:c="No emails",autoLoad:d=!0,onSelect:f,onSelectionChange:h,onDelete:p,onError:m,onLoad:x,renderItem:D,renderDetail:y,renderActions:A,renderEmpty:C,renderLoading:E,theme:v={}}){const _={...pu,...v},[S,T]=w.useState([]),[z,N]=w.useState(!1),[L,P]=w.useState(null),[j,R]=w.useState(new Set),[X,ge]=w.useState(null),[ie,De]=w.useState(null),[Ce,Ie]=w.useState(null),[ze,Me]=w.useState(!1),[Ve,be]=w.useState(""),he=a!==void 0?a:Ve,Le=k=>{u?u(k):be(k)},je=w.useMemo(()=>{if(!he.trim())return S;const k=he.toLowerCase();return S.filter($=>gr($.from).toLowerCase().includes(k)||gr($.subject).toLowerCase().includes(k))},[S,he]),me=w.useMemo(()=>e?new ol({baseUrl:r,system_id:e}):null,[r,e]),He=w.useCallback(async()=>{if(me){N(!0),P(null);try{const k=await me.listEmails(t,n,s);k!=null&&k.messages&&(T(k.messages),x==null||x(k.messages))}catch(k){const $=k instanceof Error?k:new Error("Failed to fetch emails");P($.message),m==null||m($)}N(!1)}},[me,t,n,s,m,x]);w.useEffect(()=>{T([]),R(new Set),De(null),P(null),a===void 0&&be(""),d&&He()},[s,d]);const Tt=w.useCallback(async k=>{if(me){De(k),Ie(null),Me(!0);try{const $=await me.getEmailParsed(t,k.uid,s||"INBOX");$!=null&&$.body&&Ie($.body)}catch($){console.error("Failed to fetch email body:",$)}Me(!1)}},[me,t,s]),bt=w.useCallback(k=>{f==null||f(k),i&&Tt(k)},[f,i,Tt]),Mt=w.useCallback((k,$,H)=>{if(!o){f==null||f(k),i&&Tt(k);return}const Q=k.uid;if(H.shiftKey&&X!==null){const ee=Math.min(X,$),oe=Math.max(X,$),re=S.slice(ee,oe+1).map(ye=>ye.uid),te=new Set(re);R(te),h==null||h(Array.from(te))}else if(H.ctrlKey||H.metaKey)R(ee=>{const oe=new Set(ee);return oe.has(Q)?oe.delete(Q):oe.add(Q),h==null||h(Array.from(oe)),oe}),ge($);else{const ee=new Set([Q]);R(ee),ge($),h==null||h(Array.from(ee))}},[o,X,S,j,f,h,i]),it=w.useCallback(async()=>{if(!me||j.size===0)return;const k=s||"INBOX";try{const $=await me.trashEmails(t,Array.from(j),k);if(console.log("Trash result:",$),$.success&&$.moved>0){T(Q=>Q.filter(ee=>!j.has(ee.uid)));const H=Array.from(j);R(new Set),p==null||p(H)}else P("Failed to move emails to trash")}catch($){const H=$ instanceof Error?$:new Error("Trash failed");console.error("Trash error:",H),P(H.message),m==null||m(H)}},[me,t,j,s,p,m]),ot=w.useCallback(async()=>{if(!me||j.size===0)return;const k=s||"INBOX";try{const $=await me.archiveEmails(t,Array.from(j),k);if(console.log("Archive result:",$),$.success&&$.archived>0){T(Q=>Q.filter(ee=>!j.has(ee.uid)));const H=Array.from(j);R(new Set),p==null||p(H)}else P("Failed to archive emails")}catch($){const H=$ instanceof Error?$:new Error("Archive failed");console.error("Archive error:",H),P(H.message),m==null||m(H)}},[me,t,j,s,p,m]),Je=w.useCallback(()=>{if(j.size===S.length)R(new Set),h==null||h([]);else{const k=new Set(S.map($=>$.uid));R(k),h==null||h(Array.from(k))}},[S,j.size,h]),tt=w.useCallback(()=>{R(new Set),h==null||h([])},[h]),Bt={delete:it,archive:ot,refresh:He,selectAll:Je,clearSelection:tt},V=k=>{if(!k)return"";const $=new Date(k),H=new Date;return $.toDateString()===H.toDateString()?$.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):$.toLocaleDateString([],{month:"short",day:"numeric"})},Be=(k,$)=>g.jsx("div",{style:{padding:"12px 16px",background:$?_.selectedBackground:k.seen?_.cardBackground:_.unreadBackground,borderBottom:`1px solid ${_.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:"14px",fontWeight:k.seen?400:600,color:_.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:gr(k.from).split("@")[0]}),g.jsx("div",{style:{fontSize:"14px",fontWeight:k.seen?400:500,color:k.seen?_.textSecondary:_.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:gr(k.subject)||"(No subject)"})]}),g.jsx("div",{style:{fontSize:"12px",color:_.textSecondary,flexShrink:0},children:V(k.date)})]})}),rt=k=>g.jsxs("div",{style:{padding:"24px"},children:[g.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:_.text},children:gr(k.subject)||"(No subject)"}),g.jsxs("div",{style:{fontSize:"14px",color:_.textSecondary,marginBottom:"16px"},children:["From: ",gr(k.from)," • ",new Date(k.date).toLocaleString()]}),ze?g.jsx("div",{style:{fontSize:"14px",color:_.textSecondary},children:"Loading..."}):Ce?g.jsx("div",{style:{fontSize:"14px",color:_.text},dangerouslySetInnerHTML:{__html:Ce}}):g.jsx("div",{style:{fontSize:"14px",color:_.textSecondary},children:"No content available"})]}),ct=(k,$)=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:_.cardBackground,borderBottom:`1px solid ${_.border}`},children:[g.jsx("button",{onClick:$.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${_.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:_.text},children:k.length===S.length?"Deselect All":"Select All"}),k.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("span",{style:{fontSize:"13px",color:_.textSecondary},children:[k.length," selected"]}),g.jsx("button",{onClick:$.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${_.border}`,borderRadius:"6px",cursor:"pointer",color:_.textSecondary},children:g.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),g.jsx("button",{onClick:$.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${_.border}`,borderRadius:"6px",cursor:"pointer",color:_.textSecondary},children:g.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),g.jsx("div",{style:{flex:1}}),g.jsx("button",{onClick:$.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${_.border}`,borderRadius:"6px",cursor:"pointer",color:_.textSecondary},children:g.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),qe=()=>g.jsx("div",{style:{padding:"48px",textAlign:"center",color:_.textSecondary},children:c}),Qe=()=>g.jsx("div",{style:{padding:"48px",textAlign:"center",color:_.textSecondary},children:"Loading..."}),$t=D||Be,U=y||rt,B=A||ct,Z=C||qe,J=E||Qe;return z&&S.length===0?g.jsx("div",{style:{background:_.background,width:"100%",height:"100%"},children:J()}):g.jsxs("div",{style:{display:"flex",background:_.background,width:"100%",height:"100%"},children:[g.jsxs("div",{style:{flex:i&&ie?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:i&&ie?`1px solid ${_.border}`:"none",overflow:"hidden"},children:[o&&B(Array.from(j),Bt),l&&g.jsx("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${_.border}`,background:_.background},children:g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",background:"#f5f5f5",borderRadius:"6px"},children:[g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:_.textSecondary,strokeWidth:"2",children:[g.jsx("circle",{cx:"11",cy:"11",r:"8"}),g.jsx("path",{d:"M21 21l-4.35-4.35"})]}),g.jsx("input",{type:"text",placeholder:"Search by email or subject...",value:he,onChange:k=>Le(k.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:"13px",color:_.text}}),he&&g.jsx("button",{onClick:()=>Le(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:_.textSecondary,strokeWidth:"2",children:g.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}),L&&g.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:_.danger,fontSize:"14px",borderBottom:`1px solid ${_.border}`},children:L}),g.jsx("div",{style:{flex:1,overflowY:"auto"},children:je.length===0?Z():je.map((k,$)=>g.jsx("div",{onClick:H=>Mt(k,$,H),onDoubleClick:()=>bt(k),children:$t(k,j.has(k.uid))},k.uid))})]}),i&&ie&&g.jsx("div",{style:{flex:1,overflowY:"auto"},children:U(ie)})]})}function mu({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:o=[],emptyMessage:i="No items",showSelectAll:l=!0,className:a=""}){const[u,c]=w.useState(new Set),[d,f]=w.useState(-1),h=r.filter(C=>u.has(C.id)),p=d>=0&&d<h.length?h[d]:null,m=w.useCallback(C=>{c(E=>{const v=new Set(E);return v.has(C)?v.delete(C):v.add(C),t==null||t(Array.from(v)),v})},[t]),x=w.useCallback(()=>{if(u.size===r.length)c(new Set),f(-1),t==null||t([]);else{const C=new Set(r.map(E=>E.id));c(C),r.length>0&&(f(0),n==null||n(r[0],0)),t==null||t(r.map(E=>E.id))}},[r,u.size,t,n]),D=w.useCallback(()=>{if(h.length===0)return;const C=d<=0?h.length-1:d-1;f(C),n==null||n(h[C],C)},[h,d,n]),y=w.useCallback(()=>{if(h.length===0)return;const C=d>=h.length-1?0:d+1;f(C),n==null||n(h[C],C)},[h,d,n]),A=w.useCallback(C=>{s==null||s(C,h,p)},[s,h,p]);return w.useEffect(()=>{h.length===0?f(-1):d>=h.length?f(h.length-1):d<0&&h.length>0&&(f(0),n==null||n(h[0],0))},[h.length,d,n]),r.length===0?g.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${a}`,children:i}):g.jsxs("div",{className:`space-y-2 ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[l&&g.jsxs("button",{onClick:x,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[g.jsx("span",{className:"material-icons text-sm",children:u.size===r.length?"check_box":u.size>0?"indeterminate_check_box":"check_box_outline_blank"}),g.jsx("span",{children:u.size===r.length?"Deselect all":"Select all"})]}),u.size>0&&g.jsxs("span",{className:"text-neutral-400",children:["(",u.size," selected)"]})]}),h.length>1&&g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{onClick:D,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:g.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),g.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[d+1," / ",h.length]}),g.jsx("button",{onClick:y,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:g.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),g.jsx("div",{className:"space-y-1",children:r.map(C=>{const E=u.has(C.id),v=(p==null?void 0:p.id)===C.id;return g.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${v?"bg-blue-50 ring-1 ring-blue-200":E?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>m(C.id),children:[g.jsx("span",{className:`material-icons text-lg ${E?"text-blue-500":"text-neutral-300"}`,children:E?"check_box":"check_box_outline_blank"}),g.jsx("div",{className:"flex-1 min-w-0",children:e(C,E,v)})]},C.id)})}),o.length>0&&u.size>0&&g.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:o.map(C=>{var v;const E=((v=C.disabled)==null?void 0:v.call(C,h))??!1;return g.jsxs("button",{onClick:()=>A(C.id),disabled:E,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${E?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[C.icon&&g.jsx("span",{className:"material-icons text-sm",children:C.icon}),C.label]},C.id)})})]})}function yu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var xu=yu(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const cl=w.createContext(null);function bu(r,e){return{getTheme:function(){return e??null}}}function yt(){const r=w.useContext(cl);return r==null&&xu(8),r}function an(r){return{}}const li={},_u={},dl={},tr={},vr={},en={},Cr={},ts={},Ms={},tn={},rn={},gt={},ai={},ui={},vu={},fl={},Cu={},hl={},wu={},pl={},gl={},Rn={},Du={},ml={},yl={},xl={},Su={},Au={},Eu={},Ki={},bl={},ku={},_l={},vl={},Tu={},rs={},ci={},$s={},Bu={},Nu={},Cn={},wn={},Fu={},Lu={},ju={},xt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ru=xt&&"documentMode"in document?document.documentMode:null,ft=xt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Kt=xt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Pn=!(!xt||!("InputEvent"in window)||Ru)&&"getTargetRanges"in new window.InputEvent("input"),ns=xt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),un=xt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pu=xt&&/Android/.test(navigator.userAgent),Cl=xt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ou=xt&&Pu&&Cl,di=xt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Cl,cn=1,Ht=3,sr=0,wl=1,Sr=2,Mu=0,$u=1,Iu=2,On=4,Mn=8,fi=128,zu=112|(3|On|Mn)|fi,hi=1,pi=2,gi=3,mi=4,yi=5,xi=6,ss=ns||un||di?" ":"​",jt=`
62
62
 
63
- `,qu=Gt?" ":ss,wl="֑-߿יִ-﷽ﹰ-ﻼ",Dl="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Uu=new RegExp("^[^"+Dl+"]*["+wl+"]"),Wu=new RegExp("^[^"+wl+"]*["+Dl+"]"),sr={bold:1,code:16,highlight:di,italic:2,strikethrough:On,subscript:32,superscript:64,underline:Mn},Gu={directionless:1,unmergeable:2},Ki={center:hi,end:yi,justify:gi,left:fi,right:pi,start:mi},Ku={[hi]:"center",[yi]:"end",[gi]:"justify",[fi]:"left",[pi]:"right",[mi]:"start"},Vu={normal:0,segmented:2,token:1},Hu={[Mu]:"normal",[Iu]:"segmented",[$u]:"token"};function Ju(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var I=Ju(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function $n(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const Qu=100;let $s=!1,xi=0;function Yu(r){xi=r.timeStamp}function Ds(r,e,t){const n=r.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(r===s||n&&r.previousSibling===s)||n&&os(r,t)!==void 0}function Xu(r,e,t){const n=ut(t._window);let s=null,o=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,o=n.focusOffset);const i=r.nodeValue;i!==null&&wi(e,i,s,o,!1)}function Zu(r,e,t){if(M(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===Vt&&t.isAttached()}function ec(r,e,t,n){for(let s=r;s&&!hc(s);s=dn(s)){const o=os(s,e);if(o!==void 0){const i=ze(o,t);if(i)return de(i)?void 0:[s,i]}else if(s===n)return[n,Ll(t)]}}function Sl(r,e,t){$s=!0;const n=performance.now()-xi>Qu;try{st(r,()=>{const s=V()||function(f){return f.getEditorState().read(()=>{const h=V();return h!==null?h.clone():null})}(r),o=new Map,i=r.getRootElement(),l=r._editorState,a=r._blockCursorElement;let u=!1,c="";for(let f=0;f<e.length;f++){const h=e[f],p=h.type,m=h.target,b=ec(m,r,l,i);if(!b)continue;const[D,y]=b;if(p==="characterData")n&&U(y)&&Zu(s,m,y)&&Xu(m,y,r);else if(p==="childList"){u=!0;const A=h.addedNodes;for(let C=0;C<A.length;C++){const v=A[C],S=Nl(v),k=v.parentNode;if(k!=null&&v!==a&&S===null&&!Ds(v,k,r)){if(Gt){const q=v.innerText||v.nodeValue;q&&(c+=q)}k.removeChild(v)}}const _=h.removedNodes,E=_.length;if(E>0){let C=0;for(let v=0;v<E;v++){const S=_[v];(Ds(S,m,r)||a===S)&&(m.appendChild(S),C++)}E!==C&&o.set(D,y)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,r);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],p=h.addedNodes,m=h.target;for(let b=0;b<p.length;b++){const D=p[b],y=D.parentNode;y==null||D.nodeName!=="BR"||Ds(D,m,r)||y.removeChild(D)}}t.takeRecords()}s!==null&&(u&&(s.dirty=!0,wt(s)),Gt&&Ol(r)&&s.insertRawText(c))})}finally{$s=!1}}function Al(r){const e=r._observer;e!==null&&Sl(r,e.takeRecords(),e)}function El(r){(function(e){xi===0&&as(e).addEventListener("textInput",Yu,!0)})(r),r._observer=new MutationObserver((e,t)=>{Sl(r,e,t)})}function Vi(r,e){const t=r.__mode,n=r.__format,s=r.__style,o=e.__mode,i=e.__format,l=e.__style;return!(t!==null&&t!==o||n!==null&&n!==i||s!==null&&s!==l)}function Hi(r,e){const t=r.mergeWithSibling(e),n=ve()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function Ji(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&U(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Vi(e,n)){n=Hi(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&U(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Vi(n,t)){n=Hi(n,t);break}break}t.remove()}}else n.remove()}function kl(r){return Qi(r.anchor),Qi(r.focus),r}function Qi(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),U(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!N(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let tc=1;const rc=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function bi(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return de(Dr(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&is(e)==null)}function cn(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!bi(e)&&Tl(e)===r}catch{return!1}}function _i(r){return r instanceof hs}function Tl(r){let e=r;for(;e!=null;){const t=is(e);if(_i(t))return t;e=dn(e)}return null}function is(r){return r?r.__lexicalEditor:null}function Xt(r){return r.isToken()||r.isSegmented()}function nc(r){return r.nodeType===Vt}function In(r){let e=r;for(;e!=null;){if(nc(e))return e;e=e.firstChild}return null}function zn(r,e,t){const n=sr[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=-65:e==="superscript"&&(s&=-33),s}function Bl(r){return U(r)||rr(r)||de(r)}function sc(r,e){if(e!=null)return void(r.__key=e);Xe(),sa();const t=ve(),n=Rt(),s=""+tc++;n._nodeMap.set(s,r),N(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=Cl,r.__key=s}function tr(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),o=r.getNextSibling();if(s===null)if(o!==null){const i=o.getWritable();n.__first=o.__key,i.__prev=null}else n.__first=null;else{const i=s.getWritable();if(o!==null){const l=o.getWritable();l.__prev=i.__key,i.__next=l.__key}else i.__next=null;t.__prev=null}if(o===null)if(s!==null){const i=s.getWritable();n.__last=s.__key,i.__next=null}else n.__last=null;else{const i=o.getWritable();if(s!==null){const l=s.getWritable();l.__next=i.__key,i.__prev=l.__key}else i.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function qn(r){sa();const e=r.getLatest(),t=e.__parent,n=Rt(),s=ve(),o=n._nodeMap,i=s._dirtyElements;t!==null&&function(a,u,c){let d=a;for(;d!==null;){if(c.has(d))return;const f=u.get(d);if(f===void 0)break;c.set(d,!1),d=f.__parent}}(t,o,i);const l=e.__key;s._dirtyType=Cl,N(r)?i.set(l,!0):s._dirtyLeaves.add(l)}function Me(r){Xe();const e=ve(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=ze(t);n!==null&&n.getWritable()}if(r!==null){const n=ze(r);n!==null&&n.getWritable()}}}function qt(){return mn()?null:ve()._compositionKey}function ze(r,e){const t=(e||Rt())._nodeMap.get(r);return t===void 0?null:t}function Nl(r,e){const t=os(r,ve());return t!==void 0?ze(t,e):null}function os(r,e){return r[`__lexicalKey_${e._key}`]}function Dr(r,e){let t=r;for(;t!=null;){const n=Nl(t,e);if(n!==null)return n;t=dn(t)}return null}function Fl(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function Yi(r){return r.read(()=>xe().getTextContent())}function xe(){return Ll(Rt())}function Ll(r){return r._nodeMap.get("root")}function wt(r){Xe();const e=Rt();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function yr(r){const e=ve(),t=function(n,s){let o=n;for(;o!=null;){const i=os(o,s);if(i!==void 0)return i;o=dn(o)}return null}(r,e);return t===null?r===e.getRootElement()?ze("root"):null:ze(t)}function Xi(r,e){return e?r.getTextContentSize():0}function jl(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function vi(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Rl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Pl(r){return r.nodeType===Vt?r.nodeValue:null}function Ci(r,e,t){const n=ut(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:o,focusOffset:i}=n;if(s!==null){let l=Pl(s);const a=Dr(s);if(l!==null&&U(a)){if(l===ss&&t){const u=t.length;l=t,o=u,i=u}l!==null&&wi(a,l,o,i,r)}}}function wi(r,e,t,n,s){let o=r;if(o.isAttached()&&(s||!o.isDirty())){const i=o.isComposing();let l=e;(i||s)&&e[e.length-1]===ss&&(l=e.slice(0,-1));const a=o.getTextContent();if(s||l!==a){if(l===""){if(Me(null),ns||an||ci)o.remove();else{const m=ve();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const u=o.getParent(),c=gn(),d=o.getTextContentSize(),f=qt(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!i||M(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===r.__key&&c.anchor.offset===0&&!o.canInsertTextBefore()&&!i||c.focus.key===r.__key&&c.focus.offset===d&&!o.canInsertTextAfter()&&!i))return void o.markDirty();const p=V();if(!M(p)||t===null||n===null)return void o.setTextContent(l);if(p.setTextNodeRange(o,t,o,n),o.isSegmented()){const m=ke(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function ic(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(o){const i=o.getPreviousSibling();return(U(i)||N(i)&&i.isInline())&&!i.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function Zi(r){return r==="ArrowLeft"}function eo(r){return r==="ArrowRight"}function zr(r,e){return dt?r:e}function to(r){return r==="Enter"}function Rr(r){return r==="Backspace"}function Pr(r){return r==="Delete"}function ro(r,e,t){return r.toLowerCase()==="a"&&zr(e,t)}function oc(){const r=xe();wt(kl(r.select(0,r.getChildrenSize())))}function Vr(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const o=$n(s);return t[e]=o,o}return s}function Di(r,e,t,n,s){if(t.size===0)return;const o=n.__type,i=n.__key,l=e.get(o);l===void 0&&I(33,o);const a=l.klass;let u=r.get(a);u===void 0&&(u=new Map,r.set(a,u));const c=u.get(i),d=c==="destroyed"&&s==="created";(c===void 0||d)&&u.set(i,d?"updated":s)}function no(r,e,t){const n=r.getParent();let s=t,o=r;return n!==null&&(e&&t===0?(s=o.getIndexWithinParent(),o=n):e||t!==o.getChildrenSize()||(s=o.getIndexWithinParent()+1,o=n)),o.getChildAtIndex(e?s-1:s)}function rn(r,e){const t=r.offset;if(r.type==="element")return no(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?no(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function Ol(r){const e=as(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function G(r,e,t){return la(r,e,t)}function ls(r){return!Ge(r)&&!r.isLastChild()&&!r.isInline()}function Un(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&I(75,e),t}function dn(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Hr(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function as(r){const e=r._window;return e===null&&I(78),e}function lc(r){let e=r.getParentOrThrow();for(;e!==null;){if(Dt(e))return e;e=e.getParentOrThrow()}return e}function Dt(r){return Ge(r)||N(r)&&r.isShadowRoot()}function At(r){const e=ve(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&I(200,r.constructor.name,t);const{replace:s,replaceWithKlass:o}=n;if(s!==null){const i=s(r),l=i.constructor;return o!==null?i instanceof o||I(201,o.name,o.getType(),l.name,l.getType(),r.constructor.name,t):i instanceof r.constructor&&l!==r.constructor||I(202,l.name,l.getType(),r.constructor.name,t),i.__key===r.__key&&I(203,r.constructor.name,t,l.name,l.getType()),i}return r}function Ss(r,e){!Ge(r.getParent())||N(e)||de(e)||I(99)}function As(r){return(de(r)||N(r)&&!r.canBeEmpty())&&!r.isInline()}function Si(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function ac(r,e,t){let n=r._blockCursorElement;if(M(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,o=s.getNode(),i=s.offset;let l=!1,a=null;if(i===o.getChildrenSize())As(o.getChildAtIndex(i-1))&&(l=!0);else{const u=o.getChildAtIndex(i);if(u!==null&&As(u)){const c=u.getPreviousSibling();(c===null||As(c))&&(l=!0,a=r.getElementByKey(u.__key))}}if(l){const u=r.getElementByKey(o.__key);return n===null&&(r._blockCursorElement=n=function(c){const d=c.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const p=$n(h);h=d.blockCursor=p}h!==void 0&&f.classList.add(...h)}return f}(r._config)),e.style.caretColor="transparent",void(a===null?u.appendChild(n):u.insertBefore(n,a))}}n!==null&&Si(n,r,e)}function ut(r){return yt?(r||window).getSelection():null}function uc(r){return jt(r)&&r.tagName==="A"}function jt(r){return r.nodeType===1}function so(r){return r.nodeType===11}function Is(r){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return r.nodeName.match(e)!==null}function Wn(r){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return r.nodeName.match(e)!==null}function It(r){if(de(r)&&!r.isInline())return!0;if(!N(r)||Dt(r))return!1;const e=r.getFirstChild(),t=e===null||rr(e)||U(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Or(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function cc(){return ve()}const io=new WeakMap,dc=new Map;function fc(r){if(!r._readOnly&&r.isEmpty())return dc;r._readOnly||I(192);let e=io.get(r);if(!e){e=new Map,io.set(r,e);for(const[t,n]of r._nodeMap){const s=n.__type;let o=e.get(s);o||(o=new Map,e.set(s,o)),o.set(t,n)}}return e}function Ai(r){const e=r.constructor.clone(r);return e.afterCloneFrom(r),e}function Ei(r,e){const t=(parseInt(r.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function hc(r){return r.__lexicalUnmanaged===!0}function Ml(r,e,t,n,s,o){let i=r.getFirstChild();for(;i!==null;){const l=i.__key;i.__parent===e&&(N(i)&&Ml(i,l,t,n,s,o),t.has(l)||o.delete(l),s.push(l)),i=i.getNextSibling()}}let Kt,Ke,nn,us,zs,qs,ir,gt,Us,sn,Te="",We="",bt=null,ft="",Ft="",$l=!1,on=!1,Nn=null;function Gn(r,e){const t=ir.get(r);if(e!==null){const n=Ks(r);n.parentNode===e&&e.removeChild(n)}if(gt.has(r)||Ke._keyToDOMMap.delete(r),N(t)){const n=Vn(t,ir);Ws(n,0,n.length-1,null)}t!==void 0&&Di(sn,nn,us,t,"destroyed")}function Ws(r,e,t,n){let s=e;for(;s<=t;++s){const o=r[s];o!==void 0&&Gn(o,n)}}function Yt(r,e){r.setProperty("text-align",e)}const pc="40px";function Il(r,e){const t=Kt.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||pc;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function zl(r,e){const t=r.style;e===0?Yt(t,""):e===fi?Yt(t,"left"):e===hi?Yt(t,"center"):e===pi?Yt(t,"right"):e===gi?Yt(t,"justify"):e===mi?Yt(t,"start"):e===yi&&Yt(t,"end")}function Kn(r,e){const t=gt.get(r);t===void 0&&I(60);const n=t.createDOM(Kt,Ke);if(function(s,o,i){const l=i._keyToDOMMap;(function(a,u,c){a[`__lexicalKey_${u._key}`]=c})(o,i,s),l.set(s,o)}(r,n,Ke),U(t)?n.setAttribute("data-lexical-text","true"):de(t)&&n.setAttribute("data-lexical-decorator","true"),N(t)){const s=t.__indent,o=t.__size;if(s!==0&&Il(n,s),o!==0){const l=o-1;(function(a,u,c,d){const f=We;We="",Gs(a,c,0,u,c.getDOMSlot(d)),Ul(c,d),We=f})(Vn(t,gt),l,t,n)}const i=t.__format;i!==0&&zl(n,i),t.isInline()||ql(null,t,n),ls(t)&&(Te+=Lt,Ft+=Lt)}else{const s=t.getTextContent();if(de(t)){const o=t.decorate(Ke,Kt);o!==null&&Wl(r,o),n.contentEditable="false"}else U(t)&&(t.isDirectionless()||(We+=s));Te+=s,Ft+=s}return e!==null&&e.insertChild(n),Di(sn,nn,us,t,"created"),n}function Gs(r,e,t,n,s){const o=Te;Te="";let i=t;for(;i<=n;++i){Kn(r[i],s);const l=gt.get(r[i]);l!==null&&U(l)&&(bt===null&&(bt=l.getFormat()),ft===""&&(ft=l.getStyle()))}ls(e)&&(Te+=Lt),s.element.__lexicalTextContent=Te,Te=o+Te}function oo(r,e){if(r){const t=r.__last;if(t){const n=e.get(t);if(n)return rr(n)?"line-break":de(n)&&n.isInline()?"decorator":null}return"empty"}return null}function ql(r,e,t){const n=oo(r,ir),s=oo(e,gt);n!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Ul(r,e){const t=e.__lexicalDirTextContent||"",n=e.__lexicalDir||"";if(t!==We||n!==Nn){const o=We==="",i=o?Nn:(s=We,Uu.test(s)?"rtl":Wu.test(s)?"ltr":null);if(i!==n){const l=e.classList,a=Kt.theme;let u=n!==null?a[n]:void 0,c=i!==null?a[i]:void 0;if(u!==void 0){if(typeof u=="string"){const d=$n(u);u=a[n]=d}l.remove(...u)}if(i===null||o&&i==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const d=$n(c);c=a[i]=d}c!==void 0&&l.add(...c)}e.dir=i}on||(r.getWritable().__dir=i)}Nn=i,e.__lexicalDirTextContent=We,e.__lexicalDir=i}var s}function gc(r,e,t){const n=We;var s;We="",bt=null,ft="",function(o,i,l){const a=Te,u=o.__size,c=i.__size;Te="";const d=l.element;if(u===1&&c===1){const f=o.__first,h=i.__first;if(f===h)qr(f,d);else{const m=Ks(f),b=Kn(h,null);try{d.replaceChild(b,m)}catch(D){if(typeof D=="object"&&D!=null){const y=`${D.toString()} Parent: ${d.tagName}, new child: {tag: ${b.tagName} key: ${h}}, old child: {tag: ${m.tagName}, key: ${f}}.`;throw new Error(y)}throw D}Gn(f,null)}const p=gt.get(h);U(p)&&(bt===null&&(bt=p.getFormat()),ft===""&&(ft=p.getStyle()))}else{const f=Vn(o,ir),h=Vn(i,gt);if(f.length!==u&&I(227),h.length!==c&&I(228),u===0)c!==0&&Gs(h,i,0,c-1,l);else if(c===0){if(u!==0){const p=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Ws(f,0,u-1,p?null:d),p&&(d.textContent="")}}else(function(p,m,b,D,y,A){const _=D-1,E=y-1;let C,v,S=A.getFirstChild(),k=0,q=0;for(;k<=_&&q<=E;){const j=m[k],L=b[q];if(j===L)S=Es(qr(L,A.element)),k++,q++;else{C===void 0&&(C=new Set(m)),v===void 0&&(v=new Set(b));const Z=v.has(j),ue=C.has(L);if(Z)if(ue){const fe=Un(Ke,L);fe===S?S=Es(qr(L,A.element)):(A.withBefore(S).insertChild(fe),qr(L,A.element)),k++,q++}else Kn(L,A.withBefore(S)),q++;else S=Es(Ks(j)),Gn(j,A.element),k++}const P=gt.get(L);P!==null&&U(P)&&(bt===null&&(bt=P.getFormat()),ft===""&&(ft=P.getStyle()))}const B=k>_,F=q>E;if(B&&!F){const j=b[E+1],L=j===void 0?null:Ke.getElementByKey(j);Gs(b,p,q,E,A.withBefore(L))}else F&&!B&&Ws(m,k,_,A.element)})(i,f,h,u,c,l)}ls(i)&&(Te+=Lt),d.__lexicalTextContent=Te,Te=a+Te}(r,e,e.getDOMSlot(t)),Ul(e,t),Sr(s=e)&&bt!=null&&bt!==s.__textFormat&&!on&&(s.setTextFormat(bt),s.setTextStyle(ft)),function(o){Sr(o)&&ft!==""&&ft!==o.__textStyle&&!on&&o.setTextStyle(ft)}(e),We=n}function Vn(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&I(101),t.push(n),n=s.__next}return t}function qr(r,e){const t=ir.get(r);let n=gt.get(r);t!==void 0&&n!==void 0||I(61);const s=$l||qs.has(r)||zs.has(r),o=Un(Ke,r);if(t===n&&!s){if(N(t)){const i=o.__lexicalTextContent;i!==void 0&&(Te+=i,Ft+=i);const l=o.__lexicalDirTextContent;l!==void 0&&(We+=l)}else{const i=t.getTextContent();U(t)&&!t.isDirectionless()&&(We+=i),Ft+=i,Te+=i}return o}if(t!==n&&s&&Di(sn,nn,us,n,"updated"),n.updateDOM(t,o,Kt)){const i=Kn(r,null);return e===null&&I(62),e.replaceChild(i,o),Gn(r,null),i}if(N(t)&&N(n)){const i=n.__indent;i!==t.__indent&&Il(o,i);const l=n.__format;l!==t.__format&&zl(o,l),s&&(gc(t,n,o),Ge(n)||n.isInline()||ql(t,n,o)),ls(n)&&(Te+=Lt,Ft+=Lt)}else{const i=n.getTextContent();if(de(n)){const l=n.decorate(Ke,Kt);l!==null&&Wl(r,l)}else U(n)&&!n.isDirectionless()&&(We+=i);Te+=i,Ft+=i}if(!on&&Ge(n)&&n.__cachedText!==Ft){const i=n.getWritable();i.__cachedText=Ft,n=i}return o}function Wl(r,e){let t=Ke._pendingDecorators;const n=Ke._decorators;if(t===null){if(n[r]===e)return;t=Fl(Ke)}t[r]=e}function Es(r){let e=r.nextSibling;return e!==null&&e===Ke._blockCursorElement&&(e=e.nextSibling),e}function mc(r,e,t,n,s,o){Te="",Ft="",We="",$l=n===wr,Nn=null,Ke=t,Kt=t._config,nn=t._nodes,us=Ke._listeners.mutation,zs=s,qs=o,ir=r._nodeMap,gt=e._nodeMap,on=e._readOnly,Us=new Map(t._keyToDOMMap);const i=new Map;return sn=i,qr("root",null),Ke=void 0,nn=void 0,zs=void 0,qs=void 0,ir=void 0,gt=void 0,Kt=void 0,Us=void 0,sn=void 0,i}function Ks(r){const e=Us.get(r);return e===void 0&&I(75,r),e}const Nt=Object.freeze({}),Vs=30,Hs=[["keydown",function(r,e){if(Jr=r.timeStamp,Gl=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:o,altKey:i}=r;if(!G(e,vu,r)&&t!=null){if(function(l,a,u,c){return eo(l)&&!a&&!c&&!u}(t,s,i,o))G(e,dl,r);else if(function(l,a,u,c,d){return eo(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))G(e,Cu,r);else if(function(l,a,u,c){return Zi(l)&&!a&&!c&&!u}(t,s,i,o))G(e,fl,r);else if(function(l,a,u,c,d){return Zi(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))G(e,wu,r);else if(function(l,a,u){return function(c){return c==="ArrowUp"}(l)&&!a&&!u}(t,s,o))G(e,hl,r);else if(function(l,a,u){return function(c){return c==="ArrowDown"}(l)&&!a&&!u}(t,s,o))G(e,pl,r);else if(function(l,a){return to(l)&&a}(t,n))Qr=!0,G(e,Rn,r);else if(function(l){return l===" "}(t))G(e,Du,r);else if(function(l,a){return dt&&a&&l.toLowerCase()==="o"}(t,s))r.preventDefault(),Qr=!0,G(e,br,!0);else if(function(l,a){return to(l)&&!a}(t,n))Qr=!1,G(e,Rn,r);else if(function(l,a,u,c){return dt?!a&&!u&&(Rr(l)||l.toLowerCase()==="h"&&c):!(c||a||u)&&Rr(l)}(t,i,o,s))Rr(t)?G(e,gl,r):(r.preventDefault(),G(e,er,!0));else if(function(l){return l==="Escape"}(t))G(e,ml,r);else if(function(l,a,u,c,d){return dt?!(u||c||d)&&(Pr(l)||l.toLowerCase()==="d"&&a):!(a||c||d)&&Pr(l)}(t,s,n,i,o))Pr(t)?G(e,yl,r):(r.preventDefault(),G(e,er,!1));else if(function(l,a,u){return Rr(l)&&(dt?a:u)}(t,i,s))r.preventDefault(),G(e,en,!0);else if(function(l,a,u){return Pr(l)&&(dt?a:u)}(t,i,s))r.preventDefault(),G(e,en,!1);else if(function(l,a){return dt&&a&&Rr(l)}(t,o))r.preventDefault(),G(e,tn,!0);else if(function(l,a){return dt&&a&&Pr(l)}(t,o))r.preventDefault(),G(e,tn,!1);else if(function(l,a,u,c){return l.toLowerCase()==="b"&&!a&&zr(u,c)}(t,i,o,s))r.preventDefault(),G(e,pt,"bold");else if(function(l,a,u,c){return l.toLowerCase()==="u"&&!a&&zr(u,c)}(t,i,o,s))r.preventDefault(),G(e,pt,"underline");else if(function(l,a,u,c){return l.toLowerCase()==="i"&&!a&&zr(u,c)}(t,i,o,s))r.preventDefault(),G(e,pt,"italic");else if(function(l,a,u,c){return l==="Tab"&&!a&&!u&&!c}(t,i,s,o))G(e,Su,r);else if(function(l,a,u,c){return l.toLowerCase()==="z"&&!a&&zr(u,c)}(t,n,o,s))r.preventDefault(),G(e,li,void 0);else if(function(l,a,u,c){return dt?l.toLowerCase()==="z"&&u&&a:l.toLowerCase()==="y"&&c||l.toLowerCase()==="z"&&c&&a}(t,n,o,s))r.preventDefault(),G(e,ai,void 0);else{const l=e._editorState._selection;l===null||M(l)?!Gt&&ro(t,o,s)&&(r.preventDefault(),G(e,Ms,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="c"&&(dt?c:d)}(t,n,o,s)?(r.preventDefault(),G(e,rs,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="x"&&(dt?c:d)}(t,n,o,s)?(r.preventDefault(),G(e,ui,r)):ro(t,o,s)&&(r.preventDefault(),G(e,Ms,r))}(function(l,a,u,c){return l||a||u||c})(s,n,i,o)&&G(e,ju,r)}}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&st(e,()=>{de(Dr(t))||(Qs=!0)})}],["compositionstart",function(r,e){st(e,()=>{const t=V();if(M(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();Me(n.key),(r.timeStamp<Jr+Vs||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||U(s)&&s.getStyle()!==t.style)&&G(e,_r,qu)}})}],["compositionend",function(r,e){Gt?Mr=!0:st(e,()=>{ks(e,r.data)})}],["input",function(r,e){r.stopPropagation(),st(e,()=>{const t=V(),n=r.data,s=Jl(r);if(n!=null&&M(t)&&Hl(t,s,n,r.timeStamp,!1)){Mr&&(ks(e,n),Mr=!1);const o=t.anchor.getNode(),i=ut(e._window);if(i===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;Pn&&!t.isCollapsed()&&U(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,a)+n+o.getTextContent().slice(a+u)===Pl(i.anchorNode)||G(e,_r,n);const c=n.length;Gt&&c>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),ns||an||ci||!e.isComposing()||(Jr=0,Me(null))}else Ci(!1,e,n!==null?n:void 0),Mr&&(ks(e,n||void 0),Mr=!1);Xe(),Al(ve())}),mr=null}],["click",function(r,e){st(e,()=>{const t=V(),n=ut(e._window),s=gn();if(n){if(M(t)){const o=t.anchor,i=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Ge(i)&&xe().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()&&(N(i)?i.select(0):i.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const o=n.anchorNode;if(o!==null){const i=o.nodeType;(i===un||i===Vt)&&wt(Ti(s,n,e,r))}}}G(e,cl,r)})}],["cut",Nt],["copy",Nt],["dragstart",Nt],["dragover",Nt],["dragend",Nt],["paste",Nt],["focus",Nt],["blur",Nt],["drop",Nt]];Pn&&Hs.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,o=Jl(t);s==="deleteCompositionText"||Gt&&Ol(n)||s!=="insertCompositionText"&&st(n,()=>{const i=V();if(s==="deleteContentBackward"){if(i===null){const h=gn();if(!M(h))return;wt(h.clone())}if(M(i)){const h=i.anchor.key===i.focus.key;if(l=t.timeStamp,Gl==="MediaLast"&&l<Jr+Vs&&n.isComposing()&&h){if(Me(null),Jr=0,setTimeout(()=>{st(n,()=>{Me(null)})},Vs),M(i)){const p=i.anchor.getNode();p.markDirty(),i.format=p.getFormat(),U(p)||I(142),i.style=p.getStyle()}}else{Me(null),t.preventDefault();const p=i.anchor.getNode(),m=p.getTextContent(),b=p.canInsertTextAfter(),D=i.anchor.offset===0&&i.focus.offset===m.length;Ou&&h&&!D&&b||G(n,er,!0)}return}}var l;if(!M(i))return;const a=t.data;mr!==null&&Ci(!1,n,mr),i.dirty&&mr===null||!i.isCollapsed()||Ge(i.anchor.getNode())||o===null||i.applyDOMRange(o),mr=null;const u=i.anchor,c=i.focus,d=u.getNode(),f=c.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":G(n,_r,t);break;case"insertFromComposition":Me(null),G(n,_r,t);break;case"insertLineBreak":Me(null),G(n,br,!1);break;case"insertParagraph":Me(null),Qr&&!an?(Qr=!1,G(n,br,!1)):G(n,Zr,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":G(n,ts,t);break;case"deleteByComposition":(function(h,p){return h!==p||N(h)||N(p)||!h.isToken()||!p.isToken()})(d,f)&&G(n,Os,t);break;case"deleteByDrag":case"deleteByCut":G(n,Os,t);break;case"deleteContent":G(n,er,!1);break;case"deleteWordBackward":G(n,en,!0);break;case"deleteWordForward":G(n,en,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":G(n,tn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":G(n,tn,!1);break;case"formatStrikeThrough":G(n,pt,"strikethrough");break;case"formatBold":G(n,pt,"bold");break;case"formatItalic":G(n,pt,"italic");break;case"formatUnderline":G(n,pt,"underline");break;case"historyUndo":G(n,li,void 0);break;case"historyRedo":G(n,ai,void 0)}else{if(a===`
64
- `)t.preventDefault(),G(n,br,!1);else if(a===Lt)t.preventDefault(),G(n,Zr,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(h)}else a!=null&&Hl(i,o,a,t.timeStamp,!0)?(t.preventDefault(),G(n,_r,a)):mr=a;Kl=t.timeStamp}})}(r,e)]);let Jr=0,Gl=null,Kl=0,mr=null;const Hn=new WeakMap;let Js=!1,Qs=!1,Qr=!1,Mr=!1,Vl=[0,"",0,"root",0];function Hl(r,e,t,n,s){const o=r.anchor,i=r.focus,l=o.getNode(),a=ve(),u=ut(a._window),c=u!==null?u.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==i.key||!U(l)||(!s&&(!Pn||Kl<n+50)||l.isDirty()&&h<2||jl(t))&&o.offset!==i.offset&&!l.isComposing()||Xt(l)||l.isDirty()&&h>1||(s||!Pn)&&f!==null&&!l.isComposing()&&c!==In(f)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==r.format||l.getStyle()!==r.style||ic(r,l)}function lo(r,e){return r!==null&&r.nodeValue!==null&&r.nodeType===Vt&&e!==0&&e!==r.nodeValue.length}function ao(r,e,t){const{anchorNode:n,anchorOffset:s,focusNode:o,focusOffset:i}=r;Js&&(Js=!1,lo(n,s)&&lo(o,i))||st(e,()=>{if(!t)return void wt(null);if(!cn(e,n,o))return;const l=V();if(M(l)){const a=l.anchor,u=a.getNode();if(l.isCollapsed()){r.type==="Range"&&r.anchorNode===r.focusNode&&(l.dirty=!0);const c=as(e).event,d=c?c.timeStamp:performance.now(),[f,h,p,m,b]=Vl,D=xe(),y=e.isComposing()===!1&&D.getTextContent()==="";if(d<b+200&&a.offset===p&&a.key===m)l.format=f,l.style=h;else if(a.type==="text")U(u)||I(141),l.format=u.getFormat(),l.style=u.getStyle();else if(a.type==="element"&&!y){const A=a.getNode();l.style="",A instanceof Er&&A.getChildrenSize()===0?(l.format=A.getTextFormat(),l.style=A.getTextStyle()):l.format=0}}else{const c=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,p=l.isBackward(),m=p?i:s,b=p?s:i,D=p?d:c,y=p?c:d;let A=zu,_=!1;for(let E=0;E<h;E++){const C=f[E],v=C.getTextContentSize();if(U(C)&&v!==0&&!(E===0&&C.__key===D&&m===v||E===h-1&&C.__key===y&&b===0)&&(_=!0,A&=C.getFormat(),A===0))break}l.format=_?A:0}}G(e,oi,void 0)})}function Jl(r){if(!r.getTargetRanges)return null;const e=r.getTargetRanges();return e.length===0?null:e[0]}function ks(r,e){const t=r._compositionKey;if(Me(null),t!==null&&e!=null){if(e===""){const n=ze(t),s=In(r.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&U(n)&&wi(n,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
65
- `){const n=V();if(M(n)){const s=n.focus;return n.anchor.set(s.key,s.offset,s.type),void G(r,Rn,null)}}}Ci(!0,r,e)}function Ql(r){let e=r.__lexicalEventHandles;return e===void 0&&(e=[],r.__lexicalEventHandles=e),e}const vr=new Map;function Yl(r){const e=r.target,t=ut(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const n=Tl(t.anchorNode);if(n===null)return;Qs&&(Qs=!1,st(n,()=>{const u=gn(),c=t.anchorNode;if(c===null)return;const d=c.nodeType;d!==un&&d!==Vt||wt(Ti(u,t,n,r))}));const s=vi(n),o=s[s.length-1],i=o._key,l=vr.get(i),a=l||o;a!==n&&ao(t,a,!1),ao(t,n,!0),n!==o?vr.set(i,n):l&&vr.delete(i)}function uo(r){r._lexicalHandled=!0}function co(r){return r._lexicalHandled===!0}function yc(r){const e=r.ownerDocument,t=Hn.get(e);t===void 0&&I(162);const n=t-1;n>=0||I(164),Hn.set(e,n),n===0&&e.removeEventListener("selectionchange",Yl);const s=is(r);_i(s)?(function(i){if(i._parentEditor!==null){const l=vi(i),a=l[l.length-1]._key;vr.get(a)===i&&vr.delete(a)}else vr.delete(i._key)}(s),r.__lexicalEditor=null):s&&I(198);const o=Ql(r);for(let i=0;i<o.length;i++)o[i]();r.__lexicalEventHandles=[]}function Ys(r,e,t){Xe();const n=r.__key,s=r.getParent();if(s===null)return;const o=function(l){const a=V();if(!M(a)||!N(l))return a;const{anchor:u,focus:c}=a,d=u.getNode(),f=c.getNode();return Hr(d,l)&&u.set(l.__key,0,"element"),Hr(f,l)&&c.set(l.__key,0,"element"),a}(r);let i=!1;if(M(o)&&e){const l=o.anchor,a=o.focus;l.key===n&&(Qn(l,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0),a.key===n&&(Qn(a,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0)}else _t(o)&&e&&r.isSelected()&&r.selectPrevious();if(M(o)&&e&&!i){const l=r.getIndexWithinParent();tr(r),Jn(o,s,l,-1)}else tr(r);t||Dt(s)||s.canBeEmpty()||!s.isEmpty()||Ys(s,e),e&&Ge(s)&&s.isEmpty()&&s.selectEnd()}class cs{static getType(){I(64,this.name)}static clone(e){I(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,sc(this,e)}getType(){return this.__type}isInline(){I(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=ze(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||V();if(t==null)return!1;const n=t.getNodes().some(s=>s.__key===this.__key);if(U(this))return n;if(M(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(de(this)&&this.isInline()&&s){const o=t.isBackward()?t.focus:t.anchor,i=o.getNode();if(o.offset===i.getChildrenSize()&&i.is(s)&&i.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:ze(e)}getParentOrThrow(){const e=this.getParent();return e===null&&I(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(Dt(t))return N(e)||e===this&&de(e)||I(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&I(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:ze(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:ze(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();N(this)&&t.unshift(this),N(e)&&n.unshift(e);const s=t.length,o=n.length;if(s===0||o===0||t[s-1]!==n[o-1])return null;const i=new Set(n);for(let l=0;l<s;l++){const a=t[l];if(i.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,s=0,o=this;for(;;){const i=o.getParentOrThrow();if(i===t){n=o.getIndexWithinParent();break}o=i}for(o=e;;){const i=o.getParentOrThrow();if(i===t){s=o.getIndexWithinParent();break}o=i}return n<s}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;n!==null;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],s=new Set;let o=this;for(;o!==null;){const i=o.__key;if(s.has(i)||(s.add(i),n.push(o)),o===e)break;const l=N(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const u=o.getParentOrThrow();if(s.has(u.__key)||n.push(u),u===e)break;let c=null,d=u;do{if(d===null&&I(68),c=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;c!==null||s.has(d.__key)||n.push(d)}while(c===null);o=c}return t||n.reverse(),n}isDirty(){const e=ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=ze(this.__key);return e===null&&I(113),e}getWritable(){Xe();const e=Rt(),t=ve(),n=e._nodeMap,s=this.__key,o=this.getLatest(),i=t._cloneNotNeeded,l=V();if(l!==null&&l.setCachedNodes(null),i.has(s))return qn(o),o;const a=Ai(o);return i.add(s),qn(a),n.set(s,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){I(70)}updateDOM(e,t,n){I(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){I(72)}static importJSON(e){I(18,this.name)}static transform(){return null}remove(e){Ys(this,!0,e)}replace(e,t){Xe();let n=V();n!==null&&(n=n.clone()),Ss(this,e);const s=this.getLatest(),o=this.__key,i=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;tr(l);const c=s.getPreviousSibling(),d=s.getNextSibling(),f=s.__prev,h=s.__next,p=s.__parent;if(Ys(s,!1,!0),c===null?a.__first=i:c.getWritable().__next=i,l.__prev=f,d===null?a.__last=i:d.getWritable().__prev=i,l.__next=h,l.__parent=p,a.__size=u,t&&(N(this)&&N(l)||I(139),this.getChildren().forEach(m=>{l.append(m)})),M(n)){wt(n);const m=n.anchor,b=n.focus;m.key===o&&go(m,l),b.key===o&&go(b,l)}return qt()===o&&Me(i),l}insertAfter(e,t=!0){Xe(),Ss(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.getParent(),i=V();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(tr(s),M(i)){const p=o.__key,m=i.anchor,b=i.focus;l=m.type==="element"&&m.key===p&&m.offset===h+1,a=b.type==="element"&&b.key===p&&b.offset===h+1}}const u=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),d=s.__key,f=n.__next;if(u===null?c.__last=d:u.getWritable().__prev=d,c.__size++,n.__next=d,s.__next=f,s.__prev=n.__key,s.__parent=n.__parent,t&&M(i)){const h=this.getIndexWithinParent();Jn(i,c,h+1);const p=c.__key;l&&i.anchor.set(p,h+2,"element"),a&&i.focus.set(p,h+2,"element")}return e}insertBefore(e,t=!0){Xe(),Ss(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.__key;tr(s);const i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=n.__prev,u=this.getIndexWithinParent();i===null?l.__first=o:i.getWritable().__next=o,l.__size++,n.__prev=o,s.__prev=a,s.__next=n.__key,s.__parent=n.__parent;const c=V();return t&&M(c)&&Jn(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return Se()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Xe();const n=this.getPreviousSibling(),s=this.getParentOrThrow();if(n===null)return s.select(0,0);if(N(n))return n.select();if(!U(n)){const o=n.getIndexWithinParent()+1;return s.select(o,o)}return n.select(e,t)}selectNext(e,t){Xe();const n=this.getNextSibling(),s=this.getParentOrThrow();if(n===null)return s.select();if(N(n))return n.select(0,0);if(!U(n)){const o=n.getIndexWithinParent();return s.select(o,o)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class fn extends cs{static getType(){return"linebreak"}static clone(e){return new fn(e.__key)}constructor(e){super(e)}getTextContent(){return`
66
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const n=t.parentElement;if(n!==null&&Wn(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&Dn(s)){const o=n.lastChild;if(o===t||o.previousSibling===t&&Dn(o))return!0}}return!1}(e)||function(t){const n=t.parentElement;if(n!==null&&Wn(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&Dn(s))return!1;const o=n.lastChild;if(o===t||o.previousSibling===t&&Dn(o))return!0}return!1}(e)?null:{conversion:xc,priority:0}}}static importJSON(e){return or()}exportJSON(){return{type:"linebreak",version:1}}}function xc(r){return{node:or()}}function or(){return At(new fn)}function rr(r){return r instanceof fn}function Dn(r){return r.nodeType===Vt&&/^( |\t|\r?\n)+$/.test(r.textContent||"")}function Ts(r,e){return 16&e?"code":e&di?"mark":32&e?"sub":64&e?"sup":null}function Bs(r,e){return 1&e?"strong":2&e?"em":"span"}function Xl(r,e,t,n,s){const o=n.classList;let i=Vr(s,"base");i!==void 0&&o.add(...i),i=Vr(s,"underlineStrikethrough");let l=!1;const a=e&Mn&&e&On;i!==void 0&&(t&Mn&&t&On?(l=!0,a||o.add(...i)):a&&o.remove(...i));for(const u in sr){const c=sr[u];if(i=Vr(s,u),i!==void 0)if(t&c){if(l&&(u==="underline"||u==="strikethrough")){e&c&&o.remove(...i);continue}e&c&&(!a||u!=="underline")&&u!=="strikethrough"||o.add(...i)}else e&c&&o.remove(...i)}}function Zl(r,e,t){const n=e.firstChild,s=t.isComposing(),o=r+(s?ss:"");if(n==null)e.textContent=o;else{const i=n.nodeValue;if(i!==o)if(s||Gt){const[l,a,u]=function(c,d){const f=c.length,h=d.length;let p=0,m=0;for(;p<f&&p<h&&c[p]===d[p];)p++;for(;m+p<f&&m+p<h&&c[f-m-1]===d[h-m-1];)m++;return[p,f-p-m,d.slice(p,h-m)]}(i,o);a!==0&&n.deleteData(l,a),n.insertData(l,u)}else n.nodeValue=o}}function fo(r,e,t,n,s,o){Zl(s,r,e);const i=o.theme.text;i!==void 0&&Xl(0,0,n,r,i)}function Sn(r,e){const t=document.createElement(e);return t.appendChild(r),t}class Ar extends cs{static getType(){return"text"}static clone(e){return new Ar(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Hu[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===qt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=sr[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return zn(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,s=Ts(0,n),o=Bs(0,n),i=s===null?o:s,l=document.createElement(i);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(a=document.createElement(o),l.appendChild(a)),fo(a,this,0,n,this.__text,e);const u=this.__style;return u!==""&&(l.style.cssText=u),l}updateDOM(e,t,n){const s=this.__text,o=e.__format,i=this.__format,l=Ts(0,o),a=Ts(0,i),u=Bs(0,o),c=Bs(0,i);if((l===null?u:l)!==(a===null?c:a))return!0;if(l===a&&u!==c){const m=t.firstChild;m==null&&I(48);const b=document.createElement(c);return fo(b,this,0,i,s,n),t.replaceChild(b,m),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&I(49)),Zl(s,d,this);const f=n.theme.text;f!==void 0&&o!==i&&Xl(0,o,i,d,f);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:Cc,priority:0}),b:()=>({conversion:_c,priority:0}),code:()=>({conversion:$t,priority:0}),em:()=>({conversion:$t,priority:0}),i:()=>({conversion:$t,priority:0}),s:()=>({conversion:$t,priority:0}),span:()=>({conversion:bc,priority:0}),strong:()=>({conversion:$t,priority:0}),sub:()=>({conversion:$t,priority:0}),sup:()=>({conversion:$t,priority:0}),u:()=>({conversion:$t,priority:0})}}static importJSON(e){const t=ke(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&jt(t)||I(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Sn(t,"b")),this.hasFormat("italic")&&(t=Sn(t,"i")),this.hasFormat("strikethrough")&&(t=Sn(t,"s")),this.hasFormat("underline")&&(t=Sn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?sr[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Gu[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=zn(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Vu[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Xe();let n=e,s=t;const o=V(),i=this.getTextContent(),l=this.__key;if(typeof i=="string"){const a=i.length;n===void 0&&(n=a),s===void 0&&(s=a)}else n=0,s=0;if(!M(o))return ra(l,n,l,s,"text","text");{const a=qt();a!==o.anchor.key&&a!==o.focus.key||Me(l),o.setTextNodeRange(this,n,this,s)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,s){const o=this.getWritable(),i=o.__text,l=n.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const u=V();if(s&&M(u)){const d=e+l;u.setTextNodeRange(o,d,o,d)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Xe();const t=this.getLatest(),n=t.getTextContent(),s=t.__key,o=qt(),i=new Set(e),l=[],a=n.length;let u="";for(let E=0;E<a;E++)u!==""&&i.has(E)&&(l.push(u),u=""),u+=n[E];u!==""&&l.push(u);const c=l.length;if(c===0)return[];if(l[0]===n)return[t];const d=l[0],f=t.getParent();let h;const p=t.getFormat(),m=t.getStyle(),b=t.__detail;let D=!1;t.isSegmented()?(h=ke(d),h.__format=p,h.__style=m,h.__detail=b,D=!0):(h=t.getWritable(),h.__text=d);const y=V(),A=[h];let _=d.length;for(let E=1;E<c;E++){const C=l[E],v=C.length,S=ke(C).getWritable();S.__format=p,S.__style=m,S.__detail=b;const k=S.__key,q=_+v;if(M(y)){const B=y.anchor,F=y.focus;B.key===s&&B.type==="text"&&B.offset>_&&B.offset<=q&&(B.key=k,B.offset-=_,y.dirty=!0),F.key===s&&F.type==="text"&&F.offset>_&&F.offset<=q&&(F.key=k,F.offset-=_,y.dirty=!0)}o===s&&Me(k),_=q,A.push(S)}if(f!==null){(function(v){const S=v.getPreviousSibling(),k=v.getNextSibling();S!==null&&qn(S),k!==null&&qn(k)})(this);const E=f.getWritable(),C=this.getIndexWithinParent();D?(E.splice(C,0,A),this.remove()):E.splice(C,1,A),M(y)&&Jn(y,f,C,c-1)}return A}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||I(50);const n=this.__key,s=e.__key,o=this.__text,i=o.length;qt()===s&&Me(n);const l=V();if(M(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===s&&(Co(d,t,n,e,i),l.dirty=!0),f!==null&&f.key===s&&(Co(f,t,n,e,i),l.dirty=!0)}const a=e.__text,u=t?a+o:o+a;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function bc(r){return{forChild:ki(r.style),node:null}}function _c(r){const e=r,t=e.style.fontWeight==="normal";return{forChild:ki(e.style,t?void 0:"bold"),node:null}}const ho=new WeakMap;function vc(r){return r.nodeName==="PRE"||r.nodeType===un&&r.style!==void 0&&r.style.whiteSpace!==void 0&&r.style.whiteSpace.startsWith("pre")}function Cc(r){const e=r;r.parentElement===null&&I(129);let t=e.textContent||"";if(function(n){let s,o=n.parentNode;const i=[n];for(;o!==null&&(s=ho.get(o))===void 0&&!vc(o);)i.push(o),o=o.parentNode;const l=s===void 0?o:s;for(let a=0;a<i.length;a++)ho.set(i[a],l);return l}(e)!==null){const n=t.split(/(\r?\n|\t)/),s=[],o=n.length;for(let i=0;i<o;i++){const l=n[i];l===`
63
+ `,qu=Kt?" ":ss,Dl="֑-߿יִ-﷽ﹰ-ﻼ",Sl="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Uu=new RegExp("^[^"+Sl+"]*["+Dl+"]"),Wu=new RegExp("^[^"+Dl+"]*["+Sl+"]"),ir={bold:1,code:16,highlight:fi,italic:2,strikethrough:On,subscript:32,superscript:64,underline:Mn},Gu={directionless:1,unmergeable:2},Vi={center:pi,end:xi,justify:mi,left:hi,right:gi,start:yi},Ku={[pi]:"center",[xi]:"end",[mi]:"justify",[hi]:"left",[gi]:"right",[yi]:"start"},Vu={normal:0,segmented:2,token:1},Hu={[Mu]:"normal",[Iu]:"segmented",[$u]:"token"};function Ju(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var I=Ju(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function $n(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const Qu=100;let Is=!1,bi=0;function Yu(r){bi=r.timeStamp}function Ss(r,e,t){const n=r.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(r===s||n&&r.previousSibling===s)||n&&os(r,t)!==void 0}function Xu(r,e,t){const n=ut(t._window);let s=null,o=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,o=n.focusOffset);const i=r.nodeValue;i!==null&&Di(e,i,s,o,!1)}function Zu(r,e,t){if(M(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===Ht&&t.isAttached()}function ec(r,e,t,n){for(let s=r;s&&!hc(s);s=fn(s)){const o=os(s,e);if(o!==void 0){const i=$e(o,t);if(i)return de(i)?void 0:[s,i]}else if(s===n)return[n,jl(t)]}}function Al(r,e,t){Is=!0;const n=performance.now()-bi>Qu;try{nt(r,()=>{const s=K()||function(f){return f.getEditorState().read(()=>{const h=K();return h!==null?h.clone():null})}(r),o=new Map,i=r.getRootElement(),l=r._editorState,a=r._blockCursorElement;let u=!1,c="";for(let f=0;f<e.length;f++){const h=e[f],p=h.type,m=h.target,x=ec(m,r,l,i);if(!x)continue;const[D,y]=x;if(p==="characterData")n&&q(y)&&Zu(s,m,y)&&Xu(m,y,r);else if(p==="childList"){u=!0;const A=h.addedNodes;for(let v=0;v<A.length;v++){const _=A[v],S=Fl(_),T=_.parentNode;if(T!=null&&_!==a&&S===null&&!Ss(_,T,r)){if(Kt){const z=_.innerText||_.nodeValue;z&&(c+=z)}T.removeChild(_)}}const C=h.removedNodes,E=C.length;if(E>0){let v=0;for(let _=0;_<E;_++){const S=C[_];(Ss(S,m,r)||a===S)&&(m.appendChild(S),v++)}E!==v&&o.set(D,y)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,r);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],p=h.addedNodes,m=h.target;for(let x=0;x<p.length;x++){const D=p[x],y=D.parentNode;y==null||D.nodeName!=="BR"||Ss(D,m,r)||y.removeChild(D)}}t.takeRecords()}s!==null&&(u&&(s.dirty=!0,St(s)),Kt&&Ml(r)&&s.insertRawText(c))})}finally{Is=!1}}function El(r){const e=r._observer;e!==null&&Al(r,e.takeRecords(),e)}function kl(r){(function(e){bi===0&&as(e).addEventListener("textInput",Yu,!0)})(r),r._observer=new MutationObserver((e,t)=>{Al(r,e,t)})}function Hi(r,e){const t=r.__mode,n=r.__format,s=r.__style,o=e.__mode,i=e.__format,l=e.__style;return!(t!==null&&t!==o||n!==null&&n!==i||s!==null&&s!==l)}function Ji(r,e){const t=r.mergeWithSibling(e),n=ve()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function Qi(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&q(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Hi(e,n)){n=Ji(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Hi(n,t)){n=Ji(n,t);break}break}t.remove()}}else n.remove()}function Tl(r){return Yi(r.anchor),Yi(r.focus),r}function Yi(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),q(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!F(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let tc=1;const rc=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function _i(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return de(Ar(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&is(e)==null)}function dn(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!_i(e)&&Bl(e)===r}catch{return!1}}function vi(r){return r instanceof hs}function Bl(r){let e=r;for(;e!=null;){const t=is(e);if(vi(t))return t;e=fn(e)}return null}function is(r){return r?r.__lexicalEditor:null}function Zt(r){return r.isToken()||r.isSegmented()}function nc(r){return r.nodeType===Ht}function In(r){let e=r;for(;e!=null;){if(nc(e))return e;e=e.firstChild}return null}function zn(r,e,t){const n=ir[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=-65:e==="superscript"&&(s&=-33),s}function Nl(r){return q(r)||nr(r)||de(r)}function sc(r,e){if(e!=null)return void(r.__key=e);Xe(),ia();const t=ve(),n=Pt(),s=""+tc++;n._nodeMap.set(s,r),F(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=wl,r.__key=s}function rr(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),o=r.getNextSibling();if(s===null)if(o!==null){const i=o.getWritable();n.__first=o.__key,i.__prev=null}else n.__first=null;else{const i=s.getWritable();if(o!==null){const l=o.getWritable();l.__prev=i.__key,i.__next=l.__key}else i.__next=null;t.__prev=null}if(o===null)if(s!==null){const i=s.getWritable();n.__last=s.__key,i.__next=null}else n.__last=null;else{const i=o.getWritable();if(s!==null){const l=s.getWritable();l.__next=i.__key,i.__prev=l.__key}else i.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function qn(r){ia();const e=r.getLatest(),t=e.__parent,n=Pt(),s=ve(),o=n._nodeMap,i=s._dirtyElements;t!==null&&function(a,u,c){let d=a;for(;d!==null;){if(c.has(d))return;const f=u.get(d);if(f===void 0)break;c.set(d,!1),d=f.__parent}}(t,o,i);const l=e.__key;s._dirtyType=wl,F(r)?i.set(l,!0):s._dirtyLeaves.add(l)}function Oe(r){Xe();const e=ve(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=$e(t);n!==null&&n.getWritable()}if(r!==null){const n=$e(r);n!==null&&n.getWritable()}}}function Ut(){return yn()?null:ve()._compositionKey}function $e(r,e){const t=(e||Pt())._nodeMap.get(r);return t===void 0?null:t}function Fl(r,e){const t=os(r,ve());return t!==void 0?$e(t,e):null}function os(r,e){return r[`__lexicalKey_${e._key}`]}function Ar(r,e){let t=r;for(;t!=null;){const n=Fl(t,e);if(n!==null)return n;t=fn(t)}return null}function Ll(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function Xi(r){return r.read(()=>xe().getTextContent())}function xe(){return jl(Pt())}function jl(r){return r._nodeMap.get("root")}function St(r){Xe();const e=Pt();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function br(r){const e=ve(),t=function(n,s){let o=n;for(;o!=null;){const i=os(o,s);if(i!==void 0)return i;o=fn(o)}return null}(r,e);return t===null?r===e.getRootElement()?$e("root"):null:$e(t)}function Zi(r,e){return e?r.getTextContentSize():0}function Rl(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function Ci(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Pl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ol(r){return r.nodeType===Ht?r.nodeValue:null}function wi(r,e,t){const n=ut(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:o,focusOffset:i}=n;if(s!==null){let l=Ol(s);const a=Ar(s);if(l!==null&&q(a)){if(l===ss&&t){const u=t.length;l=t,o=u,i=u}l!==null&&Di(a,l,o,i,r)}}}function Di(r,e,t,n,s){let o=r;if(o.isAttached()&&(s||!o.isDirty())){const i=o.isComposing();let l=e;(i||s)&&e[e.length-1]===ss&&(l=e.slice(0,-1));const a=o.getTextContent();if(s||l!==a){if(l===""){if(Oe(null),ns||un||di)o.remove();else{const m=ve();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const u=o.getParent(),c=mn(),d=o.getTextContentSize(),f=Ut(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!i||M(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===r.__key&&c.anchor.offset===0&&!o.canInsertTextBefore()&&!i||c.focus.key===r.__key&&c.focus.offset===d&&!o.canInsertTextAfter()&&!i))return void o.markDirty();const p=K();if(!M(p)||t===null||n===null)return void o.setTextContent(l);if(p.setTextNodeRange(o,t,o,n),o.isSegmented()){const m=ke(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function ic(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(o){const i=o.getPreviousSibling();return(q(i)||F(i)&&i.isInline())&&!i.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function eo(r){return r==="ArrowLeft"}function to(r){return r==="ArrowRight"}function qr(r,e){return ft?r:e}function ro(r){return r==="Enter"}function Pr(r){return r==="Backspace"}function Or(r){return r==="Delete"}function no(r,e,t){return r.toLowerCase()==="a"&&qr(e,t)}function oc(){const r=xe();St(Tl(r.select(0,r.getChildrenSize())))}function Hr(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const o=$n(s);return t[e]=o,o}return s}function Si(r,e,t,n,s){if(t.size===0)return;const o=n.__type,i=n.__key,l=e.get(o);l===void 0&&I(33,o);const a=l.klass;let u=r.get(a);u===void 0&&(u=new Map,r.set(a,u));const c=u.get(i),d=c==="destroyed"&&s==="created";(c===void 0||d)&&u.set(i,d?"updated":s)}function so(r,e,t){const n=r.getParent();let s=t,o=r;return n!==null&&(e&&t===0?(s=o.getIndexWithinParent(),o=n):e||t!==o.getChildrenSize()||(s=o.getIndexWithinParent()+1,o=n)),o.getChildAtIndex(e?s-1:s)}function nn(r,e){const t=r.offset;if(r.type==="element")return so(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?so(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function Ml(r){const e=as(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function W(r,e,t){return aa(r,e,t)}function ls(r){return!Ge(r)&&!r.isLastChild()&&!r.isInline()}function Un(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&I(75,e),t}function fn(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Jr(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function as(r){const e=r._window;return e===null&&I(78),e}function lc(r){let e=r.getParentOrThrow();for(;e!==null;){if(At(e))return e;e=e.getParentOrThrow()}return e}function At(r){return Ge(r)||F(r)&&r.isShadowRoot()}function kt(r){const e=ve(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&I(200,r.constructor.name,t);const{replace:s,replaceWithKlass:o}=n;if(s!==null){const i=s(r),l=i.constructor;return o!==null?i instanceof o||I(201,o.name,o.getType(),l.name,l.getType(),r.constructor.name,t):i instanceof r.constructor&&l!==r.constructor||I(202,l.name,l.getType(),r.constructor.name,t),i.__key===r.__key&&I(203,r.constructor.name,t,l.name,l.getType()),i}return r}function As(r,e){!Ge(r.getParent())||F(e)||de(e)||I(99)}function Es(r){return(de(r)||F(r)&&!r.canBeEmpty())&&!r.isInline()}function Ai(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function ac(r,e,t){let n=r._blockCursorElement;if(M(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,o=s.getNode(),i=s.offset;let l=!1,a=null;if(i===o.getChildrenSize())Es(o.getChildAtIndex(i-1))&&(l=!0);else{const u=o.getChildAtIndex(i);if(u!==null&&Es(u)){const c=u.getPreviousSibling();(c===null||Es(c))&&(l=!0,a=r.getElementByKey(u.__key))}}if(l){const u=r.getElementByKey(o.__key);return n===null&&(r._blockCursorElement=n=function(c){const d=c.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const p=$n(h);h=d.blockCursor=p}h!==void 0&&f.classList.add(...h)}return f}(r._config)),e.style.caretColor="transparent",void(a===null?u.appendChild(n):u.insertBefore(n,a))}}n!==null&&Ai(n,r,e)}function ut(r){return xt?(r||window).getSelection():null}function uc(r){return Rt(r)&&r.tagName==="A"}function Rt(r){return r.nodeType===1}function io(r){return r.nodeType===11}function zs(r){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return r.nodeName.match(e)!==null}function Wn(r){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return r.nodeName.match(e)!==null}function zt(r){if(de(r)&&!r.isInline())return!0;if(!F(r)||At(r))return!1;const e=r.getFirstChild(),t=e===null||nr(e)||q(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Mr(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function cc(){return ve()}const oo=new WeakMap,dc=new Map;function fc(r){if(!r._readOnly&&r.isEmpty())return dc;r._readOnly||I(192);let e=oo.get(r);if(!e){e=new Map,oo.set(r,e);for(const[t,n]of r._nodeMap){const s=n.__type;let o=e.get(s);o||(o=new Map,e.set(s,o)),o.set(t,n)}}return e}function Ei(r){const e=r.constructor.clone(r);return e.afterCloneFrom(r),e}function ki(r,e){const t=(parseInt(r.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function hc(r){return r.__lexicalUnmanaged===!0}function $l(r,e,t,n,s,o){let i=r.getFirstChild();for(;i!==null;){const l=i.__key;i.__parent===e&&(F(i)&&$l(i,l,t,n,s,o),t.has(l)||o.delete(l),s.push(l)),i=i.getNextSibling()}}let Vt,Ke,sn,us,qs,Us,or,mt,Ws,on,Te="",We="",vt=null,ht="",Lt="",Il=!1,ln=!1,Nn=null;function Gn(r,e){const t=or.get(r);if(e!==null){const n=Vs(r);n.parentNode===e&&e.removeChild(n)}if(mt.has(r)||Ke._keyToDOMMap.delete(r),F(t)){const n=Vn(t,or);Gs(n,0,n.length-1,null)}t!==void 0&&Si(on,sn,us,t,"destroyed")}function Gs(r,e,t,n){let s=e;for(;s<=t;++s){const o=r[s];o!==void 0&&Gn(o,n)}}function Xt(r,e){r.setProperty("text-align",e)}const pc="40px";function zl(r,e){const t=Vt.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||pc;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function ql(r,e){const t=r.style;e===0?Xt(t,""):e===hi?Xt(t,"left"):e===pi?Xt(t,"center"):e===gi?Xt(t,"right"):e===mi?Xt(t,"justify"):e===yi?Xt(t,"start"):e===xi&&Xt(t,"end")}function Kn(r,e){const t=mt.get(r);t===void 0&&I(60);const n=t.createDOM(Vt,Ke);if(function(s,o,i){const l=i._keyToDOMMap;(function(a,u,c){a[`__lexicalKey_${u._key}`]=c})(o,i,s),l.set(s,o)}(r,n,Ke),q(t)?n.setAttribute("data-lexical-text","true"):de(t)&&n.setAttribute("data-lexical-decorator","true"),F(t)){const s=t.__indent,o=t.__size;if(s!==0&&zl(n,s),o!==0){const l=o-1;(function(a,u,c,d){const f=We;We="",Ks(a,c,0,u,c.getDOMSlot(d)),Wl(c,d),We=f})(Vn(t,mt),l,t,n)}const i=t.__format;i!==0&&ql(n,i),t.isInline()||Ul(null,t,n),ls(t)&&(Te+=jt,Lt+=jt)}else{const s=t.getTextContent();if(de(t)){const o=t.decorate(Ke,Vt);o!==null&&Gl(r,o),n.contentEditable="false"}else q(t)&&(t.isDirectionless()||(We+=s));Te+=s,Lt+=s}return e!==null&&e.insertChild(n),Si(on,sn,us,t,"created"),n}function Ks(r,e,t,n,s){const o=Te;Te="";let i=t;for(;i<=n;++i){Kn(r[i],s);const l=mt.get(r[i]);l!==null&&q(l)&&(vt===null&&(vt=l.getFormat()),ht===""&&(ht=l.getStyle()))}ls(e)&&(Te+=jt),s.element.__lexicalTextContent=Te,Te=o+Te}function lo(r,e){if(r){const t=r.__last;if(t){const n=e.get(t);if(n)return nr(n)?"line-break":de(n)&&n.isInline()?"decorator":null}return"empty"}return null}function Ul(r,e,t){const n=lo(r,or),s=lo(e,mt);n!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Wl(r,e){const t=e.__lexicalDirTextContent||"",n=e.__lexicalDir||"";if(t!==We||n!==Nn){const o=We==="",i=o?Nn:(s=We,Uu.test(s)?"rtl":Wu.test(s)?"ltr":null);if(i!==n){const l=e.classList,a=Vt.theme;let u=n!==null?a[n]:void 0,c=i!==null?a[i]:void 0;if(u!==void 0){if(typeof u=="string"){const d=$n(u);u=a[n]=d}l.remove(...u)}if(i===null||o&&i==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const d=$n(c);c=a[i]=d}c!==void 0&&l.add(...c)}e.dir=i}ln||(r.getWritable().__dir=i)}Nn=i,e.__lexicalDirTextContent=We,e.__lexicalDir=i}var s}function gc(r,e,t){const n=We;var s;We="",vt=null,ht="",function(o,i,l){const a=Te,u=o.__size,c=i.__size;Te="";const d=l.element;if(u===1&&c===1){const f=o.__first,h=i.__first;if(f===h)Ur(f,d);else{const m=Vs(f),x=Kn(h,null);try{d.replaceChild(x,m)}catch(D){if(typeof D=="object"&&D!=null){const y=`${D.toString()} Parent: ${d.tagName}, new child: {tag: ${x.tagName} key: ${h}}, old child: {tag: ${m.tagName}, key: ${f}}.`;throw new Error(y)}throw D}Gn(f,null)}const p=mt.get(h);q(p)&&(vt===null&&(vt=p.getFormat()),ht===""&&(ht=p.getStyle()))}else{const f=Vn(o,or),h=Vn(i,mt);if(f.length!==u&&I(227),h.length!==c&&I(228),u===0)c!==0&&Ks(h,i,0,c-1,l);else if(c===0){if(u!==0){const p=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Gs(f,0,u-1,p?null:d),p&&(d.textContent="")}}else(function(p,m,x,D,y,A){const C=D-1,E=y-1;let v,_,S=A.getFirstChild(),T=0,z=0;for(;T<=C&&z<=E;){const P=m[T],j=x[z];if(P===j)S=ks(Ur(j,A.element)),T++,z++;else{v===void 0&&(v=new Set(m)),_===void 0&&(_=new Set(x));const X=_.has(P),ge=v.has(j);if(X)if(ge){const ie=Un(Ke,j);ie===S?S=ks(Ur(j,A.element)):(A.withBefore(S).insertChild(ie),Ur(j,A.element)),T++,z++}else Kn(j,A.withBefore(S)),z++;else S=ks(Vs(P)),Gn(P,A.element),T++}const R=mt.get(j);R!==null&&q(R)&&(vt===null&&(vt=R.getFormat()),ht===""&&(ht=R.getStyle()))}const N=T>C,L=z>E;if(N&&!L){const P=x[E+1],j=P===void 0?null:Ke.getElementByKey(P);Ks(x,p,z,E,A.withBefore(j))}else L&&!N&&Gs(m,T,C,A.element)})(i,f,h,u,c,l)}ls(i)&&(Te+=jt),d.__lexicalTextContent=Te,Te=a+Te}(r,e,e.getDOMSlot(t)),Wl(e,t),Er(s=e)&&vt!=null&&vt!==s.__textFormat&&!ln&&(s.setTextFormat(vt),s.setTextStyle(ht)),function(o){Er(o)&&ht!==""&&ht!==o.__textStyle&&!ln&&o.setTextStyle(ht)}(e),We=n}function Vn(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&I(101),t.push(n),n=s.__next}return t}function Ur(r,e){const t=or.get(r);let n=mt.get(r);t!==void 0&&n!==void 0||I(61);const s=Il||Us.has(r)||qs.has(r),o=Un(Ke,r);if(t===n&&!s){if(F(t)){const i=o.__lexicalTextContent;i!==void 0&&(Te+=i,Lt+=i);const l=o.__lexicalDirTextContent;l!==void 0&&(We+=l)}else{const i=t.getTextContent();q(t)&&!t.isDirectionless()&&(We+=i),Lt+=i,Te+=i}return o}if(t!==n&&s&&Si(on,sn,us,n,"updated"),n.updateDOM(t,o,Vt)){const i=Kn(r,null);return e===null&&I(62),e.replaceChild(i,o),Gn(r,null),i}if(F(t)&&F(n)){const i=n.__indent;i!==t.__indent&&zl(o,i);const l=n.__format;l!==t.__format&&ql(o,l),s&&(gc(t,n,o),Ge(n)||n.isInline()||Ul(t,n,o)),ls(n)&&(Te+=jt,Lt+=jt)}else{const i=n.getTextContent();if(de(n)){const l=n.decorate(Ke,Vt);l!==null&&Gl(r,l)}else q(n)&&!n.isDirectionless()&&(We+=i);Te+=i,Lt+=i}if(!ln&&Ge(n)&&n.__cachedText!==Lt){const i=n.getWritable();i.__cachedText=Lt,n=i}return o}function Gl(r,e){let t=Ke._pendingDecorators;const n=Ke._decorators;if(t===null){if(n[r]===e)return;t=Ll(Ke)}t[r]=e}function ks(r){let e=r.nextSibling;return e!==null&&e===Ke._blockCursorElement&&(e=e.nextSibling),e}function mc(r,e,t,n,s,o){Te="",Lt="",We="",Il=n===Sr,Nn=null,Ke=t,Vt=t._config,sn=t._nodes,us=Ke._listeners.mutation,qs=s,Us=o,or=r._nodeMap,mt=e._nodeMap,ln=e._readOnly,Ws=new Map(t._keyToDOMMap);const i=new Map;return on=i,Ur("root",null),Ke=void 0,sn=void 0,qs=void 0,Us=void 0,or=void 0,mt=void 0,Vt=void 0,Ws=void 0,on=void 0,i}function Vs(r){const e=Ws.get(r);return e===void 0&&I(75,r),e}const Ft=Object.freeze({}),Hs=30,Js=[["keydown",function(r,e){if(Qr=r.timeStamp,Kl=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:o,altKey:i}=r;if(!W(e,vu,r)&&t!=null){if(function(l,a,u,c){return to(l)&&!a&&!c&&!u}(t,s,i,o))W(e,fl,r);else if(function(l,a,u,c,d){return to(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))W(e,Cu,r);else if(function(l,a,u,c){return eo(l)&&!a&&!c&&!u}(t,s,i,o))W(e,hl,r);else if(function(l,a,u,c,d){return eo(l)&&!c&&!u&&(a||d)}(t,s,n,i,o))W(e,wu,r);else if(function(l,a,u){return function(c){return c==="ArrowUp"}(l)&&!a&&!u}(t,s,o))W(e,pl,r);else if(function(l,a,u){return function(c){return c==="ArrowDown"}(l)&&!a&&!u}(t,s,o))W(e,gl,r);else if(function(l,a){return ro(l)&&a}(t,n))Yr=!0,W(e,Rn,r);else if(function(l){return l===" "}(t))W(e,Du,r);else if(function(l,a){return ft&&a&&l.toLowerCase()==="o"}(t,s))r.preventDefault(),Yr=!0,W(e,vr,!0);else if(function(l,a){return ro(l)&&!a}(t,n))Yr=!1,W(e,Rn,r);else if(function(l,a,u,c){return ft?!a&&!u&&(Pr(l)||l.toLowerCase()==="h"&&c):!(c||a||u)&&Pr(l)}(t,i,o,s))Pr(t)?W(e,ml,r):(r.preventDefault(),W(e,tr,!0));else if(function(l){return l==="Escape"}(t))W(e,yl,r);else if(function(l,a,u,c,d){return ft?!(u||c||d)&&(Or(l)||l.toLowerCase()==="d"&&a):!(a||c||d)&&Or(l)}(t,s,n,i,o))Or(t)?W(e,xl,r):(r.preventDefault(),W(e,tr,!1));else if(function(l,a,u){return Pr(l)&&(ft?a:u)}(t,i,s))r.preventDefault(),W(e,tn,!0);else if(function(l,a,u){return Or(l)&&(ft?a:u)}(t,i,s))r.preventDefault(),W(e,tn,!1);else if(function(l,a){return ft&&a&&Pr(l)}(t,o))r.preventDefault(),W(e,rn,!0);else if(function(l,a){return ft&&a&&Or(l)}(t,o))r.preventDefault(),W(e,rn,!1);else if(function(l,a,u,c){return l.toLowerCase()==="b"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),W(e,gt,"bold");else if(function(l,a,u,c){return l.toLowerCase()==="u"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),W(e,gt,"underline");else if(function(l,a,u,c){return l.toLowerCase()==="i"&&!a&&qr(u,c)}(t,i,o,s))r.preventDefault(),W(e,gt,"italic");else if(function(l,a,u,c){return l==="Tab"&&!a&&!u&&!c}(t,i,s,o))W(e,Su,r);else if(function(l,a,u,c){return l.toLowerCase()==="z"&&!a&&qr(u,c)}(t,n,o,s))r.preventDefault(),W(e,ai,void 0);else if(function(l,a,u,c){return ft?l.toLowerCase()==="z"&&u&&a:l.toLowerCase()==="y"&&c||l.toLowerCase()==="z"&&c&&a}(t,n,o,s))r.preventDefault(),W(e,ui,void 0);else{const l=e._editorState._selection;l===null||M(l)?!Kt&&no(t,o,s)&&(r.preventDefault(),W(e,$s,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="c"&&(ft?c:d)}(t,n,o,s)?(r.preventDefault(),W(e,rs,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="x"&&(ft?c:d)}(t,n,o,s)?(r.preventDefault(),W(e,ci,r)):no(t,o,s)&&(r.preventDefault(),W(e,$s,r))}(function(l,a,u,c){return l||a||u||c})(s,n,i,o)&&W(e,ju,r)}}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&nt(e,()=>{de(Ar(t))||(Ys=!0)})}],["compositionstart",function(r,e){nt(e,()=>{const t=K();if(M(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();Oe(n.key),(r.timeStamp<Qr+Hs||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||q(s)&&s.getStyle()!==t.style)&&W(e,Cr,qu)}})}],["compositionend",function(r,e){Kt?$r=!0:nt(e,()=>{Ts(e,r.data)})}],["input",function(r,e){r.stopPropagation(),nt(e,()=>{const t=K(),n=r.data,s=Ql(r);if(n!=null&&M(t)&&Jl(t,s,n,r.timeStamp,!1)){$r&&(Ts(e,n),$r=!1);const o=t.anchor.getNode(),i=ut(e._window);if(i===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;Pn&&!t.isCollapsed()&&q(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,a)+n+o.getTextContent().slice(a+u)===Ol(i.anchorNode)||W(e,Cr,n);const c=n.length;Kt&&c>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),ns||un||di||!e.isComposing()||(Qr=0,Oe(null))}else wi(!1,e,n!==null?n:void 0),$r&&(Ts(e,n||void 0),$r=!1);Xe(),El(ve())}),xr=null}],["click",function(r,e){nt(e,()=>{const t=K(),n=ut(e._window),s=mn();if(n){if(M(t)){const o=t.anchor,i=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Ge(i)&&xe().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()&&(F(i)?i.select(0):i.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const o=n.anchorNode;if(o!==null){const i=o.nodeType;(i===cn||i===Ht)&&St(Bi(s,n,e,r))}}}W(e,dl,r)})}],["cut",Ft],["copy",Ft],["dragstart",Ft],["dragover",Ft],["dragend",Ft],["paste",Ft],["focus",Ft],["blur",Ft],["drop",Ft]];Pn&&Js.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,o=Ql(t);s==="deleteCompositionText"||Kt&&Ml(n)||s!=="insertCompositionText"&&nt(n,()=>{const i=K();if(s==="deleteContentBackward"){if(i===null){const h=mn();if(!M(h))return;St(h.clone())}if(M(i)){const h=i.anchor.key===i.focus.key;if(l=t.timeStamp,Kl==="MediaLast"&&l<Qr+Hs&&n.isComposing()&&h){if(Oe(null),Qr=0,setTimeout(()=>{nt(n,()=>{Oe(null)})},Hs),M(i)){const p=i.anchor.getNode();p.markDirty(),i.format=p.getFormat(),q(p)||I(142),i.style=p.getStyle()}}else{Oe(null),t.preventDefault();const p=i.anchor.getNode(),m=p.getTextContent(),x=p.canInsertTextAfter(),D=i.anchor.offset===0&&i.focus.offset===m.length;Ou&&h&&!D&&x||W(n,tr,!0)}return}}var l;if(!M(i))return;const a=t.data;xr!==null&&wi(!1,n,xr),i.dirty&&xr===null||!i.isCollapsed()||Ge(i.anchor.getNode())||o===null||i.applyDOMRange(o),xr=null;const u=i.anchor,c=i.focus,d=u.getNode(),f=c.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":W(n,Cr,t);break;case"insertFromComposition":Oe(null),W(n,Cr,t);break;case"insertLineBreak":Oe(null),W(n,vr,!1);break;case"insertParagraph":Oe(null),Yr&&!un?(Yr=!1,W(n,vr,!1)):W(n,en,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":W(n,ts,t);break;case"deleteByComposition":(function(h,p){return h!==p||F(h)||F(p)||!h.isToken()||!p.isToken()})(d,f)&&W(n,Ms,t);break;case"deleteByDrag":case"deleteByCut":W(n,Ms,t);break;case"deleteContent":W(n,tr,!1);break;case"deleteWordBackward":W(n,tn,!0);break;case"deleteWordForward":W(n,tn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":W(n,rn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":W(n,rn,!1);break;case"formatStrikeThrough":W(n,gt,"strikethrough");break;case"formatBold":W(n,gt,"bold");break;case"formatItalic":W(n,gt,"italic");break;case"formatUnderline":W(n,gt,"underline");break;case"historyUndo":W(n,ai,void 0);break;case"historyRedo":W(n,ui,void 0)}else{if(a===`
64
+ `)t.preventDefault(),W(n,vr,!1);else if(a===jt)t.preventDefault(),W(n,en,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),i.insertRawText(h)}else a!=null&&Jl(i,o,a,t.timeStamp,!0)?(t.preventDefault(),W(n,Cr,a)):xr=a;Vl=t.timeStamp}})}(r,e)]);let Qr=0,Kl=null,Vl=0,xr=null;const Hn=new WeakMap;let Qs=!1,Ys=!1,Yr=!1,$r=!1,Hl=[0,"",0,"root",0];function Jl(r,e,t,n,s){const o=r.anchor,i=r.focus,l=o.getNode(),a=ve(),u=ut(a._window),c=u!==null?u.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==i.key||!q(l)||(!s&&(!Pn||Vl<n+50)||l.isDirty()&&h<2||Rl(t))&&o.offset!==i.offset&&!l.isComposing()||Zt(l)||l.isDirty()&&h>1||(s||!Pn)&&f!==null&&!l.isComposing()&&c!==In(f)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==r.format||l.getStyle()!==r.style||ic(r,l)}function ao(r,e){return r!==null&&r.nodeValue!==null&&r.nodeType===Ht&&e!==0&&e!==r.nodeValue.length}function uo(r,e,t){const{anchorNode:n,anchorOffset:s,focusNode:o,focusOffset:i}=r;Qs&&(Qs=!1,ao(n,s)&&ao(o,i))||nt(e,()=>{if(!t)return void St(null);if(!dn(e,n,o))return;const l=K();if(M(l)){const a=l.anchor,u=a.getNode();if(l.isCollapsed()){r.type==="Range"&&r.anchorNode===r.focusNode&&(l.dirty=!0);const c=as(e).event,d=c?c.timeStamp:performance.now(),[f,h,p,m,x]=Hl,D=xe(),y=e.isComposing()===!1&&D.getTextContent()==="";if(d<x+200&&a.offset===p&&a.key===m)l.format=f,l.style=h;else if(a.type==="text")q(u)||I(141),l.format=u.getFormat(),l.style=u.getStyle();else if(a.type==="element"&&!y){const A=a.getNode();l.style="",A instanceof Tr&&A.getChildrenSize()===0?(l.format=A.getTextFormat(),l.style=A.getTextStyle()):l.format=0}}else{const c=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,p=l.isBackward(),m=p?i:s,x=p?s:i,D=p?d:c,y=p?c:d;let A=zu,C=!1;for(let E=0;E<h;E++){const v=f[E],_=v.getTextContentSize();if(q(v)&&_!==0&&!(E===0&&v.__key===D&&m===_||E===h-1&&v.__key===y&&x===0)&&(C=!0,A&=v.getFormat(),A===0))break}l.format=C?A:0}}W(e,li,void 0)})}function Ql(r){if(!r.getTargetRanges)return null;const e=r.getTargetRanges();return e.length===0?null:e[0]}function Ts(r,e){const t=r._compositionKey;if(Oe(null),t!==null&&e!=null){if(e===""){const n=$e(t),s=In(r.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&q(n)&&Di(n,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
65
+ `){const n=K();if(M(n)){const s=n.focus;return n.anchor.set(s.key,s.offset,s.type),void W(r,Rn,null)}}}wi(!0,r,e)}function Yl(r){let e=r.__lexicalEventHandles;return e===void 0&&(e=[],r.__lexicalEventHandles=e),e}const wr=new Map;function Xl(r){const e=r.target,t=ut(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const n=Bl(t.anchorNode);if(n===null)return;Ys&&(Ys=!1,nt(n,()=>{const u=mn(),c=t.anchorNode;if(c===null)return;const d=c.nodeType;d!==cn&&d!==Ht||St(Bi(u,t,n,r))}));const s=Ci(n),o=s[s.length-1],i=o._key,l=wr.get(i),a=l||o;a!==n&&uo(t,a,!1),uo(t,n,!0),n!==o?wr.set(i,n):l&&wr.delete(i)}function co(r){r._lexicalHandled=!0}function fo(r){return r._lexicalHandled===!0}function yc(r){const e=r.ownerDocument,t=Hn.get(e);t===void 0&&I(162);const n=t-1;n>=0||I(164),Hn.set(e,n),n===0&&e.removeEventListener("selectionchange",Xl);const s=is(r);vi(s)?(function(i){if(i._parentEditor!==null){const l=Ci(i),a=l[l.length-1]._key;wr.get(a)===i&&wr.delete(a)}else wr.delete(i._key)}(s),r.__lexicalEditor=null):s&&I(198);const o=Yl(r);for(let i=0;i<o.length;i++)o[i]();r.__lexicalEventHandles=[]}function Xs(r,e,t){Xe();const n=r.__key,s=r.getParent();if(s===null)return;const o=function(l){const a=K();if(!M(a)||!F(l))return a;const{anchor:u,focus:c}=a,d=u.getNode(),f=c.getNode();return Jr(d,l)&&u.set(l.__key,0,"element"),Jr(f,l)&&c.set(l.__key,0,"element"),a}(r);let i=!1;if(M(o)&&e){const l=o.anchor,a=o.focus;l.key===n&&(Qn(l,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0),a.key===n&&(Qn(a,r,s,r.getPreviousSibling(),r.getNextSibling()),i=!0)}else Ct(o)&&e&&r.isSelected()&&r.selectPrevious();if(M(o)&&e&&!i){const l=r.getIndexWithinParent();rr(r),Jn(o,s,l,-1)}else rr(r);t||At(s)||s.canBeEmpty()||!s.isEmpty()||Xs(s,e),e&&Ge(s)&&s.isEmpty()&&s.selectEnd()}class cs{static getType(){I(64,this.name)}static clone(e){I(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,sc(this,e)}getType(){return this.__type}isInline(){I(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=$e(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||K();if(t==null)return!1;const n=t.getNodes().some(s=>s.__key===this.__key);if(q(this))return n;if(M(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(de(this)&&this.isInline()&&s){const o=t.isBackward()?t.focus:t.anchor,i=o.getNode();if(o.offset===i.getChildrenSize()&&i.is(s)&&i.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:$e(e)}getParentOrThrow(){const e=this.getParent();return e===null&&I(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(At(t))return F(e)||e===this&&de(e)||I(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&I(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:$e(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:$e(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();F(this)&&t.unshift(this),F(e)&&n.unshift(e);const s=t.length,o=n.length;if(s===0||o===0||t[s-1]!==n[o-1])return null;const i=new Set(n);for(let l=0;l<s;l++){const a=t[l];if(i.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let n=0,s=0,o=this;for(;;){const i=o.getParentOrThrow();if(i===t){n=o.getIndexWithinParent();break}o=i}for(o=e;;){const i=o.getParentOrThrow();if(i===t){s=o.getIndexWithinParent();break}o=i}return n<s}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;n!==null;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],s=new Set;let o=this;for(;o!==null;){const i=o.__key;if(s.has(i)||(s.add(i),n.push(o)),o===e)break;const l=F(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const u=o.getParentOrThrow();if(s.has(u.__key)||n.push(u),u===e)break;let c=null,d=u;do{if(d===null&&I(68),c=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;c!==null||s.has(d.__key)||n.push(d)}while(c===null);o=c}return t||n.reverse(),n}isDirty(){const e=ve()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=$e(this.__key);return e===null&&I(113),e}getWritable(){Xe();const e=Pt(),t=ve(),n=e._nodeMap,s=this.__key,o=this.getLatest(),i=t._cloneNotNeeded,l=K();if(l!==null&&l.setCachedNodes(null),i.has(s))return qn(o),o;const a=Ei(o);return i.add(s),qn(a),n.set(s,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){I(70)}updateDOM(e,t,n){I(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){I(72)}static importJSON(e){I(18,this.name)}static transform(){return null}remove(e){Xs(this,!0,e)}replace(e,t){Xe();let n=K();n!==null&&(n=n.clone()),As(this,e);const s=this.getLatest(),o=this.__key,i=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;rr(l);const c=s.getPreviousSibling(),d=s.getNextSibling(),f=s.__prev,h=s.__next,p=s.__parent;if(Xs(s,!1,!0),c===null?a.__first=i:c.getWritable().__next=i,l.__prev=f,d===null?a.__last=i:d.getWritable().__prev=i,l.__next=h,l.__parent=p,a.__size=u,t&&(F(this)&&F(l)||I(139),this.getChildren().forEach(m=>{l.append(m)})),M(n)){St(n);const m=n.anchor,x=n.focus;m.key===o&&mo(m,l),x.key===o&&mo(x,l)}return Ut()===o&&Oe(i),l}insertAfter(e,t=!0){Xe(),As(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.getParent(),i=K();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(rr(s),M(i)){const p=o.__key,m=i.anchor,x=i.focus;l=m.type==="element"&&m.key===p&&m.offset===h+1,a=x.type==="element"&&x.key===p&&x.offset===h+1}}const u=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),d=s.__key,f=n.__next;if(u===null?c.__last=d:u.getWritable().__prev=d,c.__size++,n.__next=d,s.__next=f,s.__prev=n.__key,s.__parent=n.__parent,t&&M(i)){const h=this.getIndexWithinParent();Jn(i,c,h+1);const p=c.__key;l&&i.anchor.set(p,h+2,"element"),a&&i.focus.set(p,h+2,"element")}return e}insertBefore(e,t=!0){Xe(),As(this,e);const n=this.getWritable(),s=e.getWritable(),o=s.__key;rr(s);const i=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=n.__prev,u=this.getIndexWithinParent();i===null?l.__first=o:i.getWritable().__next=o,l.__size++,n.__prev=o,s.__prev=a,s.__next=n.__key,s.__parent=n.__parent;const c=K();return t&&M(c)&&Jn(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return Ee()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Xe();const n=this.getPreviousSibling(),s=this.getParentOrThrow();if(n===null)return s.select(0,0);if(F(n))return n.select();if(!q(n)){const o=n.getIndexWithinParent()+1;return s.select(o,o)}return n.select(e,t)}selectNext(e,t){Xe();const n=this.getNextSibling(),s=this.getParentOrThrow();if(n===null)return s.select();if(F(n))return n.select(0,0);if(!q(n)){const o=n.getIndexWithinParent();return s.select(o,o)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class hn extends cs{static getType(){return"linebreak"}static clone(e){return new hn(e.__key)}constructor(e){super(e)}getTextContent(){return`
66
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const n=t.parentElement;if(n!==null&&Wn(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&Dn(s)){const o=n.lastChild;if(o===t||o.previousSibling===t&&Dn(o))return!0}}return!1}(e)||function(t){const n=t.parentElement;if(n!==null&&Wn(n)){const s=n.firstChild;if(s===t||s.nextSibling===t&&Dn(s))return!1;const o=n.lastChild;if(o===t||o.previousSibling===t&&Dn(o))return!0}return!1}(e)?null:{conversion:xc,priority:0}}}static importJSON(e){return lr()}exportJSON(){return{type:"linebreak",version:1}}}function xc(r){return{node:lr()}}function lr(){return kt(new hn)}function nr(r){return r instanceof hn}function Dn(r){return r.nodeType===Ht&&/^( |\t|\r?\n)+$/.test(r.textContent||"")}function Bs(r,e){return 16&e?"code":e&fi?"mark":32&e?"sub":64&e?"sup":null}function Ns(r,e){return 1&e?"strong":2&e?"em":"span"}function Zl(r,e,t,n,s){const o=n.classList;let i=Hr(s,"base");i!==void 0&&o.add(...i),i=Hr(s,"underlineStrikethrough");let l=!1;const a=e&Mn&&e&On;i!==void 0&&(t&Mn&&t&On?(l=!0,a||o.add(...i)):a&&o.remove(...i));for(const u in ir){const c=ir[u];if(i=Hr(s,u),i!==void 0)if(t&c){if(l&&(u==="underline"||u==="strikethrough")){e&c&&o.remove(...i);continue}e&c&&(!a||u!=="underline")&&u!=="strikethrough"||o.add(...i)}else e&c&&o.remove(...i)}}function ea(r,e,t){const n=e.firstChild,s=t.isComposing(),o=r+(s?ss:"");if(n==null)e.textContent=o;else{const i=n.nodeValue;if(i!==o)if(s||Kt){const[l,a,u]=function(c,d){const f=c.length,h=d.length;let p=0,m=0;for(;p<f&&p<h&&c[p]===d[p];)p++;for(;m+p<f&&m+p<h&&c[f-m-1]===d[h-m-1];)m++;return[p,f-p-m,d.slice(p,h-m)]}(i,o);a!==0&&n.deleteData(l,a),n.insertData(l,u)}else n.nodeValue=o}}function ho(r,e,t,n,s,o){ea(s,r,e);const i=o.theme.text;i!==void 0&&Zl(0,0,n,r,i)}function Sn(r,e){const t=document.createElement(e);return t.appendChild(r),t}class kr extends cs{static getType(){return"text"}static clone(e){return new kr(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Hu[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ut()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=ir[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return zn(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const n=this.__format,s=Bs(0,n),o=Ns(0,n),i=s===null?o:s,l=document.createElement(i);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(a=document.createElement(o),l.appendChild(a)),ho(a,this,0,n,this.__text,e);const u=this.__style;return u!==""&&(l.style.cssText=u),l}updateDOM(e,t,n){const s=this.__text,o=e.__format,i=this.__format,l=Bs(0,o),a=Bs(0,i),u=Ns(0,o),c=Ns(0,i);if((l===null?u:l)!==(a===null?c:a))return!0;if(l===a&&u!==c){const m=t.firstChild;m==null&&I(48);const x=document.createElement(c);return ho(x,this,0,i,s,n),t.replaceChild(x,m),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&I(49)),ea(s,d,this);const f=n.theme.text;f!==void 0&&o!==i&&Zl(0,o,i,d,f);const h=e.__style,p=this.__style;return h!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:Cc,priority:0}),b:()=>({conversion:_c,priority:0}),code:()=>({conversion:It,priority:0}),em:()=>({conversion:It,priority:0}),i:()=>({conversion:It,priority:0}),s:()=>({conversion:It,priority:0}),span:()=>({conversion:bc,priority:0}),strong:()=>({conversion:It,priority:0}),sub:()=>({conversion:It,priority:0}),sup:()=>({conversion:It,priority:0}),u:()=>({conversion:It,priority:0})}}static importJSON(e){const t=ke(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Rt(t)||I(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Sn(t,"b")),this.hasFormat("italic")&&(t=Sn(t,"i")),this.hasFormat("strikethrough")&&(t=Sn(t,"s")),this.hasFormat("underline")&&(t=Sn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?ir[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Gu[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=zn(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Vu[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Xe();let n=e,s=t;const o=K(),i=this.getTextContent(),l=this.__key;if(typeof i=="string"){const a=i.length;n===void 0&&(n=a),s===void 0&&(s=a)}else n=0,s=0;if(!M(o))return na(l,n,l,s,"text","text");{const a=Ut();a!==o.anchor.key&&a!==o.focus.key||Oe(l),o.setTextNodeRange(this,n,this,s)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,s){const o=this.getWritable(),i=o.__text,l=n.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const u=K();if(s&&M(u)){const d=e+l;u.setTextNodeRange(o,d,o,d)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Xe();const t=this.getLatest(),n=t.getTextContent(),s=t.__key,o=Ut(),i=new Set(e),l=[],a=n.length;let u="";for(let E=0;E<a;E++)u!==""&&i.has(E)&&(l.push(u),u=""),u+=n[E];u!==""&&l.push(u);const c=l.length;if(c===0)return[];if(l[0]===n)return[t];const d=l[0],f=t.getParent();let h;const p=t.getFormat(),m=t.getStyle(),x=t.__detail;let D=!1;t.isSegmented()?(h=ke(d),h.__format=p,h.__style=m,h.__detail=x,D=!0):(h=t.getWritable(),h.__text=d);const y=K(),A=[h];let C=d.length;for(let E=1;E<c;E++){const v=l[E],_=v.length,S=ke(v).getWritable();S.__format=p,S.__style=m,S.__detail=x;const T=S.__key,z=C+_;if(M(y)){const N=y.anchor,L=y.focus;N.key===s&&N.type==="text"&&N.offset>C&&N.offset<=z&&(N.key=T,N.offset-=C,y.dirty=!0),L.key===s&&L.type==="text"&&L.offset>C&&L.offset<=z&&(L.key=T,L.offset-=C,y.dirty=!0)}o===s&&Oe(T),C=z,A.push(S)}if(f!==null){(function(_){const S=_.getPreviousSibling(),T=_.getNextSibling();S!==null&&qn(S),T!==null&&qn(T)})(this);const E=f.getWritable(),v=this.getIndexWithinParent();D?(E.splice(v,0,A),this.remove()):E.splice(v,1,A),M(y)&&Jn(y,f,v,c-1)}return A}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||I(50);const n=this.__key,s=e.__key,o=this.__text,i=o.length;Ut()===s&&Oe(n);const l=K();if(M(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===s&&(wo(d,t,n,e,i),l.dirty=!0),f!==null&&f.key===s&&(wo(f,t,n,e,i),l.dirty=!0)}const a=e.__text,u=t?a+o:o+a;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function bc(r){return{forChild:Ti(r.style),node:null}}function _c(r){const e=r,t=e.style.fontWeight==="normal";return{forChild:Ti(e.style,t?void 0:"bold"),node:null}}const po=new WeakMap;function vc(r){return r.nodeName==="PRE"||r.nodeType===cn&&r.style!==void 0&&r.style.whiteSpace!==void 0&&r.style.whiteSpace.startsWith("pre")}function Cc(r){const e=r;r.parentElement===null&&I(129);let t=e.textContent||"";if(function(n){let s,o=n.parentNode;const i=[n];for(;o!==null&&(s=po.get(o))===void 0&&!vc(o);)i.push(o),o=o.parentNode;const l=s===void 0?o:s;for(let a=0;a<i.length;a++)po.set(i[a],l);return l}(e)!==null){const n=t.split(/(\r?\n|\t)/),s=[],o=n.length;for(let i=0;i<o;i++){const l=n[i];l===`
67
67
  `||l===`\r
68
- `?s.push(or()):l===" "?s.push(pn()):l!==""&&s.push(ke(l))}return{node:s}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let n=e,s=!0;for(;n!==null&&(n=po(n,!1))!==null;){const o=n.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),s=!1;break}}s&&(t=t.slice(1))}if(t[t.length-1]===" "){let n=e,s=!0;for(;n!==null&&(n=po(n,!0))!==null;)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ke(t)}}function po(r,e){let t=r;for(;;){let n;for(;(n=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=n,t.nodeType===un){const o=t.style.display;if(o===""&&!Is(t)||o!==""&&!o.startsWith("inline"))return null}let s=t;for(;(s=e?t.firstChild:t.lastChild)!==null;)t=s;if(t.nodeType===Vt)return t;if(t.nodeName==="BR")return null}}const wc={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function $t(r){const e=wc[r.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ki(r.style,e),node:null}}function ke(r=""){return At(new Ar(r))}function U(r){return r instanceof Ar}function ki(r,e){const t=r.fontWeight,n=r.textDecoration.split(" "),s=t==="700"||t==="bold",o=n.includes("line-through"),i=r.fontStyle==="italic",l=n.includes("underline"),a=r.verticalAlign;return u=>(U(u)&&(s&&!u.hasFormat("bold")&&u.toggleFormat("bold"),o&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),l&&!u.hasFormat("underline")&&u.toggleFormat("underline"),a!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),a!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),e&&!u.hasFormat(e)&&u.toggleFormat(e)),u)}class hn extends Ar{static getType(){return"tab"}static clone(e){return new hn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=pn();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){I(126)}setDetail(e){I(127)}setMode(e){I(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function pn(){return At(new hn)}function Dc(r){return r instanceof hn}class Sc{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const s=this.offset,o=e.offset;if(N(t)){const i=t.getDescendantByIndex(s);t=i??t}if(N(n)){const i=n.getDescendantByIndex(o);n=i??n}return t===n?s<o:t.isBefore(n)}getNode(){const e=ze(this.key);return e===null&&I(20),e}set(e,t,n){const s=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,mn()||(qt()===o&&Me(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0))}}function St(r,e,t){return new Sc(r,e,t)}function Ns(r,e){let t=e.__key,n=r.offset,s="element";if(U(e)){s="text";const o=e.getTextContentSize();n>o&&(n=o)}else if(!N(e)){const o=e.getNextSibling();if(U(o))t=o.__key,n=0,s="text";else{const i=e.getParent();i&&(t=i.__key,n=e.getIndexWithinParent()+1)}}r.set(t,n,s)}function go(r,e){if(N(e)){const t=e.getLastDescendant();N(t)||U(t)?Ns(r,t):Ns(r,e)}else Ns(r,e)}function zt(r,e,t,n){r.key=e,r.offset=t,r.type=n}class ds{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!_t(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(s=>n.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new ds(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,s=t[n-1];let o;if(U(s))o=s.select();else{const i=s.getIndexWithinParent()+1;o=s.getParentOrThrow().select(i,i)}o.insertNodes(e);for(let i=0;i<n;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,n=[];for(const s of t){const o=ze(s);o!==null&&n.push(o)}return mn()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function M(r){return r instanceof Ht}class Ht{constructor(e,t,n,s){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!M(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,n=this.focus,s=t.isBefore(n),o=s?t:n,i=s?n:t;let l=o.getNode(),a=i.getNode();const u=o.offset,c=i.offset;if(N(l)){const f=l.getDescendantByIndex(u);l=f??l}if(N(a)){let f=a.getDescendantByIndex(c);f!==null&&f!==l&&a.getChildAtIndex(c)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?N(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),mn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,n,s){zt(this.anchor,e.__key,t,"text"),zt(this.focus,n.__key,s,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],n=e[e.length-1],s=this.anchor,o=this.focus,i=s.isBefore(o),[l,a]=Xs(this);let u="",c=!0;for(let d=0;d<e.length;d++){const f=e[d];if(N(f)&&!f.isInline())c||(u+=`
69
- `),c=!f.isEmpty();else if(c=!1,U(f)){let h=f.getTextContent();f===t?f===n?s.type==="element"&&o.type==="element"&&o.offset!==s.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=i?h.slice(l):h.slice(a):f===n&&(h=i?h.slice(0,a):h.slice(0,l)),u+=h}else!de(f)&&!rr(f)||f===n&&this.isCollapsed()||(u+=f.getTextContent())}return u}applyDOMRange(e){const t=ve(),n=t.getEditorState()._selection,s=ta(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(s===null)return;const[o,i]=s;zt(this.anchor,o.key,o.offset,o.type),zt(this.focus,i.key,i.offset,i.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Ht(St(e.key,e.offset,e.type),St(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=zn(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=sr[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],s=t.length;for(let o=0;o<s;o++){const i=t[o];i===`
68
+ `?s.push(lr()):l===" "?s.push(gn()):l!==""&&s.push(ke(l))}return{node:s}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let n=e,s=!0;for(;n!==null&&(n=go(n,!1))!==null;){const o=n.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),s=!1;break}}s&&(t=t.slice(1))}if(t[t.length-1]===" "){let n=e,s=!0;for(;n!==null&&(n=go(n,!0))!==null;)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ke(t)}}function go(r,e){let t=r;for(;;){let n;for(;(n=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=n,t.nodeType===cn){const o=t.style.display;if(o===""&&!zs(t)||o!==""&&!o.startsWith("inline"))return null}let s=t;for(;(s=e?t.firstChild:t.lastChild)!==null;)t=s;if(t.nodeType===Ht)return t;if(t.nodeName==="BR")return null}}const wc={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function It(r){const e=wc[r.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Ti(r.style,e),node:null}}function ke(r=""){return kt(new kr(r))}function q(r){return r instanceof kr}function Ti(r,e){const t=r.fontWeight,n=r.textDecoration.split(" "),s=t==="700"||t==="bold",o=n.includes("line-through"),i=r.fontStyle==="italic",l=n.includes("underline"),a=r.verticalAlign;return u=>(q(u)&&(s&&!u.hasFormat("bold")&&u.toggleFormat("bold"),o&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),l&&!u.hasFormat("underline")&&u.toggleFormat("underline"),a!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),a!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),e&&!u.hasFormat(e)&&u.toggleFormat(e)),u)}class pn extends kr{static getType(){return"tab"}static clone(e){return new pn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=gn();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){I(126)}setDetail(e){I(127)}setMode(e){I(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function gn(){return kt(new pn)}function Dc(r){return r instanceof pn}class Sc{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const s=this.offset,o=e.offset;if(F(t)){const i=t.getDescendantByIndex(s);t=i??t}if(F(n)){const i=n.getDescendantByIndex(o);n=i??n}return t===n?s<o:t.isBefore(n)}getNode(){const e=$e(this.key);return e===null&&I(20),e}set(e,t,n){const s=this._selection,o=this.key;this.key=e,this.offset=t,this.type=n,yn()||(Ut()===o&&Oe(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0))}}function Et(r,e,t){return new Sc(r,e,t)}function Fs(r,e){let t=e.__key,n=r.offset,s="element";if(q(e)){s="text";const o=e.getTextContentSize();n>o&&(n=o)}else if(!F(e)){const o=e.getNextSibling();if(q(o))t=o.__key,n=0,s="text";else{const i=e.getParent();i&&(t=i.__key,n=e.getIndexWithinParent()+1)}}r.set(t,n,s)}function mo(r,e){if(F(e)){const t=e.getLastDescendant();F(t)||q(t)?Fs(r,t):Fs(r,e)}else Fs(r,e)}function qt(r,e,t,n){r.key=e,r.offset=t,r.type=n}class ds{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ct(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(s=>n.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new ds(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,s=t[n-1];let o;if(q(s))o=s.select();else{const i=s.getIndexWithinParent()+1;o=s.getParentOrThrow().select(i,i)}o.insertNodes(e);for(let i=0;i<n;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,n=[];for(const s of t){const o=$e(s);o!==null&&n.push(o)}return yn()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}}function M(r){return r instanceof Jt}class Jt{constructor(e,t,n,s){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!M(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,n=this.focus,s=t.isBefore(n),o=s?t:n,i=s?n:t;let l=o.getNode(),a=i.getNode();const u=o.offset,c=i.offset;if(F(l)){const f=l.getDescendantByIndex(u);l=f??l}if(F(a)){let f=a.getDescendantByIndex(c);f!==null&&f!==l&&a.getChildAtIndex(c)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?F(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),yn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,n,s){qt(this.anchor,e.__key,t,"text"),qt(this.focus,n.__key,s,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],n=e[e.length-1],s=this.anchor,o=this.focus,i=s.isBefore(o),[l,a]=Zs(this);let u="",c=!0;for(let d=0;d<e.length;d++){const f=e[d];if(F(f)&&!f.isInline())c||(u+=`
69
+ `),c=!f.isEmpty();else if(c=!1,q(f)){let h=f.getTextContent();f===t?f===n?s.type==="element"&&o.type==="element"&&o.offset!==s.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=i?h.slice(l):h.slice(a):f===n&&(h=i?h.slice(0,a):h.slice(0,l)),u+=h}else!de(f)&&!nr(f)||f===n&&this.isCollapsed()||(u+=f.getTextContent())}return u}applyDOMRange(e){const t=ve(),n=t.getEditorState()._selection,s=ra(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(s===null)return;const[o,i]=s;qt(this.anchor,o.key,o.offset,o.type),qt(this.focus,i.key,i.offset,i.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Jt(Et(e.key,e.offset,e.type),Et(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=zn(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=ir[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],s=t.length;for(let o=0;o<s;o++){const i=t[o];i===`
70
70
  `||i===`\r
71
- `?n.push(or()):i===" "?n.push(pn()):n.push(ke(i))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,s=this.format,o=this.style;let i=t,l=n;!this.isCollapsed()&&n.isBefore(t)&&(i=n,l=t),i.type==="element"&&function(b,D,y,A){const _=b.getNode(),E=_.getChildAtIndex(b.offset),C=ke(),v=Ge(_)?Se().append(C):C;C.setFormat(y),C.setStyle(A),E===null?_.append(v):E.insertBefore(v),b.is(D)&&D.set(C.__key,0,"text"),b.set(C.__key,0,"text")}(i,l,s,o);const a=i.offset;let u=l.offset;const c=this.getNodes(),d=c.length;let f=c[0];U(f)||I(26);const h=f.getTextContent().length,p=f.getParentOrThrow();let m=c[d-1];if(d===1&&l.type==="element"&&(u=h,l.set(i.key,u,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!p.canInsertTextAfter()&&f.getNextSibling()===null)){let b=f.getNextSibling();if(U(b)&&b.canInsertTextBefore()&&!Xt(b)||(b=ke(),b.setFormat(s),b.setStyle(o),p.canInsertTextAfter()?f.insertAfter(b):p.insertAfter(b)),b.select(0,0),f=b,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!p.canInsertTextBefore()&&f.getPreviousSibling()===null)){let b=f.getPreviousSibling();if(U(b)&&!Xt(b)||(b=ke(),b.setFormat(s),p.canInsertTextBefore()?f.insertBefore(b):p.insertBefore(b)),b.select(),f=b,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const b=ke(f.getTextContent());b.setFormat(s),f.replace(b),f=b}else if(!this.isCollapsed()&&e!==""){const b=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||N(b)&&(!b.canInsertTextBefore()||!b.canInsertTextAfter()))return this.insertText(""),ea(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const A=ke(e);return A.select(),void f.replace(A)}const b=f.getFormat(),D=f.getStyle();if(a!==u||b===s&&D===o){if(Dc(f)){const A=ke(e);return A.setFormat(s),A.setStyle(o),A.select(),void f.replace(A)}}else{if(f.getTextContent()!==""){const A=ke(e);if(A.setFormat(s),A.setStyle(o),A.select(),a===0)f.insertBefore(A,!1);else{const[_]=f.splitText(a);_.insertAfter(A,!1)}return void(A.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(s),f.setStyle(o)}const y=u-a;f=f.spliceText(a,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=b,this.style=D))}else{const b=new Set([...f.getParentKeys(),...m.getParentKeys()]),D=N(f)?f:f.getParentOrThrow();let y=N(m)?m:m.getParentOrThrow(),A=m;if(!D.is(y)&&y.isInline())do A=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(u!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<u)if(U(m)&&!m.isToken()&&u!==m.getTextContentSize()){if(m.isSegmented()){const S=ke(m.getTextContent());m.replace(S),m=S}Ge(l.getNode())||l.type!=="text"||(m=m.spliceText(0,u,"")),b.add(m.__key)}else{const S=m.getParentOrThrow();S.canBeEmpty()||S.getChildrenSize()!==1?m.remove():S.remove()}else b.add(m.__key);const _=y.getChildren(),E=new Set(c),C=D.is(y),v=D.isInline()&&f.getNextSibling()===null?D:f;for(let S=_.length-1;S>=0;S--){const k=_[S];if(k.is(f)||N(k)&&k.isParentOf(f))break;k.isAttached()&&(!E.has(k)||k.is(A)?C||v.insertAfter(k,!1):k.remove())}if(!C){let S=y,k=null;for(;S!==null;){const q=S.getChildren(),B=q.length;(B===0||q[B-1].is(k))&&(b.delete(S.__key),k=S),S=S.getParent()}}if(f.isToken())if(a===h)f.select();else{const S=ke(e);S.select(),f.replace(S)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let S=1;S<d;S++){const k=c[S],q=k.__key;b.has(q)||k.remove()}}}removeText(){if(this.isCollapsed())return;const{anchor:e,focus:t}=this,n=this.getNodes(),s=this.isBackward()?t:e,o=this.isBackward()?e:t;let i=s.getNode(),l=o.getNode();const a=Or(i,It),u=Or(l,It);U(i)&&i.isToken()&&s.offset<i.getTextContentSize()&&(s.offset=0),o.offset>0&&U(l)&&l.isToken()&&(o.offset=l.getTextContentSize()),n.forEach(d=>{Hr(i,d)||Hr(l,d)||d.getKey()===i.getKey()||d.getKey()===l.getKey()||d.remove()});const c=(d,f)=>{if(d.getTextContent()==="")d.remove();else if(f!==0&&Xt(d)){const h=ke(d.getTextContent());return h.setFormat(d.getFormat()),h.setStyle(d.getStyle()),d.replace(h)}};if(i===l&&U(i)){const d=Math.abs(t.offset-e.offset);return i.spliceText(s.offset,d,"",!0),void c(i,d)}if(U(i)){const d=i.getTextContentSize()-s.offset;i.spliceText(s.offset,d,""),i=c(i,d)||i}U(l)&&(l.spliceText(0,o.offset,""),l=c(l,o.offset)||l),i.isAttached()&&U(i)?i.selectEnd():l.isAttached()&&U(l)&&l.selectStart(),N(a)&&N(u)&&a!==u&&(a.append(...u.getChildren()),u.remove(),o.set(s.key,s.offset,s.type))}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Me(null);const n=this.getNodes(),s=[];for(const _ of n)U(_)&&s.push(_);const o=_=>{n.forEach(E=>{if(Sr(E)){const C=E.getFormatFlags(e,_);E.setTextFormat(C)}})},i=s.length;if(i===0)return this.toggleFormat(e),Me(null),void o(t);const l=this.anchor,a=this.focus,u=this.isBackward(),c=u?a:l,d=u?l:a;let f=0,h=s[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===h.getTextContentSize()&&(f=1,h=s[1],p=0),h==null)return;const m=h.getFormatFlags(e,t);o(m);const b=i-1;let D=s[b];const y=d.type==="text"?d.offset:D.getTextContentSize();if(h.is(D)){if(p===y)return;if(Xt(h)||p===0&&y===h.getTextContentSize())h.setFormat(m);else{const _=h.splitText(p,y),E=p===0?_[0]:_[1];E.setFormat(m),c.type==="text"&&c.set(E.__key,0,"text"),d.type==="text"&&d.set(E.__key,y-p,"text")}return void(this.format=m)}p===0||Xt(h)||([,h]=h.splitText(p),p=0),h.setFormat(m);const A=D.getFormatFlags(e,m);y>0&&(y===D.getTextContentSize()||Xt(D)||([D]=D.splitText(y)),D.setFormat(A));for(let _=f+1;_<b;_++){const E=s[_],C=E.getFormatFlags(e,A);E.setFormat(C)}c.type==="text"&&c.set(h.__key,p,"text"),d.type==="text"&&d.set(D.__key,y,"text"),this.format=m|A}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const p=V();return M(p)||I(134),p.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Or(t,It),s=e[e.length-1];if(N(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const p=Fs(this);n.splice(p,0,e),s.selectEnd()}return}if(!e.some(p=>(N(p)||de(p))&&!p.isInline())){N(n)||I(211,t.constructor.name,t.getType());const p=Fs(this);return n.splice(p,0,e),void s.selectEnd()}const o=function(p){const m=Se();let b=null;for(let D=0;D<p.length;D++){const y=p[D],A=rr(y);if(A||de(y)&&y.isInline()||N(y)&&y.isInline()||U(y)||y.isParentRequired()){if(b===null&&(b=y.createParentElementNode(),m.append(b),A))continue;b!==null&&b.append(y)}else m.append(y),b=null}return m}(e),i=o.getLastDescendant(),l=o.getChildren(),a=!N(n)||!n.isEmpty()?this.insertParagraph():null,u=l[l.length-1];let c=l[0];var d;N(d=c)&&It(d)&&!d.isEmpty()&&N(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(N(n)||I(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=l[1]),c&&(n===null&&I(212,t.constructor.name,t.getType()),function(p,m,b){const D=m.getParentOrThrow().getLastChild();let y=m;const A=[m];for(;y!==D;)y.getNextSibling()||I(140),y=y.getNextSibling(),A.push(y);let _=p;for(const E of A)_=_.insertAfter(E)}(n,c));const f=Or(i,It);a&&N(f)&&(a.canMergeWhenEmpty()||It(u))&&(f.append(...a.getChildren()),a.remove()),N(n)&&n.isEmpty()&&n.remove(),i.selectEnd();const h=N(n)?n.getLastChild():null;rr(h)&&f!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=Se();return xe().splice(this.anchor.offset,0,[i]),i.select(),i}const e=Fs(this),t=Or(this.anchor.getNode(),It);N(t)||I(213);const n=t.getChildAtIndex(e),s=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...s),o.selectStart(),o):null}insertLineBreak(e){const t=or();if(this.insertNodes([t]),e){const n=t.getParentOrThrow(),s=t.getIndexWithinParent();n.select(s,s)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,s=this.anchor,o=this.focus;let i=e[0],l=e[n];const[a,u]=Xs(this);if(t===0)return[];if(t===1){if(U(i)&&!this.isCollapsed()){const d=a>u?u:a,f=a>u?a:u,h=i.splitText(d,f),p=d===0?h[0]:h[1];return p!=null?[p]:[]}return[i]}const c=s.isBefore(o);if(U(i)){const d=c?a:u;d===i.getTextContentSize()?e.shift():d!==0&&([,i]=i.splitText(d),e[0]=i)}if(U(l)){const d=l.getTextContent().length,f=c?u:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[n]=l)}return e}modify(e,t,n){const s=this.focus,o=this.anchor,i=e==="move",l=rn(s,t);if(de(l)&&!l.isIsolated()){if(i&&l.isKeyboardSelectable()){const h=_o();return h.add(l.__key),void wt(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(U(f)){const h=f.__key,p=t?f.getTextContent().length:0;return s.set(h,p,"text"),void(i&&o.set(h,p,"text"))}{const h=l.getParentOrThrow();let p,m;return N(f)?(m=f.__key,p=t?f.getChildrenSize():0):(p=l.getIndexWithinParent(),m=h.__key,t||p++),s.set(m,p,"element"),void(i&&o.set(m,p,"element"))}}const a=ve(),u=ut(a._window);if(!u)return;const c=a._blockCursorElement,d=a._rootElement;if(d===null||c===null||!N(l)||l.isInline()||l.canBeEmpty()||Si(c,a,d),function(f,h,p,m){f.modify(h,p,m)}(u,e,t?"backward":"forward",n),u.rangeCount>0){const f=u.getRangeAt(0),h=this.anchor.getNode(),p=Ge(h)?h:lc(h);if(this.applyDOMRange(f),this.dirty=!0,!i){const m=this.getNodes(),b=[];let D=!1;for(let y=0;y<m.length;y++){const A=m[y];Hr(A,p)?b.push(A):D=!0}if(D&&b.length>0)if(t){const y=b[0];N(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=b[b.length-1];N(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}u.anchorNode===f.startContainer&&u.anchorOffset===f.startOffset||function(y){const A=y.focus,_=y.anchor,E=_.key,C=_.offset,v=_.type;zt(_,A.key,A.offset,A.type),zt(A,E,C,v),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&N(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),o=t.getNextSibling()||(s===null?null:s.getNextSibling());if(N(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let s=n.getNode();if(this.forwardDeletion(n,s,e))return;const o=this.focus,i=rn(o,e);if(de(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&N(s)&&s.getChildrenSize()===0){s.remove();const l=_o();l.add(i.__key),wt(l)}else i.remove(),ve().dispatchCommand(oi,void 0);return}if(!e&&N(i)&&N(s)&&s.isEmpty())return s.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(s=n.type==="text"?n.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,u=l.getTextContentSize();if(l.is(s)||e&&a!==u||!e&&a!==0)return void yo(l,e,a)}else if(s!==null&&s.isSegmented()){const a=n.offset,u=s.getTextContentSize();if(s.is(l)||e&&a!==0||!e&&a!==u)return void yo(s,e,a)}(function(a,u){const c=a.anchor,d=a.focus,f=c.getNode(),h=d.getNode();if(f===h&&c.type==="text"&&d.type==="text"){const p=c.offset,m=d.offset,b=p<m,D=b?p:m,y=b?m:p,A=y-1;D!==A&&(jl(f.getTextContent().slice(D,y))||(u?d.offset=A:c.offset=A))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const n=this.anchor.getNode();n.isEmpty()&&Ge(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),this.isCollapsed()&&this.anchor.offset===0&&this.modify("extend",e,"character"),t){const n=e?this.anchor:this.focus;n.set(n.key,n.offset+1,n.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function _t(r){return r instanceof ds}function mo(r){const e=r.offset;if(r.type==="text")return e;const t=r.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Xs(r){const e=r.getStartEndPoints();if(e===null)return[0,0];const[t,n]=e;return t.type==="element"&&n.type==="element"&&t.key===n.key&&t.offset===n.offset?[0,0]:[mo(t),mo(n)]}function yo(r,e,t){const n=r,s=n.getTextContent().split(/(?=\s)/g),o=s.length;let i=0,l=0;for(let u=0;u<o;u++){const c=u===o-1;if(l=i,i+=s[u].length,e&&i===t||i>t||c){s.splice(u,1),c&&(l=void 0);break}}const a=s.join("").trim();a===""?n.remove():(n.setTextContent(a),n.select(l,l))}function xo(r,e,t,n){let s,o=e;if(r.nodeType===un){let i=!1;const l=r.childNodes,a=l.length,u=n._blockCursorElement;o===a&&(i=!0,o=a-1);let c=l[o],d=!1;if(c===u)c=l[o+1],d=!0;else if(u!==null){const f=u.parentNode;r===f&&e>Array.prototype.indexOf.call(f.children,u)&&o--}if(s=yr(c),U(s))o=Xi(s,i);else{let f=yr(r);if(f===null)return null;if(N(f)){const h=n.getElementByKey(f.getKey());h===null&&I(214),[f,o]=f.getDOMSlot(h).resolveChildIndex(f,h,r,e),N(f)||I(215),i&&o>=f.getChildrenSize()&&(o=Math.max(0,f.getChildrenSize()-1));let m=f.getChildAtIndex(o);if(N(m)&&function(b,D,y){const A=b.getParent();return y===null||A===null||!A.canBeEmpty()||A!==y.getNode()}(m,0,t)){const b=i?m.getLastDescendant():m.getFirstDescendant();b===null?f=m:(m=b,f=N(m)?m:m.getParentOrThrow()),o=0}U(m)?(s=m,f=null,o=Xi(m,i)):m!==f&&i&&!d&&(N(f)||I(216),o=Math.min(f.getChildrenSize(),o+1))}else{const h=f.getIndexWithinParent();o=e===0&&de(f)&&yr(r)===f?h:h+1,f=f.getParentOrThrow()}if(N(f))return St(f.__key,o,"element")}}else s=yr(r);return U(s)?St(s.__key,o,"text"):null}function bo(r,e,t){const n=r.offset,s=r.getNode();if(n===0){const o=s.getPreviousSibling(),i=s.getParent();if(e){if((t||!e)&&o===null&&N(i)&&i.isInline()){const l=i.getPreviousSibling();U(l)&&(r.key=l.__key,r.offset=l.getTextContent().length)}}else N(o)&&!t&&o.isInline()?(r.key=o.__key,r.offset=o.getChildrenSize(),r.type="element"):U(o)&&(r.key=o.__key,r.offset=o.getTextContent().length)}else if(n===s.getTextContent().length){const o=s.getNextSibling(),i=s.getParent();if(e&&N(o)&&o.isInline())r.key=o.__key,r.offset=0,r.type="element";else if((t||e)&&o===null&&N(i)&&i.isInline()&&!i.canInsertTextAfter()){const l=i.getNextSibling();U(l)&&(r.key=l.__key,r.offset=0)}}}function ea(r,e,t){if(r.type==="text"&&e.type==="text"){const n=r.isBefore(e),s=r.is(e);bo(r,n,s),bo(e,!n,s),s&&(e.key=r.key,e.offset=r.offset,e.type=r.type);const o=ve();if(o.isComposing()&&o._compositionKey!==r.key&&M(t)){const i=t.anchor,l=t.focus;zt(r,i.key,i.offset,i.type),zt(e,l.key,l.offset,l.type)}}}function ta(r,e,t,n,s,o){if(r===null||t===null||!cn(s,r,t))return null;const i=xo(r,e,M(o)?o.anchor:null,s);if(i===null)return null;const l=xo(t,n,M(o)?o.focus:null,s);if(l===null)return null;if(i.type==="element"&&l.type==="element"){const a=yr(r),u=yr(t);if(de(a)&&de(u))return null}return ea(i,l,o),[i,l]}function Zs(r){return N(r)&&!r.isInline()}function ra(r,e,t,n,s,o){const i=Rt(),l=new Ht(St(r,e,s),St(t,n,o),0,"");return l.dirty=!0,i._selection=l,l}function Ac(){const r=St("root",0,"element"),e=St("root",0,"element");return new Ht(r,e,0,"")}function _o(){return new ds(new Set)}function Ti(r,e,t,n){const s=t._window;if(s===null)return null;const o=n||s.event,i=o?o.type:void 0,l=i==="selectionchange",a=!$s&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&o&&o.detail===3||i==="drop"||i===void 0);let u,c,d,f;if(M(r)&&!a)return r.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&M(r)&&!cn(t,u,c))return r.clone();const h=ta(u,d,c,f,t,r);if(h===null)return null;const[p,m]=h;return new Ht(p,m,M(r)?r.format:0,M(r)?r.style:"")}function V(){return Rt()._selection}function gn(){return ve()._editorState._selection}function Jn(r,e,t,n=1){const s=r.anchor,o=r.focus,i=s.getNode(),l=o.getNode();if(!e.is(i)&&!e.is(l))return;const a=e.__key;if(r.isCollapsed()){const u=s.offset;if(t<=u&&n>0||t<u&&n<0){const c=Math.max(0,u+n);s.set(a,c,"element"),o.set(a,c,"element"),vo(r)}}else{const u=r.isBackward(),c=u?o:s,d=c.getNode(),f=u?s:o,h=f.getNode();if(e.is(d)){const p=c.offset;(t<=p&&n>0||t<p&&n<0)&&c.set(a,Math.max(0,p+n),"element")}if(e.is(h)){const p=f.offset;(t<=p&&n>0||t<p&&n<0)&&f.set(a,Math.max(0,p+n),"element")}}vo(r)}function vo(r){const e=r.anchor,t=e.offset,n=r.focus,s=n.offset,o=e.getNode(),i=n.getNode();if(r.isCollapsed()){if(!N(o))return;const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(U(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),n.set(u.__key,c,"text")}}else{if(N(o)){const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(U(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(N(i)){const l=i.getChildrenSize(),a=s>=l,u=a?i.getChildAtIndex(l-1):i.getChildAtIndex(s);if(U(u)){let c=0;a&&(c=u.getTextContentSize()),n.set(u.__key,c,"text")}}}}function Qn(r,e,t,n,s){let o=null,i=0,l=null;n!==null?(o=n.__key,U(n)?(i=n.getTextContentSize(),l="text"):N(n)&&(i=n.getChildrenSize(),l="element")):s!==null&&(o=s.__key,U(s)?l="text":N(s)&&(l="element")),o!==null&&l!==null?r.set(o,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),r.set(t.__key,i,"element"))}function Co(r,e,t,n,s){r.type==="text"?(r.key=t,e||(r.offset+=s)):r.offset>n.getIndexWithinParent()&&(r.offset-=1)}function Ec(r,e,t,n,s,o,i){const l=n.anchorNode,a=n.focusNode,u=n.anchorOffset,c=n.focusOffset,d=document.activeElement;if(s.has("collaboration")&&d!==o||d!==null&&bi(d))return;if(!M(e))return void(r!==null&&cn(t,l,a)&&n.removeAllRanges());const f=e.anchor,h=e.focus,p=f.key,m=h.key,b=Un(t,p),D=Un(t,m),y=f.offset,A=h.offset,_=e.format,E=e.style,C=e.isCollapsed();let v=b,S=D,k=!1;if(f.type==="text"){v=In(b);const P=f.getNode();k=P.getFormat()!==_||P.getStyle()!==E}else M(r)&&r.anchor.type==="text"&&(k=!0);var q,B,F,j,L;if(h.type==="text"&&(S=In(D)),v!==null&&S!==null&&(C&&(r===null||k||M(r)&&(r.format!==_||r.style!==E))&&(q=_,B=E,F=y,j=p,L=performance.now(),Vl=[q,B,F,j,L]),u!==y||c!==A||l!==v||a!==S||n.type==="Range"&&C||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{n.setBaseAndExtent(v,y,S,A)}catch{}if(!s.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const P=e instanceof Ht&&e.anchor.type==="element"?v.childNodes[y]||null:n.rangeCount>0?n.getRangeAt(0):null;if(P!==null){let Z;if(P instanceof Text){const ue=document.createRange();ue.selectNode(P),Z=ue.getBoundingClientRect()}else Z=P.getBoundingClientRect();(function(ue,fe,we){const Ae=we.ownerDocument,Ve=Ae.defaultView;if(Ve===null)return;let{top:qe,bottom:$e}=fe,Be=0,Re=0,he=we;for(;he!==null;){const Ie=he===Ae.body;if(Ie)Be=0,Re=as(ue).innerHeight;else{const ge=he.getBoundingClientRect();Be=ge.top,Re=ge.bottom}let Ne=0;if(qe<Be?Ne=-(Be-qe):$e>Re&&(Ne=$e-Re),Ne!==0)if(Ie)Ve.scrollBy(0,Ne);else{const ge=he.scrollTop;he.scrollTop+=Ne;const He=he.scrollTop-ge;qe-=He,$e-=He}if(Ie)break;he=dn(he)}})(t,Z,o)}}Js=!0}}function na(r){let e=V()||gn();e===null&&(e=xe().selectEnd()),e.insertNodes(r)}function Fs(r){let e=r;r.isCollapsed()||e.removeText();const t=V();M(t)&&(e=t),M(e)||I(161);const n=e.anchor;let s=n.getNode(),o=n.offset;for(;!It(s);)[s,o]=kc(s,o);return o}function kc(r,e){const t=r.getParent();if(!t){const s=Se();return xe().append(s),s.select(),[xe(),0]}if(U(r)){const s=r.splitText(e);if(s.length===0)return[t,r.getIndexWithinParent()];const o=e===0?0:1;return[t,s[0].getIndexWithinParent()+o]}if(!N(r)||e===0)return[t,r.getIndexWithinParent()];const n=r.getChildAtIndex(e);if(n){const s=new Ht(St(r.__key,e,"element"),St(r.__key,e,"element"),0,""),o=r.insertNewAfter(s);o&&o.append(n,...n.getNextSiblings())}return[t,r.getIndexWithinParent()+1]}let Le=null,je=null,Ze=!1,Ls=!1,Fn=0;const wo={characterData:!0,childList:!0,subtree:!0};function mn(){return Ze||Le!==null&&Le._readOnly}function Xe(){Ze&&I(13)}function sa(){Fn>99&&I(14)}function Rt(){return Le===null&&I(195,ia()),Le}function ve(){return je===null&&I(196,ia()),je}function ia(){let r=0;const e=new Set,t=hs.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const o=is(s);if(_i(o))r++;else if(o){let i=String(o.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let n=` Detected on the page: ${r} compatible editor(s) with version ${t}`;return e.size&&(n+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),n}function Tc(){return je}function Do(r,e,t){const n=e.__type,s=function(l,a){const u=l._nodes.get(a);return u===void 0&&I(30,a),u}(r,n);let o=t.get(n);o===void 0&&(o=Array.from(s.transforms),t.set(n,o));const i=o.length;for(let l=0;l<i&&(o[l](e),e.isAttached());l++);}function So(r,e){return r!==void 0&&r.__key!==e&&r.isAttached()}function oa(r,e){if(!e)return;const t=r._updateTags;let n=e;Array.isArray(e)||(n=[e]);for(const s of n)t.add(s)}function Bc(r){return Bi(r,ve()._nodes)}function Bi(r,e){const t=r.type,n=e.get(t);n===void 0&&I(17,t);const s=n.klass;r.type!==s.getType()&&I(18,s.name);const o=s.importJSON(r),i=r.children;if(N(o)&&Array.isArray(i))for(let l=0;l<i.length;l++){const a=Bi(i[l],e);o.append(a)}return o}function Ao(r,e,t){const n=Le,s=Ze,o=je;Le=e,Ze=!0,je=r;try{return t()}finally{Le=n,Ze=s,je=o}}function Ut(r,e){const t=r._pendingEditorState,n=r._rootElement,s=r._headless||n===null;if(t===null)return;const o=r._editorState,i=o._selection,l=t._selection,a=r._dirtyType!==nr,u=Le,c=Ze,d=je,f=r._updating,h=r._observer;let p=null;if(r._pendingEditorState=null,r._editorState=t,!s&&a&&h!==null){je=r,Le=t,Ze=!1,r._updating=!0;try{const C=r._dirtyType,v=r._dirtyElements,S=r._dirtyLeaves;h.disconnect(),p=mc(o,t,r,C,v,S)}catch(C){if(C instanceof Error&&r._onError(C),Ls)throw C;return da(r,null,n,t),El(r),r._dirtyType=wr,Ls=!0,Ut(r,o),void(Ls=!1)}finally{h.observe(n,wo),r._updating=f,Le=u,Ze=c,je=d}}t._readOnly||(t._readOnly=!0);const m=r._dirtyLeaves,b=r._dirtyElements,D=r._normalizedNodes,y=r._updateTags,A=r._deferred;a&&(r._dirtyType=nr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set,r._updateTags=new Set),function(C,v){const S=C._decorators;let k=C._pendingDecorators||S;const q=v._nodeMap;let B;for(B in k)q.has(B)||(k===S&&(k=Fl(C)),delete k[B])}(r,t);const _=s?null:ut(r._window);if(r._editable&&_!==null&&(a||l===null||l.dirty)){je=r,Le=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const C=r._blockCursorElement;C!==null&&Si(C,r,n),Ec(i,l,r,_,y,n)}ac(r,n,l),h!==null&&h.observe(n,wo)}finally{je=d,Le=u}}p!==null&&function(C,v,S,k,q){const B=Array.from(C._listeners.mutation),F=B.length;for(let j=0;j<F;j++){const[L,P]=B[j],Z=v.get(P);Z!==void 0&&L(Z,{dirtyLeaves:k,prevEditorState:q,updateTags:S})}}(r,p,y,m,o),M(l)||l===null||i!==null&&i.is(l)||r.dispatchCommand(oi,void 0);const E=r._pendingDecorators;E!==null&&(r._decorators=E,r._pendingDecorators=null,Yr("decorator",r,!0,E)),function(C,v,S){const k=Yi(v),q=Yi(S);k!==q&&Yr("textcontent",C,!0,q)}(r,e||o,t),Yr("update",r,!0,{dirtyElements:b,dirtyLeaves:m,editorState:t,normalizedNodes:D,prevEditorState:e||o,tags:y}),function(C,v){if(C._deferred=[],v.length!==0){const S=C._updating;C._updating=!0;try{for(let k=0;k<v.length;k++)v[k]()}finally{C._updating=S}}}(r,A),function(C){const v=C._updates;if(v.length!==0){const S=v.shift();if(S){const[k,q]=S;aa(C,k,q)}}}(r)}function Yr(r,e,t,...n){const s=e._updating;e._updating=t;try{const o=Array.from(e._listeners[r]);for(let i=0;i<o.length;i++)o[i].apply(null,n)}finally{e._updating=s}}function la(r,e,t){if(r._updating===!1||je!==r){let s=!1;return r.update(()=>{s=la(r,e,t)}),s}const n=vi(r);for(let s=4;s>=0;s--)for(let o=0;o<n.length;o++){const i=n[o]._commands.get(e);if(i!==void 0){const l=i[s];if(l!==void 0){const a=Array.from(l),u=a.length;for(let c=0;c<u;c++)if(a[c](t,r)===!0)return!0}}}return!1}function Eo(r,e){const t=r._updates;let n=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[o,i]=s;let l;if(i!==void 0){if(l=i.onUpdate,i.skipTransforms&&(n=!0),i.discrete){const a=r._pendingEditorState;a===null&&I(191),a._flushSync=!0}l&&r._deferred.push(l),oa(r,i.tag)}o()}}return n}function aa(r,e,t){const n=r._updateTags;let s,o=!1,i=!1;t!==void 0&&(s=t.onUpdate,oa(r,t.tag),o=t.skipTransforms||!1,i=t.discrete||!1),s&&r._deferred.push(s);const l=r._editorState;let a=r._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=r._pendingEditorState=ua(a||l),u=!0),a._flushSync=i;const c=Le,d=Ze,f=je,h=r._updating;Le=a,Ze=!1,r._updating=!0,je=r;try{u&&(r._headless?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=function(D){const y=D.getEditorState()._selection,A=ut(D._window);return M(y)||y==null?Ti(y,A,D,null):y.clone()}(r));const m=r._compositionKey;e(),o=Eo(r,o),function(D,y){const A=y.getEditorState()._selection,_=D._selection;if(M(_)){const E=_.anchor,C=_.focus;let v;if(E.type==="text"&&(v=E.getNode(),v.selectionTransform(A,_)),C.type==="text"){const S=C.getNode();v!==S&&S.selectionTransform(A,_)}}}(a,r),r._dirtyType!==nr&&(o?function(D,y){const A=y._dirtyLeaves,_=D._nodeMap;for(const E of A){const C=_.get(E);U(C)&&C.isAttached()&&C.isSimpleText()&&!C.isUnmergeable()&&Ji(C)}}(a,r):function(D,y){const A=y._dirtyLeaves,_=y._dirtyElements,E=D._nodeMap,C=qt(),v=new Map;let S=A,k=S.size,q=_,B=q.size;for(;k>0||B>0;){if(k>0){y._dirtyLeaves=new Set;for(const F of S){const j=E.get(F);U(j)&&j.isAttached()&&j.isSimpleText()&&!j.isUnmergeable()&&Ji(j),j!==void 0&&So(j,C)&&Do(y,j,v),A.add(F)}if(S=y._dirtyLeaves,k=S.size,k>0){Fn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const F of q){const j=F[0],L=F[1];if(j!=="root"&&!L)continue;const P=E.get(j);P!==void 0&&So(P,C)&&Do(y,P,v),_.set(j,L)}S=y._dirtyLeaves,k=S.size,q=y._dirtyElements,B=q.size,Fn++}y._dirtyLeaves=A,y._dirtyElements=_}(a,r),Eo(r),function(D,y,A,_){const E=D._nodeMap,C=y._nodeMap,v=[];for(const[S]of _){const k=C.get(S);k!==void 0&&(k.isAttached()||(N(k)&&Ml(k,S,E,C,v,_),E.has(S)||_.delete(S),v.push(S)))}for(const S of v)C.delete(S);for(const S of A){const k=C.get(S);k===void 0||k.isAttached()||(E.has(S)||A.delete(S),C.delete(S))}}(l,a,r._dirtyLeaves,r._dirtyElements)),m!==r._compositionKey&&(a._flushSync=!0);const b=a._selection;if(M(b)){const D=a._nodeMap,y=b.anchor.key,A=b.focus.key;D.get(y)!==void 0&&D.get(A)!==void 0||I(19)}else _t(b)&&b._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&r._onError(m),r._pendingEditorState=l,r._dirtyType=wr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),void Ut(r)}finally{Le=c,Ze=d,je=f,r._updating=h,Fn=0}r._dirtyType!==nr||function(m,b){const D=b.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(D))return!0}else if(D!==null)return!0;return!1}(a,r)?a._flushSync?(a._flushSync=!1,Ut(r)):u&&rc(()=>{Ut(r)}):(a._flushSync=!1,u&&(n.clear(),r._deferred=[],r._pendingEditorState=null))}function st(r,e,t){r._updating?r._updates.push([e,t]):aa(r,e,t)}class Xr{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new Xr(this.element,e,this.after)}withAfter(e){return new Xr(this.element,this.before,e)}withElement(e){return new Xr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&I(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&I(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&I(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(an||ns);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const n=this.element,s=this.before,o=document.createElement("br");if(n.insertBefore(o,s),e){const i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",n.insertBefore(i,o),n.__lexicalLineBreak=i}else n.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,s){if(n===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,s))]}const o=ko(t,n);o.push(s);const i=ko(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<i.length;a++){const u=o[a],c=i[a];if(u===void 0||u<c)break;if(u>c){l+=1;break}}return[e.getParentOrThrow(),l]}}function ko(r,e){const t=[];let n=e;for(;n!==r&&n!==null;n=e.parentNode){let s=0;for(let o=n.previousSibling;o!==null;o=n.previousSibling)s++;t.push(s)}return n!==r&&I(225),t.reverse()}class Pt extends cs{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ku[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=ve()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(U(t)&&e.push(t),N(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;N(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;N(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const o=t[n-1];return N(o)&&o.getLastDescendant()||o||null}const s=t[e];return N(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:ze(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&I(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:ze(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&I(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,s;if(e<t/2){for(n=this.getFirstChild(),s=0;n!==null&&s<=e;){if(s===e)return n;n=n.getNextSibling(),s++}return null}for(n=this.getLastChild(),s=t-1;n!==null&&s>=e;){if(s===e)return n;n=n.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContent(),N(o)&&s!==n-1&&!o.isInline()&&(e+=Lt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContentSize(),N(o)&&s!==n-1&&!o.isInline()&&(e+=Lt.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ki[e];return!!(this.getFormat()&t)}return!1}select(e,t){Xe();const n=V();let s=e,o=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(U(a)||N(a))return a.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const a=this.getLastChild();if(U(a)||N(a))return a.select()}}s===void 0&&(s=i),o===void 0&&(o=i);const l=this.__key;return M(n)?(n.anchor.set(l,s,"element"),n.focus.set(l,o,"element"),n.dirty=!0,n):ra(l,s,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ki[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const s=n.length,o=this.getChildrenSize(),i=this.getWritable();e+t<=o||I(226,String(e),String(t),String(o));const l=i.__key,a=[],u=[],c=this.getChildAtIndex(e+t);let d=null,f=o-t+s;if(e!==0)if(e===o)d=this.getLastChild();else{const p=this.getChildAtIndex(e);p!==null&&(d=p.getPreviousSibling())}if(t>0){let p=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){p===null&&I(100);const b=p.getNextSibling(),D=p.__key;tr(p.getWritable()),u.push(D),p=b}}let h=d;for(let p=0;p<s;p++){const m=n[p];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const b=m.getWritable();b.__parent===l&&f--,tr(b);const D=m.__key;if(h===null)i.__first=D,b.__prev=null;else{const y=h.getWritable();y.__next=D,b.__prev=y.__key}m.__key===l&&I(76),b.__parent=l,a.push(D),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,i.__last=h.__key);else if(c!==null){const p=c.getWritable();if(h!==null){const m=h.getWritable();p.__prev=h.__key,m.__next=c.__key}else p.__prev=null}if(i.__size=f,u.length){const p=V();if(M(p)){const m=new Set(u),b=new Set(a),{anchor:D,focus:y}=p;To(D,m,b)&&Qn(D,D.getNode(),this,d,c),To(y,m,b)&&Qn(y,y.getNode(),this,d,c),f!==0||this.canBeEmpty()||Dt(this)||this.remove()}}return i}getDOMSlot(e){return new Xr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&jt(t)){const n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px")}return{element:t}}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let s=n.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const i=t.getElementByKey(o.getKey());i!==null&&(s==null?(n.insertChild(i),s=i):s!==i&&n.replaceChild(i,s),s=s.nextSibling)}}}function N(r){return r instanceof Pt}function To(r,e,t){let n=r.getNode();for(;n;){const s=n.__key;if(e.has(s)&&!t.has(s))return!0;n=n.getParent()}return!1}class Nc extends cs{constructor(e){super(e)}decorate(e,t){I(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function de(r){return r instanceof Nc}class yn extends Pt{static getType(){return"root"}static clone(){return new yn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){I(51)}getTextContent(){const e=this.__cachedText;return!mn()&&ve()._dirtyType!==nr||e===null?super.getTextContent():e}remove(){I(52)}replace(e){I(53)}insertBefore(e){I(54)}insertAfter(e){I(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];N(n)||de(n)||I(56)}return super.append(...e)}static importJSON(e){const t=xe();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Ge(r){return r instanceof yn}function ua(r){return new fs(new Map(r._nodeMap))}function Ni(){return new fs(new Map([["root",new yn]]))}function ca(r){const e=r.exportJSON(),t=r.constructor;if(e.type!==t.getType()&&I(130,t.name),N(r)){const n=e.children;Array.isArray(n)||I(59,t.name);const s=r.getChildren();for(let o=0;o<s.length;o++){const i=ca(s[o]);n.push(i)}}return e}class fs{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Ao(t&&t.editor||null,this,e)}clone(e){const t=new fs(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Ao(null,this,()=>({root:ca(xe())}))}}class Fi extends Pt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Er extends Pt{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=sr[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return zn(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Er(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Vr(e.theme,"paragraph");return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Fc,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&jt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Se();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Se();n.setTextFormat(e.format),n.setTextStyle(e.style);const s=this.getDirection();return n.setDirection(s),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(e.length===0||U(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Fc(r){const e=Se();return r.style&&(e.setFormat(r.style.textAlign),Ei(r,e)),{node:e}}function Se(){return At(new Er)}function Sr(r){return r instanceof Er}const ae=0,xr=1,Lc=4;function da(r,e,t,n){const s=r._keyToDOMMap;s.clear(),r._editorState=Ni(),r._pendingEditorState=n,r._compositionKey=null,r._dirtyType=nr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),r._normalizedNodes=new Set,r._updateTags=new Set,r._updates=[],r._blockCursorElement=null;const o=r._observer;o!==null&&(o.disconnect(),r._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function jc(r){const e=r||{},t=Tc(),n=e.theme||{},s=r===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,i=Ni(),l=e.namespace||(s!==null?s._config.namespace:Rl()),a=e.editorState,u=[yn,Ar,fn,hn,Er,Fi,...e.nodes||[]],{onError:c,html:d}=e,f=e.editable===void 0||e.editable;let h;if(r===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<u.length;m++){let b=u[m],D=null,y=null;if(typeof b!="function"){const C=b;b=C.replace,D=C.with,y=C.withKlass||null}const A=b.getType(),_=b.transform(),E=new Set;_!==null&&E.add(_),h.set(A,{exportDOM:d&&d.export?d.export.get(b):void 0,klass:b,replace:D,replaceWithKlass:y,transforms:E})}}const p=new hs(i,s,h,{disableEvents:o,namespace:l,theme:n},c||console.error,function(m,b){const D=new Map,y=new Set,A=_=>{Object.keys(_).forEach(E=>{let C=D.get(E);C===void 0&&(C=[],D.set(E,C)),C.push(_[E])})};return m.forEach(_=>{const E=_.klass.importDOM;if(E==null||y.has(E))return;y.add(E);const C=E.call(_.klass);C!==null&&A(C)}),b&&A(b),D}(h,d?d.import:void 0),f);return a!==void 0&&(p._pendingEditorState=a,p._dirtyType=wr),p}class hs{constructor(e,t,n,s,o,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=nr,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Rl(),this._onError=o,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&I(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=s.get(e);o===void 0&&I(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every(l=>l.size===0)&&s.delete(e)}}registerMutationListener(e,t,n){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,s);const i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,s),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&I(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,s=fc(n).get(t.getType());if(!s)return;const o=new Map;for(const i of s.keys())o.set(i,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),s=[n],o=n.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);s.push(a)}var i,l;return i=this,l=e.getType(),st(i,()=>{const a=Rt();if(a.isEmpty())return;if(l==="root")return void xe().markDirty();const u=a._nodeMap;for(const[,c]of u)c.markDirty()},i._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return G(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Vr(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,da(this,t,e,s),t!==null&&(this._config.disableEvents||yc(t),n!=null&&t.classList.remove(...n)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=wr,El(this),this._updateTags.add("history-merge"),Ut(this),this._config.disableEvents||function(l,a){const u=l.ownerDocument,c=Hn.get(u);(c===void 0||c<1)&&u.addEventListener("selectionchange",Yl),Hn.set(u,(c||0)+1),l.__lexicalEditor=a;const d=Ql(l);for(let f=0;f<Hs.length;f++){const[h,p]=Hs[f],m=typeof p=="function"?b=>{co(b)||(uo(b),(a.isEditable()||h==="click")&&p(b,a))}:b=>{if(co(b))return;uo(b);const D=a.isEditable();switch(h){case"cut":return D&&G(a,ui,b);case"copy":return G(a,rs,b);case"paste":return D&&G(a,ts,b);case"dragstart":return D&&G(a,bl,b);case"dragover":return D&&G(a,_l,b);case"dragend":return D&&G(a,Tu,b);case"focus":return D&&G(a,Fu,b);case"blur":return D&&G(a,Lu,b);case"drop":return D&&G(a,xl,b)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),n!=null&&e.classList.add(...n)}else this._editorState=s,this._pendingEditorState=null,this._window=null;Yr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&I(38);let n=e;n._readOnly&&(n=ua(e),n._selection=e._selection?e._selection.clone():null),Al(this);const s=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;s===null||s.isEmpty()||(i!=null&&o.add(i),Ut(this)),this._pendingEditorState=n,this._dirtyType=wr,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),this._updating||Ut(this)}parseEditorState(e,t){return function(n,s,o){const i=Ni(),l=Le,a=Ze,u=je,c=s._dirtyElements,d=s._dirtyLeaves,f=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Le=i,Ze=!1,je=s;try{const p=s._nodes;Bi(n.root,p),o&&o(),i._readOnly=!0}catch(p){p instanceof Error&&s._onError(p)}finally{s._dirtyElements=c,s._dirtyLeaves=d,s._cloneNotNeeded=f,s._dirtyType=h,Le=l,Ze=a,je=u}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ut(this),this.getEditorState().read(e,{editor:this})}update(e,t){st(this,e,t)}focus(e,t={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),st(this,()=>{const s=V(),o=xe();s!==null?s.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=ut(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Yr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}hs.version="0.21.0+prod.esm";const fa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Rc=fa?w.useLayoutEffect:w.useEffect,An={tag:"history-merge"};function Pc({initialConfig:r,children:e}){const t=w.useMemo(()=>{const{theme:n,namespace:s,nodes:o,onError:i,editorState:l,html:a}=r,u=bu(null,n),c=jc({editable:r.editable,html:a,namespace:s,nodes:o,onError:d=>i(d,c),theme:n});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=xe();if(h.isEmpty()){const p=Se();h.append(p);const m=fa?document.activeElement:null;(V()!==null||m!==null&&m===d.getRootElement())&&p.select()}},An);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,An);break}case"object":d.setEditorState(f,An);break;case"function":d.update(()=>{xe().isEmpty()&&f(d)},An)}}}(c,l),[c,u]},[]);return Rc(()=>{const n=r.editable,[s]=t;s.setEditable(n===void 0||n)},[]),g.jsx(ul.Provider,{value:t,children:e})}const Oc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Mc(r){return{initialValueFn:()=>r.isEditable(),subscribe:e=>r.registerEditableListener(e)}}function $c(){return function(r){const[e]=mt(),t=w.useMemo(()=>r(e),[e,r]),[n,s]=w.useState(()=>t.initialValueFn()),o=w.useRef(n);return Oc(()=>{const{initialValueFn:i,subscribe:l}=t,a=i();return o.current!==a&&(o.current=a,s(a)),l(u=>{o.current=u,s(u)})},[t,r]),n}(Mc)}function Ic(){return xe().getTextContent()}function zc(r,e=!0){if(r)return!1;let t=Ic();return e&&(t=t.trim()),t===""}function qc(r){if(!zc(r,!1))return!1;const e=xe().getChildren(),t=e.length;if(t>1)return!1;for(let n=0;n<t;n++){const s=e[n];if(de(s))return!1;if(N(s)){if(!Sr(s)||s.__indent!==0)return!1;const o=s.getChildren(),i=o.length;for(let l=0;l<i;l++){const a=o[n];if(!U(a))return!1}}}return!0}function ha(r){return()=>qc(r)}function Uc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}Uc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Wc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gc=Wc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Kc=new Map;function Vc(r){const e={};if(!r)return e;const t=r.split(";");for(const n of t)if(n!==""){const[s,o]=n.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function pa(r,e){const t=r.getStartEndPoints();if(e.isSelected(r)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[n,s]=t,o=r.isBackward(),i=n.getNode(),l=s.getNode(),a=e.is(i),u=e.is(l);if(a||u){const[c,d]=Xs(r),f=i.is(l),h=e.is(o?l:i),p=e.is(o?i:l);let m,b=0;return f?(b=c>d?d:c,m=c>d?c:d):h?(b=o?d:c,m=void 0):p&&(b=0,m=o?c:d),e.__text=e.__text.slice(b,m),e}}return e}function Hc(r){const e=r.getStyle(),t=Vc(e);Kc.set(e,t)}function Jc(r,e){if(r===null)return;const t=r.getStartEndPoints(),n=t?t[0]:null;if(n!==null&&n.key==="root"){const i=e(),l=xe(),a=l.getFirstChild();return void(a?a.replace(i,!0):l.append(i))}const s=r.getNodes(),o=n!==null&&function(i,l){let a=i;for(;a!==null&&a.getParent()!==null&&!l(a);)a=a.getParentOrThrow();return l(a)?a:null}(n.getNode(),Fo);o&&s.indexOf(o)===-1&&s.push(o);for(let i=0;i<s.length;i++){const l=s[i];if(!Fo(l))continue;N(l)||Gc(178);const a=e();a.setFormat(l.getFormatType()),a.setIndent(l.getIndent()),l.replace(a,!0)}}function Bo(r,e){const t=rn(r.focus,e);return de(t)&&!t.isIsolated()||N(t)&&!t.isInline()&&!t.canBeEmpty()}function Qc(r,e,t,n){r.modify(e?"extend":"move",t,n)}function Yc(r){const e=r.anchor.getNode();return(Ge(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function No(r,e,t){const n=Yc(r);Qc(r,e,t?!n:n,"character")}function Fo(r){if(de(r)||!N(r)||Dt(r))return!1;const e=r.getFirstChild(),t=e===null||rr(e)||U(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Xc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Zc=Xc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ga=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ed=ga&&"documentMode"in document?document.documentMode:null;!(!ga||!("InputEvent"in window)||ed)&&"getTargetRanges"in new window.InputEvent("input");function ma(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}function ar(...r){return()=>{for(let e=r.length-1;e>=0;e--)r[e]();r.length=0}}function xn(r,...e){const t=ma(...e);t.length>0&&r.classList.add(...t)}function ya(r,...e){const t=ma(...e);t.length>0&&r.classList.remove(...t)}function td(r,e){let t=r;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function rd(r){const e=ps(r,t=>N(t)&&!t.isInline());return N(e)||Zc(4,r.__key),e}const ps=(r,e)=>{let t=r;for(;t!==xe()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Wt(r,e){return r!==null&&Object.getPrototypeOf(r).constructor.name===e.name}function nd(r){const e=window.location.origin,t=n=>{if(n.origin!==e)return;const s=r.getRootElement();if(document.activeElement!==s)return;const o=n.data;if(typeof o=="string"){let i;try{i=JSON.parse(o)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const l=i.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[u,c,d,f,h,p]=a;r.update(()=>{const m=V();if(M(m)){const b=m.anchor;let D=b.getNode(),y=0,A=0;if(U(D)&&u>=0&&c>=0&&(y=u,A=u+c,m.setTextNodeRange(D,y,D,A)),y===A&&d===""||(m.insertRawText(d),D=b.getNode()),U(D)){y=f,A=f+h;const _=D.getTextContentSize();y=y>_?_:y,A=A>_?_:A,m.setTextNodeRange(D,y,D,A)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function xa(r,e){const t=e.body?e.body.childNodes:[];let n=[];const s=[];for(let o=0;o<t.length;o++){const i=t[o];if(!va.has(i.nodeName)){const l=Ca(i,r,s,!1);l!==null&&(n=n.concat(l))}}return function(o){for(const i of o)i.getNextSibling()instanceof Fi&&i.insertAfter(or());for(const i of o){const l=i.getChildren();for(const a of l)i.insertBefore(a);i.remove()}}(s),n}function ba(r,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),n=xe().getChildren();for(let s=0;s<n.length;s++)_a(r,n[s],t,e);return t.innerHTML}function _a(r,e,t,n=null){let s=n===null||e.isSelected(n);const o=N(e)&&e.excludeFromCopy("html");let i=e;if(n!==null){let h=Ai(e);h=U(h)&&n!==null?pa(n,h):h,i=h}const l=N(i)?i.getChildren():[],a=r._nodes.get(i.getType());let u;u=a&&a.exportDOM!==void 0?a.exportDOM(r,i):i.exportDOM(r);const{element:c,after:d}=u;if(!c)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const p=l[h],m=_a(r,p,f,n);!s&&N(e)&&m&&e.extractWithChild(p,n,"html")&&(s=!0)}if(s&&!o){if((jt(c)||so(c))&&c.append(f),t.append(c),d){const h=d.call(i,c);h&&(so(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(f);return s}const va=new Set(["STYLE","SCRIPT"]);function Ca(r,e,t,n,s=new Map,o){let i=[];if(va.has(r.nodeName))return i;let l=null;const a=function(p,m){const{nodeName:b}=p,D=m._htmlConversions.get(b.toLowerCase());let y=null;if(D!==void 0)for(const A of D){const _=A(p);_!==null&&(y===null||(y.priority||0)<=(_.priority||0))&&(y=_)}return y!==null?y.conversion:null}(r,e),u=a?a(r):null;let c=null;if(u!==null){c=u.after;const p=u.node;if(l=Array.isArray(p)?p[p.length-1]:p,l!==null){for(const[,m]of s)if(l=m(l,o),!l)break;l&&i.push(...Array.isArray(p)?p:[l])}u.forChild!=null&&s.set(r.nodeName,u.forChild)}const d=r.childNodes;let f=[];const h=(l==null||!Dt(l))&&(l!=null&&Zs(l)||n);for(let p=0;p<d.length;p++)f.push(...Ca(d[p],e,t,h,new Map(s),l));return c!=null&&(f=c(f)),Wn(r)&&(f=sd(r,f,h?()=>{const p=new Fi;return t.push(p),p}:Se)),l==null?f.length>0?i=i.concat(f):Wn(r)&&function(p){return p.nextSibling==null||p.previousSibling==null?!1:Is(p.nextSibling)&&Is(p.previousSibling)}(r)&&(i=i.concat(or())):N(l)&&l.append(...f),i}function sd(r,e,t){const n=r.style.textAlign,s=[];let o=[];for(let i=0;i<e.length;i++){const l=e[i];if(Zs(l))n&&!l.getFormat()&&l.setFormat(n),s.push(l);else if(o.push(l),i===e.length-1||i<e.length-1&&Zs(e[i+1])){const a=t();a.setFormat(n),a.append(...o),s.push(a),o=[]}}return s}function id(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Yn=id(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function od(r,e=V()){return e==null&&Yn(166),M(e)&&e.isCollapsed()||e.getNodes().length===0?"":ba(r,e)}function ld(r,e=V()){return e==null&&Yn(166),M(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ad(r,e))}function Lo(r,e,t){const n=r.getData("application/x-lexical-editor");if(n)try{const i=JSON.parse(n);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes))return jo(t,ud(i.nodes),e)}catch{}const s=r.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:a=>a}).createHTML(l):l}(s),"text/html");return jo(t,xa(t,i),e)}catch{}const o=r.getData("text/plain")||r.getData("text/uri-list");if(o!=null)if(M(e)){const i=o.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){const a=V();if(M(a)){const u=i[l];u===`
71
+ `?n.push(lr()):i===" "?n.push(gn()):n.push(ke(i))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,s=this.format,o=this.style;let i=t,l=n;!this.isCollapsed()&&n.isBefore(t)&&(i=n,l=t),i.type==="element"&&function(x,D,y,A){const C=x.getNode(),E=C.getChildAtIndex(x.offset),v=ke(),_=Ge(C)?Ee().append(v):v;v.setFormat(y),v.setStyle(A),E===null?C.append(_):E.insertBefore(_),x.is(D)&&D.set(v.__key,0,"text"),x.set(v.__key,0,"text")}(i,l,s,o);const a=i.offset;let u=l.offset;const c=this.getNodes(),d=c.length;let f=c[0];q(f)||I(26);const h=f.getTextContent().length,p=f.getParentOrThrow();let m=c[d-1];if(d===1&&l.type==="element"&&(u=h,l.set(i.key,u,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!p.canInsertTextAfter()&&f.getNextSibling()===null)){let x=f.getNextSibling();if(q(x)&&x.canInsertTextBefore()&&!Zt(x)||(x=ke(),x.setFormat(s),x.setStyle(o),p.canInsertTextAfter()?f.insertAfter(x):p.insertAfter(x)),x.select(0,0),f=x,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!p.canInsertTextBefore()&&f.getPreviousSibling()===null)){let x=f.getPreviousSibling();if(q(x)&&!Zt(x)||(x=ke(),x.setFormat(s),p.canInsertTextBefore()?f.insertBefore(x):p.insertBefore(x)),x.select(),f=x,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const x=ke(f.getTextContent());x.setFormat(s),f.replace(x),f=x}else if(!this.isCollapsed()&&e!==""){const x=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||F(x)&&(!x.canInsertTextBefore()||!x.canInsertTextAfter()))return this.insertText(""),ta(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const A=ke(e);return A.select(),void f.replace(A)}const x=f.getFormat(),D=f.getStyle();if(a!==u||x===s&&D===o){if(Dc(f)){const A=ke(e);return A.setFormat(s),A.setStyle(o),A.select(),void f.replace(A)}}else{if(f.getTextContent()!==""){const A=ke(e);if(A.setFormat(s),A.setStyle(o),A.select(),a===0)f.insertBefore(A,!1);else{const[C]=f.splitText(a);C.insertAfter(A,!1)}return void(A.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(s),f.setStyle(o)}const y=u-a;f=f.spliceText(a,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=x,this.style=D))}else{const x=new Set([...f.getParentKeys(),...m.getParentKeys()]),D=F(f)?f:f.getParentOrThrow();let y=F(m)?m:m.getParentOrThrow(),A=m;if(!D.is(y)&&y.isInline())do A=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(u!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<u)if(q(m)&&!m.isToken()&&u!==m.getTextContentSize()){if(m.isSegmented()){const S=ke(m.getTextContent());m.replace(S),m=S}Ge(l.getNode())||l.type!=="text"||(m=m.spliceText(0,u,"")),x.add(m.__key)}else{const S=m.getParentOrThrow();S.canBeEmpty()||S.getChildrenSize()!==1?m.remove():S.remove()}else x.add(m.__key);const C=y.getChildren(),E=new Set(c),v=D.is(y),_=D.isInline()&&f.getNextSibling()===null?D:f;for(let S=C.length-1;S>=0;S--){const T=C[S];if(T.is(f)||F(T)&&T.isParentOf(f))break;T.isAttached()&&(!E.has(T)||T.is(A)?v||_.insertAfter(T,!1):T.remove())}if(!v){let S=y,T=null;for(;S!==null;){const z=S.getChildren(),N=z.length;(N===0||z[N-1].is(T))&&(x.delete(S.__key),T=S),S=S.getParent()}}if(f.isToken())if(a===h)f.select();else{const S=ke(e);S.select(),f.replace(S)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let S=1;S<d;S++){const T=c[S],z=T.__key;x.has(z)||T.remove()}}}removeText(){if(this.isCollapsed())return;const{anchor:e,focus:t}=this,n=this.getNodes(),s=this.isBackward()?t:e,o=this.isBackward()?e:t;let i=s.getNode(),l=o.getNode();const a=Mr(i,zt),u=Mr(l,zt);q(i)&&i.isToken()&&s.offset<i.getTextContentSize()&&(s.offset=0),o.offset>0&&q(l)&&l.isToken()&&(o.offset=l.getTextContentSize()),n.forEach(d=>{Jr(i,d)||Jr(l,d)||d.getKey()===i.getKey()||d.getKey()===l.getKey()||d.remove()});const c=(d,f)=>{if(d.getTextContent()==="")d.remove();else if(f!==0&&Zt(d)){const h=ke(d.getTextContent());return h.setFormat(d.getFormat()),h.setStyle(d.getStyle()),d.replace(h)}};if(i===l&&q(i)){const d=Math.abs(t.offset-e.offset);return i.spliceText(s.offset,d,"",!0),void c(i,d)}if(q(i)){const d=i.getTextContentSize()-s.offset;i.spliceText(s.offset,d,""),i=c(i,d)||i}q(l)&&(l.spliceText(0,o.offset,""),l=c(l,o.offset)||l),i.isAttached()&&q(i)?i.selectEnd():l.isAttached()&&q(l)&&l.selectStart(),F(a)&&F(u)&&a!==u&&(a.append(...u.getChildren()),u.remove(),o.set(s.key,s.offset,s.type))}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Oe(null);const n=this.getNodes(),s=[];for(const C of n)q(C)&&s.push(C);const o=C=>{n.forEach(E=>{if(Er(E)){const v=E.getFormatFlags(e,C);E.setTextFormat(v)}})},i=s.length;if(i===0)return this.toggleFormat(e),Oe(null),void o(t);const l=this.anchor,a=this.focus,u=this.isBackward(),c=u?a:l,d=u?l:a;let f=0,h=s[0],p=c.type==="element"?0:c.offset;if(c.type==="text"&&p===h.getTextContentSize()&&(f=1,h=s[1],p=0),h==null)return;const m=h.getFormatFlags(e,t);o(m);const x=i-1;let D=s[x];const y=d.type==="text"?d.offset:D.getTextContentSize();if(h.is(D)){if(p===y)return;if(Zt(h)||p===0&&y===h.getTextContentSize())h.setFormat(m);else{const C=h.splitText(p,y),E=p===0?C[0]:C[1];E.setFormat(m),c.type==="text"&&c.set(E.__key,0,"text"),d.type==="text"&&d.set(E.__key,y-p,"text")}return void(this.format=m)}p===0||Zt(h)||([,h]=h.splitText(p),p=0),h.setFormat(m);const A=D.getFormatFlags(e,m);y>0&&(y===D.getTextContentSize()||Zt(D)||([D]=D.splitText(y)),D.setFormat(A));for(let C=f+1;C<x;C++){const E=s[C],v=E.getFormatFlags(e,A);E.setFormat(v)}c.type==="text"&&c.set(h.__key,p,"text"),d.type==="text"&&d.set(D.__key,y,"text"),this.format=m|A}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const p=K();return M(p)||I(134),p.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Mr(t,zt),s=e[e.length-1];if(F(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const p=Ls(this);n.splice(p,0,e),s.selectEnd()}return}if(!e.some(p=>(F(p)||de(p))&&!p.isInline())){F(n)||I(211,t.constructor.name,t.getType());const p=Ls(this);return n.splice(p,0,e),void s.selectEnd()}const o=function(p){const m=Ee();let x=null;for(let D=0;D<p.length;D++){const y=p[D],A=nr(y);if(A||de(y)&&y.isInline()||F(y)&&y.isInline()||q(y)||y.isParentRequired()){if(x===null&&(x=y.createParentElementNode(),m.append(x),A))continue;x!==null&&x.append(y)}else m.append(y),x=null}return m}(e),i=o.getLastDescendant(),l=o.getChildren(),a=!F(n)||!n.isEmpty()?this.insertParagraph():null,u=l[l.length-1];let c=l[0];var d;F(d=c)&&zt(d)&&!d.isEmpty()&&F(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(F(n)||I(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=l[1]),c&&(n===null&&I(212,t.constructor.name,t.getType()),function(p,m,x){const D=m.getParentOrThrow().getLastChild();let y=m;const A=[m];for(;y!==D;)y.getNextSibling()||I(140),y=y.getNextSibling(),A.push(y);let C=p;for(const E of A)C=C.insertAfter(E)}(n,c));const f=Mr(i,zt);a&&F(f)&&(a.canMergeWhenEmpty()||zt(u))&&(f.append(...a.getChildren()),a.remove()),F(n)&&n.isEmpty()&&n.remove(),i.selectEnd();const h=F(n)?n.getLastChild():null;nr(h)&&f!==n&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=Ee();return xe().splice(this.anchor.offset,0,[i]),i.select(),i}const e=Ls(this),t=Mr(this.anchor.getNode(),zt);F(t)||I(213);const n=t.getChildAtIndex(e),s=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...s),o.selectStart(),o):null}insertLineBreak(e){const t=lr();if(this.insertNodes([t]),e){const n=t.getParentOrThrow(),s=t.getIndexWithinParent();n.select(s,s)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,s=this.anchor,o=this.focus;let i=e[0],l=e[n];const[a,u]=Zs(this);if(t===0)return[];if(t===1){if(q(i)&&!this.isCollapsed()){const d=a>u?u:a,f=a>u?a:u,h=i.splitText(d,f),p=d===0?h[0]:h[1];return p!=null?[p]:[]}return[i]}const c=s.isBefore(o);if(q(i)){const d=c?a:u;d===i.getTextContentSize()?e.shift():d!==0&&([,i]=i.splitText(d),e[0]=i)}if(q(l)){const d=l.getTextContent().length,f=c?u:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[n]=l)}return e}modify(e,t,n){const s=this.focus,o=this.anchor,i=e==="move",l=nn(s,t);if(de(l)&&!l.isIsolated()){if(i&&l.isKeyboardSelectable()){const h=vo();return h.add(l.__key),void St(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(q(f)){const h=f.__key,p=t?f.getTextContent().length:0;return s.set(h,p,"text"),void(i&&o.set(h,p,"text"))}{const h=l.getParentOrThrow();let p,m;return F(f)?(m=f.__key,p=t?f.getChildrenSize():0):(p=l.getIndexWithinParent(),m=h.__key,t||p++),s.set(m,p,"element"),void(i&&o.set(m,p,"element"))}}const a=ve(),u=ut(a._window);if(!u)return;const c=a._blockCursorElement,d=a._rootElement;if(d===null||c===null||!F(l)||l.isInline()||l.canBeEmpty()||Ai(c,a,d),function(f,h,p,m){f.modify(h,p,m)}(u,e,t?"backward":"forward",n),u.rangeCount>0){const f=u.getRangeAt(0),h=this.anchor.getNode(),p=Ge(h)?h:lc(h);if(this.applyDOMRange(f),this.dirty=!0,!i){const m=this.getNodes(),x=[];let D=!1;for(let y=0;y<m.length;y++){const A=m[y];Jr(A,p)?x.push(A):D=!0}if(D&&x.length>0)if(t){const y=x[0];F(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=x[x.length-1];F(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}u.anchorNode===f.startContainer&&u.anchorOffset===f.startOffset||function(y){const A=y.focus,C=y.anchor,E=C.key,v=C.offset,_=C.type;qt(C,A.key,A.offset,A.type),qt(A,E,v,_),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&(e.type==="element"&&F(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),o=t.getNextSibling()||(s===null?null:s.getNextSibling());if(F(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let s=n.getNode();if(this.forwardDeletion(n,s,e))return;const o=this.focus,i=nn(o,e);if(de(i)&&!i.isIsolated()){if(i.isKeyboardSelectable()&&F(s)&&s.getChildrenSize()===0){s.remove();const l=vo();l.add(i.__key),St(l)}else i.remove(),ve().dispatchCommand(li,void 0);return}if(!e&&F(i)&&F(s)&&s.isEmpty())return s.remove(),void i.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&n.offset===0&&(n.type==="element"?n.getNode():n.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(s=n.type==="text"?n.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,u=l.getTextContentSize();if(l.is(s)||e&&a!==u||!e&&a!==0)return void xo(l,e,a)}else if(s!==null&&s.isSegmented()){const a=n.offset,u=s.getTextContentSize();if(s.is(l)||e&&a!==0||!e&&a!==u)return void xo(s,e,a)}(function(a,u){const c=a.anchor,d=a.focus,f=c.getNode(),h=d.getNode();if(f===h&&c.type==="text"&&d.type==="text"){const p=c.offset,m=d.offset,x=p<m,D=x?p:m,y=x?m:p,A=y-1;D!==A&&(Rl(f.getTextContent().slice(D,y))||(u?d.offset=A:c.offset=A))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const n=this.anchor.getNode();n.isEmpty()&&Ge(n.getParent())&&n.getIndexWithinParent()===0&&n.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),this.isCollapsed()&&this.anchor.offset===0&&this.modify("extend",e,"character"),t){const n=e?this.anchor:this.focus;n.set(n.key,n.offset+1,n.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ct(r){return r instanceof ds}function yo(r){const e=r.offset;if(r.type==="text")return e;const t=r.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Zs(r){const e=r.getStartEndPoints();if(e===null)return[0,0];const[t,n]=e;return t.type==="element"&&n.type==="element"&&t.key===n.key&&t.offset===n.offset?[0,0]:[yo(t),yo(n)]}function xo(r,e,t){const n=r,s=n.getTextContent().split(/(?=\s)/g),o=s.length;let i=0,l=0;for(let u=0;u<o;u++){const c=u===o-1;if(l=i,i+=s[u].length,e&&i===t||i>t||c){s.splice(u,1),c&&(l=void 0);break}}const a=s.join("").trim();a===""?n.remove():(n.setTextContent(a),n.select(l,l))}function bo(r,e,t,n){let s,o=e;if(r.nodeType===cn){let i=!1;const l=r.childNodes,a=l.length,u=n._blockCursorElement;o===a&&(i=!0,o=a-1);let c=l[o],d=!1;if(c===u)c=l[o+1],d=!0;else if(u!==null){const f=u.parentNode;r===f&&e>Array.prototype.indexOf.call(f.children,u)&&o--}if(s=br(c),q(s))o=Zi(s,i);else{let f=br(r);if(f===null)return null;if(F(f)){const h=n.getElementByKey(f.getKey());h===null&&I(214),[f,o]=f.getDOMSlot(h).resolveChildIndex(f,h,r,e),F(f)||I(215),i&&o>=f.getChildrenSize()&&(o=Math.max(0,f.getChildrenSize()-1));let m=f.getChildAtIndex(o);if(F(m)&&function(x,D,y){const A=x.getParent();return y===null||A===null||!A.canBeEmpty()||A!==y.getNode()}(m,0,t)){const x=i?m.getLastDescendant():m.getFirstDescendant();x===null?f=m:(m=x,f=F(m)?m:m.getParentOrThrow()),o=0}q(m)?(s=m,f=null,o=Zi(m,i)):m!==f&&i&&!d&&(F(f)||I(216),o=Math.min(f.getChildrenSize(),o+1))}else{const h=f.getIndexWithinParent();o=e===0&&de(f)&&br(r)===f?h:h+1,f=f.getParentOrThrow()}if(F(f))return Et(f.__key,o,"element")}}else s=br(r);return q(s)?Et(s.__key,o,"text"):null}function _o(r,e,t){const n=r.offset,s=r.getNode();if(n===0){const o=s.getPreviousSibling(),i=s.getParent();if(e){if((t||!e)&&o===null&&F(i)&&i.isInline()){const l=i.getPreviousSibling();q(l)&&(r.key=l.__key,r.offset=l.getTextContent().length)}}else F(o)&&!t&&o.isInline()?(r.key=o.__key,r.offset=o.getChildrenSize(),r.type="element"):q(o)&&(r.key=o.__key,r.offset=o.getTextContent().length)}else if(n===s.getTextContent().length){const o=s.getNextSibling(),i=s.getParent();if(e&&F(o)&&o.isInline())r.key=o.__key,r.offset=0,r.type="element";else if((t||e)&&o===null&&F(i)&&i.isInline()&&!i.canInsertTextAfter()){const l=i.getNextSibling();q(l)&&(r.key=l.__key,r.offset=0)}}}function ta(r,e,t){if(r.type==="text"&&e.type==="text"){const n=r.isBefore(e),s=r.is(e);_o(r,n,s),_o(e,!n,s),s&&(e.key=r.key,e.offset=r.offset,e.type=r.type);const o=ve();if(o.isComposing()&&o._compositionKey!==r.key&&M(t)){const i=t.anchor,l=t.focus;qt(r,i.key,i.offset,i.type),qt(e,l.key,l.offset,l.type)}}}function ra(r,e,t,n,s,o){if(r===null||t===null||!dn(s,r,t))return null;const i=bo(r,e,M(o)?o.anchor:null,s);if(i===null)return null;const l=bo(t,n,M(o)?o.focus:null,s);if(l===null)return null;if(i.type==="element"&&l.type==="element"){const a=br(r),u=br(t);if(de(a)&&de(u))return null}return ta(i,l,o),[i,l]}function ei(r){return F(r)&&!r.isInline()}function na(r,e,t,n,s,o){const i=Pt(),l=new Jt(Et(r,e,s),Et(t,n,o),0,"");return l.dirty=!0,i._selection=l,l}function Ac(){const r=Et("root",0,"element"),e=Et("root",0,"element");return new Jt(r,e,0,"")}function vo(){return new ds(new Set)}function Bi(r,e,t,n){const s=t._window;if(s===null)return null;const o=n||s.event,i=o?o.type:void 0,l=i==="selectionchange",a=!Is&&(l||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&o&&o.detail===3||i==="drop"||i===void 0);let u,c,d,f;if(M(r)&&!a)return r.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&M(r)&&!dn(t,u,c))return r.clone();const h=ra(u,d,c,f,t,r);if(h===null)return null;const[p,m]=h;return new Jt(p,m,M(r)?r.format:0,M(r)?r.style:"")}function K(){return Pt()._selection}function mn(){return ve()._editorState._selection}function Jn(r,e,t,n=1){const s=r.anchor,o=r.focus,i=s.getNode(),l=o.getNode();if(!e.is(i)&&!e.is(l))return;const a=e.__key;if(r.isCollapsed()){const u=s.offset;if(t<=u&&n>0||t<u&&n<0){const c=Math.max(0,u+n);s.set(a,c,"element"),o.set(a,c,"element"),Co(r)}}else{const u=r.isBackward(),c=u?o:s,d=c.getNode(),f=u?s:o,h=f.getNode();if(e.is(d)){const p=c.offset;(t<=p&&n>0||t<p&&n<0)&&c.set(a,Math.max(0,p+n),"element")}if(e.is(h)){const p=f.offset;(t<=p&&n>0||t<p&&n<0)&&f.set(a,Math.max(0,p+n),"element")}}Co(r)}function Co(r){const e=r.anchor,t=e.offset,n=r.focus,s=n.offset,o=e.getNode(),i=n.getNode();if(r.isCollapsed()){if(!F(o))return;const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(q(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),n.set(u.__key,c,"text")}}else{if(F(o)){const l=o.getChildrenSize(),a=t>=l,u=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(q(u)){let c=0;a&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(F(i)){const l=i.getChildrenSize(),a=s>=l,u=a?i.getChildAtIndex(l-1):i.getChildAtIndex(s);if(q(u)){let c=0;a&&(c=u.getTextContentSize()),n.set(u.__key,c,"text")}}}}function Qn(r,e,t,n,s){let o=null,i=0,l=null;n!==null?(o=n.__key,q(n)?(i=n.getTextContentSize(),l="text"):F(n)&&(i=n.getChildrenSize(),l="element")):s!==null&&(o=s.__key,q(s)?l="text":F(s)&&(l="element")),o!==null&&l!==null?r.set(o,i,l):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),r.set(t.__key,i,"element"))}function wo(r,e,t,n,s){r.type==="text"?(r.key=t,e||(r.offset+=s)):r.offset>n.getIndexWithinParent()&&(r.offset-=1)}function Ec(r,e,t,n,s,o,i){const l=n.anchorNode,a=n.focusNode,u=n.anchorOffset,c=n.focusOffset,d=document.activeElement;if(s.has("collaboration")&&d!==o||d!==null&&_i(d))return;if(!M(e))return void(r!==null&&dn(t,l,a)&&n.removeAllRanges());const f=e.anchor,h=e.focus,p=f.key,m=h.key,x=Un(t,p),D=Un(t,m),y=f.offset,A=h.offset,C=e.format,E=e.style,v=e.isCollapsed();let _=x,S=D,T=!1;if(f.type==="text"){_=In(x);const R=f.getNode();T=R.getFormat()!==C||R.getStyle()!==E}else M(r)&&r.anchor.type==="text"&&(T=!0);var z,N,L,P,j;if(h.type==="text"&&(S=In(D)),_!==null&&S!==null&&(v&&(r===null||T||M(r)&&(r.format!==C||r.style!==E))&&(z=C,N=E,L=y,P=p,j=performance.now(),Hl=[z,N,L,P,j]),u!==y||c!==A||l!==_||a!==S||n.type==="Range"&&v||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{n.setBaseAndExtent(_,y,S,A)}catch{}if(!s.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const R=e instanceof Jt&&e.anchor.type==="element"?_.childNodes[y]||null:n.rangeCount>0?n.getRangeAt(0):null;if(R!==null){let X;if(R instanceof Text){const ge=document.createRange();ge.selectNode(R),X=ge.getBoundingClientRect()}else X=R.getBoundingClientRect();(function(ge,ie,De){const Ce=De.ownerDocument,Ie=Ce.defaultView;if(Ie===null)return;let{top:ze,bottom:Me}=ie,Ve=0,be=0,he=De;for(;he!==null;){const Le=he===Ce.body;if(Le)Ve=0,be=as(ge).innerHeight;else{const me=he.getBoundingClientRect();Ve=me.top,be=me.bottom}let je=0;if(ze<Ve?je=-(Ve-ze):Me>be&&(je=Me-be),je!==0)if(Le)Ie.scrollBy(0,je);else{const me=he.scrollTop;he.scrollTop+=je;const He=he.scrollTop-me;ze-=He,Me-=He}if(Le)break;he=fn(he)}})(t,X,o)}}Qs=!0}}function sa(r){let e=K()||mn();e===null&&(e=xe().selectEnd()),e.insertNodes(r)}function Ls(r){let e=r;r.isCollapsed()||e.removeText();const t=K();M(t)&&(e=t),M(e)||I(161);const n=e.anchor;let s=n.getNode(),o=n.offset;for(;!zt(s);)[s,o]=kc(s,o);return o}function kc(r,e){const t=r.getParent();if(!t){const s=Ee();return xe().append(s),s.select(),[xe(),0]}if(q(r)){const s=r.splitText(e);if(s.length===0)return[t,r.getIndexWithinParent()];const o=e===0?0:1;return[t,s[0].getIndexWithinParent()+o]}if(!F(r)||e===0)return[t,r.getIndexWithinParent()];const n=r.getChildAtIndex(e);if(n){const s=new Jt(Et(r.__key,e,"element"),Et(r.__key,e,"element"),0,""),o=r.insertNewAfter(s);o&&o.append(n,...n.getNextSiblings())}return[t,r.getIndexWithinParent()+1]}let Ne=null,Fe=null,Ze=!1,js=!1,Fn=0;const Do={characterData:!0,childList:!0,subtree:!0};function yn(){return Ze||Ne!==null&&Ne._readOnly}function Xe(){Ze&&I(13)}function ia(){Fn>99&&I(14)}function Pt(){return Ne===null&&I(195,oa()),Ne}function ve(){return Fe===null&&I(196,oa()),Fe}function oa(){let r=0;const e=new Set,t=hs.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const o=is(s);if(vi(o))r++;else if(o){let i=String(o.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let n=` Detected on the page: ${r} compatible editor(s) with version ${t}`;return e.size&&(n+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),n}function Tc(){return Fe}function So(r,e,t){const n=e.__type,s=function(l,a){const u=l._nodes.get(a);return u===void 0&&I(30,a),u}(r,n);let o=t.get(n);o===void 0&&(o=Array.from(s.transforms),t.set(n,o));const i=o.length;for(let l=0;l<i&&(o[l](e),e.isAttached());l++);}function Ao(r,e){return r!==void 0&&r.__key!==e&&r.isAttached()}function la(r,e){if(!e)return;const t=r._updateTags;let n=e;Array.isArray(e)||(n=[e]);for(const s of n)t.add(s)}function Bc(r){return Ni(r,ve()._nodes)}function Ni(r,e){const t=r.type,n=e.get(t);n===void 0&&I(17,t);const s=n.klass;r.type!==s.getType()&&I(18,s.name);const o=s.importJSON(r),i=r.children;if(F(o)&&Array.isArray(i))for(let l=0;l<i.length;l++){const a=Ni(i[l],e);o.append(a)}return o}function Eo(r,e,t){const n=Ne,s=Ze,o=Fe;Ne=e,Ze=!0,Fe=r;try{return t()}finally{Ne=n,Ze=s,Fe=o}}function Wt(r,e){const t=r._pendingEditorState,n=r._rootElement,s=r._headless||n===null;if(t===null)return;const o=r._editorState,i=o._selection,l=t._selection,a=r._dirtyType!==sr,u=Ne,c=Ze,d=Fe,f=r._updating,h=r._observer;let p=null;if(r._pendingEditorState=null,r._editorState=t,!s&&a&&h!==null){Fe=r,Ne=t,Ze=!1,r._updating=!0;try{const v=r._dirtyType,_=r._dirtyElements,S=r._dirtyLeaves;h.disconnect(),p=mc(o,t,r,v,_,S)}catch(v){if(v instanceof Error&&r._onError(v),js)throw v;return fa(r,null,n,t),kl(r),r._dirtyType=Sr,js=!0,Wt(r,o),void(js=!1)}finally{h.observe(n,Do),r._updating=f,Ne=u,Ze=c,Fe=d}}t._readOnly||(t._readOnly=!0);const m=r._dirtyLeaves,x=r._dirtyElements,D=r._normalizedNodes,y=r._updateTags,A=r._deferred;a&&(r._dirtyType=sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set,r._updateTags=new Set),function(v,_){const S=v._decorators;let T=v._pendingDecorators||S;const z=_._nodeMap;let N;for(N in T)z.has(N)||(T===S&&(T=Ll(v)),delete T[N])}(r,t);const C=s?null:ut(r._window);if(r._editable&&C!==null&&(a||l===null||l.dirty)){Fe=r,Ne=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const v=r._blockCursorElement;v!==null&&Ai(v,r,n),Ec(i,l,r,C,y,n)}ac(r,n,l),h!==null&&h.observe(n,Do)}finally{Fe=d,Ne=u}}p!==null&&function(v,_,S,T,z){const N=Array.from(v._listeners.mutation),L=N.length;for(let P=0;P<L;P++){const[j,R]=N[P],X=_.get(R);X!==void 0&&j(X,{dirtyLeaves:T,prevEditorState:z,updateTags:S})}}(r,p,y,m,o),M(l)||l===null||i!==null&&i.is(l)||r.dispatchCommand(li,void 0);const E=r._pendingDecorators;E!==null&&(r._decorators=E,r._pendingDecorators=null,Xr("decorator",r,!0,E)),function(v,_,S){const T=Xi(_),z=Xi(S);T!==z&&Xr("textcontent",v,!0,z)}(r,e||o,t),Xr("update",r,!0,{dirtyElements:x,dirtyLeaves:m,editorState:t,normalizedNodes:D,prevEditorState:e||o,tags:y}),function(v,_){if(v._deferred=[],_.length!==0){const S=v._updating;v._updating=!0;try{for(let T=0;T<_.length;T++)_[T]()}finally{v._updating=S}}}(r,A),function(v){const _=v._updates;if(_.length!==0){const S=_.shift();if(S){const[T,z]=S;ua(v,T,z)}}}(r)}function Xr(r,e,t,...n){const s=e._updating;e._updating=t;try{const o=Array.from(e._listeners[r]);for(let i=0;i<o.length;i++)o[i].apply(null,n)}finally{e._updating=s}}function aa(r,e,t){if(r._updating===!1||Fe!==r){let s=!1;return r.update(()=>{s=aa(r,e,t)}),s}const n=Ci(r);for(let s=4;s>=0;s--)for(let o=0;o<n.length;o++){const i=n[o]._commands.get(e);if(i!==void 0){const l=i[s];if(l!==void 0){const a=Array.from(l),u=a.length;for(let c=0;c<u;c++)if(a[c](t,r)===!0)return!0}}}return!1}function ko(r,e){const t=r._updates;let n=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[o,i]=s;let l;if(i!==void 0){if(l=i.onUpdate,i.skipTransforms&&(n=!0),i.discrete){const a=r._pendingEditorState;a===null&&I(191),a._flushSync=!0}l&&r._deferred.push(l),la(r,i.tag)}o()}}return n}function ua(r,e,t){const n=r._updateTags;let s,o=!1,i=!1;t!==void 0&&(s=t.onUpdate,la(r,t.tag),o=t.skipTransforms||!1,i=t.discrete||!1),s&&r._deferred.push(s);const l=r._editorState;let a=r._pendingEditorState,u=!1;(a===null||a._readOnly)&&(a=r._pendingEditorState=ca(a||l),u=!0),a._flushSync=i;const c=Ne,d=Ze,f=Fe,h=r._updating;Ne=a,Ze=!1,r._updating=!0,Fe=r;try{u&&(r._headless?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=function(D){const y=D.getEditorState()._selection,A=ut(D._window);return M(y)||y==null?Bi(y,A,D,null):y.clone()}(r));const m=r._compositionKey;e(),o=ko(r,o),function(D,y){const A=y.getEditorState()._selection,C=D._selection;if(M(C)){const E=C.anchor,v=C.focus;let _;if(E.type==="text"&&(_=E.getNode(),_.selectionTransform(A,C)),v.type==="text"){const S=v.getNode();_!==S&&S.selectionTransform(A,C)}}}(a,r),r._dirtyType!==sr&&(o?function(D,y){const A=y._dirtyLeaves,C=D._nodeMap;for(const E of A){const v=C.get(E);q(v)&&v.isAttached()&&v.isSimpleText()&&!v.isUnmergeable()&&Qi(v)}}(a,r):function(D,y){const A=y._dirtyLeaves,C=y._dirtyElements,E=D._nodeMap,v=Ut(),_=new Map;let S=A,T=S.size,z=C,N=z.size;for(;T>0||N>0;){if(T>0){y._dirtyLeaves=new Set;for(const L of S){const P=E.get(L);q(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&Qi(P),P!==void 0&&Ao(P,v)&&So(y,P,_),A.add(L)}if(S=y._dirtyLeaves,T=S.size,T>0){Fn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const L of z){const P=L[0],j=L[1];if(P!=="root"&&!j)continue;const R=E.get(P);R!==void 0&&Ao(R,v)&&So(y,R,_),C.set(P,j)}S=y._dirtyLeaves,T=S.size,z=y._dirtyElements,N=z.size,Fn++}y._dirtyLeaves=A,y._dirtyElements=C}(a,r),ko(r),function(D,y,A,C){const E=D._nodeMap,v=y._nodeMap,_=[];for(const[S]of C){const T=v.get(S);T!==void 0&&(T.isAttached()||(F(T)&&$l(T,S,E,v,_,C),E.has(S)||C.delete(S),_.push(S)))}for(const S of _)v.delete(S);for(const S of A){const T=v.get(S);T===void 0||T.isAttached()||(E.has(S)||A.delete(S),v.delete(S))}}(l,a,r._dirtyLeaves,r._dirtyElements)),m!==r._compositionKey&&(a._flushSync=!0);const x=a._selection;if(M(x)){const D=a._nodeMap,y=x.anchor.key,A=x.focus.key;D.get(y)!==void 0&&D.get(A)!==void 0||I(19)}else Ct(x)&&x._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&r._onError(m),r._pendingEditorState=l,r._dirtyType=Sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),void Wt(r)}finally{Ne=c,Ze=d,Fe=f,r._updating=h,Fn=0}r._dirtyType!==sr||function(m,x){const D=x.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(D))return!0}else if(D!==null)return!0;return!1}(a,r)?a._flushSync?(a._flushSync=!1,Wt(r)):u&&rc(()=>{Wt(r)}):(a._flushSync=!1,u&&(n.clear(),r._deferred=[],r._pendingEditorState=null))}function nt(r,e,t){r._updating?r._updates.push([e,t]):ua(r,e,t)}class Zr{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new Zr(this.element,e,this.after)}withAfter(e){return new Zr(this.element,this.before,e)}withElement(e){return new Zr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&I(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&I(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&I(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(un||ns);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n=e.nodeName==="IMG"?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const n=this.element,s=this.before,o=document.createElement("br");if(n.insertBefore(o,s),e){const i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",n.insertBefore(i,o),n.__lexicalLineBreak=i}else n.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,s){if(n===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,s))]}const o=To(t,n);o.push(s);const i=To(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<i.length;a++){const u=o[a],c=i[a];if(u===void 0||u<c)break;if(u>c){l+=1;break}}return[e.getParentOrThrow(),l]}}function To(r,e){const t=[];let n=e;for(;n!==r&&n!==null;n=e.parentNode){let s=0;for(let o=n.previousSibling;o!==null;o=n.previousSibling)s++;t.push(s)}return n!==r&&I(225),t.reverse()}class Ot extends cs{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ku[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=ve()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(q(t)&&e.push(t),F(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;F(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;F(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const o=t[n-1];return F(o)&&o.getLastDescendant()||o||null}const s=t[e];return F(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:$e(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&I(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:$e(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&I(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,s;if(e<t/2){for(n=this.getFirstChild(),s=0;n!==null&&s<=e;){if(s===e)return n;n=n.getNextSibling(),s++}return null}for(n=this.getLastChild(),s=t-1;n!==null&&s>=e;){if(s===e)return n;n=n.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContent(),F(o)&&s!==n-1&&!o.isInline()&&(e+=jt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let s=0;s<n;s++){const o=t[s];e+=o.getTextContentSize(),F(o)&&s!==n-1&&!o.isInline()&&(e+=jt.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Vi[e];return!!(this.getFormat()&t)}return!1}select(e,t){Xe();const n=K();let s=e,o=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(q(a)||F(a))return a.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const a=this.getLastChild();if(q(a)||F(a))return a.select()}}s===void 0&&(s=i),o===void 0&&(o=i);const l=this.__key;return M(n)?(n.anchor.set(l,s,"element"),n.focus.set(l,o,"element"),n.dirty=!0,n):na(l,s,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Vi[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const s=n.length,o=this.getChildrenSize(),i=this.getWritable();e+t<=o||I(226,String(e),String(t),String(o));const l=i.__key,a=[],u=[],c=this.getChildAtIndex(e+t);let d=null,f=o-t+s;if(e!==0)if(e===o)d=this.getLastChild();else{const p=this.getChildAtIndex(e);p!==null&&(d=p.getPreviousSibling())}if(t>0){let p=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){p===null&&I(100);const x=p.getNextSibling(),D=p.__key;rr(p.getWritable()),u.push(D),p=x}}let h=d;for(let p=0;p<s;p++){const m=n[p];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const x=m.getWritable();x.__parent===l&&f--,rr(x);const D=m.__key;if(h===null)i.__first=D,x.__prev=null;else{const y=h.getWritable();y.__next=D,x.__prev=y.__key}m.__key===l&&I(76),x.__parent=l,a.push(D),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,i.__last=h.__key);else if(c!==null){const p=c.getWritable();if(h!==null){const m=h.getWritable();p.__prev=h.__key,m.__next=c.__key}else p.__prev=null}if(i.__size=f,u.length){const p=K();if(M(p)){const m=new Set(u),x=new Set(a),{anchor:D,focus:y}=p;Bo(D,m,x)&&Qn(D,D.getNode(),this,d,c),Bo(y,m,x)&&Qn(y,y.getNode(),this,d,c),f!==0||this.canBeEmpty()||At(this)||this.remove()}}return i}getDOMSlot(e){return new Zr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Rt(t)){const n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px")}return{element:t}}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let s=n.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const i=t.getElementByKey(o.getKey());i!==null&&(s==null?(n.insertChild(i),s=i):s!==i&&n.replaceChild(i,s),s=s.nextSibling)}}}function F(r){return r instanceof Ot}function Bo(r,e,t){let n=r.getNode();for(;n;){const s=n.__key;if(e.has(s)&&!t.has(s))return!0;n=n.getParent()}return!1}class Nc extends cs{constructor(e){super(e)}decorate(e,t){I(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function de(r){return r instanceof Nc}class xn extends Ot{static getType(){return"root"}static clone(){return new xn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){I(51)}getTextContent(){const e=this.__cachedText;return!yn()&&ve()._dirtyType!==sr||e===null?super.getTextContent():e}remove(){I(52)}replace(e){I(53)}insertBefore(e){I(54)}insertAfter(e){I(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];F(n)||de(n)||I(56)}return super.append(...e)}static importJSON(e){const t=xe();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Ge(r){return r instanceof xn}function ca(r){return new fs(new Map(r._nodeMap))}function Fi(){return new fs(new Map([["root",new xn]]))}function da(r){const e=r.exportJSON(),t=r.constructor;if(e.type!==t.getType()&&I(130,t.name),F(r)){const n=e.children;Array.isArray(n)||I(59,t.name);const s=r.getChildren();for(let o=0;o<s.length;o++){const i=da(s[o]);n.push(i)}}return e}class fs{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Eo(t&&t.editor||null,this,e)}clone(e){const t=new fs(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Eo(null,this,()=>({root:da(xe())}))}}class Li extends Ot{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Tr extends Ot{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ir[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return zn(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Tr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Hr(e.theme,"paragraph");return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Fc,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Rt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Ee();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Ee();n.setTextFormat(e.format),n.setTextStyle(e.style);const s=this.getDirection();return n.setDirection(s),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(e.length===0||q(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Fc(r){const e=Ee();return r.style&&(e.setFormat(r.style.textAlign),ki(r,e)),{node:e}}function Ee(){return kt(new Tr)}function Er(r){return r instanceof Tr}const ae=0,_r=1,Lc=4;function fa(r,e,t,n){const s=r._keyToDOMMap;s.clear(),r._editorState=Fi(),r._pendingEditorState=n,r._compositionKey=null,r._dirtyType=sr,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements.clear(),r._normalizedNodes=new Set,r._updateTags=new Set,r._updates=[],r._blockCursorElement=null;const o=r._observer;o!==null&&(o.disconnect(),r._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function jc(r){const e=r||{},t=Tc(),n=e.theme||{},s=r===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,i=Fi(),l=e.namespace||(s!==null?s._config.namespace:Pl()),a=e.editorState,u=[xn,kr,hn,pn,Tr,Li,...e.nodes||[]],{onError:c,html:d}=e,f=e.editable===void 0||e.editable;let h;if(r===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<u.length;m++){let x=u[m],D=null,y=null;if(typeof x!="function"){const v=x;x=v.replace,D=v.with,y=v.withKlass||null}const A=x.getType(),C=x.transform(),E=new Set;C!==null&&E.add(C),h.set(A,{exportDOM:d&&d.export?d.export.get(x):void 0,klass:x,replace:D,replaceWithKlass:y,transforms:E})}}const p=new hs(i,s,h,{disableEvents:o,namespace:l,theme:n},c||console.error,function(m,x){const D=new Map,y=new Set,A=C=>{Object.keys(C).forEach(E=>{let v=D.get(E);v===void 0&&(v=[],D.set(E,v)),v.push(C[E])})};return m.forEach(C=>{const E=C.klass.importDOM;if(E==null||y.has(E))return;y.add(E);const v=E.call(C.klass);v!==null&&A(v)}),x&&A(x),D}(h,d?d.import:void 0),f);return a!==void 0&&(p._pendingEditorState=a,p._dirtyType=Sr),p}class hs{constructor(e,t,n,s,o,i,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=sr,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Pl(),this._onError=o,this._htmlConversions=i,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){n===void 0&&I(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=s.get(e);o===void 0&&I(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every(l=>l.size===0)&&s.delete(e)}}registerMutationListener(e,t,n){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,s);const i=n&&n.skipInitialization;return i!==void 0&&i||this.initializeMutationListener(t,s),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&I(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,s=fc(n).get(t.getType());if(!s)return;const o=new Map;for(const i of s.keys())o.set(i,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),s=[n],o=n.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);s.push(a)}var i,l;return i=this,l=e.getType(),nt(i,()=>{const a=Pt();if(a.isEmpty())return;if(l==="root")return void xe().markDirty();const u=a._nodeMap;for(const[,c]of u)c.markDirty()},i._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{s.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return W(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Hr(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,fa(this,t,e,s),t!==null&&(this._config.disableEvents||yc(t),n!=null&&t.classList.remove(...n)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=Sr,kl(this),this._updateTags.add("history-merge"),Wt(this),this._config.disableEvents||function(l,a){const u=l.ownerDocument,c=Hn.get(u);(c===void 0||c<1)&&u.addEventListener("selectionchange",Xl),Hn.set(u,(c||0)+1),l.__lexicalEditor=a;const d=Yl(l);for(let f=0;f<Js.length;f++){const[h,p]=Js[f],m=typeof p=="function"?x=>{fo(x)||(co(x),(a.isEditable()||h==="click")&&p(x,a))}:x=>{if(fo(x))return;co(x);const D=a.isEditable();switch(h){case"cut":return D&&W(a,ci,x);case"copy":return W(a,rs,x);case"paste":return D&&W(a,ts,x);case"dragstart":return D&&W(a,_l,x);case"dragover":return D&&W(a,vl,x);case"dragend":return D&&W(a,Tu,x);case"focus":return D&&W(a,Fu,x);case"blur":return D&&W(a,Lu,x);case"drop":return D&&W(a,bl,x)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),n!=null&&e.classList.add(...n)}else this._editorState=s,this._pendingEditorState=null,this._window=null;Xr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&I(38);let n=e;n._readOnly&&(n=ca(e),n._selection=e._selection?e._selection.clone():null),El(this);const s=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;s===null||s.isEmpty()||(i!=null&&o.add(i),Wt(this)),this._pendingEditorState=n,this._dirtyType=Sr,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),this._updating||Wt(this)}parseEditorState(e,t){return function(n,s,o){const i=Fi(),l=Ne,a=Ze,u=Fe,c=s._dirtyElements,d=s._dirtyLeaves,f=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Ne=i,Ze=!1,Fe=s;try{const p=s._nodes;Ni(n.root,p),o&&o(),i._readOnly=!0}catch(p){p instanceof Error&&s._onError(p)}finally{s._dirtyElements=c,s._dirtyLeaves=d,s._cloneNotNeeded=f,s._dirtyType=h,Ne=l,Ze=a,Fe=u}return i}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Wt(this),this.getEditorState().read(e,{editor:this})}update(e,t){nt(this,e,t)}focus(e,t={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),nt(this,()=>{const s=K(),o=xe();s!==null?s.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=ut(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Xr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}hs.version="0.21.0+prod.esm";const ha=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Rc=ha?w.useLayoutEffect:w.useEffect,An={tag:"history-merge"};function Pc({initialConfig:r,children:e}){const t=w.useMemo(()=>{const{theme:n,namespace:s,nodes:o,onError:i,editorState:l,html:a}=r,u=bu(null,n),c=jc({editable:r.editable,html:a,namespace:s,nodes:o,onError:d=>i(d,c),theme:n});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=xe();if(h.isEmpty()){const p=Ee();h.append(p);const m=ha?document.activeElement:null;(K()!==null||m!==null&&m===d.getRootElement())&&p.select()}},An);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,An);break}case"object":d.setEditorState(f,An);break;case"function":d.update(()=>{xe().isEmpty()&&f(d)},An)}}}(c,l),[c,u]},[]);return Rc(()=>{const n=r.editable,[s]=t;s.setEditable(n===void 0||n)},[]),g.jsx(cl.Provider,{value:t,children:e})}const Oc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Mc(r){return{initialValueFn:()=>r.isEditable(),subscribe:e=>r.registerEditableListener(e)}}function $c(){return function(r){const[e]=yt(),t=w.useMemo(()=>r(e),[e,r]),[n,s]=w.useState(()=>t.initialValueFn()),o=w.useRef(n);return Oc(()=>{const{initialValueFn:i,subscribe:l}=t,a=i();return o.current!==a&&(o.current=a,s(a)),l(u=>{o.current=u,s(u)})},[t,r]),n}(Mc)}function Ic(){return xe().getTextContent()}function zc(r,e=!0){if(r)return!1;let t=Ic();return e&&(t=t.trim()),t===""}function qc(r){if(!zc(r,!1))return!1;const e=xe().getChildren(),t=e.length;if(t>1)return!1;for(let n=0;n<t;n++){const s=e[n];if(de(s))return!1;if(F(s)){if(!Er(s)||s.__indent!==0)return!1;const o=s.getChildren(),i=o.length;for(let l=0;l<i;l++){const a=o[n];if(!q(a))return!1}}}return!0}function pa(r){return()=>qc(r)}function Uc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}Uc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Wc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gc=Wc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Kc=new Map;function Vc(r){const e={};if(!r)return e;const t=r.split(";");for(const n of t)if(n!==""){const[s,o]=n.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function ga(r,e){const t=r.getStartEndPoints();if(e.isSelected(r)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[n,s]=t,o=r.isBackward(),i=n.getNode(),l=s.getNode(),a=e.is(i),u=e.is(l);if(a||u){const[c,d]=Zs(r),f=i.is(l),h=e.is(o?l:i),p=e.is(o?i:l);let m,x=0;return f?(x=c>d?d:c,m=c>d?c:d):h?(x=o?d:c,m=void 0):p&&(x=0,m=o?c:d),e.__text=e.__text.slice(x,m),e}}return e}function Hc(r){const e=r.getStyle(),t=Vc(e);Kc.set(e,t)}function Jc(r,e){if(r===null)return;const t=r.getStartEndPoints(),n=t?t[0]:null;if(n!==null&&n.key==="root"){const i=e(),l=xe(),a=l.getFirstChild();return void(a?a.replace(i,!0):l.append(i))}const s=r.getNodes(),o=n!==null&&function(i,l){let a=i;for(;a!==null&&a.getParent()!==null&&!l(a);)a=a.getParentOrThrow();return l(a)?a:null}(n.getNode(),Lo);o&&s.indexOf(o)===-1&&s.push(o);for(let i=0;i<s.length;i++){const l=s[i];if(!Lo(l))continue;F(l)||Gc(178);const a=e();a.setFormat(l.getFormatType()),a.setIndent(l.getIndent()),l.replace(a,!0)}}function No(r,e){const t=nn(r.focus,e);return de(t)&&!t.isIsolated()||F(t)&&!t.isInline()&&!t.canBeEmpty()}function Qc(r,e,t,n){r.modify(e?"extend":"move",t,n)}function Yc(r){const e=r.anchor.getNode();return(Ge(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function Fo(r,e,t){const n=Yc(r);Qc(r,e,t?!n:n,"character")}function Lo(r){if(de(r)||!F(r)||At(r))return!1;const e=r.getFirstChild(),t=e===null||nr(e)||q(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function Xc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Zc=Xc(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const ma=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ed=ma&&"documentMode"in document?document.documentMode:null;!(!ma||!("InputEvent"in window)||ed)&&"getTargetRanges"in new window.InputEvent("input");function ya(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}function ur(...r){return()=>{for(let e=r.length-1;e>=0;e--)r[e]();r.length=0}}function bn(r,...e){const t=ya(...e);t.length>0&&r.classList.add(...t)}function xa(r,...e){const t=ya(...e);t.length>0&&r.classList.remove(...t)}function td(r,e){let t=r;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function rd(r){const e=ps(r,t=>F(t)&&!t.isInline());return F(e)||Zc(4,r.__key),e}const ps=(r,e)=>{let t=r;for(;t!==xe()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Gt(r,e){return r!==null&&Object.getPrototypeOf(r).constructor.name===e.name}function nd(r){const e=window.location.origin,t=n=>{if(n.origin!==e)return;const s=r.getRootElement();if(document.activeElement!==s)return;const o=n.data;if(typeof o=="string"){let i;try{i=JSON.parse(o)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const l=i.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[u,c,d,f,h,p]=a;r.update(()=>{const m=K();if(M(m)){const x=m.anchor;let D=x.getNode(),y=0,A=0;if(q(D)&&u>=0&&c>=0&&(y=u,A=u+c,m.setTextNodeRange(D,y,D,A)),y===A&&d===""||(m.insertRawText(d),D=x.getNode()),q(D)){y=f,A=f+h;const C=D.getTextContentSize();y=y>C?C:y,A=A>C?C:A,m.setTextNodeRange(D,y,D,A)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function ba(r,e){const t=e.body?e.body.childNodes:[];let n=[];const s=[];for(let o=0;o<t.length;o++){const i=t[o];if(!Ca.has(i.nodeName)){const l=wa(i,r,s,!1);l!==null&&(n=n.concat(l))}}return function(o){for(const i of o)i.getNextSibling()instanceof Li&&i.insertAfter(lr());for(const i of o){const l=i.getChildren();for(const a of l)i.insertBefore(a);i.remove()}}(s),n}function _a(r,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),n=xe().getChildren();for(let s=0;s<n.length;s++)va(r,n[s],t,e);return t.innerHTML}function va(r,e,t,n=null){let s=n===null||e.isSelected(n);const o=F(e)&&e.excludeFromCopy("html");let i=e;if(n!==null){let h=Ei(e);h=q(h)&&n!==null?ga(n,h):h,i=h}const l=F(i)?i.getChildren():[],a=r._nodes.get(i.getType());let u;u=a&&a.exportDOM!==void 0?a.exportDOM(r,i):i.exportDOM(r);const{element:c,after:d}=u;if(!c)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const p=l[h],m=va(r,p,f,n);!s&&F(e)&&m&&e.extractWithChild(p,n,"html")&&(s=!0)}if(s&&!o){if((Rt(c)||io(c))&&c.append(f),t.append(c),d){const h=d.call(i,c);h&&(io(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(f);return s}const Ca=new Set(["STYLE","SCRIPT"]);function wa(r,e,t,n,s=new Map,o){let i=[];if(Ca.has(r.nodeName))return i;let l=null;const a=function(p,m){const{nodeName:x}=p,D=m._htmlConversions.get(x.toLowerCase());let y=null;if(D!==void 0)for(const A of D){const C=A(p);C!==null&&(y===null||(y.priority||0)<=(C.priority||0))&&(y=C)}return y!==null?y.conversion:null}(r,e),u=a?a(r):null;let c=null;if(u!==null){c=u.after;const p=u.node;if(l=Array.isArray(p)?p[p.length-1]:p,l!==null){for(const[,m]of s)if(l=m(l,o),!l)break;l&&i.push(...Array.isArray(p)?p:[l])}u.forChild!=null&&s.set(r.nodeName,u.forChild)}const d=r.childNodes;let f=[];const h=(l==null||!At(l))&&(l!=null&&ei(l)||n);for(let p=0;p<d.length;p++)f.push(...wa(d[p],e,t,h,new Map(s),l));return c!=null&&(f=c(f)),Wn(r)&&(f=sd(r,f,h?()=>{const p=new Li;return t.push(p),p}:Ee)),l==null?f.length>0?i=i.concat(f):Wn(r)&&function(p){return p.nextSibling==null||p.previousSibling==null?!1:zs(p.nextSibling)&&zs(p.previousSibling)}(r)&&(i=i.concat(lr())):F(l)&&l.append(...f),i}function sd(r,e,t){const n=r.style.textAlign,s=[];let o=[];for(let i=0;i<e.length;i++){const l=e[i];if(ei(l))n&&!l.getFormat()&&l.setFormat(n),s.push(l);else if(o.push(l),i===e.length-1||i<e.length-1&&ei(e[i+1])){const a=t();a.setFormat(n),a.append(...o),s.push(a),o=[]}}return s}function id(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Yn=id(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function od(r,e=K()){return e==null&&Yn(166),M(e)&&e.isCollapsed()||e.getNodes().length===0?"":_a(r,e)}function ld(r,e=K()){return e==null&&Yn(166),M(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ad(r,e))}function jo(r,e,t){const n=r.getData("application/x-lexical-editor");if(n)try{const i=JSON.parse(n);if(i.namespace===t._config.namespace&&Array.isArray(i.nodes))return Ro(t,ud(i.nodes),e)}catch{}const s=r.getData("text/html");if(s)try{const i=new DOMParser().parseFromString(function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:a=>a}).createHTML(l):l}(s),"text/html");return Ro(t,ba(t,i),e)}catch{}const o=r.getData("text/plain")||r.getData("text/uri-list");if(o!=null)if(M(e)){const i=o.split(/(\r?\n|\t)/);i[i.length-1]===""&&i.pop();for(let l=0;l<i.length;l++){const a=K();if(M(a)){const u=i[l];u===`
72
72
  `||u===`\r
73
- `?a.insertParagraph():u===" "?a.insertNodes([pn()]):a.insertText(u)}}}else e.insertRawText(o)}function jo(r,e,t){r.dispatchCommand(_u,{nodes:e,selection:t})||t.insertNodes(e)}function wa(r,e,t,n=[]){let s=e===null||t.isSelected(e);const o=N(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let u=Ai(t);u=U(u)&&e!==null?pa(e,u):u,i=u}const l=N(i)?i.getChildren():[],a=function(u){const c=u.exportJSON(),d=u.constructor;if(c.type!==d.getType()&&Yn(58,d.name),N(u)){const f=c.children;Array.isArray(f)||Yn(59,d.name)}return c}(i);if(U(i)){const u=i.__text;u.length>0?a.text=u:s=!1}for(let u=0;u<l.length;u++){const c=l[u],d=wa(r,e,c,a.children);!s&&N(t)&&d&&t.extractWithChild(c,e,"clone")&&(s=!0)}if(s&&!o)n.push(a);else if(Array.isArray(a.children))for(let u=0;u<a.children.length;u++){const c=a.children[u];n.push(c)}return s}function ad(r,e){const t=[],n=xe().getChildren();for(let s=0;s<n.length;s++)wa(r,e,n[s],t);return{namespace:r._config.namespace,nodes:t}}function ud(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t],s=Bc(n);U(s)&&Hc(s),e.push(s)}return e}let pr=null;async function Ro(r,e,t){if(pr!==null)return!1;if(e!==null)return new Promise((a,u)=>{r.update(()=>{a(Po(r,e,t))})});const n=r.getRootElement(),s=r._window==null?window.document:r._window.document,o=ut(r._window);if(n===null||o===null)return!1;const i=s.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(s.createTextNode("#")),n.append(i);const l=new Range;return l.setStart(i,0),l.setEnd(i,1),o.removeAllRanges(),o.addRange(l),new Promise((a,u)=>{const c=r.registerCommand(rs,d=>(Wt(d,ClipboardEvent)&&(c(),pr!==null&&(window.clearTimeout(pr),pr=null),a(Po(r,d,t))),!0),Lc);pr=window.setTimeout(()=>{c(),pr=null,a(!1)},50),s.execCommand("copy"),i.remove()})}function Po(r,e,t){if(t===void 0){const s=ut(r._window);if(!s)return!1;const o=s.anchorNode,i=s.focusNode;if(o!==null&&i!==null&&!cn(r,o,i))return!1;const l=V();if(l===null)return!1;t=dd(l)}e.preventDefault();const n=e.clipboardData;return n!==null&&(fd(n,t),!0)}const cd=[["text/html",od],["application/x-lexical-editor",ld]];function dd(r=V()){const e={"text/plain":r?r.getTextContent():""};if(r){const t=cc();for(const[n,s]of cd){const o=s(t,r);o!==null&&(e[n]=o)}}return e}function fd(r,e){for(const t in e){const n=e[t];n!==void 0&&r.setData(t,n)}}function Oo(r,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(r,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(r,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const kr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,hd=kr&&"documentMode"in document?document.documentMode:null,pd=!(!kr||!("InputEvent"in window)||hd)&&"getTargetRanges"in new window.InputEvent("input"),gd=kr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Mo=kr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,md=kr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yd=kr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!md,$o=ln();class gs extends Pt{static getType(){return"quote"}static clone(e){return new gs(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return xn(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:xd,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&jt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Li();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=Se(),s=this.getDirection();return n.setDirection(s),this.insertAfter(n,t),n}collapseAtStart(){const e=Se();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Li(){return At(new gs)}class ms extends Pt{static getType(){return"heading"}static clone(e){return new ms(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),s=e.theme.heading;if(s!==void 0){const o=s[t];xn(n,o)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:gr,priority:0}),h2:e=>({conversion:gr,priority:0}),h3:e=>({conversion:gr,priority:0}),h4:e=>({conversion:gr,priority:0}),h5:e=>({conversion:gr,priority:0}),h6:e=>({conversion:gr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Io(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Io(e)?{conversion:t=>({node:Ur("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&jt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Ur(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,s=this.getLastDescendant(),o=!s||e&&e.anchor.key===s.getKey()&&n===s.getTextContentSize()||!e?Se():Ur(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),n===0&&!this.isEmpty()&&e){const l=Se();l.select(),this.replace(l,!0)}return o}collapseAtStart(){const e=this.isEmpty()?Se():Ur(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function Io(r){return r.nodeName.toLowerCase()==="span"&&r.style.fontSize==="26pt"}function gr(r){const e=r.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Ur(e),r.style!==null&&(Ei(r,t),t.setFormat(r.style.textAlign))),{node:t}}function xd(r){const e=Li();return r.style!==null&&(e.setFormat(r.style.textAlign),Ei(r,e)),{node:e}}function Ur(r){return At(new ms(r))}function En(r){let e=null;if(Wt(r,DragEvent)?e=r.dataTransfer:Wt(r,ClipboardEvent)&&(e=r.clipboardData),e===null)return[!1,[],!1];const t=e.types,n=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[n,Array.from(e.files),s]}function zo(r){const e=V();if(!M(e))return!1;const t=new Set,n=e.getNodes();for(let s=0;s<n.length;s++){const o=n[s],i=o.getKey();if(t.has(i))continue;const l=ps(o,u=>N(u)&&!u.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),r(l))}return t.size>0}function kn(r){const e=Dr(r);return de(e)}function bd(r){return ar(r.registerCommand(cl,e=>{const t=V();return!!_t(t)&&(t.clear(),!0)},0),r.registerCommand(er,e=>{const t=V();return!!M(t)&&(t.deleteCharacter(e),!0)},ae),r.registerCommand(en,e=>{const t=V();return!!M(t)&&(t.deleteWord(e),!0)},ae),r.registerCommand(tn,e=>{const t=V();return!!M(t)&&(t.deleteLine(e),!0)},ae),r.registerCommand(_r,e=>{const t=V();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const n=e.dataTransfer;if(n!=null)Lo(n,t,r);else if(M(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},ae),r.registerCommand(Os,()=>{const e=V();return!!M(e)&&(e.removeText(),!0)},ae),r.registerCommand(pt,e=>{const t=V();return!!M(t)&&(t.formatText(e),!0)},ae),r.registerCommand(ku,e=>{const t=V();if(!M(t)&&!_t(t))return!1;const n=t.getNodes();for(const s of n){const o=ps(s,i=>N(i)&&!i.isInline());o!==null&&o.setFormat(e)}return!0},ae),r.registerCommand(br,e=>{const t=V();return!!M(t)&&(t.insertLineBreak(e),!0)},ae),r.registerCommand(Zr,()=>{const e=V();return!!M(e)&&(e.insertParagraph(),!0)},ae),r.registerCommand(Au,()=>(na([pn()]),!0),ae),r.registerCommand(Eu,()=>zo(e=>{const t=e.getIndent();e.setIndent(t+1)}),ae),r.registerCommand(Gi,()=>zo(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),ae),r.registerCommand(hl,e=>{const t=V();if(_t(t)&&!kn(e.target)){const n=t.getNodes();if(n.length>0)return n[0].selectPrevious(),!0}else if(M(t)){const n=rn(t.focus,!0);if(!e.shiftKey&&de(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},ae),r.registerCommand(pl,e=>{const t=V();if(_t(t)){const n=t.getNodes();if(n.length>0)return n[0].selectNext(0,0),!0}else if(M(t)){if(function(s){const o=s.focus;return o.key==="root"&&o.offset===xe().getChildrenSize()}(t))return e.preventDefault(),!0;const n=rn(t.focus,!1);if(!e.shiftKey&&de(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},ae),r.registerCommand(fl,e=>{const t=V();if(_t(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!M(t))return!1;if(Bo(t,!0)){const n=e.shiftKey;return e.preventDefault(),No(t,n,!0),!0}return!1},ae),r.registerCommand(dl,e=>{const t=V();if(_t(t)&&!kn(e.target)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),s[0].selectNext(0,0),!0}if(!M(t))return!1;const n=e.shiftKey;return!!Bo(t,!1)&&(e.preventDefault(),No(t,n,!1),!0)},ae),r.registerCommand(gl,e=>{if(kn(e.target))return!1;const t=V();if(!M(t))return!1;const{anchor:n}=t,s=n.getNode();return t.isCollapsed()&&n.offset===0&&!Ge(s)&&rd(s).getIndent()>0?(e.preventDefault(),r.dispatchCommand(Gi,void 0)):(!Mo||navigator.language!=="ko-KR")&&(e.preventDefault(),r.dispatchCommand(er,!0))},ae),r.registerCommand(yl,e=>{if(kn(e.target))return!1;const t=V();return!!M(t)&&(e.preventDefault(),r.dispatchCommand(er,!1))},ae),r.registerCommand(Rn,e=>{const t=V();if(!M(t))return!1;if(e!==null){if((Mo||gd||yd)&&pd)return!1;if(e.preventDefault(),e.shiftKey)return r.dispatchCommand(br,!1)}return r.dispatchCommand(Zr,void 0)},ae),r.registerCommand(ml,()=>{const e=V();return!!M(e)&&(r.blur(),!0)},ae),r.registerCommand(xl,e=>{const[,t]=En(e);if(t.length>0){const s=Oo(e.clientX,e.clientY);if(s!==null){const{offset:o,node:i}=s,l=Dr(i);if(l!==null){const a=Ac();if(U(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const c=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(c,d,"element"),a.focus.set(c,d,"element")}const u=kl(a);wt(u)}r.dispatchCommand($o,t)}return e.preventDefault(),!0}const n=V();return!!M(n)},ae),r.registerCommand(bl,e=>{const[t]=En(e),n=V();return!(t&&!M(n))},ae),r.registerCommand(_l,e=>{const[t]=En(e),n=V();if(t&&!M(n))return!1;const s=Oo(e.clientX,e.clientY);if(s!==null){const o=Dr(s.node);de(o)&&e.preventDefault()}return!0},ae),r.registerCommand(Ms,()=>(oc(),!0),ae),r.registerCommand(rs,e=>(Ro(r,Wt(e,ClipboardEvent)?e:null),!0),ae),r.registerCommand(ui,e=>(async function(t,n){await Ro(n,Wt(t,ClipboardEvent)?t:null),n.update(()=>{const s=V();M(s)?s.removeText():_t(s)&&s.getNodes().forEach(o=>o.remove())})}(e,r),!0),ae),r.registerCommand(ts,e=>{const[,t,n]=En(e);return t.length>0&&!n?(r.dispatchCommand($o,t),!0):bi(e.target)?!1:V()!==null&&(function(s,o){s.preventDefault(),o.update(()=>{const i=V(),l=Wt(s,InputEvent)||Wt(s,KeyboardEvent)?null:s.clipboardData;l!=null&&i!==null&&Lo(l,i,o)},{tag:"paste"})}(e,r),!0)},ae))}const ei=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function qo(r){return r.getEditorState().read(ha(r.isComposing()))}function _d({contentEditable:r,placeholder:e=null,ErrorBoundary:t}){const[n]=mt(),s=function(o,i){const[l,a]=w.useState(()=>o.getDecorators());return ei(()=>o.registerDecoratorListener(u=>{Ri.flushSync(()=>{a(u)})}),[o]),w.useEffect(()=>{a(o.getDecorators())},[o]),w.useMemo(()=>{const u=[],c=Object.keys(l);for(let d=0;d<c.length;d++){const f=c[d],h=g.jsx(i,{onError:m=>o._onError(m),children:g.jsx(w.Suspense,{fallback:null,children:l[f]})}),p=o.getElementByKey(f);p!==null&&u.push(Ri.createPortal(h,p,f))}return u},[i,l,o])}(n,t);return function(o){ei(()=>ar(bd(o),nd(o)),[o])}(n),g.jsxs(g.Fragment,{children:[r,g.jsx(vd,{content:e}),s]})}function vd({content:r}){const[e]=mt(),t=function(s){const[o,i]=w.useState(()=>qo(s));return ei(()=>{function l(){const a=qo(s);i(a)}return l(),ar(s.registerUpdateListener(()=>{l()}),s.registerEditableListener(()=>{l()}))},[s]),o}(e),n=$c();return t?typeof r=="function"?r(n):r:null}const Da=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Cd({editor:r,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaErrorMessage:o,ariaExpanded:i,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:d,ariaRequired:f,autoCapitalize:h,className:p,id:m,role:b="textbox",spellCheck:D=!0,style:y,tabIndex:A,"data-testid":_,...E},C){const[v,S]=w.useState(r.isEditable()),k=w.useCallback(B=>{B&&B.ownerDocument&&B.ownerDocument.defaultView?r.setRootElement(B):r.setRootElement(null)},[r]),q=w.useMemo(()=>function(...B){return F=>{B.forEach(j=>{typeof j=="function"?j(F):j!=null&&(j.current=F)})}}(C,k),[k,C]);return Da(()=>(S(r.isEditable()),r.registerEditableListener(B=>{S(B)})),[r]),g.jsx("div",{"aria-activedescendant":v?e:void 0,"aria-autocomplete":v?t:"none","aria-controls":v?n:void 0,"aria-describedby":s,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":v&&b==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":u,"aria-multiline":c,"aria-owns":v?d:void 0,"aria-readonly":!v||void 0,"aria-required":f,autoCapitalize:h,className:p,contentEditable:v,"data-testid":_,id:m,ref:q,role:v?b:void 0,spellCheck:D,style:y,tabIndex:A,...E})}const wd=w.forwardRef(Cd);function Uo(r){return r.getEditorState().read(ha(r.isComposing()))}const Dd=w.forwardRef(Sd);function Sd(r,e){const{placeholder:t,...n}=r,[s]=mt();return g.jsxs(g.Fragment,{children:[g.jsx(wd,{editor:s,...n,ref:e}),t!=null&&g.jsx(Ad,{editor:s,content:t})]})}function Ad({content:r,editor:e}){const t=function(i){const[l,a]=w.useState(()=>Uo(i));return Da(()=>{function u(){const c=Uo(i);a(c)}return u(),ar(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),l}(e),[n,s]=w.useState(e.isEditable());if(w.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(i=>{s(i)})),[e]),!t)return null;let o=null;return typeof r=="function"?o=r(n):r!==null&&(o=r),o===null?null:g.jsx("div",{"aria-hidden":!0,children:o})}const Tn=0,ti=1,ri=2,ht=0,Ed=1,Wo=2,kd=3,Td=4;function Bd(r,e,t,n,s){if(r===null||t.size===0&&n.size===0&&!s)return ht;const o=e._selection,i=r._selection;if(s)return Ed;if(!(M(o)&&M(i)&&i.isCollapsed()&&o.isCollapsed()))return ht;const l=function(D,y,A){const _=D._nodeMap,E=[];for(const C of y){const v=_.get(C);v!==void 0&&E.push(v)}for(const[C,v]of A){if(!v)continue;const S=_.get(C);S===void 0||Ge(S)||E.push(S)}return E}(e,t,n);if(l.length===0)return ht;if(l.length>1){const D=e._nodeMap,y=D.get(o.anchor.key),A=D.get(i.anchor.key);return y&&A&&!r._nodeMap.has(y.__key)&&U(y)&&y.__text.length===1&&o.anchor.offset===1?Wo:ht}const a=l[0],u=r._nodeMap.get(a.__key);if(!U(u)||!U(a)||u.__mode!==a.__mode)return ht;const c=u.__text,d=a.__text;if(c===d)return ht;const f=o.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return ht;const p=f.offset,m=h.offset,b=d.length-c.length;return b===1&&m===p-1?Wo:b===-1&&m===p+1?kd:b===-1&&m===p?Td:ht}function Nd(r,e){let t=Date.now(),n=ht;return(s,o,i,l,a,u)=>{const c=Date.now();if(u.has("historic"))return n=ht,t=c,ri;const d=Bd(s,o,l,a,r.isComposing()),f=(()=>{const h=i===null||i.editor===r,p=u.has("history-push");if(!p&&h&&u.has("history-merge"))return Tn;if(s===null)return ti;const m=o._selection;return l.size>0||a.size>0?p===!1&&d!==ht&&d===n&&c<t+e&&h||l.size===1&&function(b,D,y){const A=D._nodeMap.get(b),_=y._nodeMap.get(b),E=D._selection,C=y._selection;return!(M(E)&&M(C)&&E.anchor.type==="element"&&E.focus.type==="element"&&C.anchor.type==="text"&&C.focus.type==="text"||!U(A)||!U(_)||A.__parent!==_.__parent)&&JSON.stringify(D.read(()=>A.exportJSON()))===JSON.stringify(y.read(()=>_.exportJSON()))}(Array.from(l)[0],s,o)?Tn:ti:m!==null?Tn:ri})();return t=c,n=d,f}}function Go(r){r.undoStack=[],r.redoStack=[],r.current=null}function Fd(r,e,t){const n=Nd(r,t);return ar(r.registerCommand(li,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(a.length!==0){const u=i.current,c=a.pop();u!==null&&(l.push(u),o.dispatchCommand(Cn,!0)),a.length===0&&o.dispatchCommand(wn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ae),r.registerCommand(ai,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(l.length!==0){const u=i.current;u!==null&&(a.push(u),o.dispatchCommand(wn,!0));const c=l.pop();l.length===0&&o.dispatchCommand(Cn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ae),r.registerCommand(Bu,()=>(Go(e),!1),ae),r.registerCommand(Nu,()=>(Go(e),r.dispatchCommand(Cn,!1),r.dispatchCommand(wn,!1),!0),ae),r.registerUpdateListener(({editorState:o,prevEditorState:i,dirtyLeaves:l,dirtyElements:a,tags:u})=>{const c=e.current,d=e.redoStack,f=e.undoStack,h=c===null?null:c.editorState;if(c!==null&&o===h)return;const p=n(i,o,c,l,a,u);if(p===ti)d.length!==0&&(e.redoStack=[],r.dispatchCommand(Cn,!1)),c!==null&&(f.push({...c}),r.dispatchCommand(wn,!0));else if(p===ri)return;e.current={editor:r,editorState:o}}))}function Ld(){return{current:null,redoStack:[],undoStack:[]}}function jd({delay:r,externalHistoryState:e}){const[t]=mt();return function(n,s,o=1e3){const i=w.useMemo(()=>s||Ld(),[s]);w.useEffect(()=>Fd(n,i,o),[o,n,i])}(t,e,r),null}const Rd=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Pd({ignoreHistoryMergeTagChange:r=!0,ignoreSelectionChange:e=!1,onChange:t}){const[n]=mt();return Rd(()=>{if(t)return n.registerUpdateListener(({editorState:s,dirtyElements:o,dirtyLeaves:i,prevEditorState:l,tags:a})=>{e&&o.size===0&&i.size===0||r&&a.has("history-merge")||l.isEmpty()||t(s,n,a)})},[n,r,e,t]),null}function ni(r,e){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},ni(r,e)}var Ko={error:null},Od=function(r){var e,t;function n(){for(var o,i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return(o=r.call.apply(r,[this].concat(l))||this).state=Ko,o.resetErrorBoundary=function(){for(var u,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];o.props.onReset==null||(u=o.props).onReset.apply(u,d),o.reset()},o}t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,ni(e,t),n.getDerivedStateFromError=function(o){return{error:o}};var s=n.prototype;return s.reset=function(){this.setState(Ko)},s.componentDidCatch=function(o,i){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,i)},s.componentDidUpdate=function(o,i){var l,a,u,c,d=this.state.error,f=this.props.resetKeys;d!==null&&i.error!==null&&((u=o.resetKeys)===void 0&&(u=[]),(c=f)===void 0&&(c=[]),u.length!==c.length||u.some(function(h,p){return!Object.is(h,c[p])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},s.render=function(){var o=this.state.error,i=this.props,l=i.fallbackRender,a=i.FallbackComponent,u=i.fallback;if(o!==null){var c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(bs.isValidElement(u))return u;if(typeof l=="function")return l(c);if(a)return bs.createElement(a,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},n}(bs.Component);function Md({children:r,onError:e}){return g.jsx(Od,{fallback:g.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:r})}function $d(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var vt=$d(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Id(r){let e=1,t=r.getParent();for(;t!=null;){if(_e(t)){const n=t.getParent();if(le(n)){e++,t=n.getParent();continue}vt(40)}return e}return e}function si(r){let e=r.getParent();le(e)||vt(40);let t=e;for(;t!==null;)t=t.getParent(),le(t)&&(e=t);return e}function Sa(r){let e=[];const t=r.getChildren().filter(_e);for(let n=0;n<t.length;n++){const s=t[n],o=s.getFirstChild();le(o)?e=e.concat(Sa(o)):e.push(s)}return e}function Ct(r){return _e(r)&&le(r.getFirstChild())}function Vo(r){return it().append(r)}function Aa(r,e){return _e(r)&&(e.length===0||e.length===1&&r.is(e[0])&&r.getChildrenSize()===0)}function Ho(r,e){r.update(()=>{const t=V();if(t!==null){const n=t.getNodes();if(M(t)){const o=t.getStartEndPoints();o===null&&vt(143);const[i]=o,l=i.getNode(),a=l.getParent();if(Aa(l,n)){const u=et(e);if(Dt(a)){l.replace(u);const c=it();N(l)&&(c.setFormat(l.getFormatType()),c.setIndent(l.getIndent())),u.append(c)}else if(_e(l)){const c=l.getParentOrThrow();lr(u,c.getChildren()),c.replace(u)}return}}const s=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(!N(i)||!i.isEmpty()||_e(i)||s.has(i.getKey())){if(Bl(i)){let l=i.getParent();for(;l!=null;){const a=l.getKey();if(le(l)){if(!s.has(a)){const u=et(e);lr(u,l.getChildren()),l.replace(u),s.add(a)}break}{const u=l.getParent();if(Dt(u)&&!s.has(a)){s.add(a),Jo(l,e);break}l=u}}}}else Jo(i,e)}}})}function lr(r,e){r.splice(r.getChildrenSize(),0,e)}function Jo(r,e){if(le(r))return r;const t=r.getPreviousSibling(),n=r.getNextSibling(),s=it();let o;if(lr(s,r.getChildren()),le(t)&&e===t.getListType())t.append(s),le(n)&&e===n.getListType()&&(lr(t,n.getChildren()),n.remove()),o=t;else if(le(n)&&e===n.getListType())n.getFirstChildOrThrow().insertBefore(s),o=n;else{const i=et(e);i.append(s),r.replace(i),o=i}return s.setFormat(r.getFormatType()),s.setIndent(r.getIndent()),r.remove(),o}function ji(r,e){const t=r.getLastChild(),n=e.getFirstChild();t&&n&&Ct(t)&&Ct(n)&&(ji(t.getFirstChild(),n.getFirstChild()),n.remove());const s=e.getChildren();s.length>0&&r.append(...s),e.remove()}function zd(r){r.update(()=>{const e=V();if(M(e)){const t=new Set,n=e.getNodes(),s=e.anchor.getNode();if(Aa(s,n))t.add(si(s));else for(let o=0;o<n.length;o++){const i=n[o];if(Bl(i)){const l=td(i,ur);l!=null&&t.add(si(l))}}for(const o of t){let i=o;const l=Sa(o);for(const a of l){const u=Se();lr(u,a.getChildren()),i.insertAfter(u),i=u,a.__key===e.anchor.key&&e.anchor.set(u.getKey(),0,"element"),a.__key===e.focus.key&&e.focus.set(u.getKey(),0,"element"),a.remove()}o.remove()}}})}function qd(r){const e=new Set;if(Ct(r)||e.has(r.getKey()))return;const t=r.getParent(),n=r.getNextSibling(),s=r.getPreviousSibling();if(Ct(n)&&Ct(s)){const o=s.getFirstChild();if(le(o)){o.append(r);const i=n.getFirstChild();le(i)&&(lr(o,i.getChildren()),n.remove(),e.add(n.getKey()))}}else if(Ct(n)){const o=n.getFirstChild();if(le(o)){const i=o.getFirstChild();i!==null&&i.insertBefore(r)}}else if(Ct(s)){const o=s.getFirstChild();le(o)&&o.append(r)}else if(le(t)){const o=it(),i=et(t.getListType());o.append(i),i.append(r),s?s.insertAfter(o):n?n.insertBefore(o):t.append(o)}}function Ud(r){if(Ct(r))return;const e=r.getParent(),t=e?e.getParent():void 0;if(le(t?t.getParent():void 0)&&_e(t)&&le(e)){const n=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(r.is(n))t.insertBefore(r),e.isEmpty()&&t.remove();else if(r.is(s))t.insertAfter(r),e.isEmpty()&&t.remove();else{const o=e.getListType(),i=it(),l=et(o);i.append(l),r.getPreviousSiblings().forEach(c=>l.append(c));const a=it(),u=et(o);a.append(u),lr(u,r.getNextSiblings()),t.insertBefore(i),t.insertAfter(a),t.replace(r)}}}function Wd(){const r=V();if(!M(r)||!r.isCollapsed())return!1;const e=r.anchor.getNode();if(!_e(e)||e.getChildrenSize()!==0)return!1;const t=si(e),n=e.getParent();le(n)||vt(40);const s=n.getParent();let o;if(Dt(s))o=Se(),t.insertAfter(o);else{if(!_e(s))return!1;o=it(),s.insertAfter(o)}o.select();const i=e.getNextSiblings();if(i.length>0){const l=et(n.getListType());if(Sr(o))o.insertAfter(l);else{const a=it();a.append(l),o.insertAfter(a)}i.forEach(a=>{a.remove(),l.append(a)})}return function(l){let a=l;for(;a.getNextSibling()==null&&a.getPreviousSibling()==null;){const u=a.getParent();if(u==null||!_e(a)&&!le(a))break;a=u}a.remove()}(e),!0}function Xn(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}class ur extends Pt{static getType(){return"listitem"}static clone(e){return new ur(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return le(n)&&n.getListType()==="check"&&Yo(t,this,null),t.value=this.__value,Qo(t,e.theme,this),t}updateDOM(e,t,n){const s=this.getParent();return le(s)&&s.getListType()==="check"&&Yo(t,this,e),t.value=this.__value,Qo(t,n.theme,this),!1}static transform(){return e=>{if(_e(e)||vt(144),e.__checked==null)return;const t=e.getParent();le(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Gd,priority:0})}}static importJSON(e){const t=it();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(N(n)&&this.canMergeWith(n)){const s=n.getChildren();this.append(...s),n.remove()}else super.append(n)}return this}replace(e,t){if(_e(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!le(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const s=et(n.getListType());let o=this.getNextSibling();for(;o;){const i=o;o=o.getNextSibling(),s.append(i)}n.insertAfter(e),e.insertAfter(s)}return t&&(N(e)||vt(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(le(n)||vt(39),_e(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(n.insertAfter(e,t),s.length!==0){const o=et(n.getListType());s.forEach(i=>o.append(i)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Ct(t)&&Ct(n)&&(ji(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=it(this.__checked==null&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=Se();this.getChildren().forEach(i=>t.append(i));const n=this.getParentOrThrow(),s=n.getParentOrThrow(),o=_e(s);if(n.getChildrenSize()===1)if(o)n.remove(),s.select();else{n.insertBefore(t),n.remove();const i=e.anchor,l=e.focus,a=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(a,i.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return le(n)&&(t=n.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(e===null)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_e(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&vt(117),(e=Math.floor(e))>=0||vt(199);let t=this.getIndent();for(;t!==e;)t<e?(qd(this),t++):(Ud(this),t--);return this}canInsertAfter(e){return _e(e)}canReplaceWith(e){return _e(e)}canMergeWith(e){return Sr(e)||_e(e)}extractWithChild(e,t){if(!M(t))return!1;const n=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return et("bullet")}canMergeWhenEmpty(){return!0}}function Qo(r,e,t){const n=[],s=[],o=e.list,i=o?o.listitem:void 0;let l;if(o&&o.nested&&(l=o.nested.listitem),i!==void 0&&n.push(...Xn(i)),o){const a=t.getParent(),u=le(a)&&a.getListType()==="check",c=t.getChecked();u&&!c||s.push(o.listitemUnchecked),u&&c||s.push(o.listitemChecked),u&&n.push(c?o.listitemChecked:o.listitemUnchecked)}if(l!==void 0){const a=Xn(l);t.getChildren().some(u=>le(u))?n.push(...a):s.push(...a)}s.length>0&&ya(r,...s),n.length>0&&xn(r,...n)}function Yo(r,e,t,n){le(e.getFirstChild())?(r.removeAttribute("role"),r.removeAttribute("tabIndex"),r.removeAttribute("aria-checked")):(r.setAttribute("role","checkbox"),r.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||r.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function Gd(r){if(r.classList.contains("task-list-item")){for(const t of r.children)if(t.tagName==="INPUT")return Kd(t)}const e=r.getAttribute("aria-checked");return{node:it(e==="true"||e!=="false"&&void 0)}}function Kd(r){return r.getAttribute("type")!=="checkbox"?{node:null}:{node:it(r.hasAttribute("checked"))}}function it(r){return At(new ur(void 0,r))}function _e(r){return r instanceof ur}class Tr extends Pt{static getType(){return"list"}static clone(e){const t=e.__listType||el[e.__tag];return new Tr(t,e.__start,e.__key)}constructor(e,t,n){super(n);const s=el[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,s=document.createElement(n);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,Xo(s,e.theme,this),s}updateDOM(e,t,n){return e.__tag!==this.__tag||(Xo(t,n.theme,this),!1)}static transform(){return e=>{le(e)||vt(163),function(t){const n=t.getNextSibling();le(n)&&t.getListType()===n.getListType()&&ji(t,n)}(e),function(t){const n=t.getListType()!=="check";let s=t.getStart();for(const o of t.getChildren())_e(o)&&(o.getValue()!==s&&o.setValue(s),n&&o.getLatest().__checked!=null&&o.setChecked(void 0),le(o.getFirstChild())||s++)}(e)}}static importDOM(){return{ol:()=>({conversion:Zo,priority:0}),ul:()=>({conversion:Zo,priority:0})}}static importJSON(e){const t=et(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config,e);return t&&jt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(_e(n))super.append(n);else{const s=it();if(le(n))s.append(n);else if(N(n))if(n.isInline())s.append(n);else{const o=ke(n.getTextContent());s.append(o)}else s.append(n);super.append(s)}}return this}extractWithChild(e){return _e(e)}}function Xo(r,e,t){const n=[],s=[],o=e.list;if(o!==void 0){const i=o[`${t.__tag}Depth`]||[],l=Id(t)-1,a=l%i.length,u=i[a],c=o[t.__tag];let d;const f=o.nested,h=o.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&n.push(c),h!==void 0&&t.__listType==="check"&&n.push(h),u!==void 0){n.push(...Xn(u));for(let p=0;p<i.length;p++)p!==a&&s.push(t.__tag+p)}if(d!==void 0){const p=Xn(d);l>1?n.push(...p):s.push(...p)}}s.length>0&&ya(r,...s),n.length>0&&xn(r,...n)}function Vd(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];if(_e(n)){e.push(n);const s=n.getChildren();s.length>1&&s.forEach(o=>{le(o)&&e.push(Vo(o))})}else e.push(Vo(n))}return e}function Zo(r){const e=r.nodeName.toLowerCase();let t=null;return e==="ol"?t=et("number",r.start):e==="ul"&&(t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list"))return!0;for(const s of n.childNodes)if(jt(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(r)?et("check"):et("bullet")),{after:Vd,node:t}}const el={ol:"number",ul:"bullet"};function et(r,e=1){return At(new Tr(r,e))}function le(r){return r instanceof Tr}const Ea=ln(),ka=ln(),Hd=ln();function Jd(r){return ar(r.registerCommand(ka,()=>(Ho(r,"number"),!0),xr),r.registerCommand(Ea,()=>(Ho(r,"bullet"),!0),xr),r.registerCommand(Hd,()=>(zd(r),!0),xr),r.registerCommand(Zr,()=>!!Wd(),xr))}function Qd(){const[r]=mt();return w.useEffect(()=>{if(!r.hasNodes([Tr,ur]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),function(e){w.useEffect(()=>Jd(e),[e])}(r),null}const Yd=new Set(["http:","https:","mailto:","sms:","tel:"]);class cr extends Pt{static getType(){return"link"}static clone(e){return new cr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:s=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=s,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),xn(t,e.theme.link),t}updateDOM(e,t,n){if(t instanceof HTMLAnchorElement){const s=this.__url,o=this.__target,i=this.__rel,l=this.__title;s!==e.__url&&(t.href=s),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),i!==e.__rel&&(i?t.rel=i:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:Xd,priority:1})}}static importJSON(e){const t=Zn(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Yd.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=Zn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!M(t))return!1;const s=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Xd(r){let e=null;if(uc(r)){const t=r.textContent;(t!==null&&t!==""||r.children.length>0)&&(e=Zn(r.getAttribute("href")||"",{rel:r.getAttribute("rel"),target:r.getAttribute("target"),title:r.getAttribute("title")}))}return{node:e}}function Zn(r,e){return At(new cr(r,e))}function $r(r){return r instanceof cr}class bn extends cr{constructor(e,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new bn(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){const t=tl(e.url,{isUnlinked:e.isUnlinked,rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(N(n)){const s=tl(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(s),s}return null}}function tl(r,e){return At(new bn(r,e))}function Zd(r){return r instanceof bn}const rl=ln();function js(r,e={}){const{target:t,title:n}=e,s=e.rel===void 0?"noreferrer":e.rel,o=V();if(!M(o))return;const i=o.extract();if(r===null)i.forEach(l=>{const a=ps(l,u=>!Zd(u)&&$r(u));if(a){const u=a.getChildren();for(let c=0;c<u.length;c++)a.insertBefore(u[c]);a.remove()}});else{if(i.length===1){const u=function(c,d){let f=c;for(;f!==null&&f.getParent()!==null&&!d(f);)f=f.getParentOrThrow();return d(f)?f:null}(i[0],$r);if(u!==null)return u.setURL(r),t!==void 0&&u.setTarget(t),s!==null&&u.setRel(s),void(n!==void 0&&u.setTitle(n))}let l=null,a=null;i.forEach(u=>{const c=u.getParent();if(c!==a&&c!==null&&(!N(u)||u.isInline())){if($r(c))return a=c,c.setURL(r),t!==void 0&&c.setTarget(t),s!==null&&a.setRel(s),void(n!==void 0&&a.setTitle(n));if(c.is(l)||(l=c,a=Zn(r,{rel:s,target:t,title:n}),$r(c)?u.getPreviousSibling()===null?c.insertBefore(a):c.insertAfter(a):u.insertBefore(a)),$r(u)){if(u.is(a))return;if(a!==null){const d=u.getChildren();for(let f=0;f<d.length;f++)a.append(d[f])}u.remove()}else a!==null&&a.append(u)}})}}function ef({validateUrl:r,attributes:e}){const[t]=mt();return w.useEffect(()=>{if(!t.hasNodes([cr]))throw new Error("LinkPlugin: LinkNode not registered on editor");return ar(t.registerCommand(rl,n=>{if(n===null)return js(n),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(js(n,e),!0);{const{url:s,target:o,rel:i,title:l}=n;return js(s,{...e,rel:i,target:o,title:l}),!0}},xr),r!==void 0?t.registerCommand(ts,n=>{const s=V();if(!M(s)||s.isCollapsed()||!Wt(n,ClipboardEvent))return!1;const o=n;if(o.clipboardData===null)return!1;const i=o.clipboardData.getData("text");return!!r(i)&&!s.getNodes().some(l=>N(l))&&(t.dispatchCommand(rl,{...e,url:i}),n.preventDefault(),!0)},xr):()=>{})},[t,r,e]),null}const tf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6"},rf={paragraph:"mail-editor-paragraph",text:{bold:"mail-editor-bold",italic:"mail-editor-italic",underline:"mail-editor-underline"},list:{ul:"mail-editor-ul",ol:"mail-editor-ol",listitem:"mail-editor-li"},link:"mail-editor-link",quote:"mail-editor-quote",heading:{h1:"mail-editor-h1",h2:"mail-editor-h2",h3:"mail-editor-h3"}};function nf({theme:r,disabled:e}){const[t]=mt(),n=w.useCallback(()=>{t.dispatchCommand(pt,"bold")},[t]),s=w.useCallback(()=>{t.dispatchCommand(pt,"italic")},[t]),o=w.useCallback(()=>{t.dispatchCommand(pt,"underline")},[t]),i=w.useCallback(()=>{t.dispatchCommand(Ea,void 0)},[t]),l=w.useCallback(()=>{t.dispatchCommand(ka,void 0)},[t]),a=w.useCallback(()=>{t.update(()=>{const d=V();M(d)&&Jc(d,()=>Li())})},[t]),u={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",borderRadius:"4px",cursor:e?"not-allowed":"pointer",color:e?r.textSecondary:r.text,fontSize:"14px",fontWeight:600,opacity:e?.5:1},c=`
73
+ `?a.insertParagraph():u===" "?a.insertNodes([gn()]):a.insertText(u)}}}else e.insertRawText(o)}function Ro(r,e,t){r.dispatchCommand(_u,{nodes:e,selection:t})||t.insertNodes(e)}function Da(r,e,t,n=[]){let s=e===null||t.isSelected(e);const o=F(t)&&t.excludeFromCopy("html");let i=t;if(e!==null){let u=Ei(t);u=q(u)&&e!==null?ga(e,u):u,i=u}const l=F(i)?i.getChildren():[],a=function(u){const c=u.exportJSON(),d=u.constructor;if(c.type!==d.getType()&&Yn(58,d.name),F(u)){const f=c.children;Array.isArray(f)||Yn(59,d.name)}return c}(i);if(q(i)){const u=i.__text;u.length>0?a.text=u:s=!1}for(let u=0;u<l.length;u++){const c=l[u],d=Da(r,e,c,a.children);!s&&F(t)&&d&&t.extractWithChild(c,e,"clone")&&(s=!0)}if(s&&!o)n.push(a);else if(Array.isArray(a.children))for(let u=0;u<a.children.length;u++){const c=a.children[u];n.push(c)}return s}function ad(r,e){const t=[],n=xe().getChildren();for(let s=0;s<n.length;s++)Da(r,e,n[s],t);return{namespace:r._config.namespace,nodes:t}}function ud(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t],s=Bc(n);q(s)&&Hc(s),e.push(s)}return e}let mr=null;async function Po(r,e,t){if(mr!==null)return!1;if(e!==null)return new Promise((a,u)=>{r.update(()=>{a(Oo(r,e,t))})});const n=r.getRootElement(),s=r._window==null?window.document:r._window.document,o=ut(r._window);if(n===null||o===null)return!1;const i=s.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(s.createTextNode("#")),n.append(i);const l=new Range;return l.setStart(i,0),l.setEnd(i,1),o.removeAllRanges(),o.addRange(l),new Promise((a,u)=>{const c=r.registerCommand(rs,d=>(Gt(d,ClipboardEvent)&&(c(),mr!==null&&(window.clearTimeout(mr),mr=null),a(Oo(r,d,t))),!0),Lc);mr=window.setTimeout(()=>{c(),mr=null,a(!1)},50),s.execCommand("copy"),i.remove()})}function Oo(r,e,t){if(t===void 0){const s=ut(r._window);if(!s)return!1;const o=s.anchorNode,i=s.focusNode;if(o!==null&&i!==null&&!dn(r,o,i))return!1;const l=K();if(l===null)return!1;t=dd(l)}e.preventDefault();const n=e.clipboardData;return n!==null&&(fd(n,t),!0)}const cd=[["text/html",od],["application/x-lexical-editor",ld]];function dd(r=K()){const e={"text/plain":r?r.getTextContent():""};if(r){const t=cc();for(const[n,s]of cd){const o=s(t,r);o!==null&&(e[n]=o)}}return e}function fd(r,e){for(const t in e){const n=e[t];n!==void 0&&r.setData(t,n)}}function Mo(r,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(r,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(r,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Br=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,hd=Br&&"documentMode"in document?document.documentMode:null,pd=!(!Br||!("InputEvent"in window)||hd)&&"getTargetRanges"in new window.InputEvent("input"),gd=Br&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),$o=Br&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,md=Br&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yd=Br&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!md,Io=an();class gs extends Ot{static getType(){return"quote"}static clone(e){return new gs(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return bn(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:xd,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Rt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=ji();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const n=Ee(),s=this.getDirection();return n.setDirection(s),this.insertAfter(n,t),n}collapseAtStart(){const e=Ee();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function ji(){return kt(new gs)}class ms extends Ot{static getType(){return"heading"}static clone(e){return new ms(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,n=document.createElement(t),s=e.theme.heading;if(s!==void 0){const o=s[t];bn(n,o)}return n}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:yr,priority:0}),h2:e=>({conversion:yr,priority:0}),h3:e=>({conversion:yr,priority:0}),h4:e=>({conversion:yr,priority:0}),h5:e=>({conversion:yr,priority:0}),h6:e=>({conversion:yr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&zo(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>zo(e)?{conversion:t=>({node:Wr("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Rt(t)){this.isEmpty()&&t.append(document.createElement("br"));const n=this.getFormatType();t.style.textAlign=n;const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){const t=Wr(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,s=this.getLastDescendant(),o=!s||e&&e.anchor.key===s.getKey()&&n===s.getTextContentSize()||!e?Ee():Wr(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),n===0&&!this.isEmpty()&&e){const l=Ee();l.select(),this.replace(l,!0)}return o}collapseAtStart(){const e=this.isEmpty()?Ee():Wr(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function zo(r){return r.nodeName.toLowerCase()==="span"&&r.style.fontSize==="26pt"}function yr(r){const e=r.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Wr(e),r.style!==null&&(ki(r,t),t.setFormat(r.style.textAlign))),{node:t}}function xd(r){const e=ji();return r.style!==null&&(e.setFormat(r.style.textAlign),ki(r,e)),{node:e}}function Wr(r){return kt(new ms(r))}function En(r){let e=null;if(Gt(r,DragEvent)?e=r.dataTransfer:Gt(r,ClipboardEvent)&&(e=r.clipboardData),e===null)return[!1,[],!1];const t=e.types,n=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[n,Array.from(e.files),s]}function qo(r){const e=K();if(!M(e))return!1;const t=new Set,n=e.getNodes();for(let s=0;s<n.length;s++){const o=n[s],i=o.getKey();if(t.has(i))continue;const l=ps(o,u=>F(u)&&!u.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),r(l))}return t.size>0}function kn(r){const e=Ar(r);return de(e)}function bd(r){return ur(r.registerCommand(dl,e=>{const t=K();return!!Ct(t)&&(t.clear(),!0)},0),r.registerCommand(tr,e=>{const t=K();return!!M(t)&&(t.deleteCharacter(e),!0)},ae),r.registerCommand(tn,e=>{const t=K();return!!M(t)&&(t.deleteWord(e),!0)},ae),r.registerCommand(rn,e=>{const t=K();return!!M(t)&&(t.deleteLine(e),!0)},ae),r.registerCommand(Cr,e=>{const t=K();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const n=e.dataTransfer;if(n!=null)jo(n,t,r);else if(M(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},ae),r.registerCommand(Ms,()=>{const e=K();return!!M(e)&&(e.removeText(),!0)},ae),r.registerCommand(gt,e=>{const t=K();return!!M(t)&&(t.formatText(e),!0)},ae),r.registerCommand(ku,e=>{const t=K();if(!M(t)&&!Ct(t))return!1;const n=t.getNodes();for(const s of n){const o=ps(s,i=>F(i)&&!i.isInline());o!==null&&o.setFormat(e)}return!0},ae),r.registerCommand(vr,e=>{const t=K();return!!M(t)&&(t.insertLineBreak(e),!0)},ae),r.registerCommand(en,()=>{const e=K();return!!M(e)&&(e.insertParagraph(),!0)},ae),r.registerCommand(Au,()=>(sa([gn()]),!0),ae),r.registerCommand(Eu,()=>qo(e=>{const t=e.getIndent();e.setIndent(t+1)}),ae),r.registerCommand(Ki,()=>qo(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),ae),r.registerCommand(pl,e=>{const t=K();if(Ct(t)&&!kn(e.target)){const n=t.getNodes();if(n.length>0)return n[0].selectPrevious(),!0}else if(M(t)){const n=nn(t.focus,!0);if(!e.shiftKey&&de(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},ae),r.registerCommand(gl,e=>{const t=K();if(Ct(t)){const n=t.getNodes();if(n.length>0)return n[0].selectNext(0,0),!0}else if(M(t)){if(function(s){const o=s.focus;return o.key==="root"&&o.offset===xe().getChildrenSize()}(t))return e.preventDefault(),!0;const n=nn(t.focus,!1);if(!e.shiftKey&&de(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},ae),r.registerCommand(hl,e=>{const t=K();if(Ct(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!M(t))return!1;if(No(t,!0)){const n=e.shiftKey;return e.preventDefault(),Fo(t,n,!0),!0}return!1},ae),r.registerCommand(fl,e=>{const t=K();if(Ct(t)&&!kn(e.target)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),s[0].selectNext(0,0),!0}if(!M(t))return!1;const n=e.shiftKey;return!!No(t,!1)&&(e.preventDefault(),Fo(t,n,!1),!0)},ae),r.registerCommand(ml,e=>{if(kn(e.target))return!1;const t=K();if(!M(t))return!1;const{anchor:n}=t,s=n.getNode();return t.isCollapsed()&&n.offset===0&&!Ge(s)&&rd(s).getIndent()>0?(e.preventDefault(),r.dispatchCommand(Ki,void 0)):(!$o||navigator.language!=="ko-KR")&&(e.preventDefault(),r.dispatchCommand(tr,!0))},ae),r.registerCommand(xl,e=>{if(kn(e.target))return!1;const t=K();return!!M(t)&&(e.preventDefault(),r.dispatchCommand(tr,!1))},ae),r.registerCommand(Rn,e=>{const t=K();if(!M(t))return!1;if(e!==null){if(($o||gd||yd)&&pd)return!1;if(e.preventDefault(),e.shiftKey)return r.dispatchCommand(vr,!1)}return r.dispatchCommand(en,void 0)},ae),r.registerCommand(yl,()=>{const e=K();return!!M(e)&&(r.blur(),!0)},ae),r.registerCommand(bl,e=>{const[,t]=En(e);if(t.length>0){const s=Mo(e.clientX,e.clientY);if(s!==null){const{offset:o,node:i}=s,l=Ar(i);if(l!==null){const a=Ac();if(q(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const c=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(c,d,"element"),a.focus.set(c,d,"element")}const u=Tl(a);St(u)}r.dispatchCommand(Io,t)}return e.preventDefault(),!0}const n=K();return!!M(n)},ae),r.registerCommand(_l,e=>{const[t]=En(e),n=K();return!(t&&!M(n))},ae),r.registerCommand(vl,e=>{const[t]=En(e),n=K();if(t&&!M(n))return!1;const s=Mo(e.clientX,e.clientY);if(s!==null){const o=Ar(s.node);de(o)&&e.preventDefault()}return!0},ae),r.registerCommand($s,()=>(oc(),!0),ae),r.registerCommand(rs,e=>(Po(r,Gt(e,ClipboardEvent)?e:null),!0),ae),r.registerCommand(ci,e=>(async function(t,n){await Po(n,Gt(t,ClipboardEvent)?t:null),n.update(()=>{const s=K();M(s)?s.removeText():Ct(s)&&s.getNodes().forEach(o=>o.remove())})}(e,r),!0),ae),r.registerCommand(ts,e=>{const[,t,n]=En(e);return t.length>0&&!n?(r.dispatchCommand(Io,t),!0):_i(e.target)?!1:K()!==null&&(function(s,o){s.preventDefault(),o.update(()=>{const i=K(),l=Gt(s,InputEvent)||Gt(s,KeyboardEvent)?null:s.clipboardData;l!=null&&i!==null&&jo(l,i,o)},{tag:"paste"})}(e,r),!0)},ae))}const ti=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Uo(r){return r.getEditorState().read(pa(r.isComposing()))}function _d({contentEditable:r,placeholder:e=null,ErrorBoundary:t}){const[n]=yt(),s=function(o,i){const[l,a]=w.useState(()=>o.getDecorators());return ti(()=>o.registerDecoratorListener(u=>{Pi.flushSync(()=>{a(u)})}),[o]),w.useEffect(()=>{a(o.getDecorators())},[o]),w.useMemo(()=>{const u=[],c=Object.keys(l);for(let d=0;d<c.length;d++){const f=c[d],h=g.jsx(i,{onError:m=>o._onError(m),children:g.jsx(w.Suspense,{fallback:null,children:l[f]})}),p=o.getElementByKey(f);p!==null&&u.push(Pi.createPortal(h,p,f))}return u},[i,l,o])}(n,t);return function(o){ti(()=>ur(bd(o),nd(o)),[o])}(n),g.jsxs(g.Fragment,{children:[r,g.jsx(vd,{content:e}),s]})}function vd({content:r}){const[e]=yt(),t=function(s){const[o,i]=w.useState(()=>Uo(s));return ti(()=>{function l(){const a=Uo(s);i(a)}return l(),ur(s.registerUpdateListener(()=>{l()}),s.registerEditableListener(()=>{l()}))},[s]),o}(e),n=$c();return t?typeof r=="function"?r(n):r:null}const Sa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Cd({editor:r,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:n,ariaDescribedBy:s,ariaErrorMessage:o,ariaExpanded:i,ariaInvalid:l,ariaLabel:a,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:d,ariaRequired:f,autoCapitalize:h,className:p,id:m,role:x="textbox",spellCheck:D=!0,style:y,tabIndex:A,"data-testid":C,...E},v){const[_,S]=w.useState(r.isEditable()),T=w.useCallback(N=>{N&&N.ownerDocument&&N.ownerDocument.defaultView?r.setRootElement(N):r.setRootElement(null)},[r]),z=w.useMemo(()=>function(...N){return L=>{N.forEach(P=>{typeof P=="function"?P(L):P!=null&&(P.current=L)})}}(v,T),[T,v]);return Sa(()=>(S(r.isEditable()),r.registerEditableListener(N=>{S(N)})),[r]),g.jsx("div",{"aria-activedescendant":_?e:void 0,"aria-autocomplete":_?t:"none","aria-controls":_?n:void 0,"aria-describedby":s,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":_&&x==="combobox"?!!i:void 0,...l!=null?{"aria-invalid":l}:{},"aria-label":a,"aria-labelledby":u,"aria-multiline":c,"aria-owns":_?d:void 0,"aria-readonly":!_||void 0,"aria-required":f,autoCapitalize:h,className:p,contentEditable:_,"data-testid":C,id:m,ref:z,role:_?x:void 0,spellCheck:D,style:y,tabIndex:A,...E})}const wd=w.forwardRef(Cd);function Wo(r){return r.getEditorState().read(pa(r.isComposing()))}const Dd=w.forwardRef(Sd);function Sd(r,e){const{placeholder:t,...n}=r,[s]=yt();return g.jsxs(g.Fragment,{children:[g.jsx(wd,{editor:s,...n,ref:e}),t!=null&&g.jsx(Ad,{editor:s,content:t})]})}function Ad({content:r,editor:e}){const t=function(i){const[l,a]=w.useState(()=>Wo(i));return Sa(()=>{function u(){const c=Wo(i);a(c)}return u(),ur(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),l}(e),[n,s]=w.useState(e.isEditable());if(w.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(i=>{s(i)})),[e]),!t)return null;let o=null;return typeof r=="function"?o=r(n):r!==null&&(o=r),o===null?null:g.jsx("div",{"aria-hidden":!0,children:o})}const Tn=0,ri=1,ni=2,pt=0,Ed=1,Go=2,kd=3,Td=4;function Bd(r,e,t,n,s){if(r===null||t.size===0&&n.size===0&&!s)return pt;const o=e._selection,i=r._selection;if(s)return Ed;if(!(M(o)&&M(i)&&i.isCollapsed()&&o.isCollapsed()))return pt;const l=function(D,y,A){const C=D._nodeMap,E=[];for(const v of y){const _=C.get(v);_!==void 0&&E.push(_)}for(const[v,_]of A){if(!_)continue;const S=C.get(v);S===void 0||Ge(S)||E.push(S)}return E}(e,t,n);if(l.length===0)return pt;if(l.length>1){const D=e._nodeMap,y=D.get(o.anchor.key),A=D.get(i.anchor.key);return y&&A&&!r._nodeMap.has(y.__key)&&q(y)&&y.__text.length===1&&o.anchor.offset===1?Go:pt}const a=l[0],u=r._nodeMap.get(a.__key);if(!q(u)||!q(a)||u.__mode!==a.__mode)return pt;const c=u.__text,d=a.__text;if(c===d)return pt;const f=o.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return pt;const p=f.offset,m=h.offset,x=d.length-c.length;return x===1&&m===p-1?Go:x===-1&&m===p+1?kd:x===-1&&m===p?Td:pt}function Nd(r,e){let t=Date.now(),n=pt;return(s,o,i,l,a,u)=>{const c=Date.now();if(u.has("historic"))return n=pt,t=c,ni;const d=Bd(s,o,l,a,r.isComposing()),f=(()=>{const h=i===null||i.editor===r,p=u.has("history-push");if(!p&&h&&u.has("history-merge"))return Tn;if(s===null)return ri;const m=o._selection;return l.size>0||a.size>0?p===!1&&d!==pt&&d===n&&c<t+e&&h||l.size===1&&function(x,D,y){const A=D._nodeMap.get(x),C=y._nodeMap.get(x),E=D._selection,v=y._selection;return!(M(E)&&M(v)&&E.anchor.type==="element"&&E.focus.type==="element"&&v.anchor.type==="text"&&v.focus.type==="text"||!q(A)||!q(C)||A.__parent!==C.__parent)&&JSON.stringify(D.read(()=>A.exportJSON()))===JSON.stringify(y.read(()=>C.exportJSON()))}(Array.from(l)[0],s,o)?Tn:ri:m!==null?Tn:ni})();return t=c,n=d,f}}function Ko(r){r.undoStack=[],r.redoStack=[],r.current=null}function Fd(r,e,t){const n=Nd(r,t);return ur(r.registerCommand(ai,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(a.length!==0){const u=i.current,c=a.pop();u!==null&&(l.push(u),o.dispatchCommand(Cn,!0)),a.length===0&&o.dispatchCommand(wn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ae),r.registerCommand(ui,()=>(function(o,i){const l=i.redoStack,a=i.undoStack;if(l.length!==0){const u=i.current;u!==null&&(a.push(u),o.dispatchCommand(wn,!0));const c=l.pop();l.length===0&&o.dispatchCommand(Cn,!1),i.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(r,e),!0),ae),r.registerCommand(Bu,()=>(Ko(e),!1),ae),r.registerCommand(Nu,()=>(Ko(e),r.dispatchCommand(Cn,!1),r.dispatchCommand(wn,!1),!0),ae),r.registerUpdateListener(({editorState:o,prevEditorState:i,dirtyLeaves:l,dirtyElements:a,tags:u})=>{const c=e.current,d=e.redoStack,f=e.undoStack,h=c===null?null:c.editorState;if(c!==null&&o===h)return;const p=n(i,o,c,l,a,u);if(p===ri)d.length!==0&&(e.redoStack=[],r.dispatchCommand(Cn,!1)),c!==null&&(f.push({...c}),r.dispatchCommand(wn,!0));else if(p===ni)return;e.current={editor:r,editorState:o}}))}function Ld(){return{current:null,redoStack:[],undoStack:[]}}function jd({delay:r,externalHistoryState:e}){const[t]=yt();return function(n,s,o=1e3){const i=w.useMemo(()=>s||Ld(),[s]);w.useEffect(()=>Fd(n,i,o),[o,n,i])}(t,e,r),null}const Rd=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Pd({ignoreHistoryMergeTagChange:r=!0,ignoreSelectionChange:e=!1,onChange:t}){const[n]=yt();return Rd(()=>{if(t)return n.registerUpdateListener(({editorState:s,dirtyElements:o,dirtyLeaves:i,prevEditorState:l,tags:a})=>{e&&o.size===0&&i.size===0||r&&a.has("history-merge")||l.isEmpty()||t(s,n,a)})},[n,r,e,t]),null}function si(r,e){return si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},si(r,e)}var Vo={error:null},Od=function(r){var e,t;function n(){for(var o,i=arguments.length,l=new Array(i),a=0;a<i;a++)l[a]=arguments[a];return(o=r.call.apply(r,[this].concat(l))||this).state=Vo,o.resetErrorBoundary=function(){for(var u,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];o.props.onReset==null||(u=o.props).onReset.apply(u,d),o.reset()},o}t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,si(e,t),n.getDerivedStateFromError=function(o){return{error:o}};var s=n.prototype;return s.reset=function(){this.setState(Vo)},s.componentDidCatch=function(o,i){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,i)},s.componentDidUpdate=function(o,i){var l,a,u,c,d=this.state.error,f=this.props.resetKeys;d!==null&&i.error!==null&&((u=o.resetKeys)===void 0&&(u=[]),(c=f)===void 0&&(c=[]),u.length!==c.length||u.some(function(h,p){return!Object.is(h,c[p])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},s.render=function(){var o=this.state.error,i=this.props,l=i.fallbackRender,a=i.FallbackComponent,u=i.fallback;if(o!==null){var c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(_s.isValidElement(u))return u;if(typeof l=="function")return l(c);if(a)return _s.createElement(a,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},n}(_s.Component);function Md({children:r,onError:e}){return g.jsx(Od,{fallback:g.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:r})}function $d(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var wt=$d(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Id(r){let e=1,t=r.getParent();for(;t!=null;){if(_e(t)){const n=t.getParent();if(le(n)){e++,t=n.getParent();continue}wt(40)}return e}return e}function ii(r){let e=r.getParent();le(e)||wt(40);let t=e;for(;t!==null;)t=t.getParent(),le(t)&&(e=t);return e}function Aa(r){let e=[];const t=r.getChildren().filter(_e);for(let n=0;n<t.length;n++){const s=t[n],o=s.getFirstChild();le(o)?e=e.concat(Aa(o)):e.push(s)}return e}function Dt(r){return _e(r)&&le(r.getFirstChild())}function Ho(r){return st().append(r)}function Ea(r,e){return _e(r)&&(e.length===0||e.length===1&&r.is(e[0])&&r.getChildrenSize()===0)}function Jo(r,e){r.update(()=>{const t=K();if(t!==null){const n=t.getNodes();if(M(t)){const o=t.getStartEndPoints();o===null&&wt(143);const[i]=o,l=i.getNode(),a=l.getParent();if(Ea(l,n)){const u=et(e);if(At(a)){l.replace(u);const c=st();F(l)&&(c.setFormat(l.getFormatType()),c.setIndent(l.getIndent())),u.append(c)}else if(_e(l)){const c=l.getParentOrThrow();ar(u,c.getChildren()),c.replace(u)}return}}const s=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(!F(i)||!i.isEmpty()||_e(i)||s.has(i.getKey())){if(Nl(i)){let l=i.getParent();for(;l!=null;){const a=l.getKey();if(le(l)){if(!s.has(a)){const u=et(e);ar(u,l.getChildren()),l.replace(u),s.add(a)}break}{const u=l.getParent();if(At(u)&&!s.has(a)){s.add(a),Qo(l,e);break}l=u}}}}else Qo(i,e)}}})}function ar(r,e){r.splice(r.getChildrenSize(),0,e)}function Qo(r,e){if(le(r))return r;const t=r.getPreviousSibling(),n=r.getNextSibling(),s=st();let o;if(ar(s,r.getChildren()),le(t)&&e===t.getListType())t.append(s),le(n)&&e===n.getListType()&&(ar(t,n.getChildren()),n.remove()),o=t;else if(le(n)&&e===n.getListType())n.getFirstChildOrThrow().insertBefore(s),o=n;else{const i=et(e);i.append(s),r.replace(i),o=i}return s.setFormat(r.getFormatType()),s.setIndent(r.getIndent()),r.remove(),o}function Ri(r,e){const t=r.getLastChild(),n=e.getFirstChild();t&&n&&Dt(t)&&Dt(n)&&(Ri(t.getFirstChild(),n.getFirstChild()),n.remove());const s=e.getChildren();s.length>0&&r.append(...s),e.remove()}function zd(r){r.update(()=>{const e=K();if(M(e)){const t=new Set,n=e.getNodes(),s=e.anchor.getNode();if(Ea(s,n))t.add(ii(s));else for(let o=0;o<n.length;o++){const i=n[o];if(Nl(i)){const l=td(i,cr);l!=null&&t.add(ii(l))}}for(const o of t){let i=o;const l=Aa(o);for(const a of l){const u=Ee();ar(u,a.getChildren()),i.insertAfter(u),i=u,a.__key===e.anchor.key&&e.anchor.set(u.getKey(),0,"element"),a.__key===e.focus.key&&e.focus.set(u.getKey(),0,"element"),a.remove()}o.remove()}}})}function qd(r){const e=new Set;if(Dt(r)||e.has(r.getKey()))return;const t=r.getParent(),n=r.getNextSibling(),s=r.getPreviousSibling();if(Dt(n)&&Dt(s)){const o=s.getFirstChild();if(le(o)){o.append(r);const i=n.getFirstChild();le(i)&&(ar(o,i.getChildren()),n.remove(),e.add(n.getKey()))}}else if(Dt(n)){const o=n.getFirstChild();if(le(o)){const i=o.getFirstChild();i!==null&&i.insertBefore(r)}}else if(Dt(s)){const o=s.getFirstChild();le(o)&&o.append(r)}else if(le(t)){const o=st(),i=et(t.getListType());o.append(i),i.append(r),s?s.insertAfter(o):n?n.insertBefore(o):t.append(o)}}function Ud(r){if(Dt(r))return;const e=r.getParent(),t=e?e.getParent():void 0;if(le(t?t.getParent():void 0)&&_e(t)&&le(e)){const n=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(r.is(n))t.insertBefore(r),e.isEmpty()&&t.remove();else if(r.is(s))t.insertAfter(r),e.isEmpty()&&t.remove();else{const o=e.getListType(),i=st(),l=et(o);i.append(l),r.getPreviousSiblings().forEach(c=>l.append(c));const a=st(),u=et(o);a.append(u),ar(u,r.getNextSiblings()),t.insertBefore(i),t.insertAfter(a),t.replace(r)}}}function Wd(){const r=K();if(!M(r)||!r.isCollapsed())return!1;const e=r.anchor.getNode();if(!_e(e)||e.getChildrenSize()!==0)return!1;const t=ii(e),n=e.getParent();le(n)||wt(40);const s=n.getParent();let o;if(At(s))o=Ee(),t.insertAfter(o);else{if(!_e(s))return!1;o=st(),s.insertAfter(o)}o.select();const i=e.getNextSiblings();if(i.length>0){const l=et(n.getListType());if(Er(o))o.insertAfter(l);else{const a=st();a.append(l),o.insertAfter(a)}i.forEach(a=>{a.remove(),l.append(a)})}return function(l){let a=l;for(;a.getNextSibling()==null&&a.getPreviousSibling()==null;){const u=a.getParent();if(u==null||!_e(a)&&!le(a))break;a=u}a.remove()}(e),!0}function Xn(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}class cr extends Ot{static getType(){return"listitem"}static clone(e){return new cr(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return le(n)&&n.getListType()==="check"&&Xo(t,this,null),t.value=this.__value,Yo(t,e.theme,this),t}updateDOM(e,t,n){const s=this.getParent();return le(s)&&s.getListType()==="check"&&Xo(t,this,e),t.value=this.__value,Yo(t,n.theme,this),!1}static transform(){return e=>{if(_e(e)||wt(144),e.__checked==null)return;const t=e.getParent();le(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Gd,priority:0})}}static importJSON(e){const t=st();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(F(n)&&this.canMergeWith(n)){const s=n.getChildren();this.append(...s),n.remove()}else super.append(n)}return this}replace(e,t){if(_e(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!le(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const s=et(n.getListType());let o=this.getNextSibling();for(;o;){const i=o;o=o.getNextSibling(),s.append(i)}n.insertAfter(e),e.insertAfter(s)}return t&&(F(e)||wt(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(le(n)||wt(39),_e(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(n.insertAfter(e,t),s.length!==0){const o=et(n.getListType());s.forEach(i=>o.append(i)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Dt(t)&&Dt(n)&&(Ri(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=st(this.__checked==null&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=Ee();this.getChildren().forEach(i=>t.append(i));const n=this.getParentOrThrow(),s=n.getParentOrThrow(),o=_e(s);if(n.getChildrenSize()===1)if(o)n.remove(),s.select();else{n.insertBefore(t),n.remove();const i=e.anchor,l=e.focus,a=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(a,i.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return le(n)&&(t=n.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(e===null)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_e(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&wt(117),(e=Math.floor(e))>=0||wt(199);let t=this.getIndent();for(;t!==e;)t<e?(qd(this),t++):(Ud(this),t--);return this}canInsertAfter(e){return _e(e)}canReplaceWith(e){return _e(e)}canMergeWith(e){return Er(e)||_e(e)}extractWithChild(e,t){if(!M(t))return!1;const n=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return et("bullet")}canMergeWhenEmpty(){return!0}}function Yo(r,e,t){const n=[],s=[],o=e.list,i=o?o.listitem:void 0;let l;if(o&&o.nested&&(l=o.nested.listitem),i!==void 0&&n.push(...Xn(i)),o){const a=t.getParent(),u=le(a)&&a.getListType()==="check",c=t.getChecked();u&&!c||s.push(o.listitemUnchecked),u&&c||s.push(o.listitemChecked),u&&n.push(c?o.listitemChecked:o.listitemUnchecked)}if(l!==void 0){const a=Xn(l);t.getChildren().some(u=>le(u))?n.push(...a):s.push(...a)}s.length>0&&xa(r,...s),n.length>0&&bn(r,...n)}function Xo(r,e,t,n){le(e.getFirstChild())?(r.removeAttribute("role"),r.removeAttribute("tabIndex"),r.removeAttribute("aria-checked")):(r.setAttribute("role","checkbox"),r.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||r.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function Gd(r){if(r.classList.contains("task-list-item")){for(const t of r.children)if(t.tagName==="INPUT")return Kd(t)}const e=r.getAttribute("aria-checked");return{node:st(e==="true"||e!=="false"&&void 0)}}function Kd(r){return r.getAttribute("type")!=="checkbox"?{node:null}:{node:st(r.hasAttribute("checked"))}}function st(r){return kt(new cr(void 0,r))}function _e(r){return r instanceof cr}class Nr extends Ot{static getType(){return"list"}static clone(e){const t=e.__listType||tl[e.__tag];return new Nr(t,e.__start,e.__key)}constructor(e,t,n){super(n);const s=tl[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,s=document.createElement(n);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,Zo(s,e.theme,this),s}updateDOM(e,t,n){return e.__tag!==this.__tag||(Zo(t,n.theme,this),!1)}static transform(){return e=>{le(e)||wt(163),function(t){const n=t.getNextSibling();le(n)&&t.getListType()===n.getListType()&&Ri(t,n)}(e),function(t){const n=t.getListType()!=="check";let s=t.getStart();for(const o of t.getChildren())_e(o)&&(o.getValue()!==s&&o.setValue(s),n&&o.getLatest().__checked!=null&&o.setChecked(void 0),le(o.getFirstChild())||s++)}(e)}}static importDOM(){return{ol:()=>({conversion:el,priority:0}),ul:()=>({conversion:el,priority:0})}}static importJSON(e){const t=et(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config,e);return t&&Rt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(_e(n))super.append(n);else{const s=st();if(le(n))s.append(n);else if(F(n))if(n.isInline())s.append(n);else{const o=ke(n.getTextContent());s.append(o)}else s.append(n);super.append(s)}}return this}extractWithChild(e){return _e(e)}}function Zo(r,e,t){const n=[],s=[],o=e.list;if(o!==void 0){const i=o[`${t.__tag}Depth`]||[],l=Id(t)-1,a=l%i.length,u=i[a],c=o[t.__tag];let d;const f=o.nested,h=o.checklist;if(f!==void 0&&f.list&&(d=f.list),c!==void 0&&n.push(c),h!==void 0&&t.__listType==="check"&&n.push(h),u!==void 0){n.push(...Xn(u));for(let p=0;p<i.length;p++)p!==a&&s.push(t.__tag+p)}if(d!==void 0){const p=Xn(d);l>1?n.push(...p):s.push(...p)}}s.length>0&&xa(r,...s),n.length>0&&bn(r,...n)}function Vd(r){const e=[];for(let t=0;t<r.length;t++){const n=r[t];if(_e(n)){e.push(n);const s=n.getChildren();s.length>1&&s.forEach(o=>{le(o)&&e.push(Ho(o))})}else e.push(Ho(n))}return e}function el(r){const e=r.nodeName.toLowerCase();let t=null;return e==="ol"?t=et("number",r.start):e==="ul"&&(t=function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list"))return!0;for(const s of n.childNodes)if(Rt(s)&&s.hasAttribute("aria-checked"))return!0;return!1}(r)?et("check"):et("bullet")),{after:Vd,node:t}}const tl={ol:"number",ul:"bullet"};function et(r,e=1){return kt(new Nr(r,e))}function le(r){return r instanceof Nr}const ka=an(),Ta=an(),Hd=an();function Jd(r){return ur(r.registerCommand(Ta,()=>(Jo(r,"number"),!0),_r),r.registerCommand(ka,()=>(Jo(r,"bullet"),!0),_r),r.registerCommand(Hd,()=>(zd(r),!0),_r),r.registerCommand(en,()=>!!Wd(),_r))}function Qd(){const[r]=yt();return w.useEffect(()=>{if(!r.hasNodes([Nr,cr]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[r]),function(e){w.useEffect(()=>Jd(e),[e])}(r),null}const Yd=new Set(["http:","https:","mailto:","sms:","tel:"]);class dr extends Ot{static getType(){return"link"}static clone(e){return new dr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},n){super(n);const{target:s=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=s,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),bn(t,e.theme.link),t}updateDOM(e,t,n){if(t instanceof HTMLAnchorElement){const s=this.__url,o=this.__target,i=this.__rel,l=this.__title;s!==e.__url&&(t.href=s),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),i!==e.__rel&&(i?t.rel=i:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:Xd,priority:1})}}static importJSON(e){const t=Zn(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Yd.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const n=Zn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!M(t))return!1;const s=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Xd(r){let e=null;if(uc(r)){const t=r.textContent;(t!==null&&t!==""||r.children.length>0)&&(e=Zn(r.getAttribute("href")||"",{rel:r.getAttribute("rel"),target:r.getAttribute("target"),title:r.getAttribute("title")}))}return{node:e}}function Zn(r,e){return kt(new dr(r,e))}function Ir(r){return r instanceof dr}class _n extends dr{constructor(e,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new _n(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){const t=rl(e.url,{isUnlinked:e.isUnlinked,rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(F(n)){const s=rl(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(s),s}return null}}function rl(r,e){return kt(new _n(r,e))}function Zd(r){return r instanceof _n}const nl=an();function Rs(r,e={}){const{target:t,title:n}=e,s=e.rel===void 0?"noreferrer":e.rel,o=K();if(!M(o))return;const i=o.extract();if(r===null)i.forEach(l=>{const a=ps(l,u=>!Zd(u)&&Ir(u));if(a){const u=a.getChildren();for(let c=0;c<u.length;c++)a.insertBefore(u[c]);a.remove()}});else{if(i.length===1){const u=function(c,d){let f=c;for(;f!==null&&f.getParent()!==null&&!d(f);)f=f.getParentOrThrow();return d(f)?f:null}(i[0],Ir);if(u!==null)return u.setURL(r),t!==void 0&&u.setTarget(t),s!==null&&u.setRel(s),void(n!==void 0&&u.setTitle(n))}let l=null,a=null;i.forEach(u=>{const c=u.getParent();if(c!==a&&c!==null&&(!F(u)||u.isInline())){if(Ir(c))return a=c,c.setURL(r),t!==void 0&&c.setTarget(t),s!==null&&a.setRel(s),void(n!==void 0&&a.setTitle(n));if(c.is(l)||(l=c,a=Zn(r,{rel:s,target:t,title:n}),Ir(c)?u.getPreviousSibling()===null?c.insertBefore(a):c.insertAfter(a):u.insertBefore(a)),Ir(u)){if(u.is(a))return;if(a!==null){const d=u.getChildren();for(let f=0;f<d.length;f++)a.append(d[f])}u.remove()}else a!==null&&a.append(u)}})}}function ef({validateUrl:r,attributes:e}){const[t]=yt();return w.useEffect(()=>{if(!t.hasNodes([dr]))throw new Error("LinkPlugin: LinkNode not registered on editor");return ur(t.registerCommand(nl,n=>{if(n===null)return Rs(n),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(Rs(n,e),!0);{const{url:s,target:o,rel:i,title:l}=n;return Rs(s,{...e,rel:i,target:o,title:l}),!0}},_r),r!==void 0?t.registerCommand(ts,n=>{const s=K();if(!M(s)||s.isCollapsed()||!Gt(n,ClipboardEvent))return!1;const o=n;if(o.clipboardData===null)return!1;const i=o.clipboardData.getData("text");return!!r(i)&&!s.getNodes().some(l=>F(l))&&(t.dispatchCommand(nl,{...e,url:i}),n.preventDefault(),!0)},_r):()=>{})},[t,r,e]),null}const tf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6"},rf={paragraph:"mail-editor-paragraph",text:{bold:"mail-editor-bold",italic:"mail-editor-italic",underline:"mail-editor-underline"},list:{ul:"mail-editor-ul",ol:"mail-editor-ol",listitem:"mail-editor-li"},link:"mail-editor-link",quote:"mail-editor-quote",heading:{h1:"mail-editor-h1",h2:"mail-editor-h2",h3:"mail-editor-h3"}};function nf({theme:r,disabled:e}){const[t]=yt(),n=w.useCallback(()=>{t.dispatchCommand(gt,"bold")},[t]),s=w.useCallback(()=>{t.dispatchCommand(gt,"italic")},[t]),o=w.useCallback(()=>{t.dispatchCommand(gt,"underline")},[t]),i=w.useCallback(()=>{t.dispatchCommand(ka,void 0)},[t]),l=w.useCallback(()=>{t.dispatchCommand(Ta,void 0)},[t]),a=w.useCallback(()=>{t.update(()=>{const d=K();M(d)&&Jc(d,()=>ji())})},[t]),u={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",borderRadius:"4px",cursor:e?"not-allowed":"pointer",color:e?r.textSecondary:r.text,fontSize:"14px",fontWeight:600,opacity:e?.5:1},c=`
74
74
  .mail-editor-toolbar-btn:hover:not(:disabled) {
75
75
  background: ${r.border};
76
76
  }
77
- `;return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"8px",borderBottom:`1px solid ${r.border}`,background:r.toolbarBackground},children:[g.jsx("style",{children:c}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:n,disabled:e,style:u,title:"Bold (Ctrl+B)",children:"B"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:s,disabled:e,style:{...u,fontStyle:"italic"},title:"Italic (Ctrl+I)",children:"I"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:o,disabled:e,style:{...u,textDecoration:"underline"},title:"Underline (Ctrl+U)",children:"U"}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:i,disabled:e,style:u,title:"Bullet List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("circle",{cx:"4",cy:"6",r:"2"}),g.jsx("circle",{cx:"4",cy:"12",r:"2"}),g.jsx("circle",{cx:"4",cy:"18",r:"2"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:l,disabled:e,style:u,title:"Numbered List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("text",{x:"2",y:"8",fontSize:"8",fontFamily:"sans-serif",children:"1"}),g.jsx("text",{x:"2",y:"14",fontSize:"8",fontFamily:"sans-serif",children:"2"}),g.jsx("text",{x:"2",y:"20",fontSize:"8",fontFamily:"sans-serif",children:"3"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:a,disabled:e,style:u,title:"Quote",children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:g.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})})]})}function sf({html:r,isExternalUpdate:e,onImportComplete:t}){const[n]=mt(),s=w.useRef(!1);return w.useEffect(()=>{r&&(s.current&&!e||(s.current=!0,n.update(()=>{const o=xe();o.clear();const i=Se();o.append(i),i.select();const a=new DOMParser().parseFromString(r,"text/html"),c=xa(n,a).filter(d=>d.getParent()===null);c.length>0&&na(c),i.getTextContent()===""&&o.getChildrenSize()>1&&i.remove(),o.selectEnd()},{discrete:!0}),t(),setTimeout(()=>{n.focus()},0)))},[r,e,n,t]),null}function of({text:r,trigger:e}){const[t]=mt(),n=w.useRef(void 0);return w.useEffect(()=>{if(e===void 0||e===n.current||!r)return;n.current=e;const s=r.trim();s&&(t.update(()=>{const o=V();if(M(o))o.insertText(s);else{const i=xe(),l=i.getLastChild();if(l){l.selectEnd();const a=V();M(a)&&a.insertText(s)}else{const a=Se(),u=ke(s);a.append(u),i.append(a)}}}),setTimeout(()=>{t.focus()},0))},[r,e,t]),null}function lf({replyTo:r,theme:e}){const t=n=>{try{return new Date(n).toLocaleString()}catch{return n}};return g.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${e.border}`},children:[g.jsxs("div",{style:{fontSize:"12px",color:e.textSecondary,marginBottom:"8px"},children:["On ",t(r.date),", ",r.from," wrote:"]}),g.jsx("blockquote",{style:{margin:0,padding:"12px 16px",borderLeft:`3px solid ${e.quoteBorder}`,background:e.quoteBackground,fontSize:"14px",color:e.textSecondary,maxHeight:"200px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:r.body}})]})}function Ta({value:r="",onChange:e,placeholder:t="Write your message...",replyTo:n,theme:s={},disabled:o=!1,className:i="",minHeight:l="200px",externalUpdate:a,insertText:u,insertTextTrigger:c}){const d={...tf,...s},[f,h]=w.useState(!1),p=w.useRef(void 0);w.useEffect(()=>{a!==void 0&&a!==p.current&&(p.current=a,h(!0))},[a]);const m=w.useCallback(()=>{h(!1)},[]),b={namespace:"MailEditor",theme:rf,onError:A=>{console.error("Lexical error:",A)},nodes:[Tr,ur,cr,bn,ms,gs],editable:!o},D=w.useCallback((A,_)=>{A.read(()=>{const E=ba(_,null);e==null||e(E)})},[e]),y=`
77
+ `;return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"8px",borderBottom:`1px solid ${r.border}`,background:r.toolbarBackground},children:[g.jsx("style",{children:c}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:n,disabled:e,style:u,title:"Bold (Ctrl+B)",children:"B"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:s,disabled:e,style:{...u,fontStyle:"italic"},title:"Italic (Ctrl+I)",children:"I"}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:o,disabled:e,style:{...u,textDecoration:"underline"},title:"Underline (Ctrl+U)",children:"U"}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:i,disabled:e,style:u,title:"Bullet List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("circle",{cx:"4",cy:"6",r:"2"}),g.jsx("circle",{cx:"4",cy:"12",r:"2"}),g.jsx("circle",{cx:"4",cy:"18",r:"2"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:l,disabled:e,style:u,title:"Numbered List",children:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("text",{x:"2",y:"8",fontSize:"8",fontFamily:"sans-serif",children:"1"}),g.jsx("text",{x:"2",y:"14",fontSize:"8",fontFamily:"sans-serif",children:"2"}),g.jsx("text",{x:"2",y:"20",fontSize:"8",fontFamily:"sans-serif",children:"3"}),g.jsx("rect",{x:"8",y:"5",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"11",width:"14",height:"2"}),g.jsx("rect",{x:"8",y:"17",width:"14",height:"2"})]})}),g.jsx("div",{style:{width:"1px",height:"20px",background:r.border,margin:"0 6px"}}),g.jsx("button",{type:"button",className:"mail-editor-toolbar-btn",onClick:a,disabled:e,style:u,title:"Quote",children:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:g.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})})})]})}function sf({html:r,isExternalUpdate:e,onImportComplete:t}){const[n]=yt(),s=w.useRef(!1);return w.useEffect(()=>{r&&(s.current&&!e||(s.current=!0,n.update(()=>{const o=xe();o.clear();const i=Ee();o.append(i),i.select();const a=new DOMParser().parseFromString(r,"text/html"),c=ba(n,a).filter(d=>d.getParent()===null);c.length>0&&sa(c),i.getTextContent()===""&&o.getChildrenSize()>1&&i.remove(),o.selectEnd()},{discrete:!0}),t(),setTimeout(()=>{n.focus()},0)))},[r,e,n,t]),null}function of({text:r,trigger:e}){const[t]=yt(),n=w.useRef(void 0);return w.useEffect(()=>{if(e===void 0||e===n.current||!r)return;n.current=e;const s=r.trim();s&&(t.update(()=>{const o=K();if(M(o))o.insertText(s);else{const i=xe(),l=i.getLastChild();if(l){l.selectEnd();const a=K();M(a)&&a.insertText(s)}else{const a=Ee(),u=ke(s);a.append(u),i.append(a)}}}),setTimeout(()=>{t.focus()},0))},[r,e,t]),null}function lf({replyTo:r,theme:e}){const t=n=>{try{return new Date(n).toLocaleString()}catch{return n}};return g.jsxs("div",{style:{marginTop:"16px",paddingTop:"16px",borderTop:`1px solid ${e.border}`},children:[g.jsxs("div",{style:{fontSize:"12px",color:e.textSecondary,marginBottom:"8px"},children:["On ",t(r.date),", ",r.from," wrote:"]}),g.jsx("blockquote",{style:{margin:0,padding:"12px 16px",borderLeft:`3px solid ${e.quoteBorder}`,background:e.quoteBackground,fontSize:"14px",color:e.textSecondary,maxHeight:"200px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:r.body}})]})}function Ba({value:r="",onChange:e,placeholder:t="Write your message...",replyTo:n,theme:s={},disabled:o=!1,className:i="",minHeight:l="200px",externalUpdate:a,insertText:u,insertTextTrigger:c}){const d={...tf,...s},[f,h]=w.useState(!1),p=w.useRef(void 0);w.useEffect(()=>{a!==void 0&&a!==p.current&&(p.current=a,h(!0))},[a]);const m=w.useCallback(()=>{h(!1)},[]),x={namespace:"MailEditor",theme:rf,onError:A=>{console.error("Lexical error:",A)},nodes:[Nr,cr,dr,_n,ms,gs],editable:!o},D=w.useCallback((A,C)=>{A.read(()=>{const E=_a(C,null);e==null||e(E)})},[e]),y=`
78
78
  .mail-editor-paragraph {
79
79
  margin: 0 0 8px 0;
80
80
  line-height: 1.5;
@@ -140,9 +140,9 @@ React keys must be passed directly to JSX without using spread:
140
140
  pointer-events: none;
141
141
  font-size: 14px;
142
142
  }
143
- `;return g.jsxs("div",{className:i,style:{border:`1px solid ${d.border}`,borderRadius:"8px",background:d.background,overflow:"hidden",display:"flex",flexDirection:"column",height:"100%",minHeight:l},children:[g.jsx("style",{children:y}),g.jsxs(Pc,{initialConfig:b,children:[g.jsx(nf,{theme:d,disabled:o}),g.jsx("div",{style:{position:"relative",flex:1,display:"flex",flexDirection:"column"},children:g.jsx(_d,{contentEditable:g.jsx(Dd,{className:"mail-editor-content",style:{outline:"none",flex:1,minHeight:"100px",padding:"16px",fontSize:"14px",lineHeight:1.6,color:d.text}}),placeholder:g.jsx("div",{className:"mail-editor-placeholder",children:t}),ErrorBoundary:Md})}),g.jsx(Qd,{}),g.jsx(ef,{}),g.jsx(jd,{}),g.jsx(Pd,{onChange:D}),g.jsx(sf,{html:r,isExternalUpdate:f,onImportComplete:m}),g.jsx(of,{text:u,trigger:c})]}),n&&g.jsx(lf,{replyTo:n,theme:d})]})}const af={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6",inputBackground:"#ffffff",inputBorder:"#d1d5db",inputFocus:"#3b82f6",buttonPrimary:"#3b82f6",buttonPrimaryHover:"#2563eb",buttonSecondary:"#f3f4f6",buttonSecondaryHover:"#e5e7eb",attachmentBackground:"#f9fafb",attachmentBorder:"#e5e7eb"};function uf({to:r="",subject:e="",body:t="",replyTo:n,onSend:s,onCancel:o,onBodyChange:i,externalUpdate:l,insertText:a,insertTextTrigger:u,theme:c={},disabled:d=!1,showCcBcc:f=!1,placeholder:h="Write your message...",className:p="",minHeight:m="200px",sendButtonText:b="Send",hideCancelButton:D=!1}){const y={...af,...c},[A,_]=w.useState(r),[E,C]=w.useState(""),[v,S]=w.useState(""),[k,q]=w.useState(e),[B,F]=w.useState(t),[j,L]=w.useState([]),[P,Z]=w.useState(!1),[ue,fe]=w.useState(""),[we,Ae]=w.useState(f),[Ve,qe]=w.useState(!1),$e=w.useRef(void 0);w.useEffect(()=>{l!==void 0&&l!==$e.current&&($e.current=l,F(t),qe(!0))},[l,t]);const Be=H=>{F(H),qe(!1),i==null||i(H)},Re=w.useRef(null),[he,Ie]=w.useState(!1),Ne=H=>{const Pe=H.target.files;Pe&&L(rt=>[...rt,...Array.from(Pe)]),Re.current&&(Re.current.value="")},ge=H=>{H.preventDefault(),H.stopPropagation(),Ie(!0)},He=H=>{H.preventDefault(),H.stopPropagation(),Ie(!1)},ct=H=>{H.preventDefault(),H.stopPropagation(),Ie(!1),H.dataTransfer.files&&L(Pe=>[...Pe,...Array.from(H.dataTransfer.files)])},Et=H=>H.type.startsWith("image/")?"image":H.type==="application/pdf"?"picture_as_pdf":H.type.includes("spreadsheet")||H.type.includes("excel")?"table_chart":H.type.includes("document")||H.type.includes("word")?"description":"attach_file",ot=H=>{L(Pe=>Pe.filter((rt,Ee)=>Ee!==H))},kt=H=>H<1024?`${H} B`:H<1024*1024?`${(H/1024).toFixed(1)} KB`:`${(H/(1024*1024)).toFixed(1)} MB`,xt=async()=>{if(!A.trim()){fe("Recipient email is required");return}if(!k.trim()){fe("Subject is required");return}Z(!0),fe("");try{const H=await Promise.all(j.map(async rt=>{const Ee=await rt.arrayBuffer(),Qe=btoa(new Uint8Array(Ee).reduce((Jt,W)=>Jt+String.fromCharCode(W),""));return{filename:rt.name,content_type:rt.type||"application/octet-stream",data:Qe,size:rt.size}})),Pe=B.replace(/>\n+</g,"><").replace(/<p class="[^"]*"><\/p>/g,"<br>").trim();await s({to:A.trim(),cc:E.trim()||void 0,bcc:v.trim()||void 0,subject:k.trim(),html:Pe,attachments:H,inReplyTo:n==null?void 0:n.messageId}),_(""),C(""),S(""),q(""),F(""),L([])}catch(H){fe(H instanceof Error?H.message:"Failed to send email")}finally{Z(!1)}},Je={width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${y.inputBorder}`,borderRadius:"6px",background:y.inputBackground,color:y.text,outline:"none"},tt={display:"block",fontSize:"12px",fontWeight:500,color:y.textSecondary,marginBottom:"4px",textTransform:"uppercase"},Tt=H=>({padding:"10px 20px",fontSize:"14px",fontWeight:500,border:"none",borderRadius:"6px",cursor:d||P?"not-allowed":"pointer",opacity:d||P?.6:1,background:H?y.buttonPrimary:y.buttonSecondary,color:H?"#ffffff":y.text,display:"flex",alignItems:"center",gap:"8px"});return g.jsxs("div",{className:p,style:{display:"flex",flexDirection:"column",gap:"16px",background:y.background},children:[ue&&g.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"6px",color:"#dc2626",fontSize:"14px"},children:ue}),g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"To"}),g.jsx("input",{type:"email",value:A,onChange:H=>_(H.target.value),placeholder:"recipient@example.com",disabled:d||P,style:Je})]}),!we&&g.jsx("button",{type:"button",onClick:()=>Ae(!0),disabled:d||P,style:{background:"none",border:"none",padding:0,fontSize:"12px",color:y.primary,cursor:"pointer",textAlign:"left"},children:"+ Add CC/BCC"}),we&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"CC"}),g.jsx("input",{type:"email",value:E,onChange:H=>C(H.target.value),placeholder:"cc@example.com",disabled:d||P,style:Je})]}),g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"BCC"}),g.jsx("input",{type:"email",value:v,onChange:H=>S(H.target.value),placeholder:"bcc@example.com",disabled:d||P,style:Je})]})]}),g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"Subject"}),g.jsx("input",{type:"text",value:k,onChange:H=>q(H.target.value),placeholder:"Email subject",disabled:d||P,style:Je})]}),g.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[g.jsx("label",{style:tt,children:"Message"}),g.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:g.jsx(Ta,{value:B,onChange:Be,placeholder:h,replyTo:n,theme:y,disabled:d||P,minHeight:m,externalUpdate:Ve?l:void 0,insertText:a,insertTextTrigger:u})})]}),g.jsxs("div",{children:[g.jsx("label",{style:{...tt,marginBottom:"8px"},children:"Attachments"}),g.jsx("input",{ref:Re,type:"file",multiple:!0,onChange:Ne,style:{display:"none"}}),g.jsxs("div",{onClick:()=>{var H;return(H=Re.current)==null?void 0:H.click()},onDragOver:ge,onDragLeave:He,onDrop:ct,style:{width:"100%",padding:"24px 16px",border:`2px dashed ${he?y.primary:y.border}`,borderRadius:"8px",background:he?`${y.primary}10`:"transparent",color:he?y.primary:y.textSecondary,cursor:d||P?"not-allowed":"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",marginBottom:j.length>0?"12px":0},children:[g.jsx("span",{className:"material-icons",style:{fontSize:"24px"},children:he?"file_download":"attach_file"}),g.jsx("span",{style:{fontSize:"14px"},children:he?"Drop files here":"Drop files or click to add"})]}),j.length>0&&g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:j.map((H,Pe)=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:y.attachmentBackground,borderRadius:"8px"},children:[g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:y.textSecondary},children:Et(H)}),g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:y.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H.name}),g.jsx("div",{style:{fontSize:"12px",color:y.textSecondary},children:kt(H.size)})]}),g.jsx("button",{type:"button",onClick:()=>ot(Pe),disabled:d||P,style:{background:"none",border:"none",padding:"4px",cursor:"pointer",color:y.textSecondary,display:"flex",borderRadius:"4px"},children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px"},children:"close"})})]},`${H.name}-${Pe}`))})]}),g.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px"},children:[!D&&o&&g.jsx("button",{type:"button",onClick:o,disabled:d||P,style:Tt(!1),children:"Cancel"}),g.jsxs("button",{type:"button",onClick:xt,disabled:d||P||!A.trim()||!k.trim(),style:Tt(!0),children:[g.jsx("span",{className:"material-icons",style:{fontSize:"18px",animation:P?"spin 1s linear infinite":"none"},children:P?"sync":"send"}),P?"Sending...":b]})]}),g.jsx("style",{children:`
143
+ `;return g.jsxs("div",{className:i,style:{border:`1px solid ${d.border}`,borderRadius:"8px",background:d.background,overflow:"hidden",display:"flex",flexDirection:"column",height:"100%",minHeight:l},children:[g.jsx("style",{children:y}),g.jsxs(Pc,{initialConfig:x,children:[g.jsx(nf,{theme:d,disabled:o}),g.jsx("div",{style:{position:"relative",flex:1,display:"flex",flexDirection:"column"},children:g.jsx(_d,{contentEditable:g.jsx(Dd,{className:"mail-editor-content",style:{outline:"none",flex:1,minHeight:"100px",padding:"16px",fontSize:"14px",lineHeight:1.6,color:d.text}}),placeholder:g.jsx("div",{className:"mail-editor-placeholder",children:t}),ErrorBoundary:Md})}),g.jsx(Qd,{}),g.jsx(ef,{}),g.jsx(jd,{}),g.jsx(Pd,{onChange:D}),g.jsx(sf,{html:r,isExternalUpdate:f,onImportComplete:m}),g.jsx(of,{text:u,trigger:c})]}),n&&g.jsx(lf,{replyTo:n,theme:d})]})}const af={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",toolbarBackground:"#f9fafb",quoteBorder:"#d1d5db",quoteBackground:"#f3f4f6",inputBackground:"#ffffff",inputBorder:"#d1d5db",inputFocus:"#3b82f6",buttonPrimary:"#3b82f6",buttonPrimaryHover:"#2563eb",buttonSecondary:"#f3f4f6",buttonSecondaryHover:"#e5e7eb",attachmentBackground:"#f9fafb",attachmentBorder:"#e5e7eb"};function uf({to:r="",subject:e="",body:t="",replyTo:n,onSend:s,onCancel:o,onBodyChange:i,externalUpdate:l,insertText:a,insertTextTrigger:u,theme:c={},disabled:d=!1,showCcBcc:f=!1,placeholder:h="Write your message...",className:p="",minHeight:m="200px",sendButtonText:x="Send",hideCancelButton:D=!1}){const y={...af,...c},[A,C]=w.useState(r),[E,v]=w.useState(""),[_,S]=w.useState(""),[T,z]=w.useState(e),[N,L]=w.useState(t),[P,j]=w.useState([]),[R,X]=w.useState(!1),[ge,ie]=w.useState(""),[De,Ce]=w.useState(f),[Ie,ze]=w.useState(!1),Me=w.useRef(void 0);w.useEffect(()=>{l!==void 0&&l!==Me.current&&(Me.current=l,L(t),ze(!0))},[l,t]);const Ve=V=>{L(V),ze(!1),i==null||i(V)},be=w.useRef(null),[he,Le]=w.useState(!1),je=V=>{const Be=V.target.files;Be&&j(rt=>[...rt,...Array.from(Be)]),be.current&&(be.current.value="")},me=V=>{V.preventDefault(),V.stopPropagation(),Le(!0)},He=V=>{V.preventDefault(),V.stopPropagation(),Le(!1)},Tt=V=>{V.preventDefault(),V.stopPropagation(),Le(!1),V.dataTransfer.files&&j(Be=>[...Be,...Array.from(V.dataTransfer.files)])},bt=V=>V.type.startsWith("image/")?"image":V.type==="application/pdf"?"picture_as_pdf":V.type.includes("spreadsheet")||V.type.includes("excel")?"table_chart":V.type.includes("document")||V.type.includes("word")?"description":"attach_file",Mt=V=>{j(Be=>Be.filter((rt,ct)=>ct!==V))},it=V=>V<1024?`${V} B`:V<1024*1024?`${(V/1024).toFixed(1)} KB`:`${(V/(1024*1024)).toFixed(1)} MB`,ot=async()=>{if(!A.trim()){ie("Recipient email is required");return}if(!T.trim()){ie("Subject is required");return}X(!0),ie("");try{const V=await Promise.all(P.map(async rt=>{const ct=await rt.arrayBuffer(),qe=btoa(new Uint8Array(ct).reduce((Qe,$t)=>Qe+String.fromCharCode($t),""));return{filename:rt.name,content_type:rt.type||"application/octet-stream",data:qe,size:rt.size}})),Be=N.replace(/>\n+</g,"><").replace(/<p class="[^"]*"><\/p>/g,"<br>").trim();await s({to:A.trim(),cc:E.trim()||void 0,bcc:_.trim()||void 0,subject:T.trim(),html:Be,attachments:V,inReplyTo:n==null?void 0:n.messageId}),C(""),v(""),S(""),z(""),L(""),j([])}catch(V){ie(V instanceof Error?V.message:"Failed to send email")}finally{X(!1)}},Je={width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${y.inputBorder}`,borderRadius:"6px",background:y.inputBackground,color:y.text,outline:"none"},tt={display:"block",fontSize:"12px",fontWeight:500,color:y.textSecondary,marginBottom:"4px",textTransform:"uppercase"},Bt=V=>({padding:"10px 20px",fontSize:"14px",fontWeight:500,border:"none",borderRadius:"6px",cursor:d||R?"not-allowed":"pointer",opacity:d||R?.6:1,background:V?y.buttonPrimary:y.buttonSecondary,color:V?"#ffffff":y.text,display:"flex",alignItems:"center",gap:"8px"});return g.jsxs("div",{className:p,style:{display:"flex",flexDirection:"column",gap:"16px",background:y.background},children:[ge&&g.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"6px",color:"#dc2626",fontSize:"14px"},children:ge}),g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"To"}),g.jsx("input",{type:"email",value:A,onChange:V=>C(V.target.value),placeholder:"recipient@example.com",disabled:d||R,style:Je})]}),!De&&g.jsx("button",{type:"button",onClick:()=>Ce(!0),disabled:d||R,style:{background:"none",border:"none",padding:0,fontSize:"12px",color:y.primary,cursor:"pointer",textAlign:"left"},children:"+ Add CC/BCC"}),De&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"CC"}),g.jsx("input",{type:"email",value:E,onChange:V=>v(V.target.value),placeholder:"cc@example.com",disabled:d||R,style:Je})]}),g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"BCC"}),g.jsx("input",{type:"email",value:_,onChange:V=>S(V.target.value),placeholder:"bcc@example.com",disabled:d||R,style:Je})]})]}),g.jsxs("div",{children:[g.jsx("label",{style:tt,children:"Subject"}),g.jsx("input",{type:"text",value:T,onChange:V=>z(V.target.value),placeholder:"Email subject",disabled:d||R,style:Je})]}),g.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[g.jsx("label",{style:tt,children:"Message"}),g.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:g.jsx(Ba,{value:N,onChange:Ve,placeholder:h,replyTo:n,theme:y,disabled:d||R,minHeight:m,externalUpdate:Ie?l:void 0,insertText:a,insertTextTrigger:u})})]}),g.jsxs("div",{children:[g.jsx("label",{style:{...tt,marginBottom:"8px"},children:"Attachments"}),g.jsx("input",{ref:be,type:"file",multiple:!0,onChange:je,style:{display:"none"}}),g.jsxs("div",{onClick:()=>{var V;return(V=be.current)==null?void 0:V.click()},onDragOver:me,onDragLeave:He,onDrop:Tt,style:{width:"100%",padding:"24px 16px",border:`2px dashed ${he?y.primary:y.border}`,borderRadius:"8px",background:he?`${y.primary}10`:"transparent",color:he?y.primary:y.textSecondary,cursor:d||R?"not-allowed":"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",transition:"all 0.2s",marginBottom:P.length>0?"12px":0},children:[g.jsx("span",{className:"material-icons",style:{fontSize:"24px"},children:he?"file_download":"attach_file"}),g.jsx("span",{style:{fontSize:"14px"},children:he?"Drop files here":"Drop files or click to add"})]}),P.length>0&&g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:P.map((V,Be)=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:y.attachmentBackground,borderRadius:"8px"},children:[g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:y.textSecondary},children:bt(V)}),g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:y.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:V.name}),g.jsx("div",{style:{fontSize:"12px",color:y.textSecondary},children:it(V.size)})]}),g.jsx("button",{type:"button",onClick:()=>Mt(Be),disabled:d||R,style:{background:"none",border:"none",padding:"4px",cursor:"pointer",color:y.textSecondary,display:"flex",borderRadius:"4px"},children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px"},children:"close"})})]},`${V.name}-${Be}`))})]}),g.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"12px"},children:[!D&&o&&g.jsx("button",{type:"button",onClick:o,disabled:d||R,style:Bt(!1),children:"Cancel"}),g.jsxs("button",{type:"button",onClick:ot,disabled:d||R||!A.trim()||!T.trim(),style:Bt(!0),children:[g.jsx("span",{className:"material-icons",style:{fontSize:"18px",animation:R?"spin 1s linear infinite":"none"},children:R?"sync":"send"}),R?"Sending...":x]})]}),g.jsx("style",{children:`
144
144
  @keyframes spin {
145
145
  from { transform: rotate(0deg); }
146
146
  to { transform: rotate(360deg); }
147
147
  }
148
- `})]})}const cf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",chipBackground:"#f3f4f6",chipText:"#374151",hoverBackground:"#f9fafb"};function df({options:r,value:e,onChange:t,placeholder:n="Search or select...",allowCreate:s=!0,onCreate:o,allowDelete:i=!1,onDelete:l,label:a,disabled:u=!1,max:c=0,theme:d={},className:f=""}){const h={...cf,...d},[p,m]=w.useState(!1),[b,D]=w.useState(""),y=w.useRef(null),A=w.useRef(null);w.useEffect(()=>{function B(F){y.current&&!y.current.contains(F.target)&&(m(!1),D(""))}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const _=r.filter(B=>{var F;return((F=B.label)==null?void 0:F.toLowerCase().includes(b.toLowerCase()))&&!e.includes(B.id)}),E=s&&b.trim()&&!r.some(B=>{var F;return((F=B.label)==null?void 0:F.toLowerCase())===b.toLowerCase()}),C=e.map(B=>r.find(F=>F.id===B)).filter(Boolean),v=w.useCallback(B=>{var F;c>0&&e.length>=c||(t([...e,B]),D(""),(F=A.current)==null||F.focus())},[e,t,c]),S=w.useCallback(B=>{t(e.filter(F=>F!==B))},[e,t]),k=w.useCallback(async()=>{if(!E)return;const B=await(o==null?void 0:o(b.trim()));B&&v(B.id),D("")},[E,b,o,v]),q=w.useCallback(B=>{B.key==="Enter"?(B.preventDefault(),E?k():_.length>0&&v(_[0].id)):B.key==="Backspace"&&!b&&e.length>0?S(e[e.length-1]):B.key==="Escape"&&(m(!1),D(""))},[E,_,b,e,k,v,S]);return g.jsxs("div",{ref:y,className:f,style:{position:"relative"},children:[a&&g.jsx("label",{style:{display:"block",fontSize:"12px",textTransform:"uppercase",color:h.textSecondary,marginBottom:"4px"},children:a}),g.jsxs("div",{onClick:()=>!u&&m(!0),style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 12px",border:`1px solid ${p?h.primary:h.border}`,borderRadius:"8px",background:u?h.hoverBackground:h.background,cursor:u?"not-allowed":"text",minHeight:"42px",alignItems:"center"},children:[C.map(B=>g.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",fontSize:"13px",background:B.color||h.chipBackground,color:B.color?"#fff":h.chipText},children:[B.label,!u&&g.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),S(B.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"0 2px",fontSize:"14px",color:"inherit",opacity:.7},children:"×"})]},B.id)),g.jsx("input",{ref:A,type:"text",value:b,onChange:B=>{D(B.target.value),p||m(!0)},onFocus:()=>m(!0),onKeyDown:q,placeholder:C.length===0?n:"",disabled:u||c>0&&e.length>=c,style:{flex:1,minWidth:"60px",border:"none",outline:"none",fontSize:"14px",background:"transparent",color:h.text}})]}),p&&!u&&g.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:h.background,border:`1px solid ${h.border}`,borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto",zIndex:50},children:_.length===0&&!E?g.jsx("div",{style:{padding:"12px",fontSize:"14px",color:h.textSecondary,textAlign:"center"},children:b?"No matches":"No options available"}):g.jsxs(g.Fragment,{children:[_.map(B=>g.jsxs("div",{onClick:()=>v(B.id),style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.text,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseEnter:F=>{F.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:F=>{F.currentTarget.style.background=""},children:[B.label,i&&l&&g.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),l(B.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",fontSize:"14px",color:h.textSecondary,opacity:.5},onMouseEnter:F=>{F.currentTarget.style.opacity="1",F.currentTarget.style.color="#ef4444"},onMouseLeave:F=>{F.currentTarget.style.opacity="0.5",F.currentTarget.style.color=h.textSecondary||""},children:"×"})]},B.id)),E&&g.jsxs("div",{onClick:k,style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.primary,borderTop:_.length>0?`1px solid ${h.border}`:"none"},onMouseEnter:B=>{B.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:B=>{B.currentTarget.style.background=""},children:['+ Create "',b.trim(),'"']})]})})]})}function ff({items:r,columns:e,getItemId:t,getItemColumn:n,getItemOrder:s,renderItem:o,onItemMove:i,onItemReorder:l,onItemClick:a,renderColumnHeader:u,renderColumnFooter:c,className:d="",columnClassName:f="",itemClassName:h=""}){const[p,m]=w.useState(null),[b,D]=w.useState(null),[y,A]=w.useState(null),_=w.useRef(null),E=e.reduce((F,j)=>{let L=r.filter(P=>n(P)===j.id);return s&&(L=L.sort((P,Z)=>s(P)-s(Z))),F[j.id]=L,F},{}),C=w.useCallback((F,j)=>{const L=t(j),P=n(j);m(L),_.current=P,F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",L),requestAnimationFrame(()=>{const Z=F.target;Z.style.opacity="0.5"})},[t,n]),v=w.useCallback(F=>{const j=F.target;j.style.opacity="1",m(null),D(null),A(null),_.current=null},[]),S=w.useCallback((F,j,L)=>{F.preventDefault(),F.dataTransfer.dropEffect="move",D(j),A(L)},[]),k=w.useCallback(F=>{const j=F.relatedTarget;j!=null&&j.closest("[data-kanban-column]")||(D(null),A(null))},[]),q=w.useCallback((F,j,L)=>{if(F.preventDefault(),!p)return;const P=_.current;P===j?l==null||l(p,j,L):P&&i(p,P,j,L),m(null),D(null),A(null),_.current=null},[p,i,l]),B=(F,j)=>g.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[F.color&&g.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:F.color}}),g.jsx("span",{className:"font-medium text-sm text-neutral-700",children:F.label})]}),g.jsx("span",{className:"text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full",children:j})]});return g.jsx("div",{className:`flex gap-4 overflow-x-auto pb-4 ${d}`,style:{minHeight:"400px"},children:e.map(F=>{const j=E[F.id]||[],L=b===F.id;return g.jsxs("div",{"data-kanban-column":F.id,className:`flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,onDragOver:P=>{P.preventDefault(),p&&!L&&D(F.id)},onDragLeave:k,onDrop:P=>q(P,F.id,y??j.length),children:[g.jsx("div",{className:"flex-shrink-0 border-b border-neutral-200",children:u?u(F,j.length):B(F,j.length)}),g.jsxs("div",{className:`flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${L?"bg-blue-50":""}`,children:[j.map((P,Z)=>{const ue=t(P),fe=p===ue,we=L&&y===Z&&!fe;return g.jsxs("div",{children:[we&&g.jsx("div",{className:"h-1 bg-blue-500 rounded-full mb-2 mx-1"}),g.jsx("div",{draggable:!0,onDragStart:Ae=>C(Ae,P),onDragEnd:v,onDragOver:Ae=>S(Ae,F.id,Z),onClick:()=>a==null?void 0:a(P),className:`cursor-grab active:cursor-grabbing transition-all ${fe?"opacity-50 scale-95":""} ${h}`,children:o(P,fe)})]},ue)}),g.jsx("div",{className:"min-h-[40px] flex-1",onDragOver:P=>{P.preventDefault(),S(P,F.id,j.length)},children:L&&y===j.length&&g.jsx("div",{className:"h-1 bg-blue-500 rounded-full mx-1 mt-1"})}),j.length===0&&L&&g.jsx("div",{className:"h-20 border-2 border-dashed border-blue-300 rounded-lg bg-blue-50/50 flex items-center justify-center",children:g.jsx("span",{className:"text-sm text-blue-400",children:"Drop here"})})]}),c&&g.jsx("div",{className:"flex-shrink-0 border-t border-neutral-200 p-2",children:c(F)})]},F.id)})})}const hf={background:"#ffffff",hourLineColor:"#e5e7eb",halfHourLineColor:"#f3f4f6",hourTextColor:"#9ca3af",currentTimeColor:"#ef4444",allDayBackground:"#f9fafb",allDayBorder:"#e5e7eb"};function pf(r){const e=r.match(/^(\d{1,2}):(\d{2})$/);return e?{hours:parseInt(e[1],10),minutes:parseInt(e[2],10)}:null}function gf(r){const e=r%12||12,t=r<12?"AM":"PM";return`${e} ${t}`}function mf(r){const e=new Date;return r.getDate()===e.getDate()&&r.getMonth()===e.getMonth()&&r.getFullYear()===e.getFullYear()}function yf({items:r,date:e,startHour:t=7,endHour:n=22,hourHeight:s=60,getItemTime:o,getItemDuration:i,getItemIsAllDay:l,getItemId:a,renderItem:u,onItemClick:c,onTimeSlotClick:d,showCurrentTime:f=!0,className:h="",theme:p={}}){const m={...hf,...p},{allDayItems:b,timedItems:D}=w.useMemo(()=>{const v=[],S=[];for(const k of r)l(k)?v.push(k):S.push(k);return{allDayItems:v,timedItems:S}},[r,l]),y=w.useMemo(()=>{const v=[];for(let S=t;S<=n;S++)v.push(S);return v},[t,n]),A=(n-t+1)*s,_=w.useCallback(v=>{const S=o(v);if(!S)return null;const k=pf(S);if(!k)return null;const{hours:q,minutes:B}=k,F=Math.max(t,Math.min(n,q)),j=q<t?0:B,L=(F-t)*s+j/60*s,P=i(v),Z=Math.max(20,P/60*s);return{top:L,height:Z}},[o,i,t,n,s]),E=w.useMemo(()=>{if(!f||!mf(e))return null;const v=new Date,S=v.getHours(),k=v.getMinutes();return S<t||S>n?null:(S-t)*s+k/60*s},[e,f,t,n,s]),C=w.useCallback(v=>{if(!d)return;const S=v.currentTarget.getBoundingClientRect(),q=(v.clientY-S.top)/s*60,B=Math.floor(q/60)+t,F=Math.round(q%60/15)*15,j=Math.min(n,Math.max(t,B)),L=F>=60?0:F,P=`${j.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;d(P)},[d,s,t,n]);return g.jsxs("div",{className:h,style:{background:m.background},children:[b.length>0&&g.jsxs("div",{style:{padding:"8px 0 8px 60px",borderBottom:`1px solid ${m.allDayBorder}`,background:m.allDayBackground},children:[g.jsx("div",{style:{fontSize:"11px",color:m.hourTextColor,marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"All Day"}),g.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:b.map(v=>g.jsx("div",{onClick:()=>c==null?void 0:c(v),style:{cursor:c?"pointer":"default"},children:u(v)},a(v)))})]}),g.jsxs("div",{style:{position:"relative",height:A},children:[y.map((v,S)=>g.jsxs("div",{style:{position:"absolute",top:S*s,left:0,right:0},children:[g.jsx("div",{style:{position:"absolute",left:0,top:-8,width:"50px",textAlign:"right",paddingRight:"10px",fontSize:"11px",color:m.hourTextColor},children:gf(v)}),g.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,height:"1px",background:m.hourLineColor}}),S<y.length-1&&g.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:s/2,height:"1px",background:m.halfHourLineColor}})]},v)),g.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,bottom:0,cursor:d?"pointer":"default"},onClick:C}),E!==null&&g.jsxs("div",{style:{position:"absolute",left:"55px",right:0,top:E,zIndex:20,pointerEvents:"none"},children:[g.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:m.currentTimeColor,marginLeft:"-5px",marginTop:"-5px",position:"absolute"}}),g.jsx("div",{style:{marginLeft:"5px",height:"2px",background:m.currentTimeColor}})]}),D.map(v=>{const S=_(v);return S?g.jsx("div",{style:{position:"absolute",left:"64px",right:"8px",top:S.top,height:S.height,zIndex:10,cursor:c?"pointer":"default"},onClick:k=>{k.stopPropagation(),c==null||c(v)},children:u(v)},a(v)):null})]})]})}function xf({onComplete:r,onCancel:e,onTranscribe:t,transcribing:n,variant:s="widget"}){const o=s==="widget",[i,l]=w.useState("idle"),[a,u]=w.useState(0),[c,d]=w.useState(0),[f,h]=w.useState(!1),[p,m]=w.useState(0),[b,D]=w.useState(null),[y,A]=w.useState(!1),[_,E]=w.useState(null),C=w.useRef(null),v=w.useRef(null),S=w.useRef(null),k=w.useRef(null),q=w.useRef(null),B=w.useRef([]),F=w.useRef(null),j=w.useRef(null),L=w.useRef(null),P=w.useRef(null),Z=w.useRef(!1),ue=w.useRef([]),fe=w.useRef(null),we=w.useRef(null),Ae=w.useRef([]),Ve=w.useRef([]),qe=w.useRef("insert"),$e=w.useRef(!1),Be=w.useRef(0),Re=w.useRef(0),he=w.useRef(0),Ie=W=>{const T=Math.floor(W/60),Y=Math.floor(W%60);return`${T.toString().padStart(2,"0")}:${Y.toString().padStart(2,"0")}`},Ne=async W=>{const T=await W.arrayBuffer(),Y=new AudioContext,Q=await Y.decodeAudioData(T);return await Y.close(),Q},ge=W=>{const T=W.numberOfChannels,Y=W.sampleRate,Q=1,z=16,R=z/8,$=T*R,J=Y*$,te=W.length*$,ne=new ArrayBuffer(44+te),ee=new DataView(ne),re=(me,oe)=>{for(let Oe=0;Oe<oe.length;Oe++)ee.setUint8(me+Oe,oe.charCodeAt(Oe))};re(0,"RIFF"),ee.setUint32(4,36+te,!0),re(8,"WAVE"),re(12,"fmt "),ee.setUint32(16,16,!0),ee.setUint16(20,Q,!0),ee.setUint16(22,T,!0),ee.setUint32(24,Y,!0),ee.setUint32(28,J,!0),ee.setUint16(32,$,!0),ee.setUint16(34,z,!0),re(36,"data"),ee.setUint32(40,te,!0);const be=[];for(let me=0;me<T;me++)be.push(W.getChannelData(me));let ye=44;for(let me=0;me<W.length;me++)for(let oe=0;oe<T;oe++){const Oe=Math.max(-1,Math.min(1,be[oe][me])),Fe=Oe<0?Oe*32768:Oe*32767;ee.setInt16(ye,Fe,!0),ye+=2}return new Blob([ne],{type:"audio/wav"})},He=async(W,T,Y,Q)=>{const z=new AudioContext,R=W.sampleRate,$=Math.max(W.numberOfChannels,T.numberOfChannels),J=Math.min(Y,W.length),te=Math.max(0,W.length-Y),ne=Q==="insert"?J+T.length+te:J+T.length,ee=z.createBuffer($,ne,R);for(let re=0;re<$;re++){const be=ee.getChannelData(re),ye=re<W.numberOfChannels?W.getChannelData(re):W.getChannelData(0);for(let oe=0;oe<J;oe++)be[oe]=ye[oe];const me=re<T.numberOfChannels?T.getChannelData(re):T.getChannelData(0);for(let oe=0;oe<T.length;oe++)be[J+oe]=me[oe];if(Q==="insert")for(let oe=0;oe<te;oe++)be[J+T.length+oe]=ye[Y+oe]}return await z.close(),ee},ct=w.useCallback(()=>{const W=C.current;if(!W)return;const T=W.getContext("2d");if(!T)return;const Y=W.getBoundingClientRect(),Q=Y.width,z=Y.height,R=ue.current,$=c||a||1,J=i==="recording"?a:p;T.fillStyle="#2d3b35",T.fillRect(0,0,Q,z);const te=8,ne="rgba(0, 0, 0, 0.4)",ee=T.createLinearGradient(0,0,0,te);ee.addColorStop(0,ne),ee.addColorStop(1,"transparent"),T.fillStyle=ee,T.fillRect(0,0,Q,te);const re=T.createLinearGradient(0,z-te,0,z);re.addColorStop(0,"transparent"),re.addColorStop(1,ne),T.fillStyle=re,T.fillRect(0,z-te,Q,te);const be=T.createLinearGradient(0,0,te,0);be.addColorStop(0,ne),be.addColorStop(1,"transparent"),T.fillStyle=be,T.fillRect(0,0,te,z);const ye=T.createLinearGradient(Q-te,0,Q,0);ye.addColorStop(0,"transparent"),ye.addColorStop(1,ne),T.fillStyle=ye,T.fillRect(Q-te,0,te,z),T.strokeStyle="#5a6b62",T.lineWidth=1,T.beginPath(),T.moveTo(0,z/2),T.lineTo(Q,z/2),T.stroke();const me=Q/2;if(R.length>0)if(i==="recording")for(let Fe=0;Fe<R.length;Fe++){const nt=R.length-1-Fe,Bt=me-nt*4;if(Bt<-3||Bt>Q)continue;const lt=R[Fe]*(z/2-12),Ot=z/2-lt;T.fillStyle="#10b981",T.fillRect(Bt,Ot,3,lt*2)}else{const Fe=$>0?J/$*R.length:0;for(let nt=0;nt<R.length;nt++){const Bt=Fe-nt,lt=me-Bt*4;if(lt<-3||lt>Q)continue;const Ot=R[nt]*(z/2-12),dr=z/2-Ot;T.fillStyle=nt<=Fe?"#10b981":"#4b5563",T.fillRect(lt,dr,3,Ot*2)}}T.strokeStyle="#ef4444",T.lineWidth=1,T.beginPath(),T.moveTo(me,0),T.lineTo(me,z),T.stroke(),T.fillStyle="#fff",T.font="bold 18px monospace",T.textAlign="center",T.fillText(Ie(J),me,z-6),i==="recording"&&(T.fillStyle="#ef4444",T.beginPath(),T.arc(20,20,8,0,Math.PI*2),T.fill(),T.fillStyle="#fff",T.font="10px sans-serif",T.textAlign="left",T.fillText("REC",34,24)),T.textAlign="left"},[i,p,a,c]),Et=()=>{const W=q.current;if(!W||!Z.current)return;const T=W.frequencyBinCount,Y=new Uint8Array(T);W.getByteTimeDomainData(Y);let Q=0;for(let $=0;$<T;$++){const J=(Y[$]-128)/128;Q+=J*J}const z=Math.sqrt(Q/T),R=Math.min(1,z*3);ue.current.push(R),ct(),Z.current&&(j.current=requestAnimationFrame(Et))},ot=async()=>{try{D(null),A(!1),fe.current===null&&(ue.current=[]);const W=await navigator.mediaDevices.getUserMedia({audio:!0});S.current=W;const T=new AudioContext;k.current=T;const Y=T.createAnalyser();Y.fftSize=2048,q.current=Y,T.createMediaStreamSource(W).connect(Y);const z=new MediaRecorder(W);v.current=z,B.current=[],z.ondataavailable=R=>{R.data.size>0&&B.current.push(R.data)},z.onstop=async()=>{try{if(Z.current=!1,B.current.length===0){D("No audio was recorded. Please try again."),l("idle"),W.getTracks().forEach(ee=>ee.stop());return}const R=new Blob(B.current,{type:"audio/webm"});let $,J;if(fe.current!==null&&we.current)try{const ee=await Ne(R),re=we.current.sampleRate,be=Math.floor(fe.current*re),ye=await He(we.current,ee,be,qe.current);$=ge(ye),J=ye.length/ye.sampleRate,qe.current==="insert"&&(ue.current=[...ue.current,...Ve.current]),fe.current=null,we.current=null,Ae.current=[],Ve.current=[]}catch{$=R,J=Be.current>0?Be.current:1}else $=R,J=Be.current>0?Be.current:1;P.current=$;const te=URL.createObjectURL($),ne=new Audio(te);ne.ontimeupdate=()=>{m(ne.currentTime)},ne.onended=()=>{h(!1)},L.current=ne,d(J),m(J),l("editing"),W.getTracks().forEach(ee=>ee.stop())}catch{D("Failed to process recording"),l("idle")}},z.start(100),Z.current=!0,l("recording"),u(0),Be.current=0,F.current=setInterval(()=>{Be.current+=1,u(Be.current)},1e3)}catch{D("Could not access microphone. Please allow microphone access.")}},kt=()=>{Z.current=!1,A(!1),E(null),j.current&&(cancelAnimationFrame(j.current),j.current=null),F.current&&(clearInterval(F.current),F.current=null),v.current&&v.current.state!=="inactive"&&v.current.stop()},xt=W=>{const T=C.current;if(!T)return;const Y=c||a;if(Y<=0)return;const Q=ue.current;if(Q.length===0)return;const z=T.getBoundingClientRect(),R=W-Re.current,$=4,J=z.width/T.width,te=Q.length/Y*$,ne=-R/(te*J),ee=he.current+ne,re=Math.max(0,Math.min(ee,Y));L.current&&(L.current.currentTime=re),m(re)},Je=()=>{L.current&&(L.current.currentTime=0),m(0)},tt=()=>{const W=c||a;L.current&&(L.current.currentTime=W),m(W)},Tt=()=>{const W=L.current;W&&(f?(W.pause(),m(W.currentTime),h(!1)):(W.currentTime=p,W.play().catch(()=>{}),h(!0)))},H=async W=>{if(!P.current){ot();return}try{L.current&&(L.current.pause(),h(!1)),qe.current=W,we.current=await Ne(P.current);const T=c||a;fe.current=p;const Y=T>0?p/T:0,Q=Math.floor(Y*ue.current.length);Ae.current=ue.current.slice(0,Q),Ve.current=ue.current.slice(Q),ue.current=[...Ae.current],ot()}catch{D("Failed to prepare recording. Please try again.")}},Pe=()=>{L.current&&(L.current.pause(),L.current=null),P.current=null,we.current=null,fe.current=null,Ae.current=[],h(!1),m(0),d(0),u(0),ot()},rt=()=>{P.current?r(P.current,c||a):alert("No audio recorded yet!")};if(w.useEffect(()=>{i==="recording"&&C.current&&q.current&&Z.current&&(j.current=requestAnimationFrame(Et))},[i]),w.useEffect(()=>{const W=C.current;if(!W)return;const T=()=>{const Y=window.devicePixelRatio||1,Q=W.getBoundingClientRect();W.width=Q.width*Y,W.height=Q.height*Y;const z=W.getContext("2d");z&&z.scale(Y,Y)};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),w.useEffect(()=>{if(i==="idle"){const W=C.current;if(!W)return;const T=W.getContext("2d");if(!T)return;const Y=W.getBoundingClientRect(),Q=Y.width,z=Y.height;T.fillStyle="#2d3b35",T.fillRect(0,0,Q,z);const R=8,$="rgba(0, 0, 0, 0.4)",J=T.createLinearGradient(0,0,0,R);J.addColorStop(0,$),J.addColorStop(1,"transparent"),T.fillStyle=J,T.fillRect(0,0,Q,R);const te=T.createLinearGradient(0,z-R,0,z);te.addColorStop(0,"transparent"),te.addColorStop(1,$),T.fillStyle=te,T.fillRect(0,z-R,Q,R);const ne=T.createLinearGradient(0,0,R,0);ne.addColorStop(0,$),ne.addColorStop(1,"transparent"),T.fillStyle=ne,T.fillRect(0,0,R,z);const ee=T.createLinearGradient(Q-R,0,Q,0);ee.addColorStop(0,"transparent"),ee.addColorStop(1,$),T.fillStyle=ee,T.fillRect(Q-R,0,R,z),T.strokeStyle="#5a6b62",T.lineWidth=1,T.beginPath(),T.moveTo(0,z/2),T.lineTo(Q,z/2),T.stroke();const re=Q/2;T.strokeStyle="#ef4444",T.lineWidth=1,T.beginPath(),T.moveTo(re,0),T.lineTo(re,z),T.stroke(),T.fillStyle="#fff",T.font="bold 18px monospace",T.textAlign="center",T.fillText("00:00",re,z-6)}},[i]),w.useEffect(()=>()=>{Z.current=!1,F.current&&clearInterval(F.current),j.current&&cancelAnimationFrame(j.current),S.current&&S.current.getTracks().forEach(W=>W.stop()),k.current&&k.current.state!=="closed"&&k.current.close()},[]),w.useEffect(()=>{if(i==="editing"&&f){let W;const T=()=>{const Y=L.current;if(Y&&f){const Q=C.current;if(Q){const z=Q.getContext("2d");if(z){const R=Q.getBoundingClientRect(),$=R.width,J=R.height,te=ue.current,ne=c||a||1,ee=Y.currentTime;z.fillStyle="#2d3b35",z.fillRect(0,0,$,J);const re=8,be="rgba(0, 0, 0, 0.4)",ye=z.createLinearGradient(0,0,0,re);ye.addColorStop(0,be),ye.addColorStop(1,"transparent"),z.fillStyle=ye,z.fillRect(0,0,$,re);const me=z.createLinearGradient(0,J-re,0,J);me.addColorStop(0,"transparent"),me.addColorStop(1,be),z.fillStyle=me,z.fillRect(0,J-re,$,re);const oe=z.createLinearGradient(0,0,re,0);oe.addColorStop(0,be),oe.addColorStop(1,"transparent"),z.fillStyle=oe,z.fillRect(0,0,re,J);const Oe=z.createLinearGradient($-re,0,$,0);Oe.addColorStop(0,"transparent"),Oe.addColorStop(1,be),z.fillStyle=Oe,z.fillRect($-re,0,re,J),z.strokeStyle="#5a6b62",z.lineWidth=1,z.beginPath(),z.moveTo(0,J/2),z.lineTo($,J/2),z.stroke();const Fe=$/2,nt=3,Bt=4,lt=ne>0?ee/ne*te.length:0;for(let Mt=0;Mt<te.length;Mt++){const ys=lt-Mt,Br=Fe-ys*Bt;if(Br<-nt||Br>$)continue;const Nr=te[Mt]*(J/2-12),_n=J/2-Nr;z.fillStyle=Mt<=lt?"#10b981":"#4b5563",z.fillRect(Br,_n,nt,Nr*2)}z.strokeStyle="#ef4444",z.lineWidth=1,z.beginPath(),z.moveTo(Fe,0),z.lineTo(Fe,J),z.stroke(),z.fillStyle="#fff",z.font="bold 18px monospace",z.textAlign="center";const Ot=Math.floor(ee/60),dr=Math.floor(ee%60);z.fillText(`${Ot.toString().padStart(2,"0")}:${dr.toString().padStart(2,"0")}`,Fe,J-6),z.textAlign="left"}}W=requestAnimationFrame(T)}};return W=requestAnimationFrame(T),()=>cancelAnimationFrame(W)}},[i,f,c,a]),w.useEffect(()=>{i==="editing"&&!f&&ct()},[i,p,f,ct]),b)return g.jsxs("div",{style:{border:"1px solid #fecaca",borderRadius:"12px",padding:"16px",background:"#fef2f2"},children:[g.jsx("p",{style:{fontSize:"14px",color:"#dc2626",marginBottom:"12px"},children:b}),g.jsx("button",{onClick:()=>{D(null),ot()},style:{padding:"8px 16px",fontSize:"14px",background:"#171717",color:"white",borderRadius:"8px",border:"none",cursor:"pointer"},children:"Try Again"})]});const Ee={padding:"8px",borderRadius:"8px",border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.15s"},Qe={...Ee,opacity:.3,cursor:"not-allowed"},Jt=o?{border:"1px solid #e5e5e5",borderRadius:"12px",overflow:"hidden",background:"white"}:{overflow:"hidden",background:"white",height:"100%",display:"flex",flexDirection:"column"};return g.jsxs("div",{style:Jt,children:[g.jsx("canvas",{ref:C,style:{width:"100%",height:"80px",cursor:"pointer",flexShrink:0},onMouseDown:W=>{if(i==="editing"){$e.current=!0,Re.current=W.clientX,he.current=p;const T=Q=>{$e.current&&xt(Q.clientX)},Y=()=>{$e.current=!1,window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",Y)};window.addEventListener("mousemove",T),window.addEventListener("mouseup",Y)}}}),g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:o?"12px 16px":"8px 12px",borderTop:"1px solid #d4d4d4",background:"linear-gradient(to bottom, #e0e0e0 0%, #c8c8c8 100%)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 0 rgba(0,0,0,0.1)",flexShrink:0},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[g.jsx("button",{onClick:Je,disabled:i==="idle"||i==="recording",style:i==="idle"||i==="recording"?Qe:Ee,title:"Go to start",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"first_page"})}),g.jsx("button",{onClick:()=>{if(i==="recording"){const W=v.current;W&&(W.state==="recording"?(W.pause(),A(!0)):W.state==="paused"&&(W.resume(),A(!1)))}else Tt()},disabled:i==="idle",style:i==="idle"?Qe:Ee,title:f||i==="recording"&&!y?"Pause":"Play",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:f||i==="recording"&&!y?"pause":"play_arrow"})}),g.jsx("button",{onClick:tt,disabled:i==="idle"||i==="recording",style:i==="idle"||i==="recording"?Qe:Ee,title:"Go to end",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"last_page"})}),g.jsx("div",{style:{width:"1px",height:"24px",margin:"0 4px",background:"linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(0,0,0,0.15))"}}),g.jsx("button",{onClick:()=>{_==="insert"?kt():i==="idle"?(E("insert"),ot()):i==="editing"&&(E("insert"),H("insert"))},disabled:i==="recording"&&_!=="insert"||f,style:i==="recording"&&_!=="insert"||f?Qe:Ee,title:_==="insert"?"Stop recording":"Insert recording",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:_==="insert"?"#ef4444":"#171717"},children:"add"})}),g.jsx("button",{onClick:()=>{_==="mic"?kt():i==="idle"?(E("mic"),ot()):i==="editing"&&(E("mic"),H("replace"))},disabled:i==="recording"&&_!=="mic"||f,style:i==="recording"&&_!=="mic"||f?Qe:Ee,title:_==="mic"?"Stop recording":"Record",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:_==="mic"?"#ef4444":"#171717"},children:"mic"})}),g.jsx("button",{onClick:()=>{_==="startover"?kt():i==="editing"&&(E("startover"),Pe())},disabled:i==="idle"||i==="recording"&&_!=="startover"||f,style:i==="idle"||i==="recording"&&_!=="startover"||f?Qe:Ee,title:_==="startover"?"Stop recording":"Start over",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:_==="startover"?"#ef4444":"#171717"},children:"refresh"})})]}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t&&g.jsx("button",{onClick:()=>P.current&&t(P.current),disabled:i!=="editing"||n,style:i!=="editing"||n?Qe:Ee,title:n?"Transcribing...":"Transcribe audio",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:n?"hourglass_empty":"subtitles"})}),g.jsx("button",{onClick:rt,disabled:i!=="editing",style:i!=="editing"?Qe:Ee,title:"Save recording",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"save"})})]})]})]})}exports.AnimatedCardFlip=hu;exports.ApiClient=ll;exports.AudioEditor=xf;exports.AuthManager=ol;exports.Card=cu;exports.ComboBox=df;exports.DataOperations=Bn;exports.Detail=du;exports.GraphClient=$a;exports.KanbanBoard=ff;exports.Mail=gu;exports.MailClient=il;exports.MailComposer=uf;exports.MailEditor=Ta;exports.SelectableList=mu;exports.Stack=uu;exports.Timeline=yf;exports.getApiClient=ii;exports.initializeApiClient=iu;exports.useMutation=ou;exports.useQuery=al;
148
+ `})]})}const cf={background:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",chipBackground:"#f3f4f6",chipText:"#374151",hoverBackground:"#f9fafb"};function df({options:r,value:e,onChange:t,placeholder:n="Search or select...",allowCreate:s=!0,onCreate:o,allowDelete:i=!1,onDelete:l,label:a,disabled:u=!1,max:c=0,theme:d={},className:f=""}){const h={...cf,...d},[p,m]=w.useState(!1),[x,D]=w.useState(""),y=w.useRef(null),A=w.useRef(null);w.useEffect(()=>{function N(L){y.current&&!y.current.contains(L.target)&&(m(!1),D(""))}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const C=r.filter(N=>{var L;return((L=N.label)==null?void 0:L.toLowerCase().includes(x.toLowerCase()))&&!e.includes(N.id)}),E=s&&x.trim()&&!r.some(N=>{var L;return((L=N.label)==null?void 0:L.toLowerCase())===x.toLowerCase()}),v=e.map(N=>r.find(L=>L.id===N)).filter(Boolean),_=w.useCallback(N=>{var L;c>0&&e.length>=c||(t([...e,N]),D(""),(L=A.current)==null||L.focus())},[e,t,c]),S=w.useCallback(N=>{t(e.filter(L=>L!==N))},[e,t]),T=w.useCallback(async()=>{if(!E)return;const N=await(o==null?void 0:o(x.trim()));N&&_(N.id),D("")},[E,x,o,_]),z=w.useCallback(N=>{N.key==="Enter"?(N.preventDefault(),E?T():C.length>0&&_(C[0].id)):N.key==="Backspace"&&!x&&e.length>0?S(e[e.length-1]):N.key==="Escape"&&(m(!1),D(""))},[E,C,x,e,T,_,S]);return g.jsxs("div",{ref:y,className:f,style:{position:"relative"},children:[a&&g.jsx("label",{style:{display:"block",fontSize:"12px",textTransform:"uppercase",color:h.textSecondary,marginBottom:"4px"},children:a}),g.jsxs("div",{onClick:()=>!u&&m(!0),style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 12px",border:`1px solid ${p?h.primary:h.border}`,borderRadius:"8px",background:u?h.hoverBackground:h.background,cursor:u?"not-allowed":"text",minHeight:"42px",alignItems:"center"},children:[v.map(N=>g.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",fontSize:"13px",background:N.color||h.chipBackground,color:N.color?"#fff":h.chipText},children:[N.label,!u&&g.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),S(N.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"0 2px",fontSize:"14px",color:"inherit",opacity:.7},children:"×"})]},N.id)),g.jsx("input",{ref:A,type:"text",value:x,onChange:N=>{D(N.target.value),p||m(!0)},onFocus:()=>m(!0),onKeyDown:z,placeholder:v.length===0?n:"",disabled:u||c>0&&e.length>=c,style:{flex:1,minWidth:"60px",border:"none",outline:"none",fontSize:"14px",background:"transparent",color:h.text}})]}),p&&!u&&g.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:h.background,border:`1px solid ${h.border}`,borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",maxHeight:"200px",overflowY:"auto",zIndex:50},children:C.length===0&&!E?g.jsx("div",{style:{padding:"12px",fontSize:"14px",color:h.textSecondary,textAlign:"center"},children:x?"No matches":"No options available"}):g.jsxs(g.Fragment,{children:[C.map(N=>g.jsxs("div",{onClick:()=>_(N.id),style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.text,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseEnter:L=>{L.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:L=>{L.currentTarget.style.background=""},children:[N.label,i&&l&&g.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),l(N.id)},style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",fontSize:"14px",color:h.textSecondary,opacity:.5},onMouseEnter:L=>{L.currentTarget.style.opacity="1",L.currentTarget.style.color="#ef4444"},onMouseLeave:L=>{L.currentTarget.style.opacity="0.5",L.currentTarget.style.color=h.textSecondary||""},children:"×"})]},N.id)),E&&g.jsxs("div",{onClick:T,style:{padding:"10px 12px",fontSize:"14px",cursor:"pointer",color:h.primary,borderTop:C.length>0?`1px solid ${h.border}`:"none"},onMouseEnter:N=>{N.currentTarget.style.background=h.hoverBackground||""},onMouseLeave:N=>{N.currentTarget.style.background=""},children:['+ Create "',x.trim(),'"']})]})})]})}function ff({items:r,columns:e,getItemId:t,getItemColumn:n,getItemOrder:s,renderItem:o,onItemMove:i,onItemReorder:l,onItemClick:a,renderColumnHeader:u,renderColumnFooter:c,className:d="",columnClassName:f="",itemClassName:h=""}){const[p,m]=w.useState(null),[x,D]=w.useState(null),[y,A]=w.useState(null),C=w.useRef(null),E=e.reduce((L,P)=>{let j=r.filter(R=>n(R)===P.id);return s&&(j=j.sort((R,X)=>s(R)-s(X))),L[P.id]=j,L},{}),v=w.useCallback((L,P)=>{const j=t(P),R=n(P);m(j),C.current=R,L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",j),requestAnimationFrame(()=>{const X=L.target;X.style.opacity="0.5"})},[t,n]),_=w.useCallback(L=>{const P=L.target;P.style.opacity="1",m(null),D(null),A(null),C.current=null},[]),S=w.useCallback((L,P,j)=>{L.preventDefault(),L.dataTransfer.dropEffect="move",D(P),A(j)},[]),T=w.useCallback(L=>{const P=L.relatedTarget;P!=null&&P.closest("[data-kanban-column]")||(D(null),A(null))},[]),z=w.useCallback((L,P,j)=>{if(L.preventDefault(),!p)return;const R=C.current;R===P?l==null||l(p,P,j):R&&i(p,R,P,j),m(null),D(null),A(null),C.current=null},[p,i,l]),N=(L,P)=>g.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[L.color&&g.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:L.color}}),g.jsx("span",{className:"font-medium text-sm text-neutral-700",children:L.label})]}),g.jsx("span",{className:"text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full",children:P})]});return g.jsx("div",{className:`flex gap-4 overflow-x-auto pb-4 ${d}`,style:{minHeight:"400px"},children:e.map(L=>{const P=E[L.id]||[],j=x===L.id;return g.jsxs("div",{"data-kanban-column":L.id,className:`flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,onDragOver:R=>{R.preventDefault(),p&&!j&&D(L.id)},onDragLeave:T,onDrop:R=>z(R,L.id,y??P.length),children:[g.jsx("div",{className:"flex-shrink-0 border-b border-neutral-200",children:u?u(L,P.length):N(L,P.length)}),g.jsxs("div",{className:`flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${j?"bg-blue-50":""}`,children:[P.map((R,X)=>{const ge=t(R),ie=p===ge,De=j&&y===X&&!ie;return g.jsxs("div",{children:[De&&g.jsx("div",{className:"h-1 bg-blue-500 rounded-full mb-2 mx-1"}),g.jsx("div",{draggable:!0,onDragStart:Ce=>v(Ce,R),onDragEnd:_,onDragOver:Ce=>S(Ce,L.id,X),onClick:()=>a==null?void 0:a(R),className:`cursor-grab active:cursor-grabbing transition-all ${ie?"opacity-50 scale-95":""} ${h}`,children:o(R,ie)})]},ge)}),g.jsx("div",{className:"min-h-[40px] flex-1",onDragOver:R=>{R.preventDefault(),S(R,L.id,P.length)},children:j&&y===P.length&&g.jsx("div",{className:"h-1 bg-blue-500 rounded-full mx-1 mt-1"})}),P.length===0&&j&&g.jsx("div",{className:"h-20 border-2 border-dashed border-blue-300 rounded-lg bg-blue-50/50 flex items-center justify-center",children:g.jsx("span",{className:"text-sm text-blue-400",children:"Drop here"})})]}),c&&g.jsx("div",{className:"flex-shrink-0 border-t border-neutral-200 p-2",children:c(L)})]},L.id)})})}const hf={background:"#ffffff",hourLineColor:"#e5e7eb",halfHourLineColor:"#f3f4f6",hourTextColor:"#9ca3af",currentTimeColor:"#ef4444",allDayBackground:"#f9fafb",allDayBorder:"#e5e7eb"};function pf(r){const e=r.match(/^(\d{1,2}):(\d{2})$/);return e?{hours:parseInt(e[1],10),minutes:parseInt(e[2],10)}:null}function gf(r){const e=r%12||12,t=r<12?"AM":"PM";return`${e} ${t}`}function mf(r){const e=new Date;return r.getDate()===e.getDate()&&r.getMonth()===e.getMonth()&&r.getFullYear()===e.getFullYear()}function yf({items:r,date:e,startHour:t=7,endHour:n=22,hourHeight:s=60,getItemTime:o,getItemDuration:i,getItemIsAllDay:l,getItemId:a,renderItem:u,onItemClick:c,onTimeSlotClick:d,showCurrentTime:f=!0,className:h="",theme:p={}}){const m={...hf,...p},{allDayItems:x,timedItems:D}=w.useMemo(()=>{const _=[],S=[];for(const T of r)l(T)?_.push(T):S.push(T);return{allDayItems:_,timedItems:S}},[r,l]),y=w.useMemo(()=>{const _=[];for(let S=t;S<=n;S++)_.push(S);return _},[t,n]),A=(n-t+1)*s,C=w.useCallback(_=>{const S=o(_);if(!S)return null;const T=pf(S);if(!T)return null;const{hours:z,minutes:N}=T,L=Math.max(t,Math.min(n,z)),P=z<t?0:N,j=(L-t)*s+P/60*s,R=i(_),X=Math.max(20,R/60*s);return{top:j,height:X}},[o,i,t,n,s]),E=w.useMemo(()=>{if(!f||!mf(e))return null;const _=new Date,S=_.getHours(),T=_.getMinutes();return S<t||S>n?null:(S-t)*s+T/60*s},[e,f,t,n,s]),v=w.useCallback(_=>{if(!d)return;const S=_.currentTarget.getBoundingClientRect(),z=(_.clientY-S.top)/s*60,N=Math.floor(z/60)+t,L=Math.round(z%60/15)*15,P=Math.min(n,Math.max(t,N)),j=L>=60?0:L,R=`${P.toString().padStart(2,"0")}:${j.toString().padStart(2,"0")}`;d(R)},[d,s,t,n]);return g.jsxs("div",{className:h,style:{background:m.background},children:[x.length>0&&g.jsxs("div",{style:{padding:"8px 0 8px 60px",borderBottom:`1px solid ${m.allDayBorder}`,background:m.allDayBackground},children:[g.jsx("div",{style:{fontSize:"11px",color:m.hourTextColor,marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"All Day"}),g.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:x.map(_=>g.jsx("div",{onClick:()=>c==null?void 0:c(_),style:{cursor:c?"pointer":"default"},children:u(_)},a(_)))})]}),g.jsxs("div",{style:{position:"relative",height:A},children:[y.map((_,S)=>g.jsxs("div",{style:{position:"absolute",top:S*s,left:0,right:0},children:[g.jsx("div",{style:{position:"absolute",left:0,top:-8,width:"50px",textAlign:"right",paddingRight:"10px",fontSize:"11px",color:m.hourTextColor},children:gf(_)}),g.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,height:"1px",background:m.hourLineColor}}),S<y.length-1&&g.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:s/2,height:"1px",background:m.halfHourLineColor}})]},_)),g.jsx("div",{style:{position:"absolute",left:"60px",right:0,top:0,bottom:0,cursor:d?"pointer":"default"},onClick:v}),E!==null&&g.jsxs("div",{style:{position:"absolute",left:"55px",right:0,top:E,zIndex:20,pointerEvents:"none"},children:[g.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:m.currentTimeColor,marginLeft:"-5px",marginTop:"-5px",position:"absolute"}}),g.jsx("div",{style:{marginLeft:"5px",height:"2px",background:m.currentTimeColor}})]}),D.map(_=>{const S=C(_);return S?g.jsx("div",{style:{position:"absolute",left:"64px",right:"8px",top:S.top,height:S.height,zIndex:10,cursor:c?"pointer":"default"},onClick:T=>{T.stopPropagation(),c==null||c(_)},children:u(_)},a(_)):null})]})]})}function xf({onComplete:r,onCancel:e,onTranscribe:t,transcribing:n,variant:s="widget",hideSaveButton:o=!1}){const i=s==="widget",[l,a]=w.useState("idle"),[u,c]=w.useState(0),[d,f]=w.useState(0),[h,p]=w.useState(!1),[m,x]=w.useState(0),[D,y]=w.useState(null),[A,C]=w.useState(!1),[E,v]=w.useState(null),_=w.useRef(null),S=w.useRef(null),T=w.useRef(null),z=w.useRef(null),N=w.useRef(null),L=w.useRef([]),P=w.useRef(null),j=w.useRef(null),R=w.useRef(null),X=w.useRef(null),ge=w.useRef(!1),ie=w.useRef([]),De=w.useRef(null),Ce=w.useRef(null),Ie=w.useRef([]),ze=w.useRef([]),Me=w.useRef("insert"),Ve=w.useRef(!1),be=w.useRef(0),he=w.useRef(0),Le=w.useRef(0),je=U=>{const B=Math.floor(U/60),Z=Math.floor(U%60);return`${B.toString().padStart(2,"0")}:${Z.toString().padStart(2,"0")}`},me=async U=>{const B=await U.arrayBuffer(),Z=new AudioContext,J=await Z.decodeAudioData(B);return await Z.close(),J},He=U=>{const B=U.numberOfChannels,Z=U.sampleRate,J=1,k=16,$=k/8,H=B*$,Q=Z*H,ee=U.length*H,oe=new ArrayBuffer(44+ee),re=new DataView(oe),te=(fe,ue)=>{for(let Re=0;Re<ue.length;Re++)re.setUint8(fe+Re,ue.charCodeAt(Re))};te(0,"RIFF"),re.setUint32(4,36+ee,!0),te(8,"WAVE"),te(12,"fmt "),re.setUint32(16,16,!0),re.setUint16(20,J,!0),re.setUint16(22,B,!0),re.setUint32(24,Z,!0),re.setUint32(28,Q,!0),re.setUint16(32,H,!0),re.setUint16(34,k,!0),te(36,"data"),re.setUint32(40,ee,!0);const ye=[];for(let fe=0;fe<B;fe++)ye.push(U.getChannelData(fe));let Se=44;for(let fe=0;fe<U.length;fe++)for(let ue=0;ue<B;ue++){const Re=Math.max(-1,Math.min(1,ye[ue][fe])),Pe=Re<0?Re*32768:Re*32767;re.setInt16(Se,Pe,!0),Se+=2}return new Blob([oe],{type:"audio/wav"})},Tt=async(U,B,Z,J)=>{const k=new AudioContext,$=U.sampleRate,H=Math.max(U.numberOfChannels,B.numberOfChannels),Q=Math.min(Z,U.length),ee=Math.max(0,U.length-Z),oe=J==="insert"?Q+B.length+ee:Q+B.length,re=k.createBuffer(H,oe,$);for(let te=0;te<H;te++){const ye=re.getChannelData(te),Se=te<U.numberOfChannels?U.getChannelData(te):U.getChannelData(0);for(let ue=0;ue<Q;ue++)ye[ue]=Se[ue];const fe=te<B.numberOfChannels?B.getChannelData(te):B.getChannelData(0);for(let ue=0;ue<B.length;ue++)ye[Q+ue]=fe[ue];if(J==="insert")for(let ue=0;ue<ee;ue++)ye[Q+B.length+ue]=Se[Z+ue]}return await k.close(),re},bt=w.useCallback(()=>{const U=_.current;if(!U)return;const B=U.getContext("2d");if(!B)return;const Z=U.getBoundingClientRect(),J=Z.width,k=Z.height,$=ie.current,H=d||u||1,Q=l==="recording"?u:m;B.fillStyle="#2d3b35",B.fillRect(0,0,J,k);const ee=8,oe="rgba(0, 0, 0, 0.4)",re=B.createLinearGradient(0,0,0,ee);re.addColorStop(0,oe),re.addColorStop(1,"transparent"),B.fillStyle=re,B.fillRect(0,0,J,ee);const te=B.createLinearGradient(0,k-ee,0,k);te.addColorStop(0,"transparent"),te.addColorStop(1,oe),B.fillStyle=te,B.fillRect(0,k-ee,J,ee);const ye=B.createLinearGradient(0,0,ee,0);ye.addColorStop(0,oe),ye.addColorStop(1,"transparent"),B.fillStyle=ye,B.fillRect(0,0,ee,k);const Se=B.createLinearGradient(J-ee,0,J,0);Se.addColorStop(0,"transparent"),Se.addColorStop(1,oe),B.fillStyle=Se,B.fillRect(J-ee,0,ee,k),B.strokeStyle="#5a6b62",B.lineWidth=1,B.beginPath(),B.moveTo(0,k/2),B.lineTo(J,k/2),B.stroke();const fe=J/2;if($.length>0)if(l==="recording")for(let Pe=0;Pe<$.length;Pe++){const lt=$.length-1-Pe,_t=fe-lt*4;if(_t<-3||_t>J)continue;const dt=$[Pe]*(k/2-12),Nt=k/2-dt;B.fillStyle="#10b981",B.fillRect(_t,Nt,3,dt*2)}else{const Pe=H>0?Q/H*$.length:0;for(let lt=0;lt<$.length;lt++){const _t=Pe-lt,dt=fe-_t*4;if(dt<-3||dt>J)continue;const Nt=$[lt]*(k/2-12),fr=k/2-Nt;B.fillStyle=lt<=Pe?"#10b981":"#4b5563",B.fillRect(dt,fr,3,Nt*2)}}B.strokeStyle="#ef4444",B.lineWidth=1,B.beginPath(),B.moveTo(fe,0),B.lineTo(fe,k),B.stroke(),B.fillStyle="#fff",B.font="bold 18px monospace",B.textAlign="center",B.fillText(je(Q),fe,k-6),l==="recording"&&(B.fillStyle="#ef4444",B.beginPath(),B.arc(20,20,8,0,Math.PI*2),B.fill(),B.fillStyle="#fff",B.font="10px sans-serif",B.textAlign="left",B.fillText("REC",34,24)),B.textAlign="left"},[l,m,u,d]),Mt=()=>{const U=N.current;if(!U||!ge.current)return;const B=U.frequencyBinCount,Z=new Uint8Array(B);U.getByteTimeDomainData(Z);let J=0;for(let H=0;H<B;H++){const Q=(Z[H]-128)/128;J+=Q*Q}const k=Math.sqrt(J/B),$=Math.min(1,k*3);ie.current.push($),bt(),ge.current&&(j.current=requestAnimationFrame(Mt))},it=async()=>{try{y(null),C(!1),De.current===null&&(ie.current=[]);const U=await navigator.mediaDevices.getUserMedia({audio:!0});T.current=U;const B=new AudioContext;z.current=B;const Z=B.createAnalyser();Z.fftSize=2048,N.current=Z,B.createMediaStreamSource(U).connect(Z);const k=new MediaRecorder(U);S.current=k,L.current=[],k.ondataavailable=$=>{$.data.size>0&&L.current.push($.data)},k.onstop=async()=>{try{if(ge.current=!1,L.current.length===0){y("No audio was recorded. Please try again."),a("idle"),U.getTracks().forEach(re=>re.stop());return}const $=new Blob(L.current,{type:"audio/webm"});let H,Q;if(De.current!==null&&Ce.current)try{const re=await me($),te=Ce.current.sampleRate,ye=Math.floor(De.current*te),Se=await Tt(Ce.current,re,ye,Me.current);H=He(Se),Q=Se.length/Se.sampleRate,Me.current==="insert"&&(ie.current=[...ie.current,...ze.current]),De.current=null,Ce.current=null,Ie.current=[],ze.current=[]}catch{H=$,Q=be.current>0?be.current:1}else H=$,Q=be.current>0?be.current:1;X.current=H;const ee=URL.createObjectURL(H),oe=new Audio(ee);oe.ontimeupdate=()=>{x(oe.currentTime)},oe.onended=()=>{p(!1)},R.current=oe,f(Q),x(Q),a("editing"),U.getTracks().forEach(re=>re.stop())}catch{y("Failed to process recording"),a("idle")}},k.start(100),ge.current=!0,a("recording"),c(0),be.current=0,P.current=setInterval(()=>{be.current+=1,c(be.current)},1e3)}catch{y("Could not access microphone. Please allow microphone access.")}},ot=()=>{ge.current=!1,C(!1),v(null),j.current&&(cancelAnimationFrame(j.current),j.current=null),P.current&&(clearInterval(P.current),P.current=null),S.current&&S.current.state!=="inactive"&&S.current.stop()},Je=U=>{const B=_.current;if(!B)return;const Z=d||u;if(Z<=0)return;const J=ie.current;if(J.length===0)return;const k=B.getBoundingClientRect(),$=U-he.current,H=4,Q=k.width/B.width,ee=J.length/Z*H,oe=-$/(ee*Q),re=Le.current+oe,te=Math.max(0,Math.min(re,Z));R.current&&(R.current.currentTime=te),x(te)},tt=()=>{R.current&&(R.current.currentTime=0),x(0)},Bt=()=>{const U=d||u;R.current&&(R.current.currentTime=U),x(U)},V=()=>{const U=R.current;U&&(h?(U.pause(),x(U.currentTime),p(!1)):(U.currentTime=m,U.play().catch(()=>{}),p(!0)))},Be=async U=>{if(!X.current){it();return}try{R.current&&(R.current.pause(),p(!1)),Me.current=U,Ce.current=await me(X.current);const B=d||u;De.current=m;const Z=B>0?m/B:0,J=Math.floor(Z*ie.current.length);Ie.current=ie.current.slice(0,J),ze.current=ie.current.slice(J),ie.current=[...Ie.current],it()}catch{y("Failed to prepare recording. Please try again.")}},rt=()=>{R.current&&(R.current.pause(),R.current=null),X.current=null,Ce.current=null,De.current=null,Ie.current=[],p(!1),x(0),f(0),c(0),it()},ct=()=>{X.current?r(X.current,d||u):alert("No audio recorded yet!")};if(w.useEffect(()=>{l==="recording"&&_.current&&N.current&&ge.current&&(j.current=requestAnimationFrame(Mt))},[l]),w.useEffect(()=>{const U=_.current;if(!U)return;const B=()=>{const Z=window.devicePixelRatio||1,J=U.getBoundingClientRect();U.width=J.width*Z,U.height=J.height*Z;const k=U.getContext("2d");k&&k.scale(Z,Z)};return B(),window.addEventListener("resize",B),()=>window.removeEventListener("resize",B)},[]),w.useEffect(()=>{if(l==="idle"){const U=_.current;if(!U)return;const B=U.getContext("2d");if(!B)return;const Z=U.getBoundingClientRect(),J=Z.width,k=Z.height;B.fillStyle="#2d3b35",B.fillRect(0,0,J,k);const $=8,H="rgba(0, 0, 0, 0.4)",Q=B.createLinearGradient(0,0,0,$);Q.addColorStop(0,H),Q.addColorStop(1,"transparent"),B.fillStyle=Q,B.fillRect(0,0,J,$);const ee=B.createLinearGradient(0,k-$,0,k);ee.addColorStop(0,"transparent"),ee.addColorStop(1,H),B.fillStyle=ee,B.fillRect(0,k-$,J,$);const oe=B.createLinearGradient(0,0,$,0);oe.addColorStop(0,H),oe.addColorStop(1,"transparent"),B.fillStyle=oe,B.fillRect(0,0,$,k);const re=B.createLinearGradient(J-$,0,J,0);re.addColorStop(0,"transparent"),re.addColorStop(1,H),B.fillStyle=re,B.fillRect(J-$,0,$,k),B.strokeStyle="#5a6b62",B.lineWidth=1,B.beginPath(),B.moveTo(0,k/2),B.lineTo(J,k/2),B.stroke();const te=J/2;B.strokeStyle="#ef4444",B.lineWidth=1,B.beginPath(),B.moveTo(te,0),B.lineTo(te,k),B.stroke(),B.fillStyle="#fff",B.font="bold 18px monospace",B.textAlign="center",B.fillText("00:00",te,k-6)}},[l]),w.useEffect(()=>()=>{ge.current=!1,P.current&&clearInterval(P.current),j.current&&cancelAnimationFrame(j.current),T.current&&T.current.getTracks().forEach(U=>U.stop()),z.current&&z.current.state!=="closed"&&z.current.close()},[]),w.useEffect(()=>{if(l==="editing"&&h){let U;const B=()=>{const Z=R.current;if(Z&&h){const J=_.current;if(J){const k=J.getContext("2d");if(k){const $=J.getBoundingClientRect(),H=$.width,Q=$.height,ee=ie.current,oe=d||u||1,re=Z.currentTime;k.fillStyle="#2d3b35",k.fillRect(0,0,H,Q);const te=8,ye="rgba(0, 0, 0, 0.4)",Se=k.createLinearGradient(0,0,0,te);Se.addColorStop(0,ye),Se.addColorStop(1,"transparent"),k.fillStyle=Se,k.fillRect(0,0,H,te);const fe=k.createLinearGradient(0,Q-te,0,Q);fe.addColorStop(0,"transparent"),fe.addColorStop(1,ye),k.fillStyle=fe,k.fillRect(0,Q-te,H,te);const ue=k.createLinearGradient(0,0,te,0);ue.addColorStop(0,ye),ue.addColorStop(1,"transparent"),k.fillStyle=ue,k.fillRect(0,0,te,Q);const Re=k.createLinearGradient(H-te,0,H,0);Re.addColorStop(0,"transparent"),Re.addColorStop(1,ye),k.fillStyle=Re,k.fillRect(H-te,0,te,Q),k.strokeStyle="#5a6b62",k.lineWidth=1,k.beginPath(),k.moveTo(0,Q/2),k.lineTo(H,Q/2),k.stroke();const Pe=H/2,lt=3,_t=4,dt=oe>0?re/oe*ee.length:0;for(let Qt=0;Qt<ee.length;Qt++){const ys=dt-Qt,hr=Pe-ys*_t;if(hr<-lt||hr>H)continue;const Fr=ee[Qt]*(Q/2-12),xs=Q/2-Fr;k.fillStyle=Qt<=dt?"#10b981":"#4b5563",k.fillRect(hr,xs,lt,Fr*2)}k.strokeStyle="#ef4444",k.lineWidth=1,k.beginPath(),k.moveTo(Pe,0),k.lineTo(Pe,Q),k.stroke(),k.fillStyle="#fff",k.font="bold 18px monospace",k.textAlign="center";const Nt=Math.floor(re/60),fr=Math.floor(re%60);k.fillText(`${Nt.toString().padStart(2,"0")}:${fr.toString().padStart(2,"0")}`,Pe,Q-6),k.textAlign="left"}}U=requestAnimationFrame(B)}};return U=requestAnimationFrame(B),()=>cancelAnimationFrame(U)}},[l,h,d,u]),w.useEffect(()=>{l==="editing"&&!h&&bt()},[l,m,h,bt]),D)return g.jsxs("div",{style:{border:"1px solid #fecaca",borderRadius:"12px",padding:"16px",background:"#fef2f2"},children:[g.jsx("p",{style:{fontSize:"14px",color:"#dc2626",marginBottom:"12px"},children:D}),g.jsx("button",{onClick:()=>{y(null),it()},style:{padding:"8px 16px",fontSize:"14px",background:"#171717",color:"white",borderRadius:"8px",border:"none",cursor:"pointer"},children:"Try Again"})]});const qe={padding:"8px",borderRadius:"8px",border:"none",background:"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.15s"},Qe={...qe,opacity:.3,cursor:"not-allowed"},$t=i?{border:"1px solid #e5e5e5",borderRadius:"12px",overflow:"hidden",background:"white"}:{overflow:"hidden",background:"white",height:"100%",display:"flex",flexDirection:"column"};return g.jsxs("div",{style:$t,children:[g.jsx("canvas",{ref:_,style:{width:"100%",height:"64px",cursor:"pointer",flexShrink:0},onMouseDown:U=>{if(l==="editing"){Ve.current=!0,he.current=U.clientX,Le.current=m;const B=J=>{Ve.current&&Je(J.clientX)},Z=()=>{Ve.current=!1,window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",Z)};window.addEventListener("mousemove",B),window.addEventListener("mouseup",Z)}}}),g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:i?"10px 12px":"8px",borderTop:"1px solid #d4d4d4",background:"linear-gradient(to bottom, #e0e0e0 0%, #c8c8c8 100%)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -1px 0 rgba(0,0,0,0.1)",flexShrink:0},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[g.jsx("button",{onClick:tt,disabled:l==="idle"||l==="recording",style:l==="idle"||l==="recording"?Qe:qe,title:"Go to start",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"first_page"})}),g.jsx("button",{onClick:()=>{if(l==="recording"){const U=S.current;U&&(U.state==="recording"?(U.pause(),C(!0)):U.state==="paused"&&(U.resume(),C(!1)))}else V()},disabled:l==="idle",style:l==="idle"?Qe:qe,title:h||l==="recording"&&!A?"Pause":"Play",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:h||l==="recording"&&!A?"pause":"play_arrow"})}),g.jsx("button",{onClick:Bt,disabled:l==="idle"||l==="recording",style:l==="idle"||l==="recording"?Qe:qe,title:"Go to end",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"last_page"})}),g.jsx("div",{style:{width:"1px",height:"24px",margin:"0 4px",background:"linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(0,0,0,0.15))"}}),g.jsx("button",{onClick:()=>{E==="insert"?ot():l==="idle"?(v("insert"),it()):l==="editing"&&(v("insert"),Be("insert"))},disabled:l==="recording"&&E!=="insert"||h,style:l==="recording"&&E!=="insert"||h?Qe:qe,title:E==="insert"?"Stop recording":"Insert recording",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:E==="insert"?"#ef4444":"#171717"},children:"add"})}),g.jsx("button",{onClick:()=>{E==="mic"?ot():l==="idle"?(v("mic"),it()):l==="editing"&&(v("mic"),Be("replace"))},disabled:l==="recording"&&E!=="mic"||h,style:l==="recording"&&E!=="mic"||h?Qe:qe,title:E==="mic"?"Stop recording":"Record",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:E==="mic"?"#ef4444":"#171717"},children:"mic"})}),g.jsx("button",{onClick:()=>{E==="startover"?ot():l==="editing"&&(v("startover"),rt())},disabled:l==="idle"||l==="recording"&&E!=="startover"||h,style:l==="idle"||l==="recording"&&E!=="startover"||h?Qe:qe,title:E==="startover"?"Stop recording":"Start over",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:E==="startover"?"#ef4444":"#171717"},children:"refresh"})})]}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t&&g.jsx("button",{onClick:()=>X.current&&t(X.current),disabled:l!=="editing"||n,style:l!=="editing"||n?Qe:qe,title:n?"Transcribing...":"Transcribe audio",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:n?"hourglass_empty":"subtitles"})}),!o&&g.jsx("button",{onClick:ct,disabled:l!=="editing",style:l!=="editing"?Qe:qe,title:"Save recording",children:g.jsx("span",{className:"material-icons",style:{fontSize:"20px",color:"#171717"},children:"save"})})]})]})]})}exports.AnimatedCardFlip=hu;exports.ApiClient=al;exports.AudioEditor=xf;exports.AuthManager=ll;exports.Card=cu;exports.ComboBox=df;exports.DataOperations=Bn;exports.Detail=du;exports.GraphClient=$a;exports.KanbanBoard=ff;exports.Mail=gu;exports.MailClient=ol;exports.MailComposer=uf;exports.MailEditor=Ba;exports.SelectableList=mu;exports.Stack=uu;exports.Timeline=yf;exports.getApiClient=oi;exports.initializeApiClient=iu;exports.useMutation=ou;exports.useQuery=ul;