@bolttech/template-editor 0.0.12 → 0.1.0
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/README.md +79 -63
- package/dist/template-editor.cjs +228 -86
- package/dist/template-editor.d.ts +4 -3
- package/dist/template-editor.mjs +25016 -6677
- package/package.json +7 -3
package/dist/template-editor.cjs
CHANGED
|
@@ -1,89 +1,231 @@
|
|
|
1
|
-
"use strict";var Fd=Object.defineProperty;var Ed=(e,r,a)=>r in e?Fd(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a;var Fe=(e,r,a)=>Ed(e,typeof r!="symbol"?r+"":r,a);Object.defineProperty(exports,"__esModule",{value:!0});const o=require("react/jsx-runtime"),Sd=require("react-shadow"),S=require("react"),H=require("@craftjs/core"),qe=require("react-icons/ri"),T=require("react-icons/fi"),kd=require("htmlparser2"),Ad=require("@monaco-editor/react"),Nd=require("react-dom"),zt=require("react-icons/lu"),jd=require("@craftjs/utils"),_d=require("re-resizable"),Bd=require("@bolttech/templating-sdk");function An(e){return e&&e.__esModule?e:{default:e}}function Td(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const u=Object.getOwnPropertyDescriptor(s,i);u&&Object.defineProperty(e,i,u.get?u:{enumerable:!0,get:function(){return s[i]}})}}}return Object.freeze(e)}const Ld=An(Sd),Ke=An(S),Pd=An(Ad),so=({text:e="Text",style:r,href:a,...s})=>{const{connectors:{connect:i,drag:u},selected:d}=H.useNode(h=>({selected:h.events.selected})),{isEnabled:p}=H.useEditor(h=>({isEnabled:h.options.enabled})),f=()=>({...{fontFamily:"inherit",fontWeight:"500",cursor:d?"pointer":"default",transition:"all 0.2s",padding:"8px 16px",fontSize:"16px",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap",display:"inline-flex",textDecoration:"none",lineHeight:"1.5",alignItems:"center",justifyContent:"center"},...r});return o.jsx("a",{ref:h=>{h&&i(u(h))},style:f(),href:p?void 0:a,target:"_blank",...s,children:e})},Id={props:{text:"Text",target:"_blank",style:{fontFamily:"inherit",fontWeight:"500",cursor:"pointer",transition:"all 0.2s",padding:"8px 16px",fontSize:"16px",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap",display:"inline-flex",textDecoration:"none",lineHeight:"1.5",alignItems:"center",justifyContent:"center"}},displayName:"Anchor",custom:{displayName:"Anchor",settings:["anchor","typography","background","border","spacing"]}};function Nn(){const{actions:{setProp:e},text:r,href:a}=H.useNode(s=>({text:s.data.props.text,href:s.data.props.href}));return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Text"}),o.jsx("input",{type:"text",value:r,onChange:s=>e(i=>i.text=s.target.value),className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Link"}),o.jsx("input",{type:"text",value:a||"",onChange:s=>{e(i=>i.href=s.target.value)},className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}so.craft={...Id,related:{settings:Nn}};const oo=({children:e,style:r,...a})=>{const{connectors:{connect:s,drag:i}}=H.useNode(d=>({selected:d.events.selected})),u={...r,overflow:"visible",boxSizing:"border-box",...r?.height==="auto"&&{height:"auto",minHeight:r?.minHeight||"50px"}};return o.jsx("div",{ref:d=>{d&&s(i(d))},style:u,...a,children:e})},Od={displayName:"Box",isCanvas:!0,custom:{resizable:!0,settings:["box","default"]},props:{style:{border:"none",borderRadius:"0px",width:"100%",height:"auto",minHeight:"50px"}}};oo.craft={...Od};const Ve=({options:e,value:r,onChange:a,placeholder:s="Select an option",disabled:i=!1,className:u=""})=>o.jsxs("div",{className:`relative ${u}`,children:[o.jsxs("select",{value:r||"",onChange:d=>a?.(d.target.value),disabled:i,className:`w-full appearance-none rounded-none border border-[#E8E7EE] bg-white px-3 py-2 pr-10 text-sm text-gray-700 transition-all duration-200 hover:border-[#170F4F]/30 hover:bg-gray-50 focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]/20 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400 ${r?"text-gray-700":"text-gray-500"} `,children:[s&&o.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),e.map(d=>o.jsx("option",{value:d.value,children:d.label},d.value))]}),o.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:o.jsx(T.FiChevronDown,{size:16,className:`transition-colors duration-200 ${i?"text-gray-400":"text-gray-500"}`})})]});function io(){const{actions:{setProp:e},style:r}=H.useNode(s=>({style:s.data.props.style})),a=r.display==="block"?"block":r.flexDirection;return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Layout direction"}),o.jsx(Ve,{options:[{value:"row",label:"Row"},{value:"column",label:"Column"},{value:"block",label:"Block"}],value:a,onChange:s=>{e(s==="block"?i=>{i.style.display="block",delete i.style.flexDirection}:i=>{i.style.display="flex",i.style.flexDirection=s})},placeholder:"Choose alignment"})]}),r.display!=="block"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Alignment"}),o.jsx(Ve,{options:[{value:"flex-start",label:"Flex Start"},{value:"flex-end",label:"Flex End"},{value:"center",label:"Center"},{value:"space-between",label:"Space Between"},{value:"space-around",label:"Space Around"},{value:"space-evenly",label:"Space Evenly"}],value:r.justifyContent,onChange:s=>e(i=>i.style.justifyContent=s),placeholder:"Choose alignment"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Gap"}),o.jsx(Ve,{options:[{value:"0px",label:"0"},{value:"4px",label:"4"},{value:"8px",label:"8"},{value:"12px",label:"12"},{value:"16px",label:"16"},{value:"24px",label:"24"},{value:"32px",label:"32"},{value:"48px",label:"48"},{value:"64px",label:"64"}],value:r.gap,onChange:s=>e(i=>i.style.gap=s),placeholder:"Choose gap"})]})]})]})}const lo=({text:e="Button",onClick:r,style:a,...s})=>{const{connectors:{connect:i,drag:u},selected:d}=H.useNode(f=>({selected:f.events.selected})),p=()=>({...{fontFamily:"inherit",fontWeight:"500",cursor:d?"pointer":"default",transition:"all 0.2s",padding:"8px 16px",fontSize:"16px",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap"},...a});return o.jsx("button",{ref:f=>{f&&i(u(f))},style:p(),className:`${d?"ring-primary-500 ring-2 ring-opacity-50":"hover:ring-2 hover:ring-gray-300 hover:ring-opacity-50"} transition-all duration-200`,onClick:r,...s,children:e})},Md={props:{text:"Button",style:{fontFamily:"inherit",fontWeight:"500",cursor:"pointer",transition:"all 0.2s",padding:"8px 16px",fontSize:"16",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap"}},displayName:"Button",custom:{displayName:"Button",settings:["button","typography","background","border","spacing"]}};function jn(){const{actions:{setProp:e},text:r,href:a}=H.useNode(s=>({text:s.data.props.text,href:s.data.props.href}));return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Button text"}),o.jsx("input",{type:"text",value:r,onChange:s=>e(i=>i.text=s.target.value),className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Link"}),o.jsx("input",{type:"text",value:a||"",onChange:s=>{e(i=>i.onClick=()=>{window.open(s.target.value,"_blank")}),e(i=>i.href=s.target.value)},className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}lo.craft={...Md,related:{settings:jn}};function _n(){const{actions:{setProp:e},style:r}=H.useNode(a=>({style:a.data.props.style}));return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Height"}),o.jsx("input",{type:"text",value:r.height,onChange:a=>e(s=>s.style.height=a.target.value),placeholder:"1px",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Width"}),o.jsx("input",{type:"text",value:r.width,onChange:a=>e(s=>s.style.width=a.target.value),placeholder:"100%",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}const Bn=({style:e,...r})=>{const{connectors:{connect:a,drag:s},selected:i}=H.useNode(d=>({selected:d.events.selected})),u={...e,cursor:i?"pointer":"default"};return o.jsx("hr",{ref:d=>{d&&a(s(d))},style:u,className:`${i?"ring-primary-500 ring-2 ring-opacity-50":"hover:ring-2 hover:ring-gray-300 hover:ring-opacity-50"} transition-all duration-200`,...r})};Bn.craft={props:{style:{height:"1px",width:"100%",margin:"16px 0",backgroundColor:"#e5e7eb"}},related:{settings:_n}};const Rd={props:{style:{marginTop:"0px",marginRight:"0px",marginBottom:"0px",marginLeft:"0px",backgroundColor:"#e5e7eb",height:"1px",width:"100%"}},related:{settings:"DividerSettings"},custom:{displayName:"Divider",settings:["divider","background","spacing"]}};Bn.craft={...Rd};const uo=({src:e="https://picsum.photos/id/1/1200/1200",alt:r="Image",style:a,...s})=>{const{connectors:{connect:i,drag:u},selected:d}=H.useNode(f=>({selected:f.events.selected})),p={...a,cursor:d?"pointer":"default"};return o.jsx("img",{ref:f=>{f&&i(u(f))},src:e,alt:r,style:p,className:`${d?"ring-primary-500 ring-2 ring-opacity-50":"hover:ring-2 hover:ring-gray-300 hover:ring-opacity-50"}`,...s})},zd={props:{src:"https://picsum.photos/id/1/1200/1200",alt:"Image",style:{width:"200px",height:"200px",objectFit:"cover",borderRadius:"0px"}},custom:{resizable:!0,settings:["image","border"]},related:{settings:"ImageSettings"}};function Tn(){const{actions:{setProp:e},src:r,alt:a,style:s}=H.useNode(i=>({src:i.data.props.src,alt:i.data.props.alt,style:i.data.props.style}));return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Image URL"}),o.jsx("input",{type:"text",value:r,onChange:i=>e(u=>u.src=i.target.value),placeholder:"https://example.com/image.jpg",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Alt Text"}),o.jsx("input",{type:"text",value:a,onChange:i=>e(u=>u.alt=i.target.value),placeholder:"Image description",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Width"}),o.jsx("input",{type:"text",value:s.width,onChange:i=>e(u=>u.style.width=i.target.value),placeholder:"100%",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Height"}),o.jsx("input",{type:"text",value:s.height,onChange:i=>e(u=>u.style.height=i.target.value),placeholder:"auto",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Object Fit"}),o.jsx(Ve,{options:[{value:"cover",label:"Cover"},{value:"contain",label:"Contain"},{value:"fill",label:"Fill"},{value:"none",label:"None"},{value:"scale-down",label:"Scale Down"}],value:s.objectFit,onChange:i=>e(u=>u.style.objectFit=i),placeholder:"Choose object fit"})]})]})}uo.craft={...zd,related:{settings:Tn}};const $d=({rows:e,columns:r,style:a,children:s,cellStyle:i,rowStyle:u,...d})=>{const{connectors:{connect:p,drag:f}}=H.useNode(D=>({selected:D.events.selected})),h=()=>({...{borderCollapse:"collapse",border:"1px solid #9CA3AF"},...a}),g=()=>({...u}),w=Array.from({length:e},(D,y)=>Array.from({length:r},(v,E)=>y*r+E));return o.jsx("table",{ref:D=>{D&&p(f(D))},style:h(),...d,children:o.jsx("tbody",{children:w.map((D,y)=>o.jsx("tr",{style:y%2===0?g():{},children:D.map((v,E)=>o.jsx("td",{style:i,children:s?.props?.children?.[y*r+E]||v},E))},y))})})};function co(){const{actions:{setProp:e},rows:r,columns:a,rowStyle:s}=H.useNode(i=>({rows:i.data.props.rows,columns:i.data.props.columns,rowStyle:i.data.props.rowStyle}));return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{className:"flex flex-row space-x-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Rows"}),o.jsx("input",{type:"number",value:r,onChange:i=>e(u=>u.rows=parseInt(i.target.value)),className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Columns"}),o.jsx("input",{type:"number",value:a,onChange:i=>{e(u=>u.columns=parseInt(i.target.value))},className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]}),o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Row Background Color (odd)"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"color",value:s.backgroundColor,onChange:i=>e(u=>u.rowStyle.backgroundColor=i.target.value),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),o.jsx("input",{type:"text",value:s.backgroundColor,onChange:i=>e(u=>u.rowStyle.backgroundColor=i.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})]})]})}const Hd=new Set(["Delete","Backspace","Escape","Enter","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function qd({tagName:e="div",html:r,innerRef:a,onChange:s,disabled:i=!1,editable:u=!0,onBlur:d,onKeyUp:p,onKeyDown:f,...h}){const g=S.useRef(null),w=S.useRef(r),D=S.useRef(!1),y=S.useRef(r),v=S.useCallback(()=>(a&&typeof a!="function"?a:g).current,[a]),E=S.useCallback((_,$)=>Object.assign({},_,{target:{value:$}}),[]),C=S.useCallback(_=>{const $=v();if(!$||!s)return;const L=$.innerHTML;L!==w.current&&(y.current=L,D.current=!0,w.current=L,s(E(_,L)))},[v,s,E]),x=S.useCallback((_,$)=>{if(document.activeElement!==_){$();return}const L=window.getSelection();if(!L||L.rangeCount===0){$();return}const oe=L.getRangeAt(0).startOffset;$();try{const ae=document.createRange(),ee=_.firstChild||_,Re=Math.min(oe,ee.textContent?.length||0);ae.setStart(ee,Re),ae.collapse(!0),L.removeAllRanges(),L.addRange(ae)}catch{}},[]);S.useEffect(()=>{const _=v();_&&r!==w.current&&!D.current&&x(_,()=>{_.innerHTML=r,y.current=r,w.current=r})},[r,v,x]),S.useEffect(()=>{const _=v();_&&r!==_.innerHTML&&(_.innerHTML=r),y.current=r,w.current=r},[v,r]),S.useEffect(()=>{u||(D.current=!1)},[u]);const A=S.useCallback(_=>{u&&Hd.has(_.key)&&_.stopPropagation(),f?.(_),u&&C(_)},[u,f,C]),j=S.useCallback(_=>{u&&_.stopPropagation(),p?.(_),u&&C(_)},[u,p,C]),N=S.useCallback(_=>{u&&(_.stopPropagation(),C(_))},[u,C]),P=S.useCallback(_=>{D.current=!1,d?.(_),u&&C(_)},[u,d,C]),M=S.useCallback(_=>{typeof a=="function"&&a(_),g.current=_},[a]);return Ke.default.createElement(e,{...h,ref:typeof a=="function"?M:a||g,contentEditable:!i&&u,suppressContentEditableWarning:!0,onInput:N,onBlur:P,onKeyUp:j,onKeyDown:A,dangerouslySetInnerHTML:{__html:r}})}const po=Ke.default.memo(qd,(e,r)=>!(r.editable===!1||e.editable!==r.editable||e.disabled!==r.disabled||e.tagName!==r.tagName||JSON.stringify(e.style)!==JSON.stringify(r.style)));po.displayName="ContentEditable";const Ud=[{name:"userName",label:"User Name",value:"John Doe"},{name:"userEmail",label:"User Email",value:"john@example.com"},{name:"companyName",label:"Company Name",value:"Acme Corp"},{name:"currentDate",label:"Current Date",value:new Date().toLocaleDateString()},{name:"currentTime",label:"Current Time",value:new Date().toLocaleTimeString()}],Wd=({ref:e,editableRef:r,position:a,onVariableInsert:s})=>{const{actions:i,style:u={}}=H.useNode(C=>({style:C.data.props.style||{}})),[d,p]=S.useState(!1),[f,h]=S.useState(!1),g=C=>{i.setProp(x=>{x.style={...x.style,...C}})},w=()=>{const x=(u.fontWeight||"normal")==="bold"?"normal":"bold";g({fontWeight:x})},D=()=>{const x=(u.fontStyle||"normal")==="italic"?"normal":"italic";g({fontStyle:x})},y=()=>{const C=u.textDecoration||"none",x=String(C).includes("underline")?"none":"underline";g({textDecoration:x})},v=C=>{g({color:C})},E=C=>{if(r.current){r.current.focus();const x=window.getSelection();if(x&&x.rangeCount>0){const A=x.getRangeAt(0);A.deleteContents();const j=document.createElement("span");j.className="variable-tag",j.style.cssText="background: #e3f2fd; border: 1px solid #90caf9; border-radius: 4px; padding: 2px 6px; margin: 0 2px; color: #1976d2; font-size: 0.9em; cursor: pointer;",j.setAttribute("data-variable",C.name),j.textContent=`{{${C.label}}}`,A.insertNode(j),A.setStartAfter(j),A.collapse(!0),x.removeAllRanges(),x.addRange(A)}}p(!1),s(C.name)};return o.jsx("div",{ref:e,className:"flex flex-wrap gap-2 rounded-lg border border-[#E8E7EE] bg-white p-3 shadow-lg",onMouseDown:C=>C.stopPropagation(),style:{position:"absolute",left:"50%",transform:"translateX(-50%)",zIndex:9999,top:a==="top"?"-70px":void 0,bottom:a==="bottom"?"-70px":void 0},children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{className:`flex items-center justify-center border p-2 transition-all duration-200 ${u.fontWeight==="bold"?"border-[#00BAC7] bg-[#CCF1F4] text-[#170F4F]":"border-[#E8E7EE] bg-white text-[#170F4F] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,title:"Bold",onClick:C=>{C.preventDefault(),C.stopPropagation(),w()},children:o.jsx(T.FiBold,{size:14})}),o.jsx("button",{className:`flex items-center justify-center border p-2 transition-all duration-200 ${u.fontStyle==="italic"?"border-[#00BAC7] bg-[#CCF1F4] text-[#170F4F]":"border-[#E8E7EE] bg-white text-[#170F4F] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,title:"Italic",onMouseDown:C=>{C.preventDefault(),C.stopPropagation(),D()},children:o.jsx(T.FiItalic,{size:14})}),o.jsx("button",{className:`flex items-center justify-center border p-2 transition-all duration-200 ${String(u.textDecoration).includes("underline")?"border-[#00BAC7] bg-[#CCF1F4] text-[#170F4F]":"border-[#E8E7EE] bg-white text-[#170F4F] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,title:"Underline",onMouseDown:C=>{C.preventDefault(),C.stopPropagation(),y()},children:o.jsx(T.FiUnderline,{size:14})}),o.jsx("button",{className:"ml-2 flex items-center justify-center border border-[#E8E7EE] bg-white p-2 text-[#170F4F] transition-all duration-200 hover:border-[#00BAC7] hover:bg-[#CCF1F4]",title:"Text Color",onMouseDown:C=>{C.preventDefault(),C.stopPropagation(),h(!f)},children:o.jsx(T.FiEdit3,{size:14})}),f&&o.jsx("input",{type:"color",className:"h-8 w-8 cursor-pointer border border-[#E8E7EE] bg-white hover:border-[#00BAC7]",value:u.color?.toString()||"#000000",onChange:C=>{v(C.target.value),h(!1)}}),o.jsx("button",{className:"flex items-center justify-center border border-[#E8E7EE] bg-white p-2 text-[#170F4F] transition-all duration-200 hover:border-[#00BAC7] hover:bg-[#CCF1F4]",title:"Insert Variable",onMouseDown:C=>{C.preventDefault(),C.stopPropagation(),p(!d)},children:o.jsx(T.FiCode,{size:14})}),d&&o.jsx("div",{className:"absolute left-0 top-full z-10 mt-1 border border-[#E8E7EE] bg-white shadow-lg",children:Ud.map(C=>o.jsx("button",{className:"block w-full border-none px-3 py-2 text-left text-[#170F4F] transition-colors hover:bg-[#CCF1F4]",onMouseDown:x=>{x.preventDefault(),x.stopPropagation(),E(C)},children:C.label},C.name))})]})})},Vd=({isEditing:e=!1,children:r="Double-click to edit text...",style:a={}})=>{const{setProp:s}=H.useNode(),[i,u]=S.useState("top"),d=S.useRef(null),p=S.useRef(null),f=S.useRef(null),h=S.useCallback(E=>{s(C=>{C.children=E})},[s]),g=S.useCallback(E=>{s(C=>(C.isEditing=E,C))},[s]),w=S.useCallback(E=>{E.preventDefault(),E.stopPropagation(),g(!0),p.current&&(p.current.getBoundingClientRect().top<window.innerHeight*.1?u("bottom"):u("top"))},[p]),D=S.useCallback(E=>{const C=E.target.value;C!==r&&h(C)},[r,h]),y=E=>{if(d.current){const C=window.getSelection();if(C&&C.rangeCount>0){const x=C.getRangeAt(0),A=document.createElement("span");A.setAttribute("data-variable",E),A.style.cssText="background: #e8f5e8; border: 1px solid #4caf50; border-radius: 4px; padding: 2px 6px; margin: 0 2px; color: #2e7d32; font-size: 0.9em;",A.textContent=`{{${E}}}`,x.deleteContents(),x.insertNode(A),x.setStartAfter(A),x.collapse(!0),C.removeAllRanges(),C.addRange(x);const j=d.current.innerHTML;h(j)}}};S.useEffect(()=>{const E=C=>{if(!e||!p.current)return;const x=C.target;p.current.contains(x)||f.current&&f.current.contains(x)||g(!1)};return e&&document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[e,g]);const v={cursor:e?"text":"pointer",userSelect:e?"text":"none",...a};return o.jsxs("div",{ref:p,onDoubleClick:w,style:{position:"relative",width:"100%",height:"100%"},children:[e&&o.jsx(Wd,{ref:f,editableRef:d,position:i,onVariableInsert:y}),o.jsx(po,{innerRef:E=>{d.current=E},tagName:"p",html:r,editable:e,onChange:D,style:v})]})},ho=Ke.default.memo(Vd,(e,r)=>!(e.isEditing!==r.isEditing||e.children!==r.children||JSON.stringify(e.style)!==JSON.stringify(r.style))),Jd={displayName:"Text",custom:{resizable:!0,tagHtml:"p",settings:["text","typography","default"]},props:{children:"Double click to edit text 2",isEditing:!1,style:{width:300,height:200,fontSize:16,fontWeight:"normal",color:"#000000",textAlign:"left",minHeight:"50px",padding:"8px",border:"none",outline:"none",overflow:"auto",position:"relative",wordWrap:"break-word",whiteSpace:"normal"}}};ho.craft={...Jd};function mo(){const{actions:{setProp:e},variableId:r,fallback:a}=H.useNode(s=>({variableId:s.data.props.variableId,fallback:s.data.props.fallback}));return o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Variable ID"}),o.jsx("input",{type:"text",value:r,onChange:s=>e(i=>i.variableId=s.target.value),placeholder:"ex: nome_usuario",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Default value"}),o.jsx("input",{type:"text",value:a,onChange:s=>e(i=>i.fallback=s.target.value),placeholder:"ex: Usuário",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}const Gd=({data:e,onSelect:r,selectedPath:a})=>!e||typeof e!="object"?null:o.jsx("div",{className:"space-y-2",children:Object.entries(e).map(([s,i])=>o.jsxs("button",{onClick:()=>r(s,i),className:`block w-full rounded px-3 py-2 text-left transition-colors ${a===s?"bg-blue-100 text-blue-800":"bg-gray-50 text-gray-700 hover:bg-gray-100"}`,children:[o.jsxs("span",{className:"font-medium",children:[s,":"]})," ",o.jsx("span",{className:"text-sm",children:JSON.stringify(i)})]},s))}),Kd=({isOpen:e,onClose:r,value:a,onSelect:s})=>{const[i,u]=S.useState(a||""),[d,p]=S.useState(null);return Ke.default.useEffect(()=>{const f=localStorage.getItem("bolttech_datasource");if(f)try{const h=JSON.parse(f);h&&typeof h=="object"&&h.data&&p({root:h.data})}catch{}},[e]),e?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-40",children:o.jsxs("div",{className:"flex w-full max-w-[40vw] flex-col rounded bg-white shadow-xl",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4",children:[o.jsx("h2",{className:"text-lg font-bold text-[#170f4f]",children:"Selecionar variável do DataSource"}),o.jsx("button",{onClick:r,className:"p-2 text-gray-400 hover:text-gray-600",children:o.jsx(T.FiX,{size:18})})]}),o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700",children:"Path da variável"}),o.jsx("input",{type:"text",value:i,onChange:f=>u(f.target.value),className:"focus:ring-primary-500 w-full rounded border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2",placeholder:"Ex: root.user.name"})]}),d&&o.jsx("div",{children:o.jsx(Gd,{data:d,onSelect:f=>u(f),selectedPath:i})}),o.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[o.jsx("button",{onClick:r,className:"rounded bg-gray-100 px-4 py-2 text-gray-700 transition-colors duration-200 hover:bg-gray-200",children:"Cancelar"}),o.jsx("button",{onClick:()=>{s(i),r()},className:"rounded bg-[#170f4f] px-4 py-2 text-white transition-colors duration-200 hover:bg-[#30aab3]",children:"Salvar"})]})]})]})}):null},fo=({variableId:e="variable",fallback:r="Default value",...a})=>{const{connectors:{connect:s,drag:i},selected:u,actions:{setProp:d}}=H.useNode(D=>({selected:D.events.selected})),[p,f]=S.useState(!1),h=`{{${e}}}`;let g;try{const D=localStorage.getItem("bolttech_datasource");if(D){const y=JSON.parse(D),v=y&&y.data;v&&e&&(g=e.split(".").reduce((C,x)=>C&&C[x]!==void 0?C[x]:void 0,{root:v}))}}catch{}const w={display:"inline-block",padding:"4px 8px",backgroundColor:"#fef3c7",border:"1px solid #f59e0b",borderRadius:"4px",color:"#92400e",fontFamily:"monospace",fontSize:"14px",cursor:u?"pointer":"default",transition:"all 0.2s"};return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:D=>{D&&s(i(D))},style:w,className:`${u?"ring-2 ring-yellow-400":"hover:ring-2 hover:ring-yellow-300 hover:ring-opacity-50"} transition-all duration-200`,title:`Variable: ${e}`,onClick:()=>f(!0),...a,children:g!=null?String(g):r||h}),o.jsx(Kd,{isOpen:p,onClose:()=>f(!1),value:e,onSelect:D=>d(y=>y.variableId=D)})]})};fo.craft={props:{variableId:"variavel",fallback:"Valor padrão"},related:{settings:mo}};const Jt=[{id:"box",label:"Box",icon:o.jsx(qe.RiBox3Line,{size:16}),category:"layout",component:oo,htmlTags:["div"],settings:io},{id:"text",label:"Text",icon:o.jsx(qe.RiText,{size:16}),category:"content",component:ho,htmlTags:["p","span","h1","h2","h3","h4","h5","h6"]},{id:"button",label:"Button",icon:o.jsx(qe.RiSquareLine,{size:16}),category:"interactive",component:lo,settings:jn,htmlTags:["button"]},{id:"a",label:"Anchor",icon:o.jsx(qe.RiSquareLine,{size:16}),category:"interactive",component:so,settings:Nn,htmlTags:["a"]},{id:"image",label:"Image",icon:o.jsx(qe.RiImageLine,{size:16}),category:"media",component:uo,settings:Tn,htmlTags:["img"]},{id:"divider",label:"Divider",icon:o.jsx(qe.RiSeparator,{size:16}),category:"layout",component:Bn,settings:_n,htmlTags:["hr"]},{id:"table",label:"Table",icon:o.jsx(qe.RiTableFill,{size:16}),category:"layout",component:$d,settings:co,htmlTags:["table"]},{id:"variable",label:"Variable",icon:o.jsx(qe.RiCodeSSlashLine,{size:16}),category:"dynamic",component:fo,settings:mo,htmlTags:["span"]}];function go(){const[e,r]=S.useState(!1),[a,s]=S.useState(!1),[i,u]=S.useState(!0);return{showPreview:e,togglePreview:()=>{r(E=>!E)},openPreview:()=>{r(!0)},closePreview:()=>{r(!1)},showCodePanel:a,toggleCodePanel:()=>{s(E=>!E)},openCodePanel:()=>{s(!0)},closeCodePanel:()=>{s(!1)},showSidebar:i,toggleSidebar:()=>{u(E=>!E)},isEditorEnabled:!(e||a),setIsEditorEnabled:E=>{r(!E),s(!E)}}}const bo={mobile:{width:375,height:667},tablet:{width:768,height:1024},desktop:{width:1200,height:800}};function Sr(){const{setIsEditorEnabled:e}=go(),{query:r,actions:a}=H.useEditor(),{nodes:s}=H.useEditor(h=>({nodes:h.nodes})),i=S.useMemo(()=>Object.keys(s).length>1,[s]),[u,d]=S.useState("desktop");return S.useEffect(()=>{const h=r.node("ROOT").get();h&&a.setProp(h.id,g=>{g.style={...g.style||{},maxWidth:bo[u].width||"100%"}})},[u]),{device:u,isEmpty:i,setDevice:d,getState:()=>{e(!1);try{return r.serialize()}catch(h){return console.warn("Error serializing canvas:",h),""}finally{e(!0)}},loadState:h=>{try{if(!h.includes("ROOT")){const g=JSON.parse(h),w={type:"div",isCanvas:!0,props:{id:"canvas",className:"relative flex-1 border border-gray-300 bg-white shadow-lg",style:{zIndex:1,minHeight:"100%",overflow:"visible",position:"relative",maxWidth:1200}},displayName:"div",custom:{},hidden:!1,nodes:Object.keys(g),linkedNodes:{}};h=JSON.stringify(w)}return a.deserialize(h)}catch(g){console.error("Error loading snapshot into canvas:",g)}}}}const Yd=new Set(["div","span","p","h1","h2","h3","h4","h5","h6","a","img","button","input","textarea","select","option","ul","ol","li","table","tr","td","th","thead","tbody","section","article","header","footer","nav","main","aside"]),Xd=new Set(["img","input","br","hr","meta","link","area","base","col","embed","source","track","wbr"]),Zd=new Set(["id","className","title","alt","src","href","target","rel"]),Qd=new Set(["width","height","min-width","min-height","max-width","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border-width","border-top-width","border-right-width","border-bottom-width","border-left-width","top","right","bottom","left","font-size","line-height","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","letter-spacing","word-spacing","text-indent","text-decoration-thickness"]);class ep{constructor(r={}){Fe(this,"options");this.options={inlineStyles:!0,prettify:!1,includeComments:!1,customComponentMap:{},styleTransformers:[],...r}}convert(r){try{const a=r.ROOT;if(!a||!a.nodes)return"";const s=this.buildHTMLFromNodes(a.nodes,r);return this.options.prettify?this.prettifyHTML(s):s}catch(a){return console.error("craftJSToHTML - Error during conversion:",a),""}}buildHTMLFromNodes(r,a){return r.map(s=>this.buildHTMLFromNode(s,a)).filter(s=>s.trim()!=="").join("")}buildHTMLFromNode(r,a){const s=a[r];if(!s||s.hidden)return"";const{type:i,props:u={},nodes:d=[]}=s,p=typeof i=="object"&&i&&"resolvedName"in i?i.resolvedName:i,f=this.getTagName(p,s),h=this.buildAttributes(u);let g="";if(f!=="table")g=this.buildHTMLFromNodes(d,a),u.children&&typeof u.children=="string"&&(g+=u.children),["button","a"].includes(f)&&u.text&&(g+=u.text);else{const y=d.map(v=>this.buildHTMLFromNodes([v],a));g+=this.generateTableHTML(s,y)}return this.isSelfClosingTag(f)?`<${f}${h} />`:`${this.options.includeComments?`<!-- ${p} -->`:""}<${f}${h}>${g}</${f}>`}getTagName(r,a){if(a.custom?.tagName&&typeof a.custom.tagName=="string")return a.custom.tagName.toLowerCase();if(a.custom?.tagHtml&&typeof a.custom.tagHtml=="string")return a.custom.tagHtml.toLowerCase();if(this.options.customComponentMap?.[r])return this.options.customComponentMap[r];const s={image:"img",button:"button",text:"p",divider:"hr",variable:"span",box:"div"};if(s[r])return s[r];const i=r.toLowerCase();return Yd.has(i)?i:"div"}buildAttributes(r){const a=[];for(const s of Zd)if(r[s]){const i=s==="className"?"class":s;a.push(`${i}="${this.escapeHTML(r[s])}"`)}if(r.style&&this.options.inlineStyles){const s=this.convertStyleObjectToCSS(r.style);s&&a.push(`style="${s}"`)}for(const[s,i]of Object.entries(r))s.startsWith("data-")&&typeof i=="string"&&a.push(`${s}="${this.escapeHTML(i)}"`);return a.length>0?` ${a.join(" ")}`:""}convertStyleObjectToCSS(r){if(!r||typeof r!="object")return"";const a=[];for(const[s,i]of Object.entries(r)){if(i==null)continue;const u=this.camelToKebabCase(s);let d=this.applStyleTransformers(s,i);d=this.addUnitIfNeeded(u,d),a.push(`${u}: ${d}`)}return a.join("; ")}camelToKebabCase(r){return r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}applStyleTransformers(r,a){const s=this.options.styleTransformers?.find(i=>i.property===r);return s?s.transform(a):String(a)}addUnitIfNeeded(r,a){const s=parseFloat(a);return!isNaN(s)&&Qd.has(r)&&!a.includes("px")&&!a.includes("%")&&!a.includes("em")&&!a.includes("rem")&&!a.includes("vh")&&!a.includes("vw")?`${s}px`:a}isSelfClosingTag(r){return Xd.has(r.toLowerCase())}escapeHTML(r){const a=document.createElement("div");return a.textContent=r,a.innerHTML}prettifyHTML(r){let a="",s=0;const i=" ";return r.split(/>\s*</).forEach((u,d)=>{d!==0&&(u=`<${u}`),d!==r.split(/>\s*</).length-1&&(u=`${u}>`),u.match(/^<\/\w/)&&s--,a+=`${i.repeat(Math.max(0,s))+u}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`,"\f","\r"," "],zi=new Mi(Ri),Ne=zi,$i=class extends Error{constructor(n,l,c="type"){super(`Unexpected ${l} node ${c}: ${JSON.stringify(n[c])}.`);Fe(this,"name","UnexpectedNodeError");this.node=n}},Hi=$i;function qi(t){return t?.type==="front-matter"}var Qt=qi,Ui=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens","switchValueSourceSpan","expSourceSpan","valueSourceSpan"]),Wi=new Set(["if","else if","for","switch","case"]);function sa(t,n){var l;if(t.type==="text"||t.type==="comment"||Qt(t)||t.type==="yaml"||t.type==="toml")return null;if(t.type==="attribute"&&delete n.value,t.type==="docType"&&delete n.value,t.type==="angularControlFlowBlock"&&(l=t.parameters)!=null&&l.children)for(let c of n.parameters.children)Wi.has(t.name)?delete c.expression:c.expression=c.expression.trim();t.type==="angularIcuExpression"&&(n.switchValue=t.switchValue.trim()),t.type==="angularLetDeclarationInitializer"&&delete n.value}sa.ignoredProperties=Ui;var Vi=sa;async function Ji(t,n){if(t.language==="yaml"){let l=t.value.trim(),c=l?await n(l,{parser:"yaml"}):"";return Ni([t.startDelimiter,t.explicitLanguage,Y,c,c?Y:"",t.endDelimiter])}}var Gi=Ji;function er(t,n=!0){return[Ce([ue,t]),n?ue:""]}function dt(t,n){let l=t.type==="NGRoot"?t.node.type==="NGMicrosyntax"&&t.node.body.length===1&&t.node.body[0].type==="NGMicrosyntaxExpression"?t.node.body[0].expression:t.node:t.type==="JsExpressionRoot"?t.node:t;return l&&(l.type==="ObjectExpression"||l.type==="ArrayExpression"||(n.parser==="__vue_expression"||n.parser==="__vue_ts_expression")&&(l.type==="TemplateLiteral"||l.type==="StringLiteral"))}async function ye(t,n,l,c){l={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...l};let m=!0;c&&(l.__onHtmlBindingRoot=(F,k)=>{m=c(F,k)});let b=await n(t,l,n);return m?te(b):er(b)}function Ki(t,n,l,c){let{node:m}=l,b=c.originalText.slice(m.sourceSpan.start.offset,m.sourceSpan.end.offset);return/^\s*$/u.test(b)?"":ye(b,t,{parser:"__ng_directive",__isInHtmlAttribute:!1},dt)}var Yi=Ki,Xi=(t,n)=>{if(!(t&&n==null))return n.toReversed||!Array.isArray(n)?n.toReversed():[...n].reverse()},Zi=Xi;function Qi(t){return Array.isArray(t)&&t.length>0}var Pr=Qi,oa,ia,la,ua,ca,el=((oa=globalThis.Deno)==null?void 0:oa.build.os)==="windows"||((la=(ia=globalThis.navigator)==null?void 0:ia.platform)==null?void 0:la.startsWith("Win"))||((ca=(ua=globalThis.process)==null?void 0:ua.platform)==null?void 0:ca.startsWith("win"))||!1;function da(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function tl(t){return t=da(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function rl(t){t=da(t);let n=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(n=`\\\\${t.hostname}${n}`),n}function nl(t){return el?rl(t):tl(t)}var al=nl,sl=t=>String(t).split(/[/\\]/u).pop();function pa(t,n){if(!n)return;let l=sl(n).toLowerCase();return t.find(({filenames:c})=>c?.some(m=>m.toLowerCase()===l))??t.find(({extensions:c})=>c?.some(m=>l.endsWith(m)))}function ol(t,n){if(n)return t.find(({name:l})=>l.toLowerCase()===n)??t.find(({aliases:l})=>l?.includes(n))??t.find(({extensions:l})=>l?.includes(`.${n}`))}function ha(t,n){if(n){if(String(n).startsWith("file:"))try{n=al(n)}catch{return}if(typeof n=="string")return t.find(({isSupported:l})=>l?.({filepath:n}))}}function il(t,n){let l=Zi(!1,t.plugins).flatMap(m=>m.languages??[]),c=ol(l,n.language)??pa(l,n.physicalFile)??pa(l,n.file)??ha(l,n.physicalFile)??ha(l,n.file)??(n.physicalFile,void 0);return c?.parsers[0]}var tr=il,ll="inline",ma={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block"},ul="normal",fa={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function cl(t){return t.type==="element"&&!t.hasExplicitNamespace&&!["html","svg"].includes(t.namespace)}var St=cl,dl=t=>A(!1,t,/^[\t\f\r ]*\n/gu,""),ga=t=>dl(Ne.trimEnd(t)),pl=t=>{let n=t,l=Ne.getLeadingWhitespace(n);l&&(n=n.slice(l.length));let c=Ne.getTrailingWhitespace(n);return c&&(n=n.slice(0,-c.length)),{leadingWhitespace:l,trailingWhitespace:c,text:n}};function ba(t,n){return!!(t.type==="ieConditionalComment"&&t.lastChild&&!t.lastChild.isSelfClosing&&!t.lastChild.endSourceSpan||t.type==="ieConditionalComment"&&!t.complete||pt(t)&&t.children.some(l=>l.type!=="text"&&l.type!=="interpolation")||Mr(t,n)&&!je(t,n)&&t.type!=="interpolation")}function rr(t){return t.type==="attribute"||!t.parent||!t.prev?!1:hl(t.prev)}function hl(t){return t.type==="comment"&&t.value.trim()==="prettier-ignore"}function ge(t){return t.type==="text"||t.type==="comment"}function je(t,n){return t.type==="element"&&(t.fullName==="script"||t.fullName==="style"||t.fullName==="svg:style"||t.fullName==="svg:script"||t.fullName==="mj-style"&&n.parser==="mjml"||St(t)&&(t.name==="script"||t.name==="style"))}function ml(t,n){return t.children&&!je(t,n)}function fl(t,n){return je(t,n)||t.type==="interpolation"||xa(t)}function xa(t){return Sa(t).startsWith("pre")}function gl(t,n){var l,c;let m=b();if(m&&!t.prev&&(c=(l=t.parent)==null?void 0:l.tagDefinition)!=null&&c.ignoreFirstLf)return t.type==="interpolation";return m;function b(){return Qt(t)||t.type==="angularControlFlowBlock"?!1:(t.type==="text"||t.type==="interpolation")&&t.prev&&(t.prev.type==="text"||t.prev.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:pt(t.parent)?!0:!(!t.prev&&(t.parent.type==="root"||pt(t)&&t.parent||je(t.parent,n)||ar(t.parent,n)||!El(t.parent.cssDisplay))||t.prev&&!Al(t.prev.cssDisplay))}}function bl(t,n){return Qt(t)||t.type==="angularControlFlowBlock"?!1:(t.type==="text"||t.type==="interpolation")&&t.next&&(t.next.type==="text"||t.next.type==="interpolation")?!0:!t.parent||t.parent.cssDisplay==="none"?!1:pt(t.parent)?!0:!(!t.next&&(t.parent.type==="root"||pt(t)&&t.parent||je(t.parent,n)||ar(t.parent,n)||!Sl(t.parent.cssDisplay))||t.next&&!kl(t.next.cssDisplay))}function xl(t,n){return Nl(t.cssDisplay)&&!je(t,n)}function nr(t){return Qt(t)||t.next&&t.sourceSpan.end&&t.sourceSpan.end.line+1<t.next.sourceSpan.start.line}function Dl(t){return Da(t)||t.type==="element"&&t.children.length>0&&(["body","script","style"].includes(t.name)||t.children.some(n=>vl(n)))||t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.type!=="text"&&va(t.firstChild)&&(!t.lastChild.isTrailingSpaceSensitive||wa(t.lastChild))}function Da(t){return t.type==="element"&&t.children.length>0&&(["html","head","ul","ol","select"].includes(t.name)||t.cssDisplay.startsWith("table")&&t.cssDisplay!=="table-cell")}function Ir(t){return Ca(t)||t.prev&&yl(t.prev)||ya(t)}function yl(t){return Ca(t)||t.type==="element"&&t.fullName==="br"||ya(t)}function ya(t){return va(t)&&wa(t)}function va(t){return t.hasLeadingSpaces&&(t.prev?t.prev.sourceSpan.end.line<t.sourceSpan.start.line:t.parent.type==="root"||t.parent.startSourceSpan.end.line<t.sourceSpan.start.line)}function wa(t){return t.hasTrailingSpaces&&(t.next?t.next.sourceSpan.start.line>t.sourceSpan.end.line:t.parent.type==="root"||t.parent.endSourceSpan&&t.parent.endSourceSpan.start.line>t.sourceSpan.end.line)}function Ca(t){switch(t.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(t.name)}return!1}function Or(t){return t.lastChild?Or(t.lastChild):t}function vl(t){var n;return(n=t.children)==null?void 0:n.some(l=>l.type!=="text")}function Fa(t){if(t)switch(t){case"module":case"text/javascript":case"text/babel":case"text/jsx":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(t.endsWith("json")||t.endsWith("importmap")||t==="speculationrules")return"json"}}function wl(t,n){let{name:l,attrMap:c}=t;if(l!=="script"||Object.prototype.hasOwnProperty.call(c,"src"))return;let{type:m,lang:b}=t.attrMap;return!b&&!m?"babel":tr(n,{language:b})??Fa(m)}function Cl(t,n){if(!Mr(t,n))return;let{attrMap:l}=t;if(Object.prototype.hasOwnProperty.call(l,"src"))return;let{type:c,lang:m}=l;return tr(n,{language:m})??Fa(c)}function Fl(t,n){if(t.name==="style"){let{lang:l}=t.attrMap;return l?tr(n,{language:l}):"css"}if(t.name==="mj-style"&&n.parser==="mjml")return"css"}function Ea(t,n){return wl(t,n)??Fl(t,n)??Cl(t,n)}function kt(t){return t==="block"||t==="list-item"||t.startsWith("table")}function El(t){return!kt(t)&&t!=="inline-block"}function Sl(t){return!kt(t)&&t!=="inline-block"}function kl(t){return!kt(t)}function Al(t){return!kt(t)}function Nl(t){return!kt(t)&&t!=="inline-block"}function pt(t){return Sa(t).startsWith("pre")}function jl(t,n){let l=t;for(;l;){if(n(l))return!0;l=l.parent}return!1}function _l(t,n){var l;if(ht(t,n))return"block";if(((l=t.prev)==null?void 0:l.type)==="comment"){let m=t.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);if(m)return m[1]}let c=!1;if(t.type==="element"&&t.namespace==="svg")if(jl(t,m=>m.fullName==="svg:foreignObject"))c=!0;else return t.name==="svg"?"inline-block":"block";switch(n.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:if(t.type==="element"&&(!t.namespace||c||St(t))&&Object.prototype.hasOwnProperty.call(ma,t.name))return ma[t.name]}return ll}function Sa(t){return t.type==="element"&&(!t.namespace||St(t))&&Object.prototype.hasOwnProperty.call(fa,t.name)?fa[t.name]:ul}function Bl(t){let n=Number.POSITIVE_INFINITY;for(let l of t.split(`
|
|
7
|
-
`)){
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`||t==="\f"||t==="\r"||t===" "}var Ul=/^[ \t\n\r\u000c]+/,Wl=/^[, \t\n\r\u000c]+/,Vl=/^[^ \t\n\r\u000c]+/,Jl=/[,]+$/,Ta=/^\d+$/,Gl=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function Kl(t){let n=t.length,l,c,m,b,F,k=0,B;function R(V){let K,re=V.exec(t.substring(k));if(re)return[K]=re,k+=K.length,K}let I=[];for(;;){if(R(Wl),k>=n){if(I.length===0)throw new Error("Must contain one or more image candidate strings.");return I}B=k,l=R(Vl),c=[],l.slice(-1)===","?(l=l.replace(Jl,""),U()):G()}function G(){for(R(Ul),m="",b="in descriptor";;){if(F=t.charAt(k),b==="in descriptor")if(Ba(F))m&&(c.push(m),m="",b="after descriptor");else if(F===","){k+=1,m&&c.push(m),U();return}else if(F==="(")m+=F,b="in parens";else if(F===""){m&&c.push(m),U();return}else m+=F;else if(b==="in parens")if(F===")")m+=F,b="in descriptor";else if(F===""){c.push(m),U();return}else m+=F;else if(b==="after descriptor"&&!Ba(F))if(F===""){U();return}else b="in descriptor",k-=1;k+=1}}function U(){let V=!1,K,re,ie,ce,O={},J,ne,Q,pe,xt;for(ce=0;ce<c.length;ce++)J=c[ce],ne=J[J.length-1],Q=J.substring(0,J.length-1),pe=parseInt(Q,10),xt=parseFloat(Q),Ta.test(Q)&&ne==="w"?((K||re)&&(V=!0),pe===0?V=!0:K=pe):Gl.test(Q)&&ne==="x"?((K||re||ie)&&(V=!0),xt<0?V=!0:re=xt):Ta.test(Q)&&ne==="h"?((ie||re)&&(V=!0),pe===0?V=!0:ie=pe):V=!0;if(!V)O.source={value:l,startOffset:B},K&&(O.width={value:K}),re&&(O.density={value:re}),ie&&(O.height={value:ie}),I.push(O);else throw new Error(`Invalid srcset descriptor found in "${t}" at "${J}".`)}}var Yl=Kl;function Xl(t){if(t.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"))return()=>Ql($e(t.node))}var La={width:"w",height:"h",density:"x"},Zl=Object.keys(La);function Ql(t){let n=Yl(t),l=Zl.filter(I=>n.some(G=>Object.prototype.hasOwnProperty.call(G,I)));if(l.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[c]=l,m=La[c],b=n.map(I=>I.source.value),F=Math.max(...b.map(I=>I.length)),k=n.map(I=>I[c]?String(I[c].value):""),B=k.map(I=>{let G=I.indexOf(".");return G===-1?I.length:G}),R=Math.max(...B);return er(ct([",",X],b.map((I,G)=>{let U=[I],V=k[G];if(V){let K=F-I.length+1,re=R-B[G],ie=" ".repeat(K+re);U.push(Xt(ie," "),V+m)}return U})))}var eu=Xl;function tu(t,n){let{node:l}=t,c=$e(t.node).trim();if(l.fullName==="style"&&!n.parentParser&&!c.includes("{{"))return async m=>er(await m(c,{parser:"css",__isHTMLStyleAttribute:!0}))}var zr=new WeakMap;function ru(t,n){let{root:l}=t;return zr.has(l)||zr.set(l,l.children.some(c=>ja(c,n)&&["ts","typescript"].includes(c.attrMap.lang))),zr.get(l)}var $r=ru;function nu(t,n,l){let{node:c}=l,m=$e(c);return ye(`type T<${m}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},dt)}function au(t,n,{parseWithTs:l}){return ye(`function _(${t}) {}`,n,{parser:l?"babel-ts":"babel",__isVueBindings:!0})}async function su(t,n,l,c){let m=$e(l.node),{left:b,operator:F,right:k}=ou(m),B=$r(l,c);return[te(await ye(`function _(${b}) {}`,t,{parser:B?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",F," ",await ye(k,t,{parser:B?"__ts_expression":"__js_expression"})]}function ou(t){let n=/(.*?)\s+(in|of)\s+(.*)/su,l=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,c=/^\(|\)$/gu,m=t.match(n);if(!m)return;let b={};if(b.for=m[3].trim(),!b.for)return;let F=A(!1,m[1].trim(),c,""),k=F.match(l);k?(b.alias=F.replace(l,""),b.iterator1=k[1].trim(),k[2]&&(b.iterator2=k[2].trim())):b.alias=F;let B=[b.alias,b.iterator1,b.iterator2];if(!B.some((R,I)=>!R&&(I===0||B.slice(I+1).some(Boolean))))return{left:B.filter(Boolean).join(","),operator:m[2],right:b.for}}function iu(t,n){if(n.parser!=="vue")return;let{node:l}=t,c=l.fullName;if(c==="v-for")return su;if(c==="generic"&&ja(l.parent,n))return nu;let m=$e(l),b=$r(t,n);if(Ll(l)||Pl(l,n))return F=>au(m,F,{parseWithTs:b});if(c.startsWith("@")||c.startsWith("v-on:"))return F=>lu(m,F,{parseWithTs:b});if(c.startsWith(":")||c.startsWith(".")||c.startsWith("v-bind:"))return F=>uu(m,F,{parseWithTs:b});if(c.startsWith("v-"))return F=>Pa(m,F,{parseWithTs:b})}async function lu(t,n,{parseWithTs:l}){var c;try{return await Pa(t,n,{parseWithTs:l})}catch(m){if(((c=m.cause)==null?void 0:c.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw m}return ye(t,n,{parser:l?"__vue_ts_event_binding":"__vue_event_binding"},dt)}function uu(t,n,{parseWithTs:l}){return ye(t,n,{parser:l?"__vue_ts_expression":"__vue_expression"},dt)}function Pa(t,n,{parseWithTs:l}){return ye(t,n,{parser:l?"__ts_expression":"__js_expression"},dt)}var cu=iu;function du(t,n){let{node:l}=t;if(l.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(n.originalText.slice(l.valueSpan.start.offset,l.valueSpan.end.offset))||n.parser==="lwc"&&l.value.startsWith("{")&&l.value.endsWith("}"))return[l.rawName,"=",l.value];for(let c of[eu,tu,ql,cu,$l]){let m=c(t,n);if(m)return pu(m)}}}function pu(t){return async(n,l,c,m)=>{let b=await t(n,l,c,m);if(b)return b=ta(b,F=>typeof F=="string"?A(!1,F,'"',"""):F),[c.node.rawName,'="',te(b),'"']}}var hu=du,mu=new Proxy(()=>{},{get:()=>mu});function At(t){return t.sourceSpan.start.offset}function sr(t){return t.sourceSpan.end.offset}function Hr(t,n){return[t.isSelfClosing?"":fu(t,n),Nt(t,n)]}function fu(t,n){return t.lastChild&&Bt(t.lastChild)?"":[gu(t,n),qr(t,n)]}function Nt(t,n){return(t.next?Qe(t.next):_t(t.parent))?"":[jt(t,n),Ze(t,n)]}function gu(t,n){return _t(t)?jt(t.lastChild,n):""}function Ze(t,n){return Bt(t)?qr(t.parent,n):or(t)?Wr(t.next,n):""}function qr(t,n){if(Ia(t,n))return"";switch(t.type){case"ieConditionalComment":return"<!";case"element":if(t.hasHtmComponentClosingTag)return"<//";default:return`</${t.rawName}`}}function jt(t,n){if(Ia(t,n))return"";switch(t.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function Ia(t,n){return!t.isSelfClosing&&!t.endSourceSpan&&(rr(t)||ba(t.parent,n))}function Qe(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!ge(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _t(t){var n;return((n=t.lastChild)==null?void 0:n.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!ge(Or(t.lastChild))&&!pt(t)}function Bt(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&ge(Or(t))}function or(t){return t.next&&!ge(t.next)&&ge(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function bu(t){let n=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return n?n[1]?n[1].split(/\s+/u):!0:!1}function ir(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function xu(t,n,l){var c;let{node:m}=t;if(!Pr(m.attrs))return m.isSelfClosing?" ":"";let b=((c=m.prev)==null?void 0:c.type)==="comment"&&bu(m.prev.value),F=typeof b=="boolean"?()=>b:Array.isArray(b)?G=>b.includes(G.rawName):()=>!1,k=t.map(({node:G})=>F(G)?xe(n.originalText.slice(At(G),sr(G))):l(),"attrs"),B=m.type==="element"&&m.fullName==="script"&&m.attrs.length===1&&m.attrs[0].fullName==="src"&&m.children.length===0,R=n.singleAttributePerLine&&m.attrs.length>1&&!ht(m,n)?Y:X,I=[Ce([B?" ":X,ct(R,k)])];return m.firstChild&&ir(m.firstChild)||m.isSelfClosing&&_t(m.parent)||B?I.push(m.isSelfClosing?" ":""):I.push(n.bracketSameLine?m.isSelfClosing?" ":"":m.isSelfClosing?X:ue),I}function Du(t){return t.firstChild&&ir(t.firstChild)?"":Vr(t)}function Ur(t,n,l){let{node:c}=t;return[Tt(c,n),xu(t,n,l),c.isSelfClosing?"":Du(c)]}function Tt(t,n){return t.prev&&or(t.prev)?"":[et(t,n),Wr(t,n)]}function et(t,n){return ir(t)?Vr(t.parent):Qe(t)?jt(t.prev,n):""}var Oa="<!doctype";function Wr(t,n){switch(t.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":{if(t.value==="html"){let{filepath:c}=n;if(c&&/\.html?$/u.test(c))return Oa}let l=At(t);return n.originalText.slice(l,l+Oa.length)}case"angularIcuExpression":return"{";case"element":if(t.condition)return`<!--[if ${t.condition}]><!--><${t.rawName}`;default:return`<${t.rawName}`}}function Vr(t){switch(t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return"><!--<![endif]-->";default:return">"}}function yu(t,n){if(!t.endSourceSpan)return"";let l=t.startSourceSpan.end.offset;t.firstChild&&ir(t.firstChild)&&(l-=Vr(t).length);let c=t.endSourceSpan.start.offset;return t.lastChild&&Bt(t.lastChild)?c+=qr(t,n).length:_t(t)&&(c-=jt(t.lastChild,n).length),n.originalText.slice(l,c)}var Ma=yu,vu=new Set(["if","else if","for","switch","case"]);function wu(t,n){let{node:l}=t;switch(l.type){case"element":if(je(l,n)||l.type==="interpolation")return;if(!l.isSelfClosing&&Mr(l,n)){let c=Ea(l,n);return c?async(m,b)=>{let F=Ma(l,n),k=/^\s*$/u.test(F),B="";return k||(B=await m(ga(F),{parser:c,__embeddedInHtml:!0}),k=B===""),[et(l,n),te(Ur(t,n,b)),k?"":Y,B,k?"":Y,Hr(l,n),Ze(l,n)]}:void 0}break;case"text":if(je(l.parent,n)){let c=Ea(l.parent,n);if(c)return async m=>{let b=c==="markdown"?ka(l.value.replace(/^[^\S\n]*\n/u,"")):l.value,F={parser:c,__embeddedInHtml:!0};if(n.parser==="html"&&c==="babel"){let k="script",{attrMap:B}=l.parent;B&&(B.type==="module"||(B.type==="text/babel"||B.type==="text/jsx")&&B["data-type"]==="module")&&(k="module"),F.__babelSourceType=k}return[Et,et(l,n),await m(b,F),Ze(l,n)]}}else if(l.parent.type==="interpolation")return async c=>{let m={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return n.parser==="angular"?m.parser="__ng_interpolation":n.parser==="vue"?m.parser=$r(t,n)?"__vue_ts_expression":"__vue_expression":m.parser="__js_expression",[Ce([X,await c(l.value,m)]),l.parent.next&&Qe(l.parent.next)?" ":X]};break;case"attribute":return hu(t,n);case"front-matter":return c=>Gi(l,c);case"angularControlFlowBlockParameters":return vu.has(t.parent.name)?Yi:void 0;case"angularLetDeclarationInitializer":return c=>ye(l.value,c,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var Cu=wu,Lt=null;function Pt(t){if(Lt!==null&&typeof Lt.property){let n=Lt;return Lt=Pt.prototype=null,n}return Lt=Pt.prototype=t??Object.create(null),new Pt}var Fu=10;for(let t=0;t<=Fu;t++)Pt();function Eu(t){return Pt(t)}function Su(t,n="type"){Eu(t);function l(c){let m=c[n],b=t[m];if(!Array.isArray(b))throw Object.assign(new Error(`Missing visitor keys for '${m}'.`),{node:c});return b}return l}var ku=Su,Au={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},Nu=Au,ju=ku(Nu),_u=ju,Bu="format",Tu=/^\s*<!--\s*@(?:noformat|noprettier)\s*-->/u,Lu=/^\s*<!--\s*@(?:format|prettier)\s*-->/u;function Pu(t){return Lu.test(t)}function Iu(t){return Tu.test(t)}function Ou(t){return`<!-- @${Bu} -->
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`){let l=n.children[0];l.value.length===1?n.removeChild(l):l.value=l.value.slice(1)}})}function Xu(t){let n=l=>{var c,m;return l.type==="element"&&((c=l.prev)==null?void 0:c.type)==="ieConditionalStartComment"&&l.prev.sourceSpan.end.offset===l.startSourceSpan.start.offset&&((m=l.firstChild)==null?void 0:m.type)==="ieConditionalEndComment"&&l.firstChild.sourceSpan.start.offset===l.startSourceSpan.end.offset};t.walk(l=>{if(l.children)for(let c=0;c<l.children.length;c++){let m=l.children[c];if(!n(m))continue;let b=m.prev,F=m.firstChild;l.removeChild(b),c--;let k=new W(b.sourceSpan.start,F.sourceSpan.end),B=new W(k.start,m.sourceSpan.end);m.condition=b.condition,m.sourceSpan=B,m.startSourceSpan=k,m.removeChild(F)}})}function Zu(t,n,l){t.walk(c=>{if(c.children)for(let m=0;m<c.children.length;m++){let b=c.children[m];if(b.type!=="text"&&!n(b))continue;b.type!=="text"&&(b.type="text",b.value=l(b));let F=b.prev;!F||F.type!=="text"||(F.value+=b.value,F.sourceSpan=new W(F.sourceSpan.start,b.sourceSpan.end),c.removeChild(b),m--)}})}function Qu(t){return Zu(t,n=>n.type==="cdata",n=>`<![CDATA[${n.value}]]>`)}function ec(t){let n=l=>{var c,m;return l.type==="element"&&l.attrs.length===0&&l.children.length===1&&l.firstChild.type==="text"&&!Ne.hasWhitespaceCharacter(l.children[0].value)&&!l.firstChild.hasLeadingSpaces&&!l.firstChild.hasTrailingSpaces&&l.isLeadingSpaceSensitive&&!l.hasLeadingSpaces&&l.isTrailingSpaceSensitive&&!l.hasTrailingSpaces&&((c=l.prev)==null?void 0:c.type)==="text"&&((m=l.next)==null?void 0:m.type)==="text"};t.walk(l=>{if(l.children)for(let c=0;c<l.children.length;c++){let m=l.children[c];if(!n(m))continue;let b=m.prev,F=m.next;b.value+=`<${m.rawName}>`+m.firstChild.value+`</${m.rawName}>`+F.value,b.sourceSpan=new W(b.sourceSpan.start,F.sourceSpan.end),b.isTrailingSpaceSensitive=F.isTrailingSpaceSensitive,b.hasTrailingSpaces=F.hasTrailingSpaces,l.removeChild(m),c--,l.removeChild(F)}})}function tc(t,n){if(n.parser==="html")return;let l=/\{\{(.+?)\}\}/su;t.walk(c=>{if(ml(c,n))for(let m of c.children){if(m.type!=="text")continue;let b=m.sourceSpan.start,F=null,k=m.value.split(l);for(let B=0;B<k.length;B++,b=F){let R=k[B];if(B%2===0){F=b.moveBy(R.length),R.length>0&&c.insertChildBefore(m,{type:"text",value:R,sourceSpan:new W(b,F)});continue}F=b.moveBy(R.length+4),c.insertChildBefore(m,{type:"interpolation",sourceSpan:new W(b,F),children:R.length===0?[]:[{type:"text",value:R,sourceSpan:new W(b.moveBy(2),F.moveBy(-2))}]})}c.removeChild(m)}})}function rc(t,n){t.walk(l=>{let c=l.$children;if(!c)return;if(c.length===0||c.length===1&&c[0].type==="text"&&Ne.trim(c[0].value).length===0){l.hasDanglingSpaces=c.length>0,l.$children=[];return}let m=fl(l,n),b=xa(l);if(!m)for(let F=0;F<c.length;F++){let k=c[F];if(k.type!=="text")continue;let{leadingWhitespace:B,text:R,trailingWhitespace:I}=pl(k.value),G=k.prev,U=k.next;R?(k.value=R,k.sourceSpan=new W(k.sourceSpan.start.moveBy(B.length),k.sourceSpan.end.moveBy(-I.length)),B&&(G&&(G.hasTrailingSpaces=!0),k.hasLeadingSpaces=!0),I&&(k.hasTrailingSpaces=!0,U&&(U.hasLeadingSpaces=!0))):(l.removeChild(k),F--,(B||I)&&(G&&(G.hasTrailingSpaces=!0),U&&(U.hasLeadingSpaces=!0)))}l.isWhitespaceSensitive=m,l.isIndentationSensitive=b})}function nc(t){t.walk(n=>{n.isSelfClosing=!n.children||n.type==="element"&&(n.tagDefinition.isVoid||n.endSourceSpan&&n.startSourceSpan.start===n.endSourceSpan.start&&n.startSourceSpan.end===n.endSourceSpan.end)})}function ac(t,n){t.walk(l=>{l.type==="element"&&(l.hasHtmComponentClosingTag=l.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(n.originalText.slice(l.endSourceSpan.start.offset,l.endSourceSpan.end.offset)))})}function sc(t,n){t.walk(l=>{l.cssDisplay=_l(l,n)})}function oc(t,n){t.walk(l=>{let{children:c}=l;if(c){if(c.length===0){l.isDanglingSpaceSensitive=xl(l,n);return}for(let m of c)m.isLeadingSpaceSensitive=gl(m,n),m.isTrailingSpaceSensitive=bl(m,n);for(let m=0;m<c.length;m++){let b=c[m];b.isLeadingSpaceSensitive=(m===0||b.prev.isTrailingSpaceSensitive)&&b.isLeadingSpaceSensitive,b.isTrailingSpaceSensitive=(m===c.length-1||b.next.isLeadingSpaceSensitive)&&b.isTrailingSpaceSensitive}}})}var ic=Ku;function lc(t,n,l){let{node:c}=t;switch(c.type){case"front-matter":return xe(c.raw);case"root":return n.__onHtmlRoot&&n.__onHtmlRoot(c),[te(Jr(t,n,l)),Y];case"element":case"ieConditionalComment":return Uu(t,n,l);case"angularControlFlowBlock":return Ru(t,n,l);case"angularControlFlowBlockParameters":return $u(t,n,l);case"angularControlFlowBlockParameter":return Ne.trim(c.expression);case"angularLetDeclaration":return te(["@let ",te([c.id," =",te(Ce([X,l("init")]))]),";"]);case"angularLetDeclarationInitializer":return c.value;case"angularIcuExpression":return Hu(t,n,l);case"angularIcuCase":return qu(t,n,l);case"ieConditionalStartComment":case"ieConditionalEndComment":return[Tt(c),Nt(c)];case"interpolation":return[Tt(c,n),...t.map(l,"children"),Nt(c,n)];case"text":{if(c.parent.type==="interpolation"){let k=/\n[^\S\n]*$/u,B=k.test(c.value),R=B?c.value.replace(k,""):c.value;return[xe(R),B?Y:""]}let m=et(c,n),b=Na(c),F=Ze(c,n);return b[0]=[m,b[0]],b.push([b.pop(),F]),na(b)}case"docType":return[te([Tt(c,n)," ",A(!1,c.value.replace(/^html\b/iu,"html"),/\s+/gu," ")]),Nt(c,n)];case"comment":return[et(c,n),xe(n.originalText.slice(At(c),sr(c))),Ze(c,n)];case"attribute":{if(c.value===null)return c.rawName;let m=Aa(c.value),b=Pi(m,'"');return[c.rawName,"=",b,xe(b==='"'?A(!1,m,'"',"""):A(!1,m,"'","'")),b]}case"cdata":default:throw new Hi(c,"HTML")}}var uc={preprocess:ic,print:lc,insertPragma:Ou,massageAstNode:Vi,embed:Cu,getVisitorKeys:_u},cc=uc,dc=[{name:"Angular",type:"markup",extensions:[".component.html"],tmScope:"text.html.basic",aceMode:"html",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["angular"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"HTML",type:"markup",extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml"],tmScope:"text.html.basic",aceMode:"html",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["html"],vscodeLanguageIds:["html"],linguistLanguageId:146},{name:"Lightning Web Components",type:"markup",extensions:[],tmScope:"text.html.basic",aceMode:"html",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"MJML",type:"markup",extensions:[".mjml"],tmScope:"text.mjml.basic",aceMode:"html",aliases:["MJML","mjml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["mjml"],filenames:[],vscodeLanguageIds:["mjml"],linguistLanguageId:146},{name:"Vue",type:"markup",extensions:[".vue"],tmScope:"source.vue",aceMode:"html",parsers:["vue"],vscodeLanguageIds:["vue"],linguistLanguageId:391}],Ua={bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},Wa="HTML",pc={bracketSameLine:Ua.bracketSameLine,htmlWhitespaceSensitivity:{category:Wa,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Ua.singleAttributePerLine,vueIndentScriptAndStyle:{category:Wa,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},hc=pc,Va={};f(Va,{angular:()=>Dd,html:()=>gd,lwc:()=>vd,mjml:()=>xd,vue:()=>yd});var Ja;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom"})(Ja||(Ja={}));var Ga;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default"})(Ga||(Ga={}));var Ka;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(Ka||(Ka={}));var Ya={name:"custom-elements"},Xa={name:"no-errors-schema"},tt;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL"})(tt||(tt={}));var Za;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Za||(Za={}));var ve;(function(t){t[t.RAW_TEXT=0]="RAW_TEXT",t[t.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",t[t.PARSABLE_DATA=2]="PARSABLE_DATA"})(ve||(ve={}));function pr(t,n=!0){if(t[0]!=":")return[null,t];let l=t.indexOf(":",1);if(l===-1){if(n)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,l),t.slice(l+1)]}function Qa(t){return pr(t)[1]==="ng-container"}function es(t){return pr(t)[1]==="ng-content"}function hr(t){return t===null?null:pr(t)[0]}function mr(t,n){return t?`:${t}:${n}`:n}var fr;function ts(){return fr||(fr={},gr(tt.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),gr(tt.STYLE,["*|style"]),gr(tt.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),gr(tt.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),fr}function gr(t,n){for(let l of n)fr[l.toLowerCase()]=t}var mc=class{},fc="boolean",gc="number",bc="string",xc="object",Dc=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],rs=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),yc=Array.from(rs).reduce((t,[n,l])=>(t.set(n,l),t),new Map),vc=class extends mc{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,Dc.forEach(t=>{let n=new Map,l=new Set,[c,m]=t.split("|"),b=m.split(","),[F,k]=c.split("^");F.split(",").forEach(R=>{this._schema.set(R.toLowerCase(),n),this._eventSchema.set(R.toLowerCase(),l)});let B=k&&this._schema.get(k.toLowerCase());if(B){for(let[R,I]of B)n.set(R,I);for(let R of this._eventSchema.get(k.toLowerCase()))l.add(R)}b.forEach(R=>{if(R.length>0)switch(R[0]){case"*":l.add(R.substring(1));break;case"!":n.set(R.substring(1),fc);break;case"#":n.set(R.substring(1),gc);break;case"%":n.set(R.substring(1),xc);break;default:n.set(R,bc)}})})}hasProperty(t,n,l){if(l.some(c=>c.name===Xa.name))return!0;if(t.indexOf("-")>-1){if(Qa(t)||es(t))return!1;if(l.some(c=>c.name===Ya.name))return!0}return(this._schema.get(t.toLowerCase())||this._schema.get("unknown")).has(n)}hasElement(t,n){return n.some(l=>l.name===Xa.name)||t.indexOf("-")>-1&&(Qa(t)||es(t)||n.some(l=>l.name===Ya.name))?!0:this._schema.has(t.toLowerCase())}securityContext(t,n,l){l&&(n=this.getMappedPropName(n)),t=t.toLowerCase(),n=n.toLowerCase();let c=ts()[t+"|"+n];return c||(c=ts()["*|"+n],c||tt.NONE)}getMappedPropName(t){return rs.get(t)??t}getDefaultComponentElementName(){return"ng-component"}validateProperty(t){return t.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${t}' is disallowed for security reasons, please use (${t.slice(2)})=...
|
|
17
|
-
If '${t}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(t){return t.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${t}' is disallowed for security reasons, please use (${t.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(t){let n=this._schema.get(t.toLowerCase())||this._schema.get("unknown");return Array.from(n.keys()).map(l=>yc.get(l)??l)}allKnownEventsOfElement(t){return Array.from(this._eventSchema.get(t.toLowerCase())??[])}normalizeAnimationStyleProperty(t){return Ju(t)}normalizeAnimationStyleValue(t,n,l){let c="",m=l.toString().trim(),b=null;if(wc(t)&&l!==0&&l!=="0")if(typeof l=="number")c="px";else{let F=l.match(/^[+-]?[\d\.]+([a-z]*)$/);F&&F[1].length==0&&(b=`Please provide a CSS unit value for ${n}:${l}`)}return{error:b,value:m+c}}};function wc(t){switch(t){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var q=class{constructor({closedByChildren:t,implicitNamespacePrefix:n,contentType:l=ve.PARSABLE_DATA,closedByParent:c=!1,isVoid:m=!1,ignoreFirstLf:b=!1,preventNamespaceInheritance:F=!1,canSelfClose:k=!1}={}){this.closedByChildren={},this.closedByParent=!1,t&&t.length>0&&t.forEach(B=>this.closedByChildren[B]=!0),this.isVoid=m,this.closedByParent=c||m,this.implicitNamespacePrefix=n||null,this.contentType=l,this.ignoreFirstLf=b,this.preventNamespaceInheritance=F,this.canSelfClose=k??m}isClosedByChild(t){return this.isVoid||t.toLowerCase()in this.closedByChildren}getContentType(t){return typeof this.contentType=="object"?(t===void 0?void 0:this.contentType[t])??this.contentType.default:this.contentType}},ns,Ot;function Zr(t){return Ot||(ns=new q({canSelfClose:!0}),Ot=Object.assign(Object.create(null),{base:new q({isVoid:!0}),meta:new q({isVoid:!0}),area:new q({isVoid:!0}),embed:new q({isVoid:!0}),link:new q({isVoid:!0}),img:new q({isVoid:!0}),input:new q({isVoid:!0}),param:new q({isVoid:!0}),hr:new q({isVoid:!0}),br:new q({isVoid:!0}),source:new q({isVoid:!0}),track:new q({isVoid:!0}),wbr:new q({isVoid:!0}),p:new q({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new q({closedByChildren:["tbody","tfoot"]}),tbody:new q({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new q({closedByChildren:["tbody"],closedByParent:!0}),tr:new q({closedByChildren:["tr"],closedByParent:!0}),td:new q({closedByChildren:["td","th"],closedByParent:!0}),th:new q({closedByChildren:["td","th"],closedByParent:!0}),col:new q({isVoid:!0}),svg:new q({implicitNamespacePrefix:"svg"}),foreignObject:new q({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new q({implicitNamespacePrefix:"math"}),li:new q({closedByChildren:["li"],closedByParent:!0}),dt:new q({closedByChildren:["dt","dd"]}),dd:new q({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new q({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new q({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new q({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new q({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new q({closedByChildren:["optgroup"],closedByParent:!0}),option:new q({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new q({ignoreFirstLf:!0}),listing:new q({ignoreFirstLf:!0}),style:new q({contentType:ve.RAW_TEXT}),script:new q({contentType:ve.RAW_TEXT}),title:new q({contentType:{default:ve.ESCAPABLE_RAW_TEXT,svg:ve.PARSABLE_DATA}}),textarea:new q({contentType:ve.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new vc().allKnownElementNames().forEach(n=>{!Ot[n]&&hr(n)===null&&(Ot[n]=new q({canSelfClose:!1}))})),Ot[t]??ns}var mt=class{constructor(t,n){this.sourceSpan=t,this.i18n=n}},Cc=class extends mt{constructor(t,n,l,c){super(n,c),this.value=t,this.tokens=l,this.type="text"}visit(t,n){return t.visitText(this,n)}},Fc=class extends mt{constructor(t,n,l,c){super(n,c),this.value=t,this.tokens=l,this.type="cdata"}visit(t,n){return t.visitCdata(this,n)}},Ec=class extends mt{constructor(t,n,l,c,m,b){super(c,b),this.switchValue=t,this.type=n,this.cases=l,this.switchValueSourceSpan=m}visit(t,n){return t.visitExpansion(this,n)}},Sc=class{constructor(t,n,l,c,m){this.value=t,this.expression=n,this.sourceSpan=l,this.valueSourceSpan=c,this.expSourceSpan=m,this.type="expansionCase"}visit(t,n){return t.visitExpansionCase(this,n)}},kc=class extends mt{constructor(t,n,l,c,m,b,F){super(l,F),this.name=t,this.value=n,this.keySpan=c,this.valueSpan=m,this.valueTokens=b,this.type="attribute"}visit(t,n){return t.visitAttribute(this,n)}get nameSpan(){return this.keySpan}},He=class extends mt{constructor(t,n,l,c,m,b=null,F=null,k){super(c,k),this.name=t,this.attrs=n,this.children=l,this.startSourceSpan=m,this.endSourceSpan=b,this.nameSpan=F,this.type="element"}visit(t,n){return t.visitElement(this,n)}},Ac=class{constructor(t,n){this.value=t,this.sourceSpan=n,this.type="comment"}visit(t,n){return t.visitComment(this,n)}},Nc=class{constructor(t,n){this.value=t,this.sourceSpan=n,this.type="docType"}visit(t,n){return t.visitDocType(this,n)}},ft=class extends mt{constructor(t,n,l,c,m,b,F=null,k){super(c,k),this.name=t,this.parameters=n,this.children=l,this.nameSpan=m,this.startSourceSpan=b,this.endSourceSpan=F,this.type="block"}visit(t,n){return t.visitBlock(this,n)}},as=class{constructor(t,n){this.expression=t,this.sourceSpan=n,this.type="blockParameter",this.startSourceSpan=null,this.endSourceSpan=null}visit(t,n){return t.visitBlockParameter(this,n)}},ss=class{constructor(t,n,l,c,m){this.name=t,this.value=n,this.sourceSpan=l,this.nameSpan=c,this.valueSpan=m,this.type="letDeclaration",this.startSourceSpan=null,this.endSourceSpan=null}visit(t,n){return t.visitLetDeclaration(this,n)}};function os(t,n,l=null){let c=[],m=t.visit?b=>t.visit(b,l)||b.visit(t,l):b=>b.visit(t,l);return n.forEach(b=>{let F=m(b);F&&c.push(F)}),c}var jc=class{constructor(){}visitElement(t,n){this.visitChildren(n,l=>{l(t.attrs),l(t.children)})}visitAttribute(t,n){}visitText(t,n){}visitCdata(t,n){}visitComment(t,n){}visitDocType(t,n){}visitExpansion(t,n){return this.visitChildren(n,l=>{l(t.cases)})}visitExpansionCase(t,n){}visitBlock(t,n){this.visitChildren(n,l=>{l(t.parameters),l(t.children)})}visitBlockParameter(t,n){}visitLetDeclaration(t,n){}visitChildren(t,n){let l=[],c=this;function m(b){b&&l.push(os(c,b,t))}return n(m),Array.prototype.concat.apply([],l)}},br={AElig:"Æ",AMP:"&",amp:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"",af:"",Aring:"Å",angst:"Å",Ascr:"𝒜",Assign:"≔",colone:"≔",coloneq:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",setminus:"∖",setmn:"∖",smallsetminus:"∖",ssetmn:"∖",Barv:"⫧",Barwed:"⌆",doublebarwedge:"⌆",Bcy:"Б",Because:"∵",becaus:"∵",because:"∵",Bernoullis:"ℬ",Bscr:"ℬ",bernou:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",breve:"˘",Bumpeq:"≎",HumpDownHump:"≎",bump:"≎",CHcy:"Ч",COPY:"©",copy:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",DD:"ⅅ",Cayleys:"ℭ",Cfr:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",cedil:"¸",CenterDot:"·",centerdot:"·",middot:"·",Chi:"Χ",CircleDot:"⊙",odot:"⊙",CircleMinus:"⊖",ominus:"⊖",CirclePlus:"⊕",oplus:"⊕",CircleTimes:"⊗",otimes:"⊗",ClockwiseContourIntegral:"∲",cwconint:"∲",CloseCurlyDoubleQuote:"”",rdquo:"”",rdquor:"”",CloseCurlyQuote:"’",rsquo:"’",rsquor:"’",Colon:"∷",Proportion:"∷",Colone:"⩴",Congruent:"≡",equiv:"≡",Conint:"∯",DoubleContourIntegral:"∯",ContourIntegral:"∮",conint:"∮",oint:"∮",Copf:"ℂ",complexes:"ℂ",Coproduct:"∐",coprod:"∐",CounterClockwiseContourIntegral:"∳",awconint:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",asympeq:"≍",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",ddagger:"‡",Darr:"↡",Dashv:"⫤",DoubleLeftTee:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",nabla:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",acute:"´",DiacriticalDot:"˙",dot:"˙",DiacriticalDoubleAcute:"˝",dblac:"˝",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"˜",tilde:"˜",Diamond:"⋄",diam:"⋄",diamond:"⋄",DifferentialD:"ⅆ",dd:"ⅆ",Dopf:"𝔻",Dot:"¨",DoubleDot:"¨",die:"¨",uml:"¨",DotDot:"⃜",DotEqual:"≐",doteq:"≐",esdot:"≐",DoubleDownArrow:"⇓",Downarrow:"⇓",dArr:"⇓",DoubleLeftArrow:"⇐",Leftarrow:"⇐",lArr:"⇐",DoubleLeftRightArrow:"⇔",Leftrightarrow:"⇔",hArr:"⇔",iff:"⇔",DoubleLongLeftArrow:"⟸",Longleftarrow:"⟸",xlArr:"⟸",DoubleLongLeftRightArrow:"⟺",Longleftrightarrow:"⟺",xhArr:"⟺",DoubleLongRightArrow:"⟹",Longrightarrow:"⟹",xrArr:"⟹",DoubleRightArrow:"⇒",Implies:"⇒",Rightarrow:"⇒",rArr:"⇒",DoubleRightTee:"⊨",vDash:"⊨",DoubleUpArrow:"⇑",Uparrow:"⇑",uArr:"⇑",DoubleUpDownArrow:"⇕",Updownarrow:"⇕",vArr:"⇕",DoubleVerticalBar:"∥",par:"∥",parallel:"∥",shortparallel:"∥",spar:"∥",DownArrow:"↓",ShortDownArrow:"↓",darr:"↓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",duarr:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",leftharpoondown:"↽",lhard:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",rhard:"⇁",rightharpoondown:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",top:"⊤",DownTeeArrow:"↧",mapstodown:"↧",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",in:"∈",isin:"∈",isinv:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",eqsim:"≂",esim:"≂",Equilibrium:"⇌",rightleftharpoons:"⇌",rlhar:"⇌",Escr:"ℰ",expectation:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",exist:"∃",ExponentialE:"ⅇ",ee:"ⅇ",exponentiale:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",blacksquare:"▪",squarf:"▪",squf:"▪",Fopf:"𝔽",ForAll:"∀",forall:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",gt:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",ggg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",ge:"≥",geq:"≥",GreaterEqualLess:"⋛",gel:"⋛",gtreqless:"⋛",GreaterFullEqual:"≧",gE:"≧",geqq:"≧",GreaterGreater:"⪢",GreaterLess:"≷",gl:"≷",gtrless:"≷",GreaterSlantEqual:"⩾",geqslant:"⩾",ges:"⩾",GreaterTilde:"≳",gsim:"≳",gtrsim:"≳",Gscr:"𝒢",Gt:"≫",NestedGreaterGreater:"≫",gg:"≫",HARDcy:"Ъ",Hacek:"ˇ",caron:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",Poincareplane:"ℌ",HilbertSpace:"ℋ",Hscr:"ℋ",hamilt:"ℋ",Hopf:"ℍ",quaternions:"ℍ",HorizontalLine:"─",boxh:"─",Hstrok:"Ħ",HumpEqual:"≏",bumpe:"≏",bumpeq:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Im:"ℑ",image:"ℑ",imagpart:"ℑ",Igrave:"Ì",Imacr:"Ī",ImaginaryI:"ⅈ",ii:"ⅈ",Int:"∬",Integral:"∫",int:"∫",Intersection:"⋂",bigcap:"⋂",xcap:"⋂",InvisibleComma:"",ic:"",InvisibleTimes:"",it:"",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",imagline:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",lt:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Lscr:"ℒ",lagran:"ℒ",Larr:"↞",twoheadleftarrow:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",lang:"⟨",langle:"⟨",LeftArrow:"←",ShortLeftArrow:"←",larr:"←",leftarrow:"←",slarr:"←",LeftArrowBar:"⇤",larrb:"⇤",LeftArrowRightArrow:"⇆",leftrightarrows:"⇆",lrarr:"⇆",LeftCeiling:"⌈",lceil:"⌈",LeftDoubleBracket:"⟦",lobrk:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",dharl:"⇃",downharpoonleft:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",lfloor:"⌊",LeftRightArrow:"↔",harr:"↔",leftrightarrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",dashv:"⊣",LeftTeeArrow:"↤",mapstoleft:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",vartriangleleft:"⊲",vltri:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",ltrie:"⊴",trianglelefteq:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",uharl:"↿",upharpoonleft:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",leftharpoonup:"↼",lharu:"↼",LeftVectorBar:"⥒",LessEqualGreater:"⋚",leg:"⋚",lesseqgtr:"⋚",LessFullEqual:"≦",lE:"≦",leqq:"≦",LessGreater:"≶",lessgtr:"≶",lg:"≶",LessLess:"⪡",LessSlantEqual:"⩽",leqslant:"⩽",les:"⩽",LessTilde:"≲",lesssim:"≲",lsim:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",lAarr:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",longleftarrow:"⟵",xlarr:"⟵",LongLeftRightArrow:"⟷",longleftrightarrow:"⟷",xharr:"⟷",LongRightArrow:"⟶",longrightarrow:"⟶",xrarr:"⟶",Lopf:"𝕃",LowerLeftArrow:"↙",swarr:"↙",swarrow:"↙",LowerRightArrow:"↘",searr:"↘",searrow:"↘",Lsh:"↰",lsh:"↰",Lstrok:"Ł",Lt:"≪",NestedLessLess:"≪",ll:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mscr:"ℳ",phmmat:"ℳ",Mfr:"𝔐",MinusPlus:"∓",mnplus:"∓",mp:"∓",Mopf:"𝕄",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",ZeroWidthSpace:"",NewLine:`
|
|
18
|
-
`,Nfr:"𝔑",NoBreak:"",NonBreakingSpace:" ",nbsp:" ",Nopf:"ℕ",naturals:"ℕ",Not:"⫬",NotCongruent:"≢",nequiv:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",npar:"∦",nparallel:"∦",nshortparallel:"∦",nspar:"∦",NotElement:"∉",notin:"∉",notinva:"∉",NotEqual:"≠",ne:"≠",NotEqualTilde:"≂̸",nesim:"≂̸",NotExists:"∄",nexist:"∄",nexists:"∄",NotGreater:"≯",ngt:"≯",ngtr:"≯",NotGreaterEqual:"≱",nge:"≱",ngeq:"≱",NotGreaterFullEqual:"≧̸",ngE:"≧̸",ngeqq:"≧̸",NotGreaterGreater:"≫̸",nGtv:"≫̸",NotGreaterLess:"≹",ntgl:"≹",NotGreaterSlantEqual:"⩾̸",ngeqslant:"⩾̸",nges:"⩾̸",NotGreaterTilde:"≵",ngsim:"≵",NotHumpDownHump:"≎̸",nbump:"≎̸",NotHumpEqual:"≏̸",nbumpe:"≏̸",NotLeftTriangle:"⋪",nltri:"⋪",ntriangleleft:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",nltrie:"⋬",ntrianglelefteq:"⋬",NotLess:"≮",nless:"≮",nlt:"≮",NotLessEqual:"≰",nle:"≰",nleq:"≰",NotLessGreater:"≸",ntlg:"≸",NotLessLess:"≪̸",nLtv:"≪̸",NotLessSlantEqual:"⩽̸",nleqslant:"⩽̸",nles:"⩽̸",NotLessTilde:"≴",nlsim:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",npr:"⊀",nprec:"⊀",NotPrecedesEqual:"⪯̸",npre:"⪯̸",npreceq:"⪯̸",NotPrecedesSlantEqual:"⋠",nprcue:"⋠",NotReverseElement:"∌",notni:"∌",notniva:"∌",NotRightTriangle:"⋫",nrtri:"⋫",ntriangleright:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",nrtrie:"⋭",ntrianglerighteq:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",nsqsube:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",nsqsupe:"⋣",NotSubset:"⊂⃒",nsubset:"⊂⃒",vnsub:"⊂⃒",NotSubsetEqual:"⊈",nsube:"⊈",nsubseteq:"⊈",NotSucceeds:"⊁",nsc:"⊁",nsucc:"⊁",NotSucceedsEqual:"⪰̸",nsce:"⪰̸",nsucceq:"⪰̸",NotSucceedsSlantEqual:"⋡",nsccue:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",nsupset:"⊃⃒",vnsup:"⊃⃒",NotSupersetEqual:"⊉",nsupe:"⊉",nsupseteq:"⊉",NotTilde:"≁",nsim:"≁",NotTildeEqual:"≄",nsime:"≄",nsimeq:"≄",NotTildeFullEqual:"≇",ncong:"≇",NotTildeTilde:"≉",nap:"≉",napprox:"≉",NotVerticalBar:"∤",nmid:"∤",nshortmid:"∤",nsmid:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",ohm:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",ldquo:"“",OpenCurlyQuote:"‘",lsquo:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",oline:"‾",OverBrace:"⏞",OverBracket:"⎴",tbrk:"⎴",OverParenthesis:"⏜",PartialD:"∂",part:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",plusmn:"±",pm:"±",Popf:"ℙ",primes:"ℙ",Pr:"⪻",Precedes:"≺",pr:"≺",prec:"≺",PrecedesEqual:"⪯",pre:"⪯",preceq:"⪯",PrecedesSlantEqual:"≼",prcue:"≼",preccurlyeq:"≼",PrecedesTilde:"≾",precsim:"≾",prsim:"≾",Prime:"″",Product:"∏",prod:"∏",Proportional:"∝",prop:"∝",propto:"∝",varpropto:"∝",vprop:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',quot:'"',Qfr:"𝔔",Qopf:"ℚ",rationals:"ℚ",Qscr:"𝒬",RBarr:"⤐",drbkarow:"⤐",REG:"®",circledR:"®",reg:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",twoheadrightarrow:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",Rfr:"ℜ",real:"ℜ",realpart:"ℜ",ReverseElement:"∋",SuchThat:"∋",ni:"∋",niv:"∋",ReverseEquilibrium:"⇋",leftrightharpoons:"⇋",lrhar:"⇋",ReverseUpEquilibrium:"⥯",duhar:"⥯",Rho:"Ρ",RightAngleBracket:"⟩",rang:"⟩",rangle:"⟩",RightArrow:"→",ShortRightArrow:"→",rarr:"→",rightarrow:"→",srarr:"→",RightArrowBar:"⇥",rarrb:"⇥",RightArrowLeftArrow:"⇄",rightleftarrows:"⇄",rlarr:"⇄",RightCeiling:"⌉",rceil:"⌉",RightDoubleBracket:"⟧",robrk:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",dharr:"⇂",downharpoonright:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rfloor:"⌋",RightTee:"⊢",vdash:"⊢",RightTeeArrow:"↦",map:"↦",mapsto:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",vartriangleright:"⊳",vrtri:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",rtrie:"⊵",trianglerighteq:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",uharr:"↾",upharpoonright:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",rharu:"⇀",rightharpoonup:"⇀",RightVectorBar:"⥓",Ropf:"ℝ",reals:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",rAarr:"⇛",Rscr:"ℛ",realine:"ℛ",Rsh:"↱",rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortUpArrow:"↑",UpArrow:"↑",uarr:"↑",uparrow:"↑",Sigma:"Σ",SmallCircle:"∘",compfn:"∘",Sopf:"𝕊",Sqrt:"√",radic:"√",Square:"□",squ:"□",square:"□",SquareIntersection:"⊓",sqcap:"⊓",SquareSubset:"⊏",sqsub:"⊏",sqsubset:"⊏",SquareSubsetEqual:"⊑",sqsube:"⊑",sqsubseteq:"⊑",SquareSuperset:"⊐",sqsup:"⊐",sqsupset:"⊐",SquareSupersetEqual:"⊒",sqsupe:"⊒",sqsupseteq:"⊒",SquareUnion:"⊔",sqcup:"⊔",Sscr:"𝒮",Star:"⋆",sstarf:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",sube:"⊆",subseteq:"⊆",Succeeds:"≻",sc:"≻",succ:"≻",SucceedsEqual:"⪰",sce:"⪰",succeq:"⪰",SucceedsSlantEqual:"≽",sccue:"≽",succcurlyeq:"≽",SucceedsTilde:"≿",scsim:"≿",succsim:"≿",Sum:"∑",sum:"∑",Sup:"⋑",Supset:"⋑",Superset:"⊃",sup:"⊃",supset:"⊃",SupersetEqual:"⊇",supe:"⊇",supseteq:"⊇",THORN:"Þ",TRADE:"™",trade:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",there4:"∴",therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",thinsp:" ",Tilde:"∼",sim:"∼",thicksim:"∼",thksim:"∼",TildeEqual:"≃",sime:"≃",simeq:"≃",TildeFullEqual:"≅",cong:"≅",TildeTilde:"≈",ap:"≈",approx:"≈",asymp:"≈",thickapprox:"≈",thkap:"≈",Topf:"𝕋",TripleDot:"⃛",tdot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",lowbar:"_",UnderBrace:"⏟",UnderBracket:"⎵",bbrk:"⎵",UnderParenthesis:"⏝",Union:"⋃",bigcup:"⋃",xcup:"⋃",UnionPlus:"⊎",uplus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",udarr:"⇅",UpDownArrow:"↕",updownarrow:"↕",varr:"↕",UpEquilibrium:"⥮",udhar:"⥮",UpTee:"⊥",bot:"⊥",bottom:"⊥",perp:"⊥",UpTeeArrow:"↥",mapstoup:"↥",UpperLeftArrow:"↖",nwarr:"↖",nwarrow:"↖",UpperRightArrow:"↗",nearr:"↗",nearrow:"↗",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",bigvee:"⋁",xvee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",mid:"∣",shortmid:"∣",smid:"∣",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"❘",VerticalTilde:"≀",wr:"≀",wreath:"≀",VeryThinSpace:" ",hairsp:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",bigwedge:"⋀",xwedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",Zeta:"Ζ",Zfr:"ℨ",zeetrf:"ℨ",Zopf:"ℤ",integers:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",mstpos:"∾",acE:"∾̳",acd:"∿",acirc:"â",acy:"а",aelig:"æ",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",and:"∧",wedge:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",angle:"∠",ange:"⦤",angmsd:"∡",measuredangle:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angzarr:"⍼",aogon:"ą",aopf:"𝕒",apE:"⩰",apacir:"⩯",ape:"≊",approxeq:"≊",apid:"≋",apos:"'",aring:"å",ascr:"𝒶",ast:"*",midast:"*",atilde:"ã",auml:"ä",awint:"⨑",bNot:"⫭",backcong:"≌",bcong:"≌",backepsilon:"϶",bepsi:"϶",backprime:"‵",bprime:"‵",backsim:"∽",bsim:"∽",backsimeq:"⋍",bsime:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrktbrk:"⎶",bcy:"б",bdquo:"„",ldquor:"„",bemptyv:"⦰",beta:"β",beth:"ℶ",between:"≬",twixt:"≬",bfr:"𝔟",bigcirc:"◯",xcirc:"◯",bigodot:"⨀",xodot:"⨀",bigoplus:"⨁",xoplus:"⨁",bigotimes:"⨂",xotime:"⨂",bigsqcup:"⨆",xsqcup:"⨆",bigstar:"★",starf:"★",bigtriangledown:"▽",xdtri:"▽",bigtriangleup:"△",xutri:"△",biguplus:"⨄",xuplus:"⨄",bkarow:"⤍",rbarr:"⤍",blacklozenge:"⧫",lozf:"⧫",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",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:"┌",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",minusb:"⊟",boxplus:"⊞",plusb:"⊞",boxtimes:"⊠",timesb:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bumpE:"⪮",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cemptyv:"⦲",cent:"¢",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",cire:"≗",circlearrowleft:"↺",olarr:"↺",circlearrowright:"↻",orarr:"↻",circledS:"Ⓢ",oS:"Ⓢ",circledast:"⊛",oast:"⊛",circledcirc:"⊚",ocir:"⊚",circleddash:"⊝",odash:"⊝",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",comma:",",commat:"@",comp:"∁",complement:"∁",congdot:"⩭",copf:"𝕔",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",curlyeqprec:"⋞",cuesc:"⋟",curlyeqsucc:"⋟",cularr:"↶",curvearrowleft:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curvearrowright:"↷",curarrm:"⤼",curlyvee:"⋎",cuvee:"⋎",curlywedge:"⋏",cuwed:"⋏",curren:"¤",cwint:"∱",cylcty:"⌭",dHar:"⥥",dagger:"†",daleth:"ℸ",dash:"‐",hyphen:"‐",dbkarow:"⤏",rBarr:"⤏",dcaron:"ď",dcy:"д",ddarr:"⇊",downdownarrows:"⇊",ddotseq:"⩷",eDDot:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",diamondsuit:"♦",diams:"♦",digamma:"ϝ",gammad:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",llcorner:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",doteqdot:"≑",eDot:"≑",dotminus:"∸",minusd:"∸",dotplus:"∔",plusdo:"∔",dotsquare:"⊡",sdotb:"⊡",drcorn:"⌟",lrcorner:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",triangledown:"▿",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",eqcirc:"≖",ecirc:"ê",ecolon:"≕",eqcolon:"≕",ecy:"э",edot:"ė",efDot:"≒",fallingdotseq:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",eqslantgtr:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",eqslantless:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",straightepsilon:"ϵ",varepsilon:"ϵ",equals:"=",equest:"≟",questeq:"≟",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",risingdotseq:"≓",erarr:"⥱",escr:"ℯ",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",fork:"⋔",pitchfork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",sfrown:"⌢",fscr:"𝒻",gEl:"⪌",gtreqqless:"⪌",gacute:"ǵ",gamma:"γ",gap:"⪆",gtrapprox:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gimel:"ℷ",gjcy:"ѓ",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gneqq:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gnsim:"⋧",gopf:"𝕘",gscr:"ℊ",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtrdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrarr:"⥸",gvertneqq:"≩︀",gvnE:"≩︀",hardcy:"ъ",harrcir:"⥈",harrw:"↭",leftrightsquigarrow:"↭",hbar:"ℏ",hslash:"ℏ",planck:"ℏ",plankv:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",mldr:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",searhk:"⤥",hkswarow:"⤦",swarhk:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",larrhk:"↩",hookrightarrow:"↪",rarrhk:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hstrok:"ħ",hybull:"⁃",iacute:"í",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",ifr:"𝔦",igrave:"ì",iiiint:"⨌",qint:"⨌",iiint:"∭",tint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",imath:"ı",inodot:"ı",imof:"⊷",imped:"Ƶ",incare:"℅",infin:"∞",infintie:"⧝",intcal:"⊺",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iquest:"¿",iscr:"𝒾",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAtail:"⤛",lBarr:"⤎",lEg:"⪋",lesseqqgtr:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lambda:"λ",langd:"⦑",lap:"⪅",lessapprox:"⪅",laquo:"«",larrbfs:"⤟",larrfs:"⤝",larrlp:"↫",looparrowleft:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",leftarrowtail:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lcy:"л",ldca:"⤶",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leq:"≤",leftleftarrows:"⇇",llarr:"⇇",leftthreetimes:"⋋",lthree:"⋋",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessdot:"⋖",ltdot:"⋖",lfisht:"⥼",lfr:"𝔩",lgE:"⪑",lharul:"⥪",lhblk:"▄",ljcy:"љ",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lneqq:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lnsim:"⋦",loang:"⟬",loarr:"⇽",longmapsto:"⟼",xmap:"⟼",looparrowright:"↬",rarrlp:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",loz:"◊",lozenge:"◊",lpar:"(",lparlt:"⦓",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsime:"⪍",lsimg:"⪏",lsquor:"‚",sbquo:"‚",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",triangleleft:"◃",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",strns:"¯",male:"♂",malt:"✠",maltese:"✠",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",mfr:"𝔪",mho:"℧",micro:"µ",midcir:"⫰",minus:"−",minusdu:"⨪",mlcp:"⫛",models:"⊧",mopf:"𝕞",mscr:"𝓂",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nLeftarrow:"⇍",nlArr:"⇍",nLeftrightarrow:"⇎",nhArr:"⇎",nLl:"⋘̸",nLt:"≪⃒",nRightarrow:"⇏",nrArr:"⇏",nVDash:"⊯",nVdash:"⊮",nacute:"ń",nang:"∠⃒",napE:"⩰̸",napid:"≋̸",napos:"ʼn",natur:"♮",natural:"♮",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",neArr:"⇗",nearhk:"⤤",nedot:"≐̸",nesear:"⤨",toea:"⤨",nfr:"𝔫",nharr:"↮",nleftrightarrow:"↮",nhpar:"⫲",nis:"⋼",nisd:"⋺",njcy:"њ",nlE:"≦̸",nleqq:"≦̸",nlarr:"↚",nleftarrow:"↚",nldr:"‥",nopf:"𝕟",not:"¬",notinE:"⋹̸",notindot:"⋵̸",notinvb:"⋷",notinvc:"⋶",notnivb:"⋾",notnivc:"⋽",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",nrarr:"↛",nrightarrow:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nscr:"𝓃",nsub:"⊄",nsubE:"⫅̸",nsubseteqq:"⫅̸",nsup:"⊅",nsupE:"⫆̸",nsupseteqq:"⫆̸",ntilde:"ñ",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwnear:"⤧",oacute:"ó",ocirc:"ô",ocy:"о",odblac:"ő",odiv:"⨸",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",olcir:"⦾",olcross:"⦻",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",oopf:"𝕠",opar:"⦷",operp:"⦹",or:"∨",vee:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",oscr:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oslash:"ø",osol:"⊘",otilde:"õ",otimesas:"⨶",ouml:"ö",ovbar:"⌽",para:"¶",parsim:"⫳",parsl:"⫽",pcy:"п",percnt:"%",period:".",permil:"‰",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",straightphi:"ϕ",varphi:"ϕ",phone:"☎",pi:"π",piv:"ϖ",varpi:"ϖ",planckh:"ℎ",plus:"+",plusacir:"⨣",pluscir:"⨢",plusdu:"⨥",pluse:"⩲",plussim:"⨦",plustwo:"⨧",pointint:"⨕",popf:"𝕡",pound:"£",prE:"⪳",prap:"⪷",precapprox:"⪷",precnapprox:"⪹",prnap:"⪹",precneqq:"⪵",prnE:"⪵",precnsim:"⋨",prnsim:"⋨",prime:"′",profalar:"⌮",profline:"⌒",profsurf:"⌓",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quatint:"⨖",quest:"?",rAtail:"⤜",rHar:"⥤",race:"∽̱",racute:"ŕ",raemptyv:"⦳",rangd:"⦒",range:"⦥",raquo:"»",rarrap:"⥵",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rightarrowtail:"↣",rarrw:"↝",rightsquigarrow:"↝",ratail:"⤚",ratio:"∶",rbbrk:"❳",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdsh:"↳",rect:"▭",rfisht:"⥽",rfr:"𝔯",rharul:"⥬",rho:"ρ",rhov:"ϱ",varrho:"ϱ",rightrightarrows:"⇉",rrarr:"⇉",rightthreetimes:"⋌",rthree:"⋌",ring:"˚",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rsaquo:"›",rscr:"𝓇",rtimes:"⋊",rtri:"▹",triangleright:"▹",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",scE:"⪴",scap:"⪸",succapprox:"⪸",scaron:"š",scedil:"ş",scirc:"ŝ",scnE:"⪶",succneqq:"⪶",scnap:"⪺",succnapprox:"⪺",scnsim:"⋩",succnsim:"⋩",scpolint:"⨓",scy:"с",sdot:"⋅",sdote:"⩦",seArr:"⇘",sect:"§",semi:";",seswar:"⤩",tosa:"⤩",sext:"✶",sfr:"𝔰",sharp:"♯",shchcy:"щ",shcy:"ш",shy:"",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",simdot:"⩪",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",smashp:"⨳",smeparsl:"⧤",smile:"⌣",ssmile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",sqcaps:"⊓︀",sqcups:"⊔︀",sscr:"𝓈",star:"☆",sub:"⊂",subset:"⊂",subE:"⫅",subseteqq:"⫅",subdot:"⪽",subedot:"⫃",submult:"⫁",subnE:"⫋",subsetneqq:"⫋",subne:"⊊",subsetneq:"⊊",subplus:"⪿",subrarr:"⥹",subsim:"⫇",subsub:"⫕",subsup:"⫓",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",supE:"⫆",supseteqq:"⫆",supdot:"⪾",supdsub:"⫘",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supsetneqq:"⫌",supne:"⊋",supsetneq:"⊋",supplus:"⫀",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tcaron:"ť",tcedil:"ţ",tcy:"т",telrec:"⌕",tfr:"𝔱",theta:"θ",thetasym:"ϑ",thetav:"ϑ",vartheta:"ϑ",thorn:"þ",times:"×",timesbar:"⨱",timesd:"⨰",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tprime:"‴",triangle:"▵",utri:"▵",triangleq:"≜",trie:"≜",tridot:"◬",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",uHar:"⥣",uacute:"ú",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udblac:"ű",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uogon:"ų",uopf:"𝕦",upsi:"υ",upsilon:"υ",upuparrows:"⇈",uuarr:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",uuml:"ü",uwangle:"⦧",vBar:"⫨",vBarv:"⫩",vangrt:"⦜",varsubsetneq:"⊊︀",vsubne:"⊊︀",varsubsetneqq:"⫋︀",vsubnE:"⫋︀",varsupsetneq:"⊋︀",vsupne:"⊋︀",varsupsetneqq:"⫌︀",vsupnE:"⫌︀",vcy:"в",veebar:"⊻",veeeq:"≚",vellip:"⋮",vfr:"𝔳",vopf:"𝕧",vscr:"𝓋",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedgeq:"≙",weierp:"℘",wp:"℘",wfr:"𝔴",wopf:"𝕨",wscr:"𝓌",xfr:"𝔵",xi:"ξ",xnis:"⋻",xopf:"𝕩",xscr:"𝓍",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"",zwnj:""},_c="";br.ngsp=_c;var Bc=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function Tc(t,n){if(n!=null&&!(Array.isArray(n)&&n.length==2))throw new Error(`Expected '${t}' to be an array, [start, end].`);if(n!=null){let l=n[0],c=n[1];Bc.forEach(m=>{if(m.test(l)||m.test(c))throw new Error(`['${l}', '${c}'] contains unusable interpolation symbol.`)})}}var Lc=class vo{static fromArray(n){return n?(Tc("interpolation",n),new vo(n[0],n[1])):is}constructor(n,l){this.start=n,this.end=l}},is=new Lc("{{","}}"),Qr=class extends qa{constructor(t,n,l){super(l,t),this.tokenType=n}},Pc=class{constructor(t,n,l){this.tokens=t,this.errors=n,this.nonNormalizedIcuExpressions=l}};function Ic(t,n,l,c={}){let m=new Rc(new Ha(t,n),l,c);return m.tokenize(),new Pc(Wc(m.tokens),m.errors,m.nonNormalizedIcuExpressions)}var Oc=/\r\n?/g;function gt(t){return`Unexpected character "${t===0?"EOF":String.fromCharCode(t)}"`}function ls(t){return`Unknown entity "${t}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function Mc(t,n){return`Unable to parse entity "${n}" - ${t} character reference entities must end with ";"`}var xr;(function(t){t.HEX="hexadecimal",t.DEC="decimal"})(xr||(xr={}));var en=class{constructor(t){this.error=t}},Rc=class{constructor(t,n,l){this._getTagContentType=n,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=l.tokenizeExpansionForms||!1,this._interpolationConfig=l.interpolationConfig||is,this._leadingTriviaCodePoints=l.leadingTriviaChars&&l.leadingTriviaChars.map(m=>m.codePointAt(0)||0),this._canSelfClose=l.canSelfClose||!1,this._allowHtmComponentClosingTags=l.allowHtmComponentClosingTags||!1;let c=l.range||{endPos:t.content.length,startPos:0,startLine:0,startCol:0};this._cursor=l.escapedString?new Vc(t,c):new hs(t,c),this._preserveLineEndings=l.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=l.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=l.tokenizeBlocks??!0,this._tokenizeLet=l.tokenizeLet??!0;try{this._cursor.init()}catch(m){this.handleError(m)}}_processCarriageReturns(t){return this._preserveLineEndings?t:t.replace(Oc,`
|
|
19
|
-
`)}tokenize(){for(;this._cursor.peek()!==0;){let t=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(t):this._attemptStr("--")?this._consumeComment(t):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(t):this._consumeBogusComment(t);else if(this._attemptCharCode(47))this._consumeTagClose(t);else{let n=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=n,this._consumeBogusComment(t)):this._consumeTagOpen(t)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(t):this._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(t):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(t):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(n){this.handleError(n)}}this._beginToken(34),this._endToken([])}_getBlockName(){let t=!1,n=this._cursor.clone();return this._attemptCharCodeUntilFn(l=>ur(l)?!t:ds(l)?(t=!0,!1):!0),this._cursor.getChars(n).trim()}_consumeBlockStart(t){this._beginToken(25,t);let n=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(Z),this._attemptCharCode(41))this._attemptCharCodeUntilFn(Z);else{n.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):n.type=29}_consumeBlockEnd(t){this._beginToken(27,t),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(ps);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let t=this._cursor.clone(),n=null,l=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||n!==null;){let c=this._cursor.peek();if(c===92)this._cursor.advance();else if(c===n)n=null;else if(n===null&&Yr(c))n=c;else if(c===40&&n===null)l++;else if(c===41&&n===null){if(l===0)break;l>0&&l--}this._cursor.advance()}this._endToken([this._cursor.getChars(t)]),this._attemptCharCodeUntilFn(ps)}}_consumeLetDeclaration(t){if(this._beginToken(30,t),ur(this._cursor.peek()))this._attemptCharCodeUntilFn(Z);else{let l=this._endToken([this._cursor.getChars(t)]);l.type=33;return}let n=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(Z),!this._attemptCharCode(61)){n.type=33;return}this._attemptCharCodeUntilFn(l=>Z(l)&&!Kr(l)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(32),this._endToken([]),this._cursor.advance()):(n.type=33,n.sourceSpan=this._cursor.getSpan(t))}_getLetDeclarationName(){let t=this._cursor.clone(),n=!1;return this._attemptCharCodeUntilFn(l=>cr(l)||l===36||l===95||n&&Gr(l)?(n=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeLetDeclarationValue(){let t=this._cursor.clone();for(this._beginToken(31,t);this._cursor.peek()!==0;){let n=this._cursor.peek();if(n===59)break;Yr(n)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(l=>l===92?(this._cursor.advance(),!1):l===n)),this._cursor.advance()}this._endToken([this._cursor.getChars(t)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(qc(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(t,n=this._cursor.clone()){this._currentTokenStart=n,this._currentTokenType=t}_endToken(t,n){if(this._currentTokenStart===null)throw new Qr("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(n));if(this._currentTokenType===null)throw new Qr("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let l={type:this._currentTokenType,parts:t,sourceSpan:(n??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(l),this._currentTokenStart=null,this._currentTokenType=null,l}_createError(t,n){this._isInExpansionForm()&&(t+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let l=new Qr(t,this._currentTokenType,n);return this._currentTokenStart=null,this._currentTokenType=null,new en(l)}handleError(t){if(t instanceof tn&&(t=this._createError(t.msg,this._cursor.getSpan(t.cursor))),t instanceof en)this.errors.push(t.error);else throw t}_attemptCharCode(t){return this._cursor.peek()===t?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(t){return Uc(this._cursor.peek(),t)?(this._cursor.advance(),!0):!1}_requireCharCode(t){let n=this._cursor.clone();if(!this._attemptCharCode(t))throw this._createError(gt(this._cursor.peek()),this._cursor.getSpan(n))}_attemptStr(t){let n=t.length;if(this._cursor.charsLeft()<n)return!1;let l=this._cursor.clone();for(let c=0;c<n;c++)if(!this._attemptCharCode(t.charCodeAt(c)))return this._cursor=l,!1;return!0}_attemptStrCaseInsensitive(t){for(let n=0;n<t.length;n++)if(!this._attemptCharCodeCaseInsensitive(t.charCodeAt(n)))return!1;return!0}_requireStr(t){let n=this._cursor.clone();if(!this._attemptStr(t))throw this._createError(gt(this._cursor.peek()),this._cursor.getSpan(n))}_requireStrCaseInsensitive(t){let n=this._cursor.clone();if(!this._attemptStrCaseInsensitive(t))throw this._createError(gt(this._cursor.peek()),this._cursor.getSpan(n))}_attemptCharCodeUntilFn(t){for(;!t(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(t,n){let l=this._cursor.clone();if(this._attemptCharCodeUntilFn(t),this._cursor.diff(l)<n)throw this._createError(gt(this._cursor.peek()),this._cursor.getSpan(l))}_attemptUntilChar(t){for(;this._cursor.peek()!==t;)this._cursor.advance()}_readChar(){let t=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),t}_consumeEntity(t){this._beginToken(9);let n=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let l=this._attemptCharCode(120)||this._attemptCharCode(88),c=this._cursor.clone();if(this._attemptCharCodeUntilFn($c),this._cursor.peek()!=59){this._cursor.advance();let b=l?xr.HEX:xr.DEC;throw this._createError(Mc(b,this._cursor.getChars(n)),this._cursor.getSpan())}let m=this._cursor.getChars(c);this._cursor.advance();try{let b=parseInt(m,l?16:10);this._endToken([String.fromCharCode(b),this._cursor.getChars(n)])}catch{throw this._createError(ls(this._cursor.getChars(n)),this._cursor.getSpan())}}else{let l=this._cursor.clone();if(this._attemptCharCodeUntilFn(Hc),this._cursor.peek()!=59)this._beginToken(t,n),this._cursor=l,this._endToken(["&"]);else{let c=this._cursor.getChars(l);this._cursor.advance();let m=br[c];if(!m)throw this._createError(ls(c),this._cursor.getSpan(n));this._endToken([m,`&${c};`])}}}_consumeRawText(t,n){this._beginToken(t?6:7);let l=[];for(;;){let c=this._cursor.clone(),m=n();if(this._cursor=c,m)break;t&&this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(l.join(""))]),l.length=0,this._consumeEntity(6),this._beginToken(6)):l.push(this._readChar())}this._endToken([this._processCarriageReturns(l.join(""))])}_consumeComment(t){this._beginToken(10,t),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(t){this._beginToken(10,t),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(11),this._cursor.advance(),this._endToken([])}_consumeCdata(t){this._beginToken(12,t),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(t){this._beginToken(18,t),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(19),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(){let t=this._cursor.clone(),n="";for(;this._cursor.peek()!==58&&!zc(this._cursor.peek());)this._cursor.advance();let l;this._cursor.peek()===58?(n=this._cursor.getChars(t),this._cursor.advance(),l=this._cursor.clone()):l=t,this._requireCharCodeUntilFn(us,n===""?0:1);let c=this._cursor.getChars(l);return[n,c]}_consumeTagOpen(t){let n,l,c,m=[];try{if(!cr(this._cursor.peek()))throw this._createError(gt(this._cursor.peek()),this._cursor.getSpan(t));for(c=this._consumeTagOpenStart(t),l=c.parts[0],n=c.parts[1],this._attemptCharCodeUntilFn(Z);this._cursor.peek()!==47&&this._cursor.peek()!==62&&this._cursor.peek()!==60&&this._cursor.peek()!==0;){let[F,k]=this._consumeAttributeName();if(this._attemptCharCodeUntilFn(Z),this._attemptCharCode(61)){this._attemptCharCodeUntilFn(Z);let B=this._consumeAttributeValue();m.push({prefix:F,name:k,value:B})}else m.push({prefix:F,name:k});this._attemptCharCodeUntilFn(Z)}this._consumeTagOpenEnd()}catch(F){if(F instanceof en){c?c.type=4:(this._beginToken(5,t),this._endToken(["<"]));return}throw F}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===2)return;let b=this._getTagContentType(n,l,this._fullNameStack.length>0,m);this._handleFullNameStackForTagOpen(l,n),b===ve.RAW_TEXT?this._consumeRawTextWithTagClose(l,n,!1):b===ve.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(l,n,!0)}_consumeRawTextWithTagClose(t,n,l){this._consumeRawText(l,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(Z),!this._attemptStrCaseInsensitive(t?`${t}:${n}`:n))?!1:(this._attemptCharCodeUntilFn(Z),this._attemptCharCode(62))),this._beginToken(3),this._requireCharCodeUntilFn(c=>c===62,3),this._cursor.advance(),this._endToken([t,n]),this._handleFullNameStackForTagClose(t,n)}_consumeTagOpenStart(t){this._beginToken(0,t);let n=this._consumePrefixAndName();return this._endToken(n)}_consumeAttributeName(){let t=this._cursor.peek();if(t===39||t===34)throw this._createError(gt(t),this._cursor.getSpan());this._beginToken(14);let n=this._consumePrefixAndName();return this._endToken(n),n}_consumeAttributeValue(){let t;if(this._cursor.peek()===39||this._cursor.peek()===34){let n=this._cursor.peek();this._consumeQuote(n);let l=()=>this._cursor.peek()===n;t=this._consumeWithInterpolation(16,17,l,l),this._consumeQuote(n)}else{let n=()=>us(this._cursor.peek());t=this._consumeWithInterpolation(16,17,n,n)}return t}_consumeQuote(t){this._beginToken(15),this._requireCharCode(t),this._endToken([String.fromCodePoint(t)])}_consumeTagOpenEnd(){let t=this._attemptCharCode(47)?2:1;this._beginToken(t),this._requireCharCode(62),this._endToken([])}_consumeTagClose(t){if(this._beginToken(3,t),this._attemptCharCodeUntilFn(Z),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(Z),this._requireCharCode(62),this._endToken([]);else{let[n,l]=this._consumePrefixAndName();this._attemptCharCodeUntilFn(Z),this._requireCharCode(62),this._endToken([n,l]),this._handleFullNameStackForTagClose(n,l)}}_consumeExpansionFormStart(){this._beginToken(20),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(20),this._beginToken(7);let t=this._readUntil(44),n=this._processCarriageReturns(t);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([n]);else{let c=this._endToken([t]);n!==t&&this.nonNormalizedIcuExpressions.push(c)}this._requireCharCode(44),this._attemptCharCodeUntilFn(Z),this._beginToken(7);let l=this._readUntil(44);this._endToken([l]),this._requireCharCode(44),this._attemptCharCodeUntilFn(Z)}_consumeExpansionCaseStart(){this._beginToken(21);let t=this._readUntil(123).trim();this._endToken([t]),this._attemptCharCodeUntilFn(Z),this._beginToken(22),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(Z),this._expansionCaseStack.push(22)}_consumeExpansionCaseEnd(){this._beginToken(23),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(Z),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(24),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(t,n,l,c){this._beginToken(t);let m=[];for(;!l();){let F=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(m.join(""))],F),m.length=0,this._consumeInterpolation(n,F,c),this._beginToken(t)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(m.join(""))]),m.length=0,this._consumeEntity(t),this._beginToken(t)):m.push(this._readChar())}this._inInterpolation=!1;let b=this._processCarriageReturns(m.join(""));return this._endToken([b]),b}_consumeInterpolation(t,n,l){let c=[];this._beginToken(t,n),c.push(this._interpolationConfig.start);let m=this._cursor.clone(),b=null,F=!1;for(;this._cursor.peek()!==0&&(l===null||!l());){let k=this._cursor.clone();if(this._isTagStart()){this._cursor=k,c.push(this._getProcessedChars(m,k)),this._endToken(c);return}if(b===null)if(this._attemptStr(this._interpolationConfig.end)){c.push(this._getProcessedChars(m,k)),c.push(this._interpolationConfig.end),this._endToken(c);return}else this._attemptStr("//")&&(F=!0);let B=this._cursor.peek();this._cursor.advance(),B===92?this._cursor.advance():B===b?b=null:!F&&b===null&&Yr(B)&&(b=B)}c.push(this._getProcessedChars(m,this._cursor)),this._endToken(c)}_getProcessedChars(t,n){return this._processCarriageReturns(n.getChars(t))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._cursor.peek()===64||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let t=this._cursor.clone();t.advance();let n=t.peek();if(97<=n&&n<=122||65<=n&&n<=90||n===47||n===33)return!0}return!1}_isBlockStart(){if(this._tokenizeBlocks&&this._cursor.peek()===64){let t=this._cursor.clone();if(t.advance(),ds(t.peek()))return!0}return!1}_readUntil(t){let n=this._cursor.clone();return this._attemptUntilChar(t),this._cursor.getChars(n)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===22}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===20}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;if(this._interpolationConfig){let t=this._cursor.clone(),n=this._attemptStr(this._interpolationConfig.start);return this._cursor=t,!n}return!0}_handleFullNameStackForTagOpen(t,n){let l=mr(t,n);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===l)&&this._fullNameStack.push(l)}_handleFullNameStackForTagClose(t,n){let l=mr(t,n);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===l&&this._fullNameStack.pop()}};function Z(t){return!ur(t)||t===0}function us(t){return ur(t)||t===62||t===60||t===47||t===39||t===34||t===61||t===0}function zc(t){return(t<97||122<t)&&(t<65||90<t)&&(t<48||t>57)}function $c(t){return t===59||t===0||!Wu(t)}function Hc(t){return t===59||t===0||!cr(t)}function qc(t){return t!==125}function Uc(t,n){return cs(t)===cs(n)}function cs(t){return t>=97&&t<=122?t-97+65:t}function ds(t){return cr(t)||Gr(t)||t===95}function ps(t){return t!==59&&Z(t)}function Wc(t){let n=[],l;for(let c=0;c<t.length;c++){let m=t[c];l&&l.type===5&&m.type===5||l&&l.type===16&&m.type===16?(l.parts[0]+=m.parts[0],l.sourceSpan.end=m.sourceSpan.end):(l=m,n.push(l))}return n}var hs=class xn{constructor(n,l){if(n instanceof xn){this.file=n.file,this.input=n.input,this.end=n.end;let c=n.state;this.state={peek:c.peek,offset:c.offset,line:c.line,column:c.column}}else{if(!l)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=n,this.input=n.content,this.end=l.endPos,this.state={peek:-1,offset:l.startPos,line:l.startLine,column:l.startCol}}}clone(){return new xn(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(n){return this.state.offset-n.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(n,l){n=n||this;let c=n;if(l)for(;this.diff(n)>0&&l.indexOf(n.peek())!==-1;)c===n&&(n=n.clone()),n.advance();let m=this.locationFromCursor(n),b=this.locationFromCursor(this),F=c!==n?this.locationFromCursor(c):m;return new W(m,b,F)}getChars(n){return this.input.substring(n.state.offset,this.state.offset)}charAt(n){return this.input.charCodeAt(n)}advanceState(n){if(n.offset>=this.end)throw this.state=n,new tn('Unexpected character "EOF"',this);let l=this.charAt(n.offset);l===10?(n.line++,n.column=0):Kr(l)||n.column++,n.offset++,this.updatePeek(n)}updatePeek(n){n.peek=n.offset>=this.end?0:this.charAt(n.offset)}locationFromCursor(n){return new Xr(n.file,n.state.offset,n.state.line,n.state.column)}},Vc=class Dn extends hs{constructor(n,l){n instanceof Dn?(super(n),this.internalState={...n.internalState}):(super(n,l),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new Dn(this)}getChars(n){let l=n.clone(),c="";for(;l.internalState.offset<this.internalState.offset;)c+=String.fromCodePoint(l.peek()),l.advance();return c}processEscapeSequence(){let n=()=>this.internalState.peek;if(n()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),n()===110)this.state.peek=10;else if(n()===114)this.state.peek=13;else if(n()===118)this.state.peek=11;else if(n()===116)this.state.peek=9;else if(n()===98)this.state.peek=8;else if(n()===102)this.state.peek=12;else if(n()===117)if(this.advanceState(this.internalState),n()===123){this.advanceState(this.internalState);let l=this.clone(),c=0;for(;n()!==125;)this.advanceState(this.internalState),c++;this.state.peek=this.decodeHexDigits(l,c)}else{let l=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(l,4)}else if(n()===120){this.advanceState(this.internalState);let l=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(l,2)}else if($a(n())){let l="",c=0,m=this.clone();for(;$a(n())&&c<3;)m=this.clone(),l+=String.fromCodePoint(n()),this.advanceState(this.internalState),c++;this.state.peek=parseInt(l,8),this.internalState=m.internalState}else Kr(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(n,l){let c=this.input.slice(n.internalState.offset,n.internalState.offset+l),m=parseInt(c,16);if(isNaN(m))throw n.state=n.internalState,new tn("Invalid hexadecimal escape sequence",n);return m}},tn=class{constructor(t,n){this.msg=t,this.cursor=n}},de=class wo extends qa{static create(n,l,c){return new wo(n,l,c)}constructor(n,l,c){super(l,c),this.elementName=n}},Jc=class{constructor(t,n){this.rootNodes=t,this.errors=n}},Gc=class{constructor(t){this.getTagDefinition=t}parse(t,n,l,c=!1,m){let b=V=>(K,...re)=>V(K.toLowerCase(),...re),F=c?this.getTagDefinition:b(this.getTagDefinition),k=V=>F(V).getContentType(),B=c?m:b(m),R=Ic(t,n,m?(V,K,re,ie)=>{let ce=B(V,K,re,ie);return ce!==void 0?ce:k(V)}:k,l),I=l&&l.canSelfClose||!1,G=l&&l.allowHtmComponentClosingTags||!1,U=new Kc(R.tokens,F,I,G,c);return U.build(),new Jc(U.rootNodes,R.errors.concat(U.errors))}},Kc=class Co{constructor(n,l,c,m,b){this.tokens=n,this.getTagDefinition=l,this.canSelfClose=c,this.allowHtmComponentClosingTags=m,this.isTagNameCaseSensitive=b,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==34;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?(this._closeVoidElement(),this._consumeEndTag(this._advance())):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===20?this._consumeExpansion(this._advance()):this._peek.type===25?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===27?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===30?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===18?this._consumeDocType(this._advance()):this._peek.type===33?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._advance();for(let n of this._containerStack)n instanceof ft&&this.errors.push(de.create(n.name,n.sourceSpan,`Unclosed block "${n.name}"`))}_advance(){let n=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],n}_advanceIf(n){return this._peek.type===n?this._advance():null}_consumeCdata(n){let l=this._advance(),c=this._getText(l),m=this._advanceIf(13);this._addToParent(new Fc(c,new W(n.sourceSpan.start,(m||l).sourceSpan.end),[l]))}_consumeComment(n){let l=this._advanceIf(7),c=this._advanceIf(11),m=l!=null?l.parts[0].trim():null,b=c==null?n.sourceSpan:new W(n.sourceSpan.start,c.sourceSpan.end,n.sourceSpan.fullStart);this._addToParent(new Ac(m,b))}_consumeDocType(n){let l=this._advanceIf(7),c=this._advanceIf(19),m=l!=null?l.parts[0].trim():null,b=new W(n.sourceSpan.start,(c||l||n).sourceSpan.end);this._addToParent(new Nc(m,b))}_consumeExpansion(n){let l=this._advance(),c=this._advance(),m=[];for(;this._peek.type===21;){let F=this._parseExpansionCase();if(!F)return;m.push(F)}if(this._peek.type!==24){this.errors.push(de.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let b=new W(n.sourceSpan.start,this._peek.sourceSpan.end,n.sourceSpan.fullStart);this._addToParent(new Ec(l.parts[0],c.parts[0],m,b,l.sourceSpan)),this._advance()}_parseExpansionCase(){let n=this._advance();if(this._peek.type!==22)return this.errors.push(de.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let l=this._advance(),c=this._collectExpansionExpTokens(l);if(!c)return null;let m=this._advance();c.push({type:34,parts:[],sourceSpan:m.sourceSpan});let b=new Co(c,this.getTagDefinition,this.canSelfClose,this.allowHtmComponentClosingTags,this.isTagNameCaseSensitive);if(b.build(),b.errors.length>0)return this.errors=this.errors.concat(b.errors),null;let F=new W(n.sourceSpan.start,m.sourceSpan.end,n.sourceSpan.fullStart),k=new W(l.sourceSpan.start,m.sourceSpan.end,l.sourceSpan.fullStart);return new Sc(n.parts[0],b.rootNodes,F,n.sourceSpan,k)}_collectExpansionExpTokens(n){let l=[],c=[22];for(;;){if((this._peek.type===20||this._peek.type===22)&&c.push(this._peek.type),this._peek.type===23)if(ms(c,22)){if(c.pop(),c.length===0)return l}else return this.errors.push(de.create(null,n.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===24)if(ms(c,20))c.pop();else return this.errors.push(de.create(null,n.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===34)return this.errors.push(de.create(null,n.sourceSpan,"Invalid ICU message. Missing '}'.")),null;l.push(this._advance())}}_getText(n){let l=n.parts[0];if(l.length>0&&l[0]==`
|
|
20
|
-
`){
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
...`,l)),m===-1)return;let F=m+1+Mt,k=t.charAt(F+1);if(!/\s?/u.test(k))return;let B=t.slice(0,F);return{type:"front-matter",language:b,explicitLanguage:c,value:t.slice(l+1,m),startDelimiter:n,endDelimiter:B.slice(-Mt),raw:B}}function td(t){let n=ed(t);if(!n)return{content:t};let{raw:l}=n;return{frontMatter:n,content:A(!1,l,/[^\n]/gu," ")+t.slice(l.length)}}var rd=td,Dr={attrs:!0,children:!0,cases:!0,expression:!0},bs=new Set(["parent"]),bt,nn,an,nd=class qt{constructor(n={}){v(this,bt),w(this,"type"),w(this,"parent");for(let l of new Set([...bs,...Object.keys(n)]))this.setProperty(l,n[l])}setProperty(n,l){if(this[n]!==l){if(n in Dr&&(l=l.map(c=>this.createChild(c))),!bs.has(n)){this[n]=l;return}Object.defineProperty(this,n,{value:l,enumerable:!1,configurable:!0})}}map(n){let l;for(let c in Dr){let m=this[c];if(m){let b=sd(m,F=>F.map(n));l!==m&&(l||(l=new qt({parent:this.parent})),l.setProperty(c,b))}}if(l)for(let c in this)c in Dr||(l[c]=this[c]);return n(l||this)}walk(n){for(let l in Dr){let c=this[l];if(c)for(let m=0;m<c.length;m++)c[m].walk(n)}n(this)}createChild(n){let l=n instanceof qt?n.clone():new qt(n);return l.setProperty("parent",this),l}insertChildBefore(n,l){let c=this.$children;c.splice(c.indexOf(n),0,this.createChild(l))}removeChild(n){let l=this.$children;l.splice(l.indexOf(n),1)}replaceChild(n,l){let c=this.$children;c[c.indexOf(n)]=this.createChild(l)}clone(){return new qt(this)}get $children(){return this[y(this,bt,nn)]}set $children(n){this[y(this,bt,nn)]=n}get firstChild(){var n;return(n=this.$children)==null?void 0:n[0]}get lastChild(){return Ft(!0,this.$children,-1)}get prev(){let n=y(this,bt,an);return n[n.indexOf(this)-1]}get next(){let n=y(this,bt,an);return n[n.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(n=>[n.fullName,n.value]))}};bt=new WeakSet,nn=function(){return this.type==="angularIcuCase"?"expression":this.type==="angularIcuExpression"?"cases":"children"},an=function(){var t;return((t=this.parent)==null?void 0:t.$children)??[]};var ad=nd;function sd(t,n){let l=t.map(n);return l.some((c,m)=>c!==t[m])?l:t}var od=[{regex:/^(\[if([^\]]*)\]>)(.*?)<!\s*\[endif\]$/su,parse:ld},{regex:/^\[if([^\]]*)\]><!$/u,parse:ud},{regex:/^<!\s*\[endif\]$/u,parse:cd}];function id(t,n){if(t.value)for(let{regex:l,parse:c}of od){let m=t.value.match(l);if(m)return c(t,n,m)}return null}function ld(t,n,l){let[,c,m,b]=l,F=4+c.length,k=t.sourceSpan.start.moveBy(F),B=k.moveBy(b.length),[R,I]=(()=>{try{return[!0,n(b,k).children]}catch{return[!1,[{type:"text",value:b,sourceSpan:new W(k,B)}]]}})();return{type:"ieConditionalComment",complete:R,children:I,condition:A(!1,m.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan,startSourceSpan:new W(t.sourceSpan.start,k),endSourceSpan:new W(B,t.sourceSpan.end)}}function ud(t,n,l){let[,c]=l;return{type:"ieConditionalStartComment",condition:A(!1,c.trim(),/\s+/gu," "),sourceSpan:t.sourceSpan}}function cd(t){return{type:"ieConditionalEndComment",sourceSpan:t.sourceSpan}}var sn=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),dd=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function pd(t){if(t.type==="block"){if(t.name=A(!1,t.name.toLowerCase(),/\s+/gu," ").trim(),t.type="angularControlFlowBlock",!Pr(t.parameters)){delete t.parameters;return}for(let n of t.parameters)n.type="angularControlFlowBlockParameter";t.parameters={type:"angularControlFlowBlockParameters",children:t.parameters,sourceSpan:new W(t.parameters[0].sourceSpan.start,Ft(!1,t.parameters,-1).sourceSpan.end)}}}function hd(t){t.type==="letDeclaration"&&(t.type="angularLetDeclaration",t.id=t.name,t.init={type:"angularLetDeclarationInitializer",sourceSpan:new W(t.valueSpan.start,t.valueSpan.end),value:t.value},delete t.name,delete t.value)}function md(t){(t.type==="plural"||t.type==="select")&&(t.clause=t.type,t.type="angularIcuExpression"),t.type==="expansionCase"&&(t.type="angularIcuCase")}function xs(t,n,l){let{name:c,canSelfClose:m=!0,normalizeTagName:b=!1,normalizeAttributeName:F=!1,allowHtmComponentClosingTags:k=!1,isTagNameCaseSensitive:B=!1,shouldParseAsRawText:R}=n,{rootNodes:I,errors:G}=gs(t,{canSelfClose:m,allowHtmComponentClosingTags:k,isTagNameCaseSensitive:B,getTagContentType:R?(...O)=>R(...O)?ve.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:c==="angular"?!0:void 0,tokenizeAngularLetDeclaration:c==="angular"?!0:void 0});if(c==="vue"){if(I.some(Q=>Q.type==="docType"&&Q.value==="html"||Q.type==="element"&&Q.name.toLowerCase()==="html"))return xs(t,on,l);let O,J=()=>O??(O=gs(t,{canSelfClose:m,allowHtmComponentClosingTags:k,isTagNameCaseSensitive:B})),ne=Q=>J().rootNodes.find(({startSourceSpan:pe})=>pe&&pe.start.offset===Q.startSourceSpan.start.offset)??Q;for(let[Q,pe]of I.entries()){let{endSourceSpan:xt,startSourceSpan:Cd}=pe;if(xt===null)G=J().errors,I[Q]=ne(pe);else if(fd(pe,l)){let vs=J().errors.find(ws=>ws.span.start.offset>Cd.start.offset&&ws.span.start.offset<xt.end.offset);vs&&Ds(vs),I[Q]=ne(pe)}}}G.length>0&&Ds(G[0]);let U=O=>{let J=O.name.startsWith(":")?O.name.slice(1).split(":")[0]:null,ne=O.nameSpan.toString(),Q=J!==null&&ne.startsWith(`${J}:`),pe=Q?ne.slice(J.length+1):ne;O.name=pe,O.namespace=J,O.hasExplicitNamespace=Q},V=O=>{switch(O.type){case"element":U(O);for(let J of O.attrs)U(J),J.valueSpan?(J.value=J.valueSpan.toString(),/["']/u.test(J.value[0])&&(J.value=J.value.slice(1,-1))):J.value=null;break;case"comment":O.value=O.sourceSpan.toString().slice(4,-3);break;case"text":O.value=O.sourceSpan.toString();break}},K=(O,J)=>{let ne=O.toLowerCase();return J(ne)?ne:O},re=O=>{if(O.type==="element"&&(b&&(!O.namespace||O.namespace===O.tagDefinition.implicitNamespacePrefix||St(O))&&(O.name=K(O.name,J=>dd.has(J))),F))for(let J of O.attrs)J.namespace||(J.name=K(J.name,ne=>sn.has(O.name)&&(sn.get("*").has(ne)||sn.get(O.name).has(ne))))},ie=O=>{O.sourceSpan&&O.endSourceSpan&&(O.sourceSpan=new W(O.sourceSpan.start,O.endSourceSpan.end))},ce=O=>{if(O.type==="element"){let J=Zr(B?O.name:O.name.toLowerCase());!O.namespace||O.namespace===J.implicitNamespacePrefix||St(O)?O.tagDefinition=J:O.tagDefinition=Zr("")}};return os(new class extends jc{visitExpansionCase(O,J){c==="angular"&&this.visitChildren(J,ne=>{ne(O.expression)})}visit(O){V(O),ce(O),re(O),ie(O)}},I),I}function fd(t,n){var l;if(t.type!=="element"||t.name!=="template")return!1;let c=(l=t.attrs.find(m=>m.name==="lang"))==null?void 0:l.value;return!c||tr(n,{language:c})==="html"}function Ds(t){let{msg:n,span:{start:l,end:c}}=t;throw Qc(n,{loc:{start:{line:l.line+1,column:l.col+1},end:{line:c.line+1,column:c.col+1}},cause:t})}function ys(t,n,l={},c=!0){let{frontMatter:m,content:b}=c?rd(t):{frontMatter:null,content:t},F=new Ha(t,l.filepath),k=new Xr(F,0,0,0),B=k.moveBy(t.length),R={type:"root",sourceSpan:new W(k,B),children:xs(b,n,l)};if(m){let U=new Xr(F,0,0,0),V=U.moveBy(m.raw.length);m.sourceSpan=new W(U,V),R.children.unshift(m)}let I=new ad(R),G=(U,V)=>{let{offset:K}=V,re=A(!1,t.slice(0,K),/[^\n\r]/gu," "),ie=ys(re+U,n,l,!1);ie.sourceSpan=new W(V,Ft(!1,ie.children,-1).sourceSpan.end);let ce=ie.children[0];return ce.length===K?ie.children.shift():(ce.sourceSpan=new W(ce.sourceSpan.start.moveBy(K),ce.sourceSpan.end),ce.value=ce.value.slice(K)),ie};return I.walk(U=>{if(U.type==="comment"){let V=id(U,G);V&&U.parent.replaceChild(U,V)}pd(U),hd(U),md(U)}),I}function Rt(t){return{parse:(n,l)=>ys(n,t,l),hasPragma:Pu,hasIgnorePragma:Iu,astFormat:"html",locStart:At,locEnd:sr}}var on={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},gd=Rt(on),bd=new Set(["mj-style","mj-raw"]),xd=Rt({...on,name:"mjml",shouldParseAsRawText:t=>bd.has(t)}),Dd=Rt({name:"angular"}),yd=Rt({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(t,n,l,c){return t.toLowerCase()!=="html"&&!l&&(t!=="template"||c.some(({name:m,value:b})=>m==="lang"&&b!=="html"&&b!==""&&b!==void 0))}}),vd=Rt({name:"lwc",canSelfClose:!1}),wd={html:cc};return g(C)})})(Do);var Fo=Do.exports;const ap=np(Fo),sp=Td({__proto__:null,default:ap},[Fo]);var op=Object.create,Pn=Object.defineProperty,ip=Object.getOwnPropertyDescriptor,lp=Object.getOwnPropertyNames,up=Object.getPrototypeOf,cp=Object.prototype.hasOwnProperty,Eo=e=>{throw TypeError(e)},dp=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),In=(e,r)=>{for(var a in r)Pn(e,a,{get:r[a],enumerable:!0})},pp=(e,r,a,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of lp(r))!cp.call(e,i)&&i!==a&&Pn(e,i,{get:()=>r[i],enumerable:!(s=ip(r,i))||s.enumerable});return e},hp=(e,r,a)=>(a=e!=null?op(up(e)):{},pp(Pn(a,"default",{value:e,enumerable:!0}),e)),mp=(e,r,a)=>r.has(e)||Eo("Cannot "+a),fp=(e,r,a)=>r.has(e)?Eo("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,a),$t=(e,r,a)=>(mp(e,r,"access private method"),a),gp=dp(e=>{Object.defineProperty(e,"__esModule",{value:!0});function r(){return new Proxy({},{get:()=>u=>u})}var a=/\r\n|[\n\r\u2028\u2029]/;function s(u,d,p){let f=Object.assign({column:0,line:-1},u.start),h=Object.assign({},f,u.end),{linesAbove:g=2,linesBelow:w=3}=p||{},D=f.line,y=f.column,v=h.line,E=h.column,C=Math.max(D-(g+1),0),x=Math.min(d.length,v+w);D===-1&&(C=0),v===-1&&(x=d.length);let A=v-D,j={};if(A)for(let N=0;N<=A;N++){let P=N+D;if(!y)j[P]=!0;else if(N===0){let M=d[P-1].length;j[P]=[y,M-y+1]}else if(N===A)j[P]=[0,E];else{let M=d[P-N].length;j[P]=[0,M]}}else y===E?y?j[D]=[y,0]:j[D]=!0:j[D]=[y,E-y];return{start:C,end:x,markerLines:j}}function i(u,d,p={}){let f=r(),h=u.split(a),{start:g,end:w,markerLines:D}=s(d,h,p),y=d.start&&typeof d.start.column=="number",v=String(w).length,E=u.split(a,w).slice(g,w).map((C,x)=>{let A=g+1+x,j=` ${` ${A}`.slice(-v)} |`,N=D[A],P=!D[A+1];if(N){let M="";if(Array.isArray(N)){let _=C.slice(0,Math.max(N[0]-1,0)).replace(/[^\t]/g," "),$=N[1]||1;M=[`
|
|
25
|
-
|
|
26
|
-
`)
|
|
27
|
-
|
|
28
|
-
`?"crlf":"cr":"lf"}function On(e){switch(e){case"cr":return"\r";case"crlf":return`\r
|
|
1
|
+
"use strict";var _2=Object.defineProperty;var I2=(t,e,r)=>e in t?_2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var kt=(t,e,r)=>I2(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,"__esModule",{value:!0});const h=require("react/jsx-runtime"),R2=require("react-shadow"),F=require("react"),Q=require("@craftjs/core"),Rt=require("react-icons/ri"),_=require("react-icons/fi"),P2=require("htmlparser2"),z2=require("@monaco-editor/react"),Ei=require("react-dom"),Et=require("react-icons/bi"),jr=require("react-icons/tb"),ns=require("react-icons/lu"),$2=require("@craftjs/utils"),H2=require("re-resizable"),Pr=require("@bolttech/templating-sdk");function Si(t){return t&&t.__esModule?t:{default:t}}function V2(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in t)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:function(){return n[s]}})}}}return Object.freeze(t)}const q2=Si(R2),Be=Si(F),W2=Si(z2),U2=Si(Ei),jh=({text:t="Text",style:e,href:r,...n})=>{const{connectors:{connect:s,drag:o},selected:i}=Q.useNode(c=>({selected:c.events.selected})),{isEnabled:a}=Q.useEditor(c=>({isEnabled:c.options.enabled})),l=()=>({...{fontFamily:"inherit",fontWeight:"500",cursor:i?"pointer":"default",transition:"all 0.2s",padding:"8px 16px",fontSize:"16px",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap",display:"inline-flex",textDecoration:"none",lineHeight:"1.5",alignItems:"center",justifyContent:"center"},...e});return h.jsx("a",{ref:c=>{c&&s(o(c))},style:l(),href:a?void 0:r,target:"_blank",...n,children:t})},J2={props:{text:"Text",target:"_blank",style:{fontFamily:"inherit",fontWeight:"500",cursor:"pointer",transition:"all 0.2s",padding:"8px 16px",fontSize:"16px",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap",display:"inline-flex",textDecoration:"none",lineHeight:"1.5",alignItems:"center",justifyContent:"center"}},displayName:"Anchor",custom:{displayName:"Anchor",settings:["anchor","typography","background","border","spacing"]}};function Jl(){const{actions:{setProp:t},text:e,href:r}=Q.useNode(n=>({text:n.data.props.text,href:n.data.props.href}));return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Text"}),h.jsx("input",{type:"text",value:e,onChange:n=>t(s=>s.text=n.target.value),className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Link"}),h.jsx("input",{type:"text",value:r||"",onChange:n=>{t(s=>s.href=n.target.value)},className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}jh.craft={...J2,related:{settings:Jl}};const Oh=({children:t,style:e,...r})=>{const{connectors:{connect:n,drag:s}}=Q.useNode(i=>({selected:i.events.selected})),o={...e,overflow:"visible",boxSizing:"border-box",...e?.height==="auto"&&{height:"auto",minHeight:e?.minHeight||"50px"}};return h.jsx("div",{ref:i=>{i&&n(s(i))},style:o,...r,children:t})},K2={displayName:"Box",isCanvas:!0,custom:{resizable:!0,settings:["box","default"]},props:{style:{border:"none",borderRadius:"0px",width:"100%",height:"auto",minHeight:"50px"}}};Oh.craft={...K2};const Mt=({options:t,value:e,onChange:r,placeholder:n="Select an option",disabled:s=!1,className:o=""})=>h.jsxs("div",{className:`relative ${o}`,children:[h.jsxs("select",{value:e||"",onChange:i=>r?.(i.target.value),disabled:s,className:`w-full appearance-none rounded-none border border-[#E8E7EE] bg-white px-3 py-2 pr-10 text-sm text-gray-700 transition-all duration-200 hover:border-[#170F4F]/30 hover:bg-gray-50 focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]/20 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400 ${e?"text-gray-700":"text-gray-500"} `,children:[n&&h.jsx("option",{value:"",disabled:!0,hidden:!0,children:n}),t.map(i=>h.jsx("option",{value:i.value,disabled:i.disabled,children:i.label},i.value))]}),h.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:h.jsx(_.FiChevronDown,{size:16,className:`transition-colors duration-200 ${s?"text-gray-400":"text-gray-500"}`})})]});function Lh(){const{actions:{setProp:t},style:e}=Q.useNode(n=>({style:n.data.props.style})),r=e.display==="block"?"block":e.flexDirection;return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Layout direction"}),h.jsx(Mt,{options:[{value:"row",label:"Row"},{value:"column",label:"Column"},{value:"block",label:"Block"}],value:r,onChange:n=>{t(n==="block"?s=>{s.style.display="block",delete s.style.flexDirection}:s=>{s.style.display="flex",s.style.flexDirection=n})},placeholder:"Choose alignment"})]}),e.display!=="block"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Alignment"}),h.jsx(Mt,{options:[{value:"flex-start",label:"Flex Start"},{value:"flex-end",label:"Flex End"},{value:"center",label:"Center"},{value:"space-between",label:"Space Between"},{value:"space-around",label:"Space Around"},{value:"space-evenly",label:"Space Evenly"}],value:e.justifyContent,onChange:n=>t(s=>s.style.justifyContent=n),placeholder:"Choose alignment"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Gap"}),h.jsx(Mt,{options:[{value:"0px",label:"0"},{value:"4px",label:"4"},{value:"8px",label:"8"},{value:"12px",label:"12"},{value:"16px",label:"16"},{value:"24px",label:"24"},{value:"32px",label:"32"},{value:"48px",label:"48"},{value:"64px",label:"64"}],value:e.gap,onChange:n=>t(s=>s.style.gap=n),placeholder:"Choose gap"})]})]})]})}const _h=({text:t="Button",onClick:e,style:r,...n})=>{const{connectors:{connect:s,drag:o},selected:i}=Q.useNode(l=>({selected:l.events.selected})),a=()=>({...{fontFamily:"inherit",fontWeight:"500",cursor:i?"pointer":"default",transition:"all 0.2s",padding:"8px 16px",fontSize:"16px",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap"},...r});return h.jsx("button",{ref:l=>{l&&s(o(l))},style:a(),className:`${i?"ring-primary-500 ring-2 ring-opacity-50":"hover:ring-2 hover:ring-gray-300 hover:ring-opacity-50"} transition-all duration-200`,onClick:e,...n,children:t})},G2={props:{text:"Button",style:{fontFamily:"inherit",fontWeight:"500",cursor:"pointer",transition:"all 0.2s",padding:"8px 16px",fontSize:"16",backgroundColor:"#3b82f6",color:"#ffffff",borderRadius:"8px",borderStyle:"none",whiteSpace:"nowrap"}},displayName:"Button",custom:{displayName:"Button",settings:["button","typography","background","border","spacing"]}};function Kl(){const{actions:{setProp:t},text:e,href:r}=Q.useNode(n=>({text:n.data.props.text,href:n.data.props.href}));return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Button text"}),h.jsx("input",{type:"text",value:e,onChange:n=>t(s=>s.text=n.target.value),className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Link"}),h.jsx("input",{type:"text",value:r||"",onChange:n=>{t(s=>s.onClick=()=>{window.open(n.target.value,"_blank")}),t(s=>s.href=n.target.value)},className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}_h.craft={...G2,related:{settings:Kl}};const Ih=({children:t,style:e,renderedChild:r=0,...n})=>{const{connectors:{connect:s,drag:o}}=Q.useNode(d=>({selected:d.events.selected})),i={...e,overflow:"visible",boxSizing:"border-box",...e?.height==="auto"&&{height:"auto",minHeight:e?.minHeight||"50px"}};function a(d){if(!F.isValidElement(d))return null;const f=d.props;return!f||f.children===void 0?null:Be.default.Children.toArray(f.children)}const l=a(t),c=l?l[r-1]:null;return h.jsx("div",{ref:d=>{d&&s(o(d))},style:i,...n,children:c})},Y2={displayName:"Conditional",isCanvas:!0,custom:{resizable:!0,settings:["conditional","default"]},props:{conditions:[{variable:"",operator:"===",value:"",option:"1",isElse:!1}],style:{border:"none",borderRadius:"0px",width:"100%",height:"auto",minHeight:"50px"}}};Ih.craft={...Y2};const _n=({title:t,icon:e,children:r,defaultOpen:n=!1,className:s="",noPadding:o=!1})=>{const i=F.useRef(null),[a,l]=F.useState(n),[c,d]=F.useState(n?void 0:0),f=F.useRef(null);F.useEffect(()=>{i.current&&i.current.parentElement&&i.current.parentElement.firstElementChild===i.current&&!n&&(l(!0),d(void 0))},[n]),F.useEffect(()=>{if(f.current)if(a){const g=f.current.scrollHeight;d(g)}else d(0)},[a]);const m=()=>{l(!a)};return h.jsxs("div",{ref:i,className:`overflow-hidden border border-[#E8E7EE] ${s}`,children:[h.jsxs("button",{onClick:m,className:"flex w-full items-center justify-between border-b border-[#E8E7EE] bg-white px-4 py-3 transition-colors hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-[#170F4F]",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[e,h.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:t})]}),h.jsx(_.FiChevronDown,{size:16,className:`text-[#A29FB9] transition-transform duration-200 ${a?"rotate-0":"-rotate-90"}`})]}),h.jsx("div",{ref:f,style:{height:c,overflow:"hidden",transition:"height 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},"data-testid":`collapse-content-${t.replace(/\s+/g,"-").toLowerCase()}`,children:a&&h.jsx("div",{className:o?"":"bg-white p-4",children:r})})]})};function Rh(){const{renderedChild:t,conditionsProps:e,actions:{setProp:r}}=Q.useNode(y=>({renderedChild:y.data.props.renderedChild,conditionsProps:y.data.props.conditions})),n=[{value:"===",label:"is equal to"},{value:"!==",label:"is not equal to"},{value:">",label:"is greater than"},{value:"<",label:"< is less than"},{value:">=",label:"is greater or equal to",disabled:!0},{value:"<=",label:"is less or equal to",disabled:!0}],[s,o]=F.useState(e||[{variable:"",operator:"===",value:"",option:"1",isElse:!1}]);F.useEffect(()=>{r(y=>y.conditions=s)},[s]);const i=()=>{o(y=>[...y,{variable:"",operator:"===",value:"",option:`${y.length+1}`,isElse:!1}])},a=(y,v,w)=>{o(D=>D.map((E,N)=>N===y?{...E,[v]:w}:E))},l=y=>{o(v=>v.map((w,D)=>D===y?{...w,isElse:!w.isElse}:w))},[c,d]=F.useState(t),f=y=>(y.isElse||!!y.variable&&!!y.operator&&!!y.value)&&!!y.option,m=s[s.length-1],g=m?f(m):!0;return h.jsxs("div",{className:"space-y-2 p-4",children:[h.jsxs("div",{className:"mt-4 whitespace-pre-wrap border bg-gray-50 p-3 text-xs text-gray-600",children:[h.jsx("div",{className:"mb-1 font-semibold",children:"Generated Conditions: (test purposes)"}),s.map((y,v)=>y.option&&h.jsxs("label",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",name:"condition-option",value:y.option,checked:c===y.option,onChange:()=>{r(w=>w.renderedChild=parseInt(y.option)),d(y.option)},className:"form-radio text-blue-600"}),h.jsx("span",{children:y.isElse?`ELSE → ${y.option}`:`IF ${y.variable} ${y.operator} ${JSON.stringify(y.value)} → ${y.option}`})]},v))]}),s.map((y,v)=>h.jsx(_n,{title:y.isElse?"ELSE":`Condition ${v+1}`,icon:h.jsx(_.FiEdit3,{size:14,className:"text-[#170F4F]"}),defaultOpen:!0,noPadding:!0,children:h.jsxs("div",{className:"relative flex flex-col gap-2 border border-gray-200 bg-gray-50 p-3",children:[v!==0&&h.jsx("button",{type:"button",className:"absolute right-2 top-2 text-gray-400 hover:text-red-500",onClick:()=>{o(w=>w.filter((D,E)=>E!==v))},children:h.jsx(_.FiTrash2,{size:14})}),!y.isElse&&v===s.length-1&&v!==0&&h.jsxs("label",{className:"mt-1 inline-flex items-center space-x-2 text-sm",children:[h.jsx("input",{type:"checkbox",checked:y.isElse,onChange:()=>l(v),disabled:v===0||!s[v-1]?.variable||s.length-1!==v}),h.jsx("span",{children:"Transform to ELSE condition"})]}),!y.isElse&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",placeholder:"Variable (placeholder/tag)",className:"w-full border border-gray-300 px-2 py-1 text-sm",value:y.variable,onChange:w=>a(v,"variable",w.target.value)}),h.jsx(Mt,{value:y.operator,onChange:w=>a(v,"operator",w),options:n}),h.jsx("input",{type:"text",placeholder:"Value",className:"w-full border border-gray-300 px-2 py-1 text-sm",value:y.value,onChange:w=>a(v,"value",w.target.value)})]}),h.jsx("input",{type:"number",placeholder:"Children component (what is rendered if this condition is true)",className:"w-full border border-gray-300 px-2 py-1 text-sm",value:y.option,onChange:w=>a(v,"option",w.target.value),min:1})]},v)})),!s[s.length-1]?.isElse&&h.jsxs("div",{className:"group relative mt-2 inline-block",children:[h.jsx("button",{type:"button",className:`mt-2 px-3 py-1 text-sm text-white ${g?"bg-[#170F4F] hover:bg-blue-700":"cursor-not-allowed bg-gray-400"}`,onClick:i,disabled:!g,children:"Add Condition"}),!g&&h.jsx("div",{className:"absolute left-[75%] top-full z-10 ml-2 mt-1 hidden w-48 rounded bg-black px-2 py-1 text-left text-xs text-white group-hover:block",children:"Before adding a new condition, complete the previous one."})]})]})}function Gl(){const{actions:{setProp:t},style:e}=Q.useNode(r=>({style:r.data.props.style}));return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Height"}),h.jsx("input",{type:"text",value:e.height,onChange:r=>t(n=>n.style.height=r.target.value),placeholder:"1px",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Width"}),h.jsx("input",{type:"text",value:e.width,onChange:r=>t(n=>n.style.width=r.target.value),placeholder:"100%",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}const Yl=({style:t,...e})=>{const{connectors:{connect:r,drag:n},selected:s}=Q.useNode(i=>({selected:i.events.selected})),o={...t,cursor:s?"pointer":"default"};return h.jsx("hr",{ref:i=>{i&&r(n(i))},style:o,className:`${s?"ring-primary-500 ring-2 ring-opacity-50":"hover:ring-2 hover:ring-gray-300 hover:ring-opacity-50"} transition-all duration-200`,...e})};Yl.craft={props:{style:{height:"1px",width:"100%",margin:"16px 0",backgroundColor:"#e5e7eb"}},related:{settings:Gl}};const X2={props:{style:{marginTop:"0px",marginRight:"0px",marginBottom:"0px",marginLeft:"0px",backgroundColor:"#e5e7eb",height:"1px",width:"100%"}},related:{settings:"DividerSettings"},custom:{displayName:"Divider",settings:["divider","background","spacing"]}};Yl.craft={...X2};const Ph=({src:t="https://picsum.photos/id/1/1200/1200",alt:e="Image",style:r,...n})=>{const{connectors:{connect:s,drag:o},selected:i}=Q.useNode(l=>({selected:l.events.selected})),a={...r,cursor:i?"pointer":"default"};return h.jsx("img",{ref:l=>{l&&s(o(l))},src:t,alt:e,style:a,className:`${i?"ring-primary-500 ring-2 ring-opacity-50":"hover:ring-2 hover:ring-gray-300 hover:ring-opacity-50"}`,...n})},Q2={props:{src:"https://picsum.photos/id/1/1200/1200",alt:"Image",style:{width:"200px",height:"200px",objectFit:"cover",borderRadius:"0px"}},custom:{resizable:!0,settings:["image","border"]},related:{settings:"ImageSettings"}};function Xl(){const{actions:{setProp:t},src:e,alt:r,style:n}=Q.useNode(s=>({src:s.data.props.src,alt:s.data.props.alt,style:s.data.props.style}));return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Image URL"}),h.jsx("input",{type:"text",value:e,onChange:s=>t(o=>o.src=s.target.value),placeholder:"https://example.com/image.jpg",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Alt Text"}),h.jsx("input",{type:"text",value:r,onChange:s=>t(o=>o.alt=s.target.value),placeholder:"Image description",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Width"}),h.jsx("input",{type:"text",value:n.width,onChange:s=>t(o=>o.style.width=s.target.value),placeholder:"100%",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Height"}),h.jsx("input",{type:"text",value:n.height,onChange:s=>t(o=>o.style.height=s.target.value),placeholder:"auto",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Object Fit"}),h.jsx(Mt,{options:[{value:"cover",label:"Cover"},{value:"contain",label:"Contain"},{value:"fill",label:"Fill"},{value:"none",label:"None"},{value:"scale-down",label:"Scale Down"}],value:n.objectFit,onChange:s=>t(o=>o.style.objectFit=s),placeholder:"Choose object fit"})]})]})}Ph.craft={...Q2,related:{settings:Xl}};const zh=({rows:t,columns:e,style:r,children:n,cellStyle:s,rowStyle:o,...i})=>{const{connectors:{connect:a,drag:l}}=Q.useNode(m=>({selected:m.events.selected})),c=()=>({...{borderCollapse:"collapse",border:"1px solid #9CA3AF"},...r}),d=()=>({...o}),f=Array.from({length:t},(m,g)=>Array.from({length:e},(y,v)=>g*e+v));return h.jsx("table",{ref:m=>{m&&a(l(m))},style:c(),...i,children:h.jsx("tbody",{children:f.map((m,g)=>h.jsx("tr",{style:g%2===0?d():{},children:m.map((y,v)=>h.jsx("td",{style:s,children:n?.props?.children?.[g*e+v]||y},v))},g))})})},Z2={displayName:"Table",isCanvas:!0,props:{rows:4,columns:4,style:{borderSpacing:"0px",borderWidth:"1px",borderStyle:"solid",borderColor:"#9CA3AF",width:"100%"},cellStyle:{borderWidth:"1px",borderStyle:"solid",borderColor:"#9CA3AF",padding:"0.5rem 0.75rem",textAlign:"center"},rowStyle:{}},custom:{displayName:"Table",settings:["table","border","layout","background"]}};function In(t,e=300){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}}function Ql(){const{actions:{setProp:t},rows:e,columns:r,rowStyle:n,cellStyle:s}=Q.useNode(i=>({rows:i.data.props.rows,columns:i.data.props.columns,rowStyle:i.data.props.rowStyle,cellStyle:i.data.props.cellStyle})),o=F.useMemo(()=>In((i,a,l)=>{t(c=>{c[a][l]=i})},300),[t]);return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{className:"flex flex-row space-x-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Rows"}),h.jsx("input",{type:"number",value:e,onChange:i=>t(a=>a.rows=parseInt(i.target.value)),className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Columns"}),h.jsx("input",{type:"number",value:r,onChange:i=>{t(a=>a.columns=parseInt(i.target.value))},className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Rows"}),h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Background Color (odd)"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"color",value:n.backgroundColor,onChange:i=>o(i.target.value,"rowStyle","backgroundColor"),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),h.jsx("input",{type:"text",value:n.backgroundColor,onChange:i=>t(a=>a.rowStyle.backgroundColor=i.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Cells"}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Width"}),h.jsx("div",{className:"mb-2 grid grid-cols-4 gap-1",children:[{value:"0px",label:"0"},{value:"1px",label:"1px"},{value:"2px",label:"2px"},{value:"4px",label:"4px"}].map(i=>h.jsx("button",{onClick:()=>t(a=>a.cellStyle.borderWidth=i.value),className:`border border-[#E8E7EE] px-2 py-2 text-xs transition-all ${s.borderWidth===i.value?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:i.label},i.value))})]}),h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Color"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"color",value:s.borderColor,onChange:i=>o(i.target.value,"cellStyle","borderColor"),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),h.jsx("input",{type:"text",value:s.borderColor,onChange:i=>t(a=>a.cellStyle.borderColor=i.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})]})]})}zh.craft={...Z2,related:{settings:Ql}};const e1=new Set(["Delete","Backspace","Escape","Enter","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function t1({tagName:t="div",html:e,innerRef:r,onChange:n,disabled:s=!1,editable:o=!0,onBlur:i,onKeyUp:a,onKeyDown:l,...c}){const d=F.useRef(null),f=F.useRef(e),m=F.useRef(!1),g=F.useRef(e),y=F.useCallback(()=>(r&&typeof r!="function"?r:d).current,[r]),v=F.useCallback((B,$)=>Object.assign({},B,{target:{value:$}}),[]),w=F.useCallback(B=>{const $=y();if(!$||!n)return;const O=$.innerHTML;O!==f.current&&(g.current=O,m.current=!0,f.current=O,n(v(B,O)))},[y,n,v]),D=F.useCallback((B,$)=>{if(document.activeElement!==B){$();return}const O=window.getSelection();if(!O||O.rangeCount===0){$();return}const I=O.getRangeAt(0).startOffset;$();try{const q=document.createRange(),J=B.firstChild||B,K=Math.min(I,J.textContent?.length||0);q.setStart(J,K),q.collapse(!0),O.removeAllRanges(),O.addRange(q)}catch{}},[]);F.useEffect(()=>{const B=y();B&&e!==f.current&&!m.current&&D(B,()=>{B.innerHTML=e,g.current=e,f.current=e})},[e,y,D]),F.useEffect(()=>{const B=y();B&&e!==B.innerHTML&&(B.innerHTML=e),g.current=e,f.current=e},[y,e]),F.useEffect(()=>{o||(m.current=!1)},[o]);const E=F.useCallback(B=>{o&&e1.has(B.key)&&B.stopPropagation(),l?.(B),o&&w(B)},[o,l,w]),N=F.useCallback(B=>{o&&B.stopPropagation(),a?.(B),o&&w(B)},[o,a,w]),A=F.useCallback(B=>{o&&(B.stopPropagation(),w(B))},[o,w]),T=F.useCallback(B=>{m.current=!1,i?.(B),o&&w(B)},[o,i,w]),j=F.useCallback(B=>{typeof r=="function"&&r(B),d.current=B},[r]);return Be.default.createElement(t,{...c,ref:typeof r=="function"?j:r||d,contentEditable:!s&&o,suppressContentEditableWarning:!0,onInput:A,onBlur:T,onKeyUp:N,onKeyDown:E,dangerouslySetInnerHTML:{__html:e}})}const $h=Be.default.memo(t1,(t,e)=>!(e.editable===!1||t.editable!==e.editable||t.disabled!==e.disabled||t.tagName!==e.tagName||JSON.stringify(t.style)!==JSON.stringify(e.style)));$h.displayName="ContentEditable";const r1=[{name:"userName",label:"User Name",value:"John Doe"},{name:"userEmail",label:"User Email",value:"john@example.com"},{name:"companyName",label:"Company Name",value:"Acme Corp"},{name:"currentDate",label:"Current Date",value:new Date().toLocaleDateString()},{name:"currentTime",label:"Current Time",value:new Date().toLocaleTimeString()}],n1=({ref:t,editableRef:e,position:r,onVariableInsert:n})=>{const{actions:s,style:o={}}=Q.useNode(w=>({style:w.data.props.style||{}})),[i,a]=F.useState(!1),[l,c]=F.useState(!1),d=w=>{s.setProp(D=>{D.style={...D.style,...w}})},f=()=>{const D=(o.fontWeight||"normal")==="bold"?"normal":"bold";d({fontWeight:D})},m=()=>{const D=(o.fontStyle||"normal")==="italic"?"normal":"italic";d({fontStyle:D})},g=()=>{const w=o.textDecoration||"none",D=String(w).includes("underline")?"none":"underline";d({textDecoration:D})},y=w=>{d({color:w})},v=w=>{if(e.current){e.current.focus();const D=window.getSelection();if(D&&D.rangeCount>0){const E=D.getRangeAt(0);E.deleteContents();const N=document.createElement("span");N.className="variable-tag",N.style.cssText="background: #e3f2fd; border: 1px solid #90caf9; border-radius: 4px; padding: 2px 6px; margin: 0 2px; color: #1976d2; font-size: 0.9em; cursor: pointer;",N.setAttribute("data-variable",w.name),N.textContent=`{{${w.label}}}`,E.insertNode(N),E.setStartAfter(N),E.collapse(!0),D.removeAllRanges(),D.addRange(E)}}a(!1),n(w.name)};return h.jsx("div",{ref:t,className:"flex flex-wrap gap-2 rounded-lg border border-[#E8E7EE] bg-white p-3 shadow-lg",onMouseDown:w=>w.stopPropagation(),style:{position:"absolute",left:"50%",transform:"translateX(-50%)",zIndex:9999,top:r==="top"?"-70px":void 0,bottom:r==="bottom"?"-70px":void 0},children:h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:`flex items-center justify-center border p-2 transition-all duration-200 ${o.fontWeight==="bold"?"border-[#00BAC7] bg-[#CCF1F4] text-[#170F4F]":"border-[#E8E7EE] bg-white text-[#170F4F] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,title:"Bold",onClick:w=>{w.preventDefault(),w.stopPropagation(),f()},children:h.jsx(_.FiBold,{size:14})}),h.jsx("button",{className:`flex items-center justify-center border p-2 transition-all duration-200 ${o.fontStyle==="italic"?"border-[#00BAC7] bg-[#CCF1F4] text-[#170F4F]":"border-[#E8E7EE] bg-white text-[#170F4F] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,title:"Italic",onMouseDown:w=>{w.preventDefault(),w.stopPropagation(),m()},children:h.jsx(_.FiItalic,{size:14})}),h.jsx("button",{className:`flex items-center justify-center border p-2 transition-all duration-200 ${String(o.textDecoration).includes("underline")?"border-[#00BAC7] bg-[#CCF1F4] text-[#170F4F]":"border-[#E8E7EE] bg-white text-[#170F4F] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,title:"Underline",onMouseDown:w=>{w.preventDefault(),w.stopPropagation(),g()},children:h.jsx(_.FiUnderline,{size:14})}),h.jsx("button",{className:"ml-2 flex items-center justify-center border border-[#E8E7EE] bg-white p-2 text-[#170F4F] transition-all duration-200 hover:border-[#00BAC7] hover:bg-[#CCF1F4]",title:"Text Color",onMouseDown:w=>{w.preventDefault(),w.stopPropagation(),c(!l)},children:h.jsx(_.FiEdit3,{size:14})}),l&&h.jsx("input",{type:"color",className:"h-8 w-8 cursor-pointer border border-[#E8E7EE] bg-white hover:border-[#00BAC7]",value:o.color?.toString()||"#000000",onChange:w=>{y(w.target.value),c(!1)}}),h.jsx("button",{className:"flex items-center justify-center border border-[#E8E7EE] bg-white p-2 text-[#170F4F] transition-all duration-200 hover:border-[#00BAC7] hover:bg-[#CCF1F4]",title:"Insert Variable",onMouseDown:w=>{w.preventDefault(),w.stopPropagation(),a(!i)},children:h.jsx(_.FiCode,{size:14})}),i&&h.jsx("div",{className:"absolute left-0 top-full z-10 mt-1 border border-[#E8E7EE] bg-white shadow-lg",children:r1.map(w=>h.jsx("button",{className:"block w-full border-none px-3 py-2 text-left text-[#170F4F] transition-colors hover:bg-[#CCF1F4]",onMouseDown:D=>{D.preventDefault(),D.stopPropagation(),v(w)},children:w.label},w.name))})]})})},s1=({isEditing:t=!1,children:e="Double-click to edit text...",style:r={}})=>{const{setProp:n}=Q.useNode(),[s,o]=F.useState("top"),i=F.useRef(null),a=F.useRef(null),l=F.useRef(null),c=F.useCallback(v=>{n(w=>{w.children=v})},[n]),d=F.useCallback(v=>{n(w=>(w.isEditing=v,w))},[n]),f=F.useCallback(v=>{v.preventDefault(),v.stopPropagation(),d(!0),a.current&&(a.current.getBoundingClientRect().top<window.innerHeight*.1?o("bottom"):o("top"))},[a]),m=F.useCallback(v=>{const w=v.target.value;w!==e&&c(w)},[e,c]),g=v=>{if(i.current){const w=window.getSelection();if(w&&w.rangeCount>0){const D=w.getRangeAt(0),E=document.createElement("span");E.setAttribute("data-variable",v),E.style.cssText="background: #e8f5e8; border: 1px solid #4caf50; border-radius: 4px; padding: 2px 6px; margin: 0 2px; color: #2e7d32; font-size: 0.9em;",E.textContent=`{{${v}}}`,D.deleteContents(),D.insertNode(E),D.setStartAfter(E),D.collapse(!0),w.removeAllRanges(),w.addRange(D);const N=i.current.innerHTML;c(N)}}};F.useEffect(()=>{const v=w=>{if(!t||!a.current)return;const D=w.target;a.current.contains(D)||l.current&&l.current.contains(D)||d(!1)};return t&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[t,d]);const y={cursor:t?"text":"pointer",userSelect:t?"text":"none",...r};return h.jsxs("div",{ref:a,onDoubleClick:f,style:{position:"relative",width:"100%",height:"100%"},children:[t&&h.jsx(n1,{ref:l,editableRef:i,position:s,onVariableInsert:g}),h.jsx($h,{innerRef:v=>{i.current=v},tagName:"p",html:e,editable:t,onChange:m,style:y})]})},Hh=Be.default.memo(s1,(t,e)=>!(t.isEditing!==e.isEditing||t.children!==e.children||JSON.stringify(t.style)!==JSON.stringify(e.style))),o1={displayName:"Text",custom:{resizable:!0,tagHtml:"p",settings:["text","typography","default"]},props:{children:"Double click to edit text 2",isEditing:!1,style:{width:300,height:200,fontSize:16,fontWeight:"normal",color:"#000000",textAlign:"left",minHeight:"50px",padding:"8px",border:"none",outline:"none",overflow:"auto",position:"relative",wordWrap:"break-word",whiteSpace:"normal"}}};Hh.craft={...o1};function Vh(){const{actions:{setProp:t},variableId:e,fallback:r}=Q.useNode(n=>({variableId:n.data.props.variableId,fallback:n.data.props.fallback}));return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Variable ID"}),h.jsx("input",{type:"text",value:e,onChange:n=>t(s=>s.variableId=n.target.value),placeholder:"ex: nome_usuario",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Default value"}),h.jsx("input",{type:"text",value:r,onChange:n=>t(s=>s.fallback=n.target.value),placeholder:"ex: Usuário",className:"focus:ring-primary-500 w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})]})}const i1=({data:t,onSelect:e,selectedPath:r})=>!t||typeof t!="object"?null:h.jsx("div",{className:"space-y-2",children:Object.entries(t).map(([n,s])=>h.jsxs("button",{onClick:()=>e(n,s),className:`block w-full rounded px-3 py-2 text-left transition-colors ${r===n?"bg-blue-100 text-blue-800":"bg-gray-50 text-gray-700 hover:bg-gray-100"}`,children:[h.jsxs("span",{className:"font-medium",children:[n,":"]})," ",h.jsx("span",{className:"text-sm",children:JSON.stringify(s)})]},n))}),a1=({isOpen:t,onClose:e,value:r,onSelect:n})=>{const[s,o]=F.useState(r||""),[i,a]=F.useState(null);return Be.default.useEffect(()=>{const l=localStorage.getItem("bolttech_datasource");if(l)try{const c=JSON.parse(l);c&&typeof c=="object"&&c.data&&a({root:c.data})}catch{}},[t]),t?h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-40",children:h.jsxs("div",{className:"flex w-full max-w-[40vw] flex-col rounded bg-white shadow-xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4",children:[h.jsx("h2",{className:"text-lg font-bold text-[#170f4f]",children:"Selecionar variável do DataSource"}),h.jsx("button",{onClick:e,className:"p-2 text-gray-400 hover:text-gray-600",children:h.jsx(_.FiX,{size:18})})]}),h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700",children:"Path da variável"}),h.jsx("input",{type:"text",value:s,onChange:l=>o(l.target.value),className:"focus:ring-primary-500 w-full rounded border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2",placeholder:"Ex: root.user.name"})]}),i&&h.jsx("div",{children:h.jsx(i1,{data:i,onSelect:l=>o(l),selectedPath:s})}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx("button",{onClick:e,className:"rounded bg-gray-100 px-4 py-2 text-gray-700 transition-colors duration-200 hover:bg-gray-200",children:"Cancelar"}),h.jsx("button",{onClick:()=>{n(s),e()},className:"rounded bg-[#170f4f] px-4 py-2 text-white transition-colors duration-200 hover:bg-[#30aab3]",children:"Salvar"})]})]})]})}):null},qh=({variableId:t="variable",fallback:e="Default value",...r})=>{const{connectors:{connect:n,drag:s},selected:o,actions:{setProp:i}}=Q.useNode(m=>({selected:m.events.selected})),[a,l]=F.useState(!1),c=`{{${t}}}`;let d;try{const m=localStorage.getItem("bolttech_datasource");if(m){const g=JSON.parse(m),y=g&&g.data;y&&t&&(d=t.split(".").reduce((w,D)=>w&&w[D]!==void 0?w[D]:void 0,{root:y}))}}catch{}const f={display:"inline-block",padding:"4px 8px",backgroundColor:"#fef3c7",border:"1px solid #f59e0b",borderRadius:"4px",color:"#92400e",fontFamily:"monospace",fontSize:"14px",cursor:o?"pointer":"default",transition:"all 0.2s"};return h.jsxs(h.Fragment,{children:[h.jsx("span",{ref:m=>{m&&n(s(m))},style:f,className:`${o?"ring-2 ring-yellow-400":"hover:ring-2 hover:ring-yellow-300 hover:ring-opacity-50"} transition-all duration-200`,title:`Variable: ${t}`,onClick:()=>l(!0),...r,children:d!=null?String(d):e||c}),h.jsx(a1,{isOpen:a,onClose:()=>l(!1),value:t,onSelect:m=>i(g=>g.variableId=m)})]})};qh.craft={props:{variableId:"variavel",fallback:"Valor padrão"},related:{settings:Vh}};const Rs=[{id:"box",label:"Box",icon:h.jsx(Rt.RiBox3Line,{size:16}),category:"layout",component:Oh,htmlTags:["div"],settings:Lh},{id:"text",label:"Text",icon:h.jsx(Rt.RiText,{size:16}),category:"content",component:Hh,htmlTags:["p","span","h1","h2","h3","h4","h5","h6"]},{id:"button",label:"Button",icon:h.jsx(Rt.RiSquareLine,{size:16}),category:"interactive",component:_h,settings:Kl,htmlTags:["button"]},{id:"a",label:"Anchor",icon:h.jsx(Rt.RiSquareLine,{size:16}),category:"interactive",component:jh,settings:Jl,htmlTags:["a"]},{id:"image",label:"Image",icon:h.jsx(Rt.RiImageLine,{size:16}),category:"media",component:Ph,settings:Xl,htmlTags:["img"]},{id:"divider",label:"Divider",icon:h.jsx(Rt.RiSeparator,{size:16}),category:"layout",component:Yl,settings:Gl,htmlTags:["hr"]},{id:"table",label:"Table",icon:h.jsx(Rt.RiTableFill,{size:16}),category:"layout",component:zh,settings:Ql,htmlTags:["table"]},{id:"variable",label:"Variable",icon:h.jsx(Rt.RiCodeSSlashLine,{size:16}),category:"dynamic",component:qh,settings:Vh,htmlTags:["span"]},{id:"conditional",label:"Conditional",icon:h.jsx(Rt.RiCodeSSlashLine,{size:16}),category:"dynamic",component:Ih,settings:Rh,htmlTags:["div"]}];function Wh(){const[t,e]=F.useState(!1),[r,n]=F.useState(!1),[s,o]=F.useState(!0);return{showPreview:t,togglePreview:()=>{e(v=>!v),n(!1)},openPreview:()=>{e(!0)},closePreview:()=>{e(!1)},showCodePanel:r,toggleCodePanel:()=>{n(v=>!v)},openCodePanel:()=>{n(!0)},closeCodePanel:()=>{n(!1)},showSidebar:s,toggleSidebar:()=>{o(v=>!v)},isEditorEnabled:!(t||r),setIsEditorEnabled:v=>{e(!v),n(!v)}}}const Uh={mobile:{width:375,height:667},tablet:{width:768,height:1024},desktop:{width:1200,height:800}};function Fi(){const{setIsEditorEnabled:t}=Wh(),{query:e,actions:r}=Q.useEditor(),{nodes:n}=Q.useEditor(c=>({nodes:c.nodes})),s=F.useMemo(()=>Object.keys(n).length>1,[n]),[o,i]=F.useState("desktop");return F.useEffect(()=>{const c=e.node("ROOT").get();c&&r.setProp(c.id,d=>{d.style={...d.style||{},maxWidth:Uh[o].width||"100%"}})},[o]),{device:o,isEmpty:s,setDevice:i,getState:()=>{t(!1);try{return e.serialize()}catch(c){return console.warn("Error serializing canvas:",c),""}finally{t(!0)}},loadState:c=>{try{if(!c.includes("ROOT")){const d=JSON.parse(c),f={type:"div",isCanvas:!0,props:{id:"canvas",className:"relative flex-1 border border-gray-300 shadow-lg",style:{zIndex:1,minHeight:"100%",overflow:"visible",position:"relative",maxWidth:1200,background:`repeating-linear-gradient(
|
|
2
|
+
to bottom,
|
|
3
|
+
white 0px,
|
|
4
|
+
white 1122px,
|
|
5
|
+
red 1122px,
|
|
6
|
+
red 1123px
|
|
7
|
+
)`}},displayName:"div",custom:{},hidden:!1,nodes:Object.keys(d),linkedNodes:{}};c=JSON.stringify(f)}return r.deserialize(c)}catch(d){console.error("Error loading snapshot into canvas:",d)}}}}const l1=new Set(["div","span","p","h1","h2","h3","h4","h5","h6","a","img","button","input","textarea","select","option","ul","ol","li","table","tr","td","th","thead","tbody","section","article","header","footer","nav","main","aside"]),u1=new Set(["img","input","br","hr","meta","link","area","base","col","embed","source","track","wbr"]),c1=new Set(["id","className","title","alt","src","href","target","rel"]),d1=new Set(["width","height","min-width","min-height","max-width","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border-width","border-top-width","border-right-width","border-bottom-width","border-left-width","top","right","bottom","left","font-size","line-height","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius","letter-spacing","word-spacing","text-indent","text-decoration-thickness"]);class p1{constructor(e={}){kt(this,"options");this.options={inlineStyles:!0,prettify:!1,includeComments:!1,customComponentMap:{},styleTransformers:[],...e}}convert(e){try{const r=e.ROOT;if(!r||!r.nodes)return"";const n=this.buildHTMLFromNodes(r.nodes,e);return this.options.prettify?this.prettifyHTML(n):n}catch(r){return console.error("craftJSToHTML - Error during conversion:",r),""}}buildHTMLFromNodes(e,r){return e.map(n=>this.buildHTMLFromNode(n,r)).filter(n=>n.trim()!=="").join("")}buildHTMLFromNode(e,r){const n=r[e];if(!n||n.hidden)return"";const{type:s,props:o={},nodes:i=[]}=n,a=typeof s=="object"&&s&&"resolvedName"in s?s.resolvedName:s,l=this.getTagName(a,n),c=this.buildAttributes(o);let d="";if(a==="conditional"){const g=i.map(y=>this.buildHTMLFromNodes([y],r));return this.generateConditionalHtml(n,g)}else if(l!=="table")d=this.buildHTMLFromNodes(i,r),o.children&&typeof o.children=="string"&&(d+=o.children),["button","a"].includes(l)&&o.text&&(d+=o.text);else{const g=i.map(y=>this.buildHTMLFromNodes([y],r));d+=this.generateTableHTML(n,g)}return this.isSelfClosingTag(l)?`<${l}${c} />`:`${this.options.includeComments?`<!-- ${a} -->`:""}<${l==="p"?"div":l}${c}>${d}</${l==="p"?"div":l}>`}getTagName(e,r){if(r.custom?.tagName&&typeof r.custom.tagName=="string")return r.custom.tagName.toLowerCase();if(r.custom?.tagHtml&&typeof r.custom.tagHtml=="string")return r.custom.tagHtml.toLowerCase();if(this.options.customComponentMap?.[e])return this.options.customComponentMap[e];const n={image:"img",button:"button",text:"p",divider:"hr",variable:"span",box:"div"};if(n[e])return n[e];const s=e.toLowerCase();return l1.has(s)?s:"div"}buildAttributes(e){const r=[];for(const n of c1)if(e[n]){const s=n==="className"?"class":n;r.push(`${s}="${this.escapeHTML(e[n])}"`)}if(e.style&&this.options.inlineStyles){const n=this.convertStyleObjectToCSS(e.style);n&&r.push(`style="${n}"`)}for(const[n,s]of Object.entries(e))n.startsWith("data-")&&typeof s=="string"&&r.push(`${n}="${this.escapeHTML(s)}"`);return r.length>0?` ${r.join(" ")}`:""}convertStyleObjectToCSS(e){if(!e||typeof e!="object")return"";const r=[];for(const[n,s]of Object.entries(e)){if(s==null)continue;const o=this.camelToKebabCase(n);let i=this.applStyleTransformers(n,s);i=this.addUnitIfNeeded(o,i),r.push(`${o}: ${i}`)}return r.join("; ")}camelToKebabCase(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}applStyleTransformers(e,r){const n=this.options.styleTransformers?.find(s=>s.property===e);return n?n.transform(r):String(r)}addUnitIfNeeded(e,r){const n=parseFloat(r);return!isNaN(n)&&d1.has(e)&&!r.includes("px")&&!r.includes("%")&&!r.includes("em")&&!r.includes("rem")&&!r.includes("vh")&&!r.includes("vw")?`${n}px`:r}isSelfClosingTag(e){return u1.has(e.toLowerCase())}escapeHTML(e){const r=document.createElement("div");return r.textContent=e,r.innerHTML}prettifyHTML(e){let r="",n=0;const s=" ";return e.split(/>\s*</).forEach((o,i)=>{i!==0&&(o=`<${o}`),i!==e.split(/>\s*</).length-1&&(o=`${o}>`),o.match(/^<\/\w/)&&n--,r+=`${s.repeat(Math.max(0,n))+o}
|
|
8
|
+
`,o.match(/^<\w[^>]*[^/]$/)&&n++}),r.trim()}generateTableHTML(e,r){let n="";for(let s=0;s<e.props?.rows;s++){n+=`<tr style="${s%2===0?this.convertStyleObjectToCSS(e.props?.rowStyle):""}">`;for(let o=0;o<e.props?.columns;o++)n+=`<td style="${this.convertStyleObjectToCSS(e.props?.cellStyle)}">${r[s*e.props?.columns+o]||""}</td>`;n+="</tr>"}return n}generateConditionalHtml(e,r){return h1(e.props?.conditions,r)}}function h1(t,e){const r={"===":"eq","!==":"ne",">":"gt","<":"lt",">=":"gte","<=":"lte"};let n="",s=!1;return t.forEach(o=>{if(o.isElse){n+=`{{else}}
|
|
9
|
+
${e[parseInt(o.option)-1]}
|
|
10
|
+
`;return}if(!o.variable||!o.operator||o.value===void 0)throw new Error(`Rule missing required fields: ${JSON.stringify(o)}`);const i=r[o.operator];if(!i)throw new Error(`Unsupported operator: ${o.operator}`);const a=`(${i} ${o.variable} "${o.value}")`;s?n+=`{{else if ${a}}}
|
|
11
|
+
${e[parseInt(o.option)-1]}
|
|
12
|
+
`:(n+=`{{#if ${a}}}
|
|
13
|
+
${e[parseInt(o.option)-1]}
|
|
14
|
+
`,s=!0)}),s&&(n+="{{/if}}"),n}function Nd(t,e){return new p1(e).convert(t)}const il={id:"canvas",className:"relative flex-1 border border-gray-300 shadow-lg",style:{zIndex:1,minHeight:"100%",overflow:"visible",position:"relative",maxWidth:1200,background:`repeating-linear-gradient(
|
|
15
|
+
to bottom,
|
|
16
|
+
white 0px,
|
|
17
|
+
white 1122px,
|
|
18
|
+
red 1122px,
|
|
19
|
+
red 1123px
|
|
20
|
+
)`}},Ca=new Set(["p","span","h1","h2","h3","h4","h5","h6","strong","em","small","mark","del","ins","sub","sup"]);class f1{constructor(e,r={}){kt(this,"options");kt(this,"tagLookupMap");kt(this,"idCounter");this.options={rootCanvasProps:il,...r},this.tagLookupMap=this.createTagLookupMap(e),this.idCounter=1}convert(e){if(!e?.trim())return this.createEmptyRoot();try{const r=P2.parseDocument(e),n={},s=r.children.filter(a=>a.type==="tag"||a.type==="text"),o="ROOT",i=[];for(const a of s){const l=this.traverseNode(a,o,n);l&&i.push(l)}return n[o]=this.createRootNode(i),this.convertToCraftJSFormat(n)}catch(r){return console.error("Error converting HTML to CraftJS:",r),this.createEmptyRoot()}}createTagLookupMap(e){const r=new Map;for(const n of e)for(const s of n.htmlTags)r.set(s.toLowerCase(),n);return r}getNextId(){return`node-${this.idCounter++}`}traverseNode(e,r,n){return e.type==="text"?this.processTextNode(e,r,n):e.type==="tag"?this.processTagNode(e,r,n):null}processTextNode(e,r,n){const s=e.data?.trim();if(!s)return null;if(r&&n[r]&&Ca.has(n[r].tagName?.toLowerCase()))return n[r].props.children=(n[r].props.children||"")+s,null;const o=Array.from(this.tagLookupMap.values()).find(a=>a.htmlTags.some(l=>Ca.has(l)));if(!o)return null;const i=this.getNextId();return n[i]={id:i,type:o.id,props:{children:s},parent:r,isCanvas:!1,displayName:o.id,custom:{},hidden:!1,nodes:[],linkedNodes:{},tagName:"text"},i}processTagNode(e,r,n){const s=e.name?.toLowerCase();if(!s)return null;const o=this.tagLookupMap.get(s)||null;if(!o)return null;const i=this.getNextId(),a=[];let l="";const c=Ca.has(s);e.children?.length>0&&(s==="table"?e.children.filter(m=>m.type==="tag").flatMap(m=>m.children.filter(g=>g.type==="tag")).flatMap(m=>m.children.filter(g=>g.type==="tag")).forEach(m=>{const g=this.traverseNode(m,i,n);g&&a.push(g)}):e.children.forEach((f,m)=>{if(f.type==="text"&&c||["button","a"].includes(s)){const g=f.data?.trim();g&&(l+=`${m!==0?" ":""}${g}`)}else if(c){const g=Jh(f);l+=`${m!==0?" ":""}${g}`}else{const g=this.traverseNode(f,i,n);g&&a.push(g)}}));const d=this.processAttributes(e.attribs||{});return c&&l&&(d.children=l),["button","a"].includes(s)&&l&&(d.text=l),s==="table"&&this.proccessHtmlTable(e,d),n[i]={id:i,type:o.id,props:d,nodes:a,parent:r,displayName:o.id,isCanvas:o.isCanvas!==!1,custom:{},hidden:!1,linkedNodes:{},tagName:s},i}processAttributes(e){const r={...e};if(r.style&&typeof r.style=="string"){const n=this.parseStyleString(r.style);r.style=n}return r}proccessHtmlTable(e,r){const n=e.children.filter(o=>o.type==="tag");r.rows=n.length;const s=n?.[0].children.filter(o=>o.type==="tag");r.columns=s.length,r.rowStyle=this.processAttributes(n[0].attribs).style,r.cellStyle=this.processAttributes(s[0].attribs).style}parseStyleString(e){const r={};return e.split(";").filter(Boolean).forEach(n=>{const[s,o]=n.split(":").map(a=>a?.trim());if(!s||!o)return;const i=s.replace(/-([a-z])/g,a=>a[1].toUpperCase());r[i]=o}),r}createEmptyRoot(){return{ROOT:{type:"div",isCanvas:!0,props:this.options.rootCanvasProps,displayName:"div",custom:{},hidden:!1,nodes:[],linkedNodes:{}}}}createRootNode(e){return{id:"ROOT",type:"div",props:this.options.rootCanvasProps,nodes:e,isCanvas:!0,displayName:"div",custom:{},hidden:!1,linkedNodes:{}}}convertToCraftJSFormat(e){const r={};return Object.entries(e).forEach(([n,s])=>{n==="ROOT"?r[n]={type:s.type,isCanvas:s.isCanvas,props:s.props||{},displayName:s.displayName||s.type,custom:s.custom||{},hidden:s.hidden||!1,nodes:s.nodes||[],linkedNodes:s.linkedNodes||{}}:r[n]={type:{resolvedName:s.type},isCanvas:s.isCanvas,props:s.props||{},displayName:s.displayName||s.type,custom:s.custom||{},hidden:s.hidden||!1,nodes:s.nodes||[],linkedNodes:s.linkedNodes||{},parent:s.parent||"ROOT"}}),r}}function m1(t,e,r){return new f1(e,r).convert(t)}function Jh(t){if(!t.type||t.type==="text")return t.data||"";const e=t.attribs&&Object.keys(t.attribs).length>0?` ${Object.entries(t.attribs).map(([n,s])=>`${n}="${s}"`).join(" ")}`:"",r=t.children?t.children.map(Jh).map(n=>n.trim()).join(""):"";return`<${t.name}${e}>${r}</${t.name}>`}function Zl(){const{query:t}=Q.useEditor();return{convertFromHtml:(n,s={})=>{const{replace:o=!0,...i}=s,a=m1(n,Rs,i);let l="";if(o)l=JSON.stringify(a);else{const c=t.serialize();if(typeof c=="string")return JSON.stringify(a);const d=c,f=d.ROOT;if(!f)return JSON.stringify(a);const{ROOT:m,...g}=a,y=Object.keys(g);Object.assign(d,g),f.nodes=[...f.nodes||[],...y],y.forEach(v=>{d[v]&&(d[v].parent="ROOT")}),l=JSON.stringify(d)}return l},convertToHtml:(n,s={})=>{if(typeof n=="string")try{const i=JSON.parse(n);return Nd(i,s)}catch(i){return console.error("Error parsing JSON:",i),""}return Nd(n,s)}}}function Kh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gh={exports:{}};(function(t,e){(function(r){function n(){var s=r();return s.default||s}t.exports=n()})(function(){var r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=u=>{throw TypeError(u)},a=(u,p,b)=>p in u?r(u,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):u[p]=b,l=(u,p)=>{for(var b in p)r(u,b,{get:p[b],enumerable:!0})},c=(u,p,b,x)=>{if(p&&typeof p=="object"||typeof p=="function")for(let C of s(p))!o.call(u,C)&&C!==b&&r(u,C,{get:()=>p[C],enumerable:!(x=n(p,C))||x.enumerable});return u},d=u=>c(r({},"__esModule",{value:!0}),u),f=(u,p,b)=>a(u,typeof p!="symbol"?p+"":p,b),m=(u,p,b)=>p.has(u)||i("Cannot "+b),g=(u,p,b)=>(m(u,p,"read from private field"),b?b.call(u):p.get(u)),y=(u,p,b)=>p.has(u)?i("Cannot add the same private member more than once"):p instanceof WeakSet?p.add(u):p.set(u,b),v=(u,p,b,x)=>(m(u,p,"write to private field"),p.set(u,b),b),w={};l(w,{languages:()=>Cx,options:()=>Ex,parsers:()=>Qc,printers:()=>O2});var D=(u,p,b,x)=>{if(!(u&&p==null))return p.replaceAll?p.replaceAll(b,x):b.global?p.replace(b,x):p.split(b).join(x)},E=D,N="string",A="array",T="cursor",j="indent",B="align",$="trim",O="group",z="fill",I="if-break",q="indent-if-break",J="line-suffix",K="line-suffix-boundary",ae="line",tt="label",ft="break-parent",oc=new Set([T,j,B,$,O,z,I,q,J,K,ae,tt,ft]),B0=(u,p,b)=>{if(!(u&&p==null))return Array.isArray(p)||typeof p=="string"?p[b<0?p.length+b:b]:p.at(b)},$n=B0;function j0(u){if(typeof u=="string")return N;if(Array.isArray(u))return A;if(!u)return;let{type:p}=u;if(oc.has(p))return p}var ic=j0,O0=u=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(u);function L0(u){let p=u===null?"null":typeof u;if(p!=="string"&&p!=="object")return`Unexpected doc '${p}',
|
|
21
|
+
Expected it to be 'string' or 'object'.`;if(ic(u))throw new Error("doc is valid.");let b=Object.prototype.toString.call(u);if(b!=="[object Object]")return`Unexpected doc '${b}'.`;let x=O0([...oc].map(C=>`'${C}'`));return`Unexpected doc.type '${u.type}'.
|
|
22
|
+
Expected it to be ${x}.`}var _0=class extends Error{constructor(p){super(L0(p));kt(this,"name","InvalidDocError");this.doc=p}},I0=_0;function ac(u,p){if(typeof u=="string")return p(u);let b=new Map;return x(u);function x(k){if(b.has(k))return b.get(k);let S=C(k);return b.set(k,S),S}function C(k){switch(ic(k)){case A:return p(k.map(x));case z:return p({...k,parts:k.parts.map(x)});case I:return p({...k,breakContents:x(k.breakContents),flatContents:x(k.flatContents)});case O:{let{expandedStates:S,contents:M}=k;return S?(S=S.map(x),M=S[0]):M=x(M),p({...k,contents:M,expandedStates:S})}case B:case j:case q:case tt:case J:return p({...k,contents:x(k.contents)});case N:case T:case $:case K:case ae:case ft:return p(k);default:throw new I0(k)}}}function mt(u,p=W0){return ac(u,b=>typeof b=="string"?an(p,b.split(`
|
|
23
|
+
`)):b)}var R0=()=>{},P0=R0;function Ct(u){return{type:j,contents:u}}function lc(u,p){return{type:B,contents:p,n:u}}function ke(u,p={}){return P0(p.expandedStates),{type:O,id:p.id,contents:u,break:!!p.shouldBreak,expandedStates:p.expandedStates}}function z0(u){return lc(Number.NEGATIVE_INFINITY,u)}function $0(u){return lc({type:"root"},u)}function uc(u){return{type:z,parts:u}}function Ws(u,p="",b={}){return{type:I,breakContents:u,flatContents:p,groupId:b.groupId}}function H0(u,p){return{type:q,contents:u,groupId:p.groupId,negate:p.negate}}var Hn={type:ft},V0={type:ae,hard:!0},q0={type:ae,hard:!0,literal:!0},xe={type:ae},ze={type:ae,soft:!0},he=[V0,Hn],W0=[q0,Hn];function an(u,p){let b=[];for(let x=0;x<p.length;x++)x!==0&&b.push(u),b.push(p[x]);return b}var Us="'",cc='"';function U0(u,p){let b=p===!0||p===Us?Us:cc,x=b===Us?cc:Us,C=0,k=0;for(let S of u)S===b?C++:S===x&&k++;return C>k?x:b}var J0=U0;function K0(u){if(typeof u!="string")throw new TypeError("Expected a string");return u.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var gt,G0=class{constructor(u){y(this,gt),v(this,gt,new Set(u))}getLeadingWhitespaceCount(u){let p=g(this,gt),b=0;for(let x=0;x<u.length&&p.has(u.charAt(x));x++)b++;return b}getTrailingWhitespaceCount(u){let p=g(this,gt),b=0;for(let x=u.length-1;x>=0&&p.has(u.charAt(x));x--)b++;return b}getLeadingWhitespace(u){let p=this.getLeadingWhitespaceCount(u);return u.slice(0,p)}getTrailingWhitespace(u){let p=this.getTrailingWhitespaceCount(u);return u.slice(u.length-p)}hasLeadingWhitespace(u){return g(this,gt).has(u.charAt(0))}hasTrailingWhitespace(u){return g(this,gt).has($n(!1,u,-1))}trimStart(u){let p=this.getLeadingWhitespaceCount(u);return u.slice(p)}trimEnd(u){let p=this.getTrailingWhitespaceCount(u);return u.slice(0,u.length-p)}trim(u){return this.trimEnd(this.trimStart(u))}split(u,p=!1){let b=`[${K0([...g(this,gt)].join(""))}]+`,x=new RegExp(p?`(${b})`:b,"u");return u.split(x)}hasWhitespaceCharacter(u){let p=g(this,gt);return Array.prototype.some.call(u,b=>p.has(b))}hasNonWhitespaceCharacter(u){let p=g(this,gt);return Array.prototype.some.call(u,b=>!p.has(b))}isWhitespaceOnly(u){let p=g(this,gt);return Array.prototype.every.call(u,b=>p.has(b))}};gt=new WeakMap;var Y0=G0,X0=[" ",`
|
|
24
|
+
`,"\f","\r"," "],Q0=new Y0(X0),_t=Q0,Z0=class extends Error{constructor(p,b,x="type"){super(`Unexpected ${b} node ${x}: ${JSON.stringify(p[x])}.`);kt(this,"name","UnexpectedNodeError");this.node=p}},eb=Z0;function tb(u){return u?.type==="front-matter"}var Js=tb,rb=new Set(["sourceSpan","startSourceSpan","endSourceSpan","nameSpan","valueSpan","keySpan","tagDefinition","tokens","valueTokens","switchValueSourceSpan","expSourceSpan","valueSourceSpan"]),nb=new Set(["if","else if","for","switch","case"]);function dc(u,p){var b;if(u.type==="text"||u.type==="comment"||Js(u)||u.type==="yaml"||u.type==="toml")return null;if(u.type==="attribute"&&delete p.value,u.type==="docType"&&delete p.value,u.type==="angularControlFlowBlock"&&(b=u.parameters)!=null&&b.children)for(let x of p.parameters.children)nb.has(u.name)?delete x.expression:x.expression=x.expression.trim();u.type==="angularIcuExpression"&&(p.switchValue=u.switchValue.trim()),u.type==="angularLetDeclarationInitializer"&&delete p.value}dc.ignoredProperties=rb;var sb=dc;async function ob(u,p){if(u.language==="yaml"){let b=u.value.trim(),x=b?await p(b,{parser:"yaml"}):"";return $0([u.startDelimiter,u.explicitLanguage,he,x,x?he:"",u.endDelimiter])}}var ib=ob;function Ks(u,p=!0){return[Ct([ze,u]),p?ze:""]}function ln(u,p){let b=u.type==="NGRoot"?u.node.type==="NGMicrosyntax"&&u.node.body.length===1&&u.node.body[0].type==="NGMicrosyntaxExpression"?u.node.body[0].expression:u.node:u.type==="JsExpressionRoot"?u.node:u;return b&&(b.type==="ObjectExpression"||b.type==="ArrayExpression"||(p.parser==="__vue_expression"||p.parser==="__vue_ts_expression")&&(b.type==="TemplateLiteral"||b.type==="StringLiteral"))}async function bt(u,p,b,x){b={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...b};let C=!0;x&&(b.__onHtmlBindingRoot=(S,M)=>{C=x(S,M)});let k=await p(u,b,p);return C?ke(k):Ks(k)}function ab(u,p,b,x){let{node:C}=b,k=x.originalText.slice(C.sourceSpan.start.offset,C.sourceSpan.end.offset);return/^\s*$/u.test(k)?"":bt(k,u,{parser:"__ng_directive",__isInHtmlAttribute:!1},ln)}var lb=ab,ub=(u,p)=>{if(!(u&&p==null))return p.toReversed||!Array.isArray(p)?p.toReversed():[...p].reverse()},cb=ub;function db(u){return Array.isArray(u)&&u.length>0}var Xi=db,pc,hc,fc,mc,gc,pb=((pc=globalThis.Deno)==null?void 0:pc.build.os)==="windows"||((fc=(hc=globalThis.navigator)==null?void 0:hc.platform)==null?void 0:fc.startsWith("Win"))||((gc=(mc=globalThis.process)==null?void 0:mc.platform)==null?void 0:gc.startsWith("win"))||!1;function bc(u){if(u=u instanceof URL?u:new URL(u),u.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${u.protocol}"`);return u}function hb(u){return u=bc(u),decodeURIComponent(u.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function fb(u){u=bc(u);let p=decodeURIComponent(u.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return u.hostname!==""&&(p=`\\\\${u.hostname}${p}`),p}function mb(u){return pb?fb(u):hb(u)}var gb=mb,bb=u=>String(u).split(/[/\\]/u).pop();function yc(u,p){if(!p)return;let b=bb(p).toLowerCase();return u.find(({filenames:x})=>x?.some(C=>C.toLowerCase()===b))??u.find(({extensions:x})=>x?.some(C=>b.endsWith(C)))}function yb(u,p){if(p)return u.find(({name:b})=>b.toLowerCase()===p)??u.find(({aliases:b})=>b?.includes(p))??u.find(({extensions:b})=>b?.includes(`.${p}`))}function xc(u,p){if(p){if(String(p).startsWith("file:"))try{p=gb(p)}catch{return}if(typeof p=="string")return u.find(({isSupported:b})=>b?.({filepath:p}))}}function xb(u,p){let b=cb(!1,u.plugins).flatMap(C=>C.languages??[]),x=yb(b,p.language)??yc(b,p.physicalFile)??yc(b,p.file)??xc(b,p.physicalFile)??xc(b,p.file)??(p.physicalFile,void 0);return x?.parsers[0]}var Gs=xb,vb="inline",vc={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block",select:"inline-block",option:"block",optgroup:"block"},wb="normal",wc={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function Db(u){return u.type==="element"&&!u.hasExplicitNamespace&&!["html","svg"].includes(u.namespace)}var Vn=Db,Cb=u=>E(!1,u,/^[\t\f\r ]*\n/gu,""),Dc=u=>Cb(_t.trimEnd(u)),kb=u=>{let p=u,b=_t.getLeadingWhitespace(p);b&&(p=p.slice(b.length));let x=_t.getTrailingWhitespace(p);return x&&(p=p.slice(0,-x.length)),{leadingWhitespace:b,trailingWhitespace:x,text:p}};function Cc(u,p){return!!(u.type==="ieConditionalComment"&&u.lastChild&&!u.lastChild.isSelfClosing&&!u.lastChild.endSourceSpan||u.type==="ieConditionalComment"&&!u.complete||un(u)&&u.children.some(b=>b.type!=="text"&&b.type!=="interpolation")||ea(u,p)&&!It(u,p)&&u.type!=="interpolation")}function Ys(u){return u.type==="attribute"||!u.parent||!u.prev?!1:Eb(u.prev)}function Eb(u){return u.type==="comment"&&u.value.trim()==="prettier-ignore"}function it(u){return u.type==="text"||u.type==="comment"}function It(u,p){return u.type==="element"&&(u.fullName==="script"||u.fullName==="style"||u.fullName==="svg:style"||u.fullName==="svg:script"||u.fullName==="mj-style"&&p.parser==="mjml"||Vn(u)&&(u.name==="script"||u.name==="style"))}function Sb(u,p){return u.children&&!It(u,p)}function Fb(u,p){return It(u,p)||u.type==="interpolation"||kc(u)}function kc(u){return Bc(u).startsWith("pre")}function Ab(u,p){var b,x;let C=k();if(C&&!u.prev&&(x=(b=u.parent)==null?void 0:b.tagDefinition)!=null&&x.ignoreFirstLf)return u.type==="interpolation";return C;function k(){return Js(u)||u.type==="angularControlFlowBlock"?!1:(u.type==="text"||u.type==="interpolation")&&u.prev&&(u.prev.type==="text"||u.prev.type==="interpolation")?!0:!u.parent||u.parent.cssDisplay==="none"?!1:un(u.parent)?!0:!(!u.prev&&(u.parent.type==="root"||un(u)&&u.parent||It(u.parent,p)||Qs(u.parent,p)||!Ib(u.parent.cssDisplay))||u.prev&&!zb(u.prev.cssDisplay))}}function Nb(u,p){return Js(u)||u.type==="angularControlFlowBlock"?!1:(u.type==="text"||u.type==="interpolation")&&u.next&&(u.next.type==="text"||u.next.type==="interpolation")?!0:!u.parent||u.parent.cssDisplay==="none"?!1:un(u.parent)?!0:!(!u.next&&(u.parent.type==="root"||un(u)&&u.parent||It(u.parent,p)||Qs(u.parent,p)||!Rb(u.parent.cssDisplay))||u.next&&!Pb(u.next.cssDisplay))}function Tb(u,p){return $b(u.cssDisplay)&&!It(u,p)}function Xs(u){return Js(u)||u.next&&u.sourceSpan.end&&u.sourceSpan.end.line+1<u.next.sourceSpan.start.line}function Mb(u){return Ec(u)||u.type==="element"&&u.children.length>0&&(["body","script","style"].includes(u.name)||u.children.some(p=>jb(p)))||u.firstChild&&u.firstChild===u.lastChild&&u.firstChild.type!=="text"&&Fc(u.firstChild)&&(!u.lastChild.isTrailingSpaceSensitive||Ac(u.lastChild))}function Ec(u){return u.type==="element"&&u.children.length>0&&(["html","head","ul","ol","select"].includes(u.name)||u.cssDisplay.startsWith("table")&&u.cssDisplay!=="table-cell")}function Qi(u){return Nc(u)||u.prev&&Bb(u.prev)||Sc(u)}function Bb(u){return Nc(u)||u.type==="element"&&u.fullName==="br"||Sc(u)}function Sc(u){return Fc(u)&&Ac(u)}function Fc(u){return u.hasLeadingSpaces&&(u.prev?u.prev.sourceSpan.end.line<u.sourceSpan.start.line:u.parent.type==="root"||u.parent.startSourceSpan.end.line<u.sourceSpan.start.line)}function Ac(u){return u.hasTrailingSpaces&&(u.next?u.next.sourceSpan.start.line>u.sourceSpan.end.line:u.parent.type==="root"||u.parent.endSourceSpan&&u.parent.endSourceSpan.start.line>u.sourceSpan.end.line)}function Nc(u){switch(u.type){case"ieConditionalComment":case"comment":case"directive":return!0;case"element":return["script","select"].includes(u.name)}return!1}function Zi(u){return u.lastChild?Zi(u.lastChild):u}function jb(u){var p;return(p=u.children)==null?void 0:p.some(b=>b.type!=="text")}function Tc(u){if(u)switch(u){case"module":case"text/javascript":case"text/babel":case"text/jsx":case"application/javascript":return"babel";case"application/x-typescript":return"typescript";case"text/markdown":return"markdown";case"text/html":return"html";case"text/x-handlebars-template":return"glimmer";default:if(u.endsWith("json")||u.endsWith("importmap")||u==="speculationrules")return"json"}}function Ob(u,p){let{name:b,attrMap:x}=u;if(b!=="script"||Object.prototype.hasOwnProperty.call(x,"src"))return;let{type:C,lang:k}=u.attrMap;return!k&&!C?"babel":Gs(p,{language:k})??Tc(C)}function Lb(u,p){if(!ea(u,p))return;let{attrMap:b}=u;if(Object.prototype.hasOwnProperty.call(b,"src"))return;let{type:x,lang:C}=b;return Gs(p,{language:C})??Tc(x)}function _b(u,p){if(u.name==="style"){let{lang:b}=u.attrMap;return b?Gs(p,{language:b}):"css"}if(u.name==="mj-style"&&p.parser==="mjml")return"css"}function Mc(u,p){return Ob(u,p)??_b(u,p)??Lb(u,p)}function qn(u){return u==="block"||u==="list-item"||u.startsWith("table")}function Ib(u){return!qn(u)&&u!=="inline-block"}function Rb(u){return!qn(u)&&u!=="inline-block"}function Pb(u){return!qn(u)}function zb(u){return!qn(u)}function $b(u){return!qn(u)&&u!=="inline-block"}function un(u){return Bc(u).startsWith("pre")}function Hb(u,p){let b=u;for(;b;){if(p(b))return!0;b=b.parent}return!1}function Vb(u,p){var b;if(cn(u,p))return"block";if(((b=u.prev)==null?void 0:b.type)==="comment"){let C=u.prev.value.match(/^\s*display:\s*([a-z]+)\s*$/u);if(C)return C[1]}let x=!1;if(u.type==="element"&&u.namespace==="svg")if(Hb(u,C=>C.fullName==="svg:foreignObject"))x=!0;else return u.name==="svg"?"inline-block":"block";switch(p.htmlWhitespaceSensitivity){case"strict":return"inline";case"ignore":return"block";default:if(u.type==="element"&&(!u.namespace||x||Vn(u))&&Object.prototype.hasOwnProperty.call(vc,u.name))return vc[u.name]}return vb}function Bc(u){return u.type==="element"&&(!u.namespace||Vn(u))&&Object.prototype.hasOwnProperty.call(wc,u.name)?wc[u.name]:wb}function qb(u){let p=Number.POSITIVE_INFINITY;for(let b of u.split(`
|
|
25
|
+
`)){if(b.length===0)continue;let x=_t.getLeadingWhitespaceCount(b);if(x===0)return 0;b.length!==x&&x<p&&(p=x)}return p===Number.POSITIVE_INFINITY?0:p}function jc(u,p=qb(u)){return p===0?u:u.split(`
|
|
26
|
+
`).map(b=>b.slice(p)).join(`
|
|
27
|
+
`)}function Oc(u){return E(!1,E(!1,u,"'","'"),""",'"')}function rr(u){return Oc(u.value)}var Wb=new Set(["template","style","script"]);function Qs(u,p){return cn(u,p)&&!Wb.has(u.fullName)}function cn(u,p){return p.parser==="vue"&&u.type==="element"&&u.parent.type==="root"&&u.fullName.toLowerCase()!=="html"}function ea(u,p){return cn(u,p)&&(Qs(u,p)||u.attrMap.lang&&u.attrMap.lang!=="html")}function Ub(u){let p=u.fullName;return p.charAt(0)==="#"||p==="slot-scope"||p==="v-slot"||p.startsWith("v-slot:")}function Jb(u,p){let b=u.parent;if(!cn(b,p))return!1;let x=b.fullName,C=u.fullName;return x==="script"&&C==="setup"||x==="style"&&C==="vars"}function Lc(u,p=u.value){return u.parent.isWhitespaceSensitive?u.parent.isIndentationSensitive?mt(p):mt(jc(Dc(p)),he):an(xe,_t.split(p))}function _c(u,p){return cn(u,p)&&u.name==="script"}var Ic=/\{\{(.+?)\}\}/su;async function Kb(u,p){let b=[];for(let[x,C]of u.split(Ic).entries())if(x%2===0)b.push(mt(C));else try{b.push(ke(["{{",Ct([xe,await bt(C,p,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),xe,"}}"]))}catch{b.push("{{",mt(C),"}}")}return b}function ta({parser:u}){return(p,b,x)=>bt(rr(x.node),p,{parser:u},ln)}var Gb=ta({parser:"__ng_action"}),Yb=ta({parser:"__ng_binding"}),Xb=ta({parser:"__ng_directive"});function Qb(u,p){if(p.parser!=="angular")return;let{node:b}=u,x=b.fullName;if(x.startsWith("(")&&x.endsWith(")")||x.startsWith("on-"))return Gb;if(x.startsWith("[")&&x.endsWith("]")||/^bind(?:on)?-/u.test(x)||/^ng-(?:if|show|hide|class|style)$/u.test(x))return Yb;if(x.startsWith("*"))return Xb;let C=rr(b);if(/^i18n(?:-.+)?$/u.test(x))return()=>Ks(uc(Lc(b,C.trim())),!C.includes("@@"));if(Ic.test(C))return k=>Kb(C,k)}var Zb=Qb;function ey(u,p){let{node:b}=u,x=rr(b);if(b.fullName==="class"&&!p.parentParser&&!x.includes("{{"))return()=>x.trim().split(/\s+/u).join(" ")}var ty=ey;function Rc(u){return u===" "||u===`
|
|
28
|
+
`||u==="\f"||u==="\r"||u===" "}var ry=/^[ \t\n\r\u000c]+/,ny=/^[, \t\n\r\u000c]+/,sy=/^[^ \t\n\r\u000c]+/,oy=/[,]+$/,Pc=/^\d+$/,iy=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ay(u){let p=u.length,b,x,C,k,S,M=0,P;function U(se){let ce,Ee=se.exec(u.substring(M));if(Ee)return[ce]=Ee,M+=ce.length,ce}let V=[];for(;;){if(U(ny),M>=p){if(V.length===0)throw new Error("Must contain one or more image candidate strings.");return V}P=M,b=U(sy),x=[],b.slice(-1)===","?(b=b.replace(oy,""),ee()):ie()}function ie(){for(U(ry),C="",k="in descriptor";;){if(S=u.charAt(M),k==="in descriptor")if(Rc(S))C&&(x.push(C),C="",k="after descriptor");else if(S===","){M+=1,C&&x.push(C),ee();return}else if(S==="(")C+=S,k="in parens";else if(S===""){C&&x.push(C),ee();return}else C+=S;else if(k==="in parens")if(S===")")C+=S,k="in descriptor";else if(S===""){x.push(C),ee();return}else C+=S;else if(k==="after descriptor"&&!Rc(S))if(S===""){ee();return}else k="in descriptor",M-=1;M+=1}}function ee(){let se=!1,ce,Ee,Oe,$e,W={},oe,Se,we,Ue,mn;for($e=0;$e<x.length;$e++)oe=x[$e],Se=oe[oe.length-1],we=oe.substring(0,oe.length-1),Ue=parseInt(we,10),mn=parseFloat(we),Pc.test(we)&&Se==="w"?((ce||Ee)&&(se=!0),Ue===0?se=!0:ce=Ue):iy.test(we)&&Se==="x"?((ce||Ee||Oe)&&(se=!0),mn<0?se=!0:Ee=mn):Pc.test(we)&&Se==="h"?((Oe||Ee)&&(se=!0),Ue===0?se=!0:Oe=Ue):se=!0;if(!se)W.source={value:b,startOffset:P},ce&&(W.width={value:ce}),Ee&&(W.density={value:Ee}),Oe&&(W.height={value:Oe}),V.push(W);else throw new Error(`Invalid srcset descriptor found in "${u}" at "${oe}".`)}}var ly=ay;function uy(u){if(u.node.fullName==="srcset"&&(u.parent.fullName==="img"||u.parent.fullName==="source"))return()=>dy(rr(u.node))}var zc={width:"w",height:"h",density:"x"},cy=Object.keys(zc);function dy(u){let p=ly(u),b=cy.filter(V=>p.some(ie=>Object.prototype.hasOwnProperty.call(ie,V)));if(b.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[x]=b,C=zc[x],k=p.map(V=>V.source.value),S=Math.max(...k.map(V=>V.length)),M=p.map(V=>V[x]?String(V[x].value):""),P=M.map(V=>{let ie=V.indexOf(".");return ie===-1?V.length:ie}),U=Math.max(...P);return Ks(an([",",xe],k.map((V,ie)=>{let ee=[V],se=M[ie];if(se){let ce=S-V.length+1,Ee=U-P[ie],Oe=" ".repeat(ce+Ee);ee.push(Ws(Oe," "),se+C)}return ee})))}var py=uy;function hy(u,p){let{node:b}=u,x=rr(u.node).trim();if(b.fullName==="style"&&!p.parentParser&&!x.includes("{{"))return async C=>Ks(await C(x,{parser:"css",__isHTMLStyleAttribute:!0}))}var ra=new WeakMap;function fy(u,p){let{root:b}=u;return ra.has(b)||ra.set(b,b.children.some(x=>_c(x,p)&&["ts","typescript"].includes(x.attrMap.lang))),ra.get(b)}var na=fy;function my(u,p,b){let{node:x}=b,C=rr(x);return bt(`type T<${C}> = any`,u,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},ln)}function gy(u,p,{parseWithTs:b}){return bt(`function _(${u}) {}`,p,{parser:b?"babel-ts":"babel",__isVueBindings:!0})}async function by(u,p,b,x){let C=rr(b.node),{left:k,operator:S,right:M}=yy(C),P=na(b,x);return[ke(await bt(`function _(${k}) {}`,u,{parser:P?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",S," ",await bt(M,u,{parser:P?"__ts_expression":"__js_expression"})]}function yy(u){let p=/(.*?)\s+(in|of)\s+(.*)/su,b=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,x=/^\(|\)$/gu,C=u.match(p);if(!C)return;let k={};if(k.for=C[3].trim(),!k.for)return;let S=E(!1,C[1].trim(),x,""),M=S.match(b);M?(k.alias=S.replace(b,""),k.iterator1=M[1].trim(),M[2]&&(k.iterator2=M[2].trim())):k.alias=S;let P=[k.alias,k.iterator1,k.iterator2];if(!P.some((U,V)=>!U&&(V===0||P.slice(V+1).some(Boolean))))return{left:P.filter(Boolean).join(","),operator:C[2],right:k.for}}function xy(u,p){if(p.parser!=="vue")return;let{node:b}=u,x=b.fullName;if(x==="v-for")return by;if(x==="generic"&&_c(b.parent,p))return my;let C=rr(b),k=na(u,p);if(Ub(b)||Jb(b,p))return S=>gy(C,S,{parseWithTs:k});if(x.startsWith("@")||x.startsWith("v-on:"))return S=>vy(C,S,{parseWithTs:k});if(x.startsWith(":")||x.startsWith(".")||x.startsWith("v-bind:"))return S=>wy(C,S,{parseWithTs:k});if(x.startsWith("v-"))return S=>$c(C,S,{parseWithTs:k})}async function vy(u,p,{parseWithTs:b}){var x;try{return await $c(u,p,{parseWithTs:b})}catch(C){if(((x=C.cause)==null?void 0:x.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw C}return bt(u,p,{parser:b?"__vue_ts_event_binding":"__vue_event_binding"},ln)}function wy(u,p,{parseWithTs:b}){return bt(u,p,{parser:b?"__vue_ts_expression":"__vue_expression"},ln)}function $c(u,p,{parseWithTs:b}){return bt(u,p,{parser:b?"__ts_expression":"__js_expression"},ln)}var Dy=xy;function Cy(u,p){let{node:b}=u;if(b.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(p.originalText.slice(b.valueSpan.start.offset,b.valueSpan.end.offset))||p.parser==="lwc"&&b.value.startsWith("{")&&b.value.endsWith("}"))return[b.rawName,"=",b.value];for(let x of[py,hy,ty,Dy,Zb]){let C=x(u,p);if(C)return ky(C)}}}function ky(u){return async(p,b,x,C)=>{let k=await u(p,b,x,C);if(k)return k=ac(k,S=>typeof S=="string"?E(!1,S,'"',"""):S),[x.node.rawName,'="',ke(k),'"']}}var Ey=Cy,Sy=new Proxy(()=>{},{get:()=>Sy});function Wn(u){return u.sourceSpan.start.offset}function Zs(u){return u.sourceSpan.end.offset}function sa(u,p){return[u.isSelfClosing?"":Fy(u,p),Un(u,p)]}function Fy(u,p){return u.lastChild&&Gn(u.lastChild)?"":[Ay(u,p),oa(u,p)]}function Un(u,p){return(u.next?Tr(u.next):Kn(u.parent))?"":[Jn(u,p),Nr(u,p)]}function Ay(u,p){return Kn(u)?Jn(u.lastChild,p):""}function Nr(u,p){return Gn(u)?oa(u.parent,p):eo(u)?aa(u.next,p):""}function oa(u,p){if(Hc(u,p))return"";switch(u.type){case"ieConditionalComment":return"<!";case"element":if(u.hasHtmComponentClosingTag)return"<//";default:return`</${u.rawName}`}}function Jn(u,p){if(Hc(u,p))return"";switch(u.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(u.isSelfClosing)return"/>";default:return">"}}function Hc(u,p){return!u.isSelfClosing&&!u.endSourceSpan&&(Ys(u)||Cc(u.parent,p))}function Tr(u){return u.prev&&u.prev.type!=="docType"&&u.type!=="angularControlFlowBlock"&&!it(u.prev)&&u.isLeadingSpaceSensitive&&!u.hasLeadingSpaces}function Kn(u){var p;return((p=u.lastChild)==null?void 0:p.isTrailingSpaceSensitive)&&!u.lastChild.hasTrailingSpaces&&!it(Zi(u.lastChild))&&!un(u)}function Gn(u){return!u.next&&!u.hasTrailingSpaces&&u.isTrailingSpaceSensitive&&it(Zi(u))}function eo(u){return u.next&&!it(u.next)&&it(u)&&u.isTrailingSpaceSensitive&&!u.hasTrailingSpaces}function Ny(u){let p=u.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return p?p[1]?p[1].split(/\s+/u):!0:!1}function to(u){return!u.prev&&u.isLeadingSpaceSensitive&&!u.hasLeadingSpaces}function Ty(u,p,b){var x;let{node:C}=u;if(!Xi(C.attrs))return C.isSelfClosing?" ":"";let k=((x=C.prev)==null?void 0:x.type)==="comment"&&Ny(C.prev.value),S=typeof k=="boolean"?()=>k:Array.isArray(k)?ie=>k.includes(ie.rawName):()=>!1,M=u.map(({node:ie})=>S(ie)?mt(p.originalText.slice(Wn(ie),Zs(ie))):b(),"attrs"),P=C.type==="element"&&C.fullName==="script"&&C.attrs.length===1&&C.attrs[0].fullName==="src"&&C.children.length===0,U=p.singleAttributePerLine&&C.attrs.length>1&&!cn(C,p)?he:xe,V=[Ct([P?" ":xe,an(U,M)])];return C.firstChild&&to(C.firstChild)||C.isSelfClosing&&Kn(C.parent)||P?V.push(C.isSelfClosing?" ":""):V.push(p.bracketSameLine?C.isSelfClosing?" ":"":C.isSelfClosing?xe:ze),V}function My(u){return u.firstChild&&to(u.firstChild)?"":la(u)}function ia(u,p,b){let{node:x}=u;return[Yn(x,p),Ty(u,p,b),x.isSelfClosing?"":My(x)]}function Yn(u,p){return u.prev&&eo(u.prev)?"":[Mr(u,p),aa(u,p)]}function Mr(u,p){return to(u)?la(u.parent):Tr(u)?Jn(u.prev,p):""}var Vc="<!doctype";function aa(u,p){switch(u.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${u.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":{if(u.value==="html"){let{filepath:x}=p;if(x&&/\.html?$/u.test(x))return Vc}let b=Wn(u);return p.originalText.slice(b,b+Vc.length)}case"angularIcuExpression":return"{";case"element":if(u.condition)return`<!--[if ${u.condition}]><!--><${u.rawName}`;default:return`<${u.rawName}`}}function la(u){switch(u.type){case"ieConditionalComment":return"]>";case"element":if(u.condition)return"><!--<![endif]-->";default:return">"}}function By(u,p){if(!u.endSourceSpan)return"";let b=u.startSourceSpan.end.offset;u.firstChild&&to(u.firstChild)&&(b-=la(u).length);let x=u.endSourceSpan.start.offset;return u.lastChild&&Gn(u.lastChild)?x+=oa(u,p).length:Kn(u)&&(x-=Jn(u.lastChild,p).length),p.originalText.slice(b,x)}var qc=By,jy=new Set(["if","else if","for","switch","case"]);function Oy(u,p){let{node:b}=u;switch(b.type){case"element":if(It(b,p)||b.type==="interpolation")return;if(!b.isSelfClosing&&ea(b,p)){let x=Mc(b,p);return x?async(C,k)=>{let S=qc(b,p),M=/^\s*$/u.test(S),P="";return M||(P=await C(Dc(S),{parser:x,__embeddedInHtml:!0}),M=P===""),[Mr(b,p),ke(ia(u,p,k)),M?"":he,P,M?"":he,sa(b,p),Nr(b,p)]}:void 0}break;case"text":if(It(b.parent,p)){let x=Mc(b.parent,p);if(x)return async C=>{let k=x==="markdown"?jc(b.value.replace(/^[^\S\n]*\n/u,"")):b.value,S={parser:x,__embeddedInHtml:!0};if(p.parser==="html"&&x==="babel"){let M="script",{attrMap:P}=b.parent;P&&(P.type==="module"||(P.type==="text/babel"||P.type==="text/jsx")&&P["data-type"]==="module")&&(M="module"),S.__babelSourceType=M}return[Hn,Mr(b,p),await C(k,S),Nr(b,p)]}}else if(b.parent.type==="interpolation")return async x=>{let C={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return p.parser==="angular"?C.parser="__ng_interpolation":p.parser==="vue"?C.parser=na(u,p)?"__vue_ts_expression":"__vue_expression":C.parser="__js_expression",[Ct([xe,await x(b.value,C)]),b.parent.next&&Tr(b.parent.next)?" ":xe]};break;case"attribute":return Ey(u,p);case"front-matter":return x=>ib(b,x);case"angularControlFlowBlockParameters":return jy.has(u.parent.name)?lb:void 0;case"angularLetDeclarationInitializer":return x=>bt(b.value,x,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var Ly=Oy,Xn=null;function Qn(u){if(Xn!==null&&typeof Xn.property){let p=Xn;return Xn=Qn.prototype=null,p}return Xn=Qn.prototype=u??Object.create(null),new Qn}var _y=10;for(let u=0;u<=_y;u++)Qn();function Iy(u){return Qn(u)}function Ry(u,p="type"){Iy(u);function b(x){let C=x[p],k=u[C];if(!Array.isArray(k))throw Object.assign(new Error(`Missing visitor keys for '${C}'.`),{node:x});return k}return b}var Py=Ry,zy={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},$y=zy,Hy=Py($y),Vy=Hy,qy="format",Wy=/^\s*<!--\s*@(?:noformat|noprettier)\s*-->/u,Uy=/^\s*<!--\s*@(?:format|prettier)\s*-->/u;function Jy(u){return Uy.test(u)}function Ky(u){return Wy.test(u)}function Gy(u){return`<!-- @${qy} -->
|
|
29
|
+
|
|
30
|
+
${u}`}var Yy=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function Wc(u){let p=Zs(u);return u.type==="element"&&!u.endSourceSpan&&Xi(u.children)?Math.max(p,Wc($n(!1,u.children,-1))):p}function Zn(u,p,b){let x=u.node;if(Ys(x)){let C=Wc(x);return[Mr(x,p),mt(_t.trimEnd(p.originalText.slice(Wn(x)+(x.prev&&eo(x.prev)?aa(x).length:0),C-(x.next&&Tr(x.next)?Jn(x,p).length:0)))),Nr(x,p)]}return b()}function ro(u,p){return it(u)&&it(p)?u.isTrailingSpaceSensitive?u.hasTrailingSpaces?Qi(p)?he:xe:"":Qi(p)?he:ze:eo(u)&&(Ys(p)||p.firstChild||p.isSelfClosing||p.type==="element"&&p.attrs.length>0)||u.type==="element"&&u.isSelfClosing&&Tr(p)?"":!p.isLeadingSpaceSensitive||Qi(p)||Tr(p)&&u.lastChild&&Gn(u.lastChild)&&u.lastChild.lastChild&&Gn(u.lastChild.lastChild)?he:p.hasLeadingSpaces?xe:ze}function ua(u,p,b){let{node:x}=u;if(Ec(x))return[Hn,...u.map(k=>{let S=k.node,M=S.prev?ro(S.prev,S):"";return[M?[M,Xs(S.prev)?he:""]:"",Zn(k,p,b)]},"children")];let C=x.children.map(()=>Symbol(""));return u.map((k,S)=>{let M=k.node;if(it(M)){if(M.prev&&it(M.prev)){let ce=ro(M.prev,M);if(ce)return Xs(M.prev)?[he,he,Zn(k,p,b)]:[ce,Zn(k,p,b)]}return Zn(k,p,b)}let P=[],U=[],V=[],ie=[],ee=M.prev?ro(M.prev,M):"",se=M.next?ro(M,M.next):"";return ee&&(Xs(M.prev)?P.push(he,he):ee===he?P.push(he):it(M.prev)?U.push(ee):U.push(Ws("",ze,{groupId:C[S-1]}))),se&&(Xs(M)?it(M.next)&&ie.push(he,he):se===he?it(M.next)&&ie.push(he):V.push(se)),[...P,ke([...U,ke([Zn(k,p,b),...V],{id:C[S]})]),...ie]},"children")}function Xy(u,p,b){let{node:x}=u,C=[];Qy(u)&&C.push("} "),C.push("@",x.name),x.parameters&&C.push(" (",ke(b("parameters")),")"),C.push(" {");let k=Uc(x);return x.children.length>0?(x.firstChild.hasLeadingSpaces=!0,x.lastChild.hasTrailingSpaces=!0,C.push(Ct([he,ua(u,p,b)])),k&&C.push(he,"}")):k&&C.push("}"),ke(C,{shouldBreak:!0})}function Uc(u){var p,b;return!(((p=u.next)==null?void 0:p.type)==="angularControlFlowBlock"&&(b=Yy.get(u.name))!=null&&b.has(u.next.name))}function Qy(u){let{previous:p}=u;return p?.type==="angularControlFlowBlock"&&!Ys(p)&&!Uc(p)}function Zy(u,p,b){return[Ct([ze,an([";",xe],u.map(b,"children"))]),ze]}function ex(u,p,b){let{node:x}=u;return[Yn(x,p),ke([x.switchValue.trim(),", ",x.clause,x.cases.length>0?[",",Ct([xe,an(xe,u.map(b,"cases"))])]:"",ze]),Un(x,p)]}function tx(u,p,b){let{node:x}=u;return[x.value," {",ke([Ct([ze,u.map(({node:C,isLast:k})=>{let S=[b()];return C.type==="text"&&(C.hasLeadingSpaces&&S.unshift(xe),C.hasTrailingSpaces&&!k&&S.push(xe)),S},"expression")]),ze]),"}"]}function rx(u,p,b){let{node:x}=u;if(Cc(x,p))return[Mr(x,p),ke(ia(u,p,b)),mt(qc(x,p)),...sa(x,p),Nr(x,p)];let C=x.children.length===1&&(x.firstChild.type==="interpolation"||x.firstChild.type==="angularIcuExpression")&&x.firstChild.isLeadingSpaceSensitive&&!x.firstChild.hasLeadingSpaces&&x.lastChild.isTrailingSpaceSensitive&&!x.lastChild.hasTrailingSpaces,k=Symbol("element-attr-group-id"),S=V=>ke([ke(ia(u,p,b),{id:k}),V,sa(x,p)]),M=V=>C?H0(V,{groupId:k}):(It(x,p)||Qs(x,p))&&x.parent.type==="root"&&p.parser==="vue"&&!p.vueIndentScriptAndStyle?V:Ct(V),P=()=>C?Ws(ze,"",{groupId:k}):x.firstChild.hasLeadingSpaces&&x.firstChild.isLeadingSpaceSensitive?xe:x.firstChild.type==="text"&&x.isWhitespaceSensitive&&x.isIndentationSensitive?z0(ze):ze,U=()=>(x.next?Tr(x.next):Kn(x.parent))?x.lastChild.hasTrailingSpaces&&x.lastChild.isTrailingSpaceSensitive?" ":"":C?Ws(ze,"",{groupId:k}):x.lastChild.hasTrailingSpaces&&x.lastChild.isTrailingSpaceSensitive?xe:(x.lastChild.type==="comment"||x.lastChild.type==="text"&&x.isWhitespaceSensitive&&x.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${p.tabWidth*(u.ancestors.length-1)}}$`,"u").test(x.lastChild.value)?"":ze;return x.children.length===0?S(x.hasDanglingSpaces&&x.isDanglingSpaceSensitive?xe:""):S([Mb(x)?Hn:"",M([P(),ua(u,p,b)]),U()])}function no(u){return u>=9&&u<=32||u==160}function ca(u){return 48<=u&&u<=57}function so(u){return u>=97&&u<=122||u>=65&&u<=90}function nx(u){return u>=97&&u<=102||u>=65&&u<=70||ca(u)}function da(u){return u===10||u===13}function Jc(u){return 48<=u&&u<=55}function pa(u){return u===39||u===34||u===96}var sx=/-+([a-z0-9])/g;function ox(u){return u.replace(sx,(...p)=>p[1].toUpperCase())}var ha=class Yh{constructor(p,b,x,C){this.file=p,this.offset=b,this.line=x,this.col=C}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(p){let b=this.file.content,x=b.length,C=this.offset,k=this.line,S=this.col;for(;C>0&&p<0;)if(C--,p++,b.charCodeAt(C)==10){k--;let M=b.substring(0,C-1).lastIndexOf(`
|
|
31
|
+
`);S=M>0?C-M:C}else S--;for(;C<x&&p>0;){let M=b.charCodeAt(C);C++,p--,M==10?(k++,S=0):S++}return new Yh(this.file,C,k,S)}getContext(p,b){let x=this.file.content,C=this.offset;if(C!=null){C>x.length-1&&(C=x.length-1);let k=C,S=0,M=0;for(;S<p&&C>0&&(C--,S++,!(x[C]==`
|
|
32
|
+
`&&++M==b)););for(S=0,M=0;S<p&&k<x.length-1&&(k++,S++,!(x[k]==`
|
|
33
|
+
`&&++M==b)););return{before:x.substring(C,this.offset),after:x.substring(this.offset,k+1)}}return null}},Kc=class{constructor(u,p){this.content=u,this.url=p}},ne=class{constructor(u,p,b=u,x=null){this.start=u,this.end=p,this.fullStart=b,this.details=x}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},oo;(function(u){u[u.WARNING=0]="WARNING",u[u.ERROR=1]="ERROR"})(oo||(oo={}));var Gc=class{constructor(u,p,b=oo.ERROR,x){this.span=u,this.msg=p,this.level=b,this.relatedError=x}contextualMessage(){let u=this.span.start.getContext(100,3);return u?`${this.msg} ("${u.before}[${oo[this.level]} ->]${u.after}")`:this.msg}toString(){let u=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${u}`}},ix=[lx,ux,dx,hx,fx,bx,mx,gx,yx,px];function ax(u,p){for(let b of ix)b(u,p);return u}function lx(u){u.walk(p=>{if(p.type==="element"&&p.tagDefinition.ignoreFirstLf&&p.children.length>0&&p.children[0].type==="text"&&p.children[0].value[0]===`
|
|
34
|
+
`){let b=p.children[0];b.value.length===1?p.removeChild(b):b.value=b.value.slice(1)}})}function ux(u){let p=b=>{var x,C;return b.type==="element"&&((x=b.prev)==null?void 0:x.type)==="ieConditionalStartComment"&&b.prev.sourceSpan.end.offset===b.startSourceSpan.start.offset&&((C=b.firstChild)==null?void 0:C.type)==="ieConditionalEndComment"&&b.firstChild.sourceSpan.start.offset===b.startSourceSpan.end.offset};u.walk(b=>{if(b.children)for(let x=0;x<b.children.length;x++){let C=b.children[x];if(!p(C))continue;let k=C.prev,S=C.firstChild;b.removeChild(k),x--;let M=new ne(k.sourceSpan.start,S.sourceSpan.end),P=new ne(M.start,C.sourceSpan.end);C.condition=k.condition,C.sourceSpan=P,C.startSourceSpan=M,C.removeChild(S)}})}function cx(u,p,b){u.walk(x=>{if(x.children)for(let C=0;C<x.children.length;C++){let k=x.children[C];if(k.type!=="text"&&!p(k))continue;k.type!=="text"&&(k.type="text",k.value=b(k));let S=k.prev;!S||S.type!=="text"||(S.value+=k.value,S.sourceSpan=new ne(S.sourceSpan.start,k.sourceSpan.end),x.removeChild(k),C--)}})}function dx(u){return cx(u,p=>p.type==="cdata",p=>`<![CDATA[${p.value}]]>`)}function px(u){let p=b=>{var x,C;return b.type==="element"&&b.attrs.length===0&&b.children.length===1&&b.firstChild.type==="text"&&!_t.hasWhitespaceCharacter(b.children[0].value)&&!b.firstChild.hasLeadingSpaces&&!b.firstChild.hasTrailingSpaces&&b.isLeadingSpaceSensitive&&!b.hasLeadingSpaces&&b.isTrailingSpaceSensitive&&!b.hasTrailingSpaces&&((x=b.prev)==null?void 0:x.type)==="text"&&((C=b.next)==null?void 0:C.type)==="text"};u.walk(b=>{if(b.children)for(let x=0;x<b.children.length;x++){let C=b.children[x];if(!p(C))continue;let k=C.prev,S=C.next;k.value+=`<${C.rawName}>`+C.firstChild.value+`</${C.rawName}>`+S.value,k.sourceSpan=new ne(k.sourceSpan.start,S.sourceSpan.end),k.isTrailingSpaceSensitive=S.isTrailingSpaceSensitive,k.hasTrailingSpaces=S.hasTrailingSpaces,b.removeChild(C),x--,b.removeChild(S)}})}function hx(u,p){if(p.parser==="html")return;let b=/\{\{(.+?)\}\}/su;u.walk(x=>{if(Sb(x,p))for(let C of x.children){if(C.type!=="text")continue;let k=C.sourceSpan.start,S=null,M=C.value.split(b);for(let P=0;P<M.length;P++,k=S){let U=M[P];if(P%2===0){S=k.moveBy(U.length),U.length>0&&x.insertChildBefore(C,{type:"text",value:U,sourceSpan:new ne(k,S)});continue}S=k.moveBy(U.length+4),x.insertChildBefore(C,{type:"interpolation",sourceSpan:new ne(k,S),children:U.length===0?[]:[{type:"text",value:U,sourceSpan:new ne(k.moveBy(2),S.moveBy(-2))}]})}x.removeChild(C)}})}function fx(u,p){u.walk(b=>{let x=b.$children;if(!x)return;if(x.length===0||x.length===1&&x[0].type==="text"&&_t.trim(x[0].value).length===0){b.hasDanglingSpaces=x.length>0,b.$children=[];return}let C=Fb(b,p),k=kc(b);if(!C)for(let S=0;S<x.length;S++){let M=x[S];if(M.type!=="text")continue;let{leadingWhitespace:P,text:U,trailingWhitespace:V}=kb(M.value),ie=M.prev,ee=M.next;U?(M.value=U,M.sourceSpan=new ne(M.sourceSpan.start.moveBy(P.length),M.sourceSpan.end.moveBy(-V.length)),P&&(ie&&(ie.hasTrailingSpaces=!0),M.hasLeadingSpaces=!0),V&&(M.hasTrailingSpaces=!0,ee&&(ee.hasLeadingSpaces=!0))):(b.removeChild(M),S--,(P||V)&&(ie&&(ie.hasTrailingSpaces=!0),ee&&(ee.hasLeadingSpaces=!0)))}b.isWhitespaceSensitive=C,b.isIndentationSensitive=k})}function mx(u){u.walk(p=>{p.isSelfClosing=!p.children||p.type==="element"&&(p.tagDefinition.isVoid||p.endSourceSpan&&p.startSourceSpan.start===p.endSourceSpan.start&&p.startSourceSpan.end===p.endSourceSpan.end)})}function gx(u,p){u.walk(b=>{b.type==="element"&&(b.hasHtmComponentClosingTag=b.endSourceSpan&&/^<\s*\/\s*\/\s*>$/u.test(p.originalText.slice(b.endSourceSpan.start.offset,b.endSourceSpan.end.offset)))})}function bx(u,p){u.walk(b=>{b.cssDisplay=Vb(b,p)})}function yx(u,p){u.walk(b=>{let{children:x}=b;if(x){if(x.length===0){b.isDanglingSpaceSensitive=Tb(b,p);return}for(let C of x)C.isLeadingSpaceSensitive=Ab(C,p),C.isTrailingSpaceSensitive=Nb(C,p);for(let C=0;C<x.length;C++){let k=x[C];k.isLeadingSpaceSensitive=(C===0||k.prev.isTrailingSpaceSensitive)&&k.isLeadingSpaceSensitive,k.isTrailingSpaceSensitive=(C===x.length-1||k.next.isLeadingSpaceSensitive)&&k.isTrailingSpaceSensitive}}})}var xx=ax;function vx(u,p,b){let{node:x}=u;switch(x.type){case"front-matter":return mt(x.raw);case"root":return p.__onHtmlRoot&&p.__onHtmlRoot(x),[ke(ua(u,p,b)),he];case"element":case"ieConditionalComment":return rx(u,p,b);case"angularControlFlowBlock":return Xy(u,p,b);case"angularControlFlowBlockParameters":return Zy(u,p,b);case"angularControlFlowBlockParameter":return _t.trim(x.expression);case"angularLetDeclaration":return ke(["@let ",ke([x.id," =",ke(Ct([xe,b("init")]))]),";"]);case"angularLetDeclarationInitializer":return x.value;case"angularIcuExpression":return ex(u,p,b);case"angularIcuCase":return tx(u,p,b);case"ieConditionalStartComment":case"ieConditionalEndComment":return[Yn(x),Un(x)];case"interpolation":return[Yn(x,p),...u.map(b,"children"),Un(x,p)];case"text":{if(x.parent.type==="interpolation"){let M=/\n[^\S\n]*$/u,P=M.test(x.value),U=P?x.value.replace(M,""):x.value;return[mt(U),P?he:""]}let C=Mr(x,p),k=Lc(x),S=Nr(x,p);return k[0]=[C,k[0]],k.push([k.pop(),S]),uc(k)}case"docType":return[ke([Yn(x,p)," ",E(!1,x.value.replace(/^html\b/iu,"html"),/\s+/gu," ")]),Un(x,p)];case"comment":return[Mr(x,p),mt(p.originalText.slice(Wn(x),Zs(x))),Nr(x,p)];case"attribute":{if(x.value===null)return x.rawName;let C=Oc(x.value),k=J0(C,'"');return[x.rawName,"=",k,mt(k==='"'?E(!1,C,'"',"""):E(!1,C,"'","'")),k]}case"cdata":default:throw new eb(x,"HTML")}}var wx={preprocess:xx,print:vx,insertPragma:Gy,massageAstNode:sb,embed:Ly,getVisitorKeys:Vy},Dx=wx,Cx=[{name:"Angular",type:"markup",extensions:[".component.html"],tmScope:"text.html.basic",aceMode:"html",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["angular"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"HTML",type:"markup",extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml"],tmScope:"text.html.basic",aceMode:"html",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["html"],vscodeLanguageIds:["html"],linguistLanguageId:146},{name:"Lightning Web Components",type:"markup",extensions:[],tmScope:"text.html.basic",aceMode:"html",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"MJML",type:"markup",extensions:[".mjml"],tmScope:"text.mjml.basic",aceMode:"html",aliases:["MJML","mjml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["mjml"],filenames:[],vscodeLanguageIds:["mjml"],linguistLanguageId:146},{name:"Vue",type:"markup",extensions:[".vue"],tmScope:"source.vue",aceMode:"html",parsers:["vue"],vscodeLanguageIds:["vue"],linguistLanguageId:391}],Yc={bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},Xc="HTML",kx={bracketSameLine:Yc.bracketSameLine,htmlWhitespaceSensitivity:{category:Xc,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Yc.singleAttributePerLine,vueIndentScriptAndStyle:{category:Xc,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},Ex=kx,Qc={};l(Qc,{angular:()=>M2,html:()=>A2,lwc:()=>j2,mjml:()=>T2,vue:()=>B2});var Zc;(function(u){u[u.Emulated=0]="Emulated",u[u.None=2]="None",u[u.ShadowDom=3]="ShadowDom"})(Zc||(Zc={}));var ed;(function(u){u[u.OnPush=0]="OnPush",u[u.Default=1]="Default"})(ed||(ed={}));var td;(function(u){u[u.None=0]="None",u[u.SignalBased=1]="SignalBased",u[u.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(td||(td={}));var rd={name:"custom-elements"},nd={name:"no-errors-schema"},Br;(function(u){u[u.NONE=0]="NONE",u[u.HTML=1]="HTML",u[u.STYLE=2]="STYLE",u[u.SCRIPT=3]="SCRIPT",u[u.URL=4]="URL",u[u.RESOURCE_URL=5]="RESOURCE_URL"})(Br||(Br={}));var sd;(function(u){u[u.Error=0]="Error",u[u.Warning=1]="Warning",u[u.Ignore=2]="Ignore"})(sd||(sd={}));var yt;(function(u){u[u.RAW_TEXT=0]="RAW_TEXT",u[u.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",u[u.PARSABLE_DATA=2]="PARSABLE_DATA"})(yt||(yt={}));function io(u,p=!0){if(u[0]!=":")return[null,u];let b=u.indexOf(":",1);if(b===-1){if(p)throw new Error(`Unsupported format "${u}" expecting ":namespace:name"`);return[null,u]}return[u.slice(1,b),u.slice(b+1)]}function od(u){return io(u)[1]==="ng-container"}function id(u){return io(u)[1]==="ng-content"}function ao(u){return u===null?null:io(u)[0]}function lo(u,p){return u?`:${u}:${p}`:p}var uo;function ad(){return uo||(uo={},co(Br.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]),co(Br.STYLE,["*|style"]),co(Br.URL,["*|formAction","area|href","area|ping","audio|src","a|href","a|ping","blockquote|cite","body|background","del|cite","form|action","img|src","input|src","ins|cite","q|cite","source|src","track|src","video|poster","video|src"]),co(Br.RESOURCE_URL,["applet|code","applet|codebase","base|href","embed|src","frame|src","head|profile","html|manifest","iframe|src","link|href","media|src","object|codebase","object|data","script|src"])),uo}function co(u,p){for(let b of p)uo[b.toLowerCase()]=u}var Sx=class{},Fx="boolean",Ax="number",Nx="string",Tx="object",Mx=["[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot,*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored","[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy","media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume",":svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":svg:graphics^:svg:|",":svg:animation^:svg:|*begin,*end,*repeat",":svg:geometry^:svg:|",":svg:componentTransferFunction^:svg:|",":svg:gradient^:svg:|",":svg:textContent^:svg:graphics|",":svg:textPositioning^:svg:textContent|","a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username","area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username","audio^media|","br^[HTMLElement]|clear","base^[HTMLElement]|href,target","body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink","button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value","canvas^[HTMLElement]|#height,#width","content^[HTMLElement]|select","dl^[HTMLElement]|!compact","data^[HTMLElement]|value","datalist^[HTMLElement]|","details^[HTMLElement]|!open","dialog^[HTMLElement]|!open,returnValue","dir^[HTMLElement]|!compact","div^[HTMLElement]|align","embed^[HTMLElement]|align,height,name,src,type,width","fieldset^[HTMLElement]|!disabled,name","font^[HTMLElement]|color,face,size","form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target","frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src","frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows","hr^[HTMLElement]|align,color,!noShade,size,width","head^[HTMLElement]|","h1,h2,h3,h4,h5,h6^[HTMLElement]|align","html^[HTMLElement]|version","iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width","img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width","input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width","li^[HTMLElement]|type,#value","label^[HTMLElement]|htmlFor","legend^[HTMLElement]|align","link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type","map^[HTMLElement]|name","marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width","menu^[HTMLElement]|!compact","meta^[HTMLElement]|content,httpEquiv,media,name,scheme","meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value","ins,del^[HTMLElement]|cite,dateTime","ol^[HTMLElement]|!compact,!reversed,#start,type","object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width","optgroup^[HTMLElement]|!disabled,label","option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value","output^[HTMLElement]|defaultValue,%htmlFor,name,value","p^[HTMLElement]|align","param^[HTMLElement]|name,type,value,valueType","picture^[HTMLElement]|","pre^[HTMLElement]|#width","progress^[HTMLElement]|#max,#value","q,blockquote,cite^[HTMLElement]|","script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type","select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value","slot^[HTMLElement]|name","source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width","span^[HTMLElement]|","style^[HTMLElement]|!disabled,media,type","caption^[HTMLElement]|align","th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width","col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width","table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width","tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign","tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign","template^[HTMLElement]|","textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap","time^[HTMLElement]|dateTime","title^[HTMLElement]|text","track^[HTMLElement]|!default,kind,label,src,srclang","ul^[HTMLElement]|!compact,type","unknown^[HTMLElement]|","video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width",":svg:a^:svg:graphics|",":svg:animate^:svg:animation|",":svg:animateMotion^:svg:animation|",":svg:animateTransform^:svg:animation|",":svg:circle^:svg:geometry|",":svg:clipPath^:svg:graphics|",":svg:defs^:svg:graphics|",":svg:desc^:svg:|",":svg:discard^:svg:|",":svg:ellipse^:svg:geometry|",":svg:feBlend^:svg:|",":svg:feColorMatrix^:svg:|",":svg:feComponentTransfer^:svg:|",":svg:feComposite^:svg:|",":svg:feConvolveMatrix^:svg:|",":svg:feDiffuseLighting^:svg:|",":svg:feDisplacementMap^:svg:|",":svg:feDistantLight^:svg:|",":svg:feDropShadow^:svg:|",":svg:feFlood^:svg:|",":svg:feFuncA^:svg:componentTransferFunction|",":svg:feFuncB^:svg:componentTransferFunction|",":svg:feFuncG^:svg:componentTransferFunction|",":svg:feFuncR^:svg:componentTransferFunction|",":svg:feGaussianBlur^:svg:|",":svg:feImage^:svg:|",":svg:feMerge^:svg:|",":svg:feMergeNode^:svg:|",":svg:feMorphology^:svg:|",":svg:feOffset^:svg:|",":svg:fePointLight^:svg:|",":svg:feSpecularLighting^:svg:|",":svg:feSpotLight^:svg:|",":svg:feTile^:svg:|",":svg:feTurbulence^:svg:|",":svg:filter^:svg:|",":svg:foreignObject^:svg:graphics|",":svg:g^:svg:graphics|",":svg:image^:svg:graphics|decoding",":svg:line^:svg:geometry|",":svg:linearGradient^:svg:gradient|",":svg:mpath^:svg:|",":svg:marker^:svg:|",":svg:mask^:svg:|",":svg:metadata^:svg:|",":svg:path^:svg:geometry|",":svg:pattern^:svg:|",":svg:polygon^:svg:geometry|",":svg:polyline^:svg:geometry|",":svg:radialGradient^:svg:gradient|",":svg:rect^:svg:geometry|",":svg:svg^:svg:graphics|#currentScale,#zoomAndPan",":svg:script^:svg:|type",":svg:set^:svg:animation|",":svg:stop^:svg:|",":svg:style^:svg:|!disabled,media,title,type",":svg:switch^:svg:graphics|",":svg:symbol^:svg:|",":svg:tspan^:svg:textPositioning|",":svg:text^:svg:textPositioning|",":svg:textPath^:svg:textContent|",":svg:title^:svg:|",":svg:use^:svg:graphics|",":svg:view^:svg:|#zoomAndPan","data^[HTMLElement]|value","keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name","menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default","summary^[HTMLElement]|","time^[HTMLElement]|dateTime",":svg:cursor^:svg:|",":math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex",":math:math^:math:|",":math:maction^:math:|",":math:menclose^:math:|",":math:merror^:math:|",":math:mfenced^:math:|",":math:mfrac^:math:|",":math:mi^:math:|",":math:mmultiscripts^:math:|",":math:mn^:math:|",":math:mo^:math:|",":math:mover^:math:|",":math:mpadded^:math:|",":math:mphantom^:math:|",":math:mroot^:math:|",":math:mrow^:math:|",":math:ms^:math:|",":math:mspace^:math:|",":math:msqrt^:math:|",":math:mstyle^:math:|",":math:msub^:math:|",":math:msubsup^:math:|",":math:msup^:math:|",":math:mtable^:math:|",":math:mtd^:math:|",":math:mtext^:math:|",":math:mtr^:math:|",":math:munder^:math:|",":math:munderover^:math:|",":math:semantics^:math:|"],ld=new Map(Object.entries({class:"className",for:"htmlFor",formaction:"formAction",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"})),Bx=Array.from(ld).reduce((u,[p,b])=>(u.set(p,b),u),new Map),jx=class extends Sx{constructor(){super(),this._schema=new Map,this._eventSchema=new Map,Mx.forEach(u=>{let p=new Map,b=new Set,[x,C]=u.split("|"),k=C.split(","),[S,M]=x.split("^");S.split(",").forEach(U=>{this._schema.set(U.toLowerCase(),p),this._eventSchema.set(U.toLowerCase(),b)});let P=M&&this._schema.get(M.toLowerCase());if(P){for(let[U,V]of P)p.set(U,V);for(let U of this._eventSchema.get(M.toLowerCase()))b.add(U)}k.forEach(U=>{if(U.length>0)switch(U[0]){case"*":b.add(U.substring(1));break;case"!":p.set(U.substring(1),Fx);break;case"#":p.set(U.substring(1),Ax);break;case"%":p.set(U.substring(1),Tx);break;default:p.set(U,Nx)}})})}hasProperty(u,p,b){if(b.some(x=>x.name===nd.name))return!0;if(u.indexOf("-")>-1){if(od(u)||id(u))return!1;if(b.some(x=>x.name===rd.name))return!0}return(this._schema.get(u.toLowerCase())||this._schema.get("unknown")).has(p)}hasElement(u,p){return p.some(b=>b.name===nd.name)||u.indexOf("-")>-1&&(od(u)||id(u)||p.some(b=>b.name===rd.name))?!0:this._schema.has(u.toLowerCase())}securityContext(u,p,b){b&&(p=this.getMappedPropName(p)),u=u.toLowerCase(),p=p.toLowerCase();let x=ad()[u+"|"+p];return x||(x=ad()["*|"+p],x||Br.NONE)}getMappedPropName(u){return ld.get(u)??u}getDefaultComponentElementName(){return"ng-component"}validateProperty(u){return u.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${u}' is disallowed for security reasons, please use (${u.slice(2)})=...
|
|
35
|
+
If '${u}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(u){return u.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${u}' is disallowed for security reasons, please use (${u.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(u){let p=this._schema.get(u.toLowerCase())||this._schema.get("unknown");return Array.from(p.keys()).map(b=>Bx.get(b)??b)}allKnownEventsOfElement(u){return Array.from(this._eventSchema.get(u.toLowerCase())??[])}normalizeAnimationStyleProperty(u){return ox(u)}normalizeAnimationStyleValue(u,p,b){let x="",C=b.toString().trim(),k=null;if(Ox(u)&&b!==0&&b!=="0")if(typeof b=="number")x="px";else{let S=b.match(/^[+-]?[\d\.]+([a-z]*)$/);S&&S[1].length==0&&(k=`Please provide a CSS unit value for ${p}:${b}`)}return{error:k,value:C+x}}};function Ox(u){switch(u){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var Z=class{constructor({closedByChildren:u,implicitNamespacePrefix:p,contentType:b=yt.PARSABLE_DATA,closedByParent:x=!1,isVoid:C=!1,ignoreFirstLf:k=!1,preventNamespaceInheritance:S=!1,canSelfClose:M=!1}={}){this.closedByChildren={},this.closedByParent=!1,u&&u.length>0&&u.forEach(P=>this.closedByChildren[P]=!0),this.isVoid=C,this.closedByParent=x||C,this.implicitNamespacePrefix=p||null,this.contentType=b,this.ignoreFirstLf=k,this.preventNamespaceInheritance=S,this.canSelfClose=M??C}isClosedByChild(u){return this.isVoid||u.toLowerCase()in this.closedByChildren}getContentType(u){return typeof this.contentType=="object"?(u===void 0?void 0:this.contentType[u])??this.contentType.default:this.contentType}},ud,es;function fa(u){return es||(ud=new Z({canSelfClose:!0}),es=Object.assign(Object.create(null),{base:new Z({isVoid:!0}),meta:new Z({isVoid:!0}),area:new Z({isVoid:!0}),embed:new Z({isVoid:!0}),link:new Z({isVoid:!0}),img:new Z({isVoid:!0}),input:new Z({isVoid:!0}),param:new Z({isVoid:!0}),hr:new Z({isVoid:!0}),br:new Z({isVoid:!0}),source:new Z({isVoid:!0}),track:new Z({isVoid:!0}),wbr:new Z({isVoid:!0}),p:new Z({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new Z({closedByChildren:["tbody","tfoot"]}),tbody:new Z({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new Z({closedByChildren:["tbody"],closedByParent:!0}),tr:new Z({closedByChildren:["tr"],closedByParent:!0}),td:new Z({closedByChildren:["td","th"],closedByParent:!0}),th:new Z({closedByChildren:["td","th"],closedByParent:!0}),col:new Z({isVoid:!0}),svg:new Z({implicitNamespacePrefix:"svg"}),foreignObject:new Z({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new Z({implicitNamespacePrefix:"math"}),li:new Z({closedByChildren:["li"],closedByParent:!0}),dt:new Z({closedByChildren:["dt","dd"]}),dd:new Z({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new Z({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new Z({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new Z({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new Z({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new Z({closedByChildren:["optgroup"],closedByParent:!0}),option:new Z({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new Z({ignoreFirstLf:!0}),listing:new Z({ignoreFirstLf:!0}),style:new Z({contentType:yt.RAW_TEXT}),script:new Z({contentType:yt.RAW_TEXT}),title:new Z({contentType:{default:yt.ESCAPABLE_RAW_TEXT,svg:yt.PARSABLE_DATA}}),textarea:new Z({contentType:yt.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new jx().allKnownElementNames().forEach(p=>{!es[p]&&ao(p)===null&&(es[p]=new Z({canSelfClose:!1}))})),es[u]??ud}var dn=class{constructor(u,p){this.sourceSpan=u,this.i18n=p}},Lx=class extends dn{constructor(u,p,b,x){super(p,x),this.value=u,this.tokens=b,this.type="text"}visit(u,p){return u.visitText(this,p)}},_x=class extends dn{constructor(u,p,b,x){super(p,x),this.value=u,this.tokens=b,this.type="cdata"}visit(u,p){return u.visitCdata(this,p)}},Ix=class extends dn{constructor(u,p,b,x,C,k){super(x,k),this.switchValue=u,this.type=p,this.cases=b,this.switchValueSourceSpan=C}visit(u,p){return u.visitExpansion(this,p)}},Rx=class{constructor(u,p,b,x,C){this.value=u,this.expression=p,this.sourceSpan=b,this.valueSourceSpan=x,this.expSourceSpan=C,this.type="expansionCase"}visit(u,p){return u.visitExpansionCase(this,p)}},Px=class extends dn{constructor(u,p,b,x,C,k,S){super(b,S),this.name=u,this.value=p,this.keySpan=x,this.valueSpan=C,this.valueTokens=k,this.type="attribute"}visit(u,p){return u.visitAttribute(this,p)}get nameSpan(){return this.keySpan}},nr=class extends dn{constructor(u,p,b,x,C,k=null,S=null,M){super(x,M),this.name=u,this.attrs=p,this.children=b,this.startSourceSpan=C,this.endSourceSpan=k,this.nameSpan=S,this.type="element"}visit(u,p){return u.visitElement(this,p)}},zx=class{constructor(u,p){this.value=u,this.sourceSpan=p,this.type="comment"}visit(u,p){return u.visitComment(this,p)}},$x=class{constructor(u,p){this.value=u,this.sourceSpan=p,this.type="docType"}visit(u,p){return u.visitDocType(this,p)}},pn=class extends dn{constructor(u,p,b,x,C,k,S=null,M){super(x,M),this.name=u,this.parameters=p,this.children=b,this.nameSpan=C,this.startSourceSpan=k,this.endSourceSpan=S,this.type="block"}visit(u,p){return u.visitBlock(this,p)}},cd=class{constructor(u,p){this.expression=u,this.sourceSpan=p,this.type="blockParameter",this.startSourceSpan=null,this.endSourceSpan=null}visit(u,p){return u.visitBlockParameter(this,p)}},dd=class{constructor(u,p,b,x,C){this.name=u,this.value=p,this.sourceSpan=b,this.nameSpan=x,this.valueSpan=C,this.type="letDeclaration",this.startSourceSpan=null,this.endSourceSpan=null}visit(u,p){return u.visitLetDeclaration(this,p)}};function pd(u,p,b=null){let x=[],C=u.visit?k=>u.visit(k,b)||k.visit(u,b):k=>k.visit(u,b);return p.forEach(k=>{let S=C(k);S&&x.push(S)}),x}var Hx=class{constructor(){}visitElement(u,p){this.visitChildren(p,b=>{b(u.attrs),b(u.children)})}visitAttribute(u,p){}visitText(u,p){}visitCdata(u,p){}visitComment(u,p){}visitDocType(u,p){}visitExpansion(u,p){return this.visitChildren(p,b=>{b(u.cases)})}visitExpansionCase(u,p){}visitBlock(u,p){this.visitChildren(p,b=>{b(u.parameters),b(u.children)})}visitBlockParameter(u,p){}visitLetDeclaration(u,p){}visitChildren(u,p){let b=[],x=this;function C(k){k&&b.push(pd(x,k,u))}return p(C),Array.prototype.concat.apply([],b)}},po={AElig:"Æ",AMP:"&",amp:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"",af:"",Aring:"Å",angst:"Å",Ascr:"𝒜",Assign:"≔",colone:"≔",coloneq:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",setminus:"∖",setmn:"∖",smallsetminus:"∖",ssetmn:"∖",Barv:"⫧",Barwed:"⌆",doublebarwedge:"⌆",Bcy:"Б",Because:"∵",becaus:"∵",because:"∵",Bernoullis:"ℬ",Bscr:"ℬ",bernou:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",breve:"˘",Bumpeq:"≎",HumpDownHump:"≎",bump:"≎",CHcy:"Ч",COPY:"©",copy:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",DD:"ⅅ",Cayleys:"ℭ",Cfr:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",cedil:"¸",CenterDot:"·",centerdot:"·",middot:"·",Chi:"Χ",CircleDot:"⊙",odot:"⊙",CircleMinus:"⊖",ominus:"⊖",CirclePlus:"⊕",oplus:"⊕",CircleTimes:"⊗",otimes:"⊗",ClockwiseContourIntegral:"∲",cwconint:"∲",CloseCurlyDoubleQuote:"”",rdquo:"”",rdquor:"”",CloseCurlyQuote:"’",rsquo:"’",rsquor:"’",Colon:"∷",Proportion:"∷",Colone:"⩴",Congruent:"≡",equiv:"≡",Conint:"∯",DoubleContourIntegral:"∯",ContourIntegral:"∮",conint:"∮",oint:"∮",Copf:"ℂ",complexes:"ℂ",Coproduct:"∐",coprod:"∐",CounterClockwiseContourIntegral:"∳",awconint:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",asympeq:"≍",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",ddagger:"‡",Darr:"↡",Dashv:"⫤",DoubleLeftTee:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",nabla:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",acute:"´",DiacriticalDot:"˙",dot:"˙",DiacriticalDoubleAcute:"˝",dblac:"˝",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"˜",tilde:"˜",Diamond:"⋄",diam:"⋄",diamond:"⋄",DifferentialD:"ⅆ",dd:"ⅆ",Dopf:"𝔻",Dot:"¨",DoubleDot:"¨",die:"¨",uml:"¨",DotDot:"⃜",DotEqual:"≐",doteq:"≐",esdot:"≐",DoubleDownArrow:"⇓",Downarrow:"⇓",dArr:"⇓",DoubleLeftArrow:"⇐",Leftarrow:"⇐",lArr:"⇐",DoubleLeftRightArrow:"⇔",Leftrightarrow:"⇔",hArr:"⇔",iff:"⇔",DoubleLongLeftArrow:"⟸",Longleftarrow:"⟸",xlArr:"⟸",DoubleLongLeftRightArrow:"⟺",Longleftrightarrow:"⟺",xhArr:"⟺",DoubleLongRightArrow:"⟹",Longrightarrow:"⟹",xrArr:"⟹",DoubleRightArrow:"⇒",Implies:"⇒",Rightarrow:"⇒",rArr:"⇒",DoubleRightTee:"⊨",vDash:"⊨",DoubleUpArrow:"⇑",Uparrow:"⇑",uArr:"⇑",DoubleUpDownArrow:"⇕",Updownarrow:"⇕",vArr:"⇕",DoubleVerticalBar:"∥",par:"∥",parallel:"∥",shortparallel:"∥",spar:"∥",DownArrow:"↓",ShortDownArrow:"↓",darr:"↓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",duarr:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",leftharpoondown:"↽",lhard:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",rhard:"⇁",rightharpoondown:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",top:"⊤",DownTeeArrow:"↧",mapstodown:"↧",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",in:"∈",isin:"∈",isinv:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",eqsim:"≂",esim:"≂",Equilibrium:"⇌",rightleftharpoons:"⇌",rlhar:"⇌",Escr:"ℰ",expectation:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",exist:"∃",ExponentialE:"ⅇ",ee:"ⅇ",exponentiale:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",blacksquare:"▪",squarf:"▪",squf:"▪",Fopf:"𝔽",ForAll:"∀",forall:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",gt:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",ggg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",ge:"≥",geq:"≥",GreaterEqualLess:"⋛",gel:"⋛",gtreqless:"⋛",GreaterFullEqual:"≧",gE:"≧",geqq:"≧",GreaterGreater:"⪢",GreaterLess:"≷",gl:"≷",gtrless:"≷",GreaterSlantEqual:"⩾",geqslant:"⩾",ges:"⩾",GreaterTilde:"≳",gsim:"≳",gtrsim:"≳",Gscr:"𝒢",Gt:"≫",NestedGreaterGreater:"≫",gg:"≫",HARDcy:"Ъ",Hacek:"ˇ",caron:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",Poincareplane:"ℌ",HilbertSpace:"ℋ",Hscr:"ℋ",hamilt:"ℋ",Hopf:"ℍ",quaternions:"ℍ",HorizontalLine:"─",boxh:"─",Hstrok:"Ħ",HumpEqual:"≏",bumpe:"≏",bumpeq:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Im:"ℑ",image:"ℑ",imagpart:"ℑ",Igrave:"Ì",Imacr:"Ī",ImaginaryI:"ⅈ",ii:"ⅈ",Int:"∬",Integral:"∫",int:"∫",Intersection:"⋂",bigcap:"⋂",xcap:"⋂",InvisibleComma:"",ic:"",InvisibleTimes:"",it:"",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",imagline:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",lt:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Lscr:"ℒ",lagran:"ℒ",Larr:"↞",twoheadleftarrow:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",lang:"⟨",langle:"⟨",LeftArrow:"←",ShortLeftArrow:"←",larr:"←",leftarrow:"←",slarr:"←",LeftArrowBar:"⇤",larrb:"⇤",LeftArrowRightArrow:"⇆",leftrightarrows:"⇆",lrarr:"⇆",LeftCeiling:"⌈",lceil:"⌈",LeftDoubleBracket:"⟦",lobrk:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",dharl:"⇃",downharpoonleft:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",lfloor:"⌊",LeftRightArrow:"↔",harr:"↔",leftrightarrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",dashv:"⊣",LeftTeeArrow:"↤",mapstoleft:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",vartriangleleft:"⊲",vltri:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",ltrie:"⊴",trianglelefteq:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",uharl:"↿",upharpoonleft:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",leftharpoonup:"↼",lharu:"↼",LeftVectorBar:"⥒",LessEqualGreater:"⋚",leg:"⋚",lesseqgtr:"⋚",LessFullEqual:"≦",lE:"≦",leqq:"≦",LessGreater:"≶",lessgtr:"≶",lg:"≶",LessLess:"⪡",LessSlantEqual:"⩽",leqslant:"⩽",les:"⩽",LessTilde:"≲",lesssim:"≲",lsim:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",lAarr:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",longleftarrow:"⟵",xlarr:"⟵",LongLeftRightArrow:"⟷",longleftrightarrow:"⟷",xharr:"⟷",LongRightArrow:"⟶",longrightarrow:"⟶",xrarr:"⟶",Lopf:"𝕃",LowerLeftArrow:"↙",swarr:"↙",swarrow:"↙",LowerRightArrow:"↘",searr:"↘",searrow:"↘",Lsh:"↰",lsh:"↰",Lstrok:"Ł",Lt:"≪",NestedLessLess:"≪",ll:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mscr:"ℳ",phmmat:"ℳ",Mfr:"𝔐",MinusPlus:"∓",mnplus:"∓",mp:"∓",Mopf:"𝕄",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",ZeroWidthSpace:"",NewLine:`
|
|
36
|
+
`,Nfr:"𝔑",NoBreak:"",NonBreakingSpace:" ",nbsp:" ",Nopf:"ℕ",naturals:"ℕ",Not:"⫬",NotCongruent:"≢",nequiv:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",npar:"∦",nparallel:"∦",nshortparallel:"∦",nspar:"∦",NotElement:"∉",notin:"∉",notinva:"∉",NotEqual:"≠",ne:"≠",NotEqualTilde:"≂̸",nesim:"≂̸",NotExists:"∄",nexist:"∄",nexists:"∄",NotGreater:"≯",ngt:"≯",ngtr:"≯",NotGreaterEqual:"≱",nge:"≱",ngeq:"≱",NotGreaterFullEqual:"≧̸",ngE:"≧̸",ngeqq:"≧̸",NotGreaterGreater:"≫̸",nGtv:"≫̸",NotGreaterLess:"≹",ntgl:"≹",NotGreaterSlantEqual:"⩾̸",ngeqslant:"⩾̸",nges:"⩾̸",NotGreaterTilde:"≵",ngsim:"≵",NotHumpDownHump:"≎̸",nbump:"≎̸",NotHumpEqual:"≏̸",nbumpe:"≏̸",NotLeftTriangle:"⋪",nltri:"⋪",ntriangleleft:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",nltrie:"⋬",ntrianglelefteq:"⋬",NotLess:"≮",nless:"≮",nlt:"≮",NotLessEqual:"≰",nle:"≰",nleq:"≰",NotLessGreater:"≸",ntlg:"≸",NotLessLess:"≪̸",nLtv:"≪̸",NotLessSlantEqual:"⩽̸",nleqslant:"⩽̸",nles:"⩽̸",NotLessTilde:"≴",nlsim:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",npr:"⊀",nprec:"⊀",NotPrecedesEqual:"⪯̸",npre:"⪯̸",npreceq:"⪯̸",NotPrecedesSlantEqual:"⋠",nprcue:"⋠",NotReverseElement:"∌",notni:"∌",notniva:"∌",NotRightTriangle:"⋫",nrtri:"⋫",ntriangleright:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",nrtrie:"⋭",ntrianglerighteq:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",nsqsube:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",nsqsupe:"⋣",NotSubset:"⊂⃒",nsubset:"⊂⃒",vnsub:"⊂⃒",NotSubsetEqual:"⊈",nsube:"⊈",nsubseteq:"⊈",NotSucceeds:"⊁",nsc:"⊁",nsucc:"⊁",NotSucceedsEqual:"⪰̸",nsce:"⪰̸",nsucceq:"⪰̸",NotSucceedsSlantEqual:"⋡",nsccue:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",nsupset:"⊃⃒",vnsup:"⊃⃒",NotSupersetEqual:"⊉",nsupe:"⊉",nsupseteq:"⊉",NotTilde:"≁",nsim:"≁",NotTildeEqual:"≄",nsime:"≄",nsimeq:"≄",NotTildeFullEqual:"≇",ncong:"≇",NotTildeTilde:"≉",nap:"≉",napprox:"≉",NotVerticalBar:"∤",nmid:"∤",nshortmid:"∤",nsmid:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",ohm:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",ldquo:"“",OpenCurlyQuote:"‘",lsquo:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",oline:"‾",OverBrace:"⏞",OverBracket:"⎴",tbrk:"⎴",OverParenthesis:"⏜",PartialD:"∂",part:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",plusmn:"±",pm:"±",Popf:"ℙ",primes:"ℙ",Pr:"⪻",Precedes:"≺",pr:"≺",prec:"≺",PrecedesEqual:"⪯",pre:"⪯",preceq:"⪯",PrecedesSlantEqual:"≼",prcue:"≼",preccurlyeq:"≼",PrecedesTilde:"≾",precsim:"≾",prsim:"≾",Prime:"″",Product:"∏",prod:"∏",Proportional:"∝",prop:"∝",propto:"∝",varpropto:"∝",vprop:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',quot:'"',Qfr:"𝔔",Qopf:"ℚ",rationals:"ℚ",Qscr:"𝒬",RBarr:"⤐",drbkarow:"⤐",REG:"®",circledR:"®",reg:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",twoheadrightarrow:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",Rfr:"ℜ",real:"ℜ",realpart:"ℜ",ReverseElement:"∋",SuchThat:"∋",ni:"∋",niv:"∋",ReverseEquilibrium:"⇋",leftrightharpoons:"⇋",lrhar:"⇋",ReverseUpEquilibrium:"⥯",duhar:"⥯",Rho:"Ρ",RightAngleBracket:"⟩",rang:"⟩",rangle:"⟩",RightArrow:"→",ShortRightArrow:"→",rarr:"→",rightarrow:"→",srarr:"→",RightArrowBar:"⇥",rarrb:"⇥",RightArrowLeftArrow:"⇄",rightleftarrows:"⇄",rlarr:"⇄",RightCeiling:"⌉",rceil:"⌉",RightDoubleBracket:"⟧",robrk:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",dharr:"⇂",downharpoonright:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rfloor:"⌋",RightTee:"⊢",vdash:"⊢",RightTeeArrow:"↦",map:"↦",mapsto:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",vartriangleright:"⊳",vrtri:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",rtrie:"⊵",trianglerighteq:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",uharr:"↾",upharpoonright:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",rharu:"⇀",rightharpoonup:"⇀",RightVectorBar:"⥓",Ropf:"ℝ",reals:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",rAarr:"⇛",Rscr:"ℛ",realine:"ℛ",Rsh:"↱",rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortUpArrow:"↑",UpArrow:"↑",uarr:"↑",uparrow:"↑",Sigma:"Σ",SmallCircle:"∘",compfn:"∘",Sopf:"𝕊",Sqrt:"√",radic:"√",Square:"□",squ:"□",square:"□",SquareIntersection:"⊓",sqcap:"⊓",SquareSubset:"⊏",sqsub:"⊏",sqsubset:"⊏",SquareSubsetEqual:"⊑",sqsube:"⊑",sqsubseteq:"⊑",SquareSuperset:"⊐",sqsup:"⊐",sqsupset:"⊐",SquareSupersetEqual:"⊒",sqsupe:"⊒",sqsupseteq:"⊒",SquareUnion:"⊔",sqcup:"⊔",Sscr:"𝒮",Star:"⋆",sstarf:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",sube:"⊆",subseteq:"⊆",Succeeds:"≻",sc:"≻",succ:"≻",SucceedsEqual:"⪰",sce:"⪰",succeq:"⪰",SucceedsSlantEqual:"≽",sccue:"≽",succcurlyeq:"≽",SucceedsTilde:"≿",scsim:"≿",succsim:"≿",Sum:"∑",sum:"∑",Sup:"⋑",Supset:"⋑",Superset:"⊃",sup:"⊃",supset:"⊃",SupersetEqual:"⊇",supe:"⊇",supseteq:"⊇",THORN:"Þ",TRADE:"™",trade:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",there4:"∴",therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",thinsp:" ",Tilde:"∼",sim:"∼",thicksim:"∼",thksim:"∼",TildeEqual:"≃",sime:"≃",simeq:"≃",TildeFullEqual:"≅",cong:"≅",TildeTilde:"≈",ap:"≈",approx:"≈",asymp:"≈",thickapprox:"≈",thkap:"≈",Topf:"𝕋",TripleDot:"⃛",tdot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",lowbar:"_",UnderBrace:"⏟",UnderBracket:"⎵",bbrk:"⎵",UnderParenthesis:"⏝",Union:"⋃",bigcup:"⋃",xcup:"⋃",UnionPlus:"⊎",uplus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",udarr:"⇅",UpDownArrow:"↕",updownarrow:"↕",varr:"↕",UpEquilibrium:"⥮",udhar:"⥮",UpTee:"⊥",bot:"⊥",bottom:"⊥",perp:"⊥",UpTeeArrow:"↥",mapstoup:"↥",UpperLeftArrow:"↖",nwarr:"↖",nwarrow:"↖",UpperRightArrow:"↗",nearr:"↗",nearrow:"↗",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",bigvee:"⋁",xvee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",mid:"∣",shortmid:"∣",smid:"∣",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"❘",VerticalTilde:"≀",wr:"≀",wreath:"≀",VeryThinSpace:" ",hairsp:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",bigwedge:"⋀",xwedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",Zeta:"Ζ",Zfr:"ℨ",zeetrf:"ℨ",Zopf:"ℤ",integers:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",mstpos:"∾",acE:"∾̳",acd:"∿",acirc:"â",acy:"а",aelig:"æ",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",and:"∧",wedge:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",angle:"∠",ange:"⦤",angmsd:"∡",measuredangle:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angzarr:"⍼",aogon:"ą",aopf:"𝕒",apE:"⩰",apacir:"⩯",ape:"≊",approxeq:"≊",apid:"≋",apos:"'",aring:"å",ascr:"𝒶",ast:"*",midast:"*",atilde:"ã",auml:"ä",awint:"⨑",bNot:"⫭",backcong:"≌",bcong:"≌",backepsilon:"϶",bepsi:"϶",backprime:"‵",bprime:"‵",backsim:"∽",bsim:"∽",backsimeq:"⋍",bsime:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrktbrk:"⎶",bcy:"б",bdquo:"„",ldquor:"„",bemptyv:"⦰",beta:"β",beth:"ℶ",between:"≬",twixt:"≬",bfr:"𝔟",bigcirc:"◯",xcirc:"◯",bigodot:"⨀",xodot:"⨀",bigoplus:"⨁",xoplus:"⨁",bigotimes:"⨂",xotime:"⨂",bigsqcup:"⨆",xsqcup:"⨆",bigstar:"★",starf:"★",bigtriangledown:"▽",xdtri:"▽",bigtriangleup:"△",xutri:"△",biguplus:"⨄",xuplus:"⨄",bkarow:"⤍",rbarr:"⤍",blacklozenge:"⧫",lozf:"⧫",blacktriangle:"▴",utrif:"▴",blacktriangledown:"▾",dtrif:"▾",blacktriangleleft:"◂",ltrif:"◂",blacktriangleright:"▸",rtrif:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",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:"┌",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",minusb:"⊟",boxplus:"⊞",plusb:"⊞",boxtimes:"⊠",timesb:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bumpE:"⪮",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cemptyv:"⦲",cent:"¢",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",cire:"≗",circlearrowleft:"↺",olarr:"↺",circlearrowright:"↻",orarr:"↻",circledS:"Ⓢ",oS:"Ⓢ",circledast:"⊛",oast:"⊛",circledcirc:"⊚",ocir:"⊚",circleddash:"⊝",odash:"⊝",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",comma:",",commat:"@",comp:"∁",complement:"∁",congdot:"⩭",copf:"𝕔",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",curlyeqprec:"⋞",cuesc:"⋟",curlyeqsucc:"⋟",cularr:"↶",curvearrowleft:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curvearrowright:"↷",curarrm:"⤼",curlyvee:"⋎",cuvee:"⋎",curlywedge:"⋏",cuwed:"⋏",curren:"¤",cwint:"∱",cylcty:"⌭",dHar:"⥥",dagger:"†",daleth:"ℸ",dash:"‐",hyphen:"‐",dbkarow:"⤏",rBarr:"⤏",dcaron:"ď",dcy:"д",ddarr:"⇊",downdownarrows:"⇊",ddotseq:"⩷",eDDot:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",diamondsuit:"♦",diams:"♦",digamma:"ϝ",gammad:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",llcorner:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",doteqdot:"≑",eDot:"≑",dotminus:"∸",minusd:"∸",dotplus:"∔",plusdo:"∔",dotsquare:"⊡",sdotb:"⊡",drcorn:"⌟",lrcorner:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",triangledown:"▿",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",eqcirc:"≖",ecirc:"ê",ecolon:"≕",eqcolon:"≕",ecy:"э",edot:"ė",efDot:"≒",fallingdotseq:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",eqslantgtr:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",eqslantless:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",varnothing:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",straightepsilon:"ϵ",varepsilon:"ϵ",equals:"=",equest:"≟",questeq:"≟",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",risingdotseq:"≓",erarr:"⥱",escr:"ℯ",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",fork:"⋔",pitchfork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",half:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",sfrown:"⌢",fscr:"𝒻",gEl:"⪌",gtreqqless:"⪌",gacute:"ǵ",gamma:"γ",gap:"⪆",gtrapprox:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gimel:"ℷ",gjcy:"ѓ",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gneqq:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gnsim:"⋧",gopf:"𝕘",gscr:"ℊ",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtrdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrarr:"⥸",gvertneqq:"≩︀",gvnE:"≩︀",hardcy:"ъ",harrcir:"⥈",harrw:"↭",leftrightsquigarrow:"↭",hbar:"ℏ",hslash:"ℏ",planck:"ℏ",plankv:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",mldr:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",searhk:"⤥",hkswarow:"⤦",swarhk:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",larrhk:"↩",hookrightarrow:"↪",rarrhk:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hstrok:"ħ",hybull:"⁃",iacute:"í",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",ifr:"𝔦",igrave:"ì",iiiint:"⨌",qint:"⨌",iiint:"∭",tint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",imath:"ı",inodot:"ı",imof:"⊷",imped:"Ƶ",incare:"℅",infin:"∞",infintie:"⧝",intcal:"⊺",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iquest:"¿",iscr:"𝒾",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",varkappa:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAtail:"⤛",lBarr:"⤎",lEg:"⪋",lesseqqgtr:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lambda:"λ",langd:"⦑",lap:"⪅",lessapprox:"⪅",laquo:"«",larrbfs:"⤟",larrfs:"⤝",larrlp:"↫",looparrowleft:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",leftarrowtail:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lcy:"л",ldca:"⤶",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leq:"≤",leftleftarrows:"⇇",llarr:"⇇",leftthreetimes:"⋋",lthree:"⋋",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessdot:"⋖",ltdot:"⋖",lfisht:"⥼",lfr:"𝔩",lgE:"⪑",lharul:"⥪",lhblk:"▄",ljcy:"љ",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lneqq:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lnsim:"⋦",loang:"⟬",loarr:"⇽",longmapsto:"⟼",xmap:"⟼",looparrowright:"↬",rarrlp:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",loz:"◊",lozenge:"◊",lpar:"(",lparlt:"⦓",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsime:"⪍",lsimg:"⪏",lsquor:"‚",sbquo:"‚",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",triangleleft:"◃",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",strns:"¯",male:"♂",malt:"✠",maltese:"✠",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",mfr:"𝔪",mho:"℧",micro:"µ",midcir:"⫰",minus:"−",minusdu:"⨪",mlcp:"⫛",models:"⊧",mopf:"𝕞",mscr:"𝓂",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nLeftarrow:"⇍",nlArr:"⇍",nLeftrightarrow:"⇎",nhArr:"⇎",nLl:"⋘̸",nLt:"≪⃒",nRightarrow:"⇏",nrArr:"⇏",nVDash:"⊯",nVdash:"⊮",nacute:"ń",nang:"∠⃒",napE:"⩰̸",napid:"≋̸",napos:"ʼn",natur:"♮",natural:"♮",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",neArr:"⇗",nearhk:"⤤",nedot:"≐̸",nesear:"⤨",toea:"⤨",nfr:"𝔫",nharr:"↮",nleftrightarrow:"↮",nhpar:"⫲",nis:"⋼",nisd:"⋺",njcy:"њ",nlE:"≦̸",nleqq:"≦̸",nlarr:"↚",nleftarrow:"↚",nldr:"‥",nopf:"𝕟",not:"¬",notinE:"⋹̸",notindot:"⋵̸",notinvb:"⋷",notinvc:"⋶",notnivb:"⋾",notnivc:"⋽",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",nrarr:"↛",nrightarrow:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nscr:"𝓃",nsub:"⊄",nsubE:"⫅̸",nsubseteqq:"⫅̸",nsup:"⊅",nsupE:"⫆̸",nsupseteqq:"⫆̸",ntilde:"ñ",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwnear:"⤧",oacute:"ó",ocirc:"ô",ocy:"о",odblac:"ő",odiv:"⨸",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",olcir:"⦾",olcross:"⦻",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",oopf:"𝕠",opar:"⦷",operp:"⦹",or:"∨",vee:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",oscr:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oslash:"ø",osol:"⊘",otilde:"õ",otimesas:"⨶",ouml:"ö",ovbar:"⌽",para:"¶",parsim:"⫳",parsl:"⫽",pcy:"п",percnt:"%",period:".",permil:"‰",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",straightphi:"ϕ",varphi:"ϕ",phone:"☎",pi:"π",piv:"ϖ",varpi:"ϖ",planckh:"ℎ",plus:"+",plusacir:"⨣",pluscir:"⨢",plusdu:"⨥",pluse:"⩲",plussim:"⨦",plustwo:"⨧",pointint:"⨕",popf:"𝕡",pound:"£",prE:"⪳",prap:"⪷",precapprox:"⪷",precnapprox:"⪹",prnap:"⪹",precneqq:"⪵",prnE:"⪵",precnsim:"⋨",prnsim:"⋨",prime:"′",profalar:"⌮",profline:"⌒",profsurf:"⌓",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quatint:"⨖",quest:"?",rAtail:"⤜",rHar:"⥤",race:"∽̱",racute:"ŕ",raemptyv:"⦳",rangd:"⦒",range:"⦥",raquo:"»",rarrap:"⥵",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rightarrowtail:"↣",rarrw:"↝",rightsquigarrow:"↝",ratail:"⤚",ratio:"∶",rbbrk:"❳",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdsh:"↳",rect:"▭",rfisht:"⥽",rfr:"𝔯",rharul:"⥬",rho:"ρ",rhov:"ϱ",varrho:"ϱ",rightrightarrows:"⇉",rrarr:"⇉",rightthreetimes:"⋌",rthree:"⋌",ring:"˚",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rsaquo:"›",rscr:"𝓇",rtimes:"⋊",rtri:"▹",triangleright:"▹",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",scE:"⪴",scap:"⪸",succapprox:"⪸",scaron:"š",scedil:"ş",scirc:"ŝ",scnE:"⪶",succneqq:"⪶",scnap:"⪺",succnapprox:"⪺",scnsim:"⋩",succnsim:"⋩",scpolint:"⨓",scy:"с",sdot:"⋅",sdote:"⩦",seArr:"⇘",sect:"§",semi:";",seswar:"⤩",tosa:"⤩",sext:"✶",sfr:"𝔰",sharp:"♯",shchcy:"щ",shcy:"ш",shy:"",sigma:"σ",sigmaf:"ς",sigmav:"ς",varsigma:"ς",simdot:"⩪",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",smashp:"⨳",smeparsl:"⧤",smile:"⌣",ssmile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",sqcaps:"⊓︀",sqcups:"⊔︀",sscr:"𝓈",star:"☆",sub:"⊂",subset:"⊂",subE:"⫅",subseteqq:"⫅",subdot:"⪽",subedot:"⫃",submult:"⫁",subnE:"⫋",subsetneqq:"⫋",subne:"⊊",subsetneq:"⊊",subplus:"⪿",subrarr:"⥹",subsim:"⫇",subsub:"⫕",subsup:"⫓",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",supE:"⫆",supseteqq:"⫆",supdot:"⪾",supdsub:"⫘",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supsetneqq:"⫌",supne:"⊋",supsetneq:"⊋",supplus:"⫀",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tcaron:"ť",tcedil:"ţ",tcy:"т",telrec:"⌕",tfr:"𝔱",theta:"θ",thetasym:"ϑ",thetav:"ϑ",vartheta:"ϑ",thorn:"þ",times:"×",timesbar:"⨱",timesd:"⨰",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tprime:"‴",triangle:"▵",utri:"▵",triangleq:"≜",trie:"≜",tridot:"◬",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",uHar:"⥣",uacute:"ú",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udblac:"ű",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uogon:"ų",uopf:"𝕦",upsi:"υ",upsilon:"υ",upuparrows:"⇈",uuarr:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",uuml:"ü",uwangle:"⦧",vBar:"⫨",vBarv:"⫩",vangrt:"⦜",varsubsetneq:"⊊︀",vsubne:"⊊︀",varsubsetneqq:"⫋︀",vsubnE:"⫋︀",varsupsetneq:"⊋︀",vsupne:"⊋︀",varsupsetneqq:"⫌︀",vsupnE:"⫌︀",vcy:"в",veebar:"⊻",veeeq:"≚",vellip:"⋮",vfr:"𝔳",vopf:"𝕧",vscr:"𝓋",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedgeq:"≙",weierp:"℘",wp:"℘",wfr:"𝔴",wopf:"𝕨",wscr:"𝓌",xfr:"𝔵",xi:"ξ",xnis:"⋻",xopf:"𝕩",xscr:"𝓍",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"",zwnj:""},Vx="";po.ngsp=Vx;var qx=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function Wx(u,p){if(p!=null&&!(Array.isArray(p)&&p.length==2))throw new Error(`Expected '${u}' to be an array, [start, end].`);if(p!=null){let b=p[0],x=p[1];qx.forEach(C=>{if(C.test(b)||C.test(x))throw new Error(`['${b}', '${x}'] contains unusable interpolation symbol.`)})}}var Ux=class Xh{static fromArray(p){return p?(Wx("interpolation",p),new Xh(p[0],p[1])):hd}constructor(p,b){this.start=p,this.end=b}},hd=new Ux("{{","}}"),ma=class extends Gc{constructor(u,p,b){super(b,u),this.tokenType=p}},Jx=class{constructor(u,p,b){this.tokens=u,this.errors=p,this.nonNormalizedIcuExpressions=b}};function Kx(u,p,b,x={}){let C=new Xx(new Kc(u,p),b,x);return C.tokenize(),new Jx(n2(C.tokens),C.errors,C.nonNormalizedIcuExpressions)}var Gx=/\r\n?/g;function hn(u){return`Unexpected character "${u===0?"EOF":String.fromCharCode(u)}"`}function fd(u){return`Unknown entity "${u}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function Yx(u,p){return`Unable to parse entity "${p}" - ${u} character reference entities must end with ";"`}var ho;(function(u){u.HEX="hexadecimal",u.DEC="decimal"})(ho||(ho={}));var ga=class{constructor(u){this.error=u}},Xx=class{constructor(u,p,b){this._getTagContentType=p,this._currentTokenStart=null,this._currentTokenType=null,this._expansionCaseStack=[],this._inInterpolation=!1,this._fullNameStack=[],this.tokens=[],this.errors=[],this.nonNormalizedIcuExpressions=[],this._tokenizeIcu=b.tokenizeExpansionForms||!1,this._interpolationConfig=b.interpolationConfig||hd,this._leadingTriviaCodePoints=b.leadingTriviaChars&&b.leadingTriviaChars.map(C=>C.codePointAt(0)||0),this._canSelfClose=b.canSelfClose||!1,this._allowHtmComponentClosingTags=b.allowHtmComponentClosingTags||!1;let x=b.range||{endPos:u.content.length,startPos:0,startLine:0,startCol:0};this._cursor=b.escapedString?new s2(u,x):new xd(u,x),this._preserveLineEndings=b.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=b.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=b.tokenizeBlocks??!0,this._tokenizeLet=b.tokenizeLet??!0;try{this._cursor.init()}catch(C){this.handleError(C)}}_processCarriageReturns(u){return this._preserveLineEndings?u:u.replace(Gx,`
|
|
37
|
+
`)}tokenize(){for(;this._cursor.peek()!==0;){let u=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(u):this._attemptStr("--")?this._consumeComment(u):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(u):this._consumeBogusComment(u);else if(this._attemptCharCode(47))this._consumeTagClose(u);else{let p=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=p,this._consumeBogusComment(u)):this._consumeTagOpen(u)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(u):this._tokenizeBlocks&&this._attemptCharCode(64)?this._consumeBlockStart(u):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(u):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(p){this.handleError(p)}}this._beginToken(34),this._endToken([])}_getBlockName(){let u=!1,p=this._cursor.clone();return this._attemptCharCodeUntilFn(b=>no(b)?!u:bd(b)?(u=!0,!1):!0),this._cursor.getChars(p).trim()}_consumeBlockStart(u){this._beginToken(25,u);let p=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(ve),this._attemptCharCode(41))this._attemptCharCodeUntilFn(ve);else{p.type=29;return}this._attemptCharCode(123)?(this._beginToken(26),this._endToken([])):p.type=29}_consumeBlockEnd(u){this._beginToken(27,u),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(yd);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(28);let u=this._cursor.clone(),p=null,b=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||p!==null;){let x=this._cursor.peek();if(x===92)this._cursor.advance();else if(x===p)p=null;else if(p===null&&pa(x))p=x;else if(x===40&&p===null)b++;else if(x===41&&p===null){if(b===0)break;b>0&&b--}this._cursor.advance()}this._endToken([this._cursor.getChars(u)]),this._attemptCharCodeUntilFn(yd)}}_consumeLetDeclaration(u){if(this._beginToken(30,u),no(this._cursor.peek()))this._attemptCharCodeUntilFn(ve);else{let b=this._endToken([this._cursor.getChars(u)]);b.type=33;return}let p=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(ve),!this._attemptCharCode(61)){p.type=33;return}this._attemptCharCodeUntilFn(b=>ve(b)&&!da(b)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(32),this._endToken([]),this._cursor.advance()):(p.type=33,p.sourceSpan=this._cursor.getSpan(u))}_getLetDeclarationName(){let u=this._cursor.clone(),p=!1;return this._attemptCharCodeUntilFn(b=>so(b)||b===36||b===95||p&&ca(b)?(p=!0,!1):!0),this._cursor.getChars(u).trim()}_consumeLetDeclarationValue(){let u=this._cursor.clone();for(this._beginToken(31,u);this._cursor.peek()!==0;){let p=this._cursor.peek();if(p===59)break;pa(p)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(b=>b===92?(this._cursor.advance(),!1):b===p)),this._cursor.advance()}this._endToken([this._cursor.getChars(u)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(t2(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(u,p=this._cursor.clone()){this._currentTokenStart=p,this._currentTokenType=u}_endToken(u,p){if(this._currentTokenStart===null)throw new ma("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(p));if(this._currentTokenType===null)throw new ma("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let b={type:this._currentTokenType,parts:u,sourceSpan:(p??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(b),this._currentTokenStart=null,this._currentTokenType=null,b}_createError(u,p){this._isInExpansionForm()&&(u+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let b=new ma(u,this._currentTokenType,p);return this._currentTokenStart=null,this._currentTokenType=null,new ga(b)}handleError(u){if(u instanceof ba&&(u=this._createError(u.msg,this._cursor.getSpan(u.cursor))),u instanceof ga)this.errors.push(u.error);else throw u}_attemptCharCode(u){return this._cursor.peek()===u?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(u){return r2(this._cursor.peek(),u)?(this._cursor.advance(),!0):!1}_requireCharCode(u){let p=this._cursor.clone();if(!this._attemptCharCode(u))throw this._createError(hn(this._cursor.peek()),this._cursor.getSpan(p))}_attemptStr(u){let p=u.length;if(this._cursor.charsLeft()<p)return!1;let b=this._cursor.clone();for(let x=0;x<p;x++)if(!this._attemptCharCode(u.charCodeAt(x)))return this._cursor=b,!1;return!0}_attemptStrCaseInsensitive(u){for(let p=0;p<u.length;p++)if(!this._attemptCharCodeCaseInsensitive(u.charCodeAt(p)))return!1;return!0}_requireStr(u){let p=this._cursor.clone();if(!this._attemptStr(u))throw this._createError(hn(this._cursor.peek()),this._cursor.getSpan(p))}_requireStrCaseInsensitive(u){let p=this._cursor.clone();if(!this._attemptStrCaseInsensitive(u))throw this._createError(hn(this._cursor.peek()),this._cursor.getSpan(p))}_attemptCharCodeUntilFn(u){for(;!u(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(u,p){let b=this._cursor.clone();if(this._attemptCharCodeUntilFn(u),this._cursor.diff(b)<p)throw this._createError(hn(this._cursor.peek()),this._cursor.getSpan(b))}_attemptUntilChar(u){for(;this._cursor.peek()!==u;)this._cursor.advance()}_readChar(){let u=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),u}_consumeEntity(u){this._beginToken(9);let p=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let b=this._attemptCharCode(120)||this._attemptCharCode(88),x=this._cursor.clone();if(this._attemptCharCodeUntilFn(Zx),this._cursor.peek()!=59){this._cursor.advance();let k=b?ho.HEX:ho.DEC;throw this._createError(Yx(k,this._cursor.getChars(p)),this._cursor.getSpan())}let C=this._cursor.getChars(x);this._cursor.advance();try{let k=parseInt(C,b?16:10);this._endToken([String.fromCharCode(k),this._cursor.getChars(p)])}catch{throw this._createError(fd(this._cursor.getChars(p)),this._cursor.getSpan())}}else{let b=this._cursor.clone();if(this._attemptCharCodeUntilFn(e2),this._cursor.peek()!=59)this._beginToken(u,p),this._cursor=b,this._endToken(["&"]);else{let x=this._cursor.getChars(b);this._cursor.advance();let C=po[x];if(!C)throw this._createError(fd(x),this._cursor.getSpan(p));this._endToken([C,`&${x};`])}}}_consumeRawText(u,p){this._beginToken(u?6:7);let b=[];for(;;){let x=this._cursor.clone(),C=p();if(this._cursor=x,C)break;u&&this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(b.join(""))]),b.length=0,this._consumeEntity(6),this._beginToken(6)):b.push(this._readChar())}this._endToken([this._processCarriageReturns(b.join(""))])}_consumeComment(u){this._beginToken(10,u),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(u){this._beginToken(10,u),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(11),this._cursor.advance(),this._endToken([])}_consumeCdata(u){this._beginToken(12,u),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(u){this._beginToken(18,u),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(19),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(){let u=this._cursor.clone(),p="";for(;this._cursor.peek()!==58&&!Qx(this._cursor.peek());)this._cursor.advance();let b;this._cursor.peek()===58?(p=this._cursor.getChars(u),this._cursor.advance(),b=this._cursor.clone()):b=u,this._requireCharCodeUntilFn(md,p===""?0:1);let x=this._cursor.getChars(b);return[p,x]}_consumeTagOpen(u){let p,b,x,C=[];try{if(!so(this._cursor.peek()))throw this._createError(hn(this._cursor.peek()),this._cursor.getSpan(u));for(x=this._consumeTagOpenStart(u),b=x.parts[0],p=x.parts[1],this._attemptCharCodeUntilFn(ve);this._cursor.peek()!==47&&this._cursor.peek()!==62&&this._cursor.peek()!==60&&this._cursor.peek()!==0;){let[S,M]=this._consumeAttributeName();if(this._attemptCharCodeUntilFn(ve),this._attemptCharCode(61)){this._attemptCharCodeUntilFn(ve);let P=this._consumeAttributeValue();C.push({prefix:S,name:M,value:P})}else C.push({prefix:S,name:M});this._attemptCharCodeUntilFn(ve)}this._consumeTagOpenEnd()}catch(S){if(S instanceof ga){x?x.type=4:(this._beginToken(5,u),this._endToken(["<"]));return}throw S}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===2)return;let k=this._getTagContentType(p,b,this._fullNameStack.length>0,C);this._handleFullNameStackForTagOpen(b,p),k===yt.RAW_TEXT?this._consumeRawTextWithTagClose(b,p,!1):k===yt.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(b,p,!0)}_consumeRawTextWithTagClose(u,p,b){this._consumeRawText(b,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(ve),!this._attemptStrCaseInsensitive(u?`${u}:${p}`:p))?!1:(this._attemptCharCodeUntilFn(ve),this._attemptCharCode(62))),this._beginToken(3),this._requireCharCodeUntilFn(x=>x===62,3),this._cursor.advance(),this._endToken([u,p]),this._handleFullNameStackForTagClose(u,p)}_consumeTagOpenStart(u){this._beginToken(0,u);let p=this._consumePrefixAndName();return this._endToken(p)}_consumeAttributeName(){let u=this._cursor.peek();if(u===39||u===34)throw this._createError(hn(u),this._cursor.getSpan());this._beginToken(14);let p=this._consumePrefixAndName();return this._endToken(p),p}_consumeAttributeValue(){let u;if(this._cursor.peek()===39||this._cursor.peek()===34){let p=this._cursor.peek();this._consumeQuote(p);let b=()=>this._cursor.peek()===p;u=this._consumeWithInterpolation(16,17,b,b),this._consumeQuote(p)}else{let p=()=>md(this._cursor.peek());u=this._consumeWithInterpolation(16,17,p,p)}return u}_consumeQuote(u){this._beginToken(15),this._requireCharCode(u),this._endToken([String.fromCodePoint(u)])}_consumeTagOpenEnd(){let u=this._attemptCharCode(47)?2:1;this._beginToken(u),this._requireCharCode(62),this._endToken([])}_consumeTagClose(u){if(this._beginToken(3,u),this._attemptCharCodeUntilFn(ve),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(ve),this._requireCharCode(62),this._endToken([]);else{let[p,b]=this._consumePrefixAndName();this._attemptCharCodeUntilFn(ve),this._requireCharCode(62),this._endToken([p,b]),this._handleFullNameStackForTagClose(p,b)}}_consumeExpansionFormStart(){this._beginToken(20),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(20),this._beginToken(7);let u=this._readUntil(44),p=this._processCarriageReturns(u);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([p]);else{let x=this._endToken([u]);p!==u&&this.nonNormalizedIcuExpressions.push(x)}this._requireCharCode(44),this._attemptCharCodeUntilFn(ve),this._beginToken(7);let b=this._readUntil(44);this._endToken([b]),this._requireCharCode(44),this._attemptCharCodeUntilFn(ve)}_consumeExpansionCaseStart(){this._beginToken(21);let u=this._readUntil(123).trim();this._endToken([u]),this._attemptCharCodeUntilFn(ve),this._beginToken(22),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(ve),this._expansionCaseStack.push(22)}_consumeExpansionCaseEnd(){this._beginToken(23),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(ve),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(24),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(u,p,b,x){this._beginToken(u);let C=[];for(;!b();){let S=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(C.join(""))],S),C.length=0,this._consumeInterpolation(p,S,x),this._beginToken(u)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(C.join(""))]),C.length=0,this._consumeEntity(u),this._beginToken(u)):C.push(this._readChar())}this._inInterpolation=!1;let k=this._processCarriageReturns(C.join(""));return this._endToken([k]),k}_consumeInterpolation(u,p,b){let x=[];this._beginToken(u,p),x.push(this._interpolationConfig.start);let C=this._cursor.clone(),k=null,S=!1;for(;this._cursor.peek()!==0&&(b===null||!b());){let M=this._cursor.clone();if(this._isTagStart()){this._cursor=M,x.push(this._getProcessedChars(C,M)),this._endToken(x);return}if(k===null)if(this._attemptStr(this._interpolationConfig.end)){x.push(this._getProcessedChars(C,M)),x.push(this._interpolationConfig.end),this._endToken(x);return}else this._attemptStr("//")&&(S=!0);let P=this._cursor.peek();this._cursor.advance(),P===92?this._cursor.advance():P===k?k=null:!S&&k===null&&pa(P)&&(k=P)}x.push(this._getProcessedChars(C,this._cursor)),this._endToken(x)}_getProcessedChars(u,p){return this._processCarriageReturns(p.getChars(u))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._cursor.peek()===64||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let u=this._cursor.clone();u.advance();let p=u.peek();if(97<=p&&p<=122||65<=p&&p<=90||p===47||p===33)return!0}return!1}_isBlockStart(){if(this._tokenizeBlocks&&this._cursor.peek()===64){let u=this._cursor.clone();if(u.advance(),bd(u.peek()))return!0}return!1}_readUntil(u){let p=this._cursor.clone();return this._attemptUntilChar(u),this._cursor.getChars(p)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===22}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===20}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;if(this._interpolationConfig){let u=this._cursor.clone(),p=this._attemptStr(this._interpolationConfig.start);return this._cursor=u,!p}return!0}_handleFullNameStackForTagOpen(u,p){let b=lo(u,p);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===b)&&this._fullNameStack.push(b)}_handleFullNameStackForTagClose(u,p){let b=lo(u,p);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===b&&this._fullNameStack.pop()}};function ve(u){return!no(u)||u===0}function md(u){return no(u)||u===62||u===60||u===47||u===39||u===34||u===61||u===0}function Qx(u){return(u<97||122<u)&&(u<65||90<u)&&(u<48||u>57)}function Zx(u){return u===59||u===0||!nx(u)}function e2(u){return u===59||u===0||!so(u)}function t2(u){return u!==125}function r2(u,p){return gd(u)===gd(p)}function gd(u){return u>=97&&u<=122?u-97+65:u}function bd(u){return so(u)||ca(u)||u===95}function yd(u){return u!==59&&ve(u)}function n2(u){let p=[],b;for(let x=0;x<u.length;x++){let C=u[x];b&&b.type===5&&C.type===5||b&&b.type===16&&C.type===16?(b.parts[0]+=C.parts[0],b.sourceSpan.end=C.sourceSpan.end):(b=C,p.push(b))}return p}var xd=class al{constructor(p,b){if(p instanceof al){this.file=p.file,this.input=p.input,this.end=p.end;let x=p.state;this.state={peek:x.peek,offset:x.offset,line:x.line,column:x.column}}else{if(!b)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=p,this.input=p.content,this.end=b.endPos,this.state={peek:-1,offset:b.startPos,line:b.startLine,column:b.startCol}}}clone(){return new al(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(p){return this.state.offset-p.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(p,b){p=p||this;let x=p;if(b)for(;this.diff(p)>0&&b.indexOf(p.peek())!==-1;)x===p&&(p=p.clone()),p.advance();let C=this.locationFromCursor(p),k=this.locationFromCursor(this),S=x!==p?this.locationFromCursor(x):C;return new ne(C,k,S)}getChars(p){return this.input.substring(p.state.offset,this.state.offset)}charAt(p){return this.input.charCodeAt(p)}advanceState(p){if(p.offset>=this.end)throw this.state=p,new ba('Unexpected character "EOF"',this);let b=this.charAt(p.offset);b===10?(p.line++,p.column=0):da(b)||p.column++,p.offset++,this.updatePeek(p)}updatePeek(p){p.peek=p.offset>=this.end?0:this.charAt(p.offset)}locationFromCursor(p){return new ha(p.file,p.state.offset,p.state.line,p.state.column)}},s2=class ll extends xd{constructor(p,b){p instanceof ll?(super(p),this.internalState={...p.internalState}):(super(p,b),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new ll(this)}getChars(p){let b=p.clone(),x="";for(;b.internalState.offset<this.internalState.offset;)x+=String.fromCodePoint(b.peek()),b.advance();return x}processEscapeSequence(){let p=()=>this.internalState.peek;if(p()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),p()===110)this.state.peek=10;else if(p()===114)this.state.peek=13;else if(p()===118)this.state.peek=11;else if(p()===116)this.state.peek=9;else if(p()===98)this.state.peek=8;else if(p()===102)this.state.peek=12;else if(p()===117)if(this.advanceState(this.internalState),p()===123){this.advanceState(this.internalState);let b=this.clone(),x=0;for(;p()!==125;)this.advanceState(this.internalState),x++;this.state.peek=this.decodeHexDigits(b,x)}else{let b=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(b,4)}else if(p()===120){this.advanceState(this.internalState);let b=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(b,2)}else if(Jc(p())){let b="",x=0,C=this.clone();for(;Jc(p())&&x<3;)C=this.clone(),b+=String.fromCodePoint(p()),this.advanceState(this.internalState),x++;this.state.peek=parseInt(b,8),this.internalState=C.internalState}else da(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(p,b){let x=this.input.slice(p.internalState.offset,p.internalState.offset+b),C=parseInt(x,16);if(isNaN(C))throw p.state=p.internalState,new ba("Invalid hexadecimal escape sequence",p);return C}},ba=class{constructor(u,p){this.msg=u,this.cursor=p}},We=class Qh extends Gc{static create(p,b,x){return new Qh(p,b,x)}constructor(p,b,x){super(b,x),this.elementName=p}},o2=class{constructor(u,p){this.rootNodes=u,this.errors=p}},i2=class{constructor(u){this.getTagDefinition=u}parse(u,p,b,x=!1,C){let k=se=>(ce,...Ee)=>se(ce.toLowerCase(),...Ee),S=x?this.getTagDefinition:k(this.getTagDefinition),M=se=>S(se).getContentType(),P=x?C:k(C),U=Kx(u,p,C?(se,ce,Ee,Oe)=>{let $e=P(se,ce,Ee,Oe);return $e!==void 0?$e:M(se)}:M,b),V=b&&b.canSelfClose||!1,ie=b&&b.allowHtmComponentClosingTags||!1,ee=new a2(U.tokens,S,V,ie,x);return ee.build(),new o2(ee.rootNodes,U.errors.concat(ee.errors))}},a2=class Zh{constructor(p,b,x,C,k){this.tokens=p,this.getTagDefinition=b,this.canSelfClose=x,this.allowHtmComponentClosingTags=C,this.isTagNameCaseSensitive=k,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==34;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?(this._closeVoidElement(),this._consumeEndTag(this._advance())):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===20?this._consumeExpansion(this._advance()):this._peek.type===25?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===27?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===30?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===18?this._consumeDocType(this._advance()):this._peek.type===33?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._advance();for(let p of this._containerStack)p instanceof pn&&this.errors.push(We.create(p.name,p.sourceSpan,`Unclosed block "${p.name}"`))}_advance(){let p=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],p}_advanceIf(p){return this._peek.type===p?this._advance():null}_consumeCdata(p){let b=this._advance(),x=this._getText(b),C=this._advanceIf(13);this._addToParent(new _x(x,new ne(p.sourceSpan.start,(C||b).sourceSpan.end),[b]))}_consumeComment(p){let b=this._advanceIf(7),x=this._advanceIf(11),C=b!=null?b.parts[0].trim():null,k=x==null?p.sourceSpan:new ne(p.sourceSpan.start,x.sourceSpan.end,p.sourceSpan.fullStart);this._addToParent(new zx(C,k))}_consumeDocType(p){let b=this._advanceIf(7),x=this._advanceIf(19),C=b!=null?b.parts[0].trim():null,k=new ne(p.sourceSpan.start,(x||b||p).sourceSpan.end);this._addToParent(new $x(C,k))}_consumeExpansion(p){let b=this._advance(),x=this._advance(),C=[];for(;this._peek.type===21;){let S=this._parseExpansionCase();if(!S)return;C.push(S)}if(this._peek.type!==24){this.errors.push(We.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let k=new ne(p.sourceSpan.start,this._peek.sourceSpan.end,p.sourceSpan.fullStart);this._addToParent(new Ix(b.parts[0],x.parts[0],C,k,b.sourceSpan)),this._advance()}_parseExpansionCase(){let p=this._advance();if(this._peek.type!==22)return this.errors.push(We.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let b=this._advance(),x=this._collectExpansionExpTokens(b);if(!x)return null;let C=this._advance();x.push({type:34,parts:[],sourceSpan:C.sourceSpan});let k=new Zh(x,this.getTagDefinition,this.canSelfClose,this.allowHtmComponentClosingTags,this.isTagNameCaseSensitive);if(k.build(),k.errors.length>0)return this.errors=this.errors.concat(k.errors),null;let S=new ne(p.sourceSpan.start,C.sourceSpan.end,p.sourceSpan.fullStart),M=new ne(b.sourceSpan.start,C.sourceSpan.end,b.sourceSpan.fullStart);return new Rx(p.parts[0],k.rootNodes,S,p.sourceSpan,M)}_collectExpansionExpTokens(p){let b=[],x=[22];for(;;){if((this._peek.type===20||this._peek.type===22)&&x.push(this._peek.type),this._peek.type===23)if(vd(x,22)){if(x.pop(),x.length===0)return b}else return this.errors.push(We.create(null,p.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===24)if(vd(x,20))x.pop();else return this.errors.push(We.create(null,p.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===34)return this.errors.push(We.create(null,p.sourceSpan,"Invalid ICU message. Missing '}'.")),null;b.push(this._advance())}}_getText(p){let b=p.parts[0];if(b.length>0&&b[0]==`
|
|
38
|
+
`){let x=this._getClosestParentElement();x!=null&&x.children.length==0&&this.getTagDefinition(x.name).ignoreFirstLf&&(b=b.substring(1))}return b}_consumeText(p){let b=[p],x=p.sourceSpan,C=p.parts[0];if(C.length>0&&C[0]===`
|
|
39
|
+
`){let k=this._getContainer();k!=null&&k.children.length===0&&this.getTagDefinition(k.name).ignoreFirstLf&&(C=C.substring(1),b[0]={type:p.type,sourceSpan:p.sourceSpan,parts:[C]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)p=this._advance(),b.push(p),p.type===8?C+=p.parts.join("").replace(/&([^;]+);/g,wd):p.type===9?C+=p.parts[0]:C+=p.parts.join("");if(C.length>0){let k=p.sourceSpan;this._addToParent(new Lx(C,new ne(x.start,k.end,x.fullStart,x.details),b))}}_closeVoidElement(){let p=this._getContainer();p instanceof nr&&this.getTagDefinition(p.name).isVoid&&this._containerStack.pop()}_consumeStartTag(p){let[b,x]=p.parts,C=[];for(;this._peek.type===14;)C.push(this._consumeAttr(this._advance()));let k=this._getElementFullName(b,x,this._getClosestParentElement()),S=!1;if(this._peek.type===2){this._advance(),S=!0;let se=this.getTagDefinition(k);this.canSelfClose||se.canSelfClose||ao(k)!==null||se.isVoid||this.errors.push(We.create(k,p.sourceSpan,`Only void, custom and foreign elements can be self closed "${p.parts[1]}"`))}else this._peek.type===1&&(this._advance(),S=!1);let M=this._peek.sourceSpan.fullStart,P=new ne(p.sourceSpan.start,M,p.sourceSpan.fullStart),U=new ne(p.sourceSpan.start,M,p.sourceSpan.fullStart),V=new ne(p.sourceSpan.start.moveBy(1),p.sourceSpan.end),ie=new nr(k,C,[],P,U,void 0,V),ee=this._getContainer();this._pushContainer(ie,ee instanceof nr&&this.getTagDefinition(ee.name).isClosedByChild(ie.name)),S?this._popContainer(k,nr,P):p.type===4&&(this._popContainer(k,nr,null),this.errors.push(We.create(k,P,`Opening tag "${k}" not terminated.`)))}_pushContainer(p,b){b&&this._containerStack.pop(),this._addToParent(p),this._containerStack.push(p)}_consumeEndTag(p){let b=this.allowHtmComponentClosingTags&&p.parts.length===0?null:this._getElementFullName(p.parts[0],p.parts[1],this._getClosestParentElement());if(b&&this.getTagDefinition(b).isVoid)this.errors.push(We.create(b,p.sourceSpan,`Void elements do not have end tags "${p.parts[1]}"`));else if(!this._popContainer(b,nr,p.sourceSpan)){let x=`Unexpected closing tag "${b}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(We.create(b,p.sourceSpan,x))}}_popContainer(p,b,x){let C=!1;for(let k=this._containerStack.length-1;k>=0;k--){let S=this._containerStack[k];if(ao(S.name)?S.name===p:(p==null||S.name.toLowerCase()===p.toLowerCase())&&S instanceof b)return S.endSourceSpan=x,S.sourceSpan.end=x!==null?x.end:S.sourceSpan.end,this._containerStack.splice(k,this._containerStack.length-k),!C;(S instanceof pn||S instanceof nr&&!this.getTagDefinition(S.name).closedByParent)&&(C=!0)}return!1}_consumeAttr(p){let b=lo(p.parts[0],p.parts[1]),x=p.sourceSpan.end,C;this._peek.type===15&&(C=this._advance());let k="",S=[],M,P;if(this._peek.type===16)for(M=this._peek.sourceSpan,P=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let V=this._advance();S.push(V),V.type===17?k+=V.parts.join("").replace(/&([^;]+);/g,wd):V.type===9?k+=V.parts[0]:k+=V.parts.join(""),P=x=V.sourceSpan.end}this._peek.type===15&&(P=x=this._advance().sourceSpan.end);let U=M&&P&&new ne(C?.sourceSpan.start??M.start,P,C?.sourceSpan.fullStart??M.fullStart);return new Px(b,k,new ne(p.sourceSpan.start,x,p.sourceSpan.fullStart),p.sourceSpan,U,S.length>0?S:void 0,void 0)}_consumeBlockOpen(p){let b=[];for(;this._peek.type===28;){let M=this._advance();b.push(new cd(M.parts[0],M.sourceSpan))}this._peek.type===26&&this._advance();let x=this._peek.sourceSpan.fullStart,C=new ne(p.sourceSpan.start,x,p.sourceSpan.fullStart),k=new ne(p.sourceSpan.start,x,p.sourceSpan.fullStart),S=new pn(p.parts[0],b,[],C,p.sourceSpan,k);this._pushContainer(S,!1)}_consumeBlockClose(p){this._popContainer(null,pn,p.sourceSpan)||this.errors.push(We.create(null,p.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(p){let b=[];for(;this._peek.type===28;){let M=this._advance();b.push(new cd(M.parts[0],M.sourceSpan))}let x=this._peek.sourceSpan.fullStart,C=new ne(p.sourceSpan.start,x,p.sourceSpan.fullStart),k=new ne(p.sourceSpan.start,x,p.sourceSpan.fullStart),S=new pn(p.parts[0],b,[],C,p.sourceSpan,k);this._pushContainer(S,!1),this._popContainer(null,pn,null),this.errors.push(We.create(p.parts[0],C,`Incomplete block "${p.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(p){let b=p.parts[0],x,C;if(this._peek.type!==31){this.errors.push(We.create(p.parts[0],p.sourceSpan,`Invalid @let declaration "${b}". Declaration must have a value.`));return}else x=this._advance();if(this._peek.type!==32){this.errors.push(We.create(p.parts[0],p.sourceSpan,`Unterminated @let declaration "${b}". Declaration must be terminated with a semicolon.`));return}else C=this._advance();let k=C.sourceSpan.fullStart,S=new ne(p.sourceSpan.start,k,p.sourceSpan.fullStart),M=p.sourceSpan.toString().lastIndexOf(b),P=p.sourceSpan.start.moveBy(M),U=new ne(P,p.sourceSpan.end),V=new dd(b,x.parts[0],S,U,x.sourceSpan);this._addToParent(V)}_consumeIncompleteLet(p){let b=p.parts[0]??"",x=b?` "${b}"`:"";if(b.length>0){let C=p.sourceSpan.toString().lastIndexOf(b),k=p.sourceSpan.start.moveBy(C),S=new ne(k,p.sourceSpan.end),M=new ne(p.sourceSpan.start,p.sourceSpan.start.moveBy(0)),P=new dd(b,"",p.sourceSpan,S,M);this._addToParent(P)}this.errors.push(We.create(p.parts[0],p.sourceSpan,`Incomplete @let declaration${x}. @let declarations must be written as \`@let <name> = <value>;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let p=this._containerStack.length-1;p>-1;p--)if(this._containerStack[p]instanceof nr)return this._containerStack[p];return null}_addToParent(p){let b=this._getContainer();b===null?this.rootNodes.push(p):b.children.push(p)}_getElementFullName(p,b,x){if(p===""&&(p=this.getTagDefinition(b).implicitNamespacePrefix||"",p===""&&x!=null)){let C=io(x.name)[1];this.getTagDefinition(C).preventNamespaceInheritance||(p=ao(x.name))}return lo(p,b)}};function vd(u,p){return u.length>0&&u[u.length-1]===p}function wd(u,p){return po[p]!==void 0?po[p]||u:/^#x[a-f0-9]+$/i.test(p)?String.fromCodePoint(parseInt(p.slice(2),16)):/^#\d+$/.test(p)?String.fromCodePoint(parseInt(p.slice(1),10)):u}var l2=class extends i2{constructor(){super(fa)}parse(u,p,b,x=!1,C){return super.parse(u,p,b,x,C)}},ya=null,u2=()=>(ya||(ya=new l2),ya);function Dd(u,p={}){let{canSelfClose:b=!1,allowHtmComponentClosingTags:x=!1,isTagNameCaseSensitive:C=!1,getTagContentType:k,tokenizeAngularBlocks:S=!1,tokenizeAngularLetDeclaration:M=!1}=p;return u2().parse(u,"angular-html-parser",{tokenizeExpansionForms:S,interpolationConfig:void 0,canSelfClose:b,allowHtmComponentClosingTags:x,tokenizeBlocks:S,tokenizeLet:M},C,k)}function c2(u,p){let b=new SyntaxError(u+" ("+p.loc.start.line+":"+p.loc.start.column+")");return Object.assign(b,p)}var d2=c2,ts=3;function p2(u){let p=u.slice(0,ts);if(p!=="---"&&p!=="+++")return;let b=u.indexOf(`
|
|
40
|
+
`,ts);if(b===-1)return;let x=u.slice(ts,b).trim(),C=u.indexOf(`
|
|
41
|
+
${p}`,b),k=x;if(k||(k=p==="+++"?"toml":"yaml"),C===-1&&p==="---"&&k==="yaml"&&(C=u.indexOf(`
|
|
42
|
+
...`,b)),C===-1)return;let S=C+1+ts,M=u.charAt(S+1);if(!/\s?/u.test(M))return;let P=u.slice(0,S);return{type:"front-matter",language:k,explicitLanguage:x,value:u.slice(b+1,C),startDelimiter:p,endDelimiter:P.slice(-ts),raw:P}}function h2(u){let p=p2(u);if(!p)return{content:u};let{raw:b}=p;return{frontMatter:p,content:E(!1,b,/[^\n]/gu," ")+u.slice(b.length)}}var f2=h2,fo={attrs:!0,children:!0,cases:!0,expression:!0},Cd=new Set(["parent"]),fn,xa,va,m2=class us{constructor(p={}){y(this,fn),f(this,"type"),f(this,"parent");for(let b of new Set([...Cd,...Object.keys(p)]))this.setProperty(b,p[b])}setProperty(p,b){if(this[p]!==b){if(p in fo&&(b=b.map(x=>this.createChild(x))),!Cd.has(p)){this[p]=b;return}Object.defineProperty(this,p,{value:b,enumerable:!1,configurable:!0})}}map(p){let b;for(let x in fo){let C=this[x];if(C){let k=b2(C,S=>S.map(p));b!==C&&(b||(b=new us({parent:this.parent})),b.setProperty(x,k))}}if(b)for(let x in this)x in fo||(b[x]=this[x]);return p(b||this)}walk(p){for(let b in fo){let x=this[b];if(x)for(let C=0;C<x.length;C++)x[C].walk(p)}p(this)}createChild(p){let b=p instanceof us?p.clone():new us(p);return b.setProperty("parent",this),b}insertChildBefore(p,b){let x=this.$children;x.splice(x.indexOf(p),0,this.createChild(b))}removeChild(p){let b=this.$children;b.splice(b.indexOf(p),1)}replaceChild(p,b){let x=this.$children;x[x.indexOf(p)]=this.createChild(b)}clone(){return new us(this)}get $children(){return this[g(this,fn,xa)]}set $children(p){this[g(this,fn,xa)]=p}get firstChild(){var p;return(p=this.$children)==null?void 0:p[0]}get lastChild(){return $n(!0,this.$children,-1)}get prev(){let p=g(this,fn,va);return p[p.indexOf(this)-1]}get next(){let p=g(this,fn,va);return p[p.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(p=>[p.fullName,p.value]))}};fn=new WeakSet,xa=function(){return this.type==="angularIcuCase"?"expression":this.type==="angularIcuExpression"?"cases":"children"},va=function(){var u;return((u=this.parent)==null?void 0:u.$children)??[]};var g2=m2;function b2(u,p){let b=u.map(p);return b.some((x,C)=>x!==u[C])?b:u}var y2=[{regex:/^(\[if([^\]]*)\]>)(.*?)<!\s*\[endif\]$/su,parse:v2},{regex:/^\[if([^\]]*)\]><!$/u,parse:w2},{regex:/^<!\s*\[endif\]$/u,parse:D2}];function x2(u,p){if(u.value)for(let{regex:b,parse:x}of y2){let C=u.value.match(b);if(C)return x(u,p,C)}return null}function v2(u,p,b){let[,x,C,k]=b,S=4+x.length,M=u.sourceSpan.start.moveBy(S),P=M.moveBy(k.length),[U,V]=(()=>{try{return[!0,p(k,M).children]}catch{return[!1,[{type:"text",value:k,sourceSpan:new ne(M,P)}]]}})();return{type:"ieConditionalComment",complete:U,children:V,condition:E(!1,C.trim(),/\s+/gu," "),sourceSpan:u.sourceSpan,startSourceSpan:new ne(u.sourceSpan.start,M),endSourceSpan:new ne(P,u.sourceSpan.end)}}function w2(u,p,b){let[,x]=b;return{type:"ieConditionalStartComment",condition:E(!1,x.trim(),/\s+/gu," "),sourceSpan:u.sourceSpan}}function D2(u){return{type:"ieConditionalEndComment",sourceSpan:u.sourceSpan}}var wa=new Map([["*",new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alt","autocomplete","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]),C2=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);function k2(u){if(u.type==="block"){if(u.name=E(!1,u.name.toLowerCase(),/\s+/gu," ").trim(),u.type="angularControlFlowBlock",!Xi(u.parameters)){delete u.parameters;return}for(let p of u.parameters)p.type="angularControlFlowBlockParameter";u.parameters={type:"angularControlFlowBlockParameters",children:u.parameters,sourceSpan:new ne(u.parameters[0].sourceSpan.start,$n(!1,u.parameters,-1).sourceSpan.end)}}}function E2(u){u.type==="letDeclaration"&&(u.type="angularLetDeclaration",u.id=u.name,u.init={type:"angularLetDeclarationInitializer",sourceSpan:new ne(u.valueSpan.start,u.valueSpan.end),value:u.value},delete u.name,delete u.value)}function S2(u){(u.type==="plural"||u.type==="select")&&(u.clause=u.type,u.type="angularIcuExpression"),u.type==="expansionCase"&&(u.type="angularIcuCase")}function kd(u,p,b){let{name:x,canSelfClose:C=!0,normalizeTagName:k=!1,normalizeAttributeName:S=!1,allowHtmComponentClosingTags:M=!1,isTagNameCaseSensitive:P=!1,shouldParseAsRawText:U}=p,{rootNodes:V,errors:ie}=Dd(u,{canSelfClose:C,allowHtmComponentClosingTags:M,isTagNameCaseSensitive:P,getTagContentType:U?(...W)=>U(...W)?yt.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:x==="angular"?!0:void 0,tokenizeAngularLetDeclaration:x==="angular"?!0:void 0});if(x==="vue"){if(V.some(we=>we.type==="docType"&&we.value==="html"||we.type==="element"&&we.name.toLowerCase()==="html"))return kd(u,Da,b);let W,oe=()=>W??(W=Dd(u,{canSelfClose:C,allowHtmComponentClosingTags:M,isTagNameCaseSensitive:P})),Se=we=>oe().rootNodes.find(({startSourceSpan:Ue})=>Ue&&Ue.start.offset===we.startSourceSpan.start.offset)??we;for(let[we,Ue]of V.entries()){let{endSourceSpan:mn,startSourceSpan:L2}=Ue;if(mn===null)ie=oe().errors,V[we]=Se(Ue);else if(F2(Ue,b)){let Fd=oe().errors.find(Ad=>Ad.span.start.offset>L2.start.offset&&Ad.span.start.offset<mn.end.offset);Fd&&Ed(Fd),V[we]=Se(Ue)}}}ie.length>0&&Ed(ie[0]);let ee=W=>{let oe=W.name.startsWith(":")?W.name.slice(1).split(":")[0]:null,Se=W.nameSpan.toString(),we=oe!==null&&Se.startsWith(`${oe}:`),Ue=we?Se.slice(oe.length+1):Se;W.name=Ue,W.namespace=oe,W.hasExplicitNamespace=we},se=W=>{switch(W.type){case"element":ee(W);for(let oe of W.attrs)ee(oe),oe.valueSpan?(oe.value=oe.valueSpan.toString(),/["']/u.test(oe.value[0])&&(oe.value=oe.value.slice(1,-1))):oe.value=null;break;case"comment":W.value=W.sourceSpan.toString().slice(4,-3);break;case"text":W.value=W.sourceSpan.toString();break}},ce=(W,oe)=>{let Se=W.toLowerCase();return oe(Se)?Se:W},Ee=W=>{if(W.type==="element"&&(k&&(!W.namespace||W.namespace===W.tagDefinition.implicitNamespacePrefix||Vn(W))&&(W.name=ce(W.name,oe=>C2.has(oe))),S))for(let oe of W.attrs)oe.namespace||(oe.name=ce(oe.name,Se=>wa.has(W.name)&&(wa.get("*").has(Se)||wa.get(W.name).has(Se))))},Oe=W=>{W.sourceSpan&&W.endSourceSpan&&(W.sourceSpan=new ne(W.sourceSpan.start,W.endSourceSpan.end))},$e=W=>{if(W.type==="element"){let oe=fa(P?W.name:W.name.toLowerCase());!W.namespace||W.namespace===oe.implicitNamespacePrefix||Vn(W)?W.tagDefinition=oe:W.tagDefinition=fa("")}};return pd(new class extends Hx{visitExpansionCase(W,oe){x==="angular"&&this.visitChildren(oe,Se=>{Se(W.expression)})}visit(W){se(W),$e(W),Ee(W),Oe(W)}},V),V}function F2(u,p){var b;if(u.type!=="element"||u.name!=="template")return!1;let x=(b=u.attrs.find(C=>C.name==="lang"))==null?void 0:b.value;return!x||Gs(p,{language:x})==="html"}function Ed(u){let{msg:p,span:{start:b,end:x}}=u;throw d2(p,{loc:{start:{line:b.line+1,column:b.col+1},end:{line:x.line+1,column:x.col+1}},cause:u})}function Sd(u,p,b={},x=!0){let{frontMatter:C,content:k}=x?f2(u):{frontMatter:null,content:u},S=new Kc(u,b.filepath),M=new ha(S,0,0,0),P=M.moveBy(u.length),U={type:"root",sourceSpan:new ne(M,P),children:kd(k,p,b)};if(C){let ee=new ha(S,0,0,0),se=ee.moveBy(C.raw.length);C.sourceSpan=new ne(ee,se),U.children.unshift(C)}let V=new g2(U),ie=(ee,se)=>{let{offset:ce}=se,Ee=E(!1,u.slice(0,ce),/[^\n\r]/gu," "),Oe=Sd(Ee+ee,p,b,!1);Oe.sourceSpan=new ne(se,$n(!1,Oe.children,-1).sourceSpan.end);let $e=Oe.children[0];return $e.length===ce?Oe.children.shift():($e.sourceSpan=new ne($e.sourceSpan.start.moveBy(ce),$e.sourceSpan.end),$e.value=$e.value.slice(ce)),Oe};return V.walk(ee=>{if(ee.type==="comment"){let se=x2(ee,ie);se&&ee.parent.replaceChild(ee,se)}k2(ee),E2(ee),S2(ee)}),V}function rs(u){return{parse:(p,b)=>Sd(p,u,b),hasPragma:Jy,hasIgnorePragma:Ky,astFormat:"html",locStart:Wn,locEnd:Zs}}var Da={name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0},A2=rs(Da),N2=new Set(["mj-style","mj-raw"]),T2=rs({...Da,name:"mjml",shouldParseAsRawText:u=>N2.has(u)}),M2=rs({name:"angular"}),B2=rs({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(u,p,b,x){return u.toLowerCase()!=="html"&&!b&&(u!=="template"||x.some(({name:C,value:k})=>C==="lang"&&k!=="html"&&k!==""&&k!==void 0))}}),j2=rs({name:"lwc",canSelfClose:!1}),O2={html:Dx};return d(w)})})(Gh);var ef=Gh.exports;const g1=Kh(ef),b1=V2({__proto__:null,default:g1},[ef]);var y1=Object.create,eu=Object.defineProperty,x1=Object.getOwnPropertyDescriptor,v1=Object.getOwnPropertyNames,w1=Object.getPrototypeOf,D1=Object.prototype.hasOwnProperty,tf=t=>{throw TypeError(t)},C1=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),tu=(t,e)=>{for(var r in e)eu(t,r,{get:e[r],enumerable:!0})},k1=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of v1(e))!D1.call(t,s)&&s!==r&&eu(t,s,{get:()=>e[s],enumerable:!(n=x1(e,s))||n.enumerable});return t},E1=(t,e,r)=>(r=t!=null?y1(w1(t)):{},k1(eu(r,"default",{value:t,enumerable:!0}),t)),S1=(t,e,r)=>e.has(t)||tf("Cannot "+r),F1=(t,e,r)=>e.has(t)?tf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ss=(t,e,r)=>(S1(t,e,"access private method"),r),A1=C1(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(){return new Proxy({},{get:()=>o=>o})}var r=/\r\n|[\n\r\u2028\u2029]/;function n(o,i,a){let l=Object.assign({column:0,line:-1},o.start),c=Object.assign({},l,o.end),{linesAbove:d=2,linesBelow:f=3}=a||{},m=l.line,g=l.column,y=c.line,v=c.column,w=Math.max(m-(d+1),0),D=Math.min(i.length,y+f);m===-1&&(w=0),y===-1&&(D=i.length);let E=y-m,N={};if(E)for(let A=0;A<=E;A++){let T=A+m;if(!g)N[T]=!0;else if(A===0){let j=i[T-1].length;N[T]=[g,j-g+1]}else if(A===E)N[T]=[0,v];else{let j=i[T-A].length;N[T]=[0,j]}}else g===v?g?N[m]=[g,0]:N[m]=!0:N[m]=[g,v-g];return{start:w,end:D,markerLines:N}}function s(o,i,a={}){let l=e(),c=o.split(r),{start:d,end:f,markerLines:m}=n(i,c,a),g=i.start&&typeof i.start.column=="number",y=String(f).length,v=o.split(r,f).slice(d,f).map((w,D)=>{let E=d+1+D,N=` ${` ${E}`.slice(-y)} |`,A=m[E],T=!m[E+1];if(A){let j="";if(Array.isArray(A)){let B=w.slice(0,Math.max(A[0]-1,0)).replace(/[^\t]/g," "),$=A[1]||1;j=[`
|
|
43
|
+
`,l.gutter(N.replace(/\d/g," "))," ",B,l.marker("^").repeat($)].join(""),T&&a.message&&(j+=" "+l.message(a.message))}return[l.marker(">"),l.gutter(N),w.length>0?` ${w}`:"",j].join("")}else return` ${l.gutter(N)}${w.length>0?` ${w}`:""}`}).join(`
|
|
44
|
+
`);return a.message&&!g&&(v=`${" ".repeat(y+1)}${a.message}
|
|
45
|
+
${v}`),v}t.codeFrameColumns=s}),N1={};tu(N1,{__debug:()=>HD,check:()=>zD,doc:()=>Pf,format:()=>gu,formatWithCursor:()=>$f,getSupportInfo:()=>$D,util:()=>zf,version:()=>fD});var T1=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},Ai=T1,M1=class{diff(t,e,r={}){let n;typeof r=="function"?(n=r,r={}):"callback"in r&&(n=r.callback);let s=this.castInput(t,r),o=this.castInput(e,r),i=this.removeEmpty(this.tokenize(s,r)),a=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(i,a,r,n)}diffWithOptionsObj(t,e,r,n){var s;let o=D=>{if(D=this.postProcess(D,r),n){setTimeout(function(){n(D)},0);return}else return D},i=e.length,a=t.length,l=1,c=i+a;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));let d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(m[0],e,t,0,r);if(m[0].oldPos+1>=a&&g+1>=i)return o(this.buildValues(m[0].lastComponent,e,t));let y=-1/0,v=1/0,w=()=>{for(let D=Math.max(y,-l);D<=Math.min(v,l);D+=2){let E,N=m[D-1],A=m[D+1];N&&(m[D-1]=void 0);let T=!1;if(A){let B=A.oldPos-D;T=A&&0<=B&&B<i}let j=N&&N.oldPos+1<a;if(!T&&!j){m[D]=void 0;continue}if(!j||T&&N.oldPos<A.oldPos?E=this.addToPath(A,!0,!1,0,r):E=this.addToPath(N,!1,!0,1,r),g=this.extractCommon(E,e,t,D,r),E.oldPos+1>=a&&g+1>=i)return o(this.buildValues(E.lastComponent,e,t))||!0;m[D]=E,E.oldPos+1>=a&&(v=Math.min(v,D-1)),g+1>=i&&(y=Math.max(y,D+1))}l++};if(n)(function D(){setTimeout(function(){if(l>c||Date.now()>f)return n(void 0);w()||D()},0)})();else for(;l<=c&&Date.now()<=f;){let D=w();if(D)return D}}addToPath(t,e,r,n,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===e&&o.removed===r?{oldPos:t.oldPos+n,lastComponent:{count:o.count+1,added:e,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+n,lastComponent:{count:1,added:e,removed:r,previousComponent:o}}}extractCommon(t,e,r,n,s){let o=e.length,i=r.length,a=t.oldPos,l=a-n,c=0;for(;l+1<o&&a+1<i&&this.equals(r[a+1],e[l+1],s);)l++,a++,c++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(t.lastComponent={count:c,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=a,l}equals(t,e,r){return r.comparator?r.comparator(t,e):t===e||!!r.ignoreCase&&t.toLowerCase()===e.toLowerCase()}removeEmpty(t){let e=[];for(let r=0;r<t.length;r++)t[r]&&e.push(t[r]);return e}castInput(t,e){return t}tokenize(t,e){return Array.from(t)}join(t){return t.join("")}postProcess(t,e){return t}get useLongestToken(){return!1}buildValues(t,e,r){let n=[],s;for(;t;)n.push(t),s=t.previousComponent,delete t.previousComponent,t=s;n.reverse();let o=n.length,i=0,a=0,l=0;for(;i<o;i++){let c=n[i];if(c.removed)c.value=this.join(r.slice(l,l+c.count)),l+=c.count;else{if(!c.added&&this.useLongestToken){let d=e.slice(a,a+c.count);d=d.map(function(f,m){let g=r[l+m];return g.length>f.length?g:f}),c.value=this.join(d)}else c.value=this.join(e.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}return n}},B1=class extends M1{tokenize(t){return t.slice()}join(t){return t}removeEmpty(t){return t}},j1=new B1;function O1(t,e,r){return j1.diff(t,e,r)}function L1(t){let e=t.indexOf("\r");return e!==-1?t.charAt(e+1)===`
|
|
46
|
+
`?"crlf":"cr":"lf"}function ru(t){switch(t){case"cr":return"\r";case"crlf":return`\r
|
|
29
47
|
`;default:return`
|
|
30
|
-
`}}function
|
|
31
|
-
`:
|
|
32
|
-
`:
|
|
33
|
-
`)}var
|
|
34
|
-
`);)
|
|
35
|
-
Expected it to be 'string' or 'object'.`;if(
|
|
36
|
-
Expected it to be ${
|
|
37
|
-
`)):a)}function zp(e){if(e.type===le)return!0}function $p(e){return Rn(e,zp,!1)}function wr(e,r){return e.type===Ae?{...e,contents:r(e.contents)}:r(e)}var Hp=()=>{},qp=Hp;function Er(e){return{type:Te,contents:e}}function wt(e,r){return{type:Le,contents:r,n:e}}function No(e,r={}){return qp(r.expandedStates),{type:me,id:r.id,contents:e,break:!!r.shouldBreak,expandedStates:r.expandedStates}}function Up(e){return wt(Number.NEGATIVE_INFINITY,e)}function Wp(e){return wt({type:"root"},e)}function Vp(e){return wt(-1,e)}function Jp(e,r){return No(e[0],{...r,expandedStates:e})}function Gp(e){return{type:ke,parts:e}}function Kp(e,r="",a={}){return{type:fe,breakContents:e,flatContents:r,groupId:a.groupId}}function Yp(e,r){return{type:Ie,contents:e,groupId:r.groupId,negate:r.negate}}function yn(e){return{type:Oe,contents:e}}var Xp={type:Me},Nr={type:be},Zp={type:Pe},zn={type:le,hard:!0},jo={type:le,hard:!0,literal:!0},_o={type:le},Qp={type:le,soft:!0},ot=[zn,Nr],Bo=[jo,Nr],st={type:Ye};function To(e,r){let a=[];for(let s=0;s<r.length;s++)s!==0&&a.push(e),a.push(r[s]);return a}function Lo(e,r,a){let s=e;if(r>0){for(let i=0;i<Math.floor(r/a);++i)s=Er(s);s=wt(r%a,s),s=wt(Number.NEGATIVE_INFINITY,s)}return s}function eh(e,r){return e?{type:Ae,label:e,contents:r}:r}function _e(e){var r;if(!e)return"";if(Array.isArray(e)){let a=[];for(let s of e)if(Array.isArray(s))a.push(..._e(s));else{let i=_e(s);i!==""&&a.push(i)}return a}return e.type===fe?{...e,breakContents:_e(e.breakContents),flatContents:_e(e.flatContents)}:e.type===me?{...e,contents:_e(e.contents),expandedStates:(r=e.expandedStates)==null?void 0:r.map(_e)}:e.type===ke?{type:"fill",parts:e.parts.map(_e)}:e.contents?{...e,contents:_e(e.contents)}:e}function th(e){let r=Object.create(null),a=new Set;return s(_e(e));function s(u,d,p){var f,h;if(typeof u=="string")return JSON.stringify(u);if(Array.isArray(u)){let g=u.map(s).filter(Boolean);return g.length===1?g[0]:`[${g.join(", ")}]`}if(u.type===le){let g=((f=p?.[d+1])==null?void 0:f.type)===be;return u.literal?g?"literalline":"literallineWithoutBreakParent":u.hard?g?"hardline":"hardlineWithoutBreakParent":u.soft?"softline":"line"}if(u.type===be)return((h=p?.[d-1])==null?void 0:h.type)===le&&p[d-1].hard?void 0:"breakParent";if(u.type===Pe)return"trim";if(u.type===Te)return"indent("+s(u.contents)+")";if(u.type===Le)return u.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+s(u.contents)+")":u.n<0?"dedent("+s(u.contents)+")":u.n.type==="root"?"markAsRoot("+s(u.contents)+")":"align("+JSON.stringify(u.n)+", "+s(u.contents)+")";if(u.type===fe)return"ifBreak("+s(u.breakContents)+(u.flatContents?", "+s(u.flatContents):"")+(u.groupId?(u.flatContents?"":', ""')+`, { groupId: ${i(u.groupId)} }`:"")+")";if(u.type===Ie){let g=[];u.negate&&g.push("negate: true"),u.groupId&&g.push(`groupId: ${i(u.groupId)}`);let w=g.length>0?`, { ${g.join(", ")} }`:"";return`indentIfBreak(${s(u.contents)}${w})`}if(u.type===me){let g=[];u.break&&u.break!=="propagated"&&g.push("shouldBreak: true"),u.id&&g.push(`id: ${i(u.id)}`);let w=g.length>0?`, { ${g.join(", ")} }`:"";return u.expandedStates?`conditionalGroup([${u.expandedStates.map(D=>s(D)).join(",")}]${w})`:`group(${s(u.contents)}${w})`}if(u.type===ke)return`fill([${u.parts.map(g=>s(g)).join(", ")}])`;if(u.type===Oe)return"lineSuffix("+s(u.contents)+")";if(u.type===Me)return"lineSuffixBoundary";if(u.type===Ae)return`label(${JSON.stringify(u.label)}, ${s(u.contents)})`;if(u.type===Ye)return"cursor";throw new Error("Unknown doc type "+u.type)}function i(u){if(typeof u!="symbol")return JSON.stringify(String(u));if(u in r)return r[u];let d=u.description||"symbol";for(let p=0;;p++){let f=d+(p>0?` #${p}`:"");if(!a.has(f))return a.add(f),r[u]=`Symbol.for(${JSON.stringify(f)})`}}}var rh=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function nh(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function ah(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var sh=e=>!(nh(e)||ah(e)),oh=/[^\x20-\x7F]/u;function ih(e){if(!e)return 0;if(!oh.test(e))return e.length;e=e.replace(rh()," ");let r=0;for(let a of e){let s=a.codePointAt(0);s<=31||s>=127&&s<=159||s>=768&&s<=879||(r+=sh(s)?1:2)}return r}var $n=ih,he=Symbol("MODE_BREAK"),Ee=Symbol("MODE_FLAT"),Dt=Symbol("cursor"),vn=Symbol("DOC_FILL_PRINTED_LENGTH");function Po(){return{value:"",length:0,queue:[]}}function lh(e,r){return wn(e,{type:"indent"},r)}function uh(e,r,a){return r===Number.NEGATIVE_INFINITY?e.root||Po():r<0?wn(e,{type:"dedent"},a):r?r.type==="root"?{...e,root:e}:wn(e,{type:typeof r=="string"?"stringAlign":"numberAlign",n:r},a):e}function wn(e,r,a){let s=r.type==="dedent"?e.queue.slice(0,-1):[...e.queue,r],i="",u=0,d=0,p=0;for(let v of s)switch(v.type){case"indent":g(),a.useTabs?f(1):h(a.tabWidth);break;case"stringAlign":g(),i+=v.n,u+=v.n.length;break;case"numberAlign":d+=1,p+=v.n;break;default:throw new Error(`Unexpected type '${v.type}'`)}return D(),{...e,value:i,length:u,queue:s};function f(v){i+=" ".repeat(v),u+=a.tabWidth*v}function h(v){i+=" ".repeat(v),u+=v}function g(){a.useTabs?w():D()}function w(){d>0&&f(d),y()}function D(){p>0&&h(p),y()}function y(){d=0,p=0}}function Cn(e){let r=0,a=0,s=e.length;e:for(;s--;){let i=e[s];if(i===Dt){a++;continue}for(let u=i.length-1;u>=0;u--){let d=i[u];if(d===" "||d===" ")r++;else{e[s]=i.slice(0,u+1);break e}}}if(r>0||a>0)for(e.length=s+1;a-- >0;)e.push(Dt);return r}function yr(e,r,a,s,i,u){if(a===Number.POSITIVE_INFINITY)return!0;let d=r.length,p=[e],f=[];for(;a>=0;){if(p.length===0){if(d===0)return!0;p.push(r[--d]);continue}let{mode:h,doc:g}=p.pop(),w=ut(g);switch(w){case lt:f.push(g),a-=$n(g);break;case Be:case ke:{let D=w===Be?g:g.parts,y=g[vn]??0;for(let v=D.length-1;v>=y;v--)p.push({mode:h,doc:D[v]});break}case Te:case Le:case Ie:case Ae:p.push({mode:h,doc:g.contents});break;case Pe:a+=Cn(f);break;case me:{if(u&&g.break)return!1;let D=g.break?he:h,y=g.expandedStates&&D===he?se(!1,g.expandedStates,-1):g.contents;p.push({mode:D,doc:y});break}case fe:{let D=(g.groupId?i[g.groupId]||Ee:h)===he?g.breakContents:g.flatContents;D&&p.push({mode:h,doc:D});break}case le:if(h===he||g.hard)return!0;g.soft||(f.push(" "),a--);break;case Oe:s=!0;break;case Me:if(s)return!1;break}}return!1}function jr(e,r){let a={},s=r.printWidth,i=On(r.endOfLine),u=0,d=[{ind:Po(),mode:he,doc:e}],p=[],f=!1,h=[],g=0;for(Lp(e);d.length>0;){let{ind:D,mode:y,doc:v}=d.pop();switch(ut(v)){case lt:{let E=i!==`
|
|
38
|
-
`?
|
|
39
|
-
`,
|
|
40
|
-
`)return
|
|
41
|
-
`||
|
|
42
|
-
`)return
|
|
43
|
-
`||
|
|
44
|
-
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:
|
|
48
|
+
`}}function rf(t,e){let r;switch(e){case`
|
|
49
|
+
`:r=/\n/gu;break;case"\r":r=/\r/gu;break;case`\r
|
|
50
|
+
`:r=/\r\n/gu;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(e)}.`)}let n=t.match(r);return n?n.length:0}function _1(t){return Ai(!1,t,/\r\n?/gu,`
|
|
51
|
+
`)}var nn="string",Kt="array",kr="cursor",Gt="indent",Yt="align",Xt="trim",et="group",Ot="fill",nt="if-break",Qt="indent-if-break",Zt="line-suffix",er="line-suffix-boundary",Pe="line",Lt="label",ht="break-parent",nf=new Set([kr,Gt,Yt,Xt,et,Ot,nt,Qt,Zt,er,Pe,Lt,ht]),I1=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},Ae=I1;function R1(t){let e=t.length;for(;e>0&&(t[e-1]==="\r"||t[e-1]===`
|
|
52
|
+
`);)e--;return e<t.length?t.slice(0,e):t}function P1(t){if(typeof t=="string")return nn;if(Array.isArray(t))return Kt;if(!t)return;let{type:e}=t;if(nf.has(e))return e}var sn=P1,z1=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function $1(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
|
|
53
|
+
Expected it to be 'string' or 'object'.`;if(sn(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=z1([...nf].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'.
|
|
54
|
+
Expected it to be ${n}.`}var H1=class extends Error{constructor(e){super($1(e));kt(this,"name","InvalidDocError");this.doc=e}},Fn=H1,Td={};function V1(t,e,r,n){let s=[t];for(;s.length>0;){let o=s.pop();if(o===Td){r(s.pop());continue}r&&s.push(o,Td);let i=sn(o);if(!i)throw new Fn(o);if(e?.(o)!==!1)switch(i){case Kt:case Ot:{let a=i===Kt?o:o.parts;for(let l=a.length,c=l-1;c>=0;--c)s.push(a[c]);break}case nt:s.push(o.flatContents,o.breakContents);break;case et:if(n&&o.expandedStates)for(let a=o.expandedStates.length,l=a-1;l>=0;--l)s.push(o.expandedStates[l]);else s.push(o.contents);break;case Yt:case Gt:case Qt:case Lt:case Zt:s.push(o.contents);break;case nn:case kr:case Xt:case er:case Pe:case ht:break;default:throw new Fn(o)}}}var nu=V1;function Ni(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(o){if(r.has(o))return r.get(o);let i=s(o);return r.set(o,i),i}function s(o){switch(sn(o)){case Kt:return e(o.map(n));case Ot:return e({...o,parts:o.parts.map(n)});case nt:return e({...o,breakContents:n(o.breakContents),flatContents:n(o.flatContents)});case et:{let{expandedStates:i,contents:a}=o;return i?(i=i.map(n),a=i[0]):a=n(a),e({...o,contents:a,expandedStates:i})}case Yt:case Gt:case Qt:case Lt:case Zt:return e({...o,contents:n(o.contents)});case nn:case kr:case Xt:case er:case Pe:case ht:return e(o);default:throw new Fn(o)}}}function su(t,e,r){let n=r,s=!1;function o(i){if(s)return!1;let a=e(i);a!==void 0&&(s=!0,n=a)}return nu(t,o),n}function q1(t){if(t.type===et&&t.break||t.type===Pe&&t.hard||t.type===ht)return!0}function W1(t){return su(t,q1,!1)}function Md(t){if(t.length>0){let e=Ae(!1,t,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function U1(t){let e=new Set,r=[];function n(o){if(o.type===ht&&Md(r),o.type===et){if(r.push(o),e.has(o))return!1;e.add(o)}}function s(o){o.type===et&&r.pop().break&&Md(r)}nu(t,n,s,!0)}function J1(t){return t.type===Pe&&!t.hard?t.soft?"":" ":t.type===nt?t.flatContents:t}function K1(t){return Ni(t,J1)}function Bd(t){for(t=[...t];t.length>=2&&Ae(!1,t,-2).type===Pe&&Ae(!1,t,-1).type===ht;)t.length-=2;if(t.length>0){let e=fs(Ae(!1,t,-1));t[t.length-1]=e}return t}function fs(t){switch(sn(t)){case Gt:case Qt:case et:case Zt:case Lt:{let e=fs(t.contents);return{...t,contents:e}}case nt:return{...t,breakContents:fs(t.breakContents),flatContents:fs(t.flatContents)};case Ot:return{...t,parts:Bd(t.parts)};case Kt:return Bd(t);case nn:return R1(t);case Yt:case kr:case Xt:case er:case Pe:case ht:break;default:throw new Fn(t)}return t}function sf(t){return fs(Y1(t))}function G1(t){switch(sn(t)){case Ot:if(t.parts.every(e=>e===""))return"";break;case et:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===et&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case Yt:case Gt:case Qt:case Zt:if(!t.contents)return"";break;case nt:if(!t.flatContents&&!t.breakContents)return"";break;case Kt:{let e=[];for(let r of t){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof Ae(!1,e,-1)=="string"?e[e.length-1]+=n:e.push(n),e.push(...s)}return e.length===0?"":e.length===1?e[0]:e}case nn:case kr:case Xt:case er:case Pe:case Lt:case ht:break;default:throw new Fn(t)}return t}function Y1(t){return Ni(t,e=>G1(e))}function X1(t,e=uf){return Ni(t,r=>typeof r=="string"?cf(e,r.split(`
|
|
55
|
+
`)):r)}function Q1(t){if(t.type===Pe)return!0}function Z1(t){return su(t,Q1,!1)}function Ao(t,e){return t.type===Lt?{...t,contents:e(t.contents)}:e(t)}var ev=()=>{},tv=ev;function _o(t){return{type:Gt,contents:t}}function An(t,e){return{type:Yt,contents:e,n:t}}function of(t,e={}){return tv(e.expandedStates),{type:et,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function rv(t){return An(Number.NEGATIVE_INFINITY,t)}function nv(t){return An({type:"root"},t)}function sv(t){return An(-1,t)}function ov(t,e){return of(t[0],{...e,expandedStates:t})}function iv(t){return{type:Ot,parts:t}}function av(t,e="",r={}){return{type:nt,breakContents:t,flatContents:e,groupId:r.groupId}}function lv(t,e){return{type:Qt,contents:t,groupId:e.groupId,negate:e.negate}}function ul(t){return{type:Zt,contents:t}}var uv={type:er},Ti={type:ht},cv={type:Xt},ou={type:Pe,hard:!0},af={type:Pe,hard:!0,literal:!0},lf={type:Pe},dv={type:Pe,soft:!0},Wr=[ou,Ti],uf=[af,Ti],zr={type:kr};function cf(t,e){let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}function df(t,e,r){let n=t;if(e>0){for(let s=0;s<Math.floor(e/r);++s)n=_o(n);n=An(e%r,n),n=An(Number.NEGATIVE_INFINITY,n)}return n}function pv(t,e){return t?{type:Lt,label:t,contents:e}:e}function Ht(t){var e;if(!t)return"";if(Array.isArray(t)){let r=[];for(let n of t)if(Array.isArray(n))r.push(...Ht(n));else{let s=Ht(n);s!==""&&r.push(s)}return r}return t.type===nt?{...t,breakContents:Ht(t.breakContents),flatContents:Ht(t.flatContents)}:t.type===et?{...t,contents:Ht(t.contents),expandedStates:(e=t.expandedStates)==null?void 0:e.map(Ht)}:t.type===Ot?{type:"fill",parts:t.parts.map(Ht)}:t.contents?{...t,contents:Ht(t.contents)}:t}function hv(t){let e=Object.create(null),r=new Set;return n(Ht(t));function n(o,i,a){var l,c;if(typeof o=="string")return JSON.stringify(o);if(Array.isArray(o)){let d=o.map(n).filter(Boolean);return d.length===1?d[0]:`[${d.join(", ")}]`}if(o.type===Pe){let d=((l=a?.[i+1])==null?void 0:l.type)===ht;return o.literal?d?"literalline":"literallineWithoutBreakParent":o.hard?d?"hardline":"hardlineWithoutBreakParent":o.soft?"softline":"line"}if(o.type===ht)return((c=a?.[i-1])==null?void 0:c.type)===Pe&&a[i-1].hard?void 0:"breakParent";if(o.type===Xt)return"trim";if(o.type===Gt)return"indent("+n(o.contents)+")";if(o.type===Yt)return o.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+n(o.contents)+")":o.n<0?"dedent("+n(o.contents)+")":o.n.type==="root"?"markAsRoot("+n(o.contents)+")":"align("+JSON.stringify(o.n)+", "+n(o.contents)+")";if(o.type===nt)return"ifBreak("+n(o.breakContents)+(o.flatContents?", "+n(o.flatContents):"")+(o.groupId?(o.flatContents?"":', ""')+`, { groupId: ${s(o.groupId)} }`:"")+")";if(o.type===Qt){let d=[];o.negate&&d.push("negate: true"),o.groupId&&d.push(`groupId: ${s(o.groupId)}`);let f=d.length>0?`, { ${d.join(", ")} }`:"";return`indentIfBreak(${n(o.contents)}${f})`}if(o.type===et){let d=[];o.break&&o.break!=="propagated"&&d.push("shouldBreak: true"),o.id&&d.push(`id: ${s(o.id)}`);let f=d.length>0?`, { ${d.join(", ")} }`:"";return o.expandedStates?`conditionalGroup([${o.expandedStates.map(m=>n(m)).join(",")}]${f})`:`group(${n(o.contents)}${f})`}if(o.type===Ot)return`fill([${o.parts.map(d=>n(d)).join(", ")}])`;if(o.type===Zt)return"lineSuffix("+n(o.contents)+")";if(o.type===er)return"lineSuffixBoundary";if(o.type===Lt)return`label(${JSON.stringify(o.label)}, ${n(o.contents)})`;if(o.type===kr)return"cursor";throw new Error("Unknown doc type "+o.type)}function s(o){if(typeof o!="symbol")return JSON.stringify(String(o));if(o in e)return e[o];let i=o.description||"symbol";for(let a=0;;a++){let l=i+(a>0?` #${a}`:"");if(!r.has(l))return r.add(l),e[o]=`Symbol.for(${JSON.stringify(l)})`}}}var fv=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function mv(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function gv(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}var bv=t=>!(mv(t)||gv(t)),yv=/[^\x20-\x7F]/u;function xv(t){if(!t)return 0;if(!yv.test(t))return t.length;t=t.replace(fv()," ");let e=0;for(let r of t){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||(e+=bv(n)?1:2)}return e}var iu=xv,Xe=Symbol("MODE_BREAK"),St=Symbol("MODE_FLAT"),Dn=Symbol("cursor"),cl=Symbol("DOC_FILL_PRINTED_LENGTH");function pf(){return{value:"",length:0,queue:[]}}function vv(t,e){return dl(t,{type:"indent"},e)}function wv(t,e,r){return e===Number.NEGATIVE_INFINITY?t.root||pf():e<0?dl(t,{type:"dedent"},r):e?e.type==="root"?{...t,root:t}:dl(t,{type:typeof e=="string"?"stringAlign":"numberAlign",n:e},r):t}function dl(t,e,r){let n=e.type==="dedent"?t.queue.slice(0,-1):[...t.queue,e],s="",o=0,i=0,a=0;for(let y of n)switch(y.type){case"indent":d(),r.useTabs?l(1):c(r.tabWidth);break;case"stringAlign":d(),s+=y.n,o+=y.n.length;break;case"numberAlign":i+=1,a+=y.n;break;default:throw new Error(`Unexpected type '${y.type}'`)}return m(),{...t,value:s,length:o,queue:n};function l(y){s+=" ".repeat(y),o+=r.tabWidth*y}function c(y){s+=" ".repeat(y),o+=y}function d(){r.useTabs?f():m()}function f(){i>0&&l(i),g()}function m(){a>0&&c(a),g()}function g(){i=0,a=0}}function pl(t){let e=0,r=0,n=t.length;e:for(;n--;){let s=t[n];if(s===Dn){r++;continue}for(let o=s.length-1;o>=0;o--){let i=s[o];if(i===" "||i===" ")e++;else{t[n]=s.slice(0,o+1);break e}}}if(e>0||r>0)for(t.length=n+1;r-- >0;)t.push(Dn);return e}function mo(t,e,r,n,s,o){if(r===Number.POSITIVE_INFINITY)return!0;let i=e.length,a=[t],l=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(e[--i]);continue}let{mode:c,doc:d}=a.pop(),f=sn(d);switch(f){case nn:l.push(d),r-=iu(d);break;case Kt:case Ot:{let m=f===Kt?d:d.parts,g=d[cl]??0;for(let y=m.length-1;y>=g;y--)a.push({mode:c,doc:m[y]});break}case Gt:case Yt:case Qt:case Lt:a.push({mode:c,doc:d.contents});break;case Xt:r+=pl(l);break;case et:{if(o&&d.break)return!1;let m=d.break?Xe:c,g=d.expandedStates&&m===Xe?Ae(!1,d.expandedStates,-1):d.contents;a.push({mode:m,doc:g});break}case nt:{let m=(d.groupId?s[d.groupId]||St:c)===Xe?d.breakContents:d.flatContents;m&&a.push({mode:c,doc:m});break}case Pe:if(c===Xe||d.hard)return!0;d.soft||(l.push(" "),r--);break;case Zt:n=!0;break;case er:if(n)return!1;break}}return!1}function Mi(t,e){let r={},n=e.printWidth,s=ru(e.endOfLine),o=0,i=[{ind:pf(),mode:Xe,doc:t}],a=[],l=!1,c=[],d=0;for(U1(t);i.length>0;){let{ind:m,mode:g,doc:y}=i.pop();switch(sn(y)){case nn:{let v=s!==`
|
|
56
|
+
`?Ai(!1,y,`
|
|
57
|
+
`,s):y;a.push(v),i.length>0&&(o+=iu(v));break}case Kt:for(let v=y.length-1;v>=0;v--)i.push({ind:m,mode:g,doc:y[v]});break;case kr:if(d>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Dn),d++;break;case Gt:i.push({ind:vv(m,e),mode:g,doc:y.contents});break;case Yt:i.push({ind:wv(m,y.n,e),mode:g,doc:y.contents});break;case Xt:o-=pl(a);break;case et:switch(g){case St:if(!l){i.push({ind:m,mode:y.break?Xe:St,doc:y.contents});break}case Xe:{l=!1;let v={ind:m,mode:St,doc:y.contents},w=n-o,D=c.length>0;if(!y.break&&mo(v,i,w,D,r))i.push(v);else if(y.expandedStates){let E=Ae(!1,y.expandedStates,-1);if(y.break){i.push({ind:m,mode:Xe,doc:E});break}else for(let N=1;N<y.expandedStates.length+1;N++)if(N>=y.expandedStates.length){i.push({ind:m,mode:Xe,doc:E});break}else{let A=y.expandedStates[N],T={ind:m,mode:St,doc:A};if(mo(T,i,w,D,r)){i.push(T);break}}}else i.push({ind:m,mode:Xe,doc:y.contents});break}}y.id&&(r[y.id]=Ae(!1,i,-1).mode);break;case Ot:{let v=n-o,w=y[cl]??0,{parts:D}=y,E=D.length-w;if(E===0)break;let N=D[w+0],A=D[w+1],T={ind:m,mode:St,doc:N},j={ind:m,mode:Xe,doc:N},B=mo(T,[],v,c.length>0,r,!0);if(E===1){B?i.push(T):i.push(j);break}let $={ind:m,mode:St,doc:A},O={ind:m,mode:Xe,doc:A};if(E===2){B?i.push($,T):i.push(O,j);break}let z=D[w+2],I={ind:m,mode:g,doc:{...y,[cl]:w+2}};mo({ind:m,mode:St,doc:[N,A,z]},[],v,c.length>0,r,!0)?i.push(I,$,T):B?i.push(I,O,T):i.push(I,O,j);break}case nt:case Qt:{let v=y.groupId?r[y.groupId]:g;if(v===Xe){let w=y.type===nt?y.breakContents:y.negate?y.contents:_o(y.contents);w&&i.push({ind:m,mode:g,doc:w})}if(v===St){let w=y.type===nt?y.flatContents:y.negate?_o(y.contents):y.contents;w&&i.push({ind:m,mode:g,doc:w})}break}case Zt:c.push({ind:m,mode:g,doc:y.contents});break;case er:c.length>0&&i.push({ind:m,mode:g,doc:ou});break;case Pe:switch(g){case St:if(y.hard)l=!0;else{y.soft||(a.push(" "),o+=1);break}case Xe:if(c.length>0){i.push({ind:m,mode:g,doc:y},...c.reverse()),c.length=0;break}y.literal?m.root?(a.push(s,m.root.value),o=m.root.length):(a.push(s),o=0):(o-=pl(a),a.push(s+m.value),o=m.length);break}break;case Lt:i.push({ind:m,mode:g,doc:y.contents});break;case ht:break;default:throw new Fn(y)}i.length===0&&c.length>0&&(i.push(...c.reverse()),c.length=0)}let f=a.indexOf(Dn);if(f!==-1){let m=a.indexOf(Dn,f+1);if(m===-1)return{formatted:a.filter(w=>w!==Dn).join("")};let g=a.slice(0,f).join(""),y=a.slice(f+1,m).join(""),v=a.slice(m+1).join("");return{formatted:g+y+v,cursorNodeStart:g.length,cursorNodeText:y}}return{formatted:a.join("")}}function Dv(t,e,r=0){let n=0;for(let s=r;s<t.length;++s)t[s]===" "?n=n+e-n%e:n++;return n}var au=Dv,Lr,hl,No,Cv=class{constructor(t){F1(this,Lr),this.stack=[t]}get key(){let{stack:t,siblings:e}=this;return Ae(!1,t,e===null?-2:-4)??null}get index(){return this.siblings===null?null:Ae(!1,this.stack,-2)}get node(){return Ae(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:t}=this,e=Ae(!1,t,-3);return Array.isArray(e)?e:null}get next(){let{siblings:t}=this;return t===null?null:t[this.index+1]}get previous(){let{siblings:t}=this;return t===null?null:t[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:t,index:e}=this;return t!==null&&e===t.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...ss(this,Lr,No).call(this)]}getName(){let{stack:t}=this,{length:e}=t;return e>1?Ae(!1,t,-2):null}getValue(){return Ae(!1,this.stack,-1)}getNode(t=0){let e=ss(this,Lr,hl).call(this,t);return e===-1?null:this.stack[e]}getParentNode(t=0){return this.getNode(t+1)}call(t,...e){let{stack:r}=this,{length:n}=r,s=Ae(!1,r,-1);for(let o of e)s=s[o],r.push(o,s);try{return t(this)}finally{r.length=n}}callParent(t,e=0){let r=ss(this,Lr,hl).call(this,e+1),n=this.stack.splice(r+1);try{return t(this)}finally{this.stack.push(...n)}}each(t,...e){let{stack:r}=this,{length:n}=r,s=Ae(!1,r,-1);for(let o of e)s=s[o],r.push(o,s);try{for(let o=0;o<s.length;++o)r.push(o,s[o]),t(this,o,s),r.length-=2}finally{r.length=n}}map(t,...e){let r=[];return this.each((n,s,o)=>{r[s]=t(n,s,o)},...e),r}match(...t){let e=this.stack.length-1,r=null,n=this.stack[e--];for(let s of t){if(n===void 0)return!1;let o=null;if(typeof r=="number"&&(o=r,r=this.stack[e--],n=this.stack[e--]),s&&!s(n,r,o))return!1;r=this.stack[e--],n=this.stack[e--]}return!0}findAncestor(t){for(let e of ss(this,Lr,No).call(this))if(t(e))return e}hasAncestor(t){for(let e of ss(this,Lr,No).call(this))if(t(e))return!0;return!1}};Lr=new WeakSet,hl=function(t){let{stack:e}=this;for(let r=e.length-1;r>=0;r-=2)if(!Array.isArray(e[r])&&--t<0)return r;return-1},No=function*(){let{stack:t}=this;for(let e=t.length-3;e>=0;e-=2){let r=t[e];Array.isArray(r)||(yield r)}};var kv=Cv,hf=new Proxy(()=>{},{get:()=>hf}),fl=hf;function Ev(t){return t!==null&&typeof t=="object"}var Sv=Ev;function*Bi(t,e){let{getVisitorKeys:r,filter:n=()=>!0}=e,s=o=>Sv(o)&&n(o);for(let o of r(t)){let i=t[o];if(Array.isArray(i))for(let a of i)s(a)&&(yield a);else s(i)&&(yield i)}}function*Fv(t,e){let r=[t];for(let n=0;n<r.length;n++){let s=r[n];for(let o of Bi(s,e))yield o,r.push(o)}}function Av(t,e){return Bi(t,e).next().done}function Ps(t){return(e,r,n)=>{let s=!!(n!=null&&n.backwards);if(r===!1)return!1;let{length:o}=e,i=r;for(;i>=0&&i<o;){let a=e.charAt(i);if(t instanceof RegExp){if(!t.test(a))return i}else if(!t.includes(a))return i;s?i--:i++}return i===-1||i===o?i:!1}}var Nv=Ps(/\s/u),wr=Ps(" "),ff=Ps(",; "),mf=Ps(/[^\n\r]/u);function Tv(t,e,r){let n=!!(r!=null&&r.backwards);if(e===!1)return!1;let s=t.charAt(e);if(n){if(t.charAt(e-1)==="\r"&&s===`
|
|
58
|
+
`)return e-2;if(s===`
|
|
59
|
+
`||s==="\r"||s==="\u2028"||s==="\u2029")return e-1}else{if(s==="\r"&&t.charAt(e+1)===`
|
|
60
|
+
`)return e+2;if(s===`
|
|
61
|
+
`||s==="\r"||s==="\u2028"||s==="\u2029")return e+1}return e}var Xr=Tv;function Mv(t,e,r={}){let n=wr(t,r.backwards?e-1:e,r),s=Xr(t,n,r);return n!==s}var gr=Mv;function Bv(t){return Array.isArray(t)&&t.length>0}var jv=Bv,gf=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Ov=t=>Object.keys(t).filter(e=>!gf.has(e));function Lv(t){return t?e=>t(e,gf):Ov}var ji=Lv;function _v(t){let e=t.type||t.kind||"(unknown type)",r=String(t.name||t.id&&(typeof t.id=="object"?t.id.name:t.id)||t.key&&(typeof t.key=="object"?t.key.name:t.key)||t.value&&(typeof t.value=="object"?"":String(t.value))||t.operator||"");return r.length>20&&(r=r.slice(0,19)+"…"),e+(r?" "+r:"")}function lu(t,e){(t.comments??(t.comments=[])).push(e),e.printed=!1,e.nodeDescription=_v(t)}function ms(t,e){e.leading=!0,e.trailing=!1,lu(t,e)}function _r(t,e,r){e.leading=!1,e.trailing=!1,r&&(e.marker=r),lu(t,e)}function gs(t,e){e.leading=!1,e.trailing=!0,lu(t,e)}var ka=new WeakMap;function uu(t,e){if(ka.has(t))return ka.get(t);let{printer:{getCommentChildNodes:r,canAttachComment:n,getVisitorKeys:s},locStart:o,locEnd:i}=e;if(!n)return[];let a=(r?.(t,e)??[...Bi(t,{getVisitorKeys:ji(s)})]).flatMap(l=>n(l)?[l]:uu(l,e));return a.sort((l,c)=>o(l)-o(c)||i(l)-i(c)),ka.set(t,a),a}function bf(t,e,r,n){let{locStart:s,locEnd:o}=r,i=s(e),a=o(e),l=uu(t,r),c,d,f=0,m=l.length;for(;f<m;){let g=f+m>>1,y=l[g],v=s(y),w=o(y);if(v<=i&&a<=w)return bf(y,e,r,y);if(w<=i){c=y,f=g+1;continue}if(a<=v){d=y,m=g;continue}throw new Error("Comment location overlaps with node location")}if(n?.type==="TemplateLiteral"){let{quasis:g}=n,y=Sa(g,e,r);c&&Sa(g,c,r)!==y&&(c=null),d&&Sa(g,d,r)!==y&&(d=null)}return{enclosingNode:n,precedingNode:c,followingNode:d}}var Ea=()=>!1;function Iv(t,e){let{comments:r}=t;if(delete t.comments,!jv(r)||!e.printer.canAttachComment)return;let n=[],{printer:{experimentalFeatures:{avoidAstMutation:s=!1}={},handleComments:o={}},originalText:i}=e,{ownLine:a=Ea,endOfLine:l=Ea,remaining:c=Ea}=o,d=r.map((f,m)=>({...bf(t,f,e),comment:f,text:i,options:e,ast:t,isLastComment:r.length-1===m}));for(let[f,m]of d.entries()){let{comment:g,precedingNode:y,enclosingNode:v,followingNode:w,text:D,options:E,ast:N,isLastComment:A}=m,T;if(s?T=[m]:(g.enclosingNode=v,g.precedingNode=y,g.followingNode=w,T=[g,D,E,N,A]),Rv(D,E,d,f))g.placement="ownLine",a(...T)||(w?ms(w,g):y?gs(y,g):_r(v||N,g));else if(Pv(D,E,d,f))g.placement="endOfLine",l(...T)||(y?gs(y,g):w?ms(w,g):_r(v||N,g));else if(g.placement="remaining",!c(...T))if(y&&w){let j=n.length;j>0&&n[j-1].followingNode!==w&&jd(n,E),n.push(m)}else y?gs(y,g):w?ms(w,g):_r(v||N,g)}if(jd(n,e),!s)for(let f of r)delete f.precedingNode,delete f.enclosingNode,delete f.followingNode}var yf=t=>!/[\S\n\u2028\u2029]/u.test(t);function Rv(t,e,r,n){let{comment:s,precedingNode:o}=r[n],{locStart:i,locEnd:a}=e,l=i(s);if(o)for(let c=n-1;c>=0;c--){let{comment:d,precedingNode:f}=r[c];if(f!==o||!yf(t.slice(a(d),l)))break;l=i(d)}return gr(t,l,{backwards:!0})}function Pv(t,e,r,n){let{comment:s,followingNode:o}=r[n],{locStart:i,locEnd:a}=e,l=a(s);if(o)for(let c=n+1;c<r.length;c++){let{comment:d,followingNode:f}=r[c];if(f!==o||!yf(t.slice(l,i(d))))break;l=a(d)}return gr(t,l)}function jd(t,e){var r,n;let s=t.length;if(s===0)return;let{precedingNode:o,followingNode:i}=t[0],a=e.locStart(i),l;for(l=s;l>0;--l){let{comment:c,precedingNode:d,followingNode:f}=t[l-1];fl.strictEqual(d,o),fl.strictEqual(f,i);let m=e.originalText.slice(e.locEnd(c),a);if(((n=(r=e.printer).isGap)==null?void 0:n.call(r,m,e))??/^[\s(]*$/u.test(m))a=e.locStart(c);else break}for(let[c,{comment:d}]of t.entries())c<l?gs(o,d):ms(i,d);for(let c of[o,i])c.comments&&c.comments.length>1&&c.comments.sort((d,f)=>e.locStart(d)-e.locStart(f));t.length=0}function Sa(t,e,r){let n=r.locStart(e)-1;for(let s=1;s<t.length;++s)if(n<r.locStart(t[s]))return s-1;return 0}function zv(t,e){let r=e-1;r=wr(t,r,{backwards:!0}),r=Xr(t,r,{backwards:!0}),r=wr(t,r,{backwards:!0});let n=Xr(t,r,{backwards:!0});return r!==n}var cu=zv;function xf(t,e){let r=t.node;return r.printed=!0,e.printer.printComment(t,e)}function $v(t,e){var r;let n=t.node,s=[xf(t,e)],{printer:o,originalText:i,locStart:a,locEnd:l}=e;if((r=o.isBlockComment)!=null&&r.call(o,n)){let d=gr(i,l(n))?gr(i,a(n),{backwards:!0})?Wr:lf:" ";s.push(d)}else s.push(Wr);let c=Xr(i,wr(i,l(n)));return c!==!1&&gr(i,c)&&s.push(Wr),s}function Hv(t,e,r){var n;let s=t.node,o=xf(t,e),{printer:i,originalText:a,locStart:l}=e,c=(n=i.isBlockComment)==null?void 0:n.call(i,s);if(r!=null&&r.hasLineSuffix&&!(r!=null&&r.isBlock)||gr(a,l(s),{backwards:!0})){let d=cu(a,l(s));return{doc:ul([Wr,d?Wr:"",o]),isBlock:c,hasLineSuffix:!0}}return!c||r!=null&&r.hasLineSuffix?{doc:[ul([" ",o]),Ti],isBlock:c,hasLineSuffix:!0}:{doc:[" ",o],isBlock:c,hasLineSuffix:!1}}function Vv(t,e){let r=t.node;if(!r)return{};let n=e[Symbol.for("printedComments")];if((r.comments||[]).filter(a=>!n.has(a)).length===0)return{leading:"",trailing:""};let s=[],o=[],i;return t.each(()=>{let a=t.node;if(n!=null&&n.has(a))return;let{leading:l,trailing:c}=a;l?s.push($v(t,e)):c&&(i=Hv(t,e,i),o.push(i.doc))},"comments"),{leading:s,trailing:o}}function qv(t,e,r){let{leading:n,trailing:s}=Vv(t,r);return!n&&!s?e:Ao(e,o=>[n,o,s])}function Wv(t){let{[Symbol.for("comments")]:e,[Symbol.for("printedComments")]:r}=t;for(let n of e){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed}}var vf=class extends Error{constructor(){super(...arguments);kt(this,"name","ConfigError")}},Od=class extends Error{constructor(){super(...arguments);kt(this,"name","UndefinedParserError")}},Uv={checkIgnorePragma:{category:"Special",type:"boolean",default:!1,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
|
|
62
|
+
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:t=>typeof t=="string"||typeof t=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:t=>typeof t=="string"||typeof t=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
|
|
45
63
|
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
|
|
46
|
-
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function
|
|
47
|
-
`)),
|
|
48
|
-
`)),
|
|
49
|
-
`,1)[0].length);return i>r&&i>u?s:a}var pn=[],Ms=[];function Yh(e,r){if(e===r)return 0;let a=e;e.length>r.length&&(e=r,r=a);let s=e.length,i=r.length;for(;s>0&&e.charCodeAt(~-s)===r.charCodeAt(~-i);)s--,i--;let u=0;for(;u<s&&e.charCodeAt(u)===r.charCodeAt(u);)u++;if(s-=u,i-=u,s===0)return i;let d,p,f,h,g=0,w=0;for(;g<s;)Ms[g]=e.charCodeAt(u+g),pn[g]=++g;for(;w<i;)for(d=r.charCodeAt(u+w),f=w++,p=w,g=0;g<s;g++)h=d===Ms[g]?f:f+1,f=pn[g],p=pn[g]=f>p?h>p?p+1:h:h>f?f+1:h;return p}var Yo=(e,r,{descriptor:a,logger:s,schemas:i})=>{let u=[`Ignored unknown option ${Se.yellow(a.pair({key:e,value:r}))}.`],d=Object.keys(i).sort().find(p=>Yh(e,p)<3);d&&u.push(`Did you mean ${Se.blue(a.key(d))}?`),s.warn(u.join(" "))},Xh=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Zh(e,r){let a=new e(r),s=Object.create(a);for(let i of Xh)i in r&&(s[i]=Qh(r[i],a,Xe.prototype[i].length));return s}var Xe=class{static create(e){return Zh(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,r){return!1}deprecated(e,r){return!1}forward(e,r){}redirect(e,r){}overlap(e,r,a){return e}preprocess(e,r){return e}postprocess(e,r){return Fr}};function Qh(e,r,a){return typeof e=="function"?(...s)=>e(...s.slice(0,a-1),r,...s.slice(a-1)):()=>e}var em=class extends Xe{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,r){return r.schemas[this._sourceName].validate(e,r)}redirect(e,r){return this._sourceName}},tm=class extends Xe{expected(){return"anything"}validate(){return!0}},rm=class extends Xe{constructor({valueSchema:e,name:r=e.name,...a}){super({...a,name:r}),this._valueSchema=e}expected(e){let{text:r,list:a}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:r&&`an array of ${r}`,list:a&&{title:"an array of the following values",values:[{list:a}]}}}validate(e,r){if(!Array.isArray(e))return!1;let a=[];for(let s of e){let i=r.normalizeValidateResult(this._valueSchema.validate(s,r),s);i!==!0&&a.push(i.value)}return a.length===0?!0:{value:a}}deprecated(e,r){let a=[];for(let s of e){let i=r.normalizeDeprecatedResult(this._valueSchema.deprecated(s,r),s);i!==!1&&a.push(...i.map(({value:u})=>({value:[u]})))}return a}forward(e,r){let a=[];for(let s of e){let i=r.normalizeForwardResult(this._valueSchema.forward(s,r),s);a.push(...i.map(Rs))}return a}redirect(e,r){let a=[],s=[];for(let i of e){let u=r.normalizeRedirectResult(this._valueSchema.redirect(i,r),i);"remain"in u&&a.push(u.remain),s.push(...u.redirect.map(Rs))}return a.length===0?{redirect:s}:{redirect:s,remain:a}}overlap(e,r){return e.concat(r)}};function Rs({from:e,to:r}){return{from:[e],to:r}}var nm=class extends Xe{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function am(e,r){let a=Object.create(null);for(let s of e){let i=s[r];if(a[i])throw new Error(`Duplicate ${r} ${JSON.stringify(i)}`);a[i]=s}return a}function sm(e,r){let a=new Map;for(let s of e){let i=s[r];if(a.has(i))throw new Error(`Duplicate ${r} ${JSON.stringify(i)}`);a.set(i,s)}return a}function om(){let e=Object.create(null);return r=>{let a=JSON.stringify(r);return e[a]?!0:(e[a]=!0,!1)}}function im(e,r){let a=[],s=[];for(let i of e)r(i)?a.push(i):s.push(i);return[a,s]}function lm(e){return e===Math.floor(e)}function um(e,r){if(e===r)return 0;let a=typeof e,s=typeof r,i=["undefined","object","boolean","number","string"];return a!==s?i.indexOf(a)-i.indexOf(s):a!=="string"?Number(e)-Number(r):e.localeCompare(r)}function cm(e){return(...r)=>{let a=e(...r);return typeof a=="string"?new Error(a):a}}function zs(e){return e===void 0?{}:e}function Xo(e){if(typeof e=="string")return{text:e};let{text:r,list:a}=e;return dm((r||a)!==void 0,"Unexpected `expected` result, there should be at least one field."),a?{text:r,list:{title:a.title,values:a.values.map(Xo)}}:{text:r}}function $s(e,r){return e===!0?!0:e===!1?{value:r}:e}function Hs(e,r,a=!1){return e===!1?!1:e===!0?a?!0:[{value:r}]:"value"in e?[e]:e.length===0?!1:e}function qs(e,r){return typeof e=="string"||"key"in e?{from:r,to:e}:"from"in e?{from:e.from,to:e.to}:{from:r,to:e.to}}function Sn(e,r){return e===void 0?[]:Array.isArray(e)?e.map(a=>qs(a,r)):[qs(e,r)]}function Us(e,r){let a=Sn(typeof e=="object"&&"redirect"in e?e.redirect:e,r);return a.length===0?{remain:r,redirect:a}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:a}:{redirect:a}}function dm(e,r){if(!e)throw new Error(r)}var pm=class extends Xe{constructor(e){super(e),this._choices=sm(e.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value")}expected({descriptor:e}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(um).map(e.value),a=r.slice(0,-2),s=r.slice(-2);return{text:a.concat(s.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(e){return this._choices.has(e)}deprecated(e){let r=this._choices.get(e);return r&&r.deprecated?{value:e}:!1}forward(e){let r=this._choices.get(e);return r?r.forward:void 0}redirect(e){let r=this._choices.get(e);return r?r.redirect:void 0}},hm=class extends Xe{expected(){return"a number"}validate(e,r){return typeof e=="number"}},mm=class extends hm{expected(){return"an integer"}validate(e,r){return r.normalizeValidateResult(super.validate(e,r),e)===!0&&lm(e)}},Ws=class extends Xe{expected(){return"a string"}validate(e){return typeof e=="string"}},fm=yt,gm=Yo,bm=Kh,xm=Gh,Dm=class{constructor(e,r){let{logger:a=console,loggerPrintWidth:s=80,descriptor:i=fm,unknown:u=gm,invalid:d=bm,deprecated:p=xm,missing:f=()=>!1,required:h=()=>!1,preprocess:g=D=>D,postprocess:w=()=>Fr}=r||{};this._utils={descriptor:i,logger:a||{warn:()=>{}},loggerPrintWidth:s,schemas:am(e,"name"),normalizeDefaultResult:zs,normalizeExpectedResult:Xo,normalizeDeprecatedResult:Hs,normalizeForwardResult:Sn,normalizeRedirectResult:Us,normalizeValidateResult:$s},this._unknownHandler=u,this._invalidHandler=cm(d),this._deprecatedHandler=p,this._identifyMissing=(D,y)=>!(D in y)||f(D,y),this._identifyRequired=h,this._preprocess=g,this._postprocess=w,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=om()}normalize(e){let r={},a=[this._preprocess(e,this._utils)],s=()=>{for(;a.length!==0;){let i=a.shift(),u=this._applyNormalization(i,r);a.push(...u)}};s();for(let i of Object.keys(this._utils.schemas)){let u=this._utils.schemas[i];if(!(i in r)){let d=zs(u.default(this._utils));"value"in d&&a.push({[i]:d.value})}}s();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let u=this._utils.schemas[i],d=r[i],p=u.postprocess(d,this._utils);p!==Fr&&(this._applyValidation(p,i,u),r[i]=p)}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(e,r){let a=[],{knownKeys:s,unknownKeys:i}=this._partitionOptionKeys(e);for(let u of s){let d=this._utils.schemas[u],p=d.preprocess(e[u],this._utils);this._applyValidation(p,u,d);let f=({from:w,to:D})=>{a.push(typeof D=="string"?{[D]:w}:{[D.key]:D.value})},h=({value:w,redirectTo:D})=>{let y=Hs(d.deprecated(w,this._utils),p,!0);if(y!==!1)if(y===!0)this._hasDeprecationWarned(u)||this._utils.logger.warn(this._deprecatedHandler(u,D,this._utils));else for(let{value:v}of y){let E={key:u,value:v};if(!this._hasDeprecationWarned(E)){let C=typeof D=="string"?{key:D,value:v}:D;this._utils.logger.warn(this._deprecatedHandler(E,C,this._utils))}}};Sn(d.forward(p,this._utils),p).forEach(f);let g=Us(d.redirect(p,this._utils),p);if(g.redirect.forEach(f),"remain"in g){let w=g.remain;r[u]=u in r?d.overlap(r[u],w,this._utils):w,h({value:w})}for(let{from:w,to:D}of g.redirect)h({value:w,redirectTo:D})}for(let u of i){let d=e[u];this._applyUnknownHandler(u,d,r,(p,f)=>{a.push({[p]:f})})}return a}_applyRequiredCheck(e){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,e)&&this._identifyRequired(r))throw this._invalidHandler(r,Jo,this._utils)}_partitionOptionKeys(e){let[r,a]=im(Object.keys(e).filter(s=>!this._identifyMissing(s,e)),s=>s in this._utils.schemas);return{knownKeys:r,unknownKeys:a}}_applyValidation(e,r,a){let s=$s(a.validate(e,this._utils),e);if(s!==!0)throw this._invalidHandler(r,s.value,this._utils)}_applyUnknownHandler(e,r,a,s){let i=this._unknownHandler(e,r,this._utils);if(i)for(let u of Object.keys(i)){if(this._identifyMissing(u,i))continue;let d=i[u];u in this._utils.schemas?s(u,d):a[u]=d}}_applyPostprocess(e){let r=this._postprocess(e,this._utils);if(r!==Fr){if(r.delete)for(let a of r.delete)delete e[a];if(r.override){let{knownKeys:a,unknownKeys:s}=this._partitionOptionKeys(r.override);for(let i of a){let u=r.override[i];this._applyValidation(u,i,this._utils.schemas[i]),e[i]=u}for(let i of s){let u=r.override[i];this._applyUnknownHandler(i,u,e,(d,p)=>{let f=this._utils.schemas[d];this._applyValidation(p,d,f),e[d]=p})}}}}},hn;function ym(e,r,{logger:a=!1,isCLI:s=!1,passThrough:i=!1,FlagSchema:u,descriptor:d}={}){if(s){if(!u)throw new Error("'FlagSchema' option is required.");if(!d)throw new Error("'descriptor' option is required.")}else d=yt;let p=i?Array.isArray(i)?(D,y)=>i.includes(D)?{[D]:y}:void 0:(D,y)=>({[D]:y}):(D,y,v)=>{let{_:E,...C}=v.schemas;return Yo(D,y,{...v,schemas:C})},f=vm(r,{isCLI:s,FlagSchema:u}),h=new Dm(f,{logger:a,unknown:p,descriptor:d}),g=a!==!1;g&&hn&&(h._hasDeprecationWarned=hn);let w=h.normalize(e);return g&&(hn=h._hasDeprecationWarned),w}function vm(e,{isCLI:r,FlagSchema:a}){let s=[];r&&s.push(tm.create({name:"_"}));for(let i of e)s.push(wm(i,{isCLI:r,optionInfos:e,FlagSchema:a})),i.alias&&r&&s.push(em.create({name:i.alias,sourceName:i.name}));return s}function wm(e,{isCLI:r,optionInfos:a,FlagSchema:s}){let{name:i}=e,u={name:i},d,p={};switch(e.type){case"int":d=mm,r&&(u.preprocess=Number);break;case"string":d=Ws;break;case"choice":d=pm,u.choices=e.choices.map(f=>f!=null&&f.redirect?{...f,redirect:{to:{key:e.name,value:f.redirect}}}:f);break;case"boolean":d=nm;break;case"flag":d=s,u.flags=a.flatMap(f=>[f.alias,f.description&&f.name,f.oppositeDescription&&`no-${f.name}`].filter(Boolean));break;case"path":d=Ws;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?u.validate=(f,h,g)=>e.exception(f)||h.validate(f,g):u.validate=(f,h,g)=>f===void 0||h.validate(f,g),e.redirect&&(p.redirect=f=>f?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(p.deprecated=!0),r&&!e.array){let f=u.preprocess||(h=>h);u.preprocess=(h,g,w)=>g.preprocess(f(Array.isArray(h)?se(!1,h,-1):h),w)}return e.array?rm.create({...r?{preprocess:f=>Array.isArray(f)?f:[f]}:{},...p,valueSchema:d.create(u)}):d.create({...u,...p})}var Cm=ym,Fm=(e,r,a)=>{if(!(e&&r==null)){if(r.findLast)return r.findLast(a);for(let s=r.length-1;s>=0;s--){let i=r[s];if(a(i,s,r))return i}}},Zo=Fm;function Qo(e,r){if(!r)throw new Error("parserName is required.");let a=Zo(!1,e,i=>i.parsers&&Object.prototype.hasOwnProperty.call(i.parsers,r));if(a)return a;let s=`Couldn't resolve parser "${r}".`;throw s+=" Plugins must be explicitly added to the standalone bundle.",new qo(s)}function Em(e,r){if(!r)throw new Error("astFormat is required.");let a=Zo(!1,e,i=>i.printers&&Object.prototype.hasOwnProperty.call(i.printers,r));if(a)return a;let s=`Couldn't find plugin for AST format "${r}".`;throw s+=" Plugins must be explicitly added to the standalone bundle.",new qo(s)}function Vn({plugins:e,parser:r}){let a=Qo(e,r);return ei(a,r)}function ei(e,r){let a=e.parsers[r];return typeof a=="function"?a():a}function Sm(e,r){let a=e.printers[r];return typeof a=="function"?a():a}var Vs={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function km(e,r={}){var a;let s={...e};if(!s.parser)if(s.filepath){if(s.parser=Jh(s,{physicalFile:s.filepath}),!s.parser)throw new As(`No parser could be inferred for file "${s.filepath}".`)}else throw new As("No parser and no file path given, couldn't infer a parser.");let i=Uo({plugins:e.plugins,showDeprecated:!0}).options,u={...Vs,...Object.fromEntries(i.filter(D=>D.default!==void 0).map(D=>[D.name,D.default]))},d=Qo(s.plugins,s.parser),p=await ei(d,s.parser);s.astFormat=p.astFormat,s.locEnd=p.locEnd,s.locStart=p.locStart;let f=(a=d.printers)!=null&&a[p.astFormat]?d:Em(s.plugins,p.astFormat),h=await Sm(f,p.astFormat);s.printer=h;let g=f.defaultOptions?Object.fromEntries(Object.entries(f.defaultOptions).filter(([,D])=>D!==void 0)):{},w={...u,...g};for(let[D,y]of Object.entries(w))(s[D]===null||s[D]===void 0)&&(s[D]=y);return s.parser==="json"&&(s.trailingComma="none"),Cm(s,i,{passThrough:Object.keys(Vs),...r})}var Ct=km,Am=hp(gp());async function Nm(e,r){let a=await Vn(r),s=a.preprocess?a.preprocess(e,r):e;r.originalText=s;let i;try{i=await a.parse(s,r,r)}catch(u){jm(u,e)}return{text:s,ast:i}}function jm(e,r){let{loc:a}=e;if(a){let s=(0,Am.codeFrameColumns)(r,a,{highlightCode:!0});throw e.message+=`
|
|
50
|
-
`+
|
|
51
|
-
`,
|
|
52
|
-
`&&(
|
|
53
|
-
`)),
|
|
54
|
-
`,
|
|
55
|
-
`);a
|
|
56
|
-
`);return
|
|
57
|
-
`)return!0;return!1}var
|
|
64
|
+
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function wf({plugins:t=[],showDeprecated:e=!1}={}){let r=t.flatMap(s=>s.languages??[]),n=[];for(let s of Kv(Object.assign({},...t.map(({options:o})=>o),Uv)))!e&&s.deprecated||(Array.isArray(s.choices)&&(e||(s.choices=s.choices.filter(o=>!o.deprecated)),s.name==="parser"&&(s.choices=[...s.choices,...Jv(s.choices,r,t)])),s.pluginDefaults=Object.fromEntries(t.filter(o=>{var i;return((i=o.defaultOptions)==null?void 0:i[s.name])!==void 0}).map(o=>[o.name,o.defaultOptions[s.name]])),n.push(s));return{languages:r,options:n}}function*Jv(t,e,r){let n=new Set(t.map(s=>s.value));for(let s of e)if(s.parsers){for(let o of s.parsers)if(!n.has(o)){n.add(o);let i=r.find(l=>l.parsers&&Object.prototype.hasOwnProperty.call(l.parsers,o)),a=s.name;i!=null&&i.name&&(a+=` (plugin: ${i.name})`),yield{value:o,description:a}}}}function Kv(t){let e=[];for(let[r,n]of Object.entries(t)){let s={name:r,...n};Array.isArray(s.default)&&(s.default=Ae(!1,s.default,-1).value),e.push(s)}return e}var Gv=(t,e)=>{if(!(t&&e==null))return e.toReversed||!Array.isArray(e)?e.toReversed():[...e].reverse()},Yv=Gv,Ld,_d,Id,Rd,Pd,Xv=((Ld=globalThis.Deno)==null?void 0:Ld.build.os)==="windows"||((Id=(_d=globalThis.navigator)==null?void 0:_d.platform)==null?void 0:Id.startsWith("Win"))||((Pd=(Rd=globalThis.process)==null?void 0:Rd.platform)==null?void 0:Pd.startsWith("win"))||!1;function Df(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function Qv(t){return t=Df(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Zv(t){t=Df(t);let e=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(e=`\\\\${t.hostname}${e}`),e}function ew(t){return Xv?Zv(t):Qv(t)}var tw=ew,rw=t=>String(t).split(/[/\\]/u).pop();function zd(t,e){if(!e)return;let r=rw(e).toLowerCase();return t.find(({filenames:n})=>n?.some(s=>s.toLowerCase()===r))??t.find(({extensions:n})=>n?.some(s=>r.endsWith(s)))}function nw(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r?.includes(e))??t.find(({extensions:r})=>r?.includes(`.${e}`))}function $d(t,e){if(e){if(String(e).startsWith("file:"))try{e=tw(e)}catch{return}if(typeof e=="string")return t.find(({isSupported:r})=>r?.({filepath:e}))}}function sw(t,e){let r=Yv(!1,t.plugins).flatMap(s=>s.languages??[]),n=nw(r,e.language)??zd(r,e.physicalFile)??zd(r,e.file)??$d(r,e.physicalFile)??$d(r,e.file)??(e.physicalFile,void 0);return n?.parsers[0]}var ow=sw,Cn={key:t=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(t)?t:JSON.stringify(t),value(t){if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(r=>Cn.value(r)).join(", ")}]`;let e=Object.keys(t);return e.length===0?"{}":`{ ${e.map(r=>`${Cn.key(r)}: ${Cn.value(t[r])}`).join(", ")} }`},pair:({key:t,value:e})=>Cn.value({[t]:e})},Cf=new Proxy(String,{get:()=>Cf}),Tt=Cf,iw=(t,e,{descriptor:r})=>{let n=[`${Tt.yellow(typeof t=="string"?r.key(t):r.pair(t))} is deprecated`];return e&&n.push(`we now treat it as ${Tt.blue(typeof e=="string"?r.key(e):r.pair(e))}`),n.join("; ")+"."},kf=Symbol.for("vnopts.VALUE_NOT_EXIST"),To=Symbol.for("vnopts.VALUE_UNCHANGED"),Hd=" ".repeat(2),aw=(t,e,r)=>{let{text:n,list:s}=r.normalizeExpectedResult(r.schemas[t].expected(r)),o=[];return n&&o.push(Vd(t,e,n,r.descriptor)),s&&o.push([Vd(t,e,s.title,r.descriptor)].concat(s.values.map(i=>Ef(i,r.loggerPrintWidth))).join(`
|
|
65
|
+
`)),Sf(o,r.loggerPrintWidth)};function Vd(t,e,r,n){return[`Invalid ${Tt.red(n.key(t))} value.`,`Expected ${Tt.blue(r)},`,`but received ${e===kf?Tt.gray("nothing"):Tt.red(n.value(e))}.`].join(" ")}function Ef({text:t,list:e},r){let n=[];return t&&n.push(`- ${Tt.blue(t)}`),e&&n.push([`- ${Tt.blue(e.title)}:`].concat(e.values.map(s=>Ef(s,r-Hd.length).replace(/^|\n/g,`$&${Hd}`))).join(`
|
|
66
|
+
`)),Sf(n,r)}function Sf(t,e){if(t.length===1)return t[0];let[r,n]=t,[s,o]=t.map(i=>i.split(`
|
|
67
|
+
`,1)[0].length);return s>e&&s>o?n:r}var Fa=[],qd=[];function lw(t,e){if(t===e)return 0;let r=t;t.length>e.length&&(t=e,e=r);let n=t.length,s=e.length;for(;n>0&&t.charCodeAt(~-n)===e.charCodeAt(~-s);)n--,s--;let o=0;for(;o<n&&t.charCodeAt(o)===e.charCodeAt(o);)o++;if(n-=o,s-=o,n===0)return s;let i,a,l,c,d=0,f=0;for(;d<n;)qd[d]=t.charCodeAt(o+d),Fa[d]=++d;for(;f<s;)for(i=e.charCodeAt(o+f),l=f++,a=f,d=0;d<n;d++)c=i===qd[d]?l:l+1,l=Fa[d],a=Fa[d]=l>a?c>a?a+1:c:c>l?l+1:c;return a}var Ff=(t,e,{descriptor:r,logger:n,schemas:s})=>{let o=[`Ignored unknown option ${Tt.yellow(r.pair({key:t,value:e}))}.`],i=Object.keys(s).sort().find(a=>lw(t,a)<3);i&&o.push(`Did you mean ${Tt.blue(r.key(i))}?`),n.warn(o.join(" "))},uw=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function cw(t,e){let r=new t(e),n=Object.create(r);for(let s of uw)s in e&&(n[s]=dw(e[s],r,Er.prototype[s].length));return n}var Er=class{static create(t){return cw(this,t)}constructor(t){this.name=t.name}default(t){}expected(t){return"nothing"}validate(t,e){return!1}deprecated(t,e){return!1}forward(t,e){}redirect(t,e){}overlap(t,e,r){return t}preprocess(t,e){return t}postprocess(t,e){return To}};function dw(t,e,r){return typeof t=="function"?(...n)=>t(...n.slice(0,r-1),e,...n.slice(r-1)):()=>t}var pw=class extends Er{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,r){return r.schemas[this._sourceName].validate(e,r)}redirect(e,r){return this._sourceName}},hw=class extends Er{expected(){return"anything"}validate(){return!0}},fw=class extends Er{constructor({valueSchema:t,name:e=t.name,...r}){super({...r,name:e}),this._valueSchema=t}expected(t){let{text:e,list:r}=t.normalizeExpectedResult(this._valueSchema.expected(t));return{text:e&&`an array of ${e}`,list:r&&{title:"an array of the following values",values:[{list:r}]}}}validate(t,e){if(!Array.isArray(t))return!1;let r=[];for(let n of t){let s=e.normalizeValidateResult(this._valueSchema.validate(n,e),n);s!==!0&&r.push(s.value)}return r.length===0?!0:{value:r}}deprecated(t,e){let r=[];for(let n of t){let s=e.normalizeDeprecatedResult(this._valueSchema.deprecated(n,e),n);s!==!1&&r.push(...s.map(({value:o})=>({value:[o]})))}return r}forward(t,e){let r=[];for(let n of t){let s=e.normalizeForwardResult(this._valueSchema.forward(n,e),n);r.push(...s.map(Wd))}return r}redirect(t,e){let r=[],n=[];for(let s of t){let o=e.normalizeRedirectResult(this._valueSchema.redirect(s,e),s);"remain"in o&&r.push(o.remain),n.push(...o.redirect.map(Wd))}return r.length===0?{redirect:n}:{redirect:n,remain:r}}overlap(t,e){return t.concat(e)}};function Wd({from:t,to:e}){return{from:[t],to:e}}var mw=class extends Er{expected(){return"true or false"}validate(t){return typeof t=="boolean"}};function gw(t,e){let r=Object.create(null);for(let n of t){let s=n[e];if(r[s])throw new Error(`Duplicate ${e} ${JSON.stringify(s)}`);r[s]=n}return r}function bw(t,e){let r=new Map;for(let n of t){let s=n[e];if(r.has(s))throw new Error(`Duplicate ${e} ${JSON.stringify(s)}`);r.set(s,n)}return r}function yw(){let t=Object.create(null);return e=>{let r=JSON.stringify(e);return t[r]?!0:(t[r]=!0,!1)}}function xw(t,e){let r=[],n=[];for(let s of t)e(s)?r.push(s):n.push(s);return[r,n]}function vw(t){return t===Math.floor(t)}function ww(t,e){if(t===e)return 0;let r=typeof t,n=typeof e,s=["undefined","object","boolean","number","string"];return r!==n?s.indexOf(r)-s.indexOf(n):r!=="string"?Number(t)-Number(e):t.localeCompare(e)}function Dw(t){return(...e)=>{let r=t(...e);return typeof r=="string"?new Error(r):r}}function Ud(t){return t===void 0?{}:t}function Af(t){if(typeof t=="string")return{text:t};let{text:e,list:r}=t;return Cw((e||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:e,list:{title:r.title,values:r.values.map(Af)}}:{text:e}}function Jd(t,e){return t===!0?!0:t===!1?{value:e}:t}function Kd(t,e,r=!1){return t===!1?!1:t===!0?r?!0:[{value:e}]:"value"in t?[t]:t.length===0?!1:t}function Gd(t,e){return typeof t=="string"||"key"in t?{from:e,to:t}:"from"in t?{from:t.from,to:t.to}:{from:e,to:t.to}}function ml(t,e){return t===void 0?[]:Array.isArray(t)?t.map(r=>Gd(r,e)):[Gd(t,e)]}function Yd(t,e){let r=ml(typeof t=="object"&&"redirect"in t?t.redirect:t,e);return r.length===0?{remain:e,redirect:r}:typeof t=="object"&&"remain"in t?{remain:t.remain,redirect:r}:{redirect:r}}function Cw(t,e){if(!t)throw new Error(e)}var kw=class extends Er{constructor(t){super(t),this._choices=bw(t.choices.map(e=>e&&typeof e=="object"?e:{value:e}),"value")}expected({descriptor:t}){let e=Array.from(this._choices.keys()).map(s=>this._choices.get(s)).filter(({hidden:s})=>!s).map(s=>s.value).sort(ww).map(t.value),r=e.slice(0,-2),n=e.slice(-2);return{text:r.concat(n.join(" or ")).join(", "),list:{title:"one of the following values",values:e}}}validate(t){return this._choices.has(t)}deprecated(t){let e=this._choices.get(t);return e&&e.deprecated?{value:t}:!1}forward(t){let e=this._choices.get(t);return e?e.forward:void 0}redirect(t){let e=this._choices.get(t);return e?e.redirect:void 0}},Ew=class extends Er{expected(){return"a number"}validate(t,e){return typeof t=="number"}},Sw=class extends Ew{expected(){return"an integer"}validate(t,e){return e.normalizeValidateResult(super.validate(t,e),t)===!0&&vw(t)}},Xd=class extends Er{expected(){return"a string"}validate(t){return typeof t=="string"}},Fw=Cn,Aw=Ff,Nw=aw,Tw=iw,Mw=class{constructor(t,e){let{logger:r=console,loggerPrintWidth:n=80,descriptor:s=Fw,unknown:o=Aw,invalid:i=Nw,deprecated:a=Tw,missing:l=()=>!1,required:c=()=>!1,preprocess:d=m=>m,postprocess:f=()=>To}=e||{};this._utils={descriptor:s,logger:r||{warn:()=>{}},loggerPrintWidth:n,schemas:gw(t,"name"),normalizeDefaultResult:Ud,normalizeExpectedResult:Af,normalizeDeprecatedResult:Kd,normalizeForwardResult:ml,normalizeRedirectResult:Yd,normalizeValidateResult:Jd},this._unknownHandler=o,this._invalidHandler=Dw(i),this._deprecatedHandler=a,this._identifyMissing=(m,g)=>!(m in g)||l(m,g),this._identifyRequired=c,this._preprocess=d,this._postprocess=f,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=yw()}normalize(t){let e={},r=[this._preprocess(t,this._utils)],n=()=>{for(;r.length!==0;){let s=r.shift(),o=this._applyNormalization(s,e);r.push(...o)}};n();for(let s of Object.keys(this._utils.schemas)){let o=this._utils.schemas[s];if(!(s in e)){let i=Ud(o.default(this._utils));"value"in i&&r.push({[s]:i.value})}}n();for(let s of Object.keys(this._utils.schemas)){if(!(s in e))continue;let o=this._utils.schemas[s],i=e[s],a=o.postprocess(i,this._utils);a!==To&&(this._applyValidation(a,s,o),e[s]=a)}return this._applyPostprocess(e),this._applyRequiredCheck(e),e}_applyNormalization(t,e){let r=[],{knownKeys:n,unknownKeys:s}=this._partitionOptionKeys(t);for(let o of n){let i=this._utils.schemas[o],a=i.preprocess(t[o],this._utils);this._applyValidation(a,o,i);let l=({from:f,to:m})=>{r.push(typeof m=="string"?{[m]:f}:{[m.key]:m.value})},c=({value:f,redirectTo:m})=>{let g=Kd(i.deprecated(f,this._utils),a,!0);if(g!==!1)if(g===!0)this._hasDeprecationWarned(o)||this._utils.logger.warn(this._deprecatedHandler(o,m,this._utils));else for(let{value:y}of g){let v={key:o,value:y};if(!this._hasDeprecationWarned(v)){let w=typeof m=="string"?{key:m,value:y}:m;this._utils.logger.warn(this._deprecatedHandler(v,w,this._utils))}}};ml(i.forward(a,this._utils),a).forEach(l);let d=Yd(i.redirect(a,this._utils),a);if(d.redirect.forEach(l),"remain"in d){let f=d.remain;e[o]=o in e?i.overlap(e[o],f,this._utils):f,c({value:f})}for(let{from:f,to:m}of d.redirect)c({value:f,redirectTo:m})}for(let o of s){let i=t[o];this._applyUnknownHandler(o,i,e,(a,l)=>{r.push({[a]:l})})}return r}_applyRequiredCheck(t){for(let e of Object.keys(this._utils.schemas))if(this._identifyMissing(e,t)&&this._identifyRequired(e))throw this._invalidHandler(e,kf,this._utils)}_partitionOptionKeys(t){let[e,r]=xw(Object.keys(t).filter(n=>!this._identifyMissing(n,t)),n=>n in this._utils.schemas);return{knownKeys:e,unknownKeys:r}}_applyValidation(t,e,r){let n=Jd(r.validate(t,this._utils),t);if(n!==!0)throw this._invalidHandler(e,n.value,this._utils)}_applyUnknownHandler(t,e,r,n){let s=this._unknownHandler(t,e,this._utils);if(s)for(let o of Object.keys(s)){if(this._identifyMissing(o,s))continue;let i=s[o];o in this._utils.schemas?n(o,i):r[o]=i}}_applyPostprocess(t){let e=this._postprocess(t,this._utils);if(e!==To){if(e.delete)for(let r of e.delete)delete t[r];if(e.override){let{knownKeys:r,unknownKeys:n}=this._partitionOptionKeys(e.override);for(let s of r){let o=e.override[s];this._applyValidation(o,s,this._utils.schemas[s]),t[s]=o}for(let s of n){let o=e.override[s];this._applyUnknownHandler(s,o,t,(i,a)=>{let l=this._utils.schemas[i];this._applyValidation(a,i,l),t[i]=a})}}}}},Aa;function Bw(t,e,{logger:r=!1,isCLI:n=!1,passThrough:s=!1,FlagSchema:o,descriptor:i}={}){if(n){if(!o)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=Cn;let a=s?Array.isArray(s)?(m,g)=>s.includes(m)?{[m]:g}:void 0:(m,g)=>({[m]:g}):(m,g,y)=>{let{_:v,...w}=y.schemas;return Ff(m,g,{...y,schemas:w})},l=jw(e,{isCLI:n,FlagSchema:o}),c=new Mw(l,{logger:r,unknown:a,descriptor:i}),d=r!==!1;d&&Aa&&(c._hasDeprecationWarned=Aa);let f=c.normalize(t);return d&&(Aa=c._hasDeprecationWarned),f}function jw(t,{isCLI:e,FlagSchema:r}){let n=[];e&&n.push(hw.create({name:"_"}));for(let s of t)n.push(Ow(s,{isCLI:e,optionInfos:t,FlagSchema:r})),s.alias&&e&&n.push(pw.create({name:s.alias,sourceName:s.name}));return n}function Ow(t,{isCLI:e,optionInfos:r,FlagSchema:n}){let{name:s}=t,o={name:s},i,a={};switch(t.type){case"int":i=Sw,e&&(o.preprocess=Number);break;case"string":i=Xd;break;case"choice":i=kw,o.choices=t.choices.map(l=>l!=null&&l.redirect?{...l,redirect:{to:{key:t.name,value:l.redirect}}}:l);break;case"boolean":i=mw;break;case"flag":i=n,o.flags=r.flatMap(l=>[l.alias,l.description&&l.name,l.oppositeDescription&&`no-${l.name}`].filter(Boolean));break;case"path":i=Xd;break;default:throw new Error(`Unexpected type ${t.type}`)}if(t.exception?o.validate=(l,c,d)=>t.exception(l)||c.validate(l,d):o.validate=(l,c,d)=>l===void 0||c.validate(l,d),t.redirect&&(a.redirect=l=>l?{to:typeof t.redirect=="string"?t.redirect:{key:t.redirect.option,value:t.redirect.value}}:void 0),t.deprecated&&(a.deprecated=!0),e&&!t.array){let l=o.preprocess||(c=>c);o.preprocess=(c,d,f)=>d.preprocess(l(Array.isArray(c)?Ae(!1,c,-1):c),f)}return t.array?fw.create({...e?{preprocess:l=>Array.isArray(l)?l:[l]}:{},...a,valueSchema:i.create(o)}):i.create({...o,...a})}var Lw=Bw,_w=(t,e,r)=>{if(!(t&&e==null)){if(e.findLast)return e.findLast(r);for(let n=e.length-1;n>=0;n--){let s=e[n];if(r(s,n,e))return s}}},Nf=_w;function Tf(t,e){if(!e)throw new Error("parserName is required.");let r=Nf(!1,t,s=>s.parsers&&Object.prototype.hasOwnProperty.call(s.parsers,e));if(r)return r;let n=`Couldn't resolve parser "${e}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new vf(n)}function Iw(t,e){if(!e)throw new Error("astFormat is required.");let r=Nf(!1,t,s=>s.printers&&Object.prototype.hasOwnProperty.call(s.printers,e));if(r)return r;let n=`Couldn't find plugin for AST format "${e}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new vf(n)}function du({plugins:t,parser:e}){let r=Tf(t,e);return Mf(r,e)}function Mf(t,e){let r=t.parsers[e];return typeof r=="function"?r():r}function Rw(t,e){let r=t.printers[e];return typeof r=="function"?r():r}var Qd={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function Pw(t,e={}){var r;let n={...t};if(!n.parser)if(n.filepath){if(n.parser=ow(n,{physicalFile:n.filepath}),!n.parser)throw new Od(`No parser could be inferred for file "${n.filepath}".`)}else throw new Od("No parser and no file path given, couldn't infer a parser.");let s=wf({plugins:t.plugins,showDeprecated:!0}).options,o={...Qd,...Object.fromEntries(s.filter(m=>m.default!==void 0).map(m=>[m.name,m.default]))},i=Tf(n.plugins,n.parser),a=await Mf(i,n.parser);n.astFormat=a.astFormat,n.locEnd=a.locEnd,n.locStart=a.locStart;let l=(r=i.printers)!=null&&r[a.astFormat]?i:Iw(n.plugins,a.astFormat),c=await Rw(l,a.astFormat);n.printer=c;let d=l.defaultOptions?Object.fromEntries(Object.entries(l.defaultOptions).filter(([,m])=>m!==void 0)):{},f={...o,...d};for(let[m,g]of Object.entries(f))(n[m]===null||n[m]===void 0)&&(n[m]=g);return n.parser==="json"&&(n.trailingComma="none"),Lw(n,s,{passThrough:Object.keys(Qd),...e})}var Rn=Pw,zw=E1(A1());async function $w(t,e){let r=await du(e),n=r.preprocess?r.preprocess(t,e):t;e.originalText=n;let s;try{s=await r.parse(n,e,e)}catch(o){Hw(o,t)}return{text:n,ast:s}}function Hw(t,e){let{loc:r}=t;if(r){let n=(0,zw.codeFrameColumns)(e,r,{highlightCode:!0});throw t.message+=`
|
|
68
|
+
`+n,t.codeFrame=n,t}throw t}var zs=$w;async function Vw(t,e,r,n,s){let{embeddedLanguageFormatting:o,printer:{embed:i,hasPrettierIgnore:a=()=>!1,getVisitorKeys:l}}=r;if(!i||o!=="auto")return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let c=ji(i.getVisitorKeys??l),d=[];g();let f=t.stack;for(let{print:y,node:v,pathStack:w}of d)try{t.stack=w;let D=await y(m,e,t,r);D&&s.set(v,D)}catch(D){if(globalThis.PRETTIER_DEBUG)throw D}t.stack=f;function m(y,v){return qw(y,v,r,n)}function g(){let{node:y}=t;if(y===null||typeof y!="object"||a(t))return;for(let w of c(y))Array.isArray(y[w])?t.each(g,w):t.call(g,w);let v=i(t,r);if(v){if(typeof v=="function"){d.push({print:v,node:y,pathStack:[...t.stack]});return}s.set(y,v)}}}async function qw(t,e,r,n){let s=await Rn({...r,...e,parentParser:r.parser,originalText:t,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:o}=await zs(t,s),i=await n(o,s);return sf(i)}function Ww(t,e){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:o,[Symbol.for("printedComments")]:i}=e,{node:a}=t,l=s(a),c=o(a);for(let d of n)s(d)>=l&&o(d)<=c&&i.add(d);return r.slice(l,c)}var Uw=Ww;async function Oi(t,e){({ast:t}=await Bf(t,e));let r=new Map,n=new kv(t),s=new Map;await Vw(n,i,e,Oi,s);let o=await Zd(n,e,i,void 0,s);if(Wv(e),e.cursorOffset>=0){if(e.nodeAfterCursor&&!e.nodeBeforeCursor)return[zr,o];if(e.nodeBeforeCursor&&!e.nodeAfterCursor)return[o,zr]}return o;function i(l,c){return l===void 0||l===n?a(c):Array.isArray(l)?n.call(()=>a(c),...l):n.call(()=>a(c),l)}function a(l){let c=n.node;if(c==null)return"";let d=c&&typeof c=="object"&&l===void 0;if(d&&r.has(c))return r.get(c);let f=Zd(n,e,i,l,s);return d&&r.set(c,f),f}}function Zd(t,e,r,n,s){var o;let{node:i}=t,{printer:a}=e,l;switch((o=a.hasPrettierIgnore)!=null&&o.call(a,t)?l=Uw(t,e):s.has(i)?l=s.get(i):l=a.print(t,e,r,n),i){case e.cursorNode:l=Ao(l,c=>[zr,c,zr]);break;case e.nodeBeforeCursor:l=Ao(l,c=>[c,zr]);break;case e.nodeAfterCursor:l=Ao(l,c=>[zr,c]);break}return a.printComment&&(!a.willPrintOwnComments||!a.willPrintOwnComments(t,e))&&(l=qv(t,l,e)),l}async function Bf(t,e){let r=t.comments??[];e[Symbol.for("comments")]=r,e[Symbol.for("printedComments")]=new Set,Iv(t,e);let{printer:{preprocess:n}}=e;return t=n?await n(t,e):t,{ast:t,comments:r}}function Jw(t,e){let{cursorOffset:r,locStart:n,locEnd:s}=e,o=ji(e.printer.getVisitorKeys),i=g=>n(g)<=r&&s(g)>=r,a=t,l=[t];for(let g of Fv(t,{getVisitorKeys:o,filter:i}))l.push(g),a=g;if(Av(a,{getVisitorKeys:o}))return{cursorNode:a};let c,d,f=-1,m=Number.POSITIVE_INFINITY;for(;l.length>0&&(c===void 0||d===void 0);){a=l.pop();let g=c!==void 0,y=d!==void 0;for(let v of Bi(a,{getVisitorKeys:o})){if(!g){let w=s(v);w<=r&&w>f&&(c=v,f=w)}if(!y){let w=n(v);w>=r&&w<m&&(d=v,m=w)}}}return{nodeBeforeCursor:c,nodeAfterCursor:d}}var jf=Jw;function Kw(t,e){let{printer:{massageAstNode:r,getVisitorKeys:n}}=e;if(!r)return t;let s=ji(n),o=r.ignoredProperties??new Set;return i(t);function i(a,l){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a))return a.map(m=>i(m,l)).filter(Boolean);let c={},d=new Set(s(a));for(let m in a)!Object.prototype.hasOwnProperty.call(a,m)||o.has(m)||(d.has(m)?c[m]=i(a[m],a):c[m]=a[m]);let f=r(a,c,l);if(f!==null)return f??c}}var Gw=Kw,Yw=(t,e,r)=>{if(!(t&&e==null)){if(e.findLastIndex)return e.findLastIndex(r);for(let n=e.length-1;n>=0;n--){let s=e[n];if(r(s,n,e))return n}return-1}},Xw=Yw,Qw=({parser:t})=>t==="json"||t==="json5"||t==="jsonc"||t==="json-stringify";function Zw(t,e){let r=[t.node,...t.parentNodes],n=new Set([e.node,...e.parentNodes]);return r.find(s=>Of.has(s.type)&&n.has(s))}function ep(t){let e=Xw(!1,t,r=>r.type!=="Program"&&r.type!=="File");return e===-1?t:t.slice(0,e+1)}function eD(t,e,{locStart:r,locEnd:n}){let s=t.node,o=e.node;if(s===o)return{startNode:s,endNode:o};let i=r(t.node);for(let l of ep(e.parentNodes))if(r(l)>=i)o=l;else break;let a=n(e.node);for(let l of ep(t.parentNodes)){if(n(l)<=a)s=l;else break;if(s===o)break}return{startNode:s,endNode:o}}function gl(t,e,r,n,s=[],o){let{locStart:i,locEnd:a}=r,l=i(t),c=a(t);if(!(e>c||e<l||o==="rangeEnd"&&e===l||o==="rangeStart"&&e===c)){for(let d of uu(t,r)){let f=gl(d,e,r,n,[t,...s],o);if(f)return f}if(!n||n(t,s[0]))return{node:t,parentNodes:s}}}function tD(t,e){return e!=="DeclareExportDeclaration"&&t!=="TypeParameterDeclaration"&&(t==="Directive"||t==="TypeAlias"||t==="TSExportAssignment"||t.startsWith("Declare")||t.startsWith("TSDeclare")||t.endsWith("Statement")||t.endsWith("Declaration"))}var Of=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),rD=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function tp(t,e,r){if(!e)return!1;switch(t.parser){case"flow":case"hermes":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"oxc":case"oxc-ts":case"__babel_estree":return tD(e.type,r?.type);case"json":case"json5":case"jsonc":case"json-stringify":return Of.has(e.type);case"graphql":return rD.has(e.kind);case"vue":return e.tag!=="root"}return!1}function nD(t,e,r){let{rangeStart:n,rangeEnd:s,locStart:o,locEnd:i}=e;fl.ok(s>n);let a=t.slice(n,s).search(/\S/u),l=a===-1;if(!l)for(n+=a;s>n&&!/\S/u.test(t[s-1]);--s);let c=gl(r,n,e,(g,y)=>tp(e,g,y),[],"rangeStart"),d=l?c:gl(r,s,e,g=>tp(e,g),[],"rangeEnd");if(!c||!d)return{rangeStart:0,rangeEnd:0};let f,m;if(Qw(e)){let g=Zw(c,d);f=g,m=g}else({startNode:f,endNode:m}=eD(c,d,e));return{rangeStart:Math.min(o(f),o(m)),rangeEnd:Math.max(i(f),i(m))}}var Lf="\uFEFF",rp=Symbol("cursor");async function _f(t,e,r=0){if(!t||t.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:s}=await zs(t,e);e.cursorOffset>=0&&(e={...e,...jf(n,e)});let o=await Oi(n,e);r>0&&(o=df([Wr,o],r,e.tabWidth));let i=Mi(o,e);if(r>0){let l=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(l),i.cursorNodeStart<0&&(i.cursorNodeStart=0,i.cursorNodeText=i.cursorNodeText.trimStart()),i.cursorNodeStart+i.cursorNodeText.length>l.length&&(i.cursorNodeText=i.cursorNodeText.trimEnd())),i.formatted=l+ru(e.endOfLine)}let a=e[Symbol.for("comments")];if(e.cursorOffset>=0){let l,c,d,f;if((e.cursorNode||e.nodeBeforeCursor||e.nodeAfterCursor)&&i.cursorNodeText)if(d=i.cursorNodeStart,f=i.cursorNodeText,e.cursorNode)l=e.locStart(e.cursorNode),c=s.slice(l,e.locEnd(e.cursorNode));else{if(!e.nodeBeforeCursor&&!e.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");l=e.nodeBeforeCursor?e.locEnd(e.nodeBeforeCursor):0;let D=e.nodeAfterCursor?e.locStart(e.nodeAfterCursor):s.length;c=s.slice(l,D)}else l=0,c=s,d=0,f=i.formatted;let m=e.cursorOffset-l;if(c===f)return{formatted:i.formatted,cursorOffset:d+m,comments:a};let g=c.split("");g.splice(m,0,rp);let y=f.split(""),v=O1(g,y),w=d;for(let D of v)if(D.removed){if(D.value.includes(rp))break}else w+=D.count;return{formatted:i.formatted,cursorOffset:w,comments:a}}return{formatted:i.formatted,cursorOffset:-1,comments:a}}async function sD(t,e){let{ast:r,text:n}=await zs(t,e),{rangeStart:s,rangeEnd:o}=nD(n,e,r),i=n.slice(s,o),a=Math.min(s,n.lastIndexOf(`
|
|
69
|
+
`,s)+1),l=n.slice(a,s).match(/^\s*/u)[0],c=au(l,e.tabWidth),d=await _f(i,{...e,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:e.cursorOffset>s&&e.cursorOffset<=o?e.cursorOffset-s:-1,endOfLine:"lf"},c),f=d.formatted.trimEnd(),{cursorOffset:m}=e;m>o?m+=f.length-i.length:d.cursorOffset>=0&&(m=d.cursorOffset+s);let g=n.slice(0,s)+f+n.slice(o);if(e.endOfLine!=="lf"){let y=ru(e.endOfLine);m>=0&&y===`\r
|
|
70
|
+
`&&(m+=rf(g.slice(0,m),`
|
|
71
|
+
`)),g=Ai(!1,g,`
|
|
72
|
+
`,y)}return{formatted:g,cursorOffset:m,comments:d.comments}}function Na(t,e,r){return typeof e!="number"||Number.isNaN(e)||e<0||e>t.length?r:e}function np(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:s}=e;return r=Na(t,r,-1),n=Na(t,n,0),s=Na(t,s,t.length),{...e,cursorOffset:r,rangeStart:n,rangeEnd:s}}function If(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:s,endOfLine:o}=np(t,e),i=t.charAt(0)===Lf;if(i&&(t=t.slice(1),r--,n--,s--),o==="auto"&&(o=L1(t)),t.includes("\r")){let a=l=>rf(t.slice(0,Math.max(l,0)),`\r
|
|
73
|
+
`);r-=a(r),n-=a(n),s-=a(s),t=_1(t)}return{hasBOM:i,text:t,options:np(t,{...e,cursorOffset:r,rangeStart:n,rangeEnd:s,endOfLine:o})}}async function sp(t,e){let r=await du(e);return!r.hasPragma||r.hasPragma(t)}async function oD(t,e){var r;let n=await du(e);return(r=n.hasIgnorePragma)==null?void 0:r.call(n,t)}async function Rf(t,e){let{hasBOM:r,text:n,options:s}=If(t,await Rn(e));if(s.rangeStart>=s.rangeEnd&&n!==""||s.requirePragma&&!await sp(n,s)||s.checkIgnorePragma&&await oD(n,s))return{formatted:t,cursorOffset:e.cursorOffset,comments:[]};let o;return s.rangeStart>0||s.rangeEnd<n.length?o=await sD(n,s):(!s.requirePragma&&s.insertPragma&&s.printer.insertPragma&&!await sp(n,s)&&(n=s.printer.insertPragma(n)),o=await _f(n,s)),r&&(o.formatted=Lf+o.formatted,o.cursorOffset>=0&&o.cursorOffset++),o}async function iD(t,e,r){let{text:n,options:s}=If(t,await Rn(e)),o=await zs(n,s);return r&&(r.preprocessForPrint&&(o.ast=await Bf(o.ast,s)),r.massage&&(o.ast=Gw(o.ast,s))),o}async function aD(t,e){e=await Rn(e);let r=await Oi(t,e);return Mi(r,e)}async function lD(t,e){let r=hv(t),{formatted:n}=await Rf(r,{...e,parser:"__js_expression"});return n}async function uD(t,e){e=await Rn(e);let{ast:r}=await zs(t,e);return e.cursorOffset>=0&&(e={...e,...jf(r,e)}),Oi(r,e)}async function cD(t,e){return Mi(t,await Rn(e))}var Pf={};tu(Pf,{builders:()=>dD,printer:()=>pD,utils:()=>hD});var dD={join:cf,line:lf,softline:dv,hardline:Wr,literalline:uf,group:of,conditionalGroup:ov,fill:iv,lineSuffix:ul,lineSuffixBoundary:uv,cursor:zr,breakParent:Ti,ifBreak:av,trim:cv,indent:_o,indentIfBreak:lv,align:An,addAlignmentToDoc:df,markAsRoot:nv,dedentToRoot:rv,dedent:sv,hardlineWithoutBreakParent:ou,literallineWithoutBreakParent:af,label:pv,concat:t=>t},pD={printDocToString:Mi},hD={willBreak:W1,traverseDoc:nu,findInDoc:su,mapDoc:Ni,removeLines:K1,stripTrailingHardline:sf,replaceEndOfLine:X1,canBreak:Z1},fD="3.6.2",zf={};tu(zf,{addDanglingComment:()=>_r,addLeadingComment:()=>ms,addTrailingComment:()=>gs,getAlignmentSize:()=>au,getIndentSize:()=>vD,getMaxContinuousCount:()=>CD,getNextNonSpaceNonCommentCharacter:()=>ED,getNextNonSpaceNonCommentCharacterIndex:()=>LD,getPreferredQuote:()=>FD,getStringWidth:()=>iu,hasNewline:()=>gr,hasNewlineInRange:()=>ND,hasSpaces:()=>MD,isNextLineEmpty:()=>PD,isNextLineEmptyAfterIndex:()=>mu,isPreviousLineEmpty:()=>ID,makeString:()=>jD,skip:()=>Ps,skipEverythingButNewLine:()=>mf,skipInlineComment:()=>pu,skipNewline:()=>Xr,skipSpaces:()=>wr,skipToLineEnd:()=>ff,skipTrailingComment:()=>hu,skipWhitespace:()=>Nv});function mD(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let r=e+2;r<t.length;++r)if(t.charAt(r)==="*"&&t.charAt(r+1)==="/")return r+2}return e}var pu=mD;function gD(t,e){return e===!1?!1:t.charAt(e)==="/"&&t.charAt(e+1)==="/"?mf(t,e):e}var hu=gD;function bD(t,e){let r=null,n=e;for(;n!==r;)r=n,n=wr(t,n),n=pu(t,n),n=hu(t,n),n=Xr(t,n);return n}var fu=bD;function yD(t,e){let r=null,n=e;for(;n!==r;)r=n,n=ff(t,n),n=pu(t,n),n=wr(t,n);return n=hu(t,n),n=Xr(t,n),n!==!1&&gr(t,n)}var mu=yD;function xD(t,e){let r=t.lastIndexOf(`
|
|
74
|
+
`);return r===-1?0:au(t.slice(r+1).match(/^[\t ]*/u)[0],e)}var vD=xD;function wD(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DD(t,e){let r=t.match(new RegExp(`(${wD(e)})+`,"gu"));return r===null?0:r.reduce((n,s)=>Math.max(n,s.length/e.length),0)}var CD=DD;function kD(t,e){let r=fu(t,e);return r===!1?"":t.charAt(r)}var ED=kD,go="'",op='"';function SD(t,e){let r=e===!0||e===go?go:op,n=r===go?op:go,s=0,o=0;for(let i of t)i===r?s++:i===n&&o++;return s>o?n:r}var FD=SD;function AD(t,e,r){for(let n=e;n<r;++n)if(t.charAt(n)===`
|
|
75
|
+
`)return!0;return!1}var ND=AD;function TD(t,e,r={}){return wr(t,r.backwards?e-1:e,r)!==e}var MD=TD;function BD(t,e,r){let n=e==='"'?"'":'"',s=Ai(!1,t,/\\(.)|(["'])/gsu,(o,i,a)=>i===n?i:a===e?"\\"+a:a||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:"\\"+i));return e+s+e}var jD=BD;function OD(t,e,r){return fu(t,r(e))}function LD(t,e){return arguments.length===2||typeof e=="number"?fu(t,e):OD(...arguments)}function _D(t,e,r){return cu(t,r(e))}function ID(t,e){return arguments.length===2||typeof e=="number"?cu(t,e):_D(...arguments)}function RD(t,e,r){return mu(t,r(e))}function PD(t,e){return arguments.length===2||typeof e=="number"?mu(t,e):RD(...arguments)}function Ir(t,e=1){return async(...r)=>{let n=r[e]??{},s=n.plugins??[];return r[e]={...n,plugins:Array.isArray(s)?s:Object.values(s)},t(...r)}}var $f=Ir(Rf);async function gu(t,e){let{formatted:r}=await $f(t,{...e,cursorOffset:-1});return r}async function zD(t,e){return await gu(t,e)===t}var $D=Ir(wf,0),HD={parse:Ir(iD),formatAST:Ir(aD),formatDoc:Ir(lD),printToDoc:Ir(uD),printDocToString:Ir(cD)};function VD(t=""){const{actions:e,query:r}=Q.useEditor(),{getState:n,loadState:s}=Fi(),{convertFromHtml:o,convertToHtml:i}=Zl(),[a,l]=F.useState(t),[c,d]=F.useState(t),[f,m]=F.useState("idle"),[g,y]=F.useState(""),[v,w]=F.useState(!1),D=F.useCallback(async()=>{if(a.trim()){w(!0);try{const z=await gu(a,{parser:"html",plugins:[b1],printWidth:80,tabWidth:2,useTabs:!1,semi:!0,singleQuote:!1,trailingComma:"none",bracketSpacing:!0,htmlWhitespaceSensitivity:"css"});l(z)}catch(z){console.error("Error formatting HTML:",z);const I=a.replace(/>\s*</g,"><").replace(/\n\s*\n/g,`
|
|
58
76
|
`).split(`
|
|
59
|
-
`).map(
|
|
60
|
-
`);f(oe)}finally{C(!1)}}},[p]),A=S.useRef(null),j=S.useRef(!1),N=p!==h;S.useEffect(()=>{if(!j.current&&r&&a)try{const z=d(s());z&&z.trim()&&(f(z),g(z)),j.current=!0}catch(z){console.warn("Could not initialize code from canvas:",z)}},[r,a]);const P=S.useCallback(async()=>{if(p.trim()){D("processing"),v("");try{const z=u(p,{replace:!0});z&&z.includes("ROOT")&&i(z),D("success")}catch(z){console.error("Error applying code to canvas:",z),D("error"),v(z instanceof Error?z.message:"Unknown error occurred")}}},[p]),M=S.useCallback(z=>{f(z),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{z.trim()?P():D("idle")},1e3)},[P]),_=S.useCallback(()=>{g(p),D("success");try{localStorage.setItem("editor_saved_code",p)}catch(z){console.warn("Could not save to localStorage:",z)}},[p]),$=S.useCallback(()=>{f(h),D("idle"),v(""),A.current&&clearTimeout(A.current)},[h]),L=S.useCallback(()=>{A.current&&clearTimeout(A.current),D("idle"),v("")},[]);return S.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),{codeValue:p,savedCodeValue:h,conversionStatus:w,hasUnsavedChanges:N,errorMessage:y,isFormattingCode:E,handleCodeChange:M,handleSave:_,handleRevert:$,handleClose:L,applyCodeToCanvas:P,formatCode:x}}const Tf=({onClose:e,onFormat:r,onSave:a,isFormattingCode:s,codeValue:i,hasUnsavedChanges:u,conversionStatus:d})=>o.jsxs("div",{className:"flex items-center justify-between border-b border-gray-700 bg-[#23272f] px-4 py-2",children:[o.jsxs("div",{className:"flex items-center space-x-3",children:[o.jsx("div",{className:"group relative",children:o.jsx("button",{className:"rounded p-1 text-gray-400 transition-colors duration-200 hover:text-white",onClick:e,"aria-label":"Close Code Panel",children:o.jsx(T.FiX,{size:18})})}),o.jsx("span",{className:"text-base font-semibold text-white",children:"Code Editor"}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("div",{className:`h-2 w-2 rounded-full ${u?"bg-yellow-500":"bg-green-500"}`}),o.jsx("span",{className:`text-xs font-medium ${u?"text-yellow-400":"text-green-400"}`,children:u?"Unsaved":"Saved"})]})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs("div",{className:"group relative",children:[o.jsx("button",{onClick:r,disabled:s||!i.trim(),className:"rounded p-1 text-gray-400 transition-colors duration-200 hover:text-white disabled:cursor-not-allowed disabled:text-gray-600","aria-label":"Format HTML",children:s?o.jsx(T.FiLoader,{size:18,className:"animate-spin"}):o.jsx(T.FiFileText,{size:18})}),o.jsx("span",{className:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded bg-gray-900 px-2 py-1 text-xs text-white opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:s?"Formatting HTML...":"Format HTML"})]}),o.jsxs("div",{className:"group relative",children:[o.jsx("button",{onClick:a,disabled:d==="processing"||!u,className:"rounded p-1 text-gray-400 transition-colors duration-200 hover:text-white disabled:cursor-not-allowed disabled:text-gray-600","aria-label":"Save HTML",children:o.jsx(T.FiSave,{size:18})}),o.jsx("span",{className:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded bg-gray-900 px-2 py-1 text-xs text-white opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:"Save"})]})]})]});function Lf({height:e="100%",defaultLanguage:r="html",theme:a="vs-dark",value:s,onChange:i,options:u}){const d=S.useRef(null),[p,f]=S.useState(null);return S.useEffect(()=>{const h=document.createElement("div");return h.style.position="fixed",h.style.top="0",h.style.left="0",h.style.width="100%",h.style.height="100%",h.style.pointerEvents="none",h.style.zIndex="9999",document.body.appendChild(h),f(h),()=>{h.parentNode&&h.parentNode.removeChild(h)}},[]),S.useEffect(()=>{if(!d.current||!p)return;const h=()=>{if(!d.current||!p)return;const D=d.current.getBoundingClientRect(),y=p.firstChild;y&&(y.style.position="absolute",y.style.top=`${D.top}px`,y.style.left=`${D.left}px`,y.style.width=`${D.width}px`,y.style.height=`${D.height}px`,y.style.pointerEvents="auto")};h();const g=()=>{requestAnimationFrame(h)};window.addEventListener("resize",g),window.addEventListener("scroll",g,!0);let w;return window.ResizeObserver&&(w=new ResizeObserver(g),w.observe(d.current)),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0),w&&w.disconnect()}},[p]),o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:d,style:{width:"100%",height:e}}),p&&Nd.createPortal(o.jsx("div",{style:{backgroundColor:"#1e1e1e"},children:o.jsx(Pd.default,{height:e,defaultLanguage:r,theme:a,value:s,onChange:i,options:u})}),p)]})}function Pf({onClose:e}){const{codeValue:r,conversionStatus:a,hasUnsavedChanges:s,handleCodeChange:i,handleSave:u,handleClose:d,formatCode:p,isFormattingCode:f}=Bf();return o.jsxs("div",{className:"flex h-full w-1/2 flex-col border-r border-gray-200 bg-[#181c24]",children:[o.jsx(Tf,{onClose:()=>{d(),e()},onFormat:p,onSave:u,isFormattingCode:f,codeValue:r,hasUnsavedChanges:s,conversionStatus:a}),o.jsx("div",{className:"flex-1 p-0",style:{width:"100%",height:"100%"},children:o.jsx(Lf,{height:"100%",defaultLanguage:"html",theme:"vs-dark",value:r,onChange:h=>i(h||""),options:{fontSize:16,padding:{top:10},minimap:{enabled:!1},wordWrap:"on",scrollBeyondLastLine:!1,formatOnPaste:!0,formatOnType:!0,autoIndent:"full",tabSize:2,insertSpaces:!0,automaticLayout:!0,folding:!0,lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},suggest:{showKeywords:!0,showSnippets:!0}}})})]})}const If={loading:!1,template:{}},di=S.createContext(If);function pi(){const e=S.useContext(di);if(!e)throw new Error("useTemplate must be used within a TemplateProvider");return e}const Of={},Mf=(e,r)=>({onDeleteNode:()=>{const a=r.getEvent("selected").last();a&&e.delete(a)},onCopy:()=>{const a=r.getEvent("selected").last();if(!a){console.warn("[Copy] No node selected");return}try{const s=r.node(a).toNodeTree();console.log("[Copy] Node tree:",s);const i={type:"craftjs-copy",nodeTree:s,selectedId:a,timestamp:Date.now()};console.log("[Copy] Copy data:",i);const u=JSON.stringify(i,(d,p)=>{if(!["dom","rules","_hydrationTimestamp","events"].includes(d))return d==="type"&&typeof p=="function"?{resolvedName:p.name||p.displayName||"Unknown"}:p});navigator.clipboard.writeText(u),console.log("[Copy] Successfully copied to clipboard")}catch(s){console.error("[Copy] Failed to copy node:",s)}},onPaste:async()=>{console.log("[Paste] Starting paste operation...");try{const a=await navigator.clipboard.readText();if(console.log("[Paste] Clipboard text:",a),!a){console.warn("[Paste] Clipboard is empty");return}let s;try{s=JSON.parse(a),console.log("[Paste] Parsed clipboard data:",s)}catch(w){console.warn("[Paste] Invalid clipboard data:",w);return}if(!s||s.type!=="craftjs-copy"||!s.nodeTree){console.warn("[Paste] Clipboard does not contain valid node data");return}const i=s.nodeTree;console.log("[Paste] Node tree to paste:",i);const d=(w=>{const D={...w},y={},v=()=>Math.random().toString(36).substring(2,15);if(D.nodes&&(Object.keys(D.nodes).forEach(E=>{y[E]=v()}),D.rootNodeId&&y[D.rootNodeId]&&(D.rootNodeId=y[D.rootNodeId])),D.nodes){const E={};Object.keys(D.nodes).forEach(C=>{const x={...D.nodes[C]},A=y[C];if(x.id=A,x.events=x.events||{selected:!1,dragged:!1,hovered:!1},x.dom=null,x.rules=x.rules||{canDrag:()=>!0,canDrop:()=>!0,canMoveIn:()=>!0,canMoveOut:()=>!0},x.data){if(x.data.props=x.data.props||{},x.data.custom=x.data.custom||{},x.data.hidden=x.data.hidden||!1,x.data.isCanvas=x.data.isCanvas||!1,x.data.nodes=x.data.nodes||[],x.data.linkedNodes=x.data.linkedNodes||{},x.data.displayName=x.data.displayName||x.data.type?.displayName||"Component",x.data.parent&&y[x.data.parent]&&(x.data.parent=y[x.data.parent]),x.data.nodes&&Array.isArray(x.data.nodes)&&(x.data.nodes=x.data.nodes.map(j=>y[j]||j)),x.data.linkedNodes){const j={};Object.keys(x.data.linkedNodes).forEach(N=>{const P=x.data.linkedNodes[N];j[N]=y[P]||P}),x.data.linkedNodes=j}if(x.data.type&&typeof x.data.type=="object"&&x.data.type.resolvedName){const j=Jt.find(N=>{const P=typeof N.component=="function"?N.component.name||N.component.displayName:"";return N.id===x.data.type.resolvedName||P===x.data.type.resolvedName});j?(x.data.type=j.component,console.log("[Paste] Resolved component:",x.data.type.resolvedName,"to",j.component)):console.warn("[Paste] Could not resolve component:",x.data.type.resolvedName)}}E[A]=x}),D.nodes=E}return D})(i);console.log("[Paste] Reconstructed node tree:",d);const p=r.getEvent("selected").last();let f="ROOT",h;if(p){const w=r.node(p).get();if(console.log("[Paste] Selected node data:",w),w.data.isCanvas)f=p,h=(w.data.nodes||[]).length,console.log("[Paste] Inserting as child of canvas node:",p,"at index:",h);else{const D=w.data.parent;D?(f=D,h=r.node(f).get().data.nodes.indexOf(p)+1,console.log("[Paste] Inserting after selected node in parent:",f,"at index:",h)):(f="ROOT",h=r.node("ROOT").get().data.nodes.indexOf(p)+1,console.log("[Paste] Inserting after selected node in ROOT at index:",h))}}else h=r.node("ROOT").get().data.nodes.length,console.log("[Paste] No selection, adding to end of ROOT at index:",h);console.log("[Paste] Will insert at parent:",f,"index:",h),console.log("[Paste] Using addNodeTree with reconstructed nodeTree:",d),e.addNodeTree(d,f,h);const g=d.rootNodeId;g&&(console.log("[Paste] Selecting newly pasted node:",g),e.selectNode(g)),console.log("[Paste] Node pasted successfully")}catch(a){console.error("[Paste] Failed to paste:",a),a instanceof Error&&console.error("[Paste] Error stack:",a.stack)}},onUndo:()=>e.history.undo(),onRedo:()=>e.history.redo(),onSave:()=>{const a=r.serialize();console.log("Saving JSON:",a)}});function Rf(){const{actions:e,query:r}=H.useEditor(),a=i=>i.toLowerCase().charAt(0).toUpperCase()+i.toLowerCase().slice(1),s=i=>i.includes("_")?`on${i.split("_").map(a).join("")}`:`on${a(i)}`;S.useEffect(()=>{const i=Mf(e,r),u=d=>{const p=navigator.platform.includes("Mac"),f=[];(p&&d.metaKey||!p&&d.ctrlKey)&&f.push(p?"Meta":"Ctrl"),d.shiftKey&&f.push("Shift"),f.push(d.key);const h=f.join("+");Object.entries(Of).forEach(([g,w])=>{if(w.keys.includes(h)){d.preventDefault();const D=i[s(g)];console.log("Executing shortcut:",g,s(g)),D?.()}})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,r])}const zf=({name:e})=>o.jsx("div",{className:"border-b border-[#e8e7ee] bg-gray-50 p-4",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded bg-[#170f4f]",children:o.jsx("span",{className:"text-xs font-medium text-white",children:e.charAt(0).toUpperCase()})}),o.jsx("div",{className:"flex-1",children:o.jsx("h3",{className:"text-sm font-medium text-[#170f4f]",children:e})})]})});function $f(){const{selected:e,actions:r,query:a}=H.useEditor(h=>({selected:h.events.selected})),s=()=>{if(e&&e.size>0){const h=Array.from(e)[0];r.delete(h)}},i=()=>{if(e&&e.size>0){const h=Array.from(e)[0];console.log("Clone component:",h)}},u=()=>{if(e&&e.size>0){const h=Array.from(e)[0];console.log("Move up component:",h)}},d=()=>{if(e&&e.size>0){const h=Array.from(e)[0];console.log("Move down component:",h)}};S.useEffect(()=>{const h=g=>{if(e&&e.size>0){const w=g.target;!(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.contentEditable==="true")&&(g.key==="Backspace"||g.key==="Delete")&&(g.preventDefault(),s())}};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[e]);const f=(()=>{if(!e||e.size===0)return null;const h=Array.from(e)[0],g=a.node(h).get();return g?{id:h,type:g.data.type,displayName:g.data.displayName||String(g.data.type),props:g.data.props,isCanvas:g.data.isCanvas,isDeletable:!0,isDuplicateable:!0,parent:g.data.parent}:null})();return f?o.jsxs("div",{className:"space-y-3 p-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("button",{onClick:i,disabled:!f.isDuplicateable,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[o.jsx(T.FiCopy,{size:14}),"Duplicate"]}),o.jsxs("button",{onClick:s,disabled:!f.isDeletable,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:border-red-300 hover:bg-red-50 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-50",children:[o.jsx(T.FiTrash2,{size:14}),"Delete"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("button",{onClick:u,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50",children:[o.jsx(T.FiArrowUp,{size:14}),"Move Up"]}),o.jsxs("button",{onClick:d,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50",children:[o.jsx(T.FiArrowDown,{size:14}),"Move Down"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("button",{className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50",children:[o.jsx(T.FiLock,{size:14}),"Lock"]}),o.jsxs("button",{className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50",children:[o.jsx(T.FiEyeOff,{size:14}),"Hide"]})]})]}):null}function Hf(){const{selected:e,query:r}=H.useEditor(h=>({selected:h.events.selected})),[a,s]=S.useState(""),i=S.useRef(null),u=()=>{if(i.current){const h=i.current.textContent||"";navigator.clipboard.writeText(h).then(()=>{console.log("HTML copied to clipboard")})}},d=h=>{try{const g=r.node(h).get();return g&&g.dom?g.dom.outerHTML.replace(/data-cy="[^"]*"/g,"").replace(/data-craft-id="[^"]*"/g,"").replace(/data-node-id="[^"]*"/g,"").replace(/class="[^"]*craft[^"]*"/g,'class=""').replace(/class="[^"]*ring-[^"]*"/g,'class=""').replace(/class="[^"]*hover:[^"]*"/g,'class=""').replace(/class="[^"]*transition-[^"]*"/g,'class=""').replace(/class="[^"]*duration-[^"]*"/g,'class=""').replace(/class="[^"]*opacity-[^"]*"/g,'class=""').replace(/class="[^"]*cursor-[^"]*"/g,'class=""').replace(/class="[^"]*min-h-screen[^"]*"/g,'class=""').replace(/class="[^"]*bg-white[^"]*"/g,'class=""').replace(/class=""/g,"").replace(/\s+/g," ").trim()||"<!-- No HTML available -->":"<!-- Component not found in DOM -->"}catch(g){return console.error("Error getting component HTML:",g),"<!-- Error getting component HTML -->"}};S.useEffect(()=>{if(e&&e.size>0){const h=Array.from(e)[0];if(r.node(h).get()){const w=d(h);s(w)}}else s("")},[e,r]);const f=(()=>{if(!e||e.size===0)return null;const h=Array.from(e)[0],g=r.node(h).get();return g?{id:h,type:g.data.type,displayName:g.data.displayName||String(g.data.type),props:g.data.props,isCanvas:g.data.isCanvas,isDeletable:!0,isDuplicateable:!0,parent:g.data.parent}:null})();return f?o.jsxs("div",{className:"space-y-4 p-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-700",children:"Component ID"}),o.jsx("input",{type:"text",value:f.id,readOnly:!0,className:"w-full rounded-none border border-[#e8e7ee] bg-gray-50 px-3 py-2 text-xs focus:outline-none"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-700",children:"Component Parent"}),o.jsx("input",{type:"text",value:String(f.parent),readOnly:!0,className:"w-full rounded-none border border-[#e8e7ee] bg-gray-50 px-3 py-2 text-xs focus:outline-none"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-700",children:"Properties"}),o.jsx("div",{className:"rounded-none border border-[#e8e7ee] bg-gray-50 p-3",children:o.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-600",children:JSON.stringify(f?.props,null,2)})})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[o.jsx("label",{className:"block text-xs font-medium text-gray-700",children:"Component HTML"}),o.jsx("button",{onClick:u,className:"rounded-none p-1 text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600",title:"Copy HTML to clipboard",children:o.jsx(T.FiClipboard,{size:14})})]}),o.jsx("div",{className:"rounded-none border border-[#e8e7ee] bg-gray-50 p-3",children:o.jsx("pre",{ref:i,className:"whitespace-pre-wrap font-mono text-xs text-gray-600",children:a||"<!-- No HTML available -->"})})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{className:"inline-flex items-center rounded bg-blue-100 px-2 py-1 text-xs font-medium text-blue-800",children:f.isCanvas?"Canvas":"Component"}),f.isDeletable&&o.jsx("span",{className:"inline-flex items-center rounded bg-green-100 px-2 py-1 text-xs font-medium text-green-800",children:"Deletable"}),f.isDuplicateable&&o.jsx("span",{className:"inline-flex items-center rounded bg-purple-100 px-2 py-1 text-xs font-medium text-purple-800",children:"Duplicatable"})]})]}):null}function qf(){const{actions:{setProp:e},text:r}=H.useNode(a=>({text:a.data.props.children}));return o.jsx("div",{className:"space-y-4 p-4",children:o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Text"}),o.jsx("textarea",{rows:5,value:r,onChange:a=>e(s=>s.children=a.target.value),className:"focus:ring-primary-500 min-h-fit w-full rounded-md border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2"})]})})}const Yt=({title:e,icon:r,children:a,defaultOpen:s=!1,className:i=""})=>{const u=S.useRef(null),[d,p]=S.useState(s),[f,h]=S.useState(s?void 0:0),g=S.useRef(null);S.useEffect(()=>{u.current&&u.current.parentElement&&u.current.parentElement.firstElementChild===u.current&&!s&&(p(!0),h(void 0))},[s]),S.useEffect(()=>{if(g.current)if(d){const D=g.current.scrollHeight;h(D)}else h(0)},[d]);const w=()=>{p(!d)};return o.jsxs("div",{ref:u,className:`overflow-hidden border border-[#E8E7EE] ${i}`,children:[o.jsxs("button",{onClick:w,className:"flex w-full items-center justify-between border-b border-[#E8E7EE] bg-white px-4 py-3 transition-colors hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-[#170F4F]",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[r,o.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:e})]}),o.jsx(T.FiChevronDown,{size:16,className:`text-[#A29FB9] transition-transform duration-200 ${d?"rotate-0":"-rotate-90"}`})]}),o.jsx("div",{ref:g,style:{height:f,overflow:"hidden",transition:"height 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},"data-testid":`collapse-content-${e.replace(/\s+/g,"-").toLowerCase()}`,children:d&&o.jsx("div",{className:"bg-white p-4",children:a})})]})};function hi(){const{actions:{setProp:e},style:{backgroundColor:r}={}}=H.useNode(a=>({style:a.data.props.style||{}}));return o.jsx(Yt,{title:"Background",icon:o.jsx(T.FiEdit3,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"color",value:r,onChange:a=>e(s=>s.style.backgroundColor=a.target.value),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),o.jsx("input",{type:"text",value:r,onChange:a=>e(s=>s.style.backgroundColor=a.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})})}function mi(){const{actions:{setProp:e},style:{borderStyle:r,borderRadius:a,borderColor:s,borderWidth:i}={}}=H.useNode(u=>({style:u.data.props.style||{}}));return o.jsx(Yt,{title:"Border",icon:o.jsx(T.FiSquare,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Radius"}),o.jsx("div",{className:"grid grid-cols-4 gap-1",children:[{value:"",label:"0"},{value:"4px",label:"4px"},{value:"8px",label:"8px"},{value:"9999px",label:"1/2"}].map(u=>o.jsx("button",{onClick:()=>e(d=>d.style.borderRadius=u.value),className:`border border-[#E8E7EE] px-2 py-2 text-xs transition-all ${a===u.value?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:u.label},u.value))})]}),o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Width"}),o.jsx("div",{className:"grid grid-cols-4 gap-1",children:[{value:"0px",label:"0"},{value:"1px",label:"1px"},{value:"2px",label:"2px"},{value:"4px",label:"4px"}].map(u=>o.jsx("button",{onClick:()=>e(d=>d.style.borderWidth=u.value),className:`border border-[#E8E7EE] px-2 py-2 text-xs transition-all ${i===u.value?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:u.label},u.value))})]}),o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border type"}),o.jsxs("div",{className:"mb-2 grid grid-cols-2 gap-2",children:[o.jsx("button",{onClick:()=>e(u=>u.style.borderStyle="none"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${r==="none"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"None"}),o.jsx("button",{onClick:()=>e(u=>u.style.borderStyle="solid"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${r==="solid"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"Light"}),o.jsx("button",{onClick:()=>e(u=>u.style.borderStyle="dotted"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${r==="dotted"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"Dotted"}),o.jsx("button",{onClick:()=>e(u=>u.style.borderStyle="dashed"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${r==="dashed"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"Dashed"})]}),o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Color"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"color",value:s,onChange:u=>e(d=>d.style.borderColor=u.target.value),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),o.jsx("input",{type:"text",value:s,onChange:u=>e(d=>d.style.borderColor=u.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})]})]})})}const we=S.forwardRef(({value:e,onChange:r,min:a,max:s,defaultUnit:i="px",allowedUnits:u=[],className:d="",...p},f)=>{const[h,g]=S.useState(""),[w,D]=S.useState(!1),y=S.useCallback(N=>{if(typeof N=="number")return{value:N,unit:i,text:`${N}${i}`};if(typeof N=="string"&&N.trim()){const P=N.trim(),M=P.match(/^(-?\d*\.?\d+)(.*)$/);if(!M)return{value:0,unit:i,text:""};const[,_,$]=M,L=parseFloat(_),z=$.trim()||i,oe=u.length>0&&!u.includes(z)?i:z;return{value:L,unit:oe,text:P}}return{value:0,unit:i,text:""}},[i,u]),v=S.useMemo(()=>{if(!e||typeof e=="string"&&e.trim()==="")return"";const N=y(e);return`${N.value}${N.unit}`},[e,y]),E=S.useCallback(N=>{g(N.target.value)},[]),C=S.useCallback(N=>{if(N.key==="Enter"){N.currentTarget.blur();return}if(N.key==="ArrowUp"||N.key==="ArrowDown"){N.preventDefault();const P=w?h:v;if(!P.trim())return;const M=y(P);if(isNaN(M.value))return;const _=N.shiftKey?10:N.ctrlKey||N.metaKey?.1:1,$=N.key==="ArrowUp"?M.value+_:M.value-_,L=Math.min(s??$,Math.max(a??$,$)),z=`${L}${M.unit}`;g(z),r?.({value:L,unit:M.unit,text:z})}},[w,h,v,y,a,s,r]),x=S.useCallback(()=>{D(!0),!h&&e&&g(typeof e=="string"?e:v)},[h,e,v]),A=S.useCallback(()=>{if(D(!1),!h.trim()){g(""),r?.({value:0,unit:i,text:""});return}const N=y(h),P=Math.min(s??N.value,Math.max(a??N.value,N.value)),M=`${P}${N.unit}`;g(M),r?.({value:P,unit:N.unit,text:M})},[h,r,i,y,a,s]),j=`border border-[#E8E7EE] bg-white text-center text-xs transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F] disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400 ${d.includes("px-")||d.includes("py-")?"":"px-1 py-0.5"}`;return o.jsx("input",{ref:f,type:"text",value:w?h:v,onChange:E,onFocus:x,onBlur:A,onKeyDown:C,className:`${j} ${d}`.trim(),...p})});we.displayName="DimensionInput";const eo={min:0,defaultUnit:"px",allowedUnits:["px","rem","%","vh","vw"],placeholder:"auto",className:"w-20 px-2 py-1 text-xs"};function fi(){const{actions:{setProp:e},style:{columns:r,columnSpacing:a,alignment:s,minHeight:i,width:u,height:d}={}}=H.useNode(h=>({style:h.data.props.style||{}})),p=()=>{r<6&&e(h=>h.style.columns=r+1)},f=()=>{r>1&&e(h=>h.style.columns=r-1)};return o.jsx(Yt,{title:"Layout",icon:o.jsx(T.FiLayout,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Width"}),o.jsx(we,{value:u,onChange:h=>e(g=>g.style.width=h.text),...eo})]}),o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Height"}),o.jsx(we,{value:d,onChange:h=>e(g=>g.style.height=h.text),...eo})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"text-xs text-[#A29FB9]",children:"Min Height"}),o.jsxs("span",{className:"bg-[#E8E7EE] px-2 py-1 font-mono text-xs text-[#170F4F]",children:[i,"px"]})]}),o.jsx("input",{type:"range",min:"50",max:"400",step:"25",value:i,onChange:h=>e(g=>g.style.minHeight=parseInt(h.target.value)),className:"slider-modern h-2 w-full cursor-pointer appearance-none bg-[#E8E7EE]",style:{background:`linear-gradient(to right, #170F4F 0%, #170F4F ${(i-50)/350*100}%, #E8E7EE ${(i-50)/350*100}%, #E8E7EE 100%)`}})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"text-xs text-[#A29FB9]",children:"Columns"}),o.jsx("span",{className:"bg-[#E8E7EE] px-2 py-1 font-mono text-xs text-[#170F4F]",children:r})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("button",{onClick:f,disabled:r<=1,className:"flex h-8 w-8 items-center justify-center border border-[#E8E7EE] bg-[#E8E7EE] text-[#A29FB9] transition-all hover:border-[#00BAC7] hover:bg-[#CCF1F4] disabled:cursor-not-allowed disabled:opacity-30",children:o.jsx(T.FiMinus,{size:14})}),o.jsx("div",{className:"flex flex-1 justify-center py-1",children:o.jsx("div",{className:"flex gap-1",children:Array.from({length:r},(h,g)=>o.jsx("div",{className:"h-8 w-4 border border-[#170F4F] bg-[#170F4F]"},g))})}),o.jsx("button",{onClick:p,disabled:r>=6,className:"flex h-8 w-8 items-center justify-center border border-[#E8E7EE] bg-[#E8E7EE] text-[#A29FB9] transition-all hover:border-[#00BAC7] hover:bg-[#CCF1F4] disabled:cursor-not-allowed disabled:opacity-30",children:o.jsx(T.FiPlus,{size:14})})]})]}),r>1&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"text-xs text-[#A29FB9]",children:"Column Gap"}),o.jsxs("span",{className:"bg-[#E8E7EE] px-2 py-1 font-mono text-xs text-[#170F4F]",children:[a,"px"]})]}),o.jsx("input",{type:"range",min:"0",max:"40",step:"2",value:a,onChange:h=>e(g=>g.style.columnSpacing=parseInt(h.target.value)),className:"slider-modern h-2 w-full cursor-pointer appearance-none bg-[#E8E7EE]",style:{background:`linear-gradient(to right, #170F4F 0%, #170F4F ${a/40*100}%, #E8E7EE ${a/40*100}%, #E8E7EE 100%)`}})]}),o.jsxs("div",{children:[o.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Alignment"}),o.jsx(Ve,{options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],value:s,onChange:h=>e(g=>g.style.alignment=h),placeholder:"Choose alignment"})]})]})})}function Ht(e){if(e!=null){if(typeof e=="number")return e===0?"0":void 0;if(typeof e=="string"){const r=e.trim();return r==="0"?"0":/^-?\d+(\.\d+)?(px|em|rem|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i.test(r)?r:void 0}}}function to(e={},r){const a=Ht(e[r]),s=Ht(e[`${r}Top`]),i=Ht(e[`${r}Right`]),u=Ht(e[`${r}Bottom`]),d=Ht(e[`${r}Left`]);if(a){const p=a.trim().split(/\s+/);switch(p.length){case 1:return{top:p[0],right:p[0],bottom:p[0],left:p[0]};case 2:return{top:p[0],right:p[1],bottom:p[0],left:p[1]};case 3:return{top:p[0],right:p[1],bottom:p[2],left:p[1]};case 4:return{top:p[0],right:p[1],bottom:p[2],left:p[3]}}}return{top:s,right:i,bottom:u,left:d}}const Ue={min:0,defaultUnit:"px",allowedUnits:["px","rem","%"],placeholder:"none",className:"w-10 px-0.5 py-0.5 text-xs"};function gi(){const{actions:{setProp:e},style:r={}}=H.useNode(i=>({style:i.data.props.style||{}})),a=S.useMemo(()=>to(r,"margin"),[r]),s=S.useMemo(()=>to(r,"padding"),[r]);return o.jsx(Yt,{title:"Spacing",icon:o.jsx(T.FiMove,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:o.jsx("div",{className:"space-y-3",children:o.jsx("div",{children:o.jsxs("div",{className:"relative border border-[#dce7fe] bg-[#F9FAFB] p-2",children:[o.jsx("div",{className:"absolute left-1 top-[-2px] -translate-y-1/2",children:o.jsx("span",{className:"bg-[#F9FAFB] px-1 text-xs text-[#A29FB9]",style:{background:"linear-gradient(to bottom,transparent 0%,transparent 50%, #F9FAFB 50%, #F9FAFB 100%)"},children:"Margin"})}),o.jsx("div",{className:"mb-1 flex justify-center",children:o.jsx(we,{value:a.top,onChange:i=>e(u=>u.style.marginTop=i.text),...Ue})}),o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx(we,{value:a.left,onChange:i=>e(u=>u.style.marginLeft=i.text),...Ue}),o.jsxs("div",{className:"relative mx-2 my-1 flex-1 border-2 border-dashed border-[#3B82F6] bg-[#EFF6FF] p-2",children:[o.jsx("div",{className:"absolute left-1 top-[-3px] -translate-y-1/2",children:o.jsx("span",{className:"bg-[#EFF6FF] px-1 text-xs text-[#3B82F6]",style:{background:"linear-gradient(to bottom, transparent 0%, transparent 50%, #EFF6FF 50%, #EFF6FF 100%)"},children:"Padding"})}),o.jsx("div",{className:"mb-1 flex justify-center",children:o.jsx(we,{value:s.top,onChange:i=>e(u=>u.style.paddingTop=i.text),...Ue})}),o.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[o.jsx(we,{value:s.left,onChange:i=>e(u=>u.style.paddingLeft=i.text),...Ue}),o.jsx("div",{className:"mx-2 my-1 flex h-6 flex-1 items-center justify-center border border-[#D1D5DB] bg-white px-2 py-1",children:o.jsx("span",{className:"text-[10px] font-medium text-[#6B7280] opacity-60",children:"Content"})}),o.jsx(we,{value:s.right,onChange:i=>e(u=>u.style.paddingRight=i.text),...Ue})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(we,{value:s.bottom,onChange:i=>e(u=>u.style.paddingBottom=i.text),...Ue})})]}),o.jsx(we,{value:a.right,onChange:i=>e(u=>u.style.marginRight=i.text),...Ue})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(we,{value:a.bottom,onChange:i=>e(u=>u.style.marginBottom=i.text),...Ue})})]})})})})}function Uf(){return o.jsxs(o.Fragment,{children:[o.jsx(fi,{}),o.jsx(gi,{}),o.jsx(hi,{}),o.jsx(mi,{})]})}const Wf=["Inter","Roboto","Arial","Georgia","Times New Roman","Montserrat","Lato","Oswald","Poppins"],Vf=[{label:"Lighter",value:"lighter"},{label:"Normal",value:"normal"},{label:"Bold",value:"bold"},{label:"Bolder",value:"bolder"},{label:"100",value:"100"},{label:"200",value:"200"},{label:"300",value:"300"},{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"},{label:"800",value:"800"},{label:"900",value:"900"}],Jf=[{label:"Normal",value:"normal"},{label:"No wrapped",value:"nowrap"}];function Gf(){const{actions:{setProp:e},style:r={}}=H.useNode(s=>({style:s.data.props.style})),a=S.useCallback(s=>{e(i=>{i.style={...i.style,...s}})},[e]);return o.jsx(Yt,{title:"Typography",icon:o.jsx(zt.LuType,{size:14,className:"text-[#170F4F]"}),defaultOpen:!0,children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Font"}),o.jsx(Ve,{options:Wf.map(s=>({value:s,label:s})),value:r.fontFamily||"Inter",onChange:s=>a({fontFamily:s}),placeholder:"Choose font family"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Size"}),o.jsx("input",{type:"number",min:8,max:96,value:r.fontSize||20,onChange:s=>a({fontSize:Number(s.target.value)}),className:"w-full border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Weight"}),o.jsx(Ve,{options:Vf,value:r.fontWeight||"normal",onChange:s=>a({fontWeight:s}),placeholder:"Choose font weight"})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T.FiMove,{size:14,className:"text-[#170F4F]"}),o.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:"Alignment"})]}),o.jsx("div",{className:"flex gap-2",children:["left","center","right","justify"].map(s=>o.jsx("button",{className:`rounded border px-3 py-2 text-xs font-medium transition-all focus:outline-none focus:ring-2 focus:ring-[#170F4F] ${r.textAlign===s?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>a({textAlign:s}),children:s.charAt(0).toUpperCase()+s.slice(1)},s))}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Line Break"}),o.jsx(Ve,{options:Jf,value:r.whiteSpace||"normal",onChange:s=>a({whiteSpace:s}),placeholder:"Choose whiteSpace"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(zt.LuRemoveFormatting,{size:14,className:"text-[#170F4F]"}),o.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:"Formatting"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{className:`rounded border px-3 py-2 text-xs font-bold ${r?.fontWeight==="bold"?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>a({fontWeight:r?.fontWeight==="bold"?"normal":"bold"}),children:o.jsx(zt.LuBold,{size:14,className:"text-[#170F4F]"})}),o.jsx("button",{className:`rounded border px-3 py-2 text-xs italic ${r?.fontStyle==="italic"?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>a({fontStyle:r?.fontStyle==="italic"?"normal":"italic"}),children:o.jsx(zt.LuItalic,{size:14,className:"text-[#170F4F]"})}),o.jsx("button",{className:`rounded border px-3 py-2 text-xs underline ${r?.textDecoration==="underline"?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>a({textDecoration:r?.textDecoration==="underline"?"none":"underline"}),children:o.jsx(zt.LuUnderline,{size:14,className:"text-[#170F4F]"})})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T.FiEdit3,{size:14,className:"text-[#170F4F]"}),o.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:"Text Color"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"color",value:r.color||"#000000",onChange:s=>a({color:s.target.value}),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Text color"}),o.jsx("input",{type:"text",value:r.color||"#000000",onChange:s=>a({color:s.target.value}),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#000000"})]})]})]})})}const Kf={default:Uf,typography:Gf,layout:fi,spacing:gi,background:hi,border:mi,box:io,text:qf,button:jn,image:Tn,anchor:Nn,divider:_n,table:co},Yf=Object.entries(Kf).map(([e,r])=>({id:e,component:r}));function Xf(){const{selected:e,query:r}=H.useEditor(i=>({selected:i.events.selected}));if(!e||e.size===0)return o.jsx("div",{className:"flex h-full items-center justify-center text-gray-500",children:o.jsxs("div",{className:"text-center",children:[o.jsx(T.FiSettings,{size:48,className:"mx-auto mb-4 text-gray-300"}),o.jsx("p",{className:"text-sm",children:"Select a component to see its settings"})]})});const a=Array.from(e)[0],s=r.node(a).get();if(!s)return null;if(s&&s.data.custom&&s.data.custom.settings){const i=s.data.custom.settings,d=(Array.isArray(i)?i:[i]).map(p=>Yf.find(f=>f.id===p)).filter(Boolean);if(d.length>0)return o.jsx(o.Fragment,{children:d.map(p=>{const f=p.component;return Ke.default.createElement(H.NodeProvider,{id:a,related:!0,key:p.id},o.jsx(f,{}))})})}return o.jsx("div",{className:"p-4",children:o.jsx("p",{className:"text-sm text-gray-500",children:"No custom settings available for this component."})})}const Zf=[{id:"settings",label:"Settings",icon:T.FiSettings},{id:"info",label:"Info",icon:T.FiInfo},{id:"actions",label:"Actions",icon:T.FiEye}];function Qf(){const{selected:e,query:r}=H.useEditor(d=>({selected:d.events.selected})),[a,s]=S.useState("settings"),i=S.useMemo(()=>({settings:o.jsx(Xf,{}),info:o.jsx(Hf,{}),actions:o.jsx($f,{})}),[]),u=S.useMemo(()=>{if(!e||e.size===0)return null;const d=Array.from(e)[0],p=r.node(d).get();return p?{id:d,type:p.data.type,displayName:p.data.displayName||String(p.data.type),props:p.data.props,isCanvas:p.data.isCanvas,isDeletable:!0,isDuplicateable:!0,parent:p.data.parent}:null},[e,r]);return o.jsxs("div",{className:"flex h-full w-80 flex-col border-l border-[#e8e7ee] bg-white",children:[u&&o.jsx(zf,{name:String(u.displayName)}),u&&o.jsx("div",{className:"flex border-b border-[#e8e7ee]",children:Zf.map(d=>{const p=d.icon;return o.jsxs("button",{onClick:()=>s(d.id),className:`flex flex-1 items-center justify-center gap-2 px-3 py-2 text-xs font-medium transition-colors duration-200 ${a===d.id?"border-b-2 border-[#170f4f] bg-white text-[#170f4f]":"text-gray-500 hover:bg-gray-50 hover:text-[#170f4f]"}`,children:[o.jsx(p,{size:14}),d.label]},d.id)})}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:i[a]})]})}function eg({blocks:e,searchTerm:r}){const{connectors:a,query:s}=H.useEditor(),[i,u]=S.useState(new Set),d=S.useRef({}),[p,f]=S.useState({}),h=S.useMemo(()=>r.trim()?e.filter(x=>x.label.toLowerCase().includes(r.toLowerCase())||x.category?.toLowerCase().includes(r.toLowerCase())):e,[e,r]),g=h.reduce((x,A)=>{const j=A.category||"other";return x[j]||(x[j]=[]),x[j].push(A),x},{}),w=x=>{u(A=>{const j=new Set(A);return j.has(x)?j.delete(x):j.add(x),j})};S.useEffect(()=>{const x=Object.keys(g);if(x[0]&&i.size===0){const j=new Set(x.slice(1));u(j)}},[g]),S.useEffect(()=>{Object.keys(d.current).forEach(x=>{const A=d.current[x];if(A){const j=i.has(x);f(j?N=>({...N,[x]:0}):N=>({...N,[x]:A.scrollHeight}))}})},[i,h]);const D=x=>o.jsxs("div",{ref:A=>{A&&a.create(A,Ke.default.createElement(x.component,{}),{})},className:"group flex cursor-move flex-col items-center gap-1.5 rounded-md bg-white p-2.5 text-center transition-all duration-200 hover:bg-gray-50",draggable:!0,onDragStart:A=>{A.currentTarget.style.opacity="0.5"},onDragEnd:A=>{A.currentTarget.style.opacity="1"},title:`Drag to add ${x.label} component`,children:[o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded bg-[#170F4F] text-sm text-white",children:x.icon}),o.jsx("span",{className:"text-xs font-medium leading-tight text-gray-700",children:x.label})]},x.id),y={layout:"Layout",content:"Content",interactive:"Interactive",media:"Media",dynamic:"Dynamic",other:"Other"},v={layout:o.jsx(T.FiGrid,{size:14}),content:o.jsx(T.FiType,{size:14}),interactive:o.jsx(T.FiMousePointer,{size:14}),media:o.jsx(T.FiImage,{size:14}),dynamic:o.jsx(T.FiCode,{size:14}),other:o.jsx(T.FiPackage,{size:14})},E=s.node("ROOT").get(),C=E&&E.data.nodes&&E.data.nodes.length>0;return o.jsxs("div",{className:"flex h-full flex-col",children:[!C&&o.jsx("div",{className:"border-b border-[#E8E7EE] bg-gray-50/50 px-3 py-2",children:o.jsx("p",{className:"text-xs text-gray-500",children:"Drag components to the canvas to add them"})}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[Object.entries(g).map(([x,A])=>{const j=i.has(x);return o.jsxs("div",{className:"last:mb-0",children:[o.jsxs("button",{onClick:()=>w(x),className:"mb-3 flex w-full items-center gap-2 rounded p-2 text-gray-700 transition-all duration-200 hover:bg-gray-50",children:[o.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded transition-colors hover:bg-gray-100",children:j?o.jsx(T.FiChevronRight,{size:12,className:"text-gray-400"}):o.jsx(T.FiChevronDown,{size:12,className:"text-gray-400"})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"text-gray-600",children:v[x]||v.other}),o.jsx("h3",{className:"text-sm font-medium text-gray-900",children:y[x]||x})]}),o.jsx("div",{className:"h-px flex-1 bg-gray-200"}),o.jsx("span",{className:"text-xs font-medium text-gray-500",children:A.length})]}),o.jsx("div",{ref:N=>{d.current[x]=N},style:{height:p[x],overflow:"hidden",transition:"height 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:!j&&o.jsx("div",{className:"pb-1",children:o.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:A.map(D)})})})]},x)}),Object.entries(g).length===0&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100",children:o.jsx("span",{className:"text-lg",children:"📦"})}),o.jsx("h3",{className:"mb-1 text-sm font-medium text-gray-900",children:r?"No components found":"No blocks available"}),o.jsx("p",{className:"text-xs text-gray-500",children:r?"Try different search terms":"Add components to get started"})]})]})]})}const tg=e=>Jt.find(a=>{const s=a.label.toLowerCase(),i=a.id.toLowerCase(),u=e.toLowerCase();return s===u||i===u})?.icon||o.jsx(T.FiMousePointer,{size:16});function rg({searchTerm:e}){const[r,a]=S.useState(new Set),{nodes:s,actions:i,selected:u}=H.useEditor(y=>({nodes:y.nodes,selected:y.events.selected})),d=y=>{const v=new Set(r);v.has(y)?v.delete(y):v.add(y),a(v)},p=(y,v)=>{if(!v.trim())return y;const E=new RegExp(`(${v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return y.split(E).map((x,A)=>E.test(x)?o.jsx("span",{className:"rounded bg-yellow-200 px-0.5 text-yellow-900",children:x},A):x)},f=(y,v=0,E=!1,C=[])=>{const x=s[y];if(!x)return null;const A=x.data.isCanvas,j=x.data.nodes||[],N=x.data.displayName||(typeof x.data.type=="string"?x.data.type:x.data.type?.displayName)||y,P=u&&u.has(y),M=typeof x.data.name=="string"?x.data.name:x.data?.displayName||"",_=j.length>0,$=r.has(y),L=e.trim()===""||N.toLowerCase().includes(e.toLowerCase())||M.toLowerCase().includes(e.toLowerCase()),z=e.trim()!==""&&j.some(ae=>{const ee=s[ae];if(!ee)return!1;const Re=ee.data.displayName||(typeof ee.data.type=="string"?ee.data.type:ee.data.type?.displayName)||ae,ze=typeof ee.data.name=="string"?ee.data.name:ee.data?.displayName||"";return Re.toLowerCase().includes(e.toLowerCase())||ze.toLowerCase().includes(e.toLowerCase())});return L||z?o.jsxs("div",{className:"flex flex-col",children:[o.jsxs("div",{className:"flex w-full items-center",children:[v>0&&o.jsx("div",{style:{width:v*20}}),o.jsxs("div",{className:`group flex w-full items-center rounded-md px-2 py-1.5 transition-colors ${P?"bg-[#170F4F]/10 hover:bg-[#170F4F]/15":"hover:bg-gray-50"} ${L&&e.trim()?"ring-1 ring-yellow-300":""}`,children:[_?o.jsx("button",{onClick:()=>d(y),className:"mr-1.5 flex h-4 w-4 items-center justify-center rounded opacity-0 transition-opacity hover:bg-gray-200 group-hover:opacity-100",children:$?o.jsx(T.FiChevronRight,{size:12,className:"text-gray-500"}):o.jsx(T.FiChevronDown,{size:12,className:"text-gray-500"})}):o.jsx("div",{className:"w-6"}),o.jsx("div",{className:`mr-2.5 flex h-5 w-5 items-center justify-center ${P?"text-[#170F4F]":"text-gray-600"}`,children:tg(M)}),o.jsx("button",{className:`flex-1 text-left text-sm font-medium transition-colors ${P?"text-[#170F4F]":"text-gray-700 group-hover:text-[#170F4F]"}`,onClick:()=>i.selectNode(y),children:p(N,e)})]})]}),A&&_&&(!$||e.trim()!=="")&&o.jsx("div",{className:"ml-0",children:j.map((ae,ee)=>f(ae,v+1,ee===j.length-1,[...C,E]))})]},y):null},g=s.ROOT?.data?.nodes||[],w=g.length>0,D=r.has("canvas");return o.jsx("div",{className:"flex h-full flex-col",children:o.jsxs("div",{className:"flex-1 space-y-0.5 overflow-y-auto p-2",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"flex w-full items-center",children:o.jsxs("div",{className:`group flex w-full items-center rounded-md px-2 py-1.5 transition-colors ${u&&u.has("ROOT")?"bg-[#170F4F]/10 hover:bg-[#170F4F]/15":"hover:bg-gray-50"}`,children:[w?o.jsx("button",{onClick:()=>d("canvas"),className:"mr-1.5 flex h-4 w-4 items-center justify-center rounded opacity-0 transition-opacity hover:bg-gray-200 group-hover:opacity-100",children:D?o.jsx(T.FiChevronRight,{size:12,className:"text-gray-500"}):o.jsx(T.FiChevronDown,{size:12,className:"text-gray-500"})}):o.jsx("div",{className:"w-6"}),o.jsx("div",{className:"mr-2.5 flex h-5 w-5 items-center justify-center text-[#170F4F]",children:o.jsx(T.FiFile,{size:14})}),o.jsx("button",{className:`flex-1 text-left text-sm font-medium transition-colors ${u&&u.has("ROOT")?"text-[#170F4F]":"text-gray-800 group-hover:text-[#170F4F]"}`,onClick:()=>i.selectNode("ROOT"),children:"Template"})]})}),w&&(!D||e.trim()!=="")&&o.jsx("div",{children:g.map((y,v)=>f(y,1,v===g.length-1,[!0]))})]}),!w&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[o.jsx("div",{className:"mb-2 flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100",children:o.jsx(T.FiLayers,{size:16,className:"text-gray-400"})}),o.jsx("p",{className:"mb-1 text-xs text-gray-500",children:"No layers yet"}),o.jsx("p",{className:"text-xs text-gray-400",children:"Add components to see them here"})]})]})})}const ng=({blocks:e=Jt})=>{const[r,a]=S.useState("blocks"),[s,i]=S.useState("");return o.jsxs("div",{className:"flex h-full w-64 flex-col overflow-hidden border-r border-[#E8E7EE] bg-white",children:[o.jsx("div",{className:"border-b border-[#E8E7EE] bg-gray-50 p-3",children:o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"text",placeholder:"Search components...",value:s,onChange:u=>i(u.target.value),className:"w-full border border-[#E8E7EE] bg-white px-3 py-2 pl-9 pr-9 text-sm text-gray-900 placeholder-gray-500 transition-all duration-200 focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]/20"}),o.jsx(T.FiSearch,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),s&&o.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2 rounded p-0.5 text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600",children:o.jsx(T.FiX,{size:14})})]})}),o.jsxs("div",{className:"flex border-b border-[#E8E7EE]",children:[o.jsx("button",{className:`flex-1 border-b py-3 text-sm font-medium transition-colors duration-200 ${r==="blocks"?"border-[#170F4F] text-[#170F4F]":"border-transparent text-[#A29FB9] hover:text-[#00BAC7]"}`,onClick:()=>a("blocks"),children:"Blocks"}),o.jsx("button",{className:`flex-1 border-b py-3 text-sm font-medium transition-colors duration-200 ${r==="layers"?"border-[#170F4F] text-[#170F4F]":"border-transparent text-[#A29FB9] hover:text-[#00BAC7]"}`,onClick:()=>a("layers"),children:"Layers"})]}),o.jsx("div",{className:"flex-1 overflow-hidden",children:r==="blocks"?o.jsx(eg,{blocks:e,searchTerm:s}):o.jsx(rg,{searchTerm:s})})]})};function ag(e,r=300){let a;return(...s)=>{clearTimeout(a),a=setTimeout(()=>e(...s),r)}}const sg=({hasChildren:e})=>{const{device:r}=Sr();return e?null:o.jsx("div",{className:`pointer-events-none absolute inset-0 left-auto right-auto z-10 flex items-center justify-center ${r==="mobile"?"w-[10%]":"w-[20%]"}`,children:o.jsxs("div",{className:"mx-auto p-6 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center border border-[#170F4F] bg-[#E8E7EE]",children:o.jsx("span",{className:"text-2xl text-[#170F4F]",children:"📄"})}),o.jsx("h3",{className:"mb-2 text-lg font-medium text-[#170F4F]",children:"Start building your page"}),o.jsx("p",{className:"text-sm text-[#A29FB9]",children:"Drag components from the sidebar to create your page layout."})]})})},og=({hasCanvasContent:e,showCodePanel:r})=>o.jsxs("div",{className:`${r?"w-1/2":"w-full"} mx-auto flex h-full flex-1 items-start justify-center overflow-scroll bg-gradient-to-br from-gray-100 to-gray-200 p-6 transition-all duration-300`,style:{maxHeight:"calc(100vh - 72px)"},children:[o.jsx(sg,{hasChildren:e}),o.jsx(H.Frame,{children:o.jsx(H.Element,{canvas:!0,is:"div",...bn,style:{...bn.style,maxWidth:bo.desktop.width}})})]}),ig=()=>{const[e,r]=S.useState(!1),a=()=>{console.log("Export HTML clicked"),r(!1)},s=()=>{console.log("Data Source clicked"),r(!1)};return Ke.default.useEffect(()=>{const i=u=>{e&&r(!1)};return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[e]),o.jsxs("div",{className:"relative",children:[o.jsx("button",{onClick:()=>r(!e),className:"rounded p-1.5 text-[#6B7280] transition-all duration-200 hover:bg-[#F5F5F7] hover:text-[#170F4F]",title:"Menu options",children:o.jsx(T.FiMenu,{size:16})}),e&&o.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-48 rounded-md border border-[#E8E7EE] bg-white py-1 shadow-lg",children:[o.jsxs("button",{onClick:a,className:"flex w-full items-center gap-3 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[o.jsx(T.FiDownload,{size:14}),"Export HTML"]}),o.jsxs("button",{onClick:s,className:"flex w-full items-center gap-3 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[o.jsx(T.FiDatabase,{size:14}),"Data Source"]})]})]})},lg=({canvasSize:e,showCodePanel:r,onPreviewModeToggle:a,onCanvasSizeChange:s,onCodePanelToggle:i,onSave:u,templateIsModified:d=!1,templateName:p,onTemplateNameChange:f,templateReference:h})=>{const[g,w]=S.useState(!1),D=Ke.default.useRef(null);S.useEffect(()=>{g&&D.current&&(D.current.focus(),D.current.select())},[g]);const y=()=>{w(!1)},v=x=>{x.key==="Enter"&&w(!1),x.key==="Escape"&&w(!1)},E=x=>{f?.(x.target.value)},C=async x=>{try{await navigator.clipboard.writeText(x)}catch(A){console.error("Failed to copy slug:",A)}};return o.jsx("div",{className:"border-b border-[#E8E7EE] bg-white",children:o.jsx("div",{className:"px-3 py-3 sm:px-8",children:o.jsxs("div",{className:"relative flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ig,{}),o.jsx("div",{className:"group",children:g?o.jsx("input",{ref:D,className:"w-full truncate rounded border-none bg-transparent px-1.5 text-base font-bold text-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",value:p,onChange:E,onBlur:y,onKeyDown:v,placeholder:"Untitled Template","aria-label":"Template name"}):o.jsxs("div",{className:"flex items-center",children:[o.jsxs("h1",{className:"cursor-pointer rounded px-1.5 py-1 text-base font-bold text-[#170F4F] hover:bg-gray-50",title:"Double-click to edit",onDoubleClick:()=>w(!0),children:[o.jsx("span",{className:"truncate",children:p||"Untitled Template"}),h&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5 text-gray-300",children:"•"}),o.jsx("span",{className:"rounded-sm bg-gray-100 px-1 py-0.5 font-mono text-[10px] font-medium text-gray-600",children:h})]})]}),h&&o.jsx("button",{onClick:()=>C(h),className:"rounded p-0.5 opacity-0 transition-opacity hover:bg-gray-50 hover:text-[#170F4F] group-hover:opacity-100",title:"Copy slug to clipboard",children:o.jsx(T.FiCopy,{size:9,className:"text-gray-400"})})]})})]}),o.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:o.jsx("div",{className:"flex items-center gap-1 border border-[#E8E7EE] bg-white p-1",children:["desktop","tablet","mobile"].map(x=>{const A={desktop:o.jsx(T.FiMonitor,{size:16}),tablet:o.jsx(T.FiTablet,{size:16}),mobile:o.jsx(T.FiSmartphone,{size:16})};return o.jsxs("button",{className:`flex items-center gap-1.5 px-2 py-1 text-xs font-medium transition-all duration-200 ${e===x?"bg-[#170F4F] text-white":"text-[#170F4F] hover:bg-[#F5F5F7]"}`,onClick:()=>s(x),title:`Switch to ${x} view`,children:[o.jsx("span",{className:"inline sm:hidden",children:A[x]}),o.jsx("span",{className:"hidden sm:inline",children:x.charAt(0).toUpperCase()+x.slice(1)})]},x)})})}),o.jsxs("div",{className:"flex items-center gap-2",children:[d?o.jsxs("div",{className:"flex items-center gap-1 text-orange-600",children:[o.jsx("div",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"}),o.jsx("span",{className:"text-xs font-medium",children:"Unsaved"})]}):o.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),o.jsx("span",{className:"text-xs font-medium",children:"Saved"})]}),o.jsx("button",{className:`p-1.5 transition-all duration-200 ${r?"bg-[#170F4F] text-white":"text-[#6B7280] hover:bg-[#F5F5F7] hover:text-[#170F4F]"}`,onClick:i,title:"Toggle Code Editor",children:o.jsx(T.FiCode,{size:16})}),o.jsx("button",{onClick:a,className:"p-1.5 text-[#6B7280] transition-all duration-200 hover:bg-[#F5F5F7] hover:text-[#170F4F]",title:"Preview template",children:o.jsx(T.FiEye,{size:16})}),u&&o.jsxs("button",{className:"relative flex items-center gap-1.5 bg-[#170F4F] px-3 py-1.5 text-xs font-medium text-white transition-all duration-200 hover:bg-[#009CA8]",onClick:u,title:"Save changes",children:[o.jsx(T.FiSave,{size:14}),"Save",d&&o.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2 w-2 animate-pulse bg-orange-500"})]})]})]})})})},ug=S.lazy(()=>Promise.resolve().then(function(){return Ag}).then(e=>({default:e.DataSourceModal}))),cg=({showCodePanel:e=!1,onPreviewToggle:r,onCodePanelToggle:a,codePanelChildren:s})=>{Rf();const i=Sr(),u=Ln(),{store:d}=H.useEditor(),{template:p,updateTemplate:f,saveTemplate:h}=pi(),[g,w]=S.useState(!1),[D,y]=S.useState(!1),v=()=>{},E=async()=>{if(!p){alert("No template loaded to save");return}try{f({snapshot:i.getState(),content:u.convertToHtml(i.getState())}),await h(),alert("Template saved successfully!")}catch(C){console.error("Error saving template:",C),alert("Error saving template. Please try again.")}};return S.useEffect(()=>{if(!D&&p&&p?.snapshot)try{i.loadState(p.snapshot)}catch(C){console.error("Error loading template into canvas:",C)}finally{y(!0)}},[p?.id]),S.useEffect(()=>{d.subscribe(ag(()=>{f({snapshot:i.getState(),content:u.convertToHtml(i.getState())})},500),()=>{})},[]),o.jsxs("div",{className:"flex h-full flex-col",children:[o.jsx(lg,{canvasSize:i.device,showCodePanel:e,onPreviewModeToggle:r||(()=>{}),onCanvasSizeChange:i.setDevice,onCodePanelToggle:a||(()=>{}),onSave:E,templateIsModified:p?.isModified,templateName:p?.title,onTemplateNameChange:C=>{f({title:C})},templateReference:p?.slug}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[!e&&o.jsx(ng,{}),o.jsxs("div",{className:`flex flex-1 ${e?"flex-row":"flex-col"}`,children:[e?s:null,o.jsx(og,{canvasSize:i.device,hasCanvasContent:i.isEmpty,showCodePanel:e})]}),!e&&o.jsx(Qf,{})]}),g&&o.jsx(S.Suspense,{fallback:o.jsx("div",{children:"Loading..."}),children:o.jsx(ug,{isOpen:g,onClose:()=>w(!1),onDataImport:v})})]})},bi=({children:e,isHover:r,isSelected:a,name:s,showIndicator:i=!0,width:u,height:d})=>{const p=r&&!a&&i,f=a&&i,h=p||f,g={outline:f?"1px solid #170f4fff":p?"1px dashed #00BAC7":"1px solid transparent",background:f?"rgba(23,15,79,0.03)":p?"rgba(0,186,199,0.02)":"transparent",cursor:"pointer",overflow:"visible",position:"relative",width:u,height:d};return o.jsxs("div",{style:g,className:a?"avoid-transition":"",children:[h&&o.jsxs("div",{className:`absolute left-0 top-0 flex items-center gap-1.5 px-2 py-1 text-xs font-medium backdrop-blur-sm ${f?"border border-[#170F4F] bg-[#170F4F] text-white shadow-lg":"border border-[#00BAC7] bg-[#00BAC7] text-white shadow-md"} `,style:{borderRadius:"4px",transform:"translateY(-100%)",transformOrigin:"left bottom",marginTop:"-2px",zIndex:99999,position:"absolute",transition:"all 0.15s ease-out"},onClick:w=>{w.stopPropagation(),w.preventDefault()},onMouseDown:w=>{w.stopPropagation(),w.preventDefault()},children:[o.jsx("div",{className:"flex h-3 w-3 items-center justify-center",children:f?o.jsx("div",{className:"h-2 w-2 rounded-full bg-white"}):o.jsx("div",{className:"h-2 w-2 rounded-full bg-white opacity-70"})}),o.jsx("span",{className:"select-none whitespace-nowrap leading-none",children:s})]}),e]})},ro=6,We=-3,dg={position:"absolute",width:`${ro}px`,height:`${ro}px`,background:"#170F4F",display:"block",pointerEvents:"none",boxShadow:"0 2px 8px rgba(23,15,79,0.3)",border:"0.5px solid #CCF1F4"},pg={topLeft:{left:`${We}px`,top:`${We}px`},topRight:{right:`${We}px`,top:`${We}px`},bottomLeft:{left:`${We}px`,bottom:`${We}px`},bottomRight:{right:`${We}px`,bottom:`${We}px`}},hg=({children:e,propKey:r={width:"width",height:"height"}})=>{const{actions:a,connectors:{connect:s}}=H.useNode(),{isSelected:i,isHover:u,nodeWidth:d,nodeHeight:p,name:f}=H.useNode(x=>({isSelected:x.events.selected,isHover:x.events.hovered,nodeWidth:x.data.props.style?.[r.width]||x.data.props[r.width]||200,nodeHeight:x.data.props.style?.[r.height]||x.data.props[r.height]||100,name:x.data.custom?.displayName||x.data.displayName})),{maxWidth:h}=H.useEditor(x=>{const j=x.nodes.ROOT?.data?.props?.style||{},N=j.maxWidth||j.width||1200;return{maxWidth:typeof N=="string"?parseInt(N):N}}),g=S.useRef(null),w=S.useRef(null),D=S.useMemo(()=>{const x=()=>{if(typeof d=="number")return Math.round(d);if(typeof d=="string"){if(d.includes("%")&&h){const j=parseFloat(d)/100;return Math.round(h*j)}return d||200}return 200},A=()=>p==="auto"?"auto":typeof p=="number"?Math.round(p):typeof p=="string"?p.includes("%")?p:p||100:100;return{width:x(),height:A()}},[d,p,h]),[y,v]=S.useState(D),E=S.useCallback(()=>{v(D)},[D]);S.useEffect(()=>{if(!h)return;const x=typeof d=="number"?d:parseFloat(d)||0;if(x>h){const A=h/x,j=Math.floor(x*A);a.setProp(N=>{N.style||(N.style={}),N.style[r.width]=j})}},[h,d,a,r.width]);const C=S.useCallback((x,A)=>{if(!w.current)return D;const{width:j,height:N}=w.current;let P=Math.round(j+x),M=Math.round(N+A);return h&&(P=Math.min(P,h)),P=Math.max(P,50),M=Math.max(M,20),{width:P,height:M}},[D,h]);return S.useEffect(()=>{E(),a.setCustom(x=>{x.resizable=!0})},[d,p,E,a]),o.jsx(bi,{isHover:u,isSelected:i,name:f||"Component",showIndicator:!0,width:y.width,height:y.height,children:o.jsxs(_d.Resizable,{ref:x=>{x&&x.resizable&&(g.current=x,s(x.resizable))},enable:{top:i,right:i,bottom:i,left:i,topLeft:i,topRight:i,bottomLeft:i,bottomRight:i},size:y,onResizeStart:x=>{x.preventDefault(),x.stopPropagation();const A=g.current?.resizable;if(!A)return;const j=A.getBoundingClientRect();w.current={width:Math.round(j.width),height:Math.round(j.height)}},onResize:(x,A,j,N)=>{const P=C(N.width,N.height);a.setProp(M=>{M.style||(M.style={}),M.style[r.width]=P.width,M.style[r.height]=P.height}),E()},onResizeStop:(x,A,j,N)=>{const P=C(N.width,N.height);a.setProp(M=>{M.style||(M.style={}),M.style[r.width]=P.width,M.style[r.height]=P.height}),E()},handleStyles:{topLeft:{display:"block"},topRight:{display:"block"},bottomLeft:{display:"block"},bottomRight:{display:"block"}},children:[e,o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:99999},children:i&&Object.entries(pg).map(([x,A])=>o.jsx("span",{style:{...dg,...A}},x))})]})})},mg=({render:e})=>{const{id:r,isHover:a,isActive:s,name:i,isResizable:u,nodeWidth:d,nodeHeight:p}=H.useNode(h=>({isHover:h.events.hovered,isActive:h.events.selected,name:h.data.custom?.displayName||h.data.displayName,isResizable:h.data.custom.resizable===!0,nodeWidth:h.data.props.style?.width||h.data.props.width||"min-content",nodeHeight:h.data.props.style?.height||h.data.props.height||"min-content"}));return r===jd.ROOT_NODE?o.jsx(o.Fragment,{children:e}):u?o.jsx(hg,{children:e}):o.jsx(bi,{isHover:a,isSelected:s,name:i,width:d,height:p,children:e})},fg=({templateId:e,baseUrl:r,workspace:a,children:s})=>{const[i,u]=S.useState(!1),[d,p]=S.useState({}),f=S.useMemo(()=>(r||console.warn("[TemplateProvider] baseUrl was not provided"),a||console.warn("[TemplateProvider] workspace was not provided"),new Bd.TemplatingSdk(r,{workspace:a,mode:"editor"})),[r,a]),h=S.useCallback(async y=>{if(y)try{u(!0);const v=await f.get(y);v&&p(v)}finally{u(!1)}},[f]),g=S.useCallback(y=>p(v=>v?.update?.(y)),[p]),w=S.useCallback(async()=>{if(!d?.id){console.warn("No template loaded to save");return}try{u(!0);const y=await d.save();p(y)}catch(y){console.error("Error saving template:",y)}finally{u(!1)}},[d]);S.useEffect(()=>{e&&h(e)},[e,h]);const D=S.useMemo(()=>({loading:i,template:d,loadTemplate:h,updateTemplate:g,saveTemplate:w}),[i,d,h,g]);return o.jsx(di.Provider,{value:D,children:s})},no={desktop:{width:1200,height:800,name:"Desktop"},tablet:{width:768,height:1024,name:"Tablet"},mobile:{width:375,height:667,name:"Mobile"}},gg=({canvasSize:e,hasCanvasContent:r,onZoomChange:a,placeholderData:s={}})=>{const{template:i}=pi(),[u,d]=S.useState(100),[p,f]=S.useState(""),h=S.useMemo(()=>no[e]||no.desktop,[e]);return S.useEffect(()=>{const g=()=>{const w=window.innerWidth-100,D=window.innerHeight-200,y=w/h.width,v=D/h.height,E=Math.min(y,v,1)*100,C=Math.max(25,Math.min(100,E));d(C),a&&a(C)};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[e,h.width,h.height,a]),S.useEffect(()=>{if(!r){f("");return}try{if(i&&i.render){const g=i.render(s);f(g)}else f("")}catch(g){console.error("Error rendering template:",g),f("")}},[r,s,i]),o.jsx("div",{className:"relative flex flex-1 items-center justify-center overflow-auto bg-[#F5F5F7] p-8",children:o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsxs("div",{className:"relative overflow-hidden rounded-lg border border-[#E8E7EE] bg-white shadow-lg",style:{width:h.width*(u/100),height:h.height*(u/100),maxWidth:"100%",maxHeight:"100%"},children:[e==="mobile"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"absolute inset-x-0 top-0 z-10 flex h-6 items-center justify-center rounded-t-lg bg-black",children:o.jsx("div",{className:"h-1 w-12 rounded-full bg-gray-600"})}),o.jsx("div",{className:"absolute inset-x-0 bottom-1 z-10 flex justify-center",children:o.jsx("div",{className:"h-1 w-16 rounded-full bg-black opacity-30"})})]}),o.jsxs("div",{className:"h-full w-full overflow-hidden",style:{transform:`scale(${u/100})`,transformOrigin:"top left",width:`${100/(u/100)}%`,height:`${100/(u/100)}%`},children:[!r&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50",children:o.jsxs("div",{className:"p-8 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-lg border-2 border-dashed border-[#E8E7EE] bg-[#F5F5F7]",children:o.jsx("span",{className:"text-2xl text-[#A29FB9]",children:"📄"})}),o.jsx("h3",{className:"mb-2 text-lg font-medium text-[#170F4F]",children:"No content to preview"}),o.jsx("p",{className:"text-sm text-[#A29FB9]",children:"Add components to see the preview"})]})}),o.jsx("div",{className:"h-full min-h-screen bg-white",style:{overflow:"visible",position:"relative",minHeight:"100%"},dangerouslySetInnerHTML:{__html:p}})]})]})})})},ao={desktop:{width:1200,height:800,name:"Desktop",icon:T.FiMonitor},tablet:{width:768,height:1024,name:"Tablet",icon:T.FiTablet},mobile:{width:375,height:667,name:"Mobile",icon:T.FiSmartphone}},bg=({canvasSize:e,onCanvasSizeChange:r,onExitPreview:a,onDownloadHTML:s,onOpenInNewTab:i,showPlayground:u=!1,onTogglePlayground:d})=>{const[p,f]=S.useState(!1),[h,g]=S.useState(100);return o.jsx("div",{className:"border-b border-[#E8E7EE] bg-white px-6 py-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{onClick:a,className:"flex items-center gap-2 px-3 py-1.5 text-sm font-medium text-[#170F4F] transition-colors hover:bg-[#F5F5F7]",children:[o.jsx(T.FiX,{className:"h-4 w-4"}),"Exit Preview"]}),o.jsx("div",{className:"h-6 w-px bg-[#E8E7EE]"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T.FiEye,{className:"h-4 w-4 text-[#00BAC7]"}),o.jsx("span",{className:"text-sm font-medium text-[#170F4F]",children:"Preview Mode"})]})]}),o.jsx("div",{className:"flex items-center gap-2",children:Object.keys(ao).map(w=>{const D=ao[w],y=D.icon,v=e===w;return o.jsxs("button",{onClick:()=>r(w),className:`flex items-center gap-2 px-3 py-1.5 text-sm font-medium transition-all duration-200 ${v?"bg-[#170F4F] text-white":"border border-[#E8E7EE] text-[#170F4F] hover:bg-[#F5F5F7]"} `,title:D.name,children:[o.jsx(y,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:D.name})]},w)})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"flex items-center overflow-hidden border border-[#E8E7EE]",children:[o.jsx("button",{onClick:()=>g(Math.max(25,h-25)),className:"px-3 py-1.5 text-[#170F4F] transition-colors hover:bg-[#F5F5F7] disabled:cursor-not-allowed disabled:opacity-50",disabled:h<=25,children:"−"}),o.jsxs("div",{className:"min-w-[60px] border-x border-[#E8E7EE] bg-[#F5F5F7] px-3 py-1.5 text-center text-sm font-medium text-[#170F4F]",children:[h,"%"]}),o.jsx("button",{onClick:()=>g(Math.min(200,h+25)),className:"px-3 py-1.5 text-[#170F4F] transition-colors hover:bg-[#F5F5F7] disabled:cursor-not-allowed disabled:opacity-50",disabled:h>=200,children:"+"})]}),o.jsx("button",{onClick:()=>f(!p),className:`p-1.5 transition-all duration-200 ${p?"bg-[#170F4F] text-white":"border border-[#E8E7EE] text-[#170F4F] hover:bg-[#F5F5F7]"} `,title:"Toggle Rulers",children:o.jsx(T.FiEyeOff,{className:"h-4 w-4"})}),o.jsx("div",{className:"h-6 w-px bg-[#E8E7EE]"}),d&&o.jsxs("button",{onClick:d,className:`flex items-center gap-2 px-3 py-1.5 text-sm font-medium transition-all duration-200 ${u?"bg-[#170F4F] text-white":"border border-[#E8E7EE] text-[#170F4F] hover:bg-[#F5F5F7]"} `,title:"Toggle Data Playground",children:[o.jsx(T.FiDatabase,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Data"})]}),o.jsx("div",{className:"h-6 w-px bg-[#E8E7EE]"}),o.jsxs("button",{onClick:s,className:"flex items-center gap-2 border border-[#E8E7EE] px-3 py-1.5 text-sm font-medium text-[#170F4F] transition-colors hover:bg-[#F5F5F7]",title:"Download HTML",children:[o.jsx(T.FiDownload,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Download"})]}),o.jsxs("button",{onClick:i,className:"flex items-center gap-2 bg-[#170F4F] px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-[#00BAC7]",title:"Open in New Tab",children:[o.jsx(T.FiExternalLink,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Open"})]})]})]})})},xg=350,Dg=700,yg=450,vg=({placeholders:e,placeholderSchema:r,onPlaceholdersChange:a,onSchemaChange:s,width:i=yg,onWidthChange:u})=>{const[d,p]=S.useState({type:"text"}),[f,h]=S.useState(!1),[g,w]=S.useState(!1),D=S.useRef(null),y=S.useRef(0),v=S.useRef(0),E=S.useCallback(_=>{w(!0),y.current=_.clientX,v.current=i,_.preventDefault()},[i]),C=S.useCallback(_=>{if(!g)return;const $=y.current-_.clientX,L=Math.min(Dg,Math.max(xg,v.current+$));u&&u(L)},[g,u]),x=S.useCallback(()=>{w(!1)},[]);S.useEffect(()=>{if(g)return document.addEventListener("mousemove",C),document.addEventListener("mouseup",x),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",x),document.body.style.cursor="",document.body.style.userSelect=""}},[g,C,x]);const A=(_,$)=>{a({...e,[_]:$})},j=()=>{if(!d.key||!d.label||!d.type)return;const _={key:d.key,label:d.label,type:d.type,value:d.value||N(d.type),options:d.options};s([...r,_]),a({...e,[_.key]:_.value||""}),p({type:"text"}),h(!1)},N=_=>{switch(_){case"text":return"Sample text";case"number":return 0;case"boolean":return!1;case"date":return new Date().toISOString().split("T")[0];case"enum":return"";default:return""}},P=_=>{s(r.filter(L=>L.key!==_));const $={...e};delete $[_],a($)},M=_=>{const $=e[_.key]??_.value??"";switch(_.type){case"text":return o.jsx("input",{type:"text",value:String($),onChange:L=>A(_.key,L.target.value),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",placeholder:"Enter text here..."});case"number":return o.jsx("input",{type:"number",value:Number($),onChange:L=>A(_.key,parseFloat(L.target.value)||0),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",placeholder:"Enter a number..."});case"boolean":return o.jsxs("div",{className:"flex items-center gap-4 rounded-none border border-[#E8E7EE] bg-white p-3",children:[o.jsxs("label",{className:"flex cursor-pointer items-center",children:[o.jsx("input",{type:"radio",name:`${_.key}-bool`,checked:!!$,onChange:()=>A(_.key,!0),className:"h-4 w-4 border-[#E8E7EE] text-[#170F4F] focus:ring-2 focus:ring-[#170F4F]"}),o.jsx("span",{className:"ml-2 text-sm font-medium text-[#170F4F]",children:"Yes"})]}),o.jsxs("label",{className:"flex cursor-pointer items-center",children:[o.jsx("input",{type:"radio",name:`${_.key}-bool`,checked:!$,onChange:()=>A(_.key,!1),className:"h-4 w-4 border-[#E8E7EE] text-[#170F4F] focus:ring-2 focus:ring-[#170F4F]"}),o.jsx("span",{className:"ml-2 text-sm font-medium text-[#170F4F]",children:"No"})]})]});case"enum":return o.jsxs("select",{value:String($),onChange:L=>A(_.key,L.target.value),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",children:[o.jsx("option",{value:"",children:"Choose an option..."}),_.options?.map((L,z)=>typeof L=="string"?o.jsx("option",{value:L,children:L},z):o.jsx("option",{value:String(L.value),children:L.label},z))]});case"date":return o.jsx("input",{type:"date",value:String($),onChange:L=>A(_.key,L.target.value),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]"});default:return null}};return o.jsxs("div",{className:"relative flex animate-slide-in-right flex-col border-l border-[#E8E7EE] bg-white transition-all duration-300 ease-in-out",style:{width:`${i}px`},children:[o.jsx("div",{ref:D,className:`absolute bottom-0 left-0 top-0 w-1 cursor-col-resize transition-colors duration-200 hover:bg-[#00BAC7] ${g?"bg-[#00BAC7]":"bg-transparent"} group`,onMouseDown:E,children:o.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform opacity-0 transition-opacity group-hover:opacity-100",children:o.jsx(T.FiMoreVertical,{className:"h-3 w-3 text-[#A29FB9]"})})}),o.jsxs("div",{className:"border-b border-[#E8E7EE] bg-gradient-to-r from-[#F9F8FE] to-white p-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"mb-1 text-lg font-semibold text-[#170F4F]",children:"Placeholders"}),o.jsx("p",{className:"text-sm text-[#A29FB9]",children:"Customize the content that appears in your template"})]}),o.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-2 rounded-none bg-[#170F4F] px-4 py-2 text-sm font-medium text-white shadow-sm transition-all duration-200 hover:bg-[#00BAC7] hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-[#170F4F] disabled:hover:shadow-sm",disabled:f,children:[o.jsx(T.FiPlus,{className:"h-4 w-4"}),"Add"]})]}),f&&o.jsxs("div",{className:"mt-4 animate-fade-in rounded-none border border-[#E8E7EE] bg-white p-4 shadow-sm",children:[o.jsx("h4",{className:"mb-4 text-sm font-semibold text-[#170F4F]",children:"Add New Placeholder"}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-xs font-medium text-[#170F4F]",children:"Field Name"}),o.jsx("input",{type:"text",placeholder:"e.g., Customer Name",value:d.label||"",onChange:_=>{const $=_.target.value,L=$.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"_").replace(/^_+|_+$/g,"");p({...d,label:$,key:L})},className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-xs font-medium text-[#170F4F]",children:"Data Type"}),o.jsxs("select",{value:d.type||"text",onChange:_=>p({...d,type:_.target.value}),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",children:[o.jsx("option",{value:"text",children:"Text"}),o.jsx("option",{value:"number",children:"Number"}),o.jsx("option",{value:"boolean",children:"True/False"}),o.jsx("option",{value:"enum",children:"Multiple Choice"}),o.jsx("option",{value:"date",children:"Date"})]})]})]}),o.jsxs("div",{className:"mt-6 flex gap-2 border-t border-[#E8E7EE] pt-4",children:[o.jsx("button",{onClick:j,disabled:!d.key||!d.label,className:"rounded-none bg-[#170F4F] px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors duration-200 hover:bg-[#00BAC7] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-[#170F4F]",children:"Confirm"}),o.jsx("button",{onClick:()=>h(!1),className:"rounded-none border border-[#E8E7EE] px-4 py-2 text-sm font-medium text-[#A29FB9] transition-colors duration-200 hover:bg-[#F9F8FE] hover:text-[#170F4F]",children:"Cancel"})]})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:r.length===0?o.jsxs("div",{className:"py-12 text-center text-[#A29FB9]",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-none border border-[#E8E7EE] bg-[#F9F8FE]",children:o.jsx(T.FiPlus,{className:"h-8 w-8 text-[#170F4F]"})}),o.jsx("h4",{className:"mb-2 text-lg font-medium text-[#170F4F]",children:"No data fields yet"}),o.jsx("p",{className:"mb-4 text-sm",children:"Add data fields to make your template dynamic"}),o.jsx("button",{onClick:()=>h(!0),className:"text-sm font-medium text-[#170F4F] transition-colors duration-200 hover:text-[#00BAC7]",children:"Add your first field"})]}):o.jsx("div",{className:"space-y-4",children:r.map(_=>o.jsxs("div",{className:"rounded-none border border-[#E8E7EE] bg-white p-4 transition-all duration-200 hover:border-[#170F4F] hover:shadow-sm",children:[o.jsxs("div",{className:"mb-3 flex items-start justify-between",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"mb-1 text-sm font-semibold text-[#170F4F]",children:_.label}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-flex items-center rounded-none border border-[#E8E7EE] bg-[#F9F8FE] px-2 py-1 text-xs font-medium text-[#170F4F]",children:_.type==="boolean"?"True/False":_.type==="enum"?"Multiple Choice":_.type.charAt(0).toUpperCase()+_.type.slice(1)}),o.jsx("span",{className:"font-mono text-xs text-[#A29FB9]",children:_.key})]})]}),o.jsx("button",{onClick:()=>P(_.key),className:"rounded-none p-1 text-[#A29FB9] transition-colors duration-200 hover:bg-red-50 hover:text-red-500",title:"Remove field",children:o.jsx(T.FiTrash2,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"block text-xs font-medium text-[#170F4F]",children:"Current Value:"}),o.jsx("div",{className:"w-full",children:M(_)})]})]},_.key))})})]})};function wg(e){let r=`<!DOCTYPE html>
|
|
61
|
-
<html lang="en">
|
|
62
|
-
<
|
|
63
|
-
<meta charset="UTF-8">
|
|
64
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
65
|
-
<title>Bolttech Page</title>
|
|
66
|
-
<style>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
padding: 0;
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
body {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</html>`;r=r.replace(/\s+/g," ").replace(/>\s+</g,"><").trim();const a=new Blob([r],{type:"text/html"}),s=URL.createObjectURL(a),i=document.createElement("a");i.href=s,i.download="bolttech-page.html",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}const fn={desktop:{width:1200,height:800,name:"Desktop"},tablet:{width:768,height:1024,name:"Tablet"},mobile:{width:375,height:667,name:"Mobile"}},Cg=({isPreviewMode:e,onExitPreview:r,initialPlaceholders:a={},initialPlaceholderSchema:s=[]})=>{const{getState:i,device:u,setDevice:d,isEmpty:p}=Sr(),{convertToHtml:f}=Ln(),[h,g]=S.useState(!1),[w,D]=S.useState(100),[y,v]=S.useState(!0),[E,C]=S.useState(450),[x,A]=S.useState(a),[j,N]=S.useState(s),P=()=>{g(!0),setTimeout(()=>{r(),g(!1)},300)},M=()=>{const $=f(i());wg($)},_=()=>{v(!y)};return e?o.jsxs("div",{className:`fixed inset-0 z-50 bg-[#F5F5F7] ${h?"animate-fade-out":"animate-fade-in"}`,children:[o.jsx("div",{className:h?"animate-slide-up-out":"animate-slide-down",children:o.jsx(bg,{canvasSize:u,onCanvasSizeChange:d,onExitPreview:P,onDownloadHTML:M,onOpenInNewTab:()=>{window.open()?.document.write(f(i()))},showPlayground:y,onTogglePlayground:_})}),o.jsxs("div",{className:"flex h-full",children:[o.jsx("div",{className:h?"animate-slide-down-out":"animate-slide-up",style:{flex:1},children:o.jsx(gg,{canvasSize:u,hasCanvasContent:p,onZoomChange:D,placeholderData:x})}),y&&o.jsx(vg,{placeholders:x,placeholderSchema:j,onPlaceholdersChange:A,onSchemaChange:N,width:E,onWidthChange:C})]}),o.jsxs("div",{className:"fixed bottom-4 left-4 z-[60] rounded bg-[#170F4F] px-3 py-2 text-sm text-white shadow-md",children:[fn[u].name," • ",fn[u].width,"×",fn[u].height,"px • ",w.toFixed(3),"%"]})]}):null},Fg=Jt.reduce((e,r)=>(e[r.id]=r.component,e),{}),Eg=({placeholders:e={},placeholderSchema:r=[]})=>{const a=go();return o.jsxs(H.Editor,{resolver:Fg,onRender:mg,enabled:a.isEditorEnabled,children:[o.jsx(cg,{onPreviewToggle:a.togglePreview,showCodePanel:a.showCodePanel,onCodePanelToggle:a.toggleCodePanel,codePanelChildren:o.jsx(Pf,{onClose:a.closeCodePanel})}),o.jsx(Cg,{isPreviewMode:a.showPreview,onExitPreview:()=>a.togglePreview(),initialPlaceholders:e,initialPlaceholderSchema:r})]})},Sg='@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Arial,Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 480px){.container{max-width:480px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1440px){.container{max-width:1440px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\\/2{left:50%}.left-3{left:.75rem}.left-4{left:1rem}.left-auto{left:auto}.right-0{right:0}.right-3{right:.75rem}.right-auto{right:auto}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[-2px\\]{top:-2px}.top-\\[-3px\\]{top:-3px}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.z-\\[60\\]{z-index:60}.mx-1\\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-1\\.5{margin-right:.375rem}.mr-2\\.5{margin-right:.625rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\\[400px\\]{height:400px}.h-\\[90vh\\]{height:90vh}.h-full{height:100%}.h-px{height:1px}.max-h-\\[42vh\\]{max-height:42vh}.min-h-fit{min-height:-moz-fit-content;min-height:fit-content}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-\\[10\\%\\]{width:10%}.w-\\[20\\%\\]{width:20%}.w-full{width:100%}.w-px{width:1px}.min-w-\\[120px\\]{min-width:120px}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[60px\\]{min-width:60px}.max-w-6xl{max-width:72rem}.max-w-\\[40vw\\]{max-width:40vw}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-fade-in{animation:fadeIn .4s ease-out}.animate-fade-out{animation:fadeOut .3s ease-in}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-slide-down{animation:slideDown .5s ease-out .1s both}.animate-slide-down-out{animation:slideDownOut .3s ease-in both}.animate-slide-in-right{animation:slideInRight .3s ease-out}.animate-slide-up{animation:slideUp .5s ease-out .2s both}.animate-slide-up-out{animation:slideUpOut .3s ease-in both}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:4px}.rounded-none{border-radius:0}.rounded-sm{border-radius:2px}.rounded-t-lg{border-top-left-radius:8px;border-top-right-radius:8px}.border{border-width:1px}.border-2{border-width:2px}.border-x{border-left-width:1px;border-right-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\\[\\#00BAC7\\]{--tw-border-opacity: 1;border-color:rgb(0 186 199 / var(--tw-border-opacity, 1))}.border-\\[\\#170F4F\\],.border-\\[\\#170f4f\\]{--tw-border-opacity: 1;border-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.border-\\[\\#30aab3\\]{--tw-border-opacity: 1;border-color:rgb(48 170 179 / var(--tw-border-opacity, 1))}.border-\\[\\#3B82F6\\]{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-\\[\\#D1D5DB\\]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-\\[\\#E8E7EE\\]{--tw-border-opacity: 1;border-color:rgb(232 231 238 / var(--tw-border-opacity, 1))}.border-\\[\\#dce7fe\\]{--tw-border-opacity: 1;border-color:rgb(220 231 254 / var(--tw-border-opacity, 1))}.border-\\[\\#e8e7ee\\]{--tw-border-opacity: 1;border-color:rgb(232 231 238 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-\\[\\#00BAC7\\]{--tw-bg-opacity: 1;background-color:rgb(0 186 199 / var(--tw-bg-opacity, 1))}.bg-\\[\\#170F4F\\]{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.bg-\\[\\#170F4F\\]\\/10{background-color:#170f4f1a}.bg-\\[\\#170f4f\\]{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.bg-\\[\\#181c24\\]{--tw-bg-opacity: 1;background-color:rgb(24 28 36 / var(--tw-bg-opacity, 1))}.bg-\\[\\#23272f\\]{--tw-bg-opacity: 1;background-color:rgb(35 39 47 / var(--tw-bg-opacity, 1))}.bg-\\[\\#CCF1F4\\]{--tw-bg-opacity: 1;background-color:rgb(204 241 244 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E8E7EE\\]{--tw-bg-opacity: 1;background-color:rgb(232 231 238 / var(--tw-bg-opacity, 1))}.bg-\\[\\#EFF6FF\\]{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F5F5F7\\]{--tw-bg-opacity: 1;background-color:rgb(245 245 247 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F9F8FE\\]{--tw-bg-opacity: 1;background-color:rgb(249 248 254 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\\/50{background-color:#f9fafb80}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-opacity-40{--tw-bg-opacity: .4}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#F9F8FE\\]{--tw-gradient-from: #F9F8FE var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 248 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-100{--tw-gradient-from: #f3f4f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 244 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-200{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0\\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-8{padding-bottom:2rem}.pl-9{padding-left:2.25rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-9{padding-right:2.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[10px\\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:2px}.text-\\[\\#00BAC7\\]{--tw-text-opacity: 1;color:rgb(0 186 199 / var(--tw-text-opacity, 1))}.text-\\[\\#170F4F\\],.text-\\[\\#170f4f\\]{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.text-\\[\\#3B82F6\\]{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-\\[\\#6B7280\\]{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-\\[\\#A29FB9\\]{--tw-text-opacity: 1;color:rgb(162 159 185 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px rgba(0, 0, 0, .15);--tw-shadow-colored: 0 10px 15px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-yellow-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 224 71 / var(--tw-ring-opacity, 1))}.ring-yellow-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 204 21 / var(--tw-ring-opacity, 1))}.ring-opacity-50{--tw-ring-opacity: .5}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.avoid-transition,.avoid-transition *{transition:none!important}#canvas,#canvas *{transition:width .3s ease-in-out,height .3s ease-in-out,max-width .3s ease-in-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes slideDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUpOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-20px)}}@keyframes slideDownOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}@keyframes slideInRight{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes slideOutRight{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(100%)}}.last\\:mb-0:last-child{margin-bottom:0}.hover\\:border-\\[\\#00BAC7\\]:hover{--tw-border-opacity: 1;border-color:rgb(0 186 199 / var(--tw-border-opacity, 1))}.hover\\:border-\\[\\#170F4F\\]:hover{--tw-border-opacity: 1;border-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.hover\\:border-\\[\\#170F4F\\]\\/30:hover{border-color:#170f4f4d}.hover\\:border-\\[\\#30aab3\\]:hover{--tw-border-opacity: 1;border-color:rgb(48 170 179 / var(--tw-border-opacity, 1))}.hover\\:border-red-300:hover{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.hover\\:bg-\\[\\#009CA8\\]:hover{--tw-bg-opacity: 1;background-color:rgb(0 156 168 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#00BAC7\\]:hover{--tw-bg-opacity: 1;background-color:rgb(0 186 199 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#170F4F\\]\\/15:hover{background-color:#170f4f26}.hover\\:bg-\\[\\#30aab3\\]:hover{--tw-bg-opacity: 1;background-color:rgb(48 170 179 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#CCF1F4\\]:hover{--tw-bg-opacity: 1;background-color:rgb(204 241 244 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#F5F5F7\\]:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 247 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#F9F8FE\\]:hover{--tw-bg-opacity: 1;background-color:rgb(249 248 254 / var(--tw-bg-opacity, 1))}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[\\#00BAC7\\]:hover{--tw-text-opacity: 1;color:rgb(0 186 199 / var(--tw-text-opacity, 1))}.hover\\:text-\\[\\#170F4F\\]:hover,.hover\\:text-\\[\\#170f4f\\]:hover{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.hover\\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:shadow-md:hover{--tw-shadow: 0 4px 6px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-sm:hover{--tw-shadow: 0 1px 2px rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\\:ring-gray-300:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.hover\\:ring-yellow-300:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 224 71 / var(--tw-ring-opacity, 1))}.hover\\:ring-opacity-50:hover{--tw-ring-opacity: .5}.focus\\:border-\\[\\#170F4F\\]:focus{--tw-border-opacity: 1;border-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.focus\\:bg-\\[\\#F9F8FE\\]:focus{--tw-bg-opacity: 1;background-color:rgb(249 248 254 / var(--tw-bg-opacity, 1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-inset:focus{--tw-ring-inset: inset}.focus\\:ring-\\[\\#170F4F\\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(23 15 79 / var(--tw-ring-opacity, 1))}.focus\\:ring-\\[\\#170F4F\\]\\/20:focus{--tw-ring-color: rgb(23 15 79 / .2)}.focus\\:ring-\\[\\#30aab3\\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(48 170 179 / var(--tw-ring-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-50:disabled{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.disabled\\:text-gray-600:disabled{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:hover\\:bg-\\[\\#170F4F\\]:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.disabled\\:hover\\:shadow-sm:hover:disabled{--tw-shadow: 0 1px 2px rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group:hover .group-hover\\:text-\\[\\#170F4F\\]{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.group:hover .group-hover\\:opacity-100{opacity:1}@media (min-width: 768px){.sm\\:inline{display:inline}.sm\\:hidden{display:none}.sm\\:px-8{padding-left:2rem;padding-right:2rem}}';function xi({templateId:e,placeholders:r={},placeholderSchema:a=[],sdk:s={baseUrl:"",workspace:""},width:i="100%",height:u="100%"}){return o.jsxs(Ld.default.div,{className:"bolttech-template-editor",style:{height:u,width:i},children:[o.jsx("style",{type:"text/css",children:Sg}),o.jsx(fg,{templateId:e,baseUrl:s.baseUrl,workspace:s.workspace,children:o.jsx(Eg,{placeholders:r,placeholderSchema:a})})]})}const gn=({name:e,value:r,path:a,onSelect:s,isSelected:i})=>{const u=typeof r=="object"&&r!==null&&!Array.isArray(r),d=Array.isArray(r),p=()=>r===null?"null":r===void 0?"undefined":typeof r=="string"?`"${r}"`:typeof r=="number"||typeof r=="boolean"?String(r):d?`Array(${r.length})`:u?`Object(${Object.keys(r).length})`:String(r),f=()=>r===null?"null":r===void 0?"undefined":typeof r=="string"?"string":typeof r=="number"?"number":typeof r=="boolean"?"boolean":d?"array":u?"object":typeof r;return o.jsxs("button",{onClick:()=>s(a,r),className:`flex min-w-[120px] flex-col items-center gap-1 rounded-none border border-[#e8e7ee] p-3 transition-all duration-200 ${i?"border-[#30aab3] bg-[#170f4f] text-white":"bg-white text-[#170f4f] hover:border-[#30aab3] hover:bg-gray-50"}`,children:[o.jsx("div",{className:"text-xs font-medium",children:e}),o.jsx("div",{className:`text-xs ${f()==="string"?"text-green-600":f()==="number"?"text-blue-600":f()==="boolean"?"text-purple-600":f()==="null"?"text-gray-500":"text-orange-600"} ${i?"text-white":""}`,children:p()}),o.jsxs("div",{className:`text-xs ${i?"text-gray-300":"text-gray-400"}`,children:["(",f(),")"]})]})},Di=({data:e,onPathSelect:r})=>{const[a,s]=S.useState([]),[i,u]=S.useState(null),[d,p]=S.useState(!1),f=(v,E)=>E.reduce((C,x)=>{if(C!=null){if(x.startsWith("[")&&x.endsWith("]")){const A=parseInt(x.slice(1,-1),10);return C[A]}return C[x]}},v),g=(()=>{const v=[];let E=[],C=e;v.push({path:[],value:e,isRoot:!0});for(const x of a)E=[...E,x],C=f(e,E),C!=null&&typeof C=="object"&&v.push({path:[...E],value:C,isRoot:!1});return v})(),w=(v,E,C)=>{if(typeof C=="object"&&C!==null&&(s(x=>[...x.slice(0,v),E]),r)){const x=[...g[v].path,E];r(x.join("."))}},D=(v,E,C)=>{if(typeof C!="object"||C===null){if(u({path:[...g[v].path,E],value:C}),r){const x=[...g[v].path,E];r(x.join("."))}}else u(null)},y=(v,E)=>{const C=v.value;return v.isRoot?o.jsx("div",{className:"flex min-w-[140px] flex-col gap-2",children:Object.entries(e).map(([x,A])=>o.jsx(gn,{name:x,value:A,path:x,onSelect:(j,N)=>typeof N=="object"&&N!==null?w(0,x,N):D(0,x,N),isSelected:a.length===0},x))},E):Array.isArray(C)?o.jsx("div",{className:"flex min-w-[140px] flex-col gap-2",children:C.map((x,A)=>o.jsx(gn,{name:`[${A}]`,value:x,path:`[${A}]`,onSelect:(j,N)=>typeof N=="object"&&N!==null?w(E,`[${A}]`,N):D(E,`[${A}]`,N),isSelected:!1},A))},E):typeof C=="object"&&C!==null?o.jsx("div",{className:"flex min-w-[140px] flex-col gap-2",children:Object.entries(C).map(([x,A])=>o.jsx(gn,{name:x,value:A,path:x,onSelect:(j,N)=>typeof N=="object"&&N!==null?w(E,x,N):D(E,x,N),isSelected:!1},x))},E):null};return o.jsxs("div",{className:"overflow-x-auto rounded-none border border-[#e8e7ee] bg-white",children:[o.jsx("div",{className:"border-b border-[#e8e7ee] bg-gray-50 px-4 py-2",children:o.jsx("h3",{className:"text-sm font-medium text-[#170f4f]",children:"Data Structure"})}),o.jsxs("div",{className:"flex gap-6 overflow-x-auto p-4",children:[g.map((v,E)=>y(v,E)),i&&o.jsx("div",{className:"flex min-w-[180px] flex-col gap-2",children:o.jsxs("div",{className:"mt-2 rounded-none border border-[#e8e7ee] bg-gray-50 p-3",children:[o.jsx("h4",{className:"mb-1 text-xs font-medium text-gray-600",children:"Selected Value"}),o.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[o.jsx("span",{className:"font-medium",children:"Path:"})," ",i.path.join("."),o.jsx("button",{className:"ml-1 text-gray-400 hover:text-gray-600",onClick:()=>{navigator.clipboard.writeText(i.path.join(".")),p(!0),setTimeout(()=>p(!1),2e3)},title:"Copy path",children:d?o.jsx(T.FiCheck,{size:14}):o.jsx(T.FiCopy,{size:14})})]}),o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"Value:"})," ",String(i.value)]}),o.jsxs("div",{className:"text-sm",children:[o.jsx("span",{className:"font-medium",children:"Type:"})," ",typeof i.value]})]})})]})]})},kg=({isOpen:e,onClose:r,onDataImport:a})=>{const[s,i]=S.useState("url"),[u,d]=S.useState(""),[p,f]=S.useState(""),[h,g]=S.useState(""),[w,D]=S.useState(!1),[y,v]=S.useState(""),[E,C]=S.useState(!1),[x,A]=S.useState(null);S.useEffect(()=>{if(e){const L=localStorage.getItem("bolttech_datasource");if(L)try{const z=JSON.parse(L);z&&typeof z=="object"&&z.data&&(A(z.data),z.url&&f(z.url))}catch{}}},[e]);const j=L=>{const z=L.target.files?.[0];if(!z)return;if(!z.name.endsWith(".json")){v("Please select a JSON file");return}const oe=new FileReader;oe.onload=ae=>{try{const ee=ae.target?.result,Re=JSON.parse(ee);d(ee),A(Re),v("")}catch{v("Invalid JSON file"),d(""),A(null)}},oe.readAsText(z)},N=async()=>{if(!p.trim()){v("Please enter a URL");return}D(!0),v("");try{const L=await fetch(p);if(!L.ok)throw new Error("Failed to fetch data");const z=await L.json();g(JSON.stringify(z,null,2)),A(z),v("")}catch{v("Failed to fetch data from URL")}finally{D(!1)}},P=L=>{g(L),v("");try{if(L.trim()){const z=JSON.parse(L);A(z)}else A(null)}catch{v("Invalid JSON format"),A(null)}},M=()=>{let L;try{switch(s){case"file":if(!u){v("Please select a file");return}L=JSON.parse(u);break;case"url":if(!h){v("Please fetch data from URL first");return}L=JSON.parse(h);break;case"code":if(!h.trim()){v("Please enter JSON data");return}L=JSON.parse(h);break}s==="url"?localStorage.setItem("bolttech_datasource",JSON.stringify({from:s,data:L,url:p})):localStorage.setItem("bolttech_datasource",JSON.stringify({from:s,data:L})),a(L),r()}catch{v("Invalid JSON data")}},_=()=>{navigator.clipboard.writeText(h),C(!0),setTimeout(()=>C(!1),2e3)},$=()=>{try{return h.trim()?(JSON.parse(h),!0):!1}catch{return!1}};return e?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:L=>{L.target===L.currentTarget&&r()},children:o.jsxs("div",{className:"flex h-[90vh] w-full max-w-6xl flex-col rounded-none bg-white shadow-xl",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-[#e8e7ee] bg-white p-6",children:[o.jsx("h2",{className:"text-lg font-bold tracking-wide text-[#170f4f]",children:"DataSource"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:()=>{localStorage.removeItem("bolttech_datasource"),A(null),d(""),f(""),g("")},className:"rounded-none p-2 text-gray-400 transition-colors duration-200 hover:bg-red-50 hover:text-red-600",title:"Clean Data",children:"🧹"}),o.jsx("button",{onClick:r,className:"rounded-none p-2 text-gray-400 transition-colors duration-200 hover:bg-gray-50 hover:text-gray-600",children:o.jsx(T.FiX,{size:18})})]})]}),o.jsx("div",{className:"max-h-[42vh] overflow-y-auto border-b border-[#e8e7ee] px-6 py-4",children:o.jsx(Di,{data:{root:x||{}}})}),o.jsxs("div",{className:"flex border-b border-[#e8e7ee]",children:[o.jsxs("button",{onClick:()=>i("url"),className:`flex items-center gap-2 px-6 py-3 text-sm font-medium transition-colors duration-200 ${s==="url"?"border-b-2 border-[#30aab3] text-[#170f4f]":"text-gray-500 hover:text-[#170f4f]"}`,children:[o.jsx(T.FiLink,{size:16}),"URL"]}),o.jsxs("button",{onClick:()=>i("file"),className:`flex items-center gap-2 px-6 py-3 text-sm font-medium transition-colors duration-200 ${s==="file"?"border-b-2 border-[#30aab3] text-[#170f4f]":"text-gray-500 hover:text-[#170f4f]"}`,children:[o.jsx(T.FiUpload,{size:16}),"Import File"]}),o.jsxs("button",{onClick:()=>i("code"),className:`flex items-center gap-2 px-6 py-3 text-sm font-medium transition-colors duration-200 ${s==="code"?"border-b-2 border-[#30aab3] text-[#170f4f]":"text-gray-500 hover:text-[#170f4f]"}`,children:[o.jsx(T.FiCode,{size:16}),"Custom Code"]})]}),o.jsxs("div",{className:"flex-1 overflow-hidden p-6",children:[s==="code"&&o.jsxs("div",{className:"flex h-full flex-col",children:[o.jsx("div",{className:"mb-4",children:o.jsx("p",{className:"mb-1 text-sm text-gray-500",children:"Enter your JSON data below"})}),o.jsxs("div",{className:"flex-1 overflow-hidden rounded-none bg-gray-900",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-gray-700 bg-gray-800 px-4 py-2",children:[o.jsx("span",{className:"text-sm font-medium text-gray-300",children:"JSON Editor"}),h&&o.jsxs("button",{onClick:_,className:"flex items-center gap-1 text-xs text-gray-400 hover:text-gray-300",children:[E?o.jsx(T.FiCheck,{size:12}):o.jsx(T.FiCopy,{size:12}),E?"Copied!":"Copy"]})]}),o.jsx("div",{className:"h-full overflow-auto pb-8",children:o.jsx("textarea",{value:h,onChange:L=>P(L.target.value),placeholder:'{"name": "John", "age": 30, "city": "New York"}',className:"h-full w-full resize-none border-none bg-transparent p-4 font-mono text-sm text-gray-300 outline-none"})})]})]}),s==="url"&&o.jsx("div",{className:"bte:flex bte:h-full bte:flex-col",children:o.jsxs("div",{className:"bte:mb-4",children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"JSON URL"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"url",value:p,onChange:L=>f(L.target.value),placeholder:"https://api.example.com/data.json",className:"flex-1 rounded-none border border-[#e8e7ee] px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#30aab3]"}),o.jsx("button",{onClick:N,disabled:w||!p.trim(),className:"rounded-none bg-[#170f4f] px-4 py-2 text-white transition-colors duration-200 hover:bg-[#30aab3] disabled:cursor-not-allowed disabled:opacity-50",children:w?"Loading...":"Fetch"})]})]})}),s==="file"&&o.jsxs("div",{className:"bte:flex bte:h-full bte:flex-col",children:[o.jsxs("div",{className:"bte:mb-4",children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Select JSON File"}),o.jsxs("div",{className:"rounded-none border-2 border-dashed border-[#e8e7ee] p-8 text-center transition-colors duration-200 hover:border-[#30aab3]",children:[o.jsx("input",{type:"file",accept:".json",onChange:j,className:"hidden",id:"file-upload"}),o.jsxs("label",{htmlFor:"file-upload",className:"flex cursor-pointer flex-col items-center",children:[o.jsx(T.FiUpload,{size:48,className:"mb-4 text-gray-400"}),o.jsx(T.FiUpload,{size:48,className:"mb-4 text-gray-400"}),o.jsx("span",{className:"text-lg font-medium text-gray-700",children:"Click to upload JSON file"}),o.jsx("span",{className:"mt-1 text-sm text-gray-500",children:"or drag and drop"})]})]})]}),u&&o.jsxs("div",{className:"flex-1 overflow-hidden rounded-none bg-gray-900",children:[o.jsx("div",{className:"flex items-center justify-between border-b border-gray-700 bg-gray-800 px-4 py-2",children:o.jsx("span",{className:"text-sm font-medium text-gray-300",children:"File Preview"})}),o.jsx("div",{className:"h-32 overflow-auto",children:o.jsx("pre",{className:"whitespace-pre-wrap p-4 font-mono text-sm text-gray-300",children:o.jsx("code",{children:u})})})]})]}),y&&o.jsx("div",{className:"mt-4 rounded-none border border-red-200 bg-red-50 p-3",children:o.jsx("p",{className:"text-sm text-red-600",children:y})})]}),o.jsxs("div",{className:"flex items-center justify-end gap-3 border-t border-[#e8e7ee] p-6",children:[o.jsx("button",{onClick:r,className:"rounded-none bg-gray-100 px-4 py-2 text-gray-700 transition-colors duration-200 hover:bg-gray-200",children:"Cancel"}),o.jsx("button",{onClick:M,disabled:s==="file"&&!u||s==="url"&&!h||s==="code"&&!h||!$(),className:"rounded-none bg-[#170f4f] px-4 py-2 text-white transition-colors duration-200 hover:bg-[#30aab3] disabled:cursor-not-allowed disabled:opacity-50",children:"Import Data"})]})]})}):null},Ag=Object.freeze({__proto__:null,DataSourceModal:kg,HorizontalDataView:Di});exports.TemplateEditor=xi;exports.default=xi;
|
|
77
|
+
`).map(q=>q.trim()).filter(q=>q).join(`
|
|
78
|
+
`);l(I)}finally{w(!1)}}},[a]),E=F.useRef(null),N=F.useRef(!1),A=a!==c;F.useEffect(()=>{if(!N.current&&e&&r)try{const z=i(n());z&&z.trim()&&(l(z),d(z)),N.current=!0}catch(z){console.warn("Could not initialize code from canvas:",z)}},[e,r]);const T=F.useCallback(async()=>{if(a.trim()){m("processing"),y("");try{const z=o(a,{replace:!0});z&&z.includes("ROOT")&&s(z),m("success")}catch(z){console.error("Error applying code to canvas:",z),m("error"),y(z instanceof Error?z.message:"Unknown error occurred")}}},[a]),j=F.useCallback(z=>{l(z),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{z.trim()?T():m("idle")},1e3)},[T]),B=F.useCallback(()=>{d(a),m("success");try{localStorage.setItem("editor_saved_code",a)}catch(z){console.warn("Could not save to localStorage:",z)}},[a]),$=F.useCallback(()=>{l(c),m("idle"),y(""),E.current&&clearTimeout(E.current)},[c]),O=F.useCallback(()=>{E.current&&clearTimeout(E.current),m("idle"),y("")},[]);return F.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]),{codeValue:a,savedCodeValue:c,conversionStatus:f,hasUnsavedChanges:A,errorMessage:g,isFormattingCode:v,handleCodeChange:j,handleSave:B,handleRevert:$,handleClose:O,applyCodeToCanvas:T,formatCode:D}}const qD={loading:!1,error:null,template:{}},Hf=F.createContext(qD),WD=({variant:t="primary",loading:e=!1,children:r,disabled:n,className:s="",...o})=>{const i=t==="primary",a=n||e;return h.jsx("button",{...o,disabled:a,className:`rounded-none border px-4 py-2 text-sm font-medium transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-60 ${i?"bg-[#170F4F] hover:bg-[#009CA8] text-white border-[#170F4F]":"bg-white hover:bg-[#F5F5F7] text-[#170F4F] border-[#E8E7EE]"} ${s}`,children:e?"Loading...":r})},UD=({isOpen:t,title:e,onClose:r,children:n,footer:s,showCloseButton:o=!0})=>t?h.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/50",onClick:r,children:h.jsxs("div",{className:"w-[90%] max-w-md rounded-none bg-white shadow-lg",onClick:i=>i.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[#e8e7ee] px-6 py-4",children:[h.jsx("h2",{className:"text-lg font-semibold text-[#170f4f]",children:e}),o&&r&&h.jsx("button",{onClick:r,className:"flex h-8 w-8 items-center justify-center rounded-none text-2xl text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700",children:"×"})]}),h.jsx("div",{className:"px-6 py-4",children:n}),s&&h.jsx("div",{className:"flex justify-end gap-3 border-t border-[#e8e7ee] px-6 py-4",children:s})]})}):null,JD=({templateId:t,baseUrl:e,workspace:r,children:n})=>{const[s,o]=F.useState(!1),[i,a]=F.useState(null),[l,c]=F.useState({}),[d,f]=F.useState(!1),[m,g]=F.useState(Pr.TemplateFormat.HTML),y=F.useMemo(()=>(e||console.warn("[TemplateProvider] baseUrl was not provided"),r||console.warn("[TemplateProvider] workspace was not provided"),new Pr.TemplatingSdk(e,{workspace:r,mode:"editor"})),[e,r]),v=F.useCallback(async A=>{if(A)try{o(!0),a(null);const T=await y.get(A);T?(T.format||(console.warn("[TemplateProvider] Template format is missing. User must select a format."),f(!0)),c(T)):a(`Template with ID "${A}" not found`)}catch(T){const j=T instanceof Error?T.message:"Failed to load template";a(j),console.error("[TemplateProvider] Error loading template:",T)}finally{o(!1)}},[y]),w=F.useCallback(A=>c(T=>T?.update?.(A)),[c]),D=F.useCallback(async()=>{if(!l?.id){console.warn("No template loaded to save");return}try{o(!0);const A=await l.save();c(A)}catch(A){console.error("Error saving template:",A)}finally{o(!1)}},[l]),E=F.useCallback(async()=>{if(l?.id)try{o(!0);const A=await l.setFormat(m);c(A),f(!1)}catch(A){console.error("Error saving template format:",A),a("Failed to save template format")}finally{o(!1)}},[l,m]);F.useEffect(()=>{t&&v(t)},[t,v]);const N=F.useMemo(()=>({loading:s,error:i,template:l,loadTemplate:v,updateTemplate:w,saveTemplate:D}),[s,i,l,v,w,D]);return h.jsxs(Hf.Provider,{value:N,children:[n,h.jsxs(UD,{isOpen:d,title:"Template Format Required",showCloseButton:!1,footer:h.jsx(WD,{variant:"primary",onClick:E,disabled:s,loading:s,children:"Save Format"}),children:[h.jsx("p",{className:"mb-5 text-sm text-gray-600",children:"This template is missing a format. Please select a format to continue editing."}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"format-select",className:"mb-2 block text-sm font-medium text-[#170f4f]",children:"Select Format"}),h.jsx(Mt,{options:[{value:Pr.TemplateFormat.HTML,label:"HTML"},{value:Pr.TemplateFormat.PDF,label:"PDF"}],value:m,onChange:A=>g(A),placeholder:"Choose a format"})]})]})]})};function Pn(){const t=F.useContext(Hf);if(!t)throw new Error("useTemplate must be used within a TemplateProvider");return t}const KD=({onClose:t,onFormat:e,onSave:r,isFormattingCode:n,codeValue:s,hasUnsavedChanges:o,conversionStatus:i})=>h.jsxs("div",{className:"flex items-center justify-between border-b border-gray-700 bg-[#23272f] px-4 py-2",children:[h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx("div",{className:"group relative",children:h.jsx("button",{className:"rounded p-1 text-gray-400 transition-colors duration-200 hover:text-white",onClick:t,"aria-label":"Close Code Panel",children:h.jsx(_.FiX,{size:18})})}),h.jsx("span",{className:"text-base font-semibold text-white",children:"Code Editor"}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("div",{className:`h-2 w-2 rounded-full ${o?"bg-yellow-500":"bg-green-500"}`}),h.jsx("span",{className:`text-xs font-medium ${o?"text-yellow-400":"text-green-400"}`,children:o?"Unsaved":"Saved"})]})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsxs("div",{className:"group relative",children:[h.jsx("button",{onClick:e,disabled:n||!s.trim(),className:"rounded p-1 text-gray-400 transition-colors duration-200 hover:text-white disabled:cursor-not-allowed disabled:text-gray-600","aria-label":"Format HTML",children:n?h.jsx(_.FiLoader,{size:18,className:"animate-spin"}):h.jsx(_.FiFileText,{size:18})}),h.jsx("span",{className:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded bg-gray-900 px-2 py-1 text-xs text-white opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:n?"Formatting HTML...":"Format HTML"})]}),h.jsxs("div",{className:"group relative",children:[h.jsx("button",{onClick:r,disabled:i==="processing"||!o,className:"rounded p-1 text-gray-400 transition-colors duration-200 hover:text-white disabled:cursor-not-allowed disabled:text-gray-600","aria-label":"Save HTML",children:h.jsx(_.FiSave,{size:18})}),h.jsx("span",{className:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded bg-gray-900 px-2 py-1 text-xs text-white opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:"Save"})]})]})]});function GD({height:t="100%",defaultLanguage:e="html",theme:r="vs-dark",value:n,onChange:s,options:o}){const i=F.useRef(null),[a,l]=F.useState(null);return F.useEffect(()=>{const c=document.createElement("div");return c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.pointerEvents="none",c.style.zIndex="9999",document.body.appendChild(c),l(c),()=>{c.parentNode&&c.parentNode.removeChild(c)}},[]),F.useEffect(()=>{if(!i.current||!a)return;const c=()=>{if(!i.current||!a)return;const m=i.current.getBoundingClientRect(),g=a.firstChild;g&&(g.style.position="absolute",g.style.top=`${m.top}px`,g.style.left=`${m.left}px`,g.style.width=`${m.width}px`,g.style.height=`${m.height}px`,g.style.pointerEvents="auto")};c();const d=()=>{requestAnimationFrame(c)};window.addEventListener("resize",d),window.addEventListener("scroll",d,!0);let f;return window.ResizeObserver&&(f=new ResizeObserver(d),f.observe(i.current)),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),f&&f.disconnect()}},[a]),h.jsxs(h.Fragment,{children:[h.jsx("div",{ref:i,style:{width:"100%",height:t}}),a&&Ei.createPortal(h.jsx("div",{style:{backgroundColor:"#1e1e1e"},children:h.jsx(W2.default,{height:t,defaultLanguage:e,theme:r,value:n,onChange:s,options:o})}),a)]})}function YD({onClose:t}){const{codeValue:e,conversionStatus:r,hasUnsavedChanges:n,handleCodeChange:s,handleSave:o,handleClose:i,formatCode:a,isFormattingCode:l}=VD();return h.jsxs("div",{className:"flex h-full w-1/2 flex-col border-r border-gray-200 bg-[#181c24]",children:[h.jsx(KD,{onClose:()=>{i(),t()},onFormat:a,onSave:o,isFormattingCode:l,codeValue:e,hasUnsavedChanges:n,conversionStatus:r}),h.jsx("div",{className:"flex-1 p-0",style:{width:"100%",height:"100%"},children:h.jsx(GD,{height:"100%",defaultLanguage:"html",theme:"vs-dark",value:e,onChange:c=>s(c||""),options:{fontSize:16,padding:{top:10},minimap:{enabled:!1},wordWrap:"on",scrollBeyondLastLine:!1,formatOnPaste:!0,formatOnType:!0,autoIndent:"full",tabSize:2,insertSpaces:!0,automaticLayout:!0,folding:!0,lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},suggest:{showKeywords:!0,showSnippets:!0}}})})]})}const XD=({templateId:t,errorMessage:e,onContinue:r,onGoBack:n})=>h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:h.jsxs("div",{className:"flex w-full max-w-lg flex-col rounded-none bg-white shadow-xl",children:[h.jsx("div",{className:"border-b border-border bg-white px-6 py-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-red-50",children:h.jsx(_.FiAlertTriangle,{className:"text-red-600",size:20})}),h.jsx("h2",{className:"text-lg font-bold text-primary",children:"Template Not Found"})]})}),h.jsxs("div",{className:"px-6 py-5",children:[t&&h.jsx("div",{className:"mb-4 rounded-none border border-border bg-background-light px-4 py-3",children:h.jsxs("p",{className:"text-sm text-muted",children:["Template ID:"," ",h.jsx("span",{className:"font-medium text-text",children:t})]})}),h.jsx("p",{className:"mb-5 text-sm leading-relaxed text-text",children:e}),h.jsx("div",{className:"rounded-none border border-red-200 bg-red-50 px-4 py-3",children:h.jsxs("div",{className:"flex gap-2",children:[h.jsx(_.FiAlertTriangle,{className:"mt-0.5 flex-shrink-0 text-red-600",size:16}),h.jsxs("p",{className:"text-sm leading-relaxed text-red-800",children:[h.jsx("strong",{children:"Warning:"})," Any changes made will not be saved, as the template was not found."]})]})})]}),h.jsxs("div",{className:"flex items-center justify-end gap-3 border-t border-border px-6 py-4",children:[h.jsx("button",{onClick:n,className:"rounded-none border border-border bg-background-light px-4 py-2 text-sm font-medium text-text transition-colors duration-200 hover:bg-surface",children:"Go Back"}),h.jsx("button",{onClick:r,className:"rounded-none bg-primary px-4 py-2 text-sm font-medium text-white transition-colors duration-200 hover:bg-secondary",children:"Continue Anyway"})]})]})}),QD={},ZD=(t,e)=>({onDeleteNode:()=>{const r=e.getEvent("selected").last();r&&t.delete(r)},onCopy:()=>{const r=e.getEvent("selected").last();if(!r){console.warn("[Copy] No node selected");return}try{const n=e.node(r).toNodeTree();console.log("[Copy] Node tree:",n);const s={type:"craftjs-copy",nodeTree:n,selectedId:r,timestamp:Date.now()};console.log("[Copy] Copy data:",s);const o=JSON.stringify(s,(i,a)=>{if(!["dom","rules","_hydrationTimestamp","events"].includes(i))return i==="type"&&typeof a=="function"?{resolvedName:a.name||a.displayName||"Unknown"}:a});navigator.clipboard.writeText(o),console.log("[Copy] Successfully copied to clipboard")}catch(n){console.error("[Copy] Failed to copy node:",n)}},onPaste:async()=>{console.log("[Paste] Starting paste operation...");try{const r=await navigator.clipboard.readText();if(console.log("[Paste] Clipboard text:",r),!r){console.warn("[Paste] Clipboard is empty");return}let n;try{n=JSON.parse(r),console.log("[Paste] Parsed clipboard data:",n)}catch(f){console.warn("[Paste] Invalid clipboard data:",f);return}if(!n||n.type!=="craftjs-copy"||!n.nodeTree){console.warn("[Paste] Clipboard does not contain valid node data");return}const s=n.nodeTree;console.log("[Paste] Node tree to paste:",s);const i=(f=>{const m={...f},g={},y=()=>Math.random().toString(36).substring(2,15);if(m.nodes&&(Object.keys(m.nodes).forEach(v=>{g[v]=y()}),m.rootNodeId&&g[m.rootNodeId]&&(m.rootNodeId=g[m.rootNodeId])),m.nodes){const v={};Object.keys(m.nodes).forEach(w=>{const D={...m.nodes[w]},E=g[w];if(D.id=E,D.events=D.events||{selected:!1,dragged:!1,hovered:!1},D.dom=null,D.rules=D.rules||{canDrag:()=>!0,canDrop:()=>!0,canMoveIn:()=>!0,canMoveOut:()=>!0},D.data){if(D.data.props=D.data.props||{},D.data.custom=D.data.custom||{},D.data.hidden=D.data.hidden||!1,D.data.isCanvas=D.data.isCanvas||!1,D.data.nodes=D.data.nodes||[],D.data.linkedNodes=D.data.linkedNodes||{},D.data.displayName=D.data.displayName||D.data.type?.displayName||"Component",D.data.parent&&g[D.data.parent]&&(D.data.parent=g[D.data.parent]),D.data.nodes&&Array.isArray(D.data.nodes)&&(D.data.nodes=D.data.nodes.map(N=>g[N]||N)),D.data.linkedNodes){const N={};Object.keys(D.data.linkedNodes).forEach(A=>{const T=D.data.linkedNodes[A];N[A]=g[T]||T}),D.data.linkedNodes=N}if(D.data.type&&typeof D.data.type=="object"&&D.data.type.resolvedName){const N=Rs.find(A=>{const T=typeof A.component=="function"?A.component.name||A.component.displayName:"";return A.id===D.data.type.resolvedName||T===D.data.type.resolvedName});N?(D.data.type=N.component,console.log("[Paste] Resolved component:",D.data.type.resolvedName,"to",N.component)):console.warn("[Paste] Could not resolve component:",D.data.type.resolvedName)}}v[E]=D}),m.nodes=v}return m})(s);console.log("[Paste] Reconstructed node tree:",i);const a=e.getEvent("selected").last();let l="ROOT",c;if(a){const f=e.node(a).get();if(console.log("[Paste] Selected node data:",f),f.data.isCanvas)l=a,c=(f.data.nodes||[]).length,console.log("[Paste] Inserting as child of canvas node:",a,"at index:",c);else{const m=f.data.parent;m?(l=m,c=e.node(l).get().data.nodes.indexOf(a)+1,console.log("[Paste] Inserting after selected node in parent:",l,"at index:",c)):(l="ROOT",c=e.node("ROOT").get().data.nodes.indexOf(a)+1,console.log("[Paste] Inserting after selected node in ROOT at index:",c))}}else c=e.node("ROOT").get().data.nodes.length,console.log("[Paste] No selection, adding to end of ROOT at index:",c);console.log("[Paste] Will insert at parent:",l,"index:",c),console.log("[Paste] Using addNodeTree with reconstructed nodeTree:",i),t.addNodeTree(i,l,c);const d=i.rootNodeId;d&&(console.log("[Paste] Selecting newly pasted node:",d),t.selectNode(d)),console.log("[Paste] Node pasted successfully")}catch(r){console.error("[Paste] Failed to paste:",r),r instanceof Error&&console.error("[Paste] Error stack:",r.stack)}},onUndo:()=>t.history.undo(),onRedo:()=>t.history.redo(),onSave:()=>{const r=e.serialize();console.log("Saving JSON:",r)}});function eC(){const{actions:t,query:e}=Q.useEditor(),r=s=>s.toLowerCase().charAt(0).toUpperCase()+s.toLowerCase().slice(1),n=s=>s.includes("_")?`on${s.split("_").map(r).join("")}`:`on${r(s)}`;F.useEffect(()=>{const s=ZD(t,e),o=i=>{const a=navigator.platform.includes("Mac"),l=[];(a&&i.metaKey||!a&&i.ctrlKey)&&l.push(a?"Meta":"Ctrl"),i.shiftKey&&l.push("Shift"),l.push(i.key);const c=l.join("+");Object.entries(QD).forEach(([d,f])=>{if(f.keys.includes(c)){i.preventDefault();const m=s[n(d)];console.log("Executing shortcut:",d,n(d)),m?.()}})};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,e])}const tC=({name:t})=>h.jsx("div",{className:"border-b border-[#e8e7ee] bg-gray-50 p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded bg-[#170f4f]",children:h.jsx("span",{className:"text-xs font-medium text-white",children:t.charAt(0).toUpperCase()})}),h.jsx("div",{className:"flex-1",children:h.jsx("h3",{className:"text-sm font-medium text-[#170f4f]",children:t})})]})});function rC(){const{selected:t,nodes:e,actions:r,query:n}=Q.useEditor(D=>({selected:D.events.selected,nodes:D.nodes})),s=Array.from(t)[0],o=()=>{if(t&&t.size>0){const D=Array.from(t)[0];r.delete(D)}},i=()=>{if(!s)return;const D=n.node(s).get(),E=n.node(s).ancestors()[0];if(!E)return;const T=n.node(E).get().data.nodes.indexOf(s);if(T===-1)return;const j={data:{type:D.data.type,props:{...D.data.props}}},B=n.parseFreshNode(j).toNode();r.add(B,E,T+1)},a=()=>{if(!s)return;const D=n.node(s).ancestors()[0];if(!D)return;const A=n.node(D).get().data.nodes.indexOf(s);if(A>0){const T=A-1;r.move(s,D,T)}},l=()=>{if(!s)return;const D=n.node(s).ancestors()[0];if(!D)return;const N=n.node(D).get().data.nodes,A=N.indexOf(s);if(A!==-1&&A<N.length-1){const T=A+2;r.move(s,D,T)}},c=()=>{if(s){const D=Array.from(t)[0];r.setHidden(D,!e[D].data.hidden)}};F.useEffect(()=>{const D=E=>{if(t&&t.size>0){const N=E.target;!(N.tagName==="INPUT"||N.tagName==="TEXTAREA"||N.contentEditable==="true")&&(E.key==="Backspace"||E.key==="Delete")&&(E.preventDefault(),o())}};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[t]);const f=(()=>{if(!t||t.size===0)return null;const D=Array.from(t)[0],E=n.node(D).get();return E?{id:D,type:E.data.type,displayName:E.data.displayName||String(E.data.type),props:E.data.props,isCanvas:E.data.isCanvas,isDeletable:!0,isDuplicateable:!0,parent:E.data.parent}:null})();if(!f)return null;const m=n.node(s).ancestors()[0]||"ROOT",g=n.node(m).get(),v=g.data.nodes.indexOf(s),w=g.data.nodes.length-1;return h.jsxs("div",{className:"space-y-3 p-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("button",{onClick:i,disabled:!f.isDuplicateable,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[h.jsx(_.FiCopy,{size:14}),"Duplicate"]}),h.jsxs("button",{onClick:o,disabled:!f.isDeletable,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:border-red-300 hover:bg-red-50 hover:text-red-600 disabled:cursor-not-allowed disabled:opacity-50",children:[h.jsx(_.FiTrash2,{size:14}),"Delete"]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("button",{disabled:v===0,onClick:a,className:`flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50 ${v===0?"cursor-not-allowed opacity-50 hover:bg-white":""}`,children:[h.jsx(_.FiArrowUp,{size:14}),"Move Up"]}),h.jsxs("button",{disabled:v>=w,onClick:l,className:`flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50 ${v>=w?"cursor-not-allowed opacity-50 hover:bg-white":""}`,children:[h.jsx(_.FiArrowDown,{size:14}),"Move Down"]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("button",{className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50",children:[h.jsx(_.FiLock,{size:14}),"Lock"]}),h.jsx("button",{onClick:c,className:"flex items-center justify-center gap-2 border border-[#e8e7ee] bg-white px-3 py-2 text-xs font-medium transition-colors duration-200 hover:bg-gray-50",children:e[s].data.hidden?h.jsxs(h.Fragment,{children:[h.jsx(_.FiEye,{size:14}),"Show"]}):h.jsxs(h.Fragment,{children:[h.jsx(_.FiEyeOff,{size:14}),"Hide"]})})]})]})}function nC(){const{selected:t,query:e}=Q.useEditor(c=>({selected:c.events.selected})),[r,n]=F.useState(""),s=F.useRef(null),o=()=>{if(s.current){const c=s.current.textContent||"";navigator.clipboard.writeText(c).then(()=>{console.log("HTML copied to clipboard")})}},i=c=>{try{const d=e.node(c).get();return d&&d.dom?d.dom.outerHTML.replace(/data-cy="[^"]*"/g,"").replace(/data-craft-id="[^"]*"/g,"").replace(/data-node-id="[^"]*"/g,"").replace(/class="[^"]*craft[^"]*"/g,'class=""').replace(/class="[^"]*ring-[^"]*"/g,'class=""').replace(/class="[^"]*hover:[^"]*"/g,'class=""').replace(/class="[^"]*transition-[^"]*"/g,'class=""').replace(/class="[^"]*duration-[^"]*"/g,'class=""').replace(/class="[^"]*opacity-[^"]*"/g,'class=""').replace(/class="[^"]*cursor-[^"]*"/g,'class=""').replace(/class="[^"]*min-h-screen[^"]*"/g,'class=""').replace(/class="[^"]*bg-white[^"]*"/g,'class=""').replace(/class=""/g,"").replace(/\s+/g," ").trim()||"<!-- No HTML available -->":"<!-- Component not found in DOM -->"}catch(d){return console.error("Error getting component HTML:",d),"<!-- Error getting component HTML -->"}};F.useEffect(()=>{if(t&&t.size>0){const c=Array.from(t)[0];if(e.node(c).get()){const f=i(c);n(f)}}else n("")},[t,e]);const l=(()=>{if(!t||t.size===0)return null;const c=Array.from(t)[0],d=e.node(c).get();return d?{id:c,type:d.data.type,displayName:d.data.displayName||String(d.data.type),props:d.data.props,isCanvas:d.data.isCanvas,isDeletable:!0,isDuplicateable:!0,parent:d.data.parent}:null})();return l?h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-700",children:"Component ID"}),h.jsx("input",{type:"text",value:l.id,readOnly:!0,className:"w-full rounded-none border border-[#e8e7ee] bg-gray-50 px-3 py-2 text-xs focus:outline-none"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-700",children:"Component Parent"}),h.jsx("input",{type:"text",value:String(l.parent),readOnly:!0,className:"w-full rounded-none border border-[#e8e7ee] bg-gray-50 px-3 py-2 text-xs focus:outline-none"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-700",children:"Properties"}),h.jsx("div",{className:"rounded-none border border-[#e8e7ee] bg-gray-50 p-3",children:h.jsx("pre",{className:"whitespace-pre-wrap text-xs text-gray-600",children:JSON.stringify(l?.props,null,2)})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[h.jsx("label",{className:"block text-xs font-medium text-gray-700",children:"Component HTML"}),h.jsx("button",{onClick:o,className:"rounded-none p-1 text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600",title:"Copy HTML to clipboard",children:h.jsx(_.FiClipboard,{size:14})})]}),h.jsx("div",{className:"rounded-none border border-[#e8e7ee] bg-gray-50 p-3",children:h.jsx("pre",{ref:s,className:"whitespace-pre-wrap font-mono text-xs text-gray-600",children:r||"<!-- No HTML available -->"})})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("span",{className:"inline-flex items-center rounded bg-blue-100 px-2 py-1 text-xs font-medium text-blue-800",children:l.isCanvas?"Canvas":"Component"}),l.isDeletable&&h.jsx("span",{className:"inline-flex items-center rounded bg-green-100 px-2 py-1 text-xs font-medium text-green-800",children:"Deletable"}),l.isDuplicateable&&h.jsx("span",{className:"inline-flex items-center rounded bg-purple-100 px-2 py-1 text-xs font-medium text-purple-800",children:"Duplicatable"})]})]}):null}function _e(t){this.content=t}_e.prototype={constructor:_e,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,s=n.find(t),o=n.content.slice();return s==-1?o.push(r||t,e):(o[s+1]=e,r&&(o[s]=r)),new _e(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new _e(r)},addToStart:function(t,e){return new _e([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new _e(r)},addBefore:function(t,e,r){var n=this.remove(e),s=n.content.slice(),o=n.find(t);return s.splice(o==-1?s.length:o,0,e,r),new _e(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=_e.from(t),t.size?new _e(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=_e.from(t),t.size?new _e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=_e.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};_e.from=function(t){if(t instanceof _e)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new _e(e)};function Vf(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let s=t.child(n),o=e.child(n);if(s==o){r+=s.nodeSize;continue}if(!s.sameMarkup(o))return r;if(s.isText&&s.text!=o.text){for(let i=0;s.text[i]==o.text[i];i++)r++;return r}if(s.content.size||o.content.size){let i=Vf(s.content,o.content,r+1);if(i!=null)return i}r+=s.nodeSize}}function qf(t,e,r,n){for(let s=t.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:r,b:n};let i=t.child(--s),a=e.child(--o),l=i.nodeSize;if(i==a){r-=l,n-=l;continue}if(!i.sameMarkup(a))return{a:r,b:n};if(i.isText&&i.text!=a.text){let c=0,d=Math.min(i.text.length,a.text.length);for(;c<d&&i.text[i.text.length-c-1]==a.text[a.text.length-c-1];)c++,r--,n--;return{a:r,b:n}}if(i.content.size||a.content.size){let c=qf(i.content,a.content,r-1,n-1);if(c)return c}r-=l,n-=l}}class L{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,s=0,o){for(let i=0,a=0;a<r;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&n(l,s+a,o||null,i)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,s+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,s){let o="",i=!0;return this.nodesBetween(e,r,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,r-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(i?i=!1:o+=n),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,s=this.content.slice(),o=0;for(r.isText&&r.sameMarkup(n)&&(s[s.length-1]=r.withText(r.text+n.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new L(s,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],s=0;if(r>e)for(let o=0,i=0;i<r;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>r)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,r-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,r-i-1))),n.push(a),s+=a.nodeSize),i=l}return new L(n,s)}cutByIndex(e,r){return e==r?L.empty:e==0&&r==this.content.length?this:new L(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let s=this.content.slice(),o=this.size+r.nodeSize-n.nodeSize;return s[e]=r,new L(s,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let s=this.content[r];e(s,n,r),n+=s.nodeSize}}findDiffStart(e,r=0){return Vf(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return qf(this,e,r,n)}findIndex(e){if(e==0)return bo(0,e);if(e==this.size)return bo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let s=this.child(r),o=n+s.nodeSize;if(o>=e)return o==e?bo(r+1,o):bo(r,n);n=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return L.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.empty;let r,n=0;for(let s=0;s<e.length;s++){let o=e[s];n+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(r||(r=e.slice(0,s)),r[r.length-1]=o.withText(r[r.length-1].text+o.text)):r&&r.push(o)}return new L(r||e,n)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Ta={index:0,offset:0};function bo(t,e){return Ta.index=t,Ta.offset=e,Ta}function Io(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Io(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Io(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ue=class bl{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))r||(r=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(r||(r=e.slice(0,s)),r.push(this),n=!0),r&&r.push(o)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Io(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let s=n.create(r.attrs);return n.checkAttrs(s.attrs),s}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return bl.none;if(e instanceof bl)return[e];let r=e.slice();return r.sort((n,s)=>n.type.rank-s.type.rank),r}};ue.none=[];class Ro extends Error{}class H{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=Uf(this.content,e+this.openStart,r);return n&&new H(n,this.openStart,this.openEnd)}removeBetween(e,r){return new H(Wf(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return H.empty;let n=r.openStart||0,s=r.openEnd||0;if(typeof n!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(L.fromJSON(e,r.content),n,s)}static maxOpen(e,r=!0){let n=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(r||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=e.lastChild;o&&!o.isLeaf&&(r||!o.type.spec.isolating);o=o.lastChild)s++;return new H(e,n,s)}}H.empty=new H(L.empty,0,0);function Wf(t,e,r){let{index:n,offset:s}=t.findIndex(e),o=t.maybeChild(n),{index:i,offset:a}=t.findIndex(r);if(s==e||o.isText){if(a!=r&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(n,o.copy(Wf(o.content,e-s-1,r-s-1)))}function Uf(t,e,r,n){let{index:s,offset:o}=t.findIndex(e),i=t.maybeChild(s);if(o==e||i.isText)return n&&!n.canReplace(s,s,r)?null:t.cut(0,e).append(r).append(t.cut(e));let a=Uf(i.content,e-o-1,r,i);return a&&t.replaceChild(s,i.copy(a))}function sC(t,e,r){if(r.openStart>t.depth)throw new Ro("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new Ro("Inconsistent open depths");return Jf(t,e,r,0)}function Jf(t,e,r,n){let s=t.index(n),o=t.node(n);if(s==e.index(n)&&n<t.depth-r.openStart){let i=Jf(t,e,r,n+1);return o.copy(o.content.replaceChild(s,i))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let i=t.parent,a=i.content;return Jr(i,a.cut(0,t.parentOffset).append(r.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=oC(r,t);return Jr(o,Gf(t,i,a,e,n))}else return Jr(o,Po(t,e,n))}function Kf(t,e){if(!e.type.compatibleContent(t.type))throw new Ro("Cannot join "+e.type.name+" onto "+t.type.name)}function yl(t,e,r){let n=t.node(r);return Kf(n,e.node(r)),n}function Ur(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function bs(t,e,r,n){let s=(e||t).node(r),o=0,i=e?e.index(r):s.childCount;t&&(o=t.index(r),t.depth>r?o++:t.textOffset&&(Ur(t.nodeAfter,n),o++));for(let a=o;a<i;a++)Ur(s.child(a),n);e&&e.depth==r&&e.textOffset&&Ur(e.nodeBefore,n)}function Jr(t,e){return t.type.checkContent(e),t.copy(e)}function Gf(t,e,r,n,s){let o=t.depth>s&&yl(t,e,s+1),i=n.depth>s&&yl(r,n,s+1),a=[];return bs(null,t,s,a),o&&i&&e.index(s)==r.index(s)?(Kf(o,i),Ur(Jr(o,Gf(t,e,r,n,s+1)),a)):(o&&Ur(Jr(o,Po(t,e,s+1)),a),bs(e,r,s,a),i&&Ur(Jr(i,Po(r,n,s+1)),a)),bs(n,null,s,a),new L(a)}function Po(t,e,r){let n=[];if(bs(null,t,r,n),t.depth>r){let s=yl(t,e,r+1);Ur(Jr(s,Po(t,e,r+1)),n)}return bs(e,null,r,n),new L(n)}function oC(t,e){let r=e.depth-t.openStart,s=e.node(r).copy(t.content);for(let o=r-1;o>=0;o--)s=e.node(o).copy(L.from(s));return{start:s.resolveNoCache(t.openStart+r),end:s.resolveNoCache(s.content.size-t.openEnd-r)}}class Fs{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],s=e.child(r);return n?e.child(r).cut(n):s}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],s=r==0?0:this.path[r*3-1]+1;for(let o=0;o<e;o++)s+=n.child(o).nodeSize;return s}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ue.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),s=e.maybeChild(r);if(!n){let a=n;n=s,s=a}let o=n.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)n[o].type.spec.inclusive===!1&&(!s||!n[o].isInSet(s.marks))&&(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new zo(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],s=0,o=r;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),c=o-l;if(n.push(i,a,s+l),!c||(i=i.child(a),i.isText))break;o=c-1,s+=l+1}return new Fs(r,n,o)}static resolveCached(e,r){let n=ip.get(e);if(n)for(let o=0;o<n.elts.length;o++){let i=n.elts[o];if(i.pos==r)return i}else ip.set(e,n=new iC);let s=n.elts[n.i]=Fs.resolve(e,r);return n.i=(n.i+1)%aC,s}}class iC{constructor(){this.elts=[],this.i=0}}const aC=12,ip=new WeakMap;class zo{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const lC=Object.create(null);class Dt{constructor(e,r,n,s=ue.none){this.type=e,this.attrs=r,this.marks=s,this.content=n||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,s=0){this.content.nodesBetween(e,r,n,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,s){return this.content.textBetween(e,r,n,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&Io(this.attrs,r||e.defaultAttrs||lC)&&ue.sameSet(this.marks,n||ue.none)}copy(e=null){return e==this.content?this:new Dt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Dt(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return H.empty;let s=this.resolve(e),o=this.resolve(r),i=n?0:s.sharedDepth(r),a=s.start(i),c=s.node(i).content.cut(s.pos-a,o.pos-a);return new H(c,s.depth-i,o.depth-i)}replace(e,r,n){return sC(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:s}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(s==e||r.isText)return r;e-=s+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let s=this.content.child(r-1);return{node:s,index:r-1,offset:n-s.nodeSize}}resolve(e){return Fs.resolveCached(this,e)}resolveNoCache(e){return Fs.resolve(this,e)}rangeHasMark(e,r,n){let s=!1;return r>e&&this.nodesBetween(e,r,o=>(n.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yf(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=L.empty,s=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,s,o),a=i&&i.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=s;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,r);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ue.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ue.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let s=L.fromJSON(e,r.content),o=e.nodeType(r.type).create(r.attrs,s,n);return o.type.checkAttrs(o.attrs),o}}Dt.prototype.text=void 0;class $o extends Dt{constructor(e,r,n,s){if(super(e,r,null,s),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new $o(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new $o(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yf(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class Qr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new uC(e,r);if(n.next==null)return Qr.empty;let s=Xf(n);n.next&&n.err("Unexpected trailing text");let o=gC(mC(s));return bC(o,n),o}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let s=this;for(let o=r;s&&o<n;o++)s=s.matchType(e.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let s=[this];function o(i,a){let l=i.matchFragment(e,n);if(l&&(!r||l.validEnd))return L.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:d,next:f}=i.next[c];if(!(d.isText||d.hasRequiredAttrs())&&s.indexOf(f)==-1){s.push(f);let m=o(f,a.concat(d));if(m)return m}}return null}return o(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let s=n.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let a=s;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in r)&&(!s.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:s}),r[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let s=0;s<n.next.length;s++)e.indexOf(n.next[s].next)==-1&&r(n.next[s].next)}return r(this),e.map((n,s)=>{let o=s+(n.validEnd?"*":" ")+" ";for(let i=0;i<n.next.length;i++)o+=(i?", ":"")+n.next[i].type.name+"->"+e.indexOf(n.next[i].next);return o}).join(`
|
|
79
|
+
`)}}Qr.empty=new Qr(!0);class uC{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Xf(t){let e=[];do e.push(cC(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function cC(t){let e=[];do e.push(dC(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function dC(t){let e=fC(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=pC(t,e);else break;return e}function ap(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function pC(t,e){let r=ap(t),n=r;return t.eat(",")&&(t.next!="}"?n=ap(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function hC(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let s=[];for(let o in r){let i=r[o];i.isInGroup(e)&&s.push(i)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function fC(t){if(t.eat("(")){let e=Xf(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=hC(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function mC(t){let e=[[]];return s(o(t,0),r()),e;function r(){return e.push([])-1}function n(i,a,l){let c={term:l,to:a};return e[i].push(c),c}function s(i,a){i.forEach(l=>l.to=a)}function o(i,a){if(i.type=="choice")return i.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(i.type=="seq")for(let l=0;;l++){let c=o(i.exprs[l],a);if(l==i.exprs.length-1)return c;s(c,a=r())}else if(i.type=="star"){let l=r();return n(a,l),s(o(i.expr,l),l),[n(l)]}else if(i.type=="plus"){let l=r();return s(o(i.expr,a),l),s(o(i.expr,l),l),[n(l)]}else{if(i.type=="opt")return[n(a)].concat(o(i.expr,a));if(i.type=="range"){let l=a;for(let c=0;c<i.min;c++){let d=r();s(o(i.expr,l),d),l=d}if(i.max==-1)s(o(i.expr,l),l);else for(let c=i.min;c<i.max;c++){let d=r();n(l,d),s(o(i.expr,l),d),l=d}return[n(l)]}else{if(i.type=="name")return[n(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function Qf(t,e){return e-t}function lp(t,e){let r=[];return n(e),r.sort(Qf);function n(s){let o=t[s];if(o.length==1&&!o[0].term)return n(o[0].to);r.push(s);for(let i=0;i<o.length;i++){let{term:a,to:l}=o[i];!a&&r.indexOf(l)==-1&&n(l)}}}function gC(t){let e=Object.create(null);return r(lp(t,0));function r(n){let s=[];n.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<s.length;d++)s[d][0]==a&&(c=s[d][1]);lp(t,l).forEach(d=>{c||s.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[n.join(",")]=new Qr(n.indexOf(t.length-1)>-1);for(let i=0;i<s.length;i++){let a=s[i][1].sort(Qf);o.next.push({type:s[i][0],next:e[a.join(",")]||r(a)})}return o}}function bC(t,e){for(let r=0,n=[t];r<n.length;r++){let s=n[r],o=!s.validEnd,i=[];for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];i.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),n.indexOf(c)==-1&&n.push(c)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zf(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function em(t,e){let r=Object.create(null);for(let n in t){let s=e&&e[n];if(s===void 0){let o=t[n];if(o.hasDefault)s=o.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=s}return r}function tm(t,e,r,n){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${r} of type ${s}`);for(let s in t){let o=t[s];o.validate&&o.validate(e[s])}}function rm(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new xC(t,n,e[n]);return r}let up=class nm{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=rm(e,n.attrs),this.defaultAttrs=Zf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Qr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:em(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Dt(this,this.computeAttrs(e),L.from(r),ue.setFrom(n))}createChecked(e=null,r,n){return r=L.from(r),this.checkContent(r),new Dt(this,this.computeAttrs(e),r,ue.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=L.from(r),r.size){let i=this.contentMatch.fillBefore(r);if(!i)return null;r=i.append(r)}let s=this.contentMatch.matchFragment(r),o=s&&s.fillBefore(L.empty,!0);return o?new Dt(this,e,r.append(o),ue.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){tm(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:ue.none:e}static compile(e,r){let n=Object.create(null);e.forEach((o,i)=>n[o]=new nm(o,r,i));let s=r.spec.topNode||"doc";if(!n[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function yC(t,e,r){let n=r.split("|");return s=>{let o=s===null?"null":typeof s;if(n.indexOf(o)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${o}`)}}class xC{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?yC(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Li{constructor(e,r,n,s){this.name=e,this.rank=r,this.schema=n,this.spec=s,this.attrs=rm(e,s.attrs),this.excluded=null;let o=Zf(this.attrs);this.instance=o?new ue(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ue(this,em(this.attrs,e))}static compile(e,r){let n=Object.create(null),s=0;return e.forEach((o,i)=>n[o]=new Li(o,s++,r,i)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){tm(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sm{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let s in e)r[s]=e[s];r.nodes=_e.from(e.nodes),r.marks=_e.from(e.marks||{}),this.nodes=up.compile(this.spec.nodes,this),this.marks=Li.compile(this.spec.marks,this);let n=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],i=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=n[i]||(n[i]=Qr.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?cp(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:cp(this,i.split(" "))}this.nodeFromJSON=s=>Dt.fromJSON(this,s),this.markFromJSON=s=>ue.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof up){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,s)}text(e,r){let n=this.nodes.text;return new $o(n,n.defaultAttrs,e,ue.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function cp(t,e){let r=[];for(let n=0;n<e.length;n++){let s=e[n],o=t.marks[s],i=o;if(o)r.push(o);else for(let a in t.marks){let l=t.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&r.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function vC(t){return t.tag!=null}function wC(t){return t.style!=null}class br{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(s=>{if(vC(s))this.tags.push(s);else if(wC(s)){let o=/[^=]*/.exec(s.style)[0];n.indexOf(o)<0&&n.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=e.nodes[s.node];return o.contentMatch.matchType(o)})}parse(e,r={}){let n=new pp(this,r,!1);return n.addAll(e,ue.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new pp(this,r,!0);return n.addAll(e,ue.none,r.from,r.to),H.maxOpen(n.finish())}matchTag(e,r,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(kC(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||r.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,r,n,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let i=this.styles[o],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!n.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=r))){if(i.getAttrs){let l=i.getAttrs(r);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let r=[];function n(s){let o=s.priority==null?50:s.priority,i=0;for(;i<r.length;i++){let a=r[i];if((a.priority==null?50:a.priority)<o)break}r.splice(i,0,s)}for(let s in e.marks){let o=e.marks[s].spec.parseDOM;o&&o.forEach(i=>{n(i=hp(i)),i.mark||i.ignore||i.clearMark||(i.mark=s)})}for(let s in e.nodes){let o=e.nodes[s].spec.parseDOM;o&&o.forEach(i=>{n(i=hp(i)),i.node||i.ignore||i.mark||(i.node=s)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new br(e,br.schemaRules(e)))}}const om={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},DC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},im={ol:!0,ul:!0},As=1,xl=2,ys=4;function dp(t,e,r){return e!=null?(e?As:0)|(e==="full"?xl:0):t&&t.whitespace=="pre"?As|xl:r&~ys}class yo{constructor(e,r,n,s,o,i){this.type=e,this.attrs=r,this.marks=n,this.solid=s,this.options=i,this.content=[],this.activeMarks=ue.none,this.match=o||(i&ys?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(L.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,s;return(s=n.findWrapping(e.type))?(this.match=n,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&As)){let n=this.content[this.content.length-1],s;if(n&&n.isText&&(s=/[ \t\r\n\u000c]+$/.exec(n.text))){let o=n;n.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let r=L.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!om.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class pp{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let s=r.topNode,o,i=dp(null,r.preserveWhitespace,0)|(n?ys:0);s?o=new yo(s.type,s.attrs,ue.none,!0,r.topMatch||s.type.contentMatch,i):n?o=new yo(null,null,ue.none,!0,null,i):o=new yo(e.schema.topNodeType,null,ue.none,!0,null,i),this.nodes=[o],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,s=this.top,o=s.options&xl?"full":this.localPreserveWS||(s.options&As)>0,{schema:i}=this.parser;if(o==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if(o==="full")n=n.replace(/\r\n?/g,`
|
|
80
|
+
`);else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(i.linebreakReplacement.create(),r,!0),a[l]&&this.insertNode(i.text(a[l]),r,!/\S/.test(a[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=s.content[s.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let s=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;im.hasOwnProperty(i)&&this.parser.normalizeLists&&CC(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:DC.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(om.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let f=l&&l.skip?r:this.readStyles(e,r);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(e,r);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=s}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
81
|
+
`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],i=n.getPropertyValue(o);if(i)for(let a=void 0;;){let l=this.parser.matchStyle(o,i,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(c=>!l.clearMark(c)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return r}addElementByRule(e,r,n,s){let o,i;if(r.node)if(i=this.parser.schema.nodes[r.node],i.isLeaf)this.insertNode(i.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(i,r.attrs||null,n,r.preserveWhitespace);l&&(o=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(s)this.addElement(e,n,s);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,r,n,s){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,a=s==null?null:e.childNodes[s];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,r);this.findAtPoint(e,o)}findPlace(e,r,n){let s,o;for(let i=this.open,a=0;i>=0;i--){let l=this.nodes[i],c=l.findWrapping(e);if(c&&(!s||s.length>c.length+a)&&(s=c,o=l,!c.length))break;if(l.solid){if(n)break;a+=2}}if(!s)return null;this.sync(o);for(let i=0;i<s.length;i++)r=this.enterInner(s[i],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(r=this.enterInner(o,null,r))}let s=this.findPlace(e,r,n);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=ue.none;for(let a of s.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):fp(a.type,e.type))&&(i=a.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,r,n,s){let o=this.findPlace(e.create(r),n,!1);return o&&(o=this.enterInner(e,r,n,!0,s)),o}enterInner(e,r,n,s=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=dp(e,o,i.options);i.options&ys&&i.content.length==0&&(a|=ys);let l=ue.none;return n=n.filter(c=>(i.type?i.type.allowsMarkType(c.type):fp(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new yo(e,r,l,s,null,a)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=As)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let s=n.length-1;s>=0;s--)e+=n[s].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&r.compareDocumentPosition(this.find[s].node)&(n?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,s=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),o=-(n?n.depth+1:0)+(s?0:1),i=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=o;l--)if(i(a-1,l))return!0;return!1}else{let d=l>0||l==0&&s?this.nodes[l].type:n&&l>=o?n.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return i(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function CC(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&im.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function kC(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function hp(t){let e={};for(let r in t)e[r]=t[r];return e}function fp(t,e){let r=e.schema.nodes;for(let n in r){let s=r[n];if(!s.allowsMarkType(t))continue;let o=[],i=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||o.indexOf(d)<0&&i(d))return!0}};if(i(s.contentMatch))return!0}}class on{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=Ma(r).createDocumentFragment());let s=n,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let a=0,l=0;for(;a<o.length&&l<i.marks.length;){let c=i.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)s=o.pop()[1];for(;l<i.marks.length;){let c=i.marks[l++],d=this.serializeMark(c,i.isInline,r);d&&(o.push([c,s]),s.appendChild(d.dom),s=d.contentDOM||d.dom)}}s.appendChild(this.serializeNodeInner(i,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:s}=Mo(Ma(r),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,s)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let s=e.marks.length-1;s>=0;s--){let o=this.serializeMark(e.marks[s],e.isInline,r);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,r,n={}){let s=this.marks[e.type.name];return s&&Mo(Ma(n),s(e,r),null,e.attrs)}static renderSpec(e,r,n=null,s){return Mo(e,r,n,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new on(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=mp(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return mp(e.marks)}}function mp(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function Ma(t){return t.document||window.document}const gp=new WeakMap;function EC(t){let e=gp.get(t);return e===void 0&&gp.set(t,e=SC(t)),e}function SC(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let s=0;s<n.length;s++)r(n[s]);else for(let s in n)r(n[s])}return r(t),e}function Mo(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],o;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(o=EC(n))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=s.indexOf(" ");i>0&&(r=s.slice(0,i),s=s.slice(i+1));let a,l=r?t.createElementNS(r,s):t.createElement(s),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let m=f.indexOf(" ");m>0?l.setAttributeNS(f.slice(0,m),f.slice(m+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=d;f<e.length;f++){let m=e[f];if(m===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:g,contentDOM:y}=Mo(t,m,r,n);if(l.appendChild(g),y){if(a)throw new RangeError("Multiple content holes");a=y}}}return{dom:l,contentDOM:a}}const am=65535,lm=Math.pow(2,16);function FC(t,e){return t+e*lm}function bp(t){return t&am}function AC(t){return(t-(t&am))/lm}const um=1,cm=2,Bo=4,dm=8;class vl{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&dm)>0}get deletedBefore(){return(this.delInfo&(um|Bo))>0}get deletedAfter(){return(this.delInfo&(cm|Bo))>0}get deletedAcross(){return(this.delInfo&Bo)>0}}class rt{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&rt.empty)return rt.empty}recover(e){let r=0,n=bp(e);if(!this.inverted)for(let s=0;s<n;s++)r+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[n*3]+r+AC(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let s=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let c=this.ranges[a+o],d=this.ranges[a+i],f=l+c;if(e<=f){let m=c?e==l?-1:e==f?1:r:r,g=l+s+(m<0?0:d);if(n)return g;let y=e==(r<0?l:f)?null:FC(a/3,e-l),v=e==l?cm:e==f?um:Bo;return(r<0?e!=l:e!=f)&&(v|=dm),new vl(g,v,y)}s+=d-c}return n?e+s:new vl(e+s,0,null)}touches(e,r){let n=0,s=bp(r),o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+o],d=l+c;if(e<=d&&a==s*3)return!0;n+=this.ranges[a+i]-c}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],a=i-(this.inverted?o:0),l=i+(this.inverted?0:o),c=this.ranges[s+r],d=this.ranges[s+n];e(a,a+c,l,l+d),o+=d-c}}invert(){return new rt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?rt.empty:new rt(e<0?[0,-e,0]:[0,0,e])}}rt.empty=new rt([]);class Ns{constructor(e,r,n=0,s=e?e.length:0){this.mirror=r,this.from=n,this.to=s,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new Ns(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let s=e.getMirror(r);this.appendMap(e._maps[r],s!=null&&s<r?n+s:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let s=e.getMirror(r);this.appendMap(e._maps[r].invert(),s!=null&&s>r?n-s-1:void 0)}}invert(){let e=new Ns;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let s=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],a=i.mapResult(e,r);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return n?e:new vl(e,s,null)}}const Ba=Object.create(null);class qe{getMap(){return rt.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ba[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in Ba)throw new RangeError("Duplicate use of step JSON ID "+e);return Ba[e]=r,r.prototype.jsonID=e,r}}class De{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,r,n,s){try{return De.ok(e.replace(r,n,s))}catch(o){if(o instanceof Ro)return De.fail(o.message);throw o}}}function bu(t,e,r){let n=[];for(let s=0;s<t.childCount;s++){let o=t.child(s);o.content.size&&(o=o.copy(bu(o.content,e,o))),o.isInline&&(o=e(o,r,s)),n.push(o)}return L.fromArray(n)}class hr extends qe{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),s=n.node(n.sharedDepth(this.to)),o=new H(bu(r.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),s),r.openStart,r.openEnd);return De.fromReplace(e,this.from,this.to,o)}invert(){return new wt(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new hr(r.pos,n.pos,this.mark)}merge(e){return e instanceof hr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new hr(r.from,r.to,e.markFromJSON(r.mark))}}qe.jsonID("addMark",hr);class wt extends qe{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new H(bu(r.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),r.openStart,r.openEnd);return De.fromReplace(e,this.from,this.to,n)}invert(){return new hr(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new wt(r.pos,n.pos,this.mark)}merge(e){return e instanceof wt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wt(r.from,r.to,e.markFromJSON(r.mark))}}qe.jsonID("removeMark",wt);class fr extends qe{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return De.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return De.fromReplace(e,this.pos,this.pos+1,new H(L.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let s=0;s<r.marks.length;s++)if(!r.marks[s].isInSet(n))return new fr(this.pos,r.marks[s]);return new fr(this.pos,this.mark)}}return new Zr(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new fr(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new fr(r.pos,e.markFromJSON(r.mark))}}qe.jsonID("addNodeMark",fr);class Zr extends qe{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return De.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return De.fromReplace(e,this.pos,this.pos+1,new H(L.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new fr(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Zr(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Zr(r.pos,e.markFromJSON(r.mark))}}qe.jsonID("removeNodeMark",Zr);class Ne extends qe{constructor(e,r,n,s=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=s}apply(e){return this.structure&&wl(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new rt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ne(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new Ne(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ne)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ne(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ne(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ne(r.from,r.to,H.fromJSON(e,r.slice),!!r.structure)}}qe.jsonID("replace",Ne);class Te extends qe{constructor(e,r,n,s,o,i,a=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=s,this.slice=o,this.insert=i,this.structure=a}apply(e){if(this.structure&&(wl(e,this.from,this.gapFrom)||wl(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return De.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?De.fromReplace(e,this.from,this.to,n):De.fail("Content does not fit in gap")}getMap(){return new rt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Te(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),s=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||s<r.pos||o>n.pos?null:new Te(r.pos,n.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Te(r.from,r.to,r.gapFrom,r.gapTo,H.fromJSON(e,r.slice),r.insert,!!r.structure)}}qe.jsonID("replaceAround",Te);function wl(t,e,r){let n=t.resolve(e),s=r-e,o=n.depth;for(;s>0&&o>0&&n.indexAfter(o)==n.node(o).childCount;)o--,s--;if(s>0){let i=n.node(o).maybeChild(n.indexAfter(o));for(;s>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,s--}}return!1}function NC(t,e,r,n){let s=[],o=[],i,a;t.doc.nodesBetween(e,r,(l,c,d)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&d.type.allowsMarkType(n.type)){let m=Math.max(c,e),g=Math.min(c+l.nodeSize,r),y=n.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(y)||(i&&i.to==m&&i.mark.eq(f[v])?i.to=g:s.push(i=new wt(m,g,f[v])));a&&a.to==m?a.to=g:o.push(a=new hr(m,g,n))}}),s.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function TC(t,e,r,n){let s=[],o=0;t.doc.nodesBetween(e,r,(i,a)=>{if(!i.isInline)return;o++;let l=null;if(n instanceof Li){let c=i.marks,d;for(;d=n.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length){let c=Math.min(a+i.nodeSize,r);for(let d=0;d<l.length;d++){let f=l[d],m;for(let g=0;g<s.length;g++){let y=s[g];y.step==o-1&&f.eq(s[g].style)&&(m=y)}m?(m.to=c,m.step=o):s.push({style:f,from:Math.max(a,e),to:c,step:o})}}}),s.forEach(i=>t.step(new wt(i.from,i.to,i.style)))}function yu(t,e,r,n=r.contentMatch,s=!0){let o=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=a+c.nodeSize,f=n.matchType(c.type);if(!f)i.push(new Ne(a,d,H.empty));else{n=f;for(let m=0;m<c.marks.length;m++)r.allowsMarkType(c.marks[m].type)||t.step(new wt(a,d,c.marks[m]));if(s&&c.isText&&r.whitespace!="pre"){let m,g=/\r?\n|\r/g,y;for(;m=g.exec(c.text);)y||(y=new H(L.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),i.push(new Ne(a+m.index,a+m.index+m[0].length,y))}}a=d}if(!n.validEnd){let l=n.fillBefore(L.empty,!0);t.replace(a,a,new H(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function MC(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function zn(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let s=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&s.canReplace(o,i,r))return n;if(n==0||s.type.spec.isolating||!MC(s,o,i))break}return null}function BC(t,e,r){let{$from:n,$to:s,depth:o}=e,i=n.before(o+1),a=s.after(o+1),l=i,c=a,d=L.empty,f=0;for(let y=o,v=!1;y>r;y--)v||n.index(y)>0?(v=!0,d=L.from(n.node(y).copy(d)),f++):l--;let m=L.empty,g=0;for(let y=o,v=!1;y>r;y--)v||s.after(y+1)<s.end(y)?(v=!0,m=L.from(s.node(y).copy(m)),g++):c++;t.step(new Te(l,c,i,a,new H(d.append(m),f,g),d.size-f,!0))}function xu(t,e,r=null,n=t){let s=jC(t,e),o=s&&OC(n,e);return o?s.map(yp).concat({type:e,attrs:r}).concat(o.map(yp)):null}function yp(t){return{type:t,attrs:null}}function jC(t,e){let{parent:r,startIndex:n,endIndex:s}=t,o=r.contentMatchAt(n).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return r.canReplaceWith(n,s,i)?o:null}function OC(t,e){let{parent:r,startIndex:n,endIndex:s}=t,o=r.child(n),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let c=n;l&&c<s;c++)l=l.matchType(r.child(c).type);return!l||!l.validEnd?null:i}function LC(t,e,r){let n=L.empty;for(let i=r.length-1;i>=0;i--){if(n.size){let a=r[i].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=L.from(r[i].type.create(r[i].attrs,n))}let s=e.start,o=e.end;t.step(new Te(s,o,s,o,new H(n,0,0),r.length,!0))}function _C(t,e,r,n,s){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,r,(i,a)=>{let l=typeof s=="function"?s(i):s;if(i.isTextblock&&!i.hasMarkup(n,l)&&IC(t.doc,t.mapping.slice(o).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let g=n.whitespace=="pre",y=!!n.contentMatch.matchType(n.schema.linebreakReplacement);g&&!y?c=!1:!g&&y&&(c=!0)}c===!1&&hm(t,i,a,o),yu(t,t.mapping.slice(o).map(a,1),n,void 0,c===null);let d=t.mapping.slice(o),f=d.map(a,1),m=d.map(a+i.nodeSize,1);return t.step(new Te(f,m,f+1,m-1,new H(L.from(n.create(l,null,i.marks)),0,0),1,!0)),c===!0&&pm(t,i,a,o),!1}})}function pm(t,e,r,n){e.forEach((s,o)=>{if(s.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(s.text);){let l=t.mapping.slice(n).map(r+1+o+i.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function hm(t,e,r,n){e.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let i=t.mapping.slice(n).map(r+1+o);t.replaceWith(i,i+1,e.type.schema.text(`
|
|
82
|
+
`))}})}function IC(t,e,r){let n=t.resolve(e),s=n.index();return n.parent.canReplaceWith(s,s+1,r)}function RC(t,e,r,n,s){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");r||(r=o.type);let i=r.create(n,null,s||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,i);if(!r.validContent(o.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new Te(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new H(L.from(i),0,0),1,!0))}function Ut(t,e,r=1,n){let s=t.resolve(e),o=s.depth-r,i=n&&n[n.length-1]||s.parent;if(o<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!i.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,d=r-2;c>o;c--,d--){let f=s.node(c),m=s.index(c);if(f.type.spec.isolating)return!1;let g=f.content.cutByIndex(m,f.childCount),y=n&&n[d+1];y&&(g=g.replaceChild(0,y.type.create(y.attrs)));let v=n&&n[d]||f;if(!f.canReplace(m+1,f.childCount)||!v.type.validContent(g))return!1}let a=s.indexAfter(o),l=n&&n[0];return s.node(o).canReplaceWith(a,a,l?l.type:s.node(o+1).type)}function PC(t,e,r=1,n){let s=t.doc.resolve(e),o=L.empty,i=L.empty;for(let a=s.depth,l=s.depth-r,c=r-1;a>l;a--,c--){o=L.from(s.node(a).copy(o));let d=n&&n[c];i=L.from(d?d.type.create(d.attrs,i):s.node(a).copy(i))}t.step(new Ne(e,e,new H(o.append(i),r,r),!0))}function Sr(t,e){let r=t.resolve(e),n=r.index();return fm(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function zC(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let s=0;s<e.childCount;s++){let o=e.child(s),i=o.type==n?t.type.schema.nodes.text:o.type;if(r=r.matchType(i),!r||!t.type.allowsMarks(o.marks))return!1}return r.validEnd}function fm(t,e){return!!(t&&e&&!t.isLeaf&&zC(t,e))}function _i(t,e,r=-1){let n=t.resolve(e);for(let s=n.depth;;s--){let o,i,a=n.index(s);if(s==n.depth?(o=n.nodeBefore,i=n.nodeAfter):r>0?(o=n.node(s+1),a++,i=n.node(s).maybeChild(a)):(o=n.node(s).maybeChild(a-1),i=n.node(s+1)),o&&!o.isTextblock&&fm(o,i)&&n.node(s).canReplace(a,a+1))return e;if(s==0)break;e=r<0?n.before(s):n.after(s)}}function $C(t,e,r){let n=null,{linebreakReplacement:s}=t.doc.type.schema,o=t.doc.resolve(e-r),i=o.node().type;if(s&&i.inlineContent){let d=i.whitespace=="pre",f=!!i.contentMatch.matchType(s);d&&!f?n=!1:!d&&f&&(n=!0)}let a=t.steps.length;if(n===!1){let d=t.doc.resolve(e+r);hm(t,d.node(),d.before(),a)}i.inlineContent&&yu(t,e+r-1,i,o.node().contentMatchAt(o.index()),n==null);let l=t.mapping.slice(a),c=l.map(e-r);if(t.step(new Ne(c,l.map(e+r,-1),H.empty,!0)),n===!0){let d=t.doc.resolve(c);pm(t,d.node(),d.before(),t.steps.length)}return t}function HC(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let s=n.depth-1;s>=0;s--){let o=n.index(s);if(n.node(s).canReplaceWith(o,o,r))return n.before(s+1);if(o>0)return null}if(n.parentOffset==n.parent.content.size)for(let s=n.depth-1;s>=0;s--){let o=n.indexAfter(s);if(n.node(s).canReplaceWith(o,o,r))return n.after(s+1);if(o<n.node(s).childCount)return null}return null}function mm(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let s=r.content;for(let o=0;o<r.openStart;o++)s=s.firstChild.content;for(let o=1;o<=(r.openStart==0&&r.size?2:1);o++)for(let i=n.depth;i>=0;i--){let a=i==n.depth?0:n.pos<=(n.start(i+1)+n.end(i+1))/2?-1:1,l=n.index(i)+(a>0?1:0),c=n.node(i),d=!1;if(o==1)d=c.canReplace(l,l,s);else{let f=c.contentMatchAt(l).findWrapping(s.firstChild.type);d=f&&c.canReplaceWith(l,l,f[0])}if(d)return a==0?n.pos:a<0?n.before(i+1):n.after(i+1)}return null}function Ii(t,e,r=e,n=H.empty){if(e==r&&!n.size)return null;let s=t.resolve(e),o=t.resolve(r);return gm(s,o,n)?new Ne(e,r,n):new VC(s,o,n).fit()}function gm(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class VC{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=L.empty;for(let s=0;s<=e.depth;s++){let o=e.node(s);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=L.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,s=this.close(e<0?this.$to:n.doc.resolve(e));if(!s)return null;let o=this.placed,i=n.depth,a=s.depth;for(;i&&a&&o.childCount==1;)o=o.firstChild.content,i--,a--;let l=new H(o,i,a);return e>-1?new Te(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Ne(n.pos,s.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,s=this.unplaced.openEnd;n<e;n++){let o=r.firstChild;if(r.childCount>1&&(s=0),o.type.spec.isolating&&s<=n){e=n;break}r=o.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let s,o=null;n?(o=ja(this.unplaced.content,n-1).firstChild,s=o.content):s=this.unplaced.content;let i=s.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,f=null;if(r==1&&(i?c.matchType(i.type)||(f=c.fillBefore(L.from(i),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:a,parent:o,inject:f};if(r==2&&i&&(d=c.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:a,parent:o,wrap:d};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,s=ja(e,r);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new H(e,r+1,Math.max(n,s.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,s=ja(e,r);if(s.childCount<=1&&r>0){let o=e.size-r<=r+s.size;this.unplaced=new H(cs(e,r-1,1),r-1,o?r-1:n)}else this.unplaced=new H(cs(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:s,wrap:o}){for(;this.depth>r;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let i=this.unplaced,a=n?n.content:i.content,l=i.openStart-e,c=0,d=[],{match:f,type:m}=this.frontier[r];if(s){for(let v=0;v<s.childCount;v++)d.push(s.child(v));f=f.matchFragment(s)}let g=a.size+e-(i.content.size-i.openEnd);for(;c<a.childCount;){let v=a.child(c),w=f.matchType(v.type);if(!w)break;c++,(c>1||l==0||v.content.size)&&(f=w,d.push(bm(v.mark(m.allowedMarks(v.marks)),c==1?l:0,c==a.childCount?g:-1)))}let y=c==a.childCount;y||(g=-1),this.placed=ds(this.placed,r,L.from(d)),this.frontier[r].match=f,y&&g<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,w=a;v<g;v++){let D=w.lastChild;this.frontier.push({type:D.type,match:D.contentMatchAt(D.childCount)}),w=D.content}this.unplaced=y?e==0?H.empty:new H(cs(i.content,e-1,1),e-1,g<0?i.openEnd:e-1):new H(cs(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!Oa(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,s=this.$to.after(n);for(;n>1&&s==this.$to.end(--n);)++s;return s}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:s}=this.frontier[r],o=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),i=Oa(e,r,s,n,o);if(i){for(let a=r-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=Oa(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:r,fit:i,move:o?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=ds(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let s=e.node(n),o=s.type.contentMatch.fillBefore(s.content,!0,e.index(n));this.openFrontierNode(s.type,s.attrs,o)}return e}openFrontierNode(e,r=null,n){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=ds(this.placed,this.depth,L.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(L.empty,!0);r.childCount&&(this.placed=ds(this.placed,this.frontier.length,r))}}function cs(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(cs(t.firstChild.content,e-1,r)))}function ds(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(ds(t.lastChild.content,e-1,r)))}function ja(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function bm(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,bm(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(L.empty,!0)))),t.copy(n)}function Oa(t,e,r,n,s){let o=t.node(e),i=s?t.indexAfter(e):t.index(e);if(i==o.childCount&&!r.compatibleContent(o.type))return null;let a=n.fillBefore(o.content,!0,i);return a&&!qC(r,o.content,i)?a:null}function qC(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function WC(t){return t.spec.defining||t.spec.definingForContent}function UC(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let s=t.doc.resolve(e),o=t.doc.resolve(r);if(gm(s,o,n))return t.step(new Ne(e,r,n));let i=xm(s,t.doc.resolve(r));i[i.length-1]==0&&i.pop();let a=-(s.depth+1);i.unshift(a);for(let m=s.depth,g=s.pos-1;m>0;m--,g--){let y=s.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;i.indexOf(m)>-1?a=m:s.before(m)==g&&i.splice(1,0,-m)}let l=i.indexOf(a),c=[],d=n.openStart;for(let m=n.content,g=0;;g++){let y=m.firstChild;if(c.push(y),g==n.openStart)break;m=y.content}for(let m=d-1;m>=0;m--){let g=c[m],y=WC(g.type);if(y&&!g.sameMarkup(s.node(Math.abs(a)-1)))d=m;else if(y||!g.type.isTextblock)break}for(let m=n.openStart;m>=0;m--){let g=(m+d+1)%(n.openStart+1),y=c[g];if(y)for(let v=0;v<i.length;v++){let w=i[(v+l)%i.length],D=!0;w<0&&(D=!1,w=-w);let E=s.node(w-1),N=s.index(w-1);if(E.canReplaceWith(N,N,y.type,y.marks))return t.replace(s.before(w),D?o.after(w):r,new H(ym(n.content,0,n.openStart,g),g,n.openEnd))}}let f=t.steps.length;for(let m=i.length-1;m>=0&&(t.replace(e,r,n),!(t.steps.length>f));m--){let g=i[m];g<0||(e=s.before(g),r=o.after(g))}}function ym(t,e,r,n,s){if(e<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(ym(o.content,e+1,r,n,o)))}if(e>n){let o=s.contentMatchAt(0),i=o.fillBefore(t).append(t);t=i.append(o.matchFragment(i).fillBefore(L.empty,!0))}return t}function JC(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let s=HC(t.doc,e,n.type);s!=null&&(e=r=s)}t.replaceRange(e,r,new H(L.from(n),0,0))}function KC(t,e,r){let n=t.doc.resolve(e),s=t.doc.resolve(r),o=xm(n,s);for(let i=0;i<o.length;i++){let a=o[i],l=i==o.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),s.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),s.indexAfter(a-1))))return t.delete(n.before(a),s.after(a))}for(let i=1;i<=n.depth&&i<=s.depth;i++)if(e-n.start(i)==n.depth-i&&r>n.end(i)&&s.end(i)-r!=s.depth-i&&n.start(i-1)==s.start(i-1)&&n.node(i-1).canReplace(n.index(i-1),s.index(i-1)))return t.delete(n.before(i),r);t.delete(e,r)}function xm(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let s=n;s>=0;s--){let o=t.start(s);if(o<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(o==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==o-1)&&r.push(s)}return r}class En extends qe{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return De.fail("No node at attribute step's position");let n=Object.create(null);for(let o in r.attrs)n[o]=r.attrs[o];n[this.attr]=this.value;let s=r.type.create(n,null,r.marks);return De.fromReplace(e,this.pos,this.pos+1,new H(L.from(s),0,r.isLeaf?0:1))}getMap(){return rt.empty}invert(e){return new En(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new En(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new En(r.pos,r.attr,r.value)}}qe.jsonID("attr",En);class Ts extends qe{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let s in e.attrs)r[s]=e.attrs[s];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return De.ok(n)}getMap(){return rt.empty}invert(e){return new Ts(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ts(r.attr,r.value)}}qe.jsonID("docAttr",Ts);let Nn=class extends Error{};Nn=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};Nn.prototype=Object.create(Error.prototype);Nn.prototype.constructor=Nn;Nn.prototype.name="TransformError";class vm{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ns}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new Nn(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=H.empty){let s=Ii(this.doc,e,r,n);return s&&this.step(s),this}replaceWith(e,r,n){return this.replace(e,r,new H(L.from(n),0,0))}delete(e,r){return this.replace(e,r,H.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return UC(this,e,r,n),this}replaceRangeWith(e,r,n){return JC(this,e,r,n),this}deleteRange(e,r){return KC(this,e,r),this}lift(e,r){return BC(this,e,r),this}join(e,r=1){return $C(this,e,r),this}wrap(e,r){return LC(this,e,r),this}setBlockType(e,r=e,n,s=null){return _C(this,e,r,n,s),this}setNodeMarkup(e,r,n=null,s){return RC(this,e,r,n,s),this}setNodeAttribute(e,r,n){return this.step(new En(e,r,n)),this}setDocAttribute(e,r){return this.step(new Ts(e,r)),this}addNodeMark(e,r){return this.step(new fr(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof ue)r.isInSet(n.marks)&&this.step(new Zr(e,r));else{let s=n.marks,o,i=[];for(;o=r.isInSet(s);)i.push(new Zr(e,o)),s=o.removeFromSet(s);for(let a=i.length-1;a>=0;a--)this.step(i[a])}return this}split(e,r=1,n){return PC(this,e,r,n),this}addMark(e,r,n){return NC(this,e,r,n),this}removeMark(e,r,n){return TC(this,e,r,n),this}clearIncompatible(e,r,n){return yu(this,e,r,n),this}}const La=Object.create(null);class re{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new GC(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=H.empty){let n=r.content.lastChild,s=null;for(let a=0;a<r.openEnd;a++)s=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],d=e.mapping.slice(o);e.replaceRange(d.map(l.pos),d.map(c.pos),a?H.empty:r),a==0&&wp(e,o,(n?n.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:i,$to:a}=s[o],l=e.mapping.slice(n),c=l.map(i.pos),d=l.map(a.pos);o?e.deleteRange(c,d):(e.replaceRangeWith(c,d,r),wp(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let s=e.parent.inlineContent?new X(e):yn(e.node(0),e.parent,e.pos,e.index(),r,n);if(s)return s;for(let o=e.depth-1;o>=0;o--){let i=r<0?yn(e.node(0),e.node(o),e.before(o+1),e.index(o),r,n):yn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,r,n);if(i)return i}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new st(e.node(0))}static atStart(e){return yn(e,e,0,0,1)||new st(e)}static atEnd(e){return yn(e,e,e.content.size,e.childCount,-1)||new st(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=La[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in La)throw new RangeError("Duplicate use of selection JSON ID "+e);return La[e]=r,r.prototype.jsonID=e,r}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}}re.prototype.visible=!0;class GC{constructor(e,r){this.$from=e,this.$to=r}}let xp=!1;function vp(t){!xp&&!t.parent.inlineContent&&(xp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class X extends re{constructor(e,r=e){vp(e),vp(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return re.near(n);let s=e.resolve(r.map(this.anchor));return new X(s.parent.inlineContent?s:n,n)}replace(e,r=H.empty){if(super.replace(e,r),r==H.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof X&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ri(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new X(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let s=e.resolve(r);return new this(s,n==r?s:e.resolve(n))}static between(e,r,n){let s=e.pos-r.pos;if((!n||s)&&(n=s>=0?1:-1),!r.parent.inlineContent){let o=re.findFrom(r,n,!0)||re.findFrom(r,-n,!0);if(o)r=o.$head;else return re.near(r,n)}return e.parent.inlineContent||(s==0?e=r:(e=(re.findFrom(e,-n,!0)||re.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=s<0&&(e=r))),new X(e,r)}}re.jsonID("text",X);class Ri{constructor(e,r){this.anchor=e,this.head=r}map(e){return new Ri(e.map(this.anchor),e.map(this.head))}resolve(e){return X.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends re{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:s}=r.mapResult(this.anchor),o=e.resolve(s);return n?re.near(o):new Y(o)}content(){return new H(L.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new vu(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(r.anchor))}static create(e,r){return new Y(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1;re.jsonID("node",Y);class vu{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new Ri(n,n):new vu(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&Y.isSelectable(n)?new Y(r):re.near(r)}}class st extends re{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=H.empty){if(r==H.empty){e.delete(0,e.doc.content.size);let n=re.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new st(e)}map(e){return new st(e)}eq(e){return e instanceof st}getBookmark(){return YC}}re.jsonID("all",st);const YC={map(){return this},resolve(t){return new st(t)}};function yn(t,e,r,n,s,o=!1){if(e.inlineContent)return X.create(t,r);for(let i=n-(s>0?0:1);s>0?i<e.childCount:i>=0;i+=s){let a=e.child(i);if(a.isAtom){if(!o&&Y.isSelectable(a))return Y.create(t,r-(s<0?a.nodeSize:0))}else{let l=yn(t,a,r+s,s<0?a.childCount:0,s,o);if(l)return l}r+=a.nodeSize*s}return null}function wp(t,e,r){let n=t.steps.length-1;if(n<e)return;let s=t.steps[n];if(!(s instanceof Ne||s instanceof Te))return;let o=t.mapping.maps[n],i;o.forEach((a,l,c,d)=>{i==null&&(i=d)}),t.setSelection(re.near(t.doc.resolve(i),r))}const Dp=1,xo=2,Cp=4;class XC extends vm{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Dp)&~xo,this.storedMarks=null,this}get selectionSet(){return(this.updated&Dp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=xo,this}ensureMarks(e){return ue.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&xo)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~xo,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||ue.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let s=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),!e)return this.deleteRange(r,n);let o=this.storedMarks;if(!o){let i=this.doc.resolve(r);o=n==r?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,s.text(e,o)),!this.selection.empty&&this.selection.to==r+e.length&&this.setSelection(re.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Cp,this}get scrolledIntoView(){return(this.updated&Cp)>0}}function kp(t,e){return!e||!t?t:t.bind(e)}class ps{constructor(e,r,n){this.name=e,this.init=kp(r.init,n),this.apply=kp(r.apply,n)}}const QC=[new ps("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ps("selection",{init(t,e){return t.selection||re.atStart(e.doc)},apply(t){return t.selection}}),new ps("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new ps("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class _a{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=QC.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new ps(n.key,n.spec.state,n))})}}class kn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let s=this.config.plugins[n];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),s=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=s?s[i].n:0,c=s?s[i].state:this,d=l<r.length&&a.spec.appendTransaction.call(a,l?r.slice(l):r,c,n);if(d&&n.filterTransaction(d,i)){if(d.setMeta("appendedTransaction",e),!s){s=[];for(let f=0;f<this.config.plugins.length;f++)s.push(f<i?{state:n,n:r.length}:{state:this,n:0})}r.push(d),n=n.applyInner(d),o=!0}s&&(s[i]={state:n,n:r.length})}}if(!o)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new kn(this.config),n=this.config.fields;for(let s=0;s<n.length;s++){let o=n[s];r[o.name]=o.apply(e,this[o.name],this,r)}return r}get tr(){return new XC(this)}static create(e){let r=new _a(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new kn(r);for(let s=0;s<r.fields.length;s++)n[r.fields[s].name]=r.fields[s].init(e,n);return n}reconfigure(e){let r=new _a(this.schema,e.plugins),n=r.fields,s=new kn(r);for(let o=0;o<n.length;o++){let i=n[o].name;s[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,s)}return s}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[n],o=s.spec.state;o&&o.toJSON&&(r[n]=o.toJSON.call(s,this[s.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new _a(e.schema,e.plugins),o=new kn(s);return s.fields.forEach(i=>{if(i.name=="doc")o.doc=Dt.fromJSON(e.schema,r.doc);else if(i.name=="selection")o.selection=re.fromJSON(o.doc,r.selection);else if(i.name=="storedMarks")r.storedMarks&&(o.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){o[i.name]=c.fromJSON.call(l,e,r[a],o);return}}o[i.name]=i.init(e,o)}}),o}}function wm(t,e,r){for(let n in t){let s=t[n];s instanceof Function?s=s.bind(e):n=="handleDOMEvents"&&(s=wm(s,e,{})),r[n]=s}return r}class be{constructor(e){this.spec=e,this.props={},e.props&&wm(e.props,this,this.props),this.key=e.key?e.key.key:Dm("plugin")}getState(e){return e[this.key]}}const Ia=Object.create(null);function Dm(t){return t in Ia?t+"$"+ ++Ia[t]:(Ia[t]=0,t+"$")}class je{constructor(e="key"){this.key=Dm(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const wu=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Cm(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const km=(t,e,r)=>{let n=Cm(t,r);if(!n)return!1;let s=Du(n);if(!s){let i=n.blockRange(),a=i&&zn(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let o=s.nodeBefore;if(jm(t,s,e,-1))return!0;if(n.parent.content.size==0&&(Tn(o,"end")||Y.isSelectable(o)))for(let i=n.depth;;i--){let a=Ii(t.doc,n.before(i),n.after(i),H.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Tn(o,"end")?re.findFrom(l.doc.resolve(l.mapping.map(s.pos,-1)),-1):Y.create(l.doc,s.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(i==1||n.node(i-1).childCount>1)break}return o.isAtom&&s.depth==n.depth-1?(e&&e(t.tr.delete(s.pos-o.nodeSize,s.pos).scrollIntoView()),!0):!1},ZC=(t,e,r)=>{let n=Cm(t,r);if(!n)return!1;let s=Du(n);return s?Em(t,s,e):!1},ek=(t,e,r)=>{let n=Fm(t,r);if(!n)return!1;let s=Cu(n);return s?Em(t,s,e):!1};function Em(t,e,r){let n=e.nodeBefore,s=n,o=e.pos-1;for(;!s.isTextblock;o--){if(s.type.spec.isolating)return!1;let d=s.lastChild;if(!d)return!1;s=d}let i=e.nodeAfter,a=i,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=Ii(t.doc,o,l,H.empty);if(!c||c.from!=o||c instanceof Ne&&c.slice.size>=l-o)return!1;if(r){let d=t.tr.step(c);d.setSelection(X.create(d.doc,o)),r(d.scrollIntoView())}return!0}function Tn(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const Sm=(t,e,r)=>{let{$head:n,empty:s}=t.selection,o=n;if(!s)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;o=Du(n)}let i=o&&o.nodeBefore;return!i||!Y.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)};function Du(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Fm(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const Am=(t,e,r)=>{let n=Fm(t,r);if(!n)return!1;let s=Cu(n);if(!s)return!1;let o=s.nodeAfter;if(jm(t,s,e,1))return!0;if(n.parent.content.size==0&&(Tn(o,"start")||Y.isSelectable(o))){let i=Ii(t.doc,n.before(),n.after(),H.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(Tn(o,"start")?re.findFrom(a.doc.resolve(a.mapping.map(s.pos)),1):Y.create(a.doc,a.mapping.map(s.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&s.depth==n.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+o.nodeSize).scrollIntoView()),!0):!1},Nm=(t,e,r)=>{let{$head:n,empty:s}=t.selection,o=n;if(!s)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;o=Cu(n)}let i=o&&o.nodeAfter;return!i||!Y.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos)).scrollIntoView()),!0)};function Cu(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const tk=(t,e)=>{let r=t.selection,n=r instanceof Y,s;if(n){if(r.node.isTextblock||!Sr(t.doc,r.from))return!1;s=r.from}else if(s=_i(t.doc,r.from,-1),s==null)return!1;if(e){let o=t.tr.join(s);n&&o.setSelection(Y.create(o.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},rk=(t,e)=>{let r=t.selection,n;if(r instanceof Y){if(r.node.isTextblock||!Sr(t.doc,r.to))return!1;n=r.to}else if(n=_i(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},nk=(t,e)=>{let{$from:r,$to:n}=t.selection,s=r.blockRange(n),o=s&&zn(s);return o==null?!1:(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)},Tm=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
|
|
83
|
+
`).scrollIntoView()),!0)};function ku(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const sk=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let s=r.node(-1),o=r.indexAfter(-1),i=ku(s.contentMatchAt(o));if(!i||!s.canReplaceWith(o,o,i))return!1;if(e){let a=r.after(),l=t.tr.replaceWith(a,a,i.createAndFill());l.setSelection(re.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Mm=(t,e)=>{let r=t.selection,{$from:n,$to:s}=r;if(r instanceof st||n.parent.inlineContent||s.parent.inlineContent)return!1;let o=ku(s.parent.contentMatchAt(s.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let i=(!n.parentOffset&&s.index()<s.parent.childCount?n:s).pos,a=t.tr.insert(i,o.createAndFill());a.setSelection(X.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},Bm=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let o=r.before();if(Ut(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let n=r.blockRange(),s=n&&zn(n);return s==null?!1:(e&&e(t.tr.lift(n,s).scrollIntoView()),!0)};function ok(t){return(e,r)=>{let{$from:n,$to:s}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!n.parentOffset||!Ut(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],i,a,l=!1,c=!1;for(let g=n.depth;;g--)if(n.node(g).isBlock){l=n.end(g)==n.pos+(n.depth-g),c=n.start(g)==n.pos-(n.depth-g),a=ku(n.node(g-1).contentMatchAt(n.indexAfter(g-1))),o.unshift(l&&a?{type:a}:null),i=g;break}else{if(g==1)return!1;o.unshift(null)}let d=e.tr;(e.selection instanceof X||e.selection instanceof st)&&d.deleteSelection();let f=d.mapping.map(n.pos),m=Ut(d.doc,f,o.length,o);if(m||(o[0]=a?{type:a}:null,m=Ut(d.doc,f,o.length,o)),!m)return!1;if(d.split(f,o.length,o),!l&&c&&n.node(i).type!=a){let g=d.mapping.map(n.before(i)),y=d.doc.resolve(g);a&&n.node(i-1).canReplaceWith(y.index(),y.index()+1,a)&&d.setNodeMarkup(d.mapping.map(n.before(i)),a)}return r&&r(d.scrollIntoView()),!0}}const ik=ok(),ak=(t,e)=>{let{$from:r,to:n}=t.selection,s,o=r.sharedDepth(n);return o==0?!1:(s=r.before(o),e&&e(t.tr.setSelection(Y.create(t.doc,s))),!0)};function lk(t,e,r){let n=e.nodeBefore,s=e.nodeAfter,o=e.index();return!n||!s||!n.type.compatibleContent(s.type)?!1:!n.content.size&&e.parent.canReplace(o-1,o)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(s.isTextblock||Sr(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function jm(t,e,r,n){let s=e.nodeBefore,o=e.nodeAfter,i,a,l=s.type.spec.isolating||o.type.spec.isolating;if(!l&&lk(t,e,r))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(i=(a=s.contentMatchAt(s.childCount)).findWrapping(o.type))&&a.matchType(i[0]||o.type).validEnd){if(r){let g=e.pos+o.nodeSize,y=L.empty;for(let D=i.length-1;D>=0;D--)y=L.from(i[D].create(null,y));y=L.from(s.copy(y));let v=t.tr.step(new Te(e.pos-1,g,e.pos,g,new H(y,1,0),i.length,!0)),w=v.doc.resolve(g+2*i.length);w.nodeAfter&&w.nodeAfter.type==s.type&&Sr(v.doc,w.pos)&&v.join(w.pos),r(v.scrollIntoView())}return!0}let d=o.type.spec.isolating||n>0&&l?null:re.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),m=f&&zn(f);if(m!=null&&m>=e.depth)return r&&r(t.tr.lift(f,m).scrollIntoView()),!0;if(c&&Tn(o,"start",!0)&&Tn(s,"end")){let g=s,y=[];for(;y.push(g),!g.isTextblock;)g=g.lastChild;let v=o,w=1;for(;!v.isTextblock;v=v.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,v.content)){if(r){let D=L.empty;for(let N=y.length-1;N>=0;N--)D=L.from(y[N].copy(D));let E=t.tr.step(new Te(e.pos-y.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new H(D,y.length,0),0,!0));r(E.scrollIntoView())}return!0}}return!1}function Om(t){return function(e,r){let n=e.selection,s=t<0?n.$from:n.$to,o=s.depth;for(;s.node(o).isInline;){if(!o)return!1;o--}return s.node(o).isTextblock?(r&&r(e.tr.setSelection(X.create(e.doc,t<0?s.start(o):s.end(o)))),!0):!1}}const uk=Om(-1),ck=Om(1);function dk(t,e=null){return function(r,n){let{$from:s,$to:o}=r.selection,i=s.blockRange(o),a=i&&xu(i,t,e);return a?(n&&n(r.tr.wrap(i,a).scrollIntoView()),!0):!1}}function Ep(t,e=null){return function(r,n){let s=!1;for(let o=0;o<r.selection.ranges.length&&!s;o++){let{$from:{pos:i},$to:{pos:a}}=r.selection.ranges[o];r.doc.nodesBetween(i,a,(l,c)=>{if(s)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)s=!0;else{let d=r.doc.resolve(c),f=d.index();s=d.parent.canReplaceWith(f,f+1,t)}})}if(!s)return!1;if(n){let o=r.tr;for(let i=0;i<r.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:l}}=r.selection.ranges[i];o.setBlockType(a,l,t,e)}n(o.scrollIntoView())}return!0}}function Eu(...t){return function(e,r,n){for(let s=0;s<t.length;s++)if(t[s](e,r,n))return!0;return!1}}Eu(wu,km,Sm);Eu(wu,Am,Nm);Eu(Tm,Mm,Bm,ik);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function pk(t,e=null){return function(r,n){let{$from:s,$to:o}=r.selection,i=s.blockRange(o);if(!i)return!1;let a=n?r.tr:null;return hk(a,i,t,e)?(n&&n(a.scrollIntoView()),!0):!1}}function hk(t,e,r,n=null){let s=!1,o=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=i.resolve(e.start-2);o=new zo(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new zo(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let a=xu(o,r,n,e);return a?(t&&fk(t,e,a,s,r),!0):!1}function fk(t,e,r,n,s){let o=L.empty;for(let d=r.length-1;d>=0;d--)o=L.from(r[d].type.create(r[d].attrs,o));t.step(new Te(e.start-(n?2:0),e.end,e.start,e.end,new H(o,0,0),r.length,!0));let i=0;for(let d=0;d<r.length;d++)r[d].type==s&&(i=d+1);let a=r.length-i,l=e.start+r.length-(n?2:0),c=e.parent;for(let d=e.startIndex,f=e.endIndex,m=!0;d<f;d++,m=!1)!m&&Ut(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function mk(t){return function(e,r){let{$from:n,$to:s}=e.selection,o=n.blockRange(s,i=>i.childCount>0&&i.firstChild.type==t);return o?r?n.node(o.depth-1).type==t?gk(e,r,t,o):bk(e,r,o):!0:!1}}function gk(t,e,r,n){let s=t.tr,o=n.end,i=n.$to.end(n.depth);o<i&&(s.step(new Te(o-1,i,o,i,new H(L.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new zo(s.doc.resolve(n.$from.pos),s.doc.resolve(i),n.depth));const a=zn(n);if(a==null)return!1;s.lift(n,a);let l=s.doc.resolve(s.mapping.map(o,-1)-1);return Sr(s.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&s.join(l.pos),e(s.scrollIntoView()),!0}function bk(t,e,r){let n=t.tr,s=r.parent;for(let g=r.end,y=r.endIndex-1,v=r.startIndex;y>v;y--)g-=s.child(y).nodeSize,n.delete(g-1,g+1);let o=n.doc.resolve(r.start),i=o.nodeAfter;if(n.mapping.map(r.end)!=r.start+o.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==s.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+(a?0:1),d+1,i.content.append(l?L.empty:L.from(s))))return!1;let f=o.pos,m=f+i.nodeSize;return n.step(new Te(f-(a?1:0),m+(l?1:0),f+1,m-1,new H((a?L.empty:L.from(s.copy(L.empty))).append(l?L.empty:L.from(s.copy(L.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function yk(t){return function(e,r){let{$from:n,$to:s}=e.selection,o=n.blockRange(s,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let i=o.startIndex;if(i==0)return!1;let a=o.parent,l=a.child(i-1);if(l.type!=t)return!1;if(r){let c=l.lastChild&&l.lastChild.type==a.type,d=L.from(c?t.create():null),f=new H(L.from(t.create(null,L.from(a.type.create(null,d)))),c?3:1,0),m=o.start,g=o.end;r(e.tr.step(new Te(m-(c?3:1),g,m,g,f,1,!0)).scrollIntoView())}return!0}}const Ie=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Mn=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Dl=null;const qt=function(t,e,r){let n=Dl||(Dl=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},xk=function(){Dl=null},en=function(t,e,r,n){return r&&(Sp(t,e,r,n,-1)||Sp(t,e,r,n,1))},vk=/^(img|br|input|textarea|hr)$/i;function Sp(t,e,r,n,s){for(var o;;){if(t==r&&e==n)return!0;if(e==(s<0?0:ct(t))){let i=t.parentNode;if(!i||i.nodeType!=1||$s(t)||vk.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ie(t)+(s<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(s<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((o=i.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=s;else return!1;else t=i,e=s<0?ct(t):0}else return!1}}function ct(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function wk(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=ct(t)}else if(t.parentNode&&!$s(t))e=Ie(t),t=t.parentNode;else return null}}function Dk(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!$s(t))e=Ie(t)+1,t=t.parentNode;else return null}}function Ck(t,e,r){for(let n=e==0,s=e==ct(t);n||s;){if(t==r)return!0;let o=Ie(t);if(t=t.parentNode,!t)return!1;n=n&&o==0,s=s&&o==ct(t)}}function $s(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Pi=function(t){return t.focusNode&&en(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Rr(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function kk(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ek(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(ct(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(ct(n.startContainer),n.startOffset)}}}const Bt=typeof navigator<"u"?navigator:null,Fp=typeof document<"u"?document:null,Fr=Bt&&Bt.userAgent||"",Cl=/Edge\/(\d+)/.exec(Fr),Lm=/MSIE \d/.exec(Fr),kl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fr),Ze=!!(Lm||kl||Cl),yr=Lm?document.documentMode:kl?+kl[1]:Cl?+Cl[1]:0,dt=!Ze&&/gecko\/(\d+)/i.test(Fr);dt&&+(/Firefox\/(\d+)/.exec(Fr)||[0,0])[1];const El=!Ze&&/Chrome\/(\d+)/.exec(Fr),Ve=!!El,_m=El?+El[1]:0,Ke=!Ze&&!!Bt&&/Apple Computer/.test(Bt.vendor),Bn=Ke&&(/Mobile\/\w+/.test(Fr)||!!Bt&&Bt.maxTouchPoints>2),ut=Bn||(Bt?/Mac/.test(Bt.platform):!1),Sk=Bt?/Win/.test(Bt.platform):!1,Wt=/Android \d/.test(Fr),Hs=!!Fp&&"webkitFontSmoothing"in Fp.documentElement.style,Fk=Hs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ak(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pt(t,e){return typeof t=="number"?t:t[e]}function Nk(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function Ap(t,e,r){let n=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let i=r||t.dom;i;){if(i.nodeType!=1){i=Mn(i);continue}let a=i,l=a==o.body,c=l?Ak(o):Nk(a),d=0,f=0;if(e.top<c.top+Pt(n,"top")?f=-(c.top-e.top+Pt(s,"top")):e.bottom>c.bottom-Pt(n,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Pt(s,"top")-c.top:e.bottom-c.bottom+Pt(s,"bottom")),e.left<c.left+Pt(n,"left")?d=-(c.left-e.left+Pt(s,"left")):e.right>c.right-Pt(n,"right")&&(d=e.right-c.right+Pt(s,"right")),d||f)if(l)o.defaultView.scrollBy(d,f);else{let g=a.scrollLeft,y=a.scrollTop;f&&(a.scrollTop+=f),d&&(a.scrollLeft+=d);let v=a.scrollLeft-g,w=a.scrollTop-y;e={left:e.left-v,top:e.top-w,right:e.right-v,bottom:e.bottom-w}}let m=l?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(m))break;i=m=="absolute"?i.offsetParent:Mn(i)}}function Tk(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,s;for(let o=(e.left+e.right)/2,i=r+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(o,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=r-20){n=a,s=l.top;break}}return{refDOM:n,refTop:s,stack:Im(t.dom)}}function Im(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=Mn(n));return e}function Mk({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;Rm(r,n==0?0:n-e)}function Rm(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:s,left:o}=t[r];n.scrollTop!=s+e&&(n.scrollTop=s+e),n.scrollLeft!=o&&(n.scrollLeft=o)}}let gn=null;function Bk(t){if(t.setActive)return t.setActive();if(gn)return t.focus(gn);let e=Im(t);t.focus(gn==null?{get preventScroll(){return gn={preventScroll:!0},!0}}:void 0),gn||(gn=!1,Rm(e,0))}function Pm(t,e){let r,n=2e8,s,o=0,i=e.top,a=e.top,l,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let m;if(d.nodeType==1)m=d.getClientRects();else if(d.nodeType==3)m=qt(d).getClientRects();else continue;for(let g=0;g<m.length;g++){let y=m[g];if(y.top<=i&&y.bottom>=a){i=Math.max(y.bottom,i),a=Math.min(y.top,a);let v=y.left>e.left?y.left-e.left:y.right<e.left?e.left-y.right:0;if(v<n){r=d,n=v,s=v&&r.nodeType==3?{left:y.right<e.left?y.right:y.left,top:e.top}:e,d.nodeType==1&&v&&(o=f+(e.left>=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!l&&y.left<=e.left&&y.right>=e.left&&(l=d,c={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!r&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(o=f+1)}}return!r&&l&&(r=l,s=c,n=0),r&&r.nodeType==3?jk(r,s):!r||n&&r.nodeType==1?{node:t,offset:o}:Pm(r,s)}function jk(t,e){let r=t.nodeValue.length,n=document.createRange();for(let s=0;s<r;s++){n.setEnd(t,s+1),n.setStart(t,s);let o=ar(n,1);if(o.top!=o.bottom&&Su(e,o))return{node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Su(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ok(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function Lk(t,e,r){let{node:n,offset:s}=Pm(e,r),o=-1;if(n.nodeType==1&&!n.firstChild){let i=n.getBoundingClientRect();o=i.left!=i.right&&r.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(n,s,o)}function _k(t,e,r,n){let s=-1;for(let o=e,i=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!i&&l.left>n.left||l.top>n.top?s=a.posBefore:(!i&&l.right<n.left||l.bottom<n.top)&&(s=a.posAfter),i=!0),!a.contentDOM&&s<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,r,-1)}function zm(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let s=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),o=s;;){let i=t.childNodes[o];if(i.nodeType==1){let a=i.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Su(e,c))return zm(i,e,c)}}if((o=(o+1)%n)==s)break}return t}function Ik(t,e){let r=t.dom.ownerDocument,n,s=0,o=Ek(r,e.left,e.top);o&&({node:n,offset:s}=o);let i=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=t.dom.getBoundingClientRect();if(!Su(e,c)||(i=zm(t.dom,e,c),!i))return null}if(Ke)for(let c=i;n&&c;c=Mn(c))c.draggable&&(n=void 0);if(i=Ok(i,e),n){if(dt&&n.nodeType==1&&(s=Math.min(s,n.childNodes.length),s<n.childNodes.length)){let d=n.childNodes[s],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&s++}let c;Hs&&s&&n.nodeType==1&&(c=n.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,n==t.dom&&s==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(s==0||n.nodeType!=1||n.childNodes[s-1].nodeName!="BR")&&(a=_k(t,n,s,e))}a==null&&(a=Lk(t,i,e));let l=t.docView.nearestDesc(i,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Np(t){return t.top<t.bottom||t.left<t.right}function ar(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(Np(n))return n}return Array.prototype.find.call(r,Np)||t.getBoundingClientRect()}const Rk=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function $m(t,e,r){let{node:n,offset:s,atom:o}=t.docView.domFromPos(e,r<0?-1:1),i=Hs||dt;if(n.nodeType==3)if(i&&(Rk.test(n.nodeValue)||(r<0?!s:s==n.nodeValue.length))){let l=ar(qt(n,s,s),r);if(dt&&s&&/\s/.test(n.nodeValue[s-1])&&s<n.nodeValue.length){let c=ar(qt(n,s-1,s-1),-1);if(c.top==l.top){let d=ar(qt(n,s,s+1),-1);if(d.top!=l.top)return is(d,d.left<c.left)}}return l}else{let l=s,c=s,d=r<0?1:-1;return r<0&&!s?(c++,d=-1):r>=0&&s==n.nodeValue.length?(l--,d=1):r<0?l--:c++,is(ar(qt(n,l,c),d),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&s&&(r<0||s==ct(n))){let l=n.childNodes[s-1];if(l.nodeType==1)return Ra(l.getBoundingClientRect(),!1)}if(o==null&&s<ct(n)){let l=n.childNodes[s];if(l.nodeType==1)return Ra(l.getBoundingClientRect(),!0)}return Ra(n.getBoundingClientRect(),r>=0)}if(o==null&&s&&(r<0||s==ct(n))){let l=n.childNodes[s-1],c=l.nodeType==3?qt(l,ct(l)-(i?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return is(ar(c,1),!1)}if(o==null&&s<ct(n)){let l=n.childNodes[s];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?qt(l,0,i?0:1):l.nodeType==1?l:null:null;if(c)return is(ar(c,-1),!0)}return is(ar(n.nodeType==3?qt(n):n,-r),r>=0)}function is(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function Ra(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Hm(t,e,r){let n=t.state,s=t.root.activeElement;n!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),s!=t.dom&&s&&s.focus()}}function Pk(t,e,r){let n=e.selection,s=r=="up"?n.$from:n.$to;return Hm(t,e,()=>{let{node:o}=t.docView.domFromPos(s.pos,r=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let i=$m(t,s.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=qt(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(r=="up"?i.top-d.top>(d.bottom-i.top)*2:d.bottom-i.bottom>(i.bottom-d.top)*2))return!1}}return!0})}const zk=/[\u0590-\u08ac]/;function $k(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let s=n.parentOffset,o=!s,i=s==n.parent.content.size,a=t.domSelection();return a?!zk.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?o:i:Hm(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",r,"character");let g=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:y,focusOffset:v}=t.domSelectionRange(),w=y&&!g.contains(y.nodeType==1?y:y.parentNode)||l==y&&c==v;try{a.collapse(d,f),l&&(l!=d||c!=f)&&a.extend&&a.extend(l,c)}catch{}return m!=null&&(a.caretBidiLevel=m),w}):n.pos==n.start()||n.pos==n.end()}let Tp=null,Mp=null,Bp=!1;function Hk(t,e,r){return Tp==e&&Mp==r?Bp:(Tp=e,Mp=r,Bp=r=="up"||r=="down"?Pk(t,e,r):$k(t,e,r))}const pt=0,jp=1,$r=2,jt=3;class Vs{constructor(e,r,n,s){this.parent=e,this.children=r,this.dom=n,this.contentDOM=s,this.dirty=pt,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let s=this.children[r];if(s==e)return n;n+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let o,i;if(e==this.contentDOM)o=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}else{let o,i;if(e==this.contentDOM)o=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(i):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=r>Ie(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let o=e;;o=o.parentNode){if(o==this.dom){s=!1;break}if(o.previousSibling)break}if(s==null&&r==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){s=!0;break}if(o.nextSibling)break}}return s??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,s=e;s;s=s.parentNode){let o=this.getDesc(s),i;if(o&&(!r||o.node))if(n&&(i=o.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))n=!1;else return o}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let s=e;s;s=s.parentNode){let o=this.getDesc(s);if(o)return o.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let s=this.children[r],o=n+s.size;if(n==e&&o!=n){for(;!s.border&&s.children.length;)for(let i=0;i<s.children.length;i++){let a=s.children[i];if(a.size){s=a;break}}return s}if(e<o)return s.descAt(e-n-s.border);n=o}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,s=0;for(let o=0;n<this.children.length;n++){let i=this.children[n],a=o+i.size;if(a>e||i instanceof qm){s=e-o;break}o=a}if(s)return this.children[n].domFromPos(s-this.children[n].border,r);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof Vm&&o.side>=0;n--);if(r<=0){let o,i=!0;for(;o=n?this.children[n-1]:null,!(!o||o.dom.parentNode==this.contentDOM);n--,i=!1);return o&&r&&i&&!o.border&&!o.domAtom?o.domFromPos(o.size,r):{node:this.contentDOM,offset:o?Ie(o.dom)+1:0}}else{let o,i=!0;for(;o=n<this.children.length?this.children[n]:null,!(!o||o.dom.parentNode==this.contentDOM);n++,i=!1);return o&&i&&!o.border&&!o.domAtom?o.domFromPos(0,r):{node:this.contentDOM,offset:o?Ie(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,o=-1;for(let i=n,a=0;;a++){let l=this.children[a],c=i+l.size;if(s==-1&&e<=c){let d=i+l.border;if(e>=d&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,d);e=i;for(let f=a;f>0;f--){let m=this.children[f-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){s=Ie(m.dom)+1;break}e-=m.size}s==-1&&(s=0)}if(s>-1&&(c>r||a==this.children.length-1)){r=c;for(let d=a+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Ie(f.dom);break}r+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:r,fromOffset:s,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,s=!1){let o=Math.min(e,r),i=Math.max(e,r);for(let g=0,y=0;g<this.children.length;g++){let v=this.children[g],w=y+v.size;if(o>y&&i<w)return v.setSelection(e-y-v.border,r-y-v.border,n,s);y=w}let a=this.domFromPos(e,e?-1:1),l=r==e?a:this.domFromPos(r,r?-1:1),c=n.root.getSelection(),d=n.domSelectionRange(),f=!1;if((dt||Ke)&&e==r){let{node:g,offset:y}=a;if(g.nodeType==3){if(f=!!(y&&g.nodeValue[y-1]==`
|
|
84
|
+
`),f&&y==g.nodeValue.length)for(let v=g,w;v;v=v.parentNode){if(w=v.nextSibling){w.nodeName=="BR"&&(a=l={node:w.parentNode,offset:Ie(w)+1});break}let D=v.pmViewDesc;if(D&&D.node&&D.node.isBlock)break}}else{let v=g.childNodes[y-1];f=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(dt&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let g=d.focusNode.childNodes[d.focusOffset];g&&g.contentEditable=="false"&&(s=!0)}if(!(s||f&&Ke)&&en(a.node,a.offset,d.anchorNode,d.anchorOffset)&&en(l.node,l.offset,d.focusNode,d.focusOffset))return;let m=!1;if((c.extend||e==r)&&!(f&&dt)){c.collapse(a.node,a.offset);try{e!=r&&c.extend(l.node,l.offset),m=!0}catch{}}if(!m){if(e>r){let y=a;a=l,l=y}let g=document.createRange();g.setEnd(l.node,l.offset),g.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(g)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,s=0;s<this.children.length;s++){let o=this.children[s],i=n+o.size;if(n==i?e<=i&&r>=n:e<i&&r>n){let a=n+o.border,l=i-o.border;if(e>=a&&r<=l){this.dirty=e==n||r==i?$r:jp,e==a&&r==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=jt:o.markDirty(e-a,r-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?$r:jt}n=i}this.dirty=$r}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?$r:jp;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Vm extends Vs{constructor(e,r,n,s){let o,i=r.type.toDOM;if(typeof i=="function"&&(i=i(n,()=>{if(!o)return s;if(o.parent)return o.parent.posBeforeChild(o)})),!r.type.spec.raw){if(i.nodeType!=1){let a=document.createElement("span");a.appendChild(i),i=a}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=r,this.widget=r,o=this}matchesWidget(e){return this.dirty==pt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Vk extends Vs{constructor(e,r,n,s){super(e,[],r,null),this.textDOM=n,this.text=s}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class tn extends Vs{constructor(e,r,n,s,o){super(e,[],n,s),this.mark=r,this.spec=o}static create(e,r,n,s){let o=s.nodeViews[r.type.name],i=o&&o(r,s,n);return(!i||!i.dom)&&(i=on.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new tn(e,r,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&jt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=jt&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=pt){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=pt}}slice(e,r,n){let s=tn.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;r<i&&(o=Fl(o,r,i,n)),e>0&&(o=Fl(o,0,e,n));for(let a=0;a<o.length;a++)o[a].parent=s;return s.children=o,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class xr extends Vs{constructor(e,r,n,s,o,i,a,l,c){super(e,[],o,i),this.node=r,this.outerDeco=n,this.innerDeco=s,this.nodeDOM=a}static create(e,r,n,s,o,i){let a=o.nodeViews[r.type.name],l,c=a&&a(r,o,()=>{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)},n,s),d=c&&c.dom,f=c&&c.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=on.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!f&&!r.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),r.type.spec.draggable&&(d.draggable=!0));let m=d;return d=Jm(d,n,r),c?l=new qk(e,r,n,s,d,f||null,m,c,o,i+1):r.isText?new zi(e,r,n,s,d,m,o):new xr(e,r,n,s,d,f||null,m,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>L.empty)}return e}matchesNode(e,r,n){return this.dirty==pt&&e.eq(this.node)&&Ho(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,s=r,o=e.composing?this.localCompositionInfo(e,r):null,i=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Uk(this,i&&i.node,e);Gk(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?ue.none:this.node.child(d).marks,n,e),l.placeWidget(c,e,s)},(c,d,f,m)=>{l.syncToMarks(c.marks,n,e);let g;l.findNodeMatch(c,d,f,m)||a&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(g=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,d,f,g,e)||l.updateNextNode(c,d,f,e,m,s)||l.addNode(c,d,f,e,s),s+=c.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==$r)&&(i&&this.protectLocalComposition(e,i),Wm(this.contentDOM,this.children,e),Bn&&Yk(this.dom))}localCompositionInfo(e,r){let{from:n,to:s}=e.state.selection;if(!(e.state.selection instanceof X)||n<r||s>r+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let i=o.nodeValue,a=Xk(this.node.content,i,n-r,s-r);return a<0?null:{node:o,pos:a,text:i}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:s}){if(this.getDesc(r))return;let o=r;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Vk(this,o,r,s);e.input.compositionNodes.push(i),this.children=Fl(this.children,n,n+s.length,e,i)}update(e,r,n,s){return this.dirty==jt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,s),!0)}updateInner(e,r,n,s){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=pt}updateOuterDeco(e){if(Ho(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Um(this.dom,this.nodeDOM,Sl(this.outerDeco,this.node,r),Sl(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Op(t,e,r,n,s){Jm(n,e,t);let o=new xr(void 0,t,e,r,n,n,n,s,0);return o.contentDOM&&o.updateChildren(s,0),o}class zi extends xr{constructor(e,r,n,s,o,i,a){super(e,r,n,s,o,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,s){return this.dirty==jt||this.dirty!=pt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=pt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=pt,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let s=this.node.cut(e,r),o=document.createTextNode(s.text);return new zi(this.parent,s,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=jt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class qm extends Vs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==pt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class qk extends xr{constructor(e,r,n,s,o,i,a,l,c,d){super(e,r,n,s,o,i,a,c,d),this.spec=l}update(e,r,n,s){if(this.dirty==jt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,r,n);return o&&this.updateInner(e,r,n,s),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,s){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Wm(t,e,r){let n=t.firstChild,s=!1;for(let o=0;o<e.length;o++){let i=e[o],a=i.dom;if(a.parentNode==t){for(;a!=n;)n=Lp(n),s=!0;n=n.nextSibling}else s=!0,t.insertBefore(a,n);if(i instanceof tn){let l=n?n.previousSibling:t.lastChild;Wm(i.contentDOM,i.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=Lp(n),s=!0;s&&r.trackWrites==t&&(r.trackWrites=null)}const xs=function(t){t&&(this.nodeName=t)};xs.prototype=Object.create(null);const Hr=[new xs];function Sl(t,e,r){if(t.length==0)return Hr;let n=r?Hr[0]:new xs,s=[n];for(let o=0;o<t.length;o++){let i=t[o].type.attrs;if(i){i.nodeName&&s.push(n=new xs(i.nodeName));for(let a in i){let l=i[a];l!=null&&(r&&s.length==1&&s.push(n=new xs(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return s}function Um(t,e,r,n){if(r==Hr&&n==Hr)return e;let s=e;for(let o=0;o<n.length;o++){let i=n[o],a=r[o];if(o){let l;a&&a.nodeName==i.nodeName&&s!=t&&(l=s.parentNode)&&l.nodeName.toLowerCase()==i.nodeName||(l=document.createElement(i.nodeName),l.pmIsDeco=!0,l.appendChild(s),a=Hr[0]),s=l}Wk(s,a||Hr[0],i)}return s}function Wk(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],s=r.class?r.class.split(" ").filter(Boolean):[];for(let o=0;o<n.length;o++)s.indexOf(n[o])==-1&&t.classList.remove(n[o]);for(let o=0;o<s.length;o++)n.indexOf(s[o])==-1&&t.classList.add(s[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=n.exec(e.style);)t.style.removeProperty(s[1])}r.style&&(t.style.cssText+=r.style)}}function Jm(t,e,r){return Um(t,t,Hr,Sl(e,r,t.nodeType!=1))}function Ho(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function Lp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Uk{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Jk(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n){let s=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;s<i&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=pt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=tn.create(this.top,e[o],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,r,n,s){let o=-1,i;if(s>=this.preMatch.index&&(i=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&i.matchesNode(e,r,n))o=this.top.children.indexOf(i,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,r,n)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,r,n,s,o){let i=this.top.children[s];return i.dirty==jt&&i.dom==i.contentDOM&&(i.dirty=$r),i.update(e,r,n,o)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==n)return s}return-1}e=r}}updateNextNode(e,r,n,s,o,i){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof xr){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let d=l.dom,f,m=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=jt&&Ho(r,l.outerDeco));if(!m&&l.update(e,r,n,s))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!m&&(f=this.recreateWrapper(l,e,r,n,s,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=$r,f.updateChildren(s,i+1),f.dirty=pt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,s,o,i){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!Ho(n,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=xr.create(this.top,r,n,s,o,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,r,n,s,o){let i=xr.create(this.top,e,r,n,s,o);i.contentDOM&&i.updateChildren(s,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,r,n){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let o=new Vm(this.top,e,r,n);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof tn;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof zi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ke||Ve)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let s=new qm(this.top,[],n,null);r!=this.top?r.children.push(s):r.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Jk(t,e){let r=e,n=r.children.length,s=t.childCount,o=new Map,i=[];e:for(;s>0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof tn)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=t.child(s-1))break;--s,o.set(a,s),i.push(a)}}return{index:s,matched:o,matches:i.reverse()}}function Kk(t,e){return t.type.side-e.type.side}function Gk(t,e,r,n){let s=e.locals(t),o=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);n(d,s,e.forChild(o,d),c),o+=d.nodeSize}return}let i=0,a=[],l=null;for(let c=0;;){let d,f;for(;i<s.length&&s[i].to==o;){let w=s[i++];w.widget&&(d?(f||(f=[d])).push(w):d=w)}if(d)if(f){f.sort(Kk);for(let w=0;w<f.length;w++)r(f[w],c,!!l)}else r(d,c,!!l);let m,g;if(l)g=-1,m=l,l=null;else if(c<t.childCount)g=c,m=t.child(c++);else break;for(let w=0;w<a.length;w++)a[w].to<=o&&a.splice(w--,1);for(;i<s.length&&s[i].from<=o&&s[i].to>o;)a.push(s[i++]);let y=o+m.nodeSize;if(m.isText){let w=y;i<s.length&&s[i].from<w&&(w=s[i].from);for(let D=0;D<a.length;D++)a[D].to<w&&(w=a[D].to);w<y&&(l=m.cut(w-o),m=m.cut(0,w-o),y=w,g=-1)}else for(;i<s.length&&s[i].to<y;)i++;let v=m.isInline&&!m.isLeaf?a.filter(w=>!w.inline):a.slice();n(m,v,e.forChild(o,m),g),o=y}}function Yk(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Xk(t,e,r,n){for(let s=0,o=0;s<t.childCount&&o<=n;){let i=t.child(s++),a=o;if(o+=i.nodeSize,!i.isText)continue;let l=i.text;for(;s<t.childCount;){let c=t.child(s++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=r){if(o>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=r)return a+c;if(r==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function Fl(t,e,r,n,s){let o=[];for(let i=0,a=0;i<t.length;i++){let l=t[i],c=a,d=a+=l.size;c>=r||d<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,n)),s&&(o.push(s),s=void 0),d>r&&o.push(l.slice(r-c,l.size,n)))}return o}function Fu(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let s=t.docView.nearestDesc(r.focusNode),o=s&&s.size==0,i=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(i<0)return null;let a=n.resolve(i),l,c;if(Pi(r)){for(l=i;s&&!s.node;)s=s.parent;let f=s.node;if(s&&f.isAtom&&Y.isSelectable(f)&&s.parent&&!(f.isInline&&Ck(r.focusNode,r.focusOffset,s.dom))){let m=s.posBefore;c=new Y(i==m?a:n.resolve(m))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let f=i,m=i;for(let g=0;g<r.rangeCount;g++){let y=r.getRangeAt(g);f=Math.min(f,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(f<0)return null;[l,i]=m==t.state.selection.anchor?[m,f]:[f,m],a=n.resolve(i)}else l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let d=n.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=Au(t,d,a,f)}return c}function Km(t){return t.editable?t.hasFocus():Ym(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Jt(t,e=!1){let r=t.state.selection;if(Gm(t,r),!!Km(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Ve){let n=t.domSelectionRange(),s=t.domObserver.currentSelection;if(n.anchorNode&&s.anchorNode&&en(n.anchorNode,n.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Zk(t);else{let{anchor:n,head:s}=r,o,i;_p&&!(r instanceof X)&&(r.$from.parent.inlineContent||(o=Ip(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(i=Ip(t,r.to))),t.docView.setSelection(n,s,t,e),_p&&(o&&Rp(o),i&&Rp(i)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Qk(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const _p=Ke||Ve&&_m<63;function Ip(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),s=n<r.childNodes.length?r.childNodes[n]:null,o=n?r.childNodes[n-1]:null;if(Ke&&s&&s.contentEditable=="false")return Pa(s);if((!s||s.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(s)return Pa(s);if(o)return Pa(o)}}function Pa(t){return t.contentEditable="true",Ke&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Rp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Qk(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,s=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Km(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Zk(t){let e=t.domSelection();if(!e)return;let r=t.cursorWrapper.dom,n=r.nodeName=="IMG";n?e.collapse(r.parentNode,Ie(r)+1):e.collapse(r,0),!n&&!t.state.selection.visible&&Ze&&yr<=11&&(r.disabled=!0,r.disabled=!1)}function Gm(t,e){if(e instanceof Y){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(Pp(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Pp(t)}function Pp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Au(t,e,r,n){return t.someProp("createSelectionBetween",s=>s(t,e,r))||X.between(e,r,n)}function zp(t){return t.editable&&!t.hasFocus()?!1:Ym(t)}function Ym(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function eE(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return en(e.node,e.offset,r.anchorNode,r.anchorOffset)}function Al(t,e){let{$anchor:r,$head:n}=t.selection,s=e>0?r.max(n):r.min(n),o=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return o&&re.findFrom(o,e)}function lr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function $p(t,e,r){let n=t.state.selection;if(n instanceof X)if(r.indexOf("s")>-1){let{$head:s}=n,o=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=t.state.doc.resolve(s.pos+o.nodeSize*(e<0?-1:1));return lr(t,new X(n.$anchor,i))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=Al(t.state,e);return s&&s instanceof Y?lr(t,s):!1}else if(!(ut&&r.indexOf("m")>-1)){let s=n.$head,o=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,i;if(!o||o.isText)return!1;let a=e<0?s.pos-o.nodeSize:s.pos;return o.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?Y.isSelectable(o)?lr(t,new Y(e<0?t.state.doc.resolve(s.pos-o.nodeSize):s)):Hs?lr(t,new X(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Y&&n.node.isInline)return lr(t,new X(e>0?n.$to:n.$from));{let s=Al(t.state,e);return s?lr(t,s):!1}}}function Vo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vs(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function bn(t,e){return e<0?tE(t):rE(t)}function tE(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let s,o,i=!1;for(dt&&r.nodeType==1&&n<Vo(r)&&vs(r.childNodes[n],-1)&&(i=!0);;)if(n>0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(vs(a,-1))s=r,o=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(Xm(r))break;{let a=r.previousSibling;for(;a&&vs(a,-1);)s=r.parentNode,o=Ie(a),a=a.previousSibling;if(a)r=a,n=Vo(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}i?Nl(t,r,n):s&&Nl(t,s,o)}function rE(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let s=Vo(r),o,i;for(;;)if(n<s){if(r.nodeType!=1)break;let a=r.childNodes[n];if(vs(a,1))o=r,i=++n;else break}else{if(Xm(r))break;{let a=r.nextSibling;for(;a&&vs(a,1);)o=a.parentNode,i=Ie(a)+1,a=a.nextSibling;if(a)r=a,n=0,s=Vo(r);else{if(r=r.parentNode,r==t.dom)break;n=s=0}}}o&&Nl(t,o,i)}function Xm(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function nE(t,e){for(;t&&e==t.childNodes.length&&!$s(t);)e=Ie(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function sE(t,e){for(;t&&!e&&!$s(t);)e=Ie(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function Nl(t,e,r){if(e.nodeType!=3){let o,i;(i=nE(e,r))?(e=i,r=0):(o=sE(e,r))&&(e=o,r=o.nodeValue.length)}let n=t.domSelection();if(!n)return;if(Pi(n)){let o=document.createRange();o.setEnd(e,r),o.setStart(e,r),n.removeAllRanges(),n.addRange(o)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&Jt(t)},50)}function Hp(t,e){let r=t.state.doc.resolve(e);if(!(Ve||Sk)&&r.parent.inlineContent){let s=t.coordsAtPos(e);if(e>r.start()){let o=t.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>s.top&&i<s.bottom&&Math.abs(o.left-s.left)>1)return o.left<s.left?"ltr":"rtl"}if(e<r.end()){let o=t.coordsAtPos(e+1),i=(o.top+o.bottom)/2;if(i>s.top&&i<s.bottom&&Math.abs(o.left-s.left)>1)return o.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Vp(t,e,r){let n=t.state.selection;if(n instanceof X&&!n.empty||r.indexOf("s")>-1||ut&&r.indexOf("m")>-1)return!1;let{$from:s,$to:o}=n;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=Al(t.state,e);if(i&&i instanceof Y)return lr(t,i)}if(!s.parent.inlineContent){let i=e<0?s:o,a=n instanceof st?re.near(i,e):re.findFrom(i,e);return a?lr(t,a):!1}return!1}function qp(t,e){if(!(t.state.selection instanceof X))return!0;let{$head:r,$anchor:n,empty:s}=t.state.selection;if(!r.sameParent(n))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(o&&!o.isText){let i=t.state.tr;return e<0?i.delete(r.pos-o.nodeSize,r.pos):i.delete(r.pos,r.pos+o.nodeSize),t.dispatch(i),!0}return!1}function Wp(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function oE(t){if(!Ke||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Wp(t,n,"true"),setTimeout(()=>Wp(t,n,"false"),20)}return!1}function iE(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function aE(t,e){let r=e.keyCode,n=iE(e);if(r==8||ut&&r==72&&n=="c")return qp(t,-1)||bn(t,-1);if(r==46&&!e.shiftKey||ut&&r==68&&n=="c")return qp(t,1)||bn(t,1);if(r==13||r==27)return!0;if(r==37||ut&&r==66&&n=="c"){let s=r==37?Hp(t,t.state.selection.from)=="ltr"?-1:1:-1;return $p(t,s,n)||bn(t,s)}else if(r==39||ut&&r==70&&n=="c"){let s=r==39?Hp(t,t.state.selection.from)=="ltr"?1:-1:1;return $p(t,s,n)||bn(t,s)}else{if(r==38||ut&&r==80&&n=="c")return Vp(t,-1,n)||bn(t,-1);if(r==40||ut&&r==78&&n=="c")return oE(t)||Vp(t,1,n)||bn(t,1);if(n==(ut?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function Nu(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let r=[],{content:n,openStart:s,openEnd:o}=e;for(;s>1&&o>1&&n.childCount==1&&n.firstChild.childCount==1;){s--,o--;let g=n.firstChild;r.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),n=g.content}let i=t.someProp("clipboardSerializer")||on.fromSchema(t.state.schema),a=ng(),l=a.createElement("div");l.appendChild(i.serializeFragment(n,{document:a}));let c=l.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=rg[c.nodeName.toLowerCase()]);){for(let g=d.length-1;g>=0;g--){let y=a.createElement(d[g]);for(;l.firstChild;)y.appendChild(l.firstChild);l.appendChild(y),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${o}${f?` -${f}`:""} ${JSON.stringify(r)}`);let m=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
|
|
85
|
+
|
|
86
|
+
`);return{dom:l,text:m,slice:e}}function Qm(t,e,r,n,s){let o=s.parent.type.spec.code,i,a;if(!r&&!e)return null;let l=!!e&&(n||o||!r);if(l){if(t.someProp("transformPastedText",m=>{e=m(e,o||n,t)}),o)return a=new H(L.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
87
|
+
`))),0,0),t.someProp("transformPasted",m=>{a=m(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",m=>m(e,s,n,t));if(f)a=f;else{let m=s.marks(),{schema:g}=t.state,y=on.fromSchema(g);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let w=i.appendChild(document.createElement("p"));v&&w.appendChild(y.serializeNode(g.text(v,m)))})}}else t.someProp("transformPastedHTML",f=>{r=f(r,t)}),i=dE(r),Hs&&pE(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let m=i.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;i=m}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||br.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||d),context:s,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!lE.test(m.parentNode.nodeName)?{ignore:!0}:null}})),d)a=hE(Up(a,+d[1],+d[2]),d[4]);else if(a=H.maxOpen(uE(a.content,s),!0),a.openStart||a.openEnd){let f=0,m=0;for(let g=a.content.firstChild;f<a.openStart&&!g.type.spec.isolating;f++,g=g.firstChild);for(let g=a.content.lastChild;m<a.openEnd&&!g.type.spec.isolating;m++,g=g.lastChild);a=Up(a,f,m)}return t.someProp("transformPasted",f=>{a=f(a,t,l)}),a}const lE=/^(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)$/i;function uE(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let s=e.node(r).contentMatchAt(e.index(r)),o,i=[];if(t.forEach(a=>{if(!i)return;let l=s.findWrapping(a.type),c;if(!l)return i=null;if(c=i.length&&o.length&&eg(l,o,a,i[i.length-1],0))i[i.length-1]=c;else{i.length&&(i[i.length-1]=tg(i[i.length-1],o.length));let d=Zm(a,l);i.push(d),s=s.matchType(d.type),o=l}}),i)return L.from(i)}return t}function Zm(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,L.from(t));return t}function eg(t,e,r,n,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let o=eg(t,e,r,n.lastChild,s+1);if(o)return n.copy(n.content.replaceChild(n.childCount-1,o));if(n.contentMatchAt(n.childCount).matchType(s==t.length-1?r.type:t[s+1]))return n.copy(n.content.append(L.from(Zm(r,t,s+1))))}}function tg(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,tg(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(L.empty,!0);return t.copy(r.append(n))}function Tl(t,e,r,n,s,o){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(o=0),s<n-1&&(a=Tl(a,e,r,n,s+1,o)),s>=r&&(a=e<0?i.contentMatchAt(0).fillBefore(a,o<=s).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(L.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function Up(t,e,r){return e<t.openStart&&(t=new H(Tl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new H(Tl(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const rg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Jp=null;function ng(){return Jp||(Jp=document.implementation.createHTMLDocument("title"))}let za=null;function cE(t){let e=window.trustedTypes;return e?(za||(za=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),za.createHTML(t)):t}function dE(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=ng().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),s;if((s=n&&rg[n[1].toLowerCase()])&&(t=s.map(o=>"<"+o+">").join("")+t+s.map(o=>"</"+o+">").reverse().join("")),r.innerHTML=cE(t),s)for(let o=0;o<s.length;o++)r=r.querySelector(s[o])||r;return r}function pE(t){let e=t.querySelectorAll(Ve?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function hE(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:s,openStart:o,openEnd:i}=t;for(let a=n.length-2;a>=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;s=L.from(l.create(n[a+1],s)),o++,i++}return new H(s,o,i)}const Ge={},Ye={},fE={touchstart:!0,touchmove:!0};class mE{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function gE(t){for(let e in Ge){let r=Ge[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{yE(t,n)&&!Tu(t,n)&&(t.editable||!(n.type in Ye))&&r(t,n)},fE[e]?{passive:!0}:void 0)}Ke&&t.dom.addEventListener("input",()=>null),Ml(t)}function mr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function bE(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ml(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>Tu(t,n))})}function Tu(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function yE(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function xE(t,e){!Tu(t,e)&&Ge[e.type]&&(t.editable||!(e.type in Ye))&&Ge[e.type](t,e)}Ye.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!og(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Wt&&Ve&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),Bn&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",s=>s(t,Rr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||aE(t,r)?r.preventDefault():mr(t,"key")};Ye.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ye.keypress=(t,e)=>{let r=e;if(og(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||ut&&r.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof X)||!n.$from.sameParent(n.$to)){let s=String.fromCharCode(r.charCode),o=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",i=>i(t,n.$from.pos,n.$to.pos,s,o))&&t.dispatch(o()),r.preventDefault()}};function $i(t){return{left:t.clientX,top:t.clientY}}function vE(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function Mu(t,e,r,n,s){if(n==-1)return!1;let o=t.state.doc.resolve(n);for(let i=o.depth+1;i>0;i--)if(t.someProp(e,a=>i>o.depth?a(t,r,o.nodeAfter,o.before(i),s,!0):a(t,r,o.node(i),o.before(i),s,!1)))return!0;return!1}function Sn(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function wE(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&Y.isSelectable(n)?(Sn(t,new Y(r)),!0):!1}function DE(t,e){if(e==-1)return!1;let r=t.state.selection,n,s;r instanceof Y&&(n=r.node);let o=t.state.doc.resolve(e);for(let i=o.depth+1;i>0;i--){let a=i>o.depth?o.nodeAfter:o.node(i);if(Y.isSelectable(a)){n&&r.$from.depth>0&&i>=r.$from.depth&&o.before(r.$from.depth+1)==r.$from.pos?s=o.before(r.$from.depth):s=o.before(i);break}}return s!=null?(Sn(t,Y.create(t.state.doc,s)),!0):!1}function CE(t,e,r,n,s){return Mu(t,"handleClickOn",e,r,n)||t.someProp("handleClick",o=>o(t,e,n))||(s?DE(t,r):wE(t,r))}function kE(t,e,r,n){return Mu(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",s=>s(t,e,n))}function EE(t,e,r,n){return Mu(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",s=>s(t,e,n))||SE(t,r,n)}function SE(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Sn(t,X.create(n,0,n.content.size)),!0):!1;let s=n.resolve(e);for(let o=s.depth+1;o>0;o--){let i=o>s.depth?s.nodeAfter:s.node(o),a=s.before(o);if(i.inlineContent)Sn(t,X.create(n,a+1,a+1+i.content.size));else if(Y.isSelectable(i))Sn(t,Y.create(n,a));else continue;return!0}}function Bu(t){return qo(t)}const sg=ut?"metaKey":"ctrlKey";Ge.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=Bu(t),s=Date.now(),o="singleClick";s-t.input.lastClick.time<500&&vE(r,t.input.lastClick)&&!r[sg]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:s,x:r.clientX,y:r.clientY,type:o,button:r.button};let i=t.posAtCoords($i(r));i&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new FE(t,i,r,!!n)):(o=="doubleClick"?kE:EE)(t,i.pos,i.inside,r)?r.preventDefault():mr(t,"pointer"))};class FE{constructor(e,r,n,s){this.view=e,this.pos=r,this.event=n,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[sg],this.allowDefault=n.shiftKey;let o,i;if(r.inside>-1)o=e.state.doc.nodeAt(r.inside),i=r.inside;else{let d=e.state.doc.resolve(r.pos);o=d.parent,i=d.depth?d.before():0}const a=s?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(n.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Y&&c.from<=i&&c.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&dt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),mr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Jt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords($i(e))),this.updateAllowDefault(e),this.allowDefault||!r?mr(this.view,"pointer"):CE(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ke&&this.mightDrag&&!this.mightDrag.node.isAtom||Ve&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Sn(this.view,re.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):mr(this.view,"pointer")}move(e){this.updateAllowDefault(e),mr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ge.touchstart=t=>{t.input.lastTouch=Date.now(),Bu(t),mr(t,"pointer")};Ge.touchmove=t=>{t.input.lastTouch=Date.now(),mr(t,"pointer")};Ge.contextmenu=t=>Bu(t);function og(t,e){return t.composing?!0:Ke&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const AE=Wt?5e3:-1;Ye.compositionstart=Ye.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof X&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||r.marks(),qo(t,!0),t.markCursor=null;else if(qo(t,!e.selection.empty),dt&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let s=n.focusNode,o=n.focusOffset;s&&s.nodeType==1&&o!=0;){let i=o<0?s.lastChild:s.childNodes[o-1];if(!i)break;if(i.nodeType==3){let a=t.domSelection();a&&a.collapse(i,i.nodeValue.length);break}else s=i,o=-1}}t.input.composing=!0}ig(t,AE)};Ye.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,ig(t,20))};function ig(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>qo(t),e))}function ag(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=TE());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function NE(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=wk(e.focusNode,e.focusOffset),n=Dk(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let s=n.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(r==o||n==o)return o;if(!s||!s.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let i=r.pmViewDesc;if(!(!i||!i.isText(r.nodeValue)))return n}}return r||n}function TE(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function qo(t,e=!1){if(!(Wt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ag(t),e||t.docView&&t.docView.dirty){let r=Fu(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function ME(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(s),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const Ms=Ze&&yr<15||Bn&&Fk<604;Ge.copy=Ye.cut=(t,e)=>{let r=e,n=t.state.selection,s=r.type=="cut";if(n.empty)return;let o=Ms?null:r.clipboardData,i=n.content(),{dom:a,text:l}=Nu(t,i);o?(r.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):ME(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function BE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function jE(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Bs(t,n.value,null,s,e):Bs(t,n.textContent,n.innerHTML,s,e)},50)}function Bs(t,e,r,n,s){let o=Qm(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,s,o||H.empty)))return!0;if(!o)return!1;let i=BE(o),a=i?t.state.tr.replaceSelectionWith(i,n):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function lg(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}Ye.paste=(t,e)=>{let r=e;if(t.composing&&!Wt)return;let n=Ms?null:r.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Bs(t,lg(n),n.getData("text/html"),s,r)?r.preventDefault():jE(t,r)};class ug{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const OE=ut?"altKey":"ctrlKey";function cg(t,e){let r=t.someProp("dragCopies",n=>!n(e));return r??!e[OE]}Ge.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let s=t.state.selection,o=s.empty?null:t.posAtCoords($i(r)),i;if(!(o&&o.pos>=s.from&&o.pos<=(s instanceof Y?s.to-1:s.to))){if(n&&n.mightDrag)i=Y.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let f=t.docView.nearestDesc(r.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(i=Y.create(t.state.doc,f.posBefore))}}let a=(i||t.state.selection).content(),{dom:l,text:c,slice:d}=Nu(t,a);(!r.dataTransfer.files.length||!Ve||_m>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Ms?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",Ms||r.dataTransfer.setData("text/plain",c),t.dragging=new ug(d,cg(t,r),i)};Ge.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ye.dragover=Ye.dragenter=(t,e)=>e.preventDefault();Ye.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let s=t.posAtCoords($i(r));if(!s)return;let o=t.state.doc.resolve(s.pos),i=n&&n.slice;i?t.someProp("transformPasted",y=>{i=y(i,t,!1)}):i=Qm(t,lg(r.dataTransfer),Ms?null:r.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&cg(t,r));if(t.someProp("handleDrop",y=>y(t,r,i||H.empty,a))){r.preventDefault();return}if(!i)return;r.preventDefault();let l=i?mm(t.state.doc,o.pos,i):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:y}=n;y?y.replace(c):c.deleteSelection()}let d=c.mapping.map(l),f=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,m=c.doc;if(f?c.replaceRangeWith(d,d,i.content.firstChild):c.replaceRange(d,d,i),c.doc.eq(m))return;let g=c.doc.resolve(d);if(f&&Y.isSelectable(i.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Y(g));else{let y=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((v,w,D,E)=>y=E),c.setSelection(Au(t,g,c.doc.resolve(y)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Ge.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Jt(t)},20))};Ge.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Ge.beforeinput=(t,e)=>{if(Ve&&Wt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Rr(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in Ye)Ge[t]=Ye[t];function js(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class Wo{constructor(e,r){this.toDOM=e,this.spec=r||Kr,this.side=this.spec.side||0}map(e,r,n,s){let{pos:o,deleted:i}=e.mapResult(r.from+s,this.side<0?-1:1);return i?null:new Je(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Wo&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&js(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class vr{constructor(e,r){this.attrs=e,this.spec=r||Kr}map(e,r,n,s){let o=e.map(r.from+s,this.spec.inclusiveStart?-1:1)-n,i=e.map(r.to+s,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Je(o,i,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof vr&&js(this.attrs,e.attrs)&&js(this.spec,e.spec)}static is(e){return e.type instanceof vr}destroy(){}}class ju{constructor(e,r){this.attrs=e,this.spec=r||Kr}map(e,r,n,s){let o=e.mapResult(r.from+s,1);if(o.deleted)return null;let i=e.mapResult(r.to+s,-1);return i.deleted||i.pos<=o.pos?null:new Je(o.pos-n,i.pos-n,this)}valid(e,r){let{index:n,offset:s}=e.content.findIndex(r.from),o;return s==r.from&&!(o=e.child(n)).isText&&s+o.nodeSize==r.to}eq(e){return this==e||e instanceof ju&&js(this.attrs,e.attrs)&&js(this.spec,e.spec)}destroy(){}}class Je{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new Je(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new Je(e,e,new Wo(r,n))}static inline(e,r,n,s){return new Je(e,r,new vr(n,s))}static node(e,r,n,s){return new Je(e,r,new ju(n,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof vr}get widget(){return this.type instanceof Wo}}const xn=[],Kr={};class fe{constructor(e,r){this.local=e.length?e:xn,this.children=r.length?r:xn}static create(e,r){return r.length?Uo(r,e,0,Kr):He}find(e,r,n){let s=[];return this.findInner(e??0,r??1e9,s,0,n),s}findInner(e,r,n,s,o){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=r&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+s,a.to+s))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<r&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,r-a,n,s+a,o)}}map(e,r,n){return this==He||e.maps.length==0?this:this.mapInner(e,r,0,0,n||Kr)}mapInner(e,r,n,s,o){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,s);l&&l.type.valid(r,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?LE(this.children,i||[],e,r,n,s,o):i?new fe(i.sort(Gr),xn):He}add(e,r){return r.length?this==He?fe.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let s,o=0;e.forEach((a,l)=>{let c=l+n,d;if(d=pg(r,a,c)){for(s||(s=this.children.slice());o<s.length&&s[o]<l;)o+=3;s[o]==l?s[o+2]=s[o+2].addInner(a,d,c+1):s.splice(o,0,l,l+a.nodeSize,Uo(d,a,c+1,Kr)),o+=3}});let i=dg(o?hg(r):r,-n);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new fe(i.length?this.local.concat(i).sort(Gr):this.local,s||this.children)}remove(e){return e.length==0||this==He?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,s=this.local;for(let o=0;o<n.length;o+=3){let i,a=n[o]+r,l=n[o+1]+r;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>a&&f.to<l&&(e[d]=null,(i||(i=[])).push(f));if(!i)continue;n==this.children&&(n=this.children.slice());let c=n[o+2].removeInner(i,a+1);c!=He?n[o+2]=c:(n.splice(o,3),o-=3)}if(s.length){for(let o=0,i;o<e.length;o++)if(i=e[o])for(let a=0;a<s.length;a++)s[a].eq(i,r)&&(s==this.local&&(s=this.local.slice()),s.splice(a--,1))}return n==this.children&&s==this.local?this:s.length||n.length?new fe(s,n):He}forChild(e,r){if(this==He)return this;if(r.isLeaf)return fe.empty;let n,s;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let o=e+1,i=o+r.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<i&&l.to>o&&l.type instanceof vr){let c=Math.max(o,l.from)-o,d=Math.min(i,l.to)-o;c<d&&(s||(s=[])).push(l.copy(c,d))}}if(s){let a=new fe(s.sort(Gr),xn);return n?new dr([a,n]):a}return n||He}eq(e){if(this==e)return!0;if(!(e instanceof fe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return Ou(this.localsInner(e))}localsInner(e){if(this==He)return xn;if(e.inlineContent||!this.local.some(vr.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof vr||r.push(this.local[n]);return r}forEachSet(e){e(this)}}fe.empty=new fe([],[]);fe.removeOverlap=Ou;const He=fe.empty;class dr{constructor(e){this.members=e}map(e,r){const n=this.members.map(s=>s.map(e,r,Kr));return dr.from(n)}forChild(e,r){if(r.isLeaf)return fe.empty;let n=[];for(let s=0;s<this.members.length;s++){let o=this.members[s].forChild(e,r);o!=He&&(o instanceof dr?n=n.concat(o.members):n.push(o))}return dr.from(n)}eq(e){if(!(e instanceof dr)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let s=0;s<this.members.length;s++){let o=this.members[s].localsInner(e);if(o.length)if(!r)r=o;else{n&&(r=r.slice(),n=!1);for(let i=0;i<o.length;i++)r.push(o[i])}}return r?Ou(n?r:r.sort(Gr)):xn}static from(e){switch(e.length){case 0:return He;case 1:return e[0];default:return new dr(e.every(r=>r instanceof fe)?e:e.reduce((r,n)=>r.concat(n instanceof fe?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function LE(t,e,r,n,s,o,i){let a=t.slice();for(let c=0,d=o;c<r.maps.length;c++){let f=0;r.maps[c].forEach((m,g,y,v)=>{let w=v-y-(g-m);for(let D=0;D<a.length;D+=3){let E=a[D+1];if(E<0||m>E+d-f)continue;let N=a[D]+d-f;g>=N?a[D+1]=m<=N?-2:-1:m>=d&&w&&(a[D]+=w,a[D+1]+=w)}f+=w}),d=r.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=r.map(t[c]+o),f=d-s;if(f<0||f>=n.content.size){l=!0;continue}let m=r.map(t[c+1]+o,-1),g=m-s,{index:y,offset:v}=n.content.findIndex(f),w=n.maybeChild(y);if(w&&v==f&&v+w.nodeSize==g){let D=a[c+2].mapInner(r,w,d+1,t[c]+o+1,i);D!=He?(a[c]=f,a[c+1]=g,a[c+2]=D):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=_E(a,t,e,r,s,o,i),d=Uo(c,n,0,i);e=d.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,m=0;f<d.children.length;f+=3){let g=d.children[f];for(;m<a.length&&a[m]<g;)m+=3;a.splice(m,0,d.children[f],d.children[f+1],d.children[f+2])}}return new fe(e.sort(Gr),a)}function dg(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let s=t[n];r.push(new Je(s.from+e,s.to+e,s.type))}return r}function _E(t,e,r,n,s,o,i){function a(l,c){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(n,s,c);f?r.push(f):i.onRemove&&i.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return r}function pg(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,s=null;for(let o=0,i;o<t.length;o++)(i=t[o])&&i.from>r&&i.to<n&&((s||(s=[])).push(i),t[o]=null);return s}function hg(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function Uo(t,e,r,n){let s=[],o=!1;e.forEach((a,l)=>{let c=pg(t,a,l+r);if(c){o=!0;let d=Uo(c,a,r+l+1,n);d!=He&&s.push(l,l+a.nodeSize,d)}});let i=dg(o?hg(t):t,-r).sort(Gr);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(n.onRemove&&n.onRemove(i[a].spec),i.splice(a--,1));return i.length||s.length?new fe(i,s):He}function Gr(t,e){return t.from-e.from||t.to-e.to}function Ou(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let s=r+1;s<e.length;s++){let o=e[s];if(o.from==n.from){o.to!=n.to&&(e==t&&(e=t.slice()),e[s]=o.copy(o.from,n.to),Kp(e,s+1,o.copy(n.to,o.to)));continue}else{o.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,o.from),Kp(e,s,n.copy(o.from,n.to)));break}}}return e}function Kp(t,e,r){for(;e<t.length&&Gr(r,t[e])>0;)e++;t.splice(e,0,r)}function $a(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=He&&e.push(n)}),t.cursorWrapper&&e.push(fe.create(t.state.doc,[t.cursorWrapper.deco])),dr.from(e)}const IE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},RE=Ze&&yr<=11;class PE{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class zE{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new PE,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let s=0;s<n.length;s++)this.queue.push(n[s]);Ze&&yr<=11&&n.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),RE&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,IE)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(zp(this.view)){if(this.suppressingSelectionUpdates)return Jt(this.view);if(Ze&&yr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&en(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let o=e.focusNode;o;o=Mn(o))r.add(o);for(let o=e.anchorNode;o;o=Mn(o))if(r.has(o)){n=o;break}let s=n&&this.view.docView.nearestDesc(n);if(s&&s.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&zp(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,a=!1,l=[];if(e.editable)for(let d=0;d<r.length;d++){let f=this.registerMutation(r[d],l);f&&(o=o<0?f.from:Math.min(f.from,o),i=i<0?f.to:Math.max(f.to,i),f.typeOver&&(a=!0))}if(dt&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,m]=d;f.parentNode&&f.parentNode.parentNode==m.parentNode?m.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let m of d){let g=m.parentNode;g&&g.nodeName=="LI"&&(!f||VE(e,f)!=g)&&m.remove()}}}let c=null;o<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Pi(n)&&(c=Fu(e))&&c.eq(re.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Jt(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||s)&&(o>-1&&(e.docView.markDirty(o,i),$E(e)),this.handleDOMChange(o,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Jt(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];r.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let s=e.previousSibling,o=e.nextSibling;if(Ze&&yr<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:m}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(o=m)}let i=s&&s.parentNode==e.target?Ie(s)+1:0,a=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?Ie(o):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Gp=new WeakMap,Yp=!1;function $E(t){if(!Gp.has(t)&&(Gp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=dt,Yp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Yp=!0}}function Xp(t,e){let r=e.startContainer,n=e.startOffset,s=e.endContainer,o=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return en(i.node,i.offset,s,o)&&([r,n,s,o]=[s,o,r,n]),{anchorNode:r,anchorOffset:n,focusNode:s,focusOffset:o}}function HE(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return Xp(t,s)}let r;function n(s){s.preventDefault(),s.stopImmediatePropagation(),r=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?Xp(t,r):null}function VE(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function qE(t,e,r){let{node:n,fromOffset:s,toOffset:o,from:i,to:a}=t.docView.parseRange(e,r),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],Pi(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Ve&&t.input.lastKeyCode===8)for(let w=o;w>s;w--){let D=n.childNodes[w-1],E=D.pmViewDesc;if(D.nodeName=="BR"&&!E){o=w;break}if(!E||E.size)break}let f=t.state.doc,m=t.someProp("domParser")||br.fromSchema(t.state.schema),g=f.resolve(i),y=null,v=m.parse(n,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:s,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:WE,context:g});if(c&&c[0].pos!=null){let w=c[0].pos,D=c[1]&&c[1].pos;D==null&&(D=w),y={anchor:w+i,head:D+i}}return{doc:v,sel:y,from:i,to:a}}function WE(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ke&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Ke&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const UE=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function JE(t,e,r,n,s){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let B=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,$=Fu(t,B);if($&&!t.state.selection.eq($)){if(Ve&&Wt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",z=>z(t,Rr(13,"Enter"))))return;let O=t.state.tr.setSelection($);B=="pointer"?O.setMeta("pointer",!0):B=="key"&&O.scrollIntoView(),o&&O.setMeta("composition",o),t.dispatch(O)}return}let i=t.state.doc.resolve(e),a=i.sharedDepth(r);e=i.before(a+1),r=t.state.doc.resolve(r).after(a+1);let l=t.state.selection,c=qE(t,e,r),d=t.state.doc,f=d.slice(c.from,c.to),m,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=YE(f.content,c.doc.content,c.from,m,g);if(y&&t.input.domChangeCount++,(Bn&&t.input.lastIOSEnter>Date.now()-225||Wt)&&s.some(B=>B.nodeType==1&&!UE.test(B.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",B=>B(t,Rr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(n&&l instanceof X&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let B=Qp(t,t.state.doc,c.sel);if(B&&!B.eq(t.state.selection)){let $=t.state.tr.setSelection(B);o&&$.setMeta("composition",o),t.dispatch($)}}return}t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof X&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Ze&&yr<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>c.from&&c.doc.textBetween(y.start-c.from-1,y.start-c.from+1)==" "&&(y.start--,y.endA--,y.endB--);let v=c.doc.resolveNoCache(y.start-c.from),w=c.doc.resolveNoCache(y.endB-c.from),D=d.resolve(y.start),E=v.sameParent(w)&&v.parent.inlineContent&&D.end()>=y.endA;if((Bn&&t.input.lastIOSEnter>Date.now()-225&&(!E||s.some(B=>B.nodeName=="DIV"||B.nodeName=="P"))||!E&&v.pos<c.doc.content.size&&(!v.sameParent(w)||!v.parent.inlineContent)&&v.pos<w.pos&&!/\S/.test(c.doc.textBetween(v.pos,w.pos,"","")))&&t.someProp("handleKeyDown",B=>B(t,Rr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&GE(d,y.start,y.endA,v,w)&&t.someProp("handleKeyDown",B=>B(t,Rr(8,"Backspace")))){Wt&&Ve&&t.domObserver.suppressSelectionUpdates();return}Ve&&y.endB==y.start&&(t.input.lastChromeDelete=Date.now()),Wt&&!E&&v.start()!=w.start()&&w.parentOffset==0&&v.depth==w.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==y.endA&&(y.endB-=2,w=c.doc.resolveNoCache(y.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(B){return B(t,Rr(13,"Enter"))})},20));let N=y.start,A=y.endA,T=B=>{let $=B||t.state.tr.replace(N,A,c.doc.slice(y.start-c.from,y.endB-c.from));if(c.sel){let O=Qp(t,$.doc,c.sel);O&&!(Ve&&t.composing&&O.empty&&(y.start!=y.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==N||O.head==$.mapping.map(A)-1)||Ze&&O.empty&&O.head==N)&&$.setSelection(O)}return o&&$.setMeta("composition",o),$.scrollIntoView()},j;if(E)if(v.pos==w.pos){Ze&&yr<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Jt(t),20));let B=T(t.state.tr.delete(N,A)),$=d.resolve(y.start).marksAcross(d.resolve(y.endA));$&&B.ensureMarks($),t.dispatch(B)}else if(y.endA==y.endB&&(j=KE(v.parent.content.cut(v.parentOffset,w.parentOffset),D.parent.content.cut(D.parentOffset,y.endA-D.start())))){let B=T(t.state.tr);j.type=="add"?B.addMark(N,A,j.mark):B.removeMark(N,A,j.mark),t.dispatch(B)}else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let B=v.parent.textBetween(v.parentOffset,w.parentOffset),$=()=>T(t.state.tr.insertText(B,N,A));t.someProp("handleTextInput",O=>O(t,N,A,B,$))||t.dispatch($())}else t.dispatch(T());else t.dispatch(T())}function Qp(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:Au(t,e.resolve(r.anchor),e.resolve(r.head))}function KE(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,s=r,o=n,i,a,l;for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);for(let d=0;d<r.length;d++)o=r[d].removeFromSet(o);if(s.length==1&&o.length==0)a=s[0],i="add",l=d=>d.mark(a.addToSet(d.marks));else if(s.length==0&&o.length==1)a=o[0],i="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(L.from(c).eq(t))return{mark:a,type:i}}function GE(t,e,r,n,s){if(r-e<=s.pos-n.pos||Ha(n,!0,!1)<s.pos)return!1;let o=t.resolve(e);if(!n.parent.isTextblock){let a=o.nodeAfter;return a!=null&&r==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let i=t.resolve(Ha(o,!0,!0));return!i.parent.isTextblock||i.pos>r||Ha(i,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(i.parent.content)}function Ha(t,e,r){let n=t.depth,s=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,s++,e=!1;if(r){let o=t.node(n).maybeChild(t.indexAfter(n));for(;o&&!o.isLeaf;)o=o.firstChild,s++}return s}function YE(t,e,r,n,s){let o=t.findDiffStart(e,r);if(o==null)return null;let{a:i,b:a}=t.findDiffEnd(e,r+t.size,r+e.size);if(s=="end"){let l=Math.max(0,o-Math.min(i,a));n-=i+l-o}if(i<o&&t.size<e.size){let l=n<=o&&n>=i?o-n:0;o-=l,o&&o<e.size&&Zp(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-i),i=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,o&&o<t.size&&Zp(t.textBetween(o-1,o+1))&&(o+=l?1:-1),i=o+(i-a),a=o}return{start:o,endA:i,endB:a}}function Zp(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class fg{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new mE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(sh),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rh(this),th(this),this.nodeViews=nh(this),this.docView=Op(this.state.doc,eh(this),$a(this),this.dom,this),this.domObserver=new zE(this,(n,s,o,i)=>JE(this,n,s,o,i)),this.domObserver.start(),gE(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ml(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sh),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let s=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(ag(this),i=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=r.plugins;if(a||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let g=nh(this);QE(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(a||r.handleDOMEvents!=this._props.handleDOMEvents)&&Ml(this),this.editable=rh(this),th(this);let l=$a(this),c=eh(this),d=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(s.selection))&&(i=!0);let m=d=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Tk(this);if(i){this.domObserver.stop();let g=f&&(Ze||Ve)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&XE(s.selection,e.selection);if(f){let y=Ve?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=NE(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Op(e.doc,c,l,this.dom,this)),y&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&eE(this))?Jt(this,g):(Gm(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((n=this.dragging)===null||n===void 0)&&n.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():m&&Mk(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof Y){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Ap(this,r.getBoundingClientRect(),e)}else Ap(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,s=-1;if(this.state.doc.nodeAt(n.from)==n.node)s=n.from;else{let o=n.from+(this.state.doc.content.size-r.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==n.node&&(s=o)}this.dragging=new ug(e.slice,e.move,s<0?void 0:Y.create(this.state.doc,s))}someProp(e,r){let n=this._props&&this._props[e],s;if(n!=null&&(s=r?r(n):n))return s;for(let i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(s=r?r(a):a))return s}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let a=o[i].props[e];if(a!=null&&(s=r?r(a):a))return s}}hasFocus(){if(Ze){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Bk(this.dom),Jt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ik(this,e)}coordsAtPos(e,r=1){return $m(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let s=this.docView.posFromDOM(e,r,n);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,r){return Hk(this,r||this.state,e)}pasteHTML(e,r){return Bs(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return Bs(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return Nu(this,e)}destroy(){this.docView&&(bE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$a(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,xk())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return xE(this,e)}domSelectionRange(){let e=this.domSelection();return e?Ke&&this.root.nodeType===11&&kk(this.dom.ownerDocument)==this.dom&&HE(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}fg.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function eh(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[Je.node(0,t.state.doc.content.size,e)]}function th(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Je.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rh(t){return!t.someProp("editable",e=>e(t.state)===!1)}function XE(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function nh(t){let e=Object.create(null);function r(n){for(let s in n)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=n[s])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function QE(t,e){let r=0,n=0;for(let s in t){if(t[s]!=e[s])return!0;r++}for(let s in e)n++;return r!=n}function sh(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Dr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Jo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ZE=typeof navigator<"u"&&/Mac/.test(navigator.platform),eS=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Re=0;Re<10;Re++)Dr[48+Re]=Dr[96+Re]=String(Re);for(var Re=1;Re<=24;Re++)Dr[Re+111]="F"+Re;for(var Re=65;Re<=90;Re++)Dr[Re]=String.fromCharCode(Re+32),Jo[Re]=String.fromCharCode(Re);for(var Va in Dr)Jo.hasOwnProperty(Va)||(Jo[Va]=Dr[Va]);function tS(t){var e=ZE&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||eS&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?Jo:Dr)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const rS=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),nS=typeof navigator<"u"&&/Win/.test(navigator.platform);function sS(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,s,o,i;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))rS?i=!0:s=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),s&&(r="Ctrl-"+r),i&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function oS(t){let e=Object.create(null);for(let r in t)e[sS(r)]=t[r];return e}function qa(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function iS(t){return new be({props:{handleKeyDown:mg(t)}})}function mg(t){let e=oS(t);return function(r,n){let s=tS(n),o,i=e[qa(s,n)];if(i&&i(r.state,r.dispatch,r))return!0;if(s.length==1&&s!=" "){if(n.shiftKey){let a=e[qa(s,n,!1)];if(a&&a(r.state,r.dispatch,r))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(nS&&n.ctrlKey&&n.altKey)&&(o=Dr[n.keyCode])&&o!=s){let a=e[qa(o,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}var aS=Object.defineProperty,Lu=(t,e)=>{for(var r in e)aS(t,r,{get:e[r],enumerable:!0})};function Hi(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:s}=r,{storedMarks:o}=r;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return n},get doc(){return s},get tr(){return n=r.selection,s=r.doc,o=r.storedMarks,r}}}var Vi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:r}=this,{view:n}=e,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([i,a])=>[i,(...c)=>{const d=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:r,editor:n,state:s}=this,{view:o}=n,i=[],a=!!t,l=t||s.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),i.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,m])=>[f,(...y)=>{const v=this.buildProps(l,e),w=m(...y)(v);return i.push(w),d}])),run:c};return d}createCan(t){const{rawCommands:e,state:r}=this,n=!1,s=t||r.tr,o=this.buildProps(s,n);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,n)}}buildProps(t,e=!0){const{rawCommands:r,editor:n,state:s}=this,{view:o}=n,i={tr:t,editor:n,view:o,state:Hi({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([a,l])=>[a,(...c)=>l(...c)(i)]))}};return i}},gg={};Lu(gg,{blur:()=>lS,clearContent:()=>uS,clearNodes:()=>cS,command:()=>dS,createParagraphNear:()=>pS,cut:()=>hS,deleteCurrentNode:()=>fS,deleteNode:()=>mS,deleteRange:()=>gS,deleteSelection:()=>bS,enter:()=>yS,exitCode:()=>xS,extendMarkRange:()=>vS,first:()=>wS,focus:()=>CS,forEach:()=>kS,insertContent:()=>ES,insertContentAt:()=>AS,joinBackward:()=>MS,joinDown:()=>TS,joinForward:()=>BS,joinItemBackward:()=>jS,joinItemForward:()=>OS,joinTextblockBackward:()=>LS,joinTextblockForward:()=>_S,joinUp:()=>NS,keyboardShortcut:()=>RS,lift:()=>PS,liftEmptyBlock:()=>zS,liftListItem:()=>$S,newlineInCode:()=>HS,resetAttributes:()=>VS,scrollIntoView:()=>qS,selectAll:()=>WS,selectNodeBackward:()=>US,selectNodeForward:()=>JS,selectParentNode:()=>KS,selectTextblockEnd:()=>GS,selectTextblockStart:()=>YS,setContent:()=>XS,setMark:()=>mF,setMeta:()=>gF,setNode:()=>bF,setNodeSelection:()=>yF,setTextSelection:()=>xF,sinkListItem:()=>vF,splitBlock:()=>wF,splitListItem:()=>DF,toggleList:()=>CF,toggleMark:()=>kF,toggleNode:()=>EF,toggleWrap:()=>SF,undoInputRule:()=>FF,unsetAllMarks:()=>AF,unsetMark:()=>NF,updateAttributes:()=>TF,wrapIn:()=>MF,wrapInList:()=>BF});var lS=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window?.getSelection())==null||r.removeAllRanges())}),!0),uS=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),cS=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:s}=n;return r&&s.forEach(({$from:o,$to:i})=>{t.doc.nodesBetween(o.pos,i.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,f=c.resolve(d.map(l)),m=c.resolve(d.map(l+a.nodeSize)),g=f.blockRange(m);if(!g)return;const y=zn(g);if(a.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(g.start,v)}(y||y===0)&&e.lift(g,y)})}),!0},dS=t=>e=>t(e),pS=()=>({state:t,dispatch:e})=>Mm(t,e),hS=(t,e)=>({editor:r,tr:n})=>{const{state:s}=r,o=s.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const i=n.mapping.map(e);return n.insert(i,o.content),n.setSelection(new X(n.doc.resolve(Math.max(i-1,0)))),!0},fS=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const s=t.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===n.type){if(e){const a=s.before(o),l=s.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1};function Ce(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var mS=t=>({tr:e,state:r,dispatch:n})=>{const s=Ce(t,r.schema),o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===s){if(n){const l=o.before(i),c=o.after(i);e.delete(l,c).scrollIntoView()}return!0}return!1},gS=t=>({tr:e,dispatch:r})=>{const{from:n,to:s}=t;return r&&e.delete(n,s),!0},bS=()=>({state:t,dispatch:e})=>wu(t,e),yS=()=>({commands:t})=>t.keyboardShortcut("Enter"),xS=()=>({state:t,dispatch:e})=>sk(t,e);function _u(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Ko(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(s=>r.strict?e[s]===t[s]:_u(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function bg(t,e,r={}){return t.find(n=>n.type===e&&Ko(Object.fromEntries(Object.keys(r).map(s=>[s,n.attrs[s]])),r))}function oh(t,e,r={}){return!!bg(t,e,r)}function Iu(t,e,r){var n;if(!t||!e)return;let s=t.parent.childAfter(t.parentOffset);if((!s.node||!s.node.marks.some(d=>d.type===e))&&(s=t.parent.childBefore(t.parentOffset)),!s.node||!s.node.marks.some(d=>d.type===e)||(r=r||((n=s.node.marks[0])==null?void 0:n.attrs),!bg([...s.node.marks],e,r)))return;let i=s.index,a=t.start()+s.offset,l=i+1,c=a+s.node.nodeSize;for(;i>0&&oh([...t.parent.child(i-1).marks],e,r);)i-=1,a-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&oh([...t.parent.child(l).marks],e,r);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function tr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var vS=(t,e={})=>({tr:r,state:n,dispatch:s})=>{const o=tr(t,n.schema),{doc:i,selection:a}=r,{$from:l,from:c,to:d}=a;if(s){const f=Iu(l,o,e);if(f&&f.from<=c&&f.to>=d){const m=X.create(i,f.from,f.to);r.setSelection(m)}}return!0},wS=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1};function yg(t){return t instanceof X}function Vr(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function xg(t,e=null){if(!e)return null;const r=re.atStart(t),n=re.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const s=r.from,o=n.to;return e==="all"?X.create(t,Vr(0,s,o),Vr(t.content.size,s,o)):X.create(t,Vr(e,s,o),Vr(e,s,o))}function DS(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Ru(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var CS=(t=null,e={})=>({editor:r,view:n,tr:s,dispatch:o})=>{e={scrollIntoView:!0,...e};const i=()=>{(Ru()||DS())&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e?.scrollIntoView&&r.commands.scrollIntoView())})};if(n.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!yg(r.state.selection))return i(),!0;const a=xg(s.doc,t)||r.state.selection,l=r.state.selection.eq(a);return o&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),i()),!0},kS=(t,e)=>r=>t.every((n,s)=>e(n,{...r,index:s})),ES=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),vg=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&vg(n)}return t};function vo(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return vg(r)}function Os(t,e,r){if(t instanceof Dt||t instanceof L)return t;r={slice:!0,parseOptions:{},...r};const n=typeof t=="object"&&t!==null,s=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return L.fromArray(t.map(a=>e.nodeFromJSON(a)));const i=e.nodeFromJSON(t);return r.errorOnInvalidContent&&i.check(),i}catch(o){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Os("",e,r)}if(s){if(r.errorOnInvalidContent){let i=!1,a="";const l=new sm({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(r.slice?br.fromSchema(l).parseSlice(vo(t),r.parseOptions):br.fromSchema(l).parse(vo(t),r.parseOptions),r.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=br.fromSchema(e);return r.slice?o.parseSlice(vo(t),r.parseOptions).content:o.parse(vo(t),r.parseOptions)}return Os("",e,r)}function SS(t,e,r){const n=t.steps.length-1;if(n<e)return;const s=t.steps[n];if(!(s instanceof Ne||s instanceof Te))return;const o=t.mapping.maps[n];let i=0;o.forEach((a,l,c,d)=>{i===0&&(i=d)}),t.setSelection(re.near(t.doc.resolve(i),r))}var FS=t=>!("type"in t),AS=(t,e,r)=>({tr:n,dispatch:s,editor:o})=>{var i;if(s){r={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let a;const l=w=>{o.emit("contentError",{editor:o,error:w,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Os(e,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(w){l(w)}try{a=Os(e,o.schema,{parseOptions:c,errorOnInvalidContent:(i=r.errorOnInvalidContent)!=null?i:o.options.enableContentCheck})}catch(w){return l(w),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},m=!0,g=!0;if((FS(a)?a:[a]).forEach(w=>{w.check(),m=m?w.isText&&w.marks.length===0:!1,g=g?w.isBlock:!1}),d===f&&g){const{parent:w}=n.doc.resolve(d);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(d-=1,f+=1)}let v;if(m){if(Array.isArray(e))v=e.map(w=>w.text||"").join("");else if(e instanceof L){let w="";e.forEach(D=>{D.text&&(w+=D.text)}),v=w}else typeof e=="object"&&e&&e.text?v=e.text:v=e;n.insertText(v,d,f)}else{v=a;const w=n.doc.resolve(d),D=w.node(),E=w.parentOffset===0,N=D.isText||D.isTextblock,A=D.content.size>0;E&&N&&A&&(d=Math.max(0,d-1)),n.replaceWith(d,f,v)}r.updateSelection&&SS(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:d,text:v}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:d,text:v})}return!0},NS=()=>({state:t,dispatch:e})=>tk(t,e),TS=()=>({state:t,dispatch:e})=>rk(t,e),MS=()=>({state:t,dispatch:e})=>km(t,e),BS=()=>({state:t,dispatch:e})=>Am(t,e),jS=()=>({state:t,dispatch:e,tr:r})=>{try{const n=_i(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},OS=()=>({state:t,dispatch:e,tr:r})=>{try{const n=_i(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},LS=()=>({state:t,dispatch:e})=>ZC(t,e),_S=()=>({state:t,dispatch:e})=>ek(t,e);function wg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function IS(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,s,o,i;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Ru()||wg()?i=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(r=`Alt-${r}`),s&&(r=`Ctrl-${r}`),i&&(r=`Meta-${r}`),o&&(r=`Shift-${r}`),r}var RS=t=>({editor:e,view:r,tr:n,dispatch:s})=>{const o=IS(t).split(/-(?!$)/),i=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",c=>c(r,a))});return l?.steps.forEach(c=>{const d=c.map(n.mapping);d&&s&&n.maybeStep(d)}),!0};function Cr(t,e,r={}){const{from:n,to:s,empty:o}=t.selection,i=e?Ce(e,t.schema):null,a=[];t.doc.nodesBetween(n,s,(f,m)=>{if(f.isText)return;const g=Math.max(n,m),y=Math.min(s,m+f.nodeSize);a.push({node:f,from:g,to:y})});const l=s-n,c=a.filter(f=>i?i.name===f.node.type.name:!0).filter(f=>Ko(f.node.attrs,r,{strict:!1}));return o?!!c.length:c.reduce((f,m)=>f+m.to-m.from,0)>=l}var PS=(t,e={})=>({state:r,dispatch:n})=>{const s=Ce(t,r.schema);return Cr(r,s,e)?nk(r,n):!1},zS=()=>({state:t,dispatch:e})=>Bm(t,e),$S=t=>({state:e,dispatch:r})=>{const n=Ce(t,e.schema);return mk(n)(e,r)},HS=()=>({state:t,dispatch:e})=>Tm(t,e);function qi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ih(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,s)=>(r.includes(s)||(n[s]=t[s]),n),{})}var VS=(t,e)=>({tr:r,state:n,dispatch:s})=>{let o=null,i=null;const a=qi(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=Ce(t,n.schema)),a==="mark"&&(i=tr(t,n.schema)),s&&r.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{o&&o===c.type&&r.setNodeMarkup(d,void 0,ih(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(f=>{i===f.type&&r.addMark(d,d+c.nodeSize,i.create(ih(f.attrs,e)))})})}),!0):!1},qS=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),WS=()=>({tr:t,dispatch:e})=>{if(e){const r=new st(t.doc);t.setSelection(r)}return!0},US=()=>({state:t,dispatch:e})=>Sm(t,e),JS=()=>({state:t,dispatch:e})=>Nm(t,e),KS=()=>({state:t,dispatch:e})=>ak(t,e),GS=()=>({state:t,dispatch:e})=>ck(t,e),YS=()=>({state:t,dispatch:e})=>uk(t,e);function Bl(t,e,r={},n={}){return Os(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}var XS=(t,{errorOnInvalidContent:e,emitUpdate:r=!0,parseOptions:n={}}={})=>({editor:s,tr:o,dispatch:i,commands:a})=>{const{doc:l}=o;if(n.preserveWhitespace!=="full"){const c=Bl(t,s.schema,n,{errorOnInvalidContent:e??s.options.enableContentCheck});return i&&o.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!r),!0}return i&&o.setMeta("preventUpdate",!r),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??s.options.enableContentCheck})};function Dg(t,e){const r=tr(e,t.schema),{from:n,to:s,empty:o}=t.selection,i=[];o?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,s,l=>{i.push(...l.marks)});const a=i.find(l=>l.type.name===r.name);return a?{...a.attrs}:{}}function Cg(t,e){const r=new vm(t);return e.forEach(n=>{n.steps.forEach(s=>{r.step(s)})}),r}function QS(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function ZS(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(s,o)=>{r(s)&&n.push({node:s,pos:o})}),n}function eF(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function Wi(t){return e=>eF(e.$from,t)}function G(t,e,r){return t.config[e]===void 0&&t.parent?G(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?G(t.parent,e,r):null}):t.config[e]}function Pu(t){return t.map(e=>{const r={name:e.name,options:e.options,storage:e.storage},n=G(e,"addExtensions",r);return n?[e,...Pu(n())]:e}).flat(10)}function zu(t,e){const r=on.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(r),s.innerHTML}function kg(t){return typeof t=="function"}function le(t,e=void 0,...r){return kg(t)?e?t.bind(e)(...r):t(...r):t}function tF(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Ls(t){const e=t.filter(s=>s.type==="extension"),r=t.filter(s=>s.type==="node"),n=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function Eg(t){const e=[],{nodeExtensions:r,markExtensions:n}=Ls(t),s=[...r,...n],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage,extensions:s},l=G(i,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(f=>{Object.entries(d.attributes).forEach(([m,g])=>{e.push({type:f,name:m,attribute:{...o,...g}})})})})}),s.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=G(i,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,f])=>{const m={...o,...f};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:i.name,name:d,attribute:m})})}),e}function ye(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([s,o])=>{if(!n[s]){n[s]=o;return}if(s==="class"){const a=o?String(o).split(" "):[],l=n[s]?n[s].split(" "):[],c=a.filter(d=>!l.includes(d));n[s]=[...l,...c].join(" ")}else if(s==="style"){const a=o?o.split(";").map(d=>d.trim()).filter(Boolean):[],l=n[s]?n[s].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[f,m]=d.split(":").map(g=>g.trim());c.set(f,m)}),a.forEach(d=>{const[f,m]=d.split(":").map(g=>g.trim());c.set(f,m)}),n[s]=Array.from(c.entries()).map(([d,f])=>`${d}: ${f}`).join("; ")}else n[s]=o}),n},{})}function Go(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>ye(r,n),{})}function rF(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function ah(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const s=e.reduce((o,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(r):rF(r.getAttribute(i.name));return a==null?o:{...o,[i.name]:a}},{});return{...n,...s}}}}function lh(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&tF(r)?!1:r!=null))}function nF(t,e){var r;const n=Eg(t),{nodeExtensions:s,markExtensions:o}=Ls(t),i=(r=s.find(c=>G(c,"topNode")))==null?void 0:r.name,a=Object.fromEntries(s.map(c=>{const d=n.filter(D=>D.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},m=t.reduce((D,E)=>{const N=G(E,"extendNodeSchema",f);return{...D,...N?N(c):{}}},{}),g=lh({...m,content:le(G(c,"content",f)),marks:le(G(c,"marks",f)),group:le(G(c,"group",f)),inline:le(G(c,"inline",f)),atom:le(G(c,"atom",f)),selectable:le(G(c,"selectable",f)),draggable:le(G(c,"draggable",f)),code:le(G(c,"code",f)),whitespace:le(G(c,"whitespace",f)),linebreakReplacement:le(G(c,"linebreakReplacement",f)),defining:le(G(c,"defining",f)),isolating:le(G(c,"isolating",f)),attrs:Object.fromEntries(d.map(D=>{var E,N;return[D.name,{default:(E=D?.attribute)==null?void 0:E.default,validate:(N=D?.attribute)==null?void 0:N.validate}]}))}),y=le(G(c,"parseHTML",f));y&&(g.parseDOM=y.map(D=>ah(D,d)));const v=G(c,"renderHTML",f);v&&(g.toDOM=D=>v({node:D,HTMLAttributes:Go(D,d)}));const w=G(c,"renderText",f);return w&&(g.toText=w),[c.name,g]})),l=Object.fromEntries(o.map(c=>{const d=n.filter(w=>w.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},m=t.reduce((w,D)=>{const E=G(D,"extendMarkSchema",f);return{...w,...E?E(c):{}}},{}),g=lh({...m,inclusive:le(G(c,"inclusive",f)),excludes:le(G(c,"excludes",f)),group:le(G(c,"group",f)),spanning:le(G(c,"spanning",f)),code:le(G(c,"code",f)),attrs:Object.fromEntries(d.map(w=>{var D,E;return[w.name,{default:(D=w?.attribute)==null?void 0:D.default,validate:(E=w?.attribute)==null?void 0:E.validate}]}))}),y=le(G(c,"parseHTML",f));y&&(g.parseDOM=y.map(w=>ah(w,d)));const v=G(c,"renderHTML",f);return v&&(g.toDOM=w=>v({mark:w,HTMLAttributes:Go(w,d)})),[c.name,g]}));return new sm({topNode:i,nodes:a,marks:l})}function sF(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}function $u(t){return t.sort((r,n)=>{const s=G(r,"priority")||100,o=G(n,"priority")||100;return s>o?-1:s<o?1:0})}function Sg(t){const e=$u(Pu(t)),r=sF(e.map(n=>n.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function Fg(t,e,r){const{from:n,to:s}=e,{blockSeparator:o=`
|
|
88
|
+
|
|
89
|
+
`,textSerializers:i={}}=r||{};let a="";return t.nodesBetween(n,s,(l,c,d,f)=>{var m;l.isBlock&&c>n&&(a+=o);const g=i?.[l.type.name];if(g)return d&&(a+=g({node:l,pos:c,parent:d,index:f,range:e})),!1;l.isText&&(a+=(m=l?.text)==null?void 0:m.slice(Math.max(n,c)-c,s-c))}),a}function oF(t,e){const r={from:0,to:t.content.size};return Fg(t,r,e)}function Ag(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}function iF(t,e){const r=Ce(e,t.schema),{from:n,to:s}=t.selection,o=[];t.doc.nodesBetween(n,s,a=>{o.push(a)});const i=o.reverse().find(a=>a.type.name===r.name);return i?{...i.attrs}:{}}function Ng(t,e){const r=qi(typeof e=="string"?e:e.name,t.schema);return r==="node"?iF(t,e):r==="mark"?Dg(t,e):{}}function aF(t,e=JSON.stringify){const r={};return t.filter(n=>{const s=e(n);return Object.prototype.hasOwnProperty.call(r,s)?!1:r[s]=!0})}function lF(t){const e=aF(t);return e.length===1?e:e.filter((r,n)=>!e.filter((o,i)=>i!==n).some(o=>r.oldRange.from>=o.oldRange.from&&r.oldRange.to<=o.oldRange.to&&r.newRange.from>=o.newRange.from&&r.newRange.to<=o.newRange.to))}function Tg(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((s,o)=>{const i=[];if(s.ranges.length)s.forEach((a,l)=>{i.push({from:a,to:l})});else{const{from:a,to:l}=r[o];if(a===void 0||l===void 0)return;i.push({from:a,to:l})}i.forEach(({from:a,to:l})=>{const c=e.slice(o).map(a,-1),d=e.slice(o).map(l),f=e.invert().map(c,-1),m=e.invert().map(d);n.push({oldRange:{from:f,to:m},newRange:{from:c,to:d}})})}),lF(n)}function Hu(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(s=>{const o=r.resolve(t),i=Iu(o,s.type);i&&n.push({mark:s,...i})}):r.nodesBetween(t,e,(s,o)=>{!s||s?.nodeSize===void 0||n.push(...s.marks.map(i=>({from:o,to:o+s.nodeSize,mark:i})))}),n}var uF=(t,e,r,n=20)=>{const s=t.doc.resolve(r);let o=n,i=null;for(;o>0&&i===null;){const a=s.node(o);a?.type.name===e?i=a:o-=1}return[i,o]};function Wa(t,e){return e.nodes[t]||e.marks[t]||null}function jo(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const s=t.find(o=>o.type===e&&o.name===n);return s?s.attribute.keepOnSplit:!1}))}var cF=(t,e=500)=>{let r="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(s,o,i,a)=>{var l,c;const d=((c=(l=s.type.spec).toText)==null?void 0:c.call(l,{node:s,pos:o,parent:i,index:a}))||s.textContent||"%leaf%";r+=s.isAtom&&!s.isText?d:d.slice(0,Math.max(0,n-o))}),r};function jl(t,e,r={}){const{empty:n,ranges:s}=t.selection,o=e?tr(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ko(f.attrs,r,{strict:!1}));let i=0;const a=[];if(s.forEach(({$from:f,$to:m})=>{const g=f.pos,y=m.pos;t.doc.nodesBetween(g,y,(v,w)=>{if(!v.isText&&!v.marks.length)return;const D=Math.max(g,w),E=Math.min(y,w+v.nodeSize),N=E-D;i+=N,a.push(...v.marks.map(A=>({mark:A,from:D,to:E})))})}),i===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ko(f.mark.attrs,r,{strict:!1})).reduce((f,m)=>f+m.to-m.from,0),c=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,m)=>f+m.to-m.from,0);return(l>0?l+c:l)>=i}function dF(t,e,r={}){if(!e)return Cr(t,null,r)||jl(t,null,r);const n=qi(e,t.schema);return n==="node"?Cr(t,e,r):n==="mark"?jl(t,e,r):!1}var pF=(t,e)=>{const{$from:r,$to:n,$anchor:s}=t.selection;if(e){const o=Wi(a=>a.type.name===e)(t.selection);if(!o)return!1;const i=t.doc.resolve(o.pos+1);return s.pos+1===i.end()}return!(n.parentOffset<n.parent.nodeSize-2||r.pos!==n.pos)},hF=t=>{const{$from:e,$to:r}=t.selection;return!(e.parentOffset>0||e.pos!==r.pos)};function uh(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function ch(t,e){const{nodeExtensions:r}=Ls(e),n=r.find(i=>i.name===t);if(!n)return!1;const s={name:n.name,options:n.options,storage:n.storage},o=le(G(n,"group",s));return typeof o!="string"?!1:o.split(" ").includes("list")}function Ui(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!=null?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(o=>{s!==!1&&(Ui(o,{ignoreWhitespace:r,checkChildren:e})||(s=!1))}),s}return!1}function Mg(t){return t instanceof Y}function fF(t,e,r){var n;const{selection:s}=e;let o=null;if(yg(s)&&(o=s.$cursor),o){const a=(n=t.storedMarks)!=null?n:o.marks();return o.parent.type.allowsMarkType(r)&&(!!r.isInSet(a)||!a.some(c=>c.type.excludes(r)))}const{ranges:i}=s;return i.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,f,m)=>{if(c)return!1;if(d.isInline){const g=!m||m.type.allowsMarkType(r),y=!!r.isInSet(d.marks)||!d.marks.some(v=>v.type.excludes(r));c=g&&y}return!c}),c})}var mF=(t,e={})=>({tr:r,state:n,dispatch:s})=>{const{selection:o}=r,{empty:i,ranges:a}=o,l=tr(t,n.schema);if(s)if(i){const c=Dg(n,l);r.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,f=c.$to.pos;n.doc.nodesBetween(d,f,(m,g)=>{const y=Math.max(g,d),v=Math.min(g+m.nodeSize,f);m.marks.find(D=>D.type===l)?m.marks.forEach(D=>{l===D.type&&r.addMark(y,v,l.create({...D.attrs,...e}))}):r.addMark(y,v,l.create(e))})});return fF(n,r,l)},gF=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),bF=(t,e={})=>({state:r,dispatch:n,chain:s})=>{const o=Ce(t,r.schema);let i;return r.selection.$anchor.sameParent(r.selection.$head)&&(i=r.selection.$anchor.parent.attrs),o.isTextblock?s().command(({commands:a})=>Ep(o,{...i,...e})(r)?!0:a.clearNodes()).command(({state:a})=>Ep(o,{...i,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},yF=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,s=Vr(t,0,n.content.size),o=Y.create(n,s);e.setSelection(o)}return!0},xF=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:s,to:o}=typeof t=="number"?{from:t,to:t}:t,i=X.atStart(n).from,a=X.atEnd(n).to,l=Vr(s,i,a),c=Vr(o,i,a),d=X.create(n,l,c);e.setSelection(d)}return!0},vF=t=>({state:e,dispatch:r})=>{const n=Ce(t,e.schema);return yk(n)(e,r)};function dh(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(s=>e?.includes(s.type.name));t.tr.ensureMarks(n)}}var wF=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:s})=>{const{selection:o,doc:i}=e,{$from:a,$to:l}=o,c=s.extensionManager.attributes,d=jo(c,a.node().type.name,a.node().attrs);if(o instanceof Y&&o.node.isBlock)return!a.parentOffset||!Ut(i,a.pos)?!1:(n&&(t&&dh(r,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,m=a.depth===0?void 0:QS(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=f&&m?[{type:m,attrs:d}]:void 0,y=Ut(e.doc,e.mapping.map(a.pos),1,g);if(!g&&!y&&Ut(e.doc,e.mapping.map(a.pos),1,m?[{type:m}]:void 0)&&(y=!0,g=m?[{type:m,attrs:d}]:void 0),n){if(y&&(o instanceof X&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,g),m&&!f&&!a.parentOffset&&a.parent.type!==m)){const v=e.mapping.map(a.before()),w=e.doc.resolve(v);a.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(a.before()),m)}t&&dh(r,s.extensionManager.splittableMarks),e.scrollIntoView()}return y},DF=(t,e={})=>({tr:r,state:n,dispatch:s,editor:o})=>{var i;const a=Ce(t,n.schema),{$from:l,$to:c}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const m=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(s){let D=L.empty;const E=l.index(-1)?1:l.index(-2)?2:3;for(let $=l.depth-E;$>=l.depth-3;$-=1)D=L.from(l.node($).copy(D));const N=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,A={...jo(m,l.node().type.name,l.node().attrs),...e},T=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill(A))||void 0;D=D.append(L.from(a.createAndFill(null,T)||void 0));const j=l.before(l.depth-(E-1));r.replace(j,l.after(-N),new H(D,4-E,0));let B=-1;r.doc.nodesBetween(j,r.doc.content.size,($,O)=>{if(B>-1)return!1;$.isTextblock&&$.content.size===0&&(B=O+1)}),B>-1&&r.setSelection(X.near(r.doc.resolve(B))),r.scrollIntoView()}return!0}const g=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,y={...jo(m,f.type.name,f.attrs),...e},v={...jo(m,l.node().type.name,l.node().attrs),...e};r.delete(l.pos,c.pos);const w=g?[{type:a,attrs:y},{type:g,attrs:v}]:[{type:a,attrs:y}];if(!Ut(r.doc,l.pos,2))return!1;if(s){const{selection:D,storedMarks:E}=n,{splittableMarks:N}=o.extensionManager,A=E||D.$to.parentOffset&&D.$from.marks();if(r.split(l.pos,2,w).scrollIntoView(),!A||!s)return!0;const T=A.filter(j=>N.includes(j.type.name));r.ensureMarks(T)}return!0},Ua=(t,e)=>{const r=Wi(i=>i.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const s=t.doc.nodeAt(n);return r.node.type===s?.type&&Sr(t.doc,r.pos)&&t.join(r.pos),!0},Ja=(t,e)=>{const r=Wi(i=>i.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const s=t.doc.nodeAt(n);return r.node.type===s?.type&&Sr(t.doc,n)&&t.join(n),!0},CF=(t,e,r,n={})=>({editor:s,tr:o,state:i,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:f,splittableMarks:m}=s.extensionManager,g=Ce(t,i.schema),y=Ce(e,i.schema),{selection:v,storedMarks:w}=i,{$from:D,$to:E}=v,N=D.blockRange(E),A=w||v.$to.parentOffset&&v.$from.marks();if(!N)return!1;const T=Wi(j=>ch(j.type.name,f))(v);if(N.depth>=1&&T&&N.depth-T.depth<=1){if(T.node.type===g)return c.liftListItem(y);if(ch(T.node.type.name,f)&&g.validContent(T.node.content)&&a)return l().command(()=>(o.setNodeMarkup(T.pos,g),!0)).command(()=>Ua(o,g)).command(()=>Ja(o,g)).run()}return!r||!A||!a?l().command(()=>d().wrapInList(g,n)?!0:c.clearNodes()).wrapInList(g,n).command(()=>Ua(o,g)).command(()=>Ja(o,g)).run():l().command(()=>{const j=d().wrapInList(g,n),B=A.filter($=>m.includes($.type.name));return o.ensureMarks(B),j?!0:c.clearNodes()}).wrapInList(g,n).command(()=>Ua(o,g)).command(()=>Ja(o,g)).run()},kF=(t,e={},r={})=>({state:n,commands:s})=>{const{extendEmptyMarkRange:o=!1}=r,i=tr(t,n.schema);return jl(n,i,e)?s.unsetMark(i,{extendEmptyMarkRange:o}):s.setMark(i,e)},EF=(t,e,r={})=>({state:n,commands:s})=>{const o=Ce(t,n.schema),i=Ce(e,n.schema),a=Cr(n,o,r);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?s.setNode(i,l):s.setNode(o,{...l,...r})},SF=(t,e={})=>({state:r,commands:n})=>{const s=Ce(t,r.schema);return Cr(r,s,e)?n.lift(s):n.wrapIn(s,e)},FF=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const s=r[n];let o;if(s.spec.isInputRules&&(o=s.getState(t))){if(e){const i=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)i.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else i.delete(o.from,o.to)}return!0}}return!1},AF=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,{empty:n,ranges:s}=r;return n||e&&s.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},NF=(t,e={})=>({tr:r,state:n,dispatch:s})=>{var o;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=r,l=tr(t,n.schema),{$from:c,empty:d,ranges:f}=a;if(!s)return!0;if(d&&i){let{from:m,to:g}=a;const y=(o=c.marks().find(w=>w.type===l))==null?void 0:o.attrs,v=Iu(c,l,y);v&&(m=v.from,g=v.to),r.removeMark(m,g,l)}else f.forEach(m=>{r.removeMark(m.$from.pos,m.$to.pos,l)});return r.removeStoredMark(l),!0},TF=(t,e={})=>({tr:r,state:n,dispatch:s})=>{let o=null,i=null;const a=qi(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(o=Ce(t,n.schema)),a==="mark"&&(i=tr(t,n.schema)),s&&r.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let f,m,g,y;r.selection.empty?n.doc.nodesBetween(c,d,(v,w)=>{o&&o===v.type&&(g=Math.max(w,c),y=Math.min(w+v.nodeSize,d),f=w,m=v)}):n.doc.nodesBetween(c,d,(v,w)=>{w<c&&o&&o===v.type&&(g=Math.max(w,c),y=Math.min(w+v.nodeSize,d),f=w,m=v),w>=c&&w<=d&&(o&&o===v.type&&r.setNodeMarkup(w,void 0,{...v.attrs,...e}),i&&v.marks.length&&v.marks.forEach(D=>{if(i===D.type){const E=Math.max(w,c),N=Math.min(w+v.nodeSize,d);r.addMark(E,N,i.create({...D.attrs,...e}))}}))}),m&&(f!==void 0&&r.setNodeMarkup(f,void 0,{...m.attrs,...e}),i&&m.marks.length&&m.marks.forEach(v=>{i===v.type&&r.addMark(g,y,i.create({...v.attrs,...e}))}))}),!0):!1},MF=(t,e={})=>({state:r,dispatch:n})=>{const s=Ce(t,r.schema);return dk(s,e)(r,n)},BF=(t,e={})=>({state:r,dispatch:n})=>{const s=Ce(t,r.schema);return pk(s,e)(r,n)},jF=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const r=this.callbacks[t];return r&&r.forEach(n=>n.apply(this,e)),this}off(t,e){const r=this.callbacks[t];return r&&(e?this.callbacks[t]=r.filter(n=>n!==e):delete this.callbacks[t]),this}once(t,e){const r=(...n)=>{this.off(t,r),e.apply(this,n)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}},Ji=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},OF=(t,e)=>{if(_u(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function wo(t){var e;const{editor:r,from:n,to:s,text:o,rules:i,plugin:a}=t,{view:l}=r;if(l.composing)return!1;const c=l.state.doc.resolve(n);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(m=>m.type.spec.code))return!1;let d=!1;const f=cF(c)+o;return i.forEach(m=>{if(d)return;const g=OF(f,m.find);if(!g)return;const y=l.state.tr,v=Hi({state:l.state,transaction:y}),w={from:n-(g[0].length-o.length),to:s},{commands:D,chain:E,can:N}=new Vi({editor:r,state:v});m.handler({state:v,range:w,match:g,commands:D,chain:E,can:N})===null||!y.steps.length||(m.undoable&&y.setMeta(a,{transform:y,from:n,to:s,text:o}),l.dispatch(y),d=!0)}),d}function LF(t){const{editor:e,rules:r}=t,n=new be({state:{init(){return null},apply(s,o,i){const a=s.getMeta(n);if(a)return a;const l=s.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=zu(L.from(d),i.schema);const{from:f}=l,m=f+d.length;wo({editor:e,from:f,to:m,text:d,rules:r,plugin:n})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,i,a){return wo({editor:e,from:o,to:i,text:a,rules:r,plugin:n})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&wo({editor:e,from:o.pos,to:o.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(s,o){if(o.key!=="Enter")return!1;const{$cursor:i}=s.state.selection;return i?wo({editor:e,from:i.pos,to:i.pos,text:`
|
|
90
|
+
`,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function _F(t){return Object.prototype.toString.call(t).slice(8,-1)}function Do(t){return _F(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Bg(t,e){const r={...t};return Do(t)&&Do(e)&&Object.keys(e).forEach(n=>{Do(e[n])&&Do(t[n])?r[n]=Bg(t[n],e[n]):r[n]=e[n]}),r}var Vu=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...le(G(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...le(G(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Bg(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Ar=class jg extends Vu{constructor(){super(...arguments),this.type="mark"}static create(e={}){const r=typeof e=="function"?e():e;return new jg(r)}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!!!i.find(c=>c?.type.name===r.name))return!1;const l=i.find(c=>c?.type.name===r.name);return l&&n.removeStoredMark(l),n.insertText(" ",s.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};function IF(t){return typeof t=="number"}var RF=class{constructor(t){this.find=t.find,this.handler=t.handler}},PF=(t,e,r)=>{if(_u(e))return[...t.matchAll(e)];const n=e(t,r);return n?n.map(s=>{const o=[s.text];return o.index=s.index,o.input=t,o.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(s.replaceWith)),o}):[]};function zF(t){const{editor:e,state:r,from:n,to:s,rule:o,pasteEvent:i,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Vi({editor:e,state:r}),f=[];return r.doc.nodesBetween(n,s,(g,y)=>{var v,w,D,E,N;if((w=(v=g.type)==null?void 0:v.spec)!=null&&w.code||!(g.isText||g.isTextblock||g.isInline))return;const A=(N=(E=(D=g.content)==null?void 0:D.size)!=null?E:g.nodeSize)!=null?N:0,T=Math.max(n,y),j=Math.min(s,y+A);if(T>=j)return;const B=g.isText?g.text||"":g.textBetween(T-y,j-y,void 0,"");PF(B,o.find,i).forEach(O=>{if(O.index===void 0)return;const z=T+O.index+1,I=z+O[0].length,q={from:r.tr.mapping.map(z),to:r.tr.mapping.map(I)},J=o.handler({state:r,range:q,match:O,commands:l,chain:c,can:d,pasteEvent:i,dropEvent:a});f.push(J)})}),f.every(g=>g!==null)}var Co=null,$F=t=>{var e;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=r.clipboardData)==null||e.setData("text/html",t),r};function HF(t){const{editor:e,rules:r}=t;let n=null,s=!1,o=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:f,to:m,rule:g,pasteEvt:y})=>{const v=d.tr,w=Hi({state:d,transaction:v});if(!(!zF({editor:e,state:w,from:Math.max(f-1,0),to:m.b-1,rule:g,pasteEvent:y,dropEvent:a})||!v.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return r.map(d=>new be({view(f){const m=y=>{var v;n=(v=f.dom.parentElement)!=null&&v.contains(y.target)?f.dom.parentElement:null,n&&(Co=e)},g=()=>{Co&&(Co=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(f,m)=>{if(o=n===f.dom.parentElement,a=m,!o){const g=Co;g?.isEditable&&setTimeout(()=>{const y=g.state.selection;y&&g.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(f,m)=>{var g;const y=(g=m.clipboardData)==null?void 0:g.getData("text/html");return i=m,s=!!y?.includes("data-pm-slice"),!1}}},appendTransaction:(f,m,g)=>{const y=f[0],v=y.getMeta("uiEvent")==="paste"&&!s,w=y.getMeta("uiEvent")==="drop"&&!o,D=y.getMeta("applyPasteRules"),E=!!D;if(!v&&!w&&!E)return;if(E){let{text:T}=D;typeof T=="string"?T=T:T=zu(L.from(T),g.schema);const{from:j}=D,B=j+T.length,$=$F(T);return l({rule:d,state:g,from:j,to:{b:B},pasteEvt:$})}const N=m.doc.content.findDiffStart(g.doc.content),A=m.doc.content.findDiffEnd(g.doc.content);if(!(!IF(N)||!A||N===A.b))return l({rule:d,state:g,from:N,to:A,pasteEvt:i})}}))}var Ki=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=Sg(t),this.schema=nF(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Wa(e.name,this.schema)},n=G(e,"addCommands",r);return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return $u([...this.extensions].reverse()).flatMap(n=>{const s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Wa(n.name,this.schema)},o=[],i=G(n,"addKeyboardShortcuts",s);let a={};if(n.type==="mark"&&G(n,"exitable",s)&&(a.ArrowRight=()=>Ar.handleExit({editor:t,mark:n})),i){const m=Object.fromEntries(Object.entries(i()).map(([g,y])=>[g,()=>y({editor:t})]));a={...a,...m}}const l=iS(a);o.push(l);const c=G(n,"addInputRules",s);if(uh(n,t.options.enableInputRules)&&c){const m=c();if(m&&m.length){const g=LF({editor:t,rules:m}),y=Array.isArray(g)?g:[g];o.push(...y)}}const d=G(n,"addPasteRules",s);if(uh(n,t.options.enablePasteRules)&&d){const m=d();if(m&&m.length){const g=HF({editor:t,rules:m});o.push(...g)}}const f=G(n,"addProseMirrorPlugins",s);if(f){const m=f();o.push(...m)}return o})}get attributes(){return Eg(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Ls(this.extensions);return Object.fromEntries(e.filter(r=>!!G(r,"addNodeView")).map(r=>{const n=this.attributes.filter(a=>a.type===r.name),s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ce(r.name,this.schema)},o=G(r,"addNodeView",s);if(!o)return[];const i=(a,l,c,d,f)=>{const m=Go(a,n);return o()({node:a,view:l,getPos:c,decorations:d,innerDecorations:f,editor:t,extension:r,HTMLAttributes:m})};return[r.name,i]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Ls(this.extensions);return Object.fromEntries(e.filter(r=>!!G(r,"addMarkView")).map(r=>{const n=this.attributes.filter(a=>a.type===r.name),s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:tr(r.name,this.schema)},o=G(r,"addMarkView",s);if(!o)return[];const i=(a,l,c)=>{const d=Go(a,n);return o()({mark:a,view:l,inline:c,editor:t,extension:r,HTMLAttributes:d,updateAttributes:f=>{rA(a,t,f)}})};return[r.name,i]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var r;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Wa(e.name,this.schema)};e.type==="mark"&&((r=le(G(e,"keepOnSplit",n)))==null||r)&&this.splittableMarks.push(e.name);const s=G(e,"onBeforeCreate",n),o=G(e,"onCreate",n),i=G(e,"onUpdate",n),a=G(e,"onSelectionUpdate",n),l=G(e,"onTransaction",n),c=G(e,"onFocus",n),d=G(e,"onBlur",n),f=G(e,"onDestroy",n);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),i&&this.editor.on("update",i),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};Ki.resolve=Sg;Ki.sort=$u;Ki.flatten=Pu;var VF={};Lu(VF,{ClipboardTextSerializer:()=>Lg,Commands:()=>_g,Delete:()=>Ig,Drop:()=>Rg,Editable:()=>Pg,FocusEvents:()=>$g,Keymap:()=>Hg,Paste:()=>Vg,Tabindex:()=>qg,focusEventsPluginKey:()=>zg});var de=class Og extends Vu{constructor(){super(...arguments),this.type="extension"}static create(e={}){const r=typeof e=="function"?e():e;return new Og(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}},Lg=de.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new be({key:new je("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:s}=e,{ranges:o}=s,i=Math.min(...o.map(d=>d.$from.pos)),a=Math.max(...o.map(d=>d.$to.pos)),l=Ag(r);return Fg(n,{from:i,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),_g=de.create({name:"commands",addCommands(){return{...gg}}}),Ig=de.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var r,n,s;const o=()=>{var i,a,l,c;if((c=(l=(a=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;const d=Cg(t.before,[t,...e]);Tg(d).forEach(g=>{d.mapping.mapResult(g.oldRange.from).deletedAfter&&d.mapping.mapResult(g.oldRange.to).deletedBefore&&d.before.nodesBetween(g.oldRange.from,g.oldRange.to,(y,v)=>{const w=v+y.nodeSize-2,D=g.oldRange.from<=v&&w<=g.oldRange.to;this.editor.emit("delete",{type:"node",node:y,from:v,to:w,newFrom:d.mapping.map(v),newTo:d.mapping.map(w),deletedRange:g.oldRange,newRange:g.newRange,partial:!D,editor:this.editor,transaction:t,combinedTransform:d})})});const m=d.mapping;d.steps.forEach((g,y)=>{var v,w;if(g instanceof wt){const D=m.slice(y).map(g.from,-1),E=m.slice(y).map(g.to),N=m.invert().map(D,-1),A=m.invert().map(E),T=(v=d.doc.nodeAt(D-1))==null?void 0:v.marks.some(B=>B.eq(g.mark)),j=(w=d.doc.nodeAt(E))==null?void 0:w.marks.some(B=>B.eq(g.mark));this.editor.emit("delete",{type:"mark",mark:g.mark,from:g.from,to:g.to,deletedRange:{from:N,to:A},newRange:{from:D,to:E},partial:!!(j||T),editor:this.editor,transaction:t,combinedTransform:d})}})};(s=(n=(r=this.editor.options.coreExtensionOptions)==null?void 0:r.delete)==null?void 0:n.async)==null||s?setTimeout(o,0):o()}}),Rg=de.create({name:"drop",addProseMirrorPlugins(){return[new be({key:new je("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}}),Pg=de.create({name:"editable",addProseMirrorPlugins(){return[new be({key:new je("editable"),props:{editable:()=>this.editor.options.editable}})]}}),zg=new je("focusEvents"),$g=de.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new be({key:zg,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),Hg=de.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:f}=l,{pos:m,parent:g}=f,y=f.parent.isTextblock&&m>0?a.doc.resolve(m-1):f,v=y.parent.type.spec.isolating,w=f.pos-f.parentOffset,D=v&&y.parent.childCount===1?w===f.pos:re.atStart(c).from===m;return!d||!g.type.isTextblock||g.textContent.length||!D||D&&f.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ru()||wg()?o:s},addProseMirrorPlugins(){return[new be({key:new je("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(v=>v.getMeta("composition")))return;const n=t.some(v=>v.docChanged)&&!e.doc.eq(r.doc),s=t.some(v=>v.getMeta("preventClearDocument"));if(!n||s)return;const{empty:o,from:i,to:a}=e.selection,l=re.atStart(e.doc).from,c=re.atEnd(e.doc).to;if(o||!(i===l&&a===c)||!Ui(r.doc))return;const m=r.tr,g=Hi({state:r,transaction:m}),{commands:y}=new Vi({editor:this.editor,state:g});if(y.clearNodes(),!!m.steps.length)return m}})]}}),Vg=de.create({name:"paste",addProseMirrorPlugins(){return[new be({key:new je("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}}),qg=de.create({name:"tabindex",addProseMirrorPlugins(){return[new be({key:new je("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),qF=class vn{constructor(e,r,n=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new vn(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new vn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new vn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((r,n)=>{const s=r.isBlock&&!r.isTextblock,o=r.isAtom&&!r.isText,i=this.pos+n+(o?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(i);if(!s&&a.depth<=this.depth)return;const l=new vn(a,this.editor,s,s?r:null);s&&(l.actualDepth=this.depth+1),e.push(new vn(a,this.editor,s,s?r:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,s=this.parent;for(;s&&!n;){if(s.node.type.name===e)if(Object.keys(r).length>0){const o=s.node.attrs,i=Object.keys(r);for(let a=0;a<i.length;a+=1){const l=i[a];if(o[l]!==r[l])break}}else n=s;s=s.parent}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let s=[];if(!this.children||this.children.length===0)return s;const o=Object.keys(r);return this.children.forEach(i=>{n&&s.length>0||(i.node.type.name===e&&o.every(l=>r[l]===i.node.attrs[l])&&s.push(i),!(n&&s.length>0)&&(s=s.concat(i.querySelectorAll(e,r,n))))}),s}setAttribute(e){const{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(r)}},WF=`.ProseMirror {
|
|
91
|
+
position: relative;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ProseMirror {
|
|
95
|
+
word-wrap: break-word;
|
|
96
|
+
white-space: pre-wrap;
|
|
97
|
+
white-space: break-spaces;
|
|
98
|
+
-webkit-font-variant-ligatures: none;
|
|
99
|
+
font-variant-ligatures: none;
|
|
100
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ProseMirror [contenteditable="false"] {
|
|
104
|
+
white-space: normal;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
108
|
+
white-space: pre-wrap;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ProseMirror pre {
|
|
112
|
+
white-space: pre-wrap;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
img.ProseMirror-separator {
|
|
116
|
+
display: inline !important;
|
|
117
|
+
border: none !important;
|
|
118
|
+
margin: 0 !important;
|
|
119
|
+
width: 0 !important;
|
|
120
|
+
height: 0 !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ProseMirror-gapcursor {
|
|
124
|
+
display: none;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
position: absolute;
|
|
127
|
+
margin: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ProseMirror-gapcursor:after {
|
|
131
|
+
content: "";
|
|
132
|
+
display: block;
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: -2px;
|
|
135
|
+
width: 20px;
|
|
136
|
+
border-top: 1px solid black;
|
|
137
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@keyframes ProseMirror-cursor-blink {
|
|
141
|
+
to {
|
|
142
|
+
visibility: hidden;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ProseMirror-hideselection *::selection {
|
|
147
|
+
background: transparent;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
151
|
+
background: transparent;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.ProseMirror-hideselection * {
|
|
155
|
+
caret-color: transparent;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
159
|
+
display: block;
|
|
160
|
+
}`;function UF(t,e,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}var JF=class extends jF{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:s,moved:o})=>this.options.onDrop(n,s,o)),this.on("paste",({event:n,slice:s})=>this.options.onPaste(n,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),r=xg(e,this.options.autofocus);this.editorState=kn.create({doc:e,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=UF(WF,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const r=kg(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let r=e;if([].concat(t).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;r=r.filter(i=>!i.key.startsWith(o))}),e.length===r.length)return;const n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[Pg,Lg.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),_g,$g,Hg,qg,Rg,Vg,Ig].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new Ki(n,this)}createCommandManager(){this.commandManager=new Vi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Bl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),t=Bl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new fg(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.prependClass(),this.injectCSS();const n=this.view.dom;n.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(c)});return}const{state:e,transactions:r}=this.state.applyTransaction(t),n=!this.state.selection.eq(e.selection),s=r.includes(t),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:r.slice(1)}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=r.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=i?.getMeta("focus"),l=i?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:i}),l&&this.emit("blur",{editor:this,event:l.event,transaction:i}),!(t.getMeta("preventUpdate")||!r.some(c=>c.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:r.slice(1)})}getAttributes(t){return Ng(this.state,t)}isActive(t,e){const r=typeof t=="string"?t:null,n=typeof t=="string"?e:t;return dF(this.state,r,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return zu(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
161
|
+
|
|
162
|
+
`,textSerializers:r={}}=t||{};return oF(this.state.doc,{blockSeparator:e,textSerializers:{...Ag(this.schema),...r}})}get isEmpty(){return Ui(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var r;return((r=this.$doc)==null?void 0:r.querySelector(t,e))||null}$nodes(t,e){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new qF(e,this)}get $doc(){return this.$pos(0)}};function jn(t){return new Ji({find:t.find,handler:({state:e,range:r,match:n})=>{const s=le(t.getAttributes,void 0,n);if(s===!1||s===null)return null;const{tr:o}=e,i=n[n.length-1],a=n[0];if(i){const l=a.search(/\S/),c=r.from+a.indexOf(i),d=c+i.length;if(Hu(r.from,r.to,e.doc).filter(g=>g.mark.type.excluded.find(v=>v===t.type&&v!==g.mark.type)).filter(g=>g.to>c).length)return null;d<r.to&&o.delete(d,r.to),c>r.from&&o.delete(r.from+l,c);const m=r.from+l+i.length;o.addMark(r.from+l,m,t.type.create(s||{})),o.removeStoredMark(t.type)}},undoable:t.undoable})}function KF(t){return new Ji({find:t.find,handler:({state:e,range:r,match:n})=>{const s=le(t.getAttributes,void 0,n)||{},{tr:o}=e,i=r.from;let a=r.to;const l=t.type.create(s);if(n[1]){const c=n[0].lastIndexOf(n[1]);let d=i+c;d>a?d=a:a=d+n[1].length;const f=n[0][n[0].length-1];o.insertText(f,i+n[0].length-1),o.replaceWith(d,a,l)}else if(n[0]){const c=t.type.isInline?i:i-1;o.insert(c,t.type.create(s)).delete(o.mapping.map(i),o.mapping.map(a))}o.scrollIntoView()},undoable:t.undoable})}function Ol(t){return new Ji({find:t.find,handler:({state:e,range:r,match:n})=>{const s=e.doc.resolve(r.from),o=le(t.getAttributes,void 0,n)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,o)},undoable:t.undoable})}function On(t){return new Ji({find:t.find,handler:({state:e,range:r,match:n,chain:s})=>{const o=le(t.getAttributes,void 0,n)||{},i=e.tr.delete(r.from,r.to),l=i.doc.resolve(r.from).blockRange(),c=l&&xu(l,t.type,o);if(!c)return null;if(i.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:m}=e,{splittableMarks:g}=t.editor.extensionManager,y=m||f.$to.parentOffset&&f.$from.marks();if(y){const v=y.filter(w=>g.includes(w.type.name));i.ensureMarks(v)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(f,o).run()}const d=i.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&Sr(i.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,d))&&i.join(r.from-1)},undoable:t.undoable})}function GF(t,e){const{selection:r}=t,{$from:n}=r;if(r instanceof Y){const o=n.index();return n.parent.canReplaceWith(o,o+1,e)}let s=n.depth;for(;s>=0;){const o=n.index(s);if(n.node(s).contentMatchAt(o).matchType(e))return!0;s-=1}return!1}var YF={};Lu(YF,{createAtomBlockMarkdownSpec:()=>XF,createBlockMarkdownSpec:()=>QF,createInlineMarkdownSpec:()=>tA,parseAttributes:()=>qu,parseIndentedBlocks:()=>Ll,renderNestedMarkdownContent:()=>Uu,serializeAttributes:()=>Wu});function qu(t){if(!t?.trim())return{};const e={},r=[],n=t.replace(/["']([^"']*)["']/g,c=>(r.push(c),`__QUOTED_${r.length-1}__`)),s=n.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(d=>d.trim().slice(1));e.class=c.join(" ")}const o=n.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const i=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(n.matchAll(i)).forEach(([,c,d])=>{var f;const m=parseInt(((f=d.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),g=r[m];g&&(e[c]=g.slice(1,-1))});const l=n.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function Wu(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([r,n])=>{r==="class"||r==="id"||(n===!0?e.push(r):n!==!1&&n!=null&&e.push(`${r}="${String(n)}"`))}),e.join(" ")}function XF(t){const{nodeName:e,name:r,parseAttributes:n=qu,serializeAttributes:s=Wu,defaultAttributes:o={},requiredAttributes:i=[],allowedAttributes:a}=t,l=r||e,c=d=>{if(!a)return d;const f={};return a.forEach(m=>{m in d&&(f[m]=d[m])}),f};return{parseMarkdown:(d,f)=>{const m={...o,...d.attributes};return f.createNode(e,m,[])},markdownTokenizer:{name:e,level:"block",start(d){var f;const m=new RegExp(`^:::${l}(?:\\s|$)`,"m"),g=(f=d.match(m))==null?void 0:f.index;return g!==void 0?g:-1},tokenize(d,f,m){const g=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),y=d.match(g);if(!y)return;const v=y[1]||"",w=n(v);if(!i.find(E=>!(E in w)))return{type:e,raw:y[0],attributes:w}}},renderMarkdown:d=>{const f=c(d.attrs||{}),m=s(f),g=m?` {${m}}`:"";return`:::${l}${g} :::`}}}function QF(t){const{nodeName:e,name:r,getContent:n,parseAttributes:s=qu,serializeAttributes:o=Wu,defaultAttributes:i={},content:a="block",allowedAttributes:l}=t,c=r||e,d=f=>{if(!l)return f;const m={};return l.forEach(g=>{g in f&&(m[g]=f[g])}),m};return{parseMarkdown:(f,m)=>{let g;if(n){const v=n(f);g=typeof v=="string"?[{type:"text",text:v}]:v}else a==="block"?g=m.parseChildren(f.tokens||[]):g=m.parseInline(f.tokens||[]);const y={...i,...f.attributes};return m.createNode(e,y,g)},markdownTokenizer:{name:e,level:"block",start(f){var m;const g=new RegExp(`^:::${c}`,"m"),y=(m=f.match(g))==null?void 0:m.index;return y!==void 0?y:-1},tokenize(f,m,g){var y;const v=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),w=f.match(v);if(!w)return;const[D,E=""]=w,N=s(E);let A=1;const T=D.length;let j="";const B=/^:::([\w-]*)(\s.*)?/gm,$=f.slice(T);for(B.lastIndex=0;;){const O=B.exec($);if(O===null)break;const z=O.index,I=O[1];if(!((y=O[2])!=null&&y.endsWith(":::"))){if(I)A+=1;else if(A-=1,A===0){const q=$.slice(0,z);j=q.trim();const J=f.slice(0,T+z+O[0].length);let K=[];if(j)if(a==="block")for(K=g.blockTokens(q),K.forEach(ae=>{ae.text&&(!ae.tokens||ae.tokens.length===0)&&(ae.tokens=g.inlineTokens(ae.text))});K.length>0;){const ae=K[K.length-1];if(ae.type==="paragraph"&&(!ae.text||ae.text.trim()===""))K.pop();else break}else K=g.inlineTokens(j);return{type:e,raw:J,attributes:N,content:j,tokens:K}}}}}},renderMarkdown:(f,m)=>{const g=d(f.attrs||{}),y=o(g),v=y?` {${y}}`:"",w=m.renderChildren(f.content||[],`
|
|
163
|
+
|
|
164
|
+
`);return`:::${c}${v}
|
|
165
|
+
|
|
166
|
+
${w}
|
|
167
|
+
|
|
168
|
+
:::`}}}function ZF(t){if(!t.trim())return{};const e={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(t);for(;n!==null;){const[,s,o,i]=n;e[s]=o||i,n=r.exec(t)}return e}function eA(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,r])=>`${e}="${r}"`).join(" ")}function tA(t){const{nodeName:e,name:r,getContent:n,parseAttributes:s=ZF,serializeAttributes:o=eA,defaultAttributes:i={},selfClosing:a=!1,allowedAttributes:l}=t,c=r||e,d=m=>{if(!l)return m;const g={};return l.forEach(y=>{y in m&&(g[y]=m[y])}),g},f=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,g)=>{const y={...i,...m.attributes};if(a)return g.createNode(e,y);const v=n?n(m):m.content||"";return v?g.createNode(e,y,[g.createTextNode(v)]):g.createNode(e,y,[])},markdownTokenizer:{name:e,level:"inline",start(m){const g=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),y=m.match(g),v=y?.index;return v!==void 0?v:-1},tokenize(m,g,y){const v=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),w=m.match(v);if(!w)return;let D="",E="";if(a){const[,A]=w;E=A}else{const[,A,T]=w;E=A,D=T||""}const N=s(E.trim());return{type:e,raw:w[0],content:D.trim(),attributes:N}}},renderMarkdown:m=>{let g="";n?g=n(m):m.content&&m.content.length>0&&(g=m.content.filter(D=>D.type==="text").map(D=>D.text).join(""));const y=d(m.attrs||{}),v=o(y),w=v?` ${v}`:"";return a?`[${c}${w}]`:`[${c}${w}]${g}[/${c}]`}}}function Ll(t,e,r){var n,s,o,i;const a=t.split(`
|
|
169
|
+
`),l=[];let c="",d=0;const f=e.baseIndentSize||2;for(;d<a.length;){const m=a[d],g=m.match(e.itemPattern);if(!g){if(l.length>0)break;if(m.trim()===""){d+=1;continue}else return}const y=e.extractItemData(g),{indentLevel:v,mainContent:w}=y;c=`${c}${m}
|
|
170
|
+
`;const D=[w];for(d+=1;d<a.length;){const T=a[d];if(T.trim()===""){const B=a.slice(d+1).findIndex(z=>z.trim()!=="");if(B===-1)break;if((((s=(n=a[d+1+B].match(/^(\s*)/))==null?void 0:n[1])==null?void 0:s.length)||0)>v){D.push(T),c=`${c}${T}
|
|
171
|
+
`,d+=1;continue}else break}if((((i=(o=T.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:i.length)||0)>v)D.push(T),c=`${c}${T}
|
|
172
|
+
`,d+=1;else break}let E;const N=D.slice(1);if(N.length>0){const T=N.map(j=>j.slice(v+f)).join(`
|
|
173
|
+
`);T.trim()&&(e.customNestedParser?E=e.customNestedParser(T):E=r.blockTokens(T))}const A=e.createToken(y,E);l.push(A)}if(l.length!==0)return{items:l,raw:c.trim()}}function Uu(t,e,r,n){if(!t||!Array.isArray(t.content))return"";const s=typeof r=="function"?r(n):r,[o,...i]=t.content,a=e.renderChildren([o]),l=[`${s}${a}`];return i&&i.length>0&&i.forEach(c=>{const d=e.renderChildren([c]);if(d){const f=d.split(`
|
|
174
|
+
`).map(m=>m?e.indent(m):"").join(`
|
|
175
|
+
`);l.push(f)}}),l.join(`
|
|
176
|
+
`)}function rA(t,e,r={}){const{state:n}=e,{doc:s,tr:o}=n,i=t;s.descendants((a,l)=>{const c=o.mapping.map(l),d=o.mapping.map(l)+a.nodeSize;let f=null;if(a.marks.forEach(g=>{if(g!==i)return!1;f=g}),!f)return;let m=!1;if(Object.keys(r).forEach(g=>{r[g]!==f.attrs[g]&&(m=!0)}),m){const g=t.type.create({...t.attrs,...r});o.removeMark(c,d,t.type),o.addMark(c,d,g)}}),o.docChanged&&e.view.dispatch(o)}var ot=class Wg extends Vu{constructor(){super(...arguments),this.type="node"}static create(e={}){const r=typeof e=="function"?e():e;return new Wg(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};function rn(t){return new RF({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:s})=>{const o=le(t.getAttributes,void 0,n,s);if(o===!1||o===null)return null;const{tr:i}=e,a=n[n.length-1],l=n[0];let c=r.to;if(a){const d=l.search(/\S/),f=r.from+l.indexOf(a),m=f+a.length;if(Hu(r.from,r.to,e.doc).filter(y=>y.mark.type.excluded.find(w=>w===t.type&&w!==y.mark.type)).filter(y=>y.to>f).length)return null;m<r.to&&i.delete(m,r.to),f>r.from&&i.delete(r.from+d,f),c=r.from+d+a.length,i.addMark(r.from+d,c,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}var Ug=ot.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ye(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
177
|
+
`},renderMarkdown:(t,e)=>e.indent(`
|
|
178
|
+
`),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:o}=r;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=n.extensionManager,l=o||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&i){const f=l.filter(m=>a.includes(m.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),nA=Ug;const sA="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",oA="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",_l="numeric",Il="ascii",Rl="alpha",ws="asciinumeric",hs="alphanumeric",Pl="domain",Jg="emoji",iA="scheme",aA="slashscheme",Ka="whitespace";function lA(t,e){return t in e||(e[t]=[]),e[t]}function qr(t,e,r){e[_l]&&(e[ws]=!0,e[hs]=!0),e[Il]&&(e[ws]=!0,e[Rl]=!0),e[ws]&&(e[hs]=!0),e[Rl]&&(e[hs]=!0),e[hs]&&(e[Pl]=!0),e[Jg]&&(e[Pl]=!0);for(const n in e){const s=lA(n,r);s.indexOf(t)<0&&s.push(t)}}function uA(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function Qe(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Qe.groups={};Qe.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const s=e.jr[n][0],o=e.jr[n][1];if(o&&s.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let s=0;s<t.length;s++)this.tt(t[s],e,r,n)},tr(t,e,r,n){n=n||Qe.groups;let s;return e&&e.j?s=e:(s=new Qe(e),r&&n&&qr(e,r,n)),this.jr.push([t,s]),s},ts(t,e,r,n){let s=this;const o=t.length;if(!o)return s;for(let i=0;i<o-1;i++)s=s.tt(t[i]);return s.tt(t[o-1],e,r,n)},tt(t,e,r,n){n=n||Qe.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const o=e;let i,a=s.go(t);if(a?(i=new Qe,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new Qe,o){if(n)if(i.t&&typeof i.t=="string"){const l=Object.assign(uA(i.t,n),r);qr(o,l,n)}else r&&qr(o,r,n);i.t=o}return s.j[t]=i,i}};const te=(t,e,r,n,s)=>t.ta(e,r,n,s),me=(t,e,r,n,s)=>t.tr(e,r,n,s),ph=(t,e,r,n,s)=>t.ts(e,r,n,s),R=(t,e,r,n,s)=>t.tt(e,r,n,s),Vt="WORD",zl="UWORD",Kg="ASCIINUMERICAL",Gg="ALPHANUMERICAL",_s="LOCALHOST",$l="TLD",Hl="UTLD",Oo="SCHEME",wn="SLASH_SCHEME",Ju="NUM",Vl="WS",Ku="NL",Ds="OPENBRACE",Cs="CLOSEBRACE",Yo="OPENBRACKET",Xo="CLOSEBRACKET",Qo="OPENPAREN",Zo="CLOSEPAREN",ei="OPENANGLEBRACKET",ti="CLOSEANGLEBRACKET",ri="FULLWIDTHLEFTPAREN",ni="FULLWIDTHRIGHTPAREN",si="LEFTCORNERBRACKET",oi="RIGHTCORNERBRACKET",ii="LEFTWHITECORNERBRACKET",ai="RIGHTWHITECORNERBRACKET",li="FULLWIDTHLESSTHAN",ui="FULLWIDTHGREATERTHAN",ci="AMPERSAND",di="APOSTROPHE",pi="ASTERISK",ur="AT",hi="BACKSLASH",fi="BACKTICK",mi="CARET",pr="COLON",Gu="COMMA",gi="DOLLAR",Ft="DOT",bi="EQUALS",Yu="EXCLAMATION",lt="HYPHEN",ks="PERCENT",yi="PIPE",xi="PLUS",vi="POUND",Es="QUERY",Xu="QUOTE",Yg="FULLWIDTHMIDDLEDOT",Qu="SEMI",At="SLASH",Ss="TILDE",wi="UNDERSCORE",Xg="EMOJI",Di="SYM";var Qg=Object.freeze({__proto__:null,ALPHANUMERICAL:Gg,AMPERSAND:ci,APOSTROPHE:di,ASCIINUMERICAL:Kg,ASTERISK:pi,AT:ur,BACKSLASH:hi,BACKTICK:fi,CARET:mi,CLOSEANGLEBRACKET:ti,CLOSEBRACE:Cs,CLOSEBRACKET:Xo,CLOSEPAREN:Zo,COLON:pr,COMMA:Gu,DOLLAR:gi,DOT:Ft,EMOJI:Xg,EQUALS:bi,EXCLAMATION:Yu,FULLWIDTHGREATERTHAN:ui,FULLWIDTHLEFTPAREN:ri,FULLWIDTHLESSTHAN:li,FULLWIDTHMIDDLEDOT:Yg,FULLWIDTHRIGHTPAREN:ni,HYPHEN:lt,LEFTCORNERBRACKET:si,LEFTWHITECORNERBRACKET:ii,LOCALHOST:_s,NL:Ku,NUM:Ju,OPENANGLEBRACKET:ei,OPENBRACE:Ds,OPENBRACKET:Yo,OPENPAREN:Qo,PERCENT:ks,PIPE:yi,PLUS:xi,POUND:vi,QUERY:Es,QUOTE:Xu,RIGHTCORNERBRACKET:oi,RIGHTWHITECORNERBRACKET:ai,SCHEME:Oo,SEMI:Qu,SLASH:At,SLASH_SCHEME:wn,SYM:Di,TILDE:Ss,TLD:$l,UNDERSCORE:wi,UTLD:Hl,UWORD:zl,WORD:Vt,WS:Vl});const zt=/[a-z]/,as=/\p{L}/u,Ga=/\p{Emoji}/u,$t=/\d/,Ya=/\s/,hh="\r",Xa=`
|
|
179
|
+
`,cA="️",dA="",Qa="";let ko=null,Eo=null;function pA(t=[]){const e={};Qe.groups=e;const r=new Qe;ko==null&&(ko=fh(sA)),Eo==null&&(Eo=fh(oA)),R(r,"'",di),R(r,"{",Ds),R(r,"}",Cs),R(r,"[",Yo),R(r,"]",Xo),R(r,"(",Qo),R(r,")",Zo),R(r,"<",ei),R(r,">",ti),R(r,"(",ri),R(r,")",ni),R(r,"「",si),R(r,"」",oi),R(r,"『",ii),R(r,"』",ai),R(r,"<",li),R(r,">",ui),R(r,"&",ci),R(r,"*",pi),R(r,"@",ur),R(r,"`",fi),R(r,"^",mi),R(r,":",pr),R(r,",",Gu),R(r,"$",gi),R(r,".",Ft),R(r,"=",bi),R(r,"!",Yu),R(r,"-",lt),R(r,"%",ks),R(r,"|",yi),R(r,"+",xi),R(r,"#",vi),R(r,"?",Es),R(r,'"',Xu),R(r,"/",At),R(r,";",Qu),R(r,"~",Ss),R(r,"_",wi),R(r,"\\",hi),R(r,"・",Yg);const n=me(r,$t,Ju,{[_l]:!0});me(n,$t,n);const s=me(n,zt,Kg,{[ws]:!0}),o=me(n,as,Gg,{[hs]:!0}),i=me(r,zt,Vt,{[Il]:!0});me(i,$t,s),me(i,zt,i),me(s,$t,s),me(s,zt,s);const a=me(r,as,zl,{[Rl]:!0});me(a,zt),me(a,$t,o),me(a,as,a),me(o,$t,o),me(o,zt),me(o,as,o);const l=R(r,Xa,Ku,{[Ka]:!0}),c=R(r,hh,Vl,{[Ka]:!0}),d=me(r,Ya,Vl,{[Ka]:!0});R(r,Qa,d),R(c,Xa,l),R(c,Qa,d),me(c,Ya,d),R(d,hh),R(d,Xa),me(d,Ya,d),R(d,Qa,d);const f=me(r,Ga,Xg,{[Jg]:!0});R(f,"#"),me(f,Ga,f),R(f,cA,f);const m=R(f,dA);R(m,"#"),me(m,Ga,f);const g=[[zt,i],[$t,s]],y=[[zt,null],[as,a],[$t,o]];for(let v=0;v<ko.length;v++)sr(r,ko[v],$l,Vt,g);for(let v=0;v<Eo.length;v++)sr(r,Eo[v],Hl,zl,y);qr($l,{tld:!0,ascii:!0},e),qr(Hl,{utld:!0,alpha:!0},e),sr(r,"file",Oo,Vt,g),sr(r,"mailto",Oo,Vt,g),sr(r,"http",wn,Vt,g),sr(r,"https",wn,Vt,g),sr(r,"ftp",wn,Vt,g),sr(r,"ftps",wn,Vt,g),qr(Oo,{scheme:!0,ascii:!0},e),qr(wn,{slashscheme:!0,ascii:!0},e),t=t.sort((v,w)=>v[0]>w[0]?1:-1);for(let v=0;v<t.length;v++){const w=t[v][0],E=t[v][1]?{[iA]:!0}:{[aA]:!0};w.indexOf("-")>=0?E[Pl]=!0:zt.test(w)?$t.test(w)?E[ws]=!0:E[Il]=!0:E[_l]=!0,ph(r,w,w,E)}return ph(r,"localhost",_s,{ascii:!0}),r.jd=new Qe(Di),{start:r,tokens:Object.assign({groups:e},Qg)}}function Zg(t,e){const r=hA(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=r.length,s=[];let o=0,i=0;for(;i<n;){let a=t,l=null,c=0,d=null,f=-1,m=-1;for(;i<n&&(l=a.go(r[i]));)a=l,a.accepts()?(f=0,m=0,d=a):f>=0&&(f+=r[i].length,m++),c+=r[i].length,o+=r[i].length,i++;o-=f,i-=m,c-=f,s.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return s}function hA(t){const e=[],r=t.length;let n=0;for(;n<r;){let s=t.charCodeAt(n),o,i=s<55296||s>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?t[n]:t.slice(n,n+2);e.push(i),n+=i.length}return e}function sr(t,e,r,n,s){let o;const i=e.length;for(let a=0;a<i-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Qe(n),o.jr=s.slice(),t.j[l]=o),t=o}return o=new Qe(r),o.jr=s.slice(),t.j[e[i-1]]=o,o}function fh(t){const e=[],r=[];let n=0,s="0123456789";for(;n<t.length;){let o=0;for(;s.indexOf(t[n+o])>=0;)o++;if(o>0){e.push(r.join(""));for(let i=parseInt(t.substring(n,n+o),10);i>0;i--)r.pop();n+=o}else r.push(t[n]),n++}return e}const Is={defaultProtocol:"http",events:null,format:mh,formatHref:mh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Zu(t,e=null){let r=Object.assign({},Is);t&&(r=Object.assign(r,t instanceof Zu?t.o:t));const n=r.ignoreTags,s=[];for(let o=0;o<n.length;o++)s.push(n[o].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=s}Zu.prototype={o:Is,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=r.t in s?s[r.t]:Is[t],typeof s=="function"&&n&&(s=s(e,r))):typeof s=="function"&&n&&(s=s(e,r.t,r)),s)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function mh(t){return t}function e0(t,e){this.t="token",this.v=t,this.tk=e}e0.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Is.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),s=t.get("tagName",r,e),o=this.toFormattedString(t),i={},a=t.get("className",r,e),l=t.get("target",r,e),c=t.get("rel",r,e),d=t.getObj("attributes",r,e),f=t.getObj("events",r,e);return i.href=n,a&&(i.class=a),l&&(i.target=l),c&&(i.rel=c),d&&Object.assign(i,d),{tagName:s,attributes:i,content:o,eventListeners:f}}};function Gi(t,e){class r extends e0{constructor(s,o){super(s,o),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const gh=Gi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),bh=Gi("text"),fA=Gi("nl"),So=Gi("url",{isLink:!0,toHref(t=Is.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_s&&t[1].t===pr}}),at=t=>new Qe(t);function mA({groups:t}){const e=t.domain.concat([ci,pi,ur,hi,fi,mi,gi,bi,lt,Ju,ks,yi,xi,vi,At,Di,Ss,wi]),r=[di,pr,Gu,Ft,Yu,ks,Es,Xu,Qu,ei,ti,Ds,Cs,Xo,Yo,Qo,Zo,ri,ni,si,oi,ii,ai,li,ui],n=[ci,di,pi,hi,fi,mi,gi,bi,lt,Ds,Cs,ks,yi,xi,vi,Es,At,Di,Ss,wi],s=at(),o=R(s,Ss);te(o,n,o),te(o,t.domain,o);const i=at(),a=at(),l=at();te(s,t.domain,i),te(s,t.scheme,a),te(s,t.slashscheme,l),te(i,n,o),te(i,t.domain,i);const c=R(i,ur);R(o,ur,c),R(a,ur,c),R(l,ur,c);const d=R(o,Ft);te(d,n,o),te(d,t.domain,o);const f=at();te(c,t.domain,f),te(f,t.domain,f);const m=R(f,Ft);te(m,t.domain,f);const g=at(gh);te(m,t.tld,g),te(m,t.utld,g),R(c,_s,g);const y=R(f,lt);R(y,lt,y),te(y,t.domain,f),te(g,t.domain,f),R(g,Ft,m),R(g,lt,y);const v=R(g,pr);te(v,t.numeric,gh);const w=R(i,lt),D=R(i,Ft);R(w,lt,w),te(w,t.domain,i),te(D,n,o),te(D,t.domain,i);const E=at(So);te(D,t.tld,E),te(D,t.utld,E),te(E,t.domain,i),te(E,n,o),R(E,Ft,D),R(E,lt,w),R(E,ur,c);const N=R(E,pr),A=at(So);te(N,t.numeric,A);const T=at(So),j=at();te(T,e,T),te(T,r,j),te(j,e,T),te(j,r,j),R(E,At,T),R(A,At,T);const B=R(a,pr),$=R(l,pr),O=R($,At),z=R(O,At);te(a,t.domain,i),R(a,Ft,D),R(a,lt,w),te(l,t.domain,i),R(l,Ft,D),R(l,lt,w),te(B,t.domain,T),R(B,At,T),R(B,Es,T),te(z,t.domain,T),te(z,e,T),R(z,At,T);const I=[[Ds,Cs],[Yo,Xo],[Qo,Zo],[ei,ti],[ri,ni],[si,oi],[ii,ai],[li,ui]];for(let q=0;q<I.length;q++){const[J,K]=I[q],ae=R(T,J);R(j,J,ae),R(ae,K,T);const tt=at(So);te(ae,e,tt);const ft=at();te(ae,r),te(tt,e,tt),te(tt,r,ft),te(ft,e,tt),te(ft,r,ft),R(tt,K,T),R(ft,K,T)}return R(s,_s,E),R(s,Ku,fA),{start:s,tokens:Qg}}function gA(t,e,r){let n=r.length,s=0,o=[],i=[];for(;s<n;){let a=t,l=null,c=null,d=0,f=null,m=-1;for(;s<n&&!(l=a.go(r[s].t));)i.push(r[s++]);for(;s<n&&(c=l||a.go(r[s].t));)l=null,a=c,a.accepts()?(m=0,f=a):m>=0&&m++,s++,d++;if(m<0)s-=d,s<n&&(i.push(r[s]),s++);else{i.length>0&&(o.push(Za(bh,e,i)),i=[]),s-=m,d-=m;const g=f.t,y=r.slice(s-d,s);o.push(Za(g,e,y))}}return i.length>0&&o.push(Za(bh,e,i)),o}function Za(t,e,r){const n=r[0].s,s=r[r.length-1].e,o=e.slice(n,s);return new t(o,r)}const bA=typeof console<"u"&&console&&console.warn||(()=>{}),yA="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",pe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xA(){return Qe.groups={},pe.scanner=null,pe.parser=null,pe.tokenQueue=[],pe.pluginQueue=[],pe.customSchemes=[],pe.initialized=!1,pe}function yh(t,e=!1){if(pe.initialized&&bA(`linkifyjs: already initialized - will not register custom scheme "${t}" ${yA}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
180
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
181
|
+
2. Cannot start or end with "-"
|
|
182
|
+
3. "-" cannot repeat`);pe.customSchemes.push([t,e])}function vA(){pe.scanner=pA(pe.customSchemes);for(let t=0;t<pe.tokenQueue.length;t++)pe.tokenQueue[t][1]({scanner:pe.scanner});pe.parser=mA(pe.scanner.tokens);for(let t=0;t<pe.pluginQueue.length;t++)pe.pluginQueue[t][1]({scanner:pe.scanner,parser:pe.parser});return pe.initialized=!0,pe}function ec(t){return pe.initialized||vA(),gA(pe.parser.start,t,Zg(pe.scanner.start,t))}ec.scan=Zg;function t0(t,e=null,r=null){if(e&&typeof e=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);r=e,e=null}const n=new Zu(r),s=ec(t),o=[];for(let i=0;i<s.length;i++){const a=s[i];a.isLink&&(!e||a.t===e)&&n.check(a)&&o.push(a.toFormattedObject(n))}return o}var tc="[\0- -\u2029 ]",wA=new RegExp(tc),DA=new RegExp(`${tc}$`),CA=new RegExp(tc,"g");function kA(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function EA(t){return new be({key:new je("autolink"),appendTransaction:(e,r,n)=>{const s=e.some(c=>c.docChanged)&&!r.doc.eq(n.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!s||o)return;const{tr:i}=n,a=Cg(r.doc,[...e]);if(Tg(a).forEach(({newRange:c})=>{const d=ZS(n.doc,c,g=>g.isTextblock);let f,m;if(d.length>1)f=d[0],m=n.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const g=n.doc.textBetween(c.from,c.to," "," ");if(!DA.test(g))return;f=d[0],m=n.doc.textBetween(f.pos,c.to,void 0," ")}if(f&&m){const g=m.split(wA).filter(Boolean);if(g.length<=0)return!1;const y=g[g.length-1],v=f.pos+m.lastIndexOf(y);if(!y)return!1;const w=ec(y).map(D=>D.toObject(t.defaultProtocol));if(!kA(w))return!1;w.filter(D=>D.isLink).map(D=>({...D,from:v+D.start+1,to:v+D.end+1})).filter(D=>n.schema.marks.code?!n.doc.rangeHasMark(D.from,D.to,n.schema.marks.code):!0).filter(D=>t.validate(D.value)).filter(D=>t.shouldAutoLink(D.value)).forEach(D=>{Hu(D.from,D.to,n.doc).some(E=>E.mark.type===t.type)||i.addMark(D.from,D.to,t.type.create({href:D.href}))})}}),!!i.steps.length)return i}})}function SA(t){return new be({key:new je("handleClickLink"),props:{handleClick:(e,r,n)=>{var s,o;if(n.button!==0||!e.editable)return!1;let i=null;if(n.target instanceof HTMLAnchorElement)i=n.target;else{let d=n.target;const f=[];for(;d.nodeName!=="DIV";)f.push(d),d=d.parentNode;i=f.find(m=>m.nodeName==="A")}if(!i)return!1;const a=Ng(e.state,t.type.name),l=(s=i?.href)!=null?s:a.href,c=(o=i?.target)!=null?o:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),i&&l?(window.open(l,c),!0):!1}}})}function FA(t){return new be({key:new je("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:s}=t,{state:o}=e,{selection:i}=o,{empty:a}=i;if(a)return!1;let l="";n.content.forEach(d=>{l+=d.textContent});const c=t0(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||s!==void 0&&!s(c.href)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function Or(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const s=typeof n=="string"?n:n.scheme;s&&r.push(s)}),!t||t.replace(CA,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var r0=Ar.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){yh(t);return}yh(t.scheme,t.optionalSlashes)})},onDestroy(){xA()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Or(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!Or(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Or(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ye(this.options.HTMLAttributes,t),0]:["a",ye(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var r;const n=((r=t.attrs)==null?void 0:r.href)||"";return`[${e.renderChildren(t)}](${n})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!Or(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!Or(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[rn({find:t=>{const e=[];if(t){const{protocols:r,defaultProtocol:n}=this.options,s=t0(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!Or(i,r),protocols:r,defaultProtocol:n}));s.length&&s.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(EA({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:s=>!!Or(s,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(SA({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(FA({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),AA=r0,NA=20,n0=(t,e=0)=>{const r=[];return!t.children.length||e>NA||Array.from(t.children).forEach(n=>{n.tagName==="SPAN"?r.push(n):n.children.length&&r.push(...n0(n,e+1))}),r},TA=t=>{if(!t.children.length)return;const e=n0(t);e&&e.forEach(r=>{var n,s;const o=r.getAttribute("style"),i=(s=(n=r.parentElement)==null?void 0:n.closest("span"))==null?void 0:s.getAttribute("style");r.setAttribute("style",`${i};${o}`)})},MA=Ar.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&TA(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(r,n)=>{if(r.isTextblock)return!0;r.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(o=>!!o))||t.removeMark(n,n+r.nodeSize,this.type)}),!0}}}}),BA=de.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const n=r.split(";").map(s=>s.trim()).filter(Boolean);for(let s=n.length-1;s>=0;s-=1){const o=n[s].split(":");if(o.length>=2){const i=o[0].trim().toLowerCase(),a=o.slice(1).join(":").trim();if(i==="background-color")return a.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),jA=de.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const n=r.split(";").map(s=>s.trim()).filter(Boolean);for(let s=n.length-1;s>=0;s-=1){const o=n[s].split(":");if(o.length>=2){const i=o[0].trim().toLowerCase(),a=o.slice(1).join(":").trim();if(i==="color")return a.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),OA=de.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),LA=de.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),_A=de.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}}),IA=de.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(BA.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(jA.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(OA.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(LA.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(_A.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(MA.configure(this.options.textStyle)),t}}),s0={exports:{}},o0={};/**
|
|
183
|
+
* @license React
|
|
184
|
+
* use-sync-external-store-shim.production.js
|
|
185
|
+
*
|
|
186
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the MIT license found in the
|
|
189
|
+
* LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/var Ln=Be.default;function RA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var PA=typeof Object.is=="function"?Object.is:RA,zA=Ln.useState,$A=Ln.useEffect,HA=Ln.useLayoutEffect,VA=Ln.useDebugValue;function qA(t,e){var r=e(),n=zA({inst:{value:r,getSnapshot:e}}),s=n[0].inst,o=n[1];return HA(function(){s.value=r,s.getSnapshot=e,el(s)&&o({inst:s})},[t,r,e]),$A(function(){return el(s)&&o({inst:s}),t(function(){el(s)&&o({inst:s})})},[t]),VA(r),r}function el(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!PA(t,r)}catch{return!0}}function WA(t,e){return e()}var UA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?WA:qA;o0.useSyncExternalStore=Ln.useSyncExternalStore!==void 0?Ln.useSyncExternalStore:UA;s0.exports=o0;var rc=s0.exports,JA=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(s of e.entries())if(!r.has(s[0]))return!1;for(s of e.entries())if(!t(s[1],r.get(s[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(s of e.entries())if(!r.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(e[s]!==r[s])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!(i==="_owner"&&e.$$typeof)&&!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r};const KA=Kh(JA);var i0={exports:{}},a0={};/**
|
|
191
|
+
* @license React
|
|
192
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
193
|
+
*
|
|
194
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the MIT license found in the
|
|
197
|
+
* LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/var Yi=Be.default,GA=rc;function YA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var XA=typeof Object.is=="function"?Object.is:YA,QA=GA.useSyncExternalStore,ZA=Yi.useRef,eN=Yi.useEffect,tN=Yi.useMemo,rN=Yi.useDebugValue;a0.useSyncExternalStoreWithSelector=function(t,e,r,n,s){var o=ZA(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=tN(function(){function l(g){if(!c){if(c=!0,d=g,g=n(g),s!==void 0&&i.hasValue){var y=i.value;if(s(y,g))return f=y}return f=g}if(y=f,XA(d,g))return y;var v=n(g);return s!==void 0&&s(y,v)?(d=g,y):(d=g,f=v)}var c=!1,d,f,m=r===void 0?null:r;return[function(){return l(e())},m===null?void 0:function(){return l(m())}]},[e,r,n,s]);var a=QA(t,o[0],o[1]);return eN(function(){i.hasValue=!0,i.value=a},[a]),rN(a),a};i0.exports=a0;var nN=i0.exports,sN=(...t)=>e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&(r.current=e)})},oN=({contentComponent:t})=>{const e=rc.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return h.jsx(h.Fragment,{children:Object.values(e)})};function iN(){const t=new Set;let e={};return{subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(r,n){e={...e,[r]:U2.default.createPortal(n.reactElement,n.element,r)},t.forEach(s=>s())},removeRenderer(r){const n={...e};delete n[r],e=n,t.forEach(s=>s())}}}var aN=class extends Be.default.Component{constructor(t){var e;super(t),this.editorContentRef=Be.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(t.view.dom),t.setOptions({element:e}),t.contentComponent=iN(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.firstChild))return;const r=document.createElement("div");r.append(e.view.dom),e.setOptions({element:r})}catch{}}}render(){const{editor:t,innerRef:e,...r}=this.props;return h.jsxs(h.Fragment,{children:[h.jsx("div",{ref:sN(e,this.editorContentRef),...r}),t?.contentComponent&&h.jsx(oN,{contentComponent:t.contentComponent})]})}},lN=F.forwardRef((t,e)=>{const r=Be.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Be.default.createElement(aN,{key:r,innerRef:e,...t})}),uN=Be.default.memo(lN),cN=typeof window<"u"?F.useLayoutEffect:F.useEffect,dN=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},r=this.editor;return r.on("transaction",e),()=>{r.off("transaction",e)}}}};function l0(t){var e;const[r]=F.useState(()=>new dN(t.editor)),n=nN.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:KA);return cN(()=>r.watch(t.editor),[t.editor,r]),F.useDebugValue(n),n}var pN=!1,ql=typeof window>"u",hN=ql||!!(typeof window<"u"&&window.next),fN=class u0{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?ql||hN?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var s,o;return(o=(s=this.options.current).onBeforeCreate)==null?void 0:o.call(s,...n)},onBlur:(...n)=>{var s,o;return(o=(s=this.options.current).onBlur)==null?void 0:o.call(s,...n)},onCreate:(...n)=>{var s,o;return(o=(s=this.options.current).onCreate)==null?void 0:o.call(s,...n)},onDestroy:(...n)=>{var s,o;return(o=(s=this.options.current).onDestroy)==null?void 0:o.call(s,...n)},onFocus:(...n)=>{var s,o;return(o=(s=this.options.current).onFocus)==null?void 0:o.call(s,...n)},onSelectionUpdate:(...n)=>{var s,o;return(o=(s=this.options.current).onSelectionUpdate)==null?void 0:o.call(s,...n)},onTransaction:(...n)=>{var s,o;return(o=(s=this.options.current).onTransaction)==null?void 0:o.call(s,...n)},onUpdate:(...n)=>{var s,o;return(o=(s=this.options.current).onUpdate)==null?void 0:o.call(s,...n)},onContentError:(...n)=>{var s,o;return(o=(s=this.options.current).onContentError)==null?void 0:o.call(s,...n)},onDrop:(...n)=>{var s,o;return(o=(s=this.options.current).onDrop)==null?void 0:o.call(s,...n)},onPaste:(...n)=>{var s,o;return(o=(s=this.options.current).onPaste)==null?void 0:o.call(s,...n)},onDelete:(...n)=>{var s,o;return(o=(s=this.options.current).onDelete)==null?void 0:o.call(s,...n)}};return new JF(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,r){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&r.extensions?e.extensions.length!==r.extensions.length?!1:e.extensions.every((s,o)=>{var i;return s===((i=r.extensions)==null?void 0:i[o])}):e[n]===r[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?u0.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,s)=>n===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function mN(t={},e=[]){const r=F.useRef(t);r.current=t;const[n]=F.useState(()=>new fN(r)),s=rc.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return F.useDebugValue(s),F.useEffect(n.onRender(e)),l0({editor:s,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&o===0?0:o+1}),s}var gN=F.createContext({editor:null});gN.Consumer;var bN=F.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),yN=()=>F.useContext(bN);Be.default.forwardRef((t,e)=>{const{onDragStart:r}=yN(),n=t.as||"div";return h.jsx(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});Be.default.createContext({markViewContentRef:()=>{}});var Ci=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,n,r]},xN=/^\s*>\s$/,vN=ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Ci("blockquote",{...ye(this.options.HTMLAttributes,t),children:Ci("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const r=[];return t.content.forEach(s=>{const i=e.renderChildren(s).split(`
|
|
199
|
+
`).map(a=>`> ${a}`).join(`
|
|
200
|
+
`);r.push(i)}),r.flatMap(s=>[s,"> "]).slice(0,-1).join(`
|
|
201
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[On({find:xN,type:this.type})]}}),wN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,DN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,CN=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kN=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,EN=Ar.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Ci("strong",{...ye(this.options.HTMLAttributes,t),children:Ci("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[jn({find:wN,type:this.type}),jn({find:CN,type:this.type})]},addPasteRules(){return[rn({find:DN,type:this.type}),rn({find:kN,type:this.type})]}}),SN=/(^|[^`])`([^`]+)`(?!`)$/,FN=/(^|[^`])`([^`]+)`(?!`)/g,AN=Ar.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[jn({find:SN,type:this.type})]},addPasteRules(){return[rn({find:FN,type:this.type})]}}),tl=4,NN=/^```([a-z]+)?[\s\n]$/,TN=/^~~~([a-z]+)?[\s\n]$/,MN=ot.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:tl,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options;if(!r)return null;const o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(r)).map(i=>i.replace(r,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ye(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var r;return((r=t.raw)==null?void 0:r.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var r;let n="";const s=((r=t.attrs)==null?void 0:r.language)||"";return t.content?n=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(`
|
|
202
|
+
`):n=`\`\`\`${s}
|
|
203
|
+
|
|
204
|
+
\`\`\``,n},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!=null?e:tl,{state:n}=t,{selection:s}=n,{$from:o,empty:i}=s;if(o.parent.type!==this.type)return!1;const a=" ".repeat(r);return i?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:c,to:d}=s,g=n.doc.textBetween(c,d,`
|
|
205
|
+
`,`
|
|
206
|
+
`).split(`
|
|
207
|
+
`).map(y=>a+y).join(`
|
|
208
|
+
`);return l.replaceWith(c,d,n.schema.text(g)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!=null?e:tl,{state:n}=t,{selection:s}=n,{$from:o,empty:i}=s;return o.parent.type!==this.type?!1:i?t.commands.command(({tr:a})=>{var l;const{pos:c}=o,d=o.start(),f=o.end(),g=n.doc.textBetween(d,f,`
|
|
209
|
+
`,`
|
|
210
|
+
`).split(`
|
|
211
|
+
`);let y=0,v=0;const w=c-d;for(let j=0;j<g.length;j+=1){if(v+g[j].length>=w){y=j;break}v+=g[j].length+1}const E=((l=g[y].match(/^ */))==null?void 0:l[0])||"",N=Math.min(E.length,r);if(N===0)return!0;let A=d;for(let j=0;j<y;j+=1)A+=g[j].length+1;return a.delete(A,A+N),c-A<=N&&a.setSelection(X.create(a.doc,A)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:c}=s,m=n.doc.textBetween(l,c,`
|
|
212
|
+
`,`
|
|
213
|
+
`).split(`
|
|
214
|
+
`).map(g=>{var y;const v=((y=g.match(/^ */))==null?void 0:y[0])||"",w=Math.min(v.length,r);return g.slice(w)}).join(`
|
|
215
|
+
`);return a.replaceWith(l,c,n.schema.text(m)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:s}=r;if(!s||n.parent.type!==this.type)return!1;const o=n.parentOffset===n.parent.nodeSize-2,i=n.parent.textContent.endsWith(`
|
|
216
|
+
|
|
217
|
+
`);return!o||!i?!1:t.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:s,empty:o}=r;if(!o||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const a=s.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(re.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Ol({find:NN,type:this.type,getAttributes:t=>({language:t[1]})}),Ol({find:TN,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new be({key:new je("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),s=n?JSON.parse(n):void 0,o=s?.mode;if(!r||!o)return!1;const{tr:i,schema:a}=t.state,l=a.text(r.replace(/\r\n?/g,`
|
|
218
|
+
`));return i.replaceSelectionWith(this.type.create({language:o},l)),i.selection.$from.parent.type!==this.type&&i.setSelection(X.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),BN=ot.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
219
|
+
|
|
220
|
+
`):""}),jN=ot.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ye(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=(r=t.attrs)!=null&&r.level?parseInt(t.attrs.level,10):1,s="#".repeat(n);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Ol({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),ON=ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ye(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!GF(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,s=t();return Mg(r)?s.insertContentAt(n.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:o,tr:i,dispatch:a})=>{if(a){const{$to:l}=i.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(X.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(Y.create(i.doc,l.pos)):i.setSelection(X.create(i.doc,l.pos));else{const d=o.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,f=d?.create();f&&(i.insert(c,f),i.setSelection(X.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[KF({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),LN=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_N=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,IN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,RN=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,PN=Ar.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[jn({find:LN,type:this.type}),jn({find:IN,type:this.type})]},addPasteRules(){return[rn({find:_N,type:this.type}),rn({find:RN,type:this.type})]}}),zN=Object.defineProperty,$N=(t,e)=>{for(var r in e)zN(t,r,{get:e[r],enumerable:!0})},HN="listItem",xh="textStyle",vh=/^\s*([-+*])\s$/,c0=ot.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
221
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HN,this.editor.getAttributes(xh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=On({find:vh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=On({find:vh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xh),editor:this.editor})),[t]}}),d0=ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let r=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(s=>s.type==="paragraph"))r=e.parseChildren(t.tokens);else{const s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(r=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){const i=t.tokens.slice(1),a=e.parseChildren(i);r.push(...a)}}else r=e.parseChildren(t.tokens)}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(t,e,r)=>Uu(t,e,n=>n.parentType==="bulletList"?"- ":n.parentType==="orderedList"?`${n.index+1}. `:"- ",r),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),VN={};$N(VN,{findListItemPos:()=>qs,getNextListDepth:()=>nc,handleBackspace:()=>Wl,handleDelete:()=>Ul,hasListBefore:()=>p0,hasListItemAfter:()=>qN,hasListItemBefore:()=>h0,listItemHasSubList:()=>f0,nextListIsDeeper:()=>m0,nextListIsHigher:()=>g0});var qs=(t,e)=>{const{$from:r}=e.selection,n=Ce(t,e.schema);let s=null,o=r.depth,i=r.pos,a=null;for(;o>0&&a===null;)s=r.node(o),s.type===n?a=o:(o-=1,i-=1);return a===null?null:{$pos:e.doc.resolve(i),depth:a}},nc=(t,e)=>{const r=qs(t,e);if(!r)return!1;const[,n]=uF(e,t,r.$pos.pos+4);return n},p0=(t,e,r)=>{const{$anchor:n}=t.selection,s=Math.max(0,n.pos-2),o=t.doc.resolve(s).node();return!(!o||!r.includes(o.type.name))},h0=(t,e)=>{var r;const{$anchor:n}=e.selection,s=e.doc.resolve(n.pos-2);return!(s.index()===0||((r=s.nodeBefore)==null?void 0:r.type.name)!==t)},f0=(t,e,r)=>{if(!r)return!1;const n=Ce(t,e.schema);let s=!1;return r.descendants(o=>{o.type===n&&(s=!0)}),s},Wl=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Cr(t.state,e)&&p0(t.state,e,r)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((m,g)=>{m.type.name===e&&c.push({node:m,pos:g})});const d=c.at(-1);if(!d)return!1;const f=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},f.end()).joinForward().run()}if(!Cr(t.state,e)||!hF(t.state))return!1;const n=qs(e,t.state);if(!n)return!1;const o=t.state.doc.resolve(n.$pos.pos-2).node(n.depth),i=f0(e,t.state,o);return h0(e,t.state)&&!i?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},m0=(t,e)=>{const r=nc(t,e),n=qs(t,e);return!n||!r?!1:r>n.depth},g0=(t,e)=>{const r=nc(t,e),n=qs(t,e);return!n||!r?!1:r<n.depth},Ul=(t,e)=>{if(!Cr(t.state,e)||!pF(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:s}=r;return!r.empty&&n.sameParent(s)?!1:m0(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():g0(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},qN=(t,e)=>{var r;const{$anchor:n}=e.selection,s=e.doc.resolve(n.pos-n.parentOffset-2);return!(s.index()===s.parent.childCount-1||((r=s.nodeAfter)==null?void 0:r.type.name)!==t)},b0=de.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Ul(t,r)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Ul(t,r)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Wl(t,r,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Wl(t,r,n)&&(e=!0)}),e}}}}),wh=/^(\s*)(\d+)\.\s+(.*)$/,WN=/^\s/;function UN(t){const e=[];let r=0,n=0;for(;r<t.length;){const s=t[r],o=s.match(wh);if(!o)break;const[,i,a,l]=o,c=i.length;let d=l,f=r+1;const m=[s];for(;f<t.length;){const g=t[f];if(g.match(wh))break;if(g.trim()==="")m.push(g),d+=`
|
|
222
|
+
`,f+=1;else if(g.match(WN))m.push(g),d+=`
|
|
223
|
+
${g.slice(c+2)}`,f+=1;else break}e.push({indent:c,number:parseInt(a,10),content:d.trim(),raw:m.join(`
|
|
224
|
+
`)}),n=f,r=f}return[e,n]}function y0(t,e,r){var n;const s=[];let o=0;for(;o<t.length;){const i=t[o];if(i.indent===e){const a=i.content.split(`
|
|
225
|
+
`),l=((n=a[0])==null?void 0:n.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:r.inlineTokens(l)});const d=a.slice(1).join(`
|
|
226
|
+
`).trim();if(d){const g=r.blockTokens(d);c.push(...g)}let f=o+1;const m=[];for(;f<t.length&&t[f].indent>e;)m.push(t[f]),f+=1;if(m.length>0){const g=Math.min(...m.map(v=>v.indent)),y=y0(m,g,r);c.push({type:"list",ordered:!0,start:m[0].number,items:y,raw:m.map(v=>v.raw).join(`
|
|
227
|
+
`)})}s.push({type:"list_item",raw:i.raw,tokens:c}),o=f}else o+=1}return s}function JN(t,e){return t.map(r=>{if(r.type!=="list_item")return e.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")n.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const o=e.parseChildren([s]);n.push({type:"paragraph",content:o})}else{const o=e.parseChildren([s]);o.length>0&&n.push(...o)}}),{type:"listItem",content:n}})}var KN="listItem",Dh="textStyle",Ch=/^(\d+)\.\s$/,x0=ot.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...r}=t;return e===1?["ol",ye(this.options.HTMLAttributes,r),0]:["ol",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const r=t.start||1,n=t.items?JN(t.items,e):[];return r!==1?{type:"orderedList",attrs:{start:r},content:n}:{type:"orderedList",content:n}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
228
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),r=e?.index;return r!==void 0?r:-1},tokenize:(t,e,r)=>{var n;const s=t.split(`
|
|
229
|
+
`),[o,i]=UN(s);if(o.length===0)return;const a=y0(o,0,r);return a.length===0?void 0:{type:"list",ordered:!0,start:((n=o[0])==null?void 0:n.number)||1,items:a,raw:s.slice(0,i).join(`
|
|
230
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(KN,this.editor.getAttributes(Dh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=On({find:Ch,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=On({find:Ch,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Dh)}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1],editor:this.editor})),[t]}}),GN=/^\s*(\[([( |x])?\])\s$/,YN=ot.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ye(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const r=[];if(t.tokens&&t.tokens.length>0?r.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?r.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):r.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);r.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},r)},renderMarkdown:(t,e)=>{var r;const s=`- [${(r=t.attrs)!=null&&r.checked?"x":" "}] `;return Uu(t,e,s)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const s=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var f,m;a.ariaLabel=((m=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:m.call(f,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(t),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:m})=>{const g=r();if(typeof g!="number")return!1;const y=m.doc.nodeAt(g);return m.setNodeMarkup(g,void 0,{...y?.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{s.setAttribute(d,f)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,i),s.append(o,l),Object.entries(e).forEach(([d,f])=>{s.setAttribute(d,f)}),{dom:s,contentDOM:l,update:d=>d.type!==this.type?!1:(s.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[On({find:GN,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),XN=ot.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
231
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const r=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return r!==void 0?r:-1},tokenize(t,e,r){const n=o=>{const i=Ll(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:r.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:n},r);return i?[{type:"taskList",raw:i.raw,items:i.items}]:r.blockTokens(o)},s=Ll(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,i)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:r.inlineTokens(o.mainContent),nestedTokens:i}),customNestedParser:n},r);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});de.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(c0.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(d0.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(b0.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(x0.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(YN.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(XN.configure(this.options.taskList)),t}});var QN=ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ye(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const r=t.tokens||[];return r.length===1&&r[0].type==="image"?e.parseChildren([r[0]]):e.createNode("paragraph",void 0,e.parseInline(r))},renderMarkdown:(t,e)=>!t||!Array.isArray(t.content)?"":e.renderChildren(t.content),addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,eT=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tT=Ar.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[jn({find:ZN,type:this.type})]},addPasteRules(){return[rn({find:eT,type:this.type})]}}),rT=ot.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),nT=Ar.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ye(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,r){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const o=s[2].trim();return{type:"underline",raw:s[0],text:o,tokens:r.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function sT(t={}){return new be({view(e){return new oT(e,t)}})}class oT{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let o=i=>{this[s](i)};return e.dom.addEventListener(s,o),{name:s,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,s=this.editorView.dom,o=s.getBoundingClientRect(),i=o.width/s.offsetWidth,a=o.height/s.offsetHeight;if(r){let f=e.nodeBefore,m=e.nodeAfter;if(f||m){let g=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(g){let y=g.getBoundingClientRect(),v=f?y.bottom:y.top;f&&m&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*a;n={left:y.left,right:y.right,top:v-w,bottom:v+w}}}}if(!n){let f=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*i;n={left:f.left-m,right:f.left+m,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=l.getBoundingClientRect(),m=f.width/l.offsetWidth,g=f.height/l.offsetHeight;c=f.left-l.scrollLeft*m,d=f.top-l.scrollTop*g}this.element.style.left=(n.left-c)/i+"px",this.element.style.top=(n.top-d)/a+"px",this.element.style.width=(n.right-n.left)/i+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),s=n&&n.type.spec.disableDropCursor,o=typeof s=="function"?s(this.editorView,r,e):s;if(r&&!o){let i=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=mm(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ge extends re{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return ge.valid(n)?new ge(n):re.near(n)}content(){return H.empty}eq(e){return e instanceof ge&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ge(e.resolve(r.pos))}getBookmark(){return new sc(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!iT(e)||!aT(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let s=r.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&ge.valid(e))return e;let s=e.pos,o=null;for(let i=e.depth;;i--){let a=e.node(i);if(r>0?e.indexAfter(i)<a.childCount:e.index(i)>0){o=a.child(r>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;s+=r;let l=e.doc.resolve(s);if(ge.valid(l))return l}for(;;){let i=r>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Y.isSelectable(o)){e=e.doc.resolve(s+o.nodeSize*r),n=!1;continue e}break}o=i,s+=r;let a=e.doc.resolve(s);if(ge.valid(a))return a}return null}}}ge.prototype.visible=!1;ge.findFrom=ge.findGapCursorFrom;re.jsonID("gapcursor",ge);class sc{constructor(e){this.pos=e}map(e){return new sc(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return ge.valid(r)?new ge(r):re.near(r)}}function v0(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function iT(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let s=n.child(r-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||v0(s.type))return!0;if(s.inlineContent)return!1}}return!0}function aT(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let s=n.child(r);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||v0(s.type))return!0;if(s.inlineContent)return!1}}return!0}function lT(){return new be({props:{decorations:pT,createSelectionBetween(t,e,r){return e.pos==r.pos&&ge.valid(r)?new ge(r):null},handleClick:cT,handleKeyDown:uT,handleDOMEvents:{beforeinput:dT}}})}const uT=mg({ArrowLeft:Fo("horiz",-1),ArrowRight:Fo("horiz",1),ArrowUp:Fo("vert",-1),ArrowDown:Fo("vert",1)});function Fo(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,s,o){let i=n.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof X){if(!o.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=ge.findGapCursorFrom(a,e,l);return c?(s&&s(n.tr.setSelection(new ge(c))),!0):!1}}function cT(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!ge.valid(n))return!1;let s=t.posAtCoords({left:r.clientX,top:r.clientY});return s&&s.inside>-1&&Y.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ge(n))),!0)}function dT(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ge))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let s=L.empty;for(let i=n.length-1;i>=0;i--)s=L.from(n[i].createAndFill(null,s));let o=t.state.tr.replace(r.pos,r.pos,new H(s,0,0));return o.setSelection(X.near(o.doc.resolve(r.pos+1))),t.dispatch(o),!1}function pT(t){if(!(t.selection instanceof ge))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",fe.create(t.doc,[Je.widget(t.selection.head,e,{key:"gapcursor"})])}var ki=200,Me=function(){};Me.prototype.append=function(e){return e.length?(e=Me.from(e),!this.length&&e||e.length<ki&&this.leafAppend(e)||this.length<ki&&e.leafPrepend(this)||this.appendInner(e)):this};Me.prototype.prepend=function(e){return e.length?Me.from(e).append(this):this};Me.prototype.appendInner=function(e){return new hT(this,e)};Me.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?Me.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};Me.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Me.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};Me.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var s=[];return this.forEach(function(o,i){return s.push(e(o,i))},r,n),s};Me.from=function(e){return e instanceof Me?e:e&&e.length?new w0(e):Me.empty};var w0=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,o){return s==0&&o==this.length?this:new e(this.values.slice(s,o))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,o,i,a){for(var l=o;l<i;l++)if(s(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,o,i,a){for(var l=o-1;l>=i;l--)if(s(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=ki)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=ki)return new e(s.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(Me);Me.empty=new w0([]);var hT=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,s,o,i){var a=this.left.length;if(s<a&&this.left.forEachInner(n,s,Math.min(o,a),i)===!1||o>a&&this.right.forEachInner(n,Math.max(s-a,0),Math.min(this.length,o)-a,i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,s,o,i){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(n,s-a,Math.max(o,a)-a,i+a)===!1||o<a&&this.left.forEachInvertedInner(n,Math.min(s,a),o,i)===!1)return!1},e.prototype.sliceInner=function(n,s){if(n==0&&s==this.length)return this;var o=this.left.length;return s<=o?this.left.slice(n,s):n>=o?this.right.slice(n-o,s-o):this.left.slice(n,o).append(this.right.slice(0,s-o))},e.prototype.leafAppend=function(n){var s=this.right.leafAppend(n);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(n){var s=this.left.leafPrepend(n);if(s)return new e(s,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Me);const fT=500;class vt{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let s,o;r&&(s=this.remapping(n,this.items.length),o=s.maps.length);let i=e.tr,a,l,c=[],d=[];return this.items.forEach((f,m)=>{if(!f.step){s||(s=this.remapping(n,m+1),o=s.maps.length),o--,d.push(f);return}if(s){d.push(new Nt(f.map));let g=f.step.map(s.slice(o)),y;g&&i.maybeStep(g).doc&&(y=i.mapping.maps[i.mapping.maps.length-1],c.push(new Nt(y,void 0,void 0,c.length+d.length))),o--,y&&s.appendMap(y,o)}else i.maybeStep(f.step);if(f.selection)return a=s?f.selection.map(s.slice(o)):f.selection,l=new vt(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,r,n,s){let o=[],i=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),m=new Nt(e.mapping.maps[d],f,r),g;(g=l&&l.merge(m))&&(m=g,d?o.pop():a=a.slice(0,a.length-1)),o.push(m),r&&(i++,r=void 0),s||(l=m)}let c=i-n.depth;return c>gT&&(a=mT(a,c),i-=c),new vt(a.append(o),i)}remapping(e,r){let n=new Ns;return this.items.forEach((s,o)=>{let i=s.mirrorOffset!=null&&o-s.mirrorOffset>=e?n.maps.length-s.mirrorOffset:void 0;n.appendMap(s.map,i)},e,r),n}addMaps(e){return this.eventCount==0?this:new vt(this.items.append(e.map(r=>new Nt(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],s=Math.max(0,this.items.length-r),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},s);let l=r;this.items.forEach(m=>{let g=o.getMirror(--l);if(g==null)return;i=Math.min(i,g);let y=o.maps[g];if(m.step){let v=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(o.slice(l+1,g));w&&a++,n.push(new Nt(y,v,w))}else n.push(new Nt(y))},s);let c=[];for(let m=r;m<i;m++)c.push(new Nt(o.maps[m]));let d=this.items.slice(0,s).append(c).append(n),f=new vt(d,a);return f.emptyItemCount()>fT&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,s=[],o=0;return this.items.forEach((i,a)=>{if(a>=e)s.push(i),i.selection&&o++;else if(i.step){let l=i.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let d=i.selection&&i.selection.map(r.slice(n));d&&o++;let f=new Nt(c.invert(),l,d),m,g=s.length-1;(m=s.length&&s[g].merge(f))?s[g]=m:s.push(f)}}else i.map&&n--},this.items.length,0),new vt(Me.from(s.reverse()),o)}}vt.empty=new vt(Me.empty,0);function mT(t,e){let r;return t.forEach((n,s)=>{if(n.selection&&e--==0)return r=s,!1}),t.slice(r)}class Nt{constructor(e,r,n,s){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new Nt(r.getMap().invert(),r,this.selection)}}}class cr{constructor(e,r,n,s,o){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=s,this.prevComposition=o}}const gT=20;function bT(t,e,r,n){let s=r.getMeta(Yr),o;if(s)return s.historyState;r.getMeta(vT)&&(t=new cr(t.done,t.undone,null,0,-1));let i=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(i&&i.getMeta(Yr))return i.getMeta(Yr).redo?new cr(t.done.addTransform(r,void 0,n,Lo(e)),t.undone,kh(r.mapping.maps),t.prevTime,t.prevComposition):new cr(t.done,t.undone.addTransform(r,void 0,n,Lo(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(r.time||0)-n.newGroupDelay||!yT(r,t.prevRanges)),c=i?rl(t.prevRanges,r.mapping):kh(r.mapping.maps);return new cr(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,Lo(e)),vt.empty,c,r.time,a??t.prevComposition)}else return(o=r.getMeta("rebased"))?new cr(t.done.rebased(r,o),t.undone.rebased(r,o),rl(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new cr(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),rl(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function yT(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,s)=>{for(let o=0;o<e.length;o+=2)n<=e[o+1]&&s>=e[o]&&(r=!0)}),r}function kh(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,s,o,i)=>e.push(o,i));return e}function rl(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let s=e.map(t[n],1),o=e.map(t[n+1],-1);s<=o&&r.push(s,o)}return r}function xT(t,e,r){let n=Lo(e),s=Yr.get(e).spec.config,o=(r?t.undone:t.done).popEvent(e,n);if(!o)return null;let i=o.selection.resolve(o.transform.doc),a=(r?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),s,n),l=new cr(r?a:o.remaining,r?o.remaining:a,null,0,-1);return o.transform.setSelection(i).setMeta(Yr,{redo:r,historyState:l})}let nl=!1,Eh=null;function Lo(t){let e=t.plugins;if(Eh!=e){nl=!1,Eh=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){nl=!0;break}}return nl}const Yr=new je("history"),vT=new je("closeHistory");function wT(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new be({key:Yr,state:{init(){return new cr(vt.empty,vt.empty,null,0,-1)},apply(e,r,n){return bT(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,s=n=="historyUndo"?C0:n=="historyRedo"?k0:null;return s?(r.preventDefault(),s(e.state,e.dispatch)):!1}}}})}function D0(t,e){return(r,n)=>{let s=Yr.getState(r);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(n){let o=xT(s,r,t);o&&n(e?o.scrollIntoView():o)}return!0}}const C0=D0(!1,!0),k0=D0(!0,!0);de.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let t=!1;return[new be({key:new je("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;const s=this.options.limit;if(s==null||s===0){t=!0;return}const o=this.storage.characters({node:n.doc});if(o>s){const i=o-s,a=0,l=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return t=!0,c}t=!0},filterTransaction:(e,r)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const s=this.storage.characters({node:r.doc}),o=this.storage.characters({node:e.doc});if(o<=n||s>n&&o>n&&o<=s)return!0;if(s>n&&o>n&&o>s||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=o-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});var DT=de.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[sT(this.options)]}});de.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new be({key:new je("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:s}=e,o=[];if(!r||!n)return fe.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(s>=c&&s<=c+l.nodeSize-1))return!1;i+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(s>=c&&s<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(Je.node(c,c+l.nodeSize,{class:this.options.className}))}),fe.create(t,o)}}})]}});var CT=de.create({name:"gapCursor",addProseMirrorPlugins(){return[lT()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=le(G(t,"allowGapCursor",r)))!=null?e:null}}});de.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new be({key:new je("placeholder"),props:{decorations:({doc:t,selection:e})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,s=[];if(!r)return null;const o=this.editor.isEmpty;return t.descendants((i,a)=>{const l=n>=a&&n<=a+i.nodeSize,c=!i.isLeaf&&Ui(i);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const f=Je.node(a,a+i.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:l}):this.options.placeholder});s.push(f)}return this.options.includeChildren}),fe.create(t,s)}}})]}});de.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new be({key:new je("selection"),props:{decorations(r){return r.selection.empty||t.isFocused||!t.isEditable||Mg(r.selection)||t.view.dragging?null:fe.create(r.doc,[Je.inline(r.selection.from,r.selection.to,{class:e.className})])}}})]}});function Sh({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var kT=de.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new je(this.name),r=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(r).includes(s.name));return[new be({key:e,appendTransaction:(s,o,i)=>{const{doc:a,tr:l,schema:c}=i,d=e.getState(i),f=a.content.size,m=c.nodes[r];if(d)return l.insert(f,m.create())},state:{init:(s,o)=>{const i=o.tr.doc.lastChild;return!Sh({node:i,types:n})},apply:(s,o)=>{if(!s.docChanged)return o;const i=s.doc.lastChild;return!Sh({node:i,types:n})}}})]}}),ET=de.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>C0(t,e),redo:()=>({state:t,dispatch:e})=>k0(t,e)}},addProseMirrorPlugins(){return[wT(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ST=de.create({name:"starterKit",addExtensions(){var t,e,r,n;const s=[];return this.options.bold!==!1&&s.push(EN.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(vN.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(c0.configure(this.options.bulletList)),this.options.code!==!1&&s.push(AN.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(MN.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(BN.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(DT.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(CT.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(Ug.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(jN.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(ET.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(ON.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(PN.configure(this.options.italic)),this.options.listItem!==!1&&s.push(d0.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(b0.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(r0.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(x0.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(QN.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(tT.configure(this.options.strike)),this.options.text!==!1&&s.push(rT.configure(this.options.text)),this.options.underline!==!1&&s.push(nT.configure((r=this.options)==null?void 0:r.underline)),this.options.trailingNode!==!1&&s.push(kT.configure((n=this.options)==null?void 0:n.trailingNode)),s}}),FT=ST;const AT=[IA,FT,nA.extend({addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.setHardBreak()}}}),AA.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(t,e)=>{try{const r=t.includes(":")?new URL(t):new URL(`${e.defaultProtocol}://${t}`);if(!e.defaultValidate(r.href))return!1;const n=["ftp","file","mailto"],s=r.protocol.replace(":","");if(n.includes(s)||!e.protocols.map(l=>typeof l=="string"?l:l.scheme).includes(s))return!1;const i=[""],a=r.hostname;return!i.includes(a)}catch{return!1}},shouldAutoLink:t=>{try{const e=t.includes(":")?new URL(t):new URL(`https://${t}`),r=[""],n=e.hostname;return!r.includes(n)}catch{return!1}}})];function Le({children:t,onClick:e,disabled:r=!1,isActive:n}){return h.jsx("button",{onClick:e,disabled:r,className:`w-[26px] h-[26px] p-1 rounded-md border border-[#170F4F] transition-colors duration-200 flex items-center justify-center hover:bg-gray-200 disabled:opacity-40 ${n?"bg-[#170F4F] text-white hover:bg-[#170F4F]":""}`,children:t})}function NT({editor:t}){const e=F.useCallback(()=>{const s=t.getAttributes("link").href,o=window.prompt("Please put a valid URL",s);if(o!==null){if(o===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}try{t.chain().focus().extendMarkRange("link").setLink({href:o}).run()}catch(i){alert(i.message)}}},[t]),r=F.useCallback(In(s=>{t.chain().focus().setColor(s).run()},300),[t]),n=l0({editor:t,selector:s=>({color:s.editor.getAttributes("textStyle").color,isBold:s.editor.isActive("bold")??!1,canBold:s.editor.can().chain().toggleBold().run()??!1,isItalic:s.editor.isActive("italic")??!1,canItalic:s.editor.can().chain().toggleItalic().run()??!1,isStrike:s.editor.isActive("strike")??!1,canStrike:s.editor.can().chain().toggleStrike().run()??!1,isUnderline:s.editor.isActive("underline")??!1,canUnderline:s.editor.can().chain().toggleUnderline().run()??!1,canClearMarks:s.editor.can().chain().unsetAllMarks().run()??!1,isParagraph:s.editor.isActive("paragraph")??!1,isHeading1:s.editor.isActive("heading",{level:1})??!1,isHeading2:s.editor.isActive("heading",{level:2})??!1,isHeading3:s.editor.isActive("heading",{level:3})??!1,isHeading4:s.editor.isActive("heading",{level:4})??!1,isHeading5:s.editor.isActive("heading",{level:5})??!1,isHeading6:s.editor.isActive("heading",{level:6})??!1,isBulletList:s.editor.isActive("bulletList")??!1,isOrderedList:s.editor.isActive("orderedList")??!1,canUndo:s.editor.can().chain().undo().run()??!1,canRedo:s.editor.can().chain().redo().run()??!1,isLink:s.editor.isActive("link")})});return h.jsx("div",{className:"control-group",children:h.jsxs("div",{className:"mb-[8px] flex flex-wrap gap-1 border border-[#e8e7ee] p-[2px]",children:[h.jsx(Le,{onClick:()=>t.chain().focus().toggleBold().run(),disabled:!n.canBold,isActive:n.isBold,children:h.jsx(Et.BiBold,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleItalic().run(),disabled:!n.canItalic,isActive:n.isItalic,children:h.jsx(Et.BiItalic,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleUnderline().run(),disabled:!n.canUnderline,isActive:n.isUnderline,children:h.jsx(Et.BiUnderline,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleStrike().run(),disabled:!n.canStrike,isActive:n.isStrike,children:h.jsx(Et.BiStrikethrough,{size:16})}),h.jsx(Le,{onClick:n.isLink?()=>t.chain().focus().unsetLink().run():()=>e(),isActive:n.isLink,children:n.isLink?h.jsx(Et.BiUnlink,{size:16}):h.jsx(Et.BiLink,{size:16})}),h.jsx("input",{type:"color",onInput:s=>r(s.currentTarget.value),className:"h-[26px] w-[26px]",value:n.color}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:n.isBulletList,children:h.jsx(Et.BiListUl,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:n.isOrderedList,children:h.jsx(Et.BiListOl,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().setHardBreak().run(),children:h.jsx(_.FiCornerDownLeft,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:n.isHeading1,children:h.jsx(jr.TbH1,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:n.isHeading2,children:h.jsx(jr.TbH2,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:n.isHeading3,children:h.jsx(jr.TbH3,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleHeading({level:4}).run(),isActive:n.isHeading4,children:h.jsx(jr.TbH4,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleHeading({level:5}).run(),isActive:n.isHeading5,children:h.jsx(jr.TbH5,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().toggleHeading({level:6}).run(),isActive:n.isHeading6,children:h.jsx(jr.TbH6,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().unsetAllMarks().run(),children:h.jsx(jr.TbClearFormatting,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().undo().run(),disabled:!n.canUndo,children:h.jsx(Et.BiUndo,{size:16})}),h.jsx(Le,{onClick:()=>t.chain().focus().redo().run(),disabled:!n.canRedo,children:h.jsx(Et.BiRedo,{size:16})})]})})}function TT({handleChange:t,text:e}){const r=mN({extensions:AT,content:e,onUpdate:({editor:n})=>{let s=n.getHTML();s=s.replace(/<p><\/p>/g,""),t(s)}});return h.jsxs("div",{children:[h.jsx(NT,{editor:r}),h.jsx(uN,{editor:r,className:"tiptap-global"})]})}function MT(){const{actions:{setProp:t},text:e}=Q.useNode(n=>({text:n.data.props.children})),r=n=>{t(s=>s.children=n)};return h.jsx("div",{className:"space-y-4 p-4",children:h.jsx(TT,{handleChange:r,text:e})})}function E0(){const{actions:{setProp:t},style:{backgroundColor:e}={}}=Q.useNode(n=>({style:n.data.props.style||{}})),r=F.useMemo(()=>In(n=>{t(s=>{s.style.backgroundColor=n})},300),[t]);return h.jsx(_n,{title:"Background",icon:h.jsx(_.FiEdit3,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"color",value:e,onChange:n=>r(n.target.value),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),h.jsx("input",{type:"text",value:e,onChange:n=>t(s=>s.style.backgroundColor=n.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})})}function S0(){const{actions:{setProp:t},style:{borderStyle:e,borderRadius:r,borderColor:n,borderWidth:s}={}}=Q.useNode(i=>({style:i.data.props.style||{}})),o=F.useMemo(()=>In(i=>{t(a=>{a.style.borderColor=i})},300),[t]);return h.jsx(_n,{title:"Border",icon:h.jsx(_.FiSquare,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Radius"}),h.jsx("div",{className:"grid grid-cols-4 gap-1",children:[{value:"",label:"0"},{value:"4px",label:"4px"},{value:"8px",label:"8px"},{value:"9999px",label:"1/2"}].map(i=>h.jsx("button",{onClick:()=>t(a=>a.style.borderRadius=i.value),className:`border border-[#E8E7EE] px-2 py-2 text-xs transition-all ${r===i.value?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:i.label},i.value))})]}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Width"}),h.jsx("div",{className:"grid grid-cols-4 gap-1",children:[{value:"0px",label:"0"},{value:"1px",label:"1px"},{value:"2px",label:"2px"},{value:"4px",label:"4px"}].map(i=>h.jsx("button",{onClick:()=>t(a=>a.style.borderWidth=i.value),className:`border border-[#E8E7EE] px-2 py-2 text-xs transition-all ${s===i.value?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:i.label},i.value))})]}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border type"}),h.jsxs("div",{className:"mb-2 grid grid-cols-2 gap-2",children:[h.jsx("button",{onClick:()=>t(i=>i.style.borderStyle="none"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${e==="none"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"None"}),h.jsx("button",{onClick:()=>t(i=>i.style.borderStyle="solid"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${e==="solid"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"Light"}),h.jsx("button",{onClick:()=>t(i=>i.style.borderStyle="dotted"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${e==="dotted"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"Dotted"}),h.jsx("button",{onClick:()=>t(i=>i.style.borderStyle="dashed"),className:`border border-[#E8E7EE] px-3 py-2 text-xs transition-all ${e==="dashed"?"border-[#170F4F] bg-[#170F4F] text-white":"text-[#A29FB9] hover:border-[#00BAC7] hover:bg-[#CCF1F4]"}`,children:"Dashed"})]}),h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Border Color"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"color",value:n,onChange:i=>o(i.target.value),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Background color"}),h.jsx("input",{type:"text",value:n,onChange:i=>t(a=>a.style.borderColor=i.target.value),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#ffffff"})]})]})]})})}const xt=F.forwardRef(({value:t,onChange:e,min:r,max:n,defaultUnit:s="px",allowedUnits:o=[],className:i="",...a},l)=>{const[c,d]=F.useState(""),[f,m]=F.useState(!1),g=F.useCallback(A=>{if(typeof A=="number")return{value:A,unit:s,text:`${A}${s}`};if(typeof A=="string"&&A.trim()){const T=A.trim(),j=T.match(/^(-?\d*\.?\d+)(.*)$/);if(!j)return{value:0,unit:s,text:""};const[,B,$]=j,O=parseFloat(B),z=$.trim()||s,I=o.length>0&&!o.includes(z)?s:z;return{value:O,unit:I,text:T}}return{value:0,unit:s,text:""}},[s,o]),y=F.useMemo(()=>{if(!t||typeof t=="string"&&t.trim()==="")return"";const A=g(t);return`${A.value}${A.unit}`},[t,g]),v=F.useCallback(A=>{d(A.target.value)},[]),w=F.useCallback(A=>{if(A.key==="Enter"){A.currentTarget.blur();return}if(A.key==="ArrowUp"||A.key==="ArrowDown"){A.preventDefault();const T=f?c:y;if(!T.trim())return;const j=g(T);if(isNaN(j.value))return;const B=A.shiftKey?10:A.ctrlKey||A.metaKey?.1:1,$=A.key==="ArrowUp"?j.value+B:j.value-B,O=Math.min(n??$,Math.max(r??$,$)),z=`${O}${j.unit}`;d(z),e?.({value:O,unit:j.unit,text:z})}},[f,c,y,g,r,n,e]),D=F.useCallback(()=>{m(!0),!c&&t&&d(typeof t=="string"?t:y)},[c,t,y]),E=F.useCallback(()=>{if(m(!1),!c.trim()){d(""),e?.({value:0,unit:s,text:""});return}const A=g(c),T=Math.min(n??A.value,Math.max(r??A.value,A.value)),j=`${T}${A.unit}`;d(j),e?.({value:T,unit:A.unit,text:j})},[c,e,s,g,r,n]),N=`border border-[#E8E7EE] bg-white text-center text-xs transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F] disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400 ${i.includes("px-")||i.includes("py-")?"":"px-1 py-0.5"}`;return h.jsx("input",{ref:l,type:"text",value:f?c:y,onChange:v,onFocus:D,onBlur:E,onKeyDown:w,className:`${N} ${i}`.trim(),...a})});xt.displayName="DimensionInput";const Fh={min:0,defaultUnit:"px",allowedUnits:["px","rem","%","vh","vw"],placeholder:"auto",className:"w-20 px-2 py-1 text-xs"};function F0(){const{actions:{setProp:t},style:{columns:e,columnSpacing:r,alignment:n,minHeight:s,width:o,height:i}={}}=Q.useNode(c=>({style:c.data.props.style||{}})),a=()=>{e<6&&t(c=>c.style.columns=e+1)},l=()=>{e>1&&t(c=>c.style.columns=e-1)};return h.jsx(_n,{title:"Layout",icon:h.jsx(_.FiLayout,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Width"}),h.jsx(xt,{value:o,onChange:c=>t(d=>d.style.width=c.text),...Fh})]}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Height"}),h.jsx(xt,{value:i,onChange:c=>t(d=>d.style.height=c.text),...Fh})]})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-[#A29FB9]",children:"Min Height"}),h.jsxs("span",{className:"bg-[#E8E7EE] px-2 py-1 font-mono text-xs text-[#170F4F]",children:[s,"px"]})]}),h.jsx("input",{type:"range",min:"50",max:"400",step:"25",value:s,onChange:c=>t(d=>d.style.minHeight=parseInt(c.target.value)),className:"slider-modern h-2 w-full cursor-pointer appearance-none bg-[#E8E7EE]",style:{background:`linear-gradient(to right, #170F4F 0%, #170F4F ${(s-50)/350*100}%, #E8E7EE ${(s-50)/350*100}%, #E8E7EE 100%)`}})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-[#A29FB9]",children:"Columns"}),h.jsx("span",{className:"bg-[#E8E7EE] px-2 py-1 font-mono text-xs text-[#170F4F]",children:e})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{onClick:l,disabled:e<=1,className:"flex h-8 w-8 items-center justify-center border border-[#E8E7EE] bg-[#E8E7EE] text-[#A29FB9] transition-all hover:border-[#00BAC7] hover:bg-[#CCF1F4] disabled:cursor-not-allowed disabled:opacity-30",children:h.jsx(_.FiMinus,{size:14})}),h.jsx("div",{className:"flex flex-1 justify-center py-1",children:h.jsx("div",{className:"flex gap-1",children:Array.from({length:e},(c,d)=>h.jsx("div",{className:"h-8 w-4 border border-[#170F4F] bg-[#170F4F]"},d))})}),h.jsx("button",{onClick:a,disabled:e>=6,className:"flex h-8 w-8 items-center justify-center border border-[#E8E7EE] bg-[#E8E7EE] text-[#A29FB9] transition-all hover:border-[#00BAC7] hover:bg-[#CCF1F4] disabled:cursor-not-allowed disabled:opacity-30",children:h.jsx(_.FiPlus,{size:14})})]})]}),e>1&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-[#A29FB9]",children:"Column Gap"}),h.jsxs("span",{className:"bg-[#E8E7EE] px-2 py-1 font-mono text-xs text-[#170F4F]",children:[r,"px"]})]}),h.jsx("input",{type:"range",min:"0",max:"40",step:"2",value:r,onChange:c=>t(d=>d.style.columnSpacing=parseInt(c.target.value)),className:"slider-modern h-2 w-full cursor-pointer appearance-none bg-[#E8E7EE]",style:{background:`linear-gradient(to right, #170F4F 0%, #170F4F ${r/40*100}%, #E8E7EE ${r/40*100}%, #E8E7EE 100%)`}})]}),h.jsxs("div",{children:[h.jsx("span",{className:"mb-2 block text-xs text-[#A29FB9]",children:"Alignment"}),h.jsx(Mt,{options:[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],value:n,onChange:c=>t(d=>d.style.alignment=c),placeholder:"Choose alignment"})]})]})})}function ls(t){if(t!=null){if(typeof t=="number")return t===0?"0":void 0;if(typeof t=="string"){const e=t.trim();return e==="0"?"0":/^-?\d+(\.\d+)?(px|em|rem|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i.test(e)?e:void 0}}}function Ah(t={},e){const r=ls(t[e]),n=ls(t[`${e}Top`]),s=ls(t[`${e}Right`]),o=ls(t[`${e}Bottom`]),i=ls(t[`${e}Left`]);if(r){const a=r.trim().split(/\s+/);switch(a.length){case 1:return{top:n||a[0],right:s||a[0],bottom:o||a[0],left:i||a[0]};case 2:return{top:n||a[0],right:s||a[1],bottom:o||a[0],left:i||a[1]};case 3:return{top:n||a[0],right:s||a[1],bottom:o||a[2],left:i||a[1]};case 4:return{top:n||a[0],right:s||a[1],bottom:o||a[2],left:i||a[3]}}}return{top:n,right:s,bottom:o,left:i}}const or={min:0,defaultUnit:"px",allowedUnits:["px","rem","%"],placeholder:"none",className:"w-10 px-0.5 py-0.5 text-xs"};function A0(){const{actions:{setProp:t},style:e={}}=Q.useNode(s=>({style:s.data.props.style||{}})),r=F.useMemo(()=>Ah(e,"margin"),[e]),n=F.useMemo(()=>Ah(e,"padding"),[e]);return h.jsx(_n,{title:"Spacing",icon:h.jsx(_.FiMove,{size:14,className:"text-[#170F4F]"}),defaultOpen:!1,children:h.jsx("div",{className:"space-y-3",children:h.jsx("div",{children:h.jsxs("div",{className:"relative border border-[#dce7fe] bg-[#F9FAFB] p-2",children:[h.jsx("div",{className:"absolute left-1 top-[-2px] -translate-y-1/2",children:h.jsx("span",{className:"bg-[#F9FAFB] px-1 text-xs text-[#A29FB9]",style:{background:"linear-gradient(to bottom,transparent 0%,transparent 50%, #F9FAFB 50%, #F9FAFB 100%)"},children:"Margin"})}),h.jsx("div",{className:"mb-1 flex justify-center",children:h.jsx(xt,{value:r.top,onChange:s=>t(o=>o.style.marginTop=s.text),...or})}),h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsx(xt,{value:r.left,onChange:s=>t(o=>o.style.marginLeft=s.text),...or}),h.jsxs("div",{className:"relative mx-2 my-1 flex-1 border-2 border-dashed border-[#3B82F6] bg-[#EFF6FF] p-2",children:[h.jsx("div",{className:"absolute left-1 top-[-3px] -translate-y-1/2",children:h.jsx("span",{className:"bg-[#EFF6FF] px-1 text-xs text-[#3B82F6]",style:{background:"linear-gradient(to bottom, transparent 0%, transparent 50%, #EFF6FF 50%, #EFF6FF 100%)"},children:"Padding"})}),h.jsx("div",{className:"mb-1 flex justify-center",children:h.jsx(xt,{value:n.top,onChange:s=>t(o=>o.style.paddingTop=s.text),...or})}),h.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[h.jsx(xt,{value:n.left,onChange:s=>t(o=>o.style.paddingLeft=s.text),...or}),h.jsx("div",{className:"mx-2 my-1 flex h-6 flex-1 items-center justify-center border border-[#D1D5DB] bg-white px-2 py-1",children:h.jsx("span",{className:"text-[10px] font-medium text-[#6B7280] opacity-60",children:"Content"})}),h.jsx(xt,{value:n.right,onChange:s=>t(o=>o.style.paddingRight=s.text),...or})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(xt,{value:n.bottom,onChange:s=>t(o=>o.style.paddingBottom=s.text),...or})})]}),h.jsx(xt,{value:r.right,onChange:s=>t(o=>o.style.marginRight=s.text),...or})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(xt,{value:r.bottom,onChange:s=>t(o=>o.style.marginBottom=s.text),...or})})]})})})})}function BT(){return h.jsxs(h.Fragment,{children:[h.jsx(F0,{}),h.jsx(A0,{}),h.jsx(E0,{}),h.jsx(S0,{})]})}const jT=[{value:"Arial, Helvetica, sans-serif",label:"Arial"},{value:"Verdana, Geneva, sans-serif",label:"Verdana"},{value:"Tahoma, Geneva, sans-serif",label:"Tahoma"},{value:"'Trebuchet MS', Helvetica, sans-serif",label:"Trebuchet MS"},{value:"Helvetica, Arial, sans-serif",label:"Helvetica"},{value:"'Times New Roman', Times, serif",label:"Times New Roman"},{value:"Georgia, serif",label:"Georgia"},{value:"'Palatino Linotype', 'Book Antiqua', Palatino, serif",label:"Palatino Linotype"},{value:"'Courier New', Courier, monospace",label:"Courier New"},{value:"'Lucida Console', Monaco, monospace",label:"Lucida Console"}],OT=[{label:"Lighter",value:"lighter"},{label:"Normal",value:"normal"},{label:"Bold",value:"bold"},{label:"Bolder",value:"bolder"},{label:"100",value:"100"},{label:"200",value:"200"},{label:"300",value:"300"},{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"},{label:"800",value:"800"},{label:"900",value:"900"}],LT=[{label:"Normal",value:"normal"},{label:"No wrapped",value:"nowrap"}];function _T(){const{actions:{setProp:t},style:e={}}=Q.useNode(s=>({style:s.data.props.style})),r=F.useCallback(s=>{t(o=>{o.style={...o.style,...s}})},[t]),n=F.useMemo(()=>In(r,300),[r]);return h.jsx(_n,{title:"Typography",icon:h.jsx(ns.LuType,{size:14,className:"text-[#170F4F]"}),defaultOpen:!0,children:h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Font"}),h.jsx(Mt,{options:jT,value:e.fontFamily||"Inter",onChange:s=>r({fontFamily:s}),placeholder:"Choose font family"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Size"}),h.jsx("input",{type:"number",min:8,max:96,value:e.fontSize||20,onChange:s=>r({fontSize:Number(s.target.value)}),className:"w-full border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Weight"}),h.jsx(Mt,{options:OT,value:e.fontWeight||"normal",onChange:s=>r({fontWeight:s}),placeholder:"Choose font weight"})]})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(_.FiMove,{size:14,className:"text-[#170F4F]"}),h.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:"Alignment"})]}),h.jsx("div",{className:"flex gap-2",children:["left","center","right","justify"].map(s=>h.jsx("button",{className:`rounded border px-3 py-2 text-xs font-medium transition-all focus:outline-none focus:ring-2 focus:ring-[#170F4F] ${e.textAlign===s?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>r({textAlign:s}),children:s.charAt(0).toUpperCase()+s.slice(1)},s))}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-1 block text-xs text-[#A29FB9]",children:"Line Break"}),h.jsx(Mt,{options:LT,value:e.whiteSpace||"normal",onChange:s=>r({whiteSpace:s}),placeholder:"Choose whiteSpace"})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ns.LuRemoveFormatting,{size:14,className:"text-[#170F4F]"}),h.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:"Formatting"})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{className:`rounded border px-3 py-2 text-xs font-bold ${e?.fontWeight==="bold"?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>r({fontWeight:e?.fontWeight==="bold"?"normal":"bold"}),children:h.jsx(ns.LuBold,{size:14,className:"text-[#170F4F]"})}),h.jsx("button",{className:`rounded border px-3 py-2 text-xs italic ${e?.fontStyle==="italic"?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>r({fontStyle:e?.fontStyle==="italic"?"normal":"italic"}),children:h.jsx(ns.LuItalic,{size:14,className:"text-[#170F4F]"})}),h.jsx("button",{className:`rounded border px-3 py-2 text-xs underline ${e?.textDecoration==="underline"?"border-[#00BAC7] bg-[#CCF1F4]":"border-[#E8E7EE] bg-white"}`,onClick:()=>r({textDecoration:e?.textDecoration==="underline"?"none":"underline"}),children:h.jsx(ns.LuUnderline,{size:14,className:"text-[#170F4F]"})})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(_.FiEdit3,{size:14,className:"text-[#170F4F]"}),h.jsx("h3",{className:"text-sm font-medium text-[#170F4F]",children:"Text Color"})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"color",value:e.color||"#000000",onChange:s=>n({color:s.target.value}),className:"h-10 w-10 cursor-pointer border border-[#E8E7EE] transition-colors hover:border-[#170F4F]","aria-label":"Text color"}),h.jsx("input",{type:"text",value:e.color||"#000000",onChange:s=>r({color:s.target.value}),className:"flex-1 border border-[#E8E7EE] px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"#000000"})]})]})]})})}const IT={default:BT,typography:_T,layout:F0,spacing:A0,background:E0,border:S0,box:Lh,text:MT,button:Kl,image:Xl,anchor:Jl,divider:Gl,table:Ql,conditional:Rh},RT=Object.entries(IT).map(([t,e])=>({id:t,component:e}));function PT(){const{selected:t,query:e}=Q.useEditor(s=>({selected:s.events.selected}));if(!t||t.size===0)return h.jsx("div",{className:"flex h-full items-center justify-center text-gray-500",children:h.jsxs("div",{className:"text-center",children:[h.jsx(_.FiSettings,{size:48,className:"mx-auto mb-4 text-gray-300"}),h.jsx("p",{className:"text-sm",children:"Select a component to see its settings"})]})});const r=Array.from(t)[0],n=e.node(r).get();if(!n)return null;if(n&&n.data.custom&&n.data.custom.settings){const s=n.data.custom.settings,i=(Array.isArray(s)?s:[s]).map(a=>RT.find(l=>l.id===a)).filter(Boolean);if(i.length>0)return h.jsx(h.Fragment,{children:i.map(a=>{const l=a.component;return Be.default.createElement(Q.NodeProvider,{id:r,related:!0,key:a.id},h.jsx(l,{}))})})}return h.jsx("div",{className:"p-4",children:h.jsx("p",{className:"text-sm text-gray-500",children:"No custom settings available for this component."})})}const zT=[{id:"settings",label:"Settings",icon:_.FiSettings},{id:"info",label:"Info",icon:_.FiInfo},{id:"actions",label:"Actions",icon:_.FiEye}];function $T(){const{selected:t,query:e}=Q.useEditor(a=>({selected:a.events.selected})),[r,n]=F.useState("settings"),s=Array.from(t)?.[0],o=F.useMemo(()=>({settings:h.jsx(PT,{},`settings_${s}`),info:h.jsx(nC,{}),actions:h.jsx(rC,{})}),[s]),i=F.useMemo(()=>{if(!t||t.size===0)return null;const a=e.node(s).get();return a?{id:s,type:a.data.type,displayName:a.data.displayName||String(a.data.type),props:a.data.props,isCanvas:a.data.isCanvas,isDeletable:!0,isDuplicateable:!0,parent:a.data.parent}:null},[t,e]);return h.jsxs("div",{className:"flex h-full w-80 flex-col border-l border-[#e8e7ee] bg-white",children:[i&&h.jsx(tC,{name:String(i.displayName)}),i&&h.jsx("div",{className:"flex border-b border-[#e8e7ee]",children:zT.map(a=>{const l=a.icon;return h.jsxs("button",{onClick:()=>n(a.id),className:`flex flex-1 items-center justify-center gap-2 px-3 py-2 text-xs font-medium transition-colors duration-200 ${r===a.id?"border-b-2 border-[#170f4f] bg-white text-[#170f4f]":"text-gray-500 hover:bg-gray-50 hover:text-[#170f4f]"}`,children:[h.jsx(l,{size:14}),a.label]},a.id)})}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:o[r]})]})}function HT({blocks:t,searchTerm:e}){const{connectors:r,query:n}=Q.useEditor(),[s,o]=F.useState(new Set),i=F.useRef({}),l=F.useMemo(()=>e.trim()?(o(new Set),t.filter(v=>v.label.toLowerCase().includes(e.toLowerCase())||v.category?.toLowerCase().includes(e.toLowerCase()))):t,[t,e]).reduce((v,w)=>{const D=w.category||"other";return v[D]||(v[D]=[]),v[D].push(w),v},{}),c=v=>{o(w=>{const D=new Set(w);return D.has(v)?D.delete(v):D.add(v),D})};F.useEffect(()=>{const v=Object.keys(l);if(v[0]&&s.size===0){const D=new Set(v.slice(1));o(D)}},[]);const d=v=>h.jsxs("div",{ref:w=>{w&&r.create(w,Be.default.createElement(v.component,{}),{})},className:"group flex cursor-move flex-col items-center gap-1.5 rounded-md bg-white p-2.5 text-center transition-all duration-200 hover:bg-gray-50",draggable:!0,onDragStart:w=>{w.currentTarget.style.opacity="0.5"},onDragEnd:w=>{w.currentTarget.style.opacity="1"},title:`Drag to add ${v.label} component`,children:[h.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded bg-[#170F4F] text-sm text-white",children:v.icon}),h.jsx("span",{className:"text-xs font-medium leading-tight text-gray-700",children:v.label})]},v.id),f={layout:"Layout",content:"Content",interactive:"Interactive",media:"Media",dynamic:"Dynamic",other:"Other"},m={layout:h.jsx(_.FiGrid,{size:14}),content:h.jsx(_.FiType,{size:14}),interactive:h.jsx(_.FiMousePointer,{size:14}),media:h.jsx(_.FiImage,{size:14}),dynamic:h.jsx(_.FiCode,{size:14}),other:h.jsx(_.FiPackage,{size:14})},g=n.node("ROOT").get(),y=g&&g.data.nodes&&g.data.nodes.length>0;return h.jsxs("div",{className:"flex h-full flex-col",children:[!y&&h.jsx("div",{className:"border-b border-[#E8E7EE] bg-gray-50/50 px-3 py-2",children:h.jsx("p",{className:"text-xs text-gray-500",children:"Drag components to the canvas to add them"})}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[Object.entries(l).map(([v,w])=>{const D=s.has(v);return h.jsxs("div",{className:"last:mb-0",children:[h.jsxs("button",{onClick:()=>c(v),className:"mb-3 flex w-full items-center gap-2 rounded p-2 text-gray-700 transition-all duration-200 hover:bg-gray-50",children:[h.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded transition-colors hover:bg-gray-100",children:D?h.jsx(_.FiChevronRight,{size:12,className:"text-gray-400"}):h.jsx(_.FiChevronDown,{size:12,className:"text-gray-400"})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"text-gray-600",children:m[v]||m.other}),h.jsx("h3",{className:"text-sm font-medium text-gray-900",children:f[v]||v})]}),h.jsx("div",{className:"h-px flex-1 bg-gray-200"}),h.jsx("span",{className:"text-xs font-medium text-gray-500",children:w.length})]}),h.jsx("div",{ref:E=>{i.current[v]=E},style:{overflow:"hidden",transition:"height 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:!D&&h.jsx("div",{className:"pb-1",children:h.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:w.map(d)})})})]},v)}),Object.entries(l).length===0&&h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100",children:h.jsx("span",{className:"text-lg",children:"📦"})}),h.jsx("h3",{className:"mb-1 text-sm font-medium text-gray-900",children:e?"No components found":"No blocks available"}),h.jsx("p",{className:"text-xs text-gray-500",children:e?"Try different search terms":"Add components to get started"})]})]})]})}const VT=t=>Rs.find(r=>{const n=r.label.toLowerCase(),s=r.id.toLowerCase(),o=t.toLowerCase();return n===o||s===o})?.icon||h.jsx(_.FiMousePointer,{size:16});function qT({searchTerm:t}){const[e,r]=F.useState(new Set),{nodes:n,actions:s,selected:o}=Q.useEditor(g=>({nodes:g.nodes,selected:g.events.selected})),i=g=>{const y=new Set(e);y.has(g)?y.delete(g):y.add(g),r(y)},a=(g,y)=>{if(!y.trim())return g;const v=new RegExp(`(${y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return g.split(v).map((D,E)=>v.test(D)?h.jsx("span",{className:"rounded bg-yellow-200 px-0.5 text-yellow-900",children:D},E):D)},l=(g,y=0,v=!1,w=[])=>{const D=n[g];if(!D)return null;const E=D.data.isCanvas,N=D.data.nodes||[],A=D.data.displayName||(typeof D.data.type=="string"?D.data.type:D.data.type?.displayName)||g,T=o&&o.has(g),j=typeof D.data.name=="string"?D.data.name:D.data?.displayName||"",B=N.length>0,$=e.has(g),O=t.trim()===""||A.toLowerCase().includes(t.toLowerCase())||j.toLowerCase().includes(t.toLowerCase()),z=t.trim()!==""&&N.some(q=>{const J=n[q];if(!J)return!1;const K=J.data.displayName||(typeof J.data.type=="string"?J.data.type:J.data.type?.displayName)||q,ae=typeof J.data.name=="string"?J.data.name:J.data?.displayName||"";return K.toLowerCase().includes(t.toLowerCase())||ae.toLowerCase().includes(t.toLowerCase())});return O||z?h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("div",{className:"flex w-full items-center",children:[y>0&&h.jsx("div",{style:{width:y*20}}),h.jsxs("div",{className:`group flex w-full items-center rounded-md px-2 py-1.5 transition-colors ${T?"bg-[#170F4F]/10 hover:bg-[#170F4F]/15":"hover:bg-gray-50"} ${O&&t.trim()?"ring-1 ring-yellow-300":""}`,children:[B?h.jsx("button",{onClick:()=>i(g),className:"mr-1.5 flex h-4 w-4 items-center justify-center rounded opacity-0 transition-opacity hover:bg-gray-200 group-hover:opacity-100",children:$?h.jsx(_.FiChevronRight,{size:12,className:"text-gray-500"}):h.jsx(_.FiChevronDown,{size:12,className:"text-gray-500"})}):h.jsx("div",{className:"w-6"}),h.jsx("div",{className:`mr-2.5 flex h-5 w-5 items-center justify-center ${T?"text-[#170F4F]":"text-gray-600"}`,children:VT(j)}),h.jsx("button",{className:`flex-1 text-left text-sm font-medium transition-colors ${T?"text-[#170F4F]":"text-gray-700 group-hover:text-[#170F4F]"}`,onClick:()=>s.selectNode(g),children:a(A,t)})]})]}),E&&B&&(!$||t.trim()!=="")&&h.jsx("div",{className:"ml-0",children:N.map((q,J)=>l(q,y+1,J===N.length-1,[...w,v]))})]},g):null},d=n.ROOT?.data?.nodes||[],f=d.length>0,m=e.has("canvas");return h.jsx("div",{className:"flex h-full flex-col",children:h.jsxs("div",{className:"flex-1 space-y-0.5 overflow-y-auto p-2",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("div",{className:"flex w-full items-center",children:h.jsxs("div",{className:`group flex w-full items-center rounded-md px-2 py-1.5 transition-colors ${o&&o.has("ROOT")?"bg-[#170F4F]/10 hover:bg-[#170F4F]/15":"hover:bg-gray-50"}`,children:[f?h.jsx("button",{onClick:()=>i("canvas"),className:"mr-1.5 flex h-4 w-4 items-center justify-center rounded opacity-0 transition-opacity hover:bg-gray-200 group-hover:opacity-100",children:m?h.jsx(_.FiChevronRight,{size:12,className:"text-gray-500"}):h.jsx(_.FiChevronDown,{size:12,className:"text-gray-500"})}):h.jsx("div",{className:"w-6"}),h.jsx("div",{className:"mr-2.5 flex h-5 w-5 items-center justify-center text-[#170F4F]",children:h.jsx(_.FiFile,{size:14})}),h.jsx("button",{className:`flex-1 text-left text-sm font-medium transition-colors ${o&&o.has("ROOT")?"text-[#170F4F]":"text-gray-800 group-hover:text-[#170F4F]"}`,onClick:()=>s.selectNode("ROOT"),children:"Template"})]})}),f&&(!m||t.trim()!=="")&&h.jsx("div",{children:d.map((g,y)=>l(g,1,y===d.length-1,[!0]))})]}),!f&&h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"mb-2 flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100",children:h.jsx(_.FiLayers,{size:16,className:"text-gray-400"})}),h.jsx("p",{className:"mb-1 text-xs text-gray-500",children:"No layers yet"}),h.jsx("p",{className:"text-xs text-gray-400",children:"Add components to see them here"})]})]})})}const WT=({blocks:t=Rs})=>{const[e,r]=F.useState("blocks"),[n,s]=F.useState("");return h.jsxs("div",{className:"flex h-full w-64 flex-col overflow-hidden border-r border-[#E8E7EE] bg-white",children:[h.jsx("div",{className:"border-b border-[#E8E7EE] bg-gray-50 p-3",children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"text",placeholder:"Search components...",value:n,onChange:o=>s(o.target.value),className:"w-full border border-[#E8E7EE] bg-white px-3 py-2 pl-9 pr-9 text-sm text-gray-900 placeholder-gray-500 transition-all duration-200 focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]/20"}),h.jsx(_.FiSearch,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n&&h.jsx("button",{onClick:()=>s(""),className:"absolute right-3 top-1/2 -translate-y-1/2 rounded p-0.5 text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600",children:h.jsx(_.FiX,{size:14})})]})}),h.jsxs("div",{className:"flex border-b border-[#E8E7EE]",children:[h.jsx("button",{className:`flex-1 border-b py-3 text-sm font-medium transition-colors duration-200 ${e==="blocks"?"border-[#170F4F] text-[#170F4F]":"border-transparent text-[#A29FB9] hover:text-[#00BAC7]"}`,onClick:()=>r("blocks"),children:"Blocks"}),h.jsx("button",{className:`flex-1 border-b py-3 text-sm font-medium transition-colors duration-200 ${e==="layers"?"border-[#170F4F] text-[#170F4F]":"border-transparent text-[#A29FB9] hover:text-[#00BAC7]"}`,onClick:()=>r("layers"),children:"Layers"})]}),h.jsx("div",{className:"flex-1 overflow-hidden",children:e==="blocks"?h.jsx(HT,{blocks:t,searchTerm:n}):h.jsx(qT,{searchTerm:n})})]})},UT=({hasChildren:t})=>{const{device:e}=Fi();return t?null:h.jsx("div",{className:`pointer-events-none absolute inset-0 left-auto right-auto z-10 flex items-center justify-center ${e==="mobile"?"w-[10%]":"w-[20%]"}`,children:h.jsxs("div",{className:"mx-auto p-6 text-center",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center border border-[#170F4F] bg-[#E8E7EE]",children:h.jsx("span",{className:"text-2xl text-[#170F4F]",children:"📄"})}),h.jsx("h3",{className:"mb-2 text-lg font-medium text-[#170F4F]",children:"Start building your page"}),h.jsx("p",{className:"text-sm text-[#A29FB9]",children:"Drag components from the sidebar to create your page layout."})]})})},JT=({hasCanvasContent:t,showCodePanel:e})=>h.jsxs("div",{className:`${e?"w-1/2":"w-full"} mx-auto flex h-full flex-1 items-start justify-center overflow-scroll bg-gradient-to-br from-gray-100 to-gray-200 p-6 transition-all duration-300`,style:{maxHeight:"calc(100vh - 72px)"},children:[h.jsx(UT,{hasChildren:t}),h.jsx(Q.Frame,{children:h.jsx(Q.Element,{canvas:!0,is:"div",...il,style:{...il.style,maxWidth:Uh.desktop.width}})})]}),KT=()=>{const[t,e]=F.useState(!1),r=()=>{console.log("Export HTML clicked"),e(!1)},n=()=>{console.log("Data Source clicked"),e(!1)};return Be.default.useEffect(()=>{const s=o=>{t&&e(!1)};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[t]),h.jsxs("div",{className:"relative",children:[h.jsx("button",{onClick:()=>e(!t),className:"rounded p-1.5 text-[#6B7280] transition-all duration-200 hover:bg-[#F5F5F7] hover:text-[#170F4F]",title:"Menu options",children:h.jsx(_.FiMenu,{size:16})}),t&&h.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-48 rounded-md border border-[#E8E7EE] bg-white py-1 shadow-lg",children:[h.jsxs("button",{onClick:r,className:"flex w-full items-center gap-3 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[h.jsx(_.FiDownload,{size:14}),"Export HTML"]}),h.jsxs("button",{onClick:n,className:"flex w-full items-center gap-3 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:[h.jsx(_.FiDatabase,{size:14}),"Data Source"]})]})]})},GT=({canvasSize:t,showCodePanel:e,onPreviewModeToggle:r,onCanvasSizeChange:n,onCodePanelToggle:s,onSave:o,templateIsModified:i=!1,templateName:a,onTemplateNameChange:l,templateReference:c})=>{const[d,f]=F.useState(!1),m=Be.default.useRef(null);F.useEffect(()=>{d&&m.current&&(m.current.focus(),m.current.select())},[d]);const g=()=>{f(!1)},y=D=>{D.key==="Enter"&&f(!1),D.key==="Escape"&&f(!1)},v=D=>{l?.(D.target.value)},w=async D=>{try{await navigator.clipboard.writeText(D)}catch(E){console.error("Failed to copy slug:",E)}};return h.jsx("div",{className:"border-b border-[#E8E7EE] bg-white",children:h.jsx("div",{className:"px-3 py-3 sm:px-8",children:h.jsxs("div",{className:"relative flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(KT,{}),h.jsx("div",{className:"group",children:d?h.jsx("input",{ref:m,className:"w-full truncate rounded border-none bg-transparent px-1.5 text-base font-bold text-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",value:a,onChange:v,onBlur:g,onKeyDown:y,placeholder:"Untitled Template","aria-label":"Template name"}):h.jsxs("div",{className:"flex items-center",children:[h.jsxs("h1",{className:"cursor-pointer rounded px-1.5 py-1 text-base font-bold text-[#170F4F] hover:bg-gray-50",title:"Double-click to edit",onDoubleClick:()=>f(!0),children:[h.jsx("span",{className:"truncate",children:a||"Untitled Template"}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"mx-1.5 text-gray-300",children:"•"}),h.jsx("span",{className:"rounded-sm bg-gray-100 px-1 py-0.5 font-mono text-[10px] font-medium text-gray-600",children:c})]})]}),c&&h.jsx("button",{onClick:()=>w(c),className:"rounded p-0.5 opacity-0 transition-opacity hover:bg-gray-50 hover:text-[#170F4F] group-hover:opacity-100",title:"Copy slug to clipboard",children:h.jsx(_.FiCopy,{size:9,className:"text-gray-400"})})]})})]}),h.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:h.jsx("div",{className:"flex items-center gap-1 border border-[#E8E7EE] bg-white p-1",children:["desktop","tablet","mobile"].map(D=>{const E={desktop:h.jsx(_.FiMonitor,{size:16}),tablet:h.jsx(_.FiTablet,{size:16}),mobile:h.jsx(_.FiSmartphone,{size:16})};return h.jsxs("button",{className:`flex items-center gap-1.5 px-2 py-1 text-xs font-medium transition-all duration-200 ${t===D?"bg-[#170F4F] text-white":"text-[#170F4F] hover:bg-[#F5F5F7]"}`,onClick:()=>n(D),title:`Switch to ${D} view`,children:[h.jsx("span",{className:"inline sm:hidden",children:E[D]}),h.jsx("span",{className:"hidden sm:inline",children:D.charAt(0).toUpperCase()+D.slice(1)})]},D)})})}),h.jsxs("div",{className:"flex items-center gap-2",children:[i?h.jsxs("div",{className:"flex items-center gap-1 text-orange-600",children:[h.jsx("div",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"}),h.jsx("span",{className:"text-xs font-medium",children:"Unsaved"})]}):h.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),h.jsx("span",{className:"text-xs font-medium",children:"Saved"})]}),h.jsx("button",{className:`p-1.5 transition-all duration-200 ${e?"bg-[#170F4F] text-white":"text-[#6B7280] hover:bg-[#F5F5F7] hover:text-[#170F4F]"}`,onClick:s,title:"Toggle Code Editor",children:h.jsx(_.FiCode,{size:16})}),h.jsx("button",{onClick:r,className:"p-1.5 text-[#6B7280] transition-all duration-200 hover:bg-[#F5F5F7] hover:text-[#170F4F]",title:"Preview template",children:h.jsx(_.FiEye,{size:16})}),o&&h.jsxs("button",{className:"relative flex items-center gap-1.5 bg-[#170F4F] px-3 py-1.5 text-xs font-medium text-white transition-all duration-200 hover:bg-[#009CA8]",onClick:o,title:"Save changes",children:[h.jsx(_.FiSave,{size:14}),"Save",i&&h.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2 w-2 animate-pulse bg-orange-500"})]})]})]})})})},YT=F.lazy(()=>Promise.resolve().then(function(){return b3}).then(t=>({default:t.DataSourceModal}))),XT=({showCodePanel:t=!1,onPreviewToggle:e,onCodePanelToggle:r,codePanelChildren:n})=>{eC();const s=Fi(),o=Zl(),{store:i}=Q.useEditor(),{template:a,updateTemplate:l,saveTemplate:c}=Pn(),[d,f]=F.useState(!1),[m,g]=F.useState(!1),y=()=>{},v=async()=>{if(!a){alert("No template loaded to save");return}try{l({snapshot:s.getState(),content:o.convertToHtml(s.getState())}),await c(),alert("Template saved successfully!")}catch(w){console.error("Error saving template:",w),alert("Error saving template. Please try again.")}};return F.useEffect(()=>{if(!m&&a&&a?.snapshot)try{s.loadState(a.snapshot)}catch(w){console.error("Error loading template into canvas:",w)}finally{g(!0)}},[a?.id]),F.useEffect(()=>{i.subscribe(In(()=>{l({snapshot:s.getState(),content:o.convertToHtml(s.getState())})},500),()=>{})},[]),h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx(GT,{canvasSize:s.device,showCodePanel:t,onPreviewModeToggle:e||(()=>{}),onCanvasSizeChange:s.setDevice,onCodePanelToggle:r||(()=>{}),onSave:v,templateIsModified:a?.isModified,templateName:a?.title,onTemplateNameChange:w=>{l({title:w})},templateReference:a?.slug}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[!t&&h.jsx(WT,{}),h.jsxs("div",{className:`flex flex-1 ${t?"flex-row":"flex-col"}`,children:[t?n:null,h.jsx(JT,{canvasSize:s.device,hasCanvasContent:s.isEmpty,showCodePanel:t})]}),!t&&h.jsx($T,{})]}),d&&h.jsx(F.Suspense,{fallback:h.jsx("div",{children:"Loading..."}),children:h.jsx(YT,{isOpen:d,onClose:()=>f(!1),onDataImport:y})})]})},N0=({children:t,isHover:e,isSelected:r,name:n,showIndicator:s=!0,width:o,height:i})=>{const a=e&&!r&&s,l=r&&s,c=a||l,d={outline:l?"1px solid #170f4fff":a?"1px dashed #00BAC7":"1px solid transparent",background:l?"rgba(23,15,79,0.03)":a?"rgba(0,186,199,0.02)":"transparent",cursor:"pointer",overflow:"visible",position:"relative",width:o,height:i};return h.jsxs("div",{style:d,className:r?"avoid-transition":"",children:[c&&h.jsxs("div",{className:`absolute left-0 top-0 flex items-center gap-1.5 px-2 py-1 text-xs font-medium backdrop-blur-sm ${l?"border border-[#170F4F] bg-[#170F4F] text-white shadow-lg":"border border-[#00BAC7] bg-[#00BAC7] text-white shadow-md"} `,style:{borderRadius:"4px",transform:"translateY(-100%)",transformOrigin:"left bottom",marginTop:"-2px",zIndex:99999,position:"absolute",transition:"all 0.15s ease-out"},onClick:f=>{f.stopPropagation(),f.preventDefault()},onMouseDown:f=>{f.stopPropagation(),f.preventDefault()},children:[h.jsx("div",{className:"flex h-3 w-3 items-center justify-center",children:l?h.jsx("div",{className:"h-2 w-2 rounded-full bg-white"}):h.jsx("div",{className:"h-2 w-2 rounded-full bg-white opacity-70"})}),h.jsx("span",{className:"select-none whitespace-nowrap leading-none",children:n})]}),t]})},Nh=6,ir=-3,QT={position:"absolute",width:`${Nh}px`,height:`${Nh}px`,background:"#170F4F",display:"block",pointerEvents:"none",boxShadow:"0 2px 8px rgba(23,15,79,0.3)",border:"0.5px solid #CCF1F4"},ZT={topLeft:{left:`${ir}px`,top:`${ir}px`},topRight:{right:`${ir}px`,top:`${ir}px`},bottomLeft:{left:`${ir}px`,bottom:`${ir}px`},bottomRight:{right:`${ir}px`,bottom:`${ir}px`}},e3=({children:t,propKey:e={width:"width",height:"height"}})=>{const{actions:r,connectors:{connect:n}}=Q.useNode(),{isSelected:s,isHover:o,nodeWidth:i,nodeHeight:a,name:l}=Q.useNode(D=>({isSelected:D.events.selected,isHover:D.events.hovered,nodeWidth:D.data.props.style?.[e.width]||D.data.props[e.width]||200,nodeHeight:D.data.props.style?.[e.height]||D.data.props[e.height]||100,name:D.data.custom?.displayName||D.data.displayName})),{maxWidth:c}=Q.useEditor(D=>{const N=D.nodes.ROOT?.data?.props?.style||{},A=N.maxWidth||N.width||1200;return{maxWidth:typeof A=="string"?parseInt(A):A}}),d=F.useRef(null),f=F.useRef(null),m=F.useMemo(()=>{const D=()=>{if(typeof i=="number")return Math.round(i);if(typeof i=="string"){if(i.includes("%")&&c){const N=parseFloat(i)/100;return Math.round(c*N)}return i||200}return 200},E=()=>a==="auto"?"auto":typeof a=="number"?Math.round(a):typeof a=="string"?a.includes("%")?a:a||100:100;return{width:D(),height:E()}},[i,a,c]),[g,y]=F.useState(m),v=F.useCallback(()=>{y(m)},[m]);F.useEffect(()=>{if(!c)return;const D=typeof i=="number"?i:parseFloat(i)||0;if(D>c){const E=c/D,N=Math.floor(D*E);r.setProp(A=>{A.style||(A.style={}),A.style[e.width]=N})}},[c,i,r,e.width]);const w=F.useCallback((D,E)=>{if(!f.current)return m;const{width:N,height:A}=f.current;let T=Math.round(N+D),j=Math.round(A+E);return c&&(T=Math.min(T,c)),T=Math.max(T,50),j=Math.max(j,20),{width:T,height:j}},[m,c]);return F.useEffect(()=>{v(),r.setCustom(D=>{D.resizable=!0})},[i,a,v,r]),h.jsx(N0,{isHover:o,isSelected:s,name:l||"Component",showIndicator:!0,width:g.width,height:g.height,children:h.jsxs(H2.Resizable,{ref:D=>{D&&D.resizable&&(d.current=D,n(D.resizable))},enable:{top:s,right:s,bottom:s,left:s,topLeft:s,topRight:s,bottomLeft:s,bottomRight:s},size:g,onResizeStart:D=>{D.preventDefault(),D.stopPropagation();const E=d.current?.resizable;if(!E)return;const N=E.getBoundingClientRect();f.current={width:Math.round(N.width),height:Math.round(N.height)}},onResize:(D,E,N,A)=>{const T=w(A.width,A.height);r.setProp(j=>{j.style||(j.style={}),j.style[e.width]=T.width,j.style[e.height]=T.height}),v()},onResizeStop:(D,E,N,A)=>{const T=w(A.width,A.height);r.setProp(j=>{j.style||(j.style={}),j.style[e.width]=T.width,j.style[e.height]=T.height}),v()},handleStyles:{topLeft:{display:"block"},topRight:{display:"block"},bottomLeft:{display:"block"},bottomRight:{display:"block"}},children:[t,h.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:99999},children:s&&Object.entries(ZT).map(([D,E])=>h.jsx("span",{style:{...QT,...E}},D))})]})})},t3=({render:t})=>{const{id:e,isHover:r,isActive:n,name:s,isResizable:o,nodeWidth:i,nodeHeight:a}=Q.useNode(c=>({isHover:c.events.hovered,isActive:c.events.selected,name:c.data.custom?.displayName||c.data.displayName,isResizable:c.data.custom.resizable===!0,nodeWidth:c.data.props.style?.width||c.data.props.width||"min-content",nodeHeight:c.data.props.style?.height||c.data.props.height||"min-content"}));return e===$2.ROOT_NODE?h.jsx(h.Fragment,{children:t}):o?h.jsx(e3,{children:t}):h.jsx(N0,{isHover:r,isSelected:n,name:s,width:i,height:a,children:t})};class Fe{static isSchema(e){return e!==null&&typeof e=="object"&&"type"in e&&"value"in e}static getByPath(e,r){const n=r.split(".");let s=e;for(let o=0;o<n.length;o++){if(s==null)return;s=s[n[o]]}return s}static deepClone(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>this.deepClone(n));const r={};for(const n in e)r[n]=this.deepClone(e[n]);return r}static setByPath(e,r,n){const s=r.split("."),o=this.deepClone(e);let i=o;for(let a=0;a<s.length-1;a++)(!i[s[a]]||typeof i[s[a]]!="object")&&(i[s[a]]={}),i=i[s[a]];return i[s[s.length-1]]=n,o}static deleteByPath(e,r){const n=r.split("."),s=this.deepClone(e);let o=s;for(let i=0;i<n.length-1;i++){if(!o[n[i]])return e;o=o[n[i]]}return delete o[n[n.length-1]],s}static toSchema(e,r,n){if(this.isSchema(e))return e;const s=typeof e;let o="text";return s==="number"?o="number":s==="boolean"?o="boolean":s==="string"&&e.length===10&&e[4]==="-"&&e[7]==="-"&&(o="date"),{key:r,label:n||r,type:o,value:e}}static getAllSchemas(e,r=""){const n={};for(const s in e){const o=e[s],i=r?`${r}.${s}`:s;if(this.isSchema(o))n[i]={...o,key:i};else if(typeof o=="object"&&o!==null){const a=this.getAllSchemas(o,i);for(let l=0;l<a.length;l++)n[a[l].key]=a[l]}else{const a=this.toSchema(o,i,s);n[a.key]=a}}return Object.values(n)}static resolve(e){const r={};for(const n in e){const s=e[n];this.isSchema(s)?r[n]=s.value:typeof s=="object"&&s!==null?r[n]=this.resolve(s):r[n]=s}return r}}const Th={desktop:{width:1200,height:800,name:"Desktop"},tablet:{width:768,height:1024,name:"Tablet"},mobile:{width:375,height:667,name:"Mobile"}},r3=({canvasSize:t,hasCanvasContent:e,onZoomChange:r,placeholderData:n={}})=>{const{template:s}=Pn(),[o,i]=F.useState(100),[a,l]=F.useState(""),c=F.useMemo(()=>Th[t]||Th.desktop,[t]);return F.useEffect(()=>{const d=()=>{const f=window.innerWidth-100,m=window.innerHeight-200,g=f/c.width,y=m/c.height,v=Math.min(g,y,1)*100,w=Math.max(25,Math.min(100,v));i(w),r&&r(w)};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[t,c.width,c.height,r]),F.useEffect(()=>{if(!e){l("");return}try{if(s&&s.id)if(typeof s.compile=="function"){const d=Fe.resolve(n),f=s.compile(d);l(f)}else console.warn("Template does not have compile method, using content"),l(s.content||"");else console.warn("Template not loaded or invalid"),l("")}catch(d){console.error("Error rendering template:",d),l("")}},[e,n,s]),h.jsx("div",{className:"relative flex flex-1 items-center justify-center overflow-auto bg-[#F5F5F7] p-8",children:h.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h.jsxs("div",{className:"relative overflow-hidden rounded-none border border-[#E8E7EE] bg-white shadow-lg",style:{width:c.width*(o/100),height:c.height*(o/100),maxWidth:"100%",maxHeight:"100%"},children:[t==="mobile"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"absolute inset-x-0 top-0 z-10 flex h-6 items-center justify-center bg-black",children:h.jsx("div",{className:"h-1 w-12 rounded-full bg-gray-600"})}),h.jsx("div",{className:"absolute inset-x-0 bottom-1 z-10 flex justify-center",children:h.jsx("div",{className:"h-1 w-16 rounded-full bg-black opacity-30"})})]}),h.jsxs("div",{className:"h-full w-full overflow-hidden",style:{transform:`scale(${o/100})`,transformOrigin:"top left",width:`${100/(o/100)}%`,height:`${100/(o/100)}%`},children:[!e&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50",children:h.jsxs("div",{className:"p-8 text-center",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-none border-2 border-dashed border-[#E8E7EE] bg-[#F5F5F7]",children:h.jsx("span",{className:"text-2xl text-[#A29FB9]",children:"📄"})}),h.jsx("h3",{className:"mb-2 text-lg font-medium text-[#170F4F]",children:"No content to preview"}),h.jsx("p",{className:"text-sm text-[#A29FB9]",children:"Add components to see the preview"})]})}),h.jsx("div",{className:"h-full min-h-screen bg-white",style:{overflow:"visible",position:"relative",minHeight:"100%"},dangerouslySetInnerHTML:{__html:a}})]})]})})})},Mh={desktop:{width:1200,height:800,name:"Desktop",icon:_.FiMonitor},tablet:{width:768,height:1024,name:"Tablet",icon:_.FiTablet},mobile:{width:375,height:667,name:"Mobile",icon:_.FiSmartphone}},n3=({canvasSize:t,onCanvasSizeChange:e,onExitPreview:r,onDownload:n,onOpenInNewTab:s,showPlayground:o=!1,onTogglePlayground:i})=>h.jsx("div",{className:"border-b border-[#E8E7EE] bg-white px-2 py-2",children:h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 rounded-none px-2 py-1.5 text-sm font-medium text-[#170F4F] transition-colors hover:bg-[#F5F5F7]",title:"Exit Preview",children:[h.jsx(_.FiX,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Exit Preview"})]}),h.jsx("div",{className:"h-6 w-px bg-[#E8E7EE]"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(_.FiEye,{className:"h-4 w-4 text-[#00BAC7]"}),h.jsx("span",{className:"hidden text-sm font-medium text-[#170F4F] min-[900px]:inline",children:"Preview"})]})]}),h.jsx("div",{className:"flex items-center gap-1",children:Object.keys(Mh).map(a=>{const l=Mh[a],c=l.icon,d=t===a;return h.jsx("button",{onClick:()=>e(a),className:`flex items-center justify-center rounded-none p-2 transition-all duration-200 ${d?"bg-[#170F4F] text-white":"border border-[#E8E7EE] text-[#170F4F] hover:bg-[#F5F5F7]"} `,title:l.name,children:h.jsx(c,{className:"h-4 w-4"})},a)})}),h.jsxs("div",{className:"flex items-center gap-1",children:[i&&h.jsx("button",{onClick:i,className:`flex items-center justify-center rounded-none p-2 transition-all duration-200 ${o?"bg-[#170F4F] text-white":"border border-[#E8E7EE] text-[#170F4F] hover:bg-[#F5F5F7]"} `,title:"Toggle Data Playground",children:h.jsx(_.FiDatabase,{className:"h-4 w-4"})}),h.jsx("button",{onClick:n,className:"flex items-center justify-center rounded-none border border-[#E8E7EE] p-2 text-[#170F4F] transition-colors hover:bg-[#F5F5F7]",title:"Download",children:h.jsx(_.FiDownload,{className:"h-4 w-4"})}),h.jsx("button",{onClick:s,className:"flex items-center justify-center rounded-none bg-[#170F4F] p-2 text-white transition-colors hover:bg-[#00BAC7]",title:"Open in New Tab",children:h.jsx(_.FiExternalLink,{className:"h-4 w-4"})})]})]})}),s3=({isOpen:t,onToggle:e,children:r,side:n="right",minWidth:s=350,maxWidth:o=700,defaultWidth:i=450,showToggleButton:a=!0,toggleButtonLabel:l="Toggle",resizable:c=!0,showOverlay:d=!0})=>{const[f,m]=F.useState(i),[g,y]=F.useState(!1),v=F.useRef(null),w=F.useRef(null),D=F.useRef(0),E=F.useRef(0),N=F.useCallback(z=>{c&&(y(!0),D.current=z.clientX,E.current=f,z.preventDefault())},[f,c]),A=F.useCallback(z=>{if(!g)return;const I=n==="right"?D.current-z.clientX:z.clientX-D.current,q=Math.min(o,Math.max(s,E.current+I));m(q)},[g,n,s,o]),T=F.useCallback(()=>{y(!1)},[]);F.useEffect(()=>{if(g)return document.addEventListener("mousemove",A),document.addEventListener("mouseup",T),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",T),document.body.style.cursor="",document.body.style.userSelect=""}},[g,A,T]);const j=t?"translate-x-0":n==="right"?"translate-x-full":"-translate-x-full",B=n==="right"?"border-l":"border-r",$=n==="right"?"right-0":"left-0",O=n==="right"?"left-0":"right-0";return h.jsxs(h.Fragment,{children:[t&&d&&h.jsx("div",{className:"absolute inset-0 z-[90] bg-transparent",onClick:e}),h.jsxs("div",{ref:v,className:`absolute bottom-0 top-0 z-[100] flex flex-col border-[#E8E7EE] bg-white shadow-2xl transition-transform duration-300 ease-in-out ${B} ${$} ${j}`,style:{width:`${f}px`},children:[c&&h.jsx("div",{ref:w,className:`absolute bottom-0 top-0 w-1 cursor-col-resize transition-colors duration-200 hover:bg-[#00BAC7] ${g?"bg-[#00BAC7]":"bg-transparent"} group ${O}`,onMouseDown:N,children:h.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform opacity-0 transition-opacity group-hover:opacity-100",children:h.jsx(_.FiMoreVertical,{className:"h-3 w-3 text-[#A29FB9]"})})}),a&&!t&&h.jsxs("button",{onClick:e,className:`group absolute top-1/2 z-10 flex -translate-y-1/2 items-center gap-2 border border-[#E8E7EE] bg-white px-2 py-6 text-sm font-medium text-[#170F4F] shadow-lg transition-all hover:bg-[#F5F5F7] ${n==="right"?"right-full rounded-l-lg border-r-0":"left-full rounded-r-lg border-l-0"}`,style:{writingMode:"vertical-rl"},children:[n==="right"?h.jsx(_.FiChevronLeft,{className:"h-4 w-4",style:{writingMode:"horizontal-tb"}}):h.jsx(_.FiChevronRight,{className:"h-4 w-4",style:{writingMode:"horizontal-tb"}}),h.jsx("span",{children:l})]}),r]})]})},o3=["eq","ne","gt","lt"],i3=({placeholders:t,onPlaceholdersChange:e})=>{const{template:r}=Pn(),n=F.useMemo(()=>{const l=[...r.content.matchAll(/\{\{(.*?)\}\}/g)].map(d=>d[1].trim()).map(d=>d.startsWith("#if ")?d.slice(4).trim():d),c=new Set;return l.forEach(d=>{if(d==="/if"||d==="else")return;const f=d.split(/\s+/);f.length===1?c.add(f[0]):f.forEach((m,g)=>{if(o3.includes(m.replace(/[()"]/g,""))&&f[g+1]){const y=f[g+1];c.add(y)}})}),[...c]},[r.content]),s=Fe.getAllSchemas(t).map(l=>l.key),o=n.filter(l=>!s.includes(l)),i=l=>{const c={key:l,label:l,type:"text",value:"Sample text"};e(d=>Fe.setByPath(d,l,c))},a=F.useMemo(()=>{const l=Math.ceil(o.length/3);return[o.slice(0,l),o.slice(l,l*2),o.slice(l*2)].filter(c=>c.length>0)},[o]);return h.jsx("div",{className:"mt-2 max-h-32 space-y-2 overflow-x-auto pb-2",children:a.map((l,c)=>h.jsx("div",{className:"flex flex-row gap-2",children:l.map(d=>h.jsx("span",{onClick:()=>i(d),className:"inline-flex flex-shrink-0 cursor-pointer items-center rounded-none bg-[#170F4F] bg-opacity-100 px-3 py-1 text-sm font-medium text-white transition-colors hover:bg-[#00BAC7]",children:d},d))},c))})},a3=({isOpen:t,onToggle:e,placeholders:r,onPlaceholdersChange:n})=>{const{template:s}=Pn(),[o,i]=F.useState({type:"text"}),[a,l]=F.useState(!1),[c,d]=F.useState(""),[f,m]=F.useState(null),[g,y]=F.useState(null),v=F.useMemo(()=>Fe.getAllSchemas(r),[r]),[w,D]=F.useState(v.length===0),E=F.useMemo(()=>{if(!c)return v;const I=c.toLowerCase();return v.filter(q=>q.key.toLowerCase().includes(I)||q.label.toLowerCase().includes(I))},[v,c]),N=(I,q)=>{n(J=>{const K=Fe.getByPath(J,I);return Fe.isSchema(K)?Fe.setByPath(J,I,{...K,value:q}):Fe.setByPath(J,I,q)})},A=()=>{if(!o.key||!o.label||!o.type)return;const I={key:o.key,label:o.label,type:o.type,value:o.value||T(o.type),options:o.options};n({...r,[I.key]:I}),i({type:"text"}),l(!1)},T=I=>{switch(I){case"text":return"Sample text";case"number":return 0;case"boolean":return!1;case"date":return new Date().toISOString().split("T")[0];case"enum":return"";default:return""}},j=I=>{n(q=>Fe.deleteByPath(q,I))},B=(I,q)=>{n(J=>{const K=Fe.getByPath(J,I);if(!Fe.isSchema(K))return J;const ae={...K,type:q,value:T(q),options:q==="enum"?K.options||[]:void 0};return Fe.setByPath(J,I,ae)}),m(null)},$=(I,q)=>{n(J=>{const K=Fe.getByPath(J,I);if(!Fe.isSchema(K))return J;const ae={...K,options:q};return Fe.setByPath(J,I,ae)})},O=I=>{switch(I){case"boolean":return"True/False";case"enum":return"Multiple Choice";case"text":return"Text";case"number":return"Number";case"date":return"Date"}},z=I=>{const q=Fe.getByPath(r,I.key),J=Fe.isSchema(q)?q.value:q??I.value??"";switch(I.type){case"text":return h.jsx("input",{type:"text",value:String(J),onChange:K=>N(I.key,K.target.value),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",placeholder:"Enter text here..."});case"number":return h.jsx("input",{type:"number",value:Number(J),onChange:K=>N(I.key,parseFloat(K.target.value)||0),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",placeholder:"Enter a number..."});case"boolean":return h.jsxs("div",{className:"flex items-center gap-4 rounded-none border border-[#E8E7EE] bg-white p-3",children:[h.jsxs("label",{className:"flex cursor-pointer items-center",children:[h.jsx("input",{type:"radio",name:`${I.key}-bool`,checked:!!J,onChange:()=>N(I.key,!0),className:"h-4 w-4 border-[#E8E7EE] text-[#170F4F] focus:ring-2 focus:ring-[#170F4F]"}),h.jsx("span",{className:"ml-2 text-sm font-medium text-[#170F4F]",children:"Yes"})]}),h.jsxs("label",{className:"flex cursor-pointer items-center",children:[h.jsx("input",{type:"radio",name:`${I.key}-bool`,checked:!J,onChange:()=>N(I.key,!1),className:"h-4 w-4 border-[#E8E7EE] text-[#170F4F] focus:ring-2 focus:ring-[#170F4F]"}),h.jsx("span",{className:"ml-2 text-sm font-medium text-[#170F4F]",children:"No"})]})]});case"enum":return h.jsxs("select",{value:String(J),onChange:K=>N(I.key,K.target.value),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",children:[h.jsx("option",{value:"",children:"Choose an option..."}),I.options?.map((K,ae)=>typeof K=="string"?h.jsx("option",{value:K,children:K},ae):h.jsx("option",{value:String(K.value),children:K.label},ae))]});case"date":return h.jsx("input",{type:"date",value:String(J),onChange:K=>N(I.key,K.target.value),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]"});default:return null}};return h.jsxs(s3,{isOpen:t,onToggle:e,side:"right",minWidth:350,maxWidth:700,defaultWidth:450,toggleButtonLabel:`Data (${v.length})`,resizable:!0,children:[h.jsxs("div",{className:"flex-shrink-0 border-b border-[#E8E7EE] bg-white px-6 py-4",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-lg font-semibold text-[#170F4F]",children:"Placeholders"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-2 rounded-none bg-[#170F4F] px-4 py-2 text-sm font-medium text-white shadow-sm transition-all duration-200 hover:bg-[#00BAC7] hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-[#170F4F] disabled:hover:shadow-sm",disabled:a,children:[h.jsx(_.FiPlus,{className:"h-4 w-4"}),"Add"]}),h.jsx("button",{onClick:e,className:"flex items-center justify-center rounded-none p-2 text-[#170F4F] transition-colors hover:bg-[#F5F5F7]",title:"Close drawer",children:h.jsx(_.FiChevronRight,{className:"h-5 w-5"})})]})]}),h.jsx("p",{className:"mb-4 text-sm text-[#A29FB9]",children:"Customize the content that appears in your template."}),v.length>8&&h.jsx("div",{className:"mb-4",children:h.jsx("input",{type:"text",value:c,onChange:I=>d(I.target.value),placeholder:"Search placeholders...",className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]"})}),(()=>{const I=[...new Set([...(s?.content||"").matchAll(/\{\{(.*?)\}\}/g)].map(K=>K[1]))],q=v.map(K=>K.key),J=I.filter(K=>!q.includes(K));return J.length>0?h.jsxs("div",{className:"rounded-none border border-[#E8E7EE] bg-[#F9F8FE]",children:[h.jsxs("button",{onClick:()=>D(!w),className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-[#F5F5F7]",children:[h.jsxs("p",{className:"text-xs font-semibold text-[#170F4F]",children:["Suggested Placeholders (",J.length,")"]}),w?h.jsx(_.FiChevronDown,{className:"h-4 w-4 text-[#170F4F]"}):h.jsx(_.FiChevronRight,{className:"h-4 w-4 text-[#170F4F]"})]}),h.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${w?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:h.jsx("div",{className:"px-3 pb-3",children:h.jsx(i3,{placeholders:r,onPlaceholdersChange:n})})})]}):null})(),a&&h.jsxs("div",{className:"mt-4 animate-fade-in rounded-none border border-[#E8E7EE] bg-white p-4 shadow-sm",children:[h.jsx("h4",{className:"mb-4 text-sm font-semibold text-[#170F4F]",children:"Add New Placeholder"}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-xs font-medium text-[#170F4F]",children:"Field Name"}),h.jsx("input",{type:"text",placeholder:"e.g., Customer Name",value:o.label||"",onChange:I=>{const q=I.target.value,J=q.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"_").replace(/^_+|_+$/g,"");i({...o,label:q,key:J})},className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-2 block text-xs font-medium text-[#170F4F]",children:"Data Type"}),h.jsxs("select",{value:o.type||"text",onChange:I=>i({...o,type:I.target.value}),className:"w-full rounded-none border border-[#E8E7EE] bg-white px-3 py-2 text-sm transition-all focus:border-[#170F4F] focus:bg-[#F9F8FE] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",children:[h.jsx("option",{value:"text",children:"Text"}),h.jsx("option",{value:"number",children:"Number"}),h.jsx("option",{value:"boolean",children:"True/False"}),h.jsx("option",{value:"enum",children:"Multiple Choice"}),h.jsx("option",{value:"date",children:"Date"})]})]})]}),h.jsxs("div",{className:"mt-6 flex gap-2 border-t border-[#E8E7EE] pt-4",children:[h.jsx("button",{onClick:A,disabled:!o.key||!o.label,className:"rounded-none bg-[#170F4F] px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors duration-200 hover:bg-[#00BAC7] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-[#170F4F]",children:"Confirm"}),h.jsx("button",{onClick:()=>l(!1),className:"rounded-none border border-[#E8E7EE] px-4 py-2 text-sm font-medium text-[#A29FB9] transition-colors duration-200 hover:bg-[#F9F8FE] hover:text-[#170F4F]",children:"Cancel"})]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:v.length===0?h.jsxs("div",{className:"py-12 text-center text-[#A29FB9]",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-none border border-[#E8E7EE] bg-[#F9F8FE]",children:h.jsx(_.FiPlus,{className:"h-8 w-8 text-[#170F4F]"})}),h.jsx("h4",{className:"mb-2 text-lg font-medium text-[#170F4F]",children:"No data fields yet"}),h.jsx("p",{className:"mb-4 text-sm",children:"Add data fields to make your template dynamic"}),h.jsx("button",{onClick:()=>l(!0),className:"text-sm font-medium text-[#170F4F] transition-colors duration-200 hover:text-[#00BAC7]",children:"Add your first field"})]}):E.length===0?h.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:h.jsxs("p",{className:"text-sm text-[#A29FB9]",children:['No placeholders found matching "',c,'"']})}):h.jsx("div",{className:"space-y-2 pb-6",children:E.map(I=>h.jsxs("div",{className:"rounded-none border border-[#E8E7EE] bg-white p-4 transition-all duration-200 hover:border-[#170F4F] hover:shadow-sm",children:[h.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[h.jsx("div",{className:"min-w-0 flex-1",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"inline-flex items-center break-all rounded-none bg-[#170F4F] bg-opacity-100 px-2 py-[2px] text-sm font-medium text-white",children:I.key}),f===I.key?h.jsxs("select",{value:I.type,onChange:q=>B(I.key,q.target.value),onBlur:()=>m(null),autoFocus:!0,className:"inline-flex flex-shrink-0 items-center rounded-none border border-[#E8E7EE] bg-[#F9F8FE] px-2 py-[2px] text-sm font-medium text-[#170F4F] transition-all hover:border-[#170F4F] focus:border-[#170F4F] focus:outline-none focus:ring-2 focus:ring-[#170F4F]",children:[h.jsx("option",{value:"text",children:"Text"}),h.jsx("option",{value:"number",children:"Number"}),h.jsx("option",{value:"boolean",children:"True/False"}),h.jsx("option",{value:"enum",children:"Multiple Choice"}),h.jsx("option",{value:"date",children:"Date"})]}):h.jsx("button",{onClick:()=>m(I.key),className:"inline-flex flex-shrink-0 items-center rounded-none border border-[#E8E7EE] bg-[#F9F8FE] px-2 py-[2px] text-sm font-medium text-[#170F4F] transition-all hover:border-[#170F4F] hover:bg-white",children:O(I.type)})]})}),h.jsx("button",{onClick:()=>j(I.key),className:"flex-shrink-0 rounded-none p-1 text-[#A29FB9] transition-colors duration-200 hover:bg-red-50 hover:text-red-500",title:"Remove field",children:h.jsx(_.FiTrash2,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:"w-full",children:z(I)}),I.type==="enum"&&h.jsxs("div",{className:"mt-3 border-t border-[#E8E7EE] pt-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-[#170F4F]",children:"Options"}),g!==I.key&&h.jsx("button",{onClick:()=>y(I.key),className:"text-xs font-medium text-[#170F4F] transition-colors hover:text-[#00BAC7]",children:"Edit options"})]}),g===I.key?h.jsxs("div",{className:"space-y-2",children:[(I.options||[]).map((q,J)=>{const K=typeof q=="string"?q:String(q.value);return h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:K,onChange:ae=>{const tt=[...I.options||[]];tt[J]=ae.target.value,$(I.key,tt)},className:"flex-1 rounded-none border border-[#E8E7EE] bg-white px-2 py-1 text-sm transition-all focus:border-[#170F4F] focus:outline-none focus:ring-1 focus:ring-[#170F4F]",placeholder:"Option value"}),h.jsx("button",{onClick:()=>{const ae=(I.options||[]).filter((tt,ft)=>ft!==J);$(I.key,ae)},className:"rounded-none p-1 text-[#A29FB9] transition-colors hover:bg-red-50 hover:text-red-500",title:"Remove option",children:h.jsx(_.FiTrash2,{className:"h-4 w-4"})})]},J)}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("button",{onClick:()=>{const q=[...I.options||[],""];$(I.key,q)},className:"flex items-center gap-1 rounded-none border border-[#E8E7EE] bg-white px-2 py-1 text-xs font-medium text-[#170F4F] transition-colors hover:bg-[#F9F8FE]",children:[h.jsx(_.FiPlus,{className:"h-3 w-3"}),"Add option"]}),h.jsx("button",{onClick:()=>y(null),className:"rounded-none px-2 py-1 text-xs font-medium text-[#A29FB9] transition-colors hover:text-[#170F4F]",children:"Done"})]})]}):h.jsx("div",{className:"flex flex-wrap gap-1",children:(I.options||[]).length===0?h.jsx("p",{className:"text-xs text-[#A29FB9]",children:"No options added yet"}):(I.options||[]).map((q,J)=>{const K=typeof q=="string"?q:q.label||q.value;return h.jsx("span",{className:"inline-flex items-center rounded-none border border-[#E8E7EE] bg-[#F9F8FE] px-2 py-[2px] text-xs text-[#170F4F]",children:K},J)})})]})]})]},I.key))})})]})},l3=()=>{const[t,e]=F.useState([]),r=F.useCallback((s,o="success")=>{const i=Date.now().toString();return e(a=>[...a,{id:i,message:s,type:o}]),i},[]),n=F.useCallback(s=>{e(o=>o.filter(i=>i.id!==s))},[]);return{toasts:t,showToast:r,hideToast:n}},Bh={[Pr.TemplateFormat.HTML]:{extension:"html",mimeType:"text/html"},[Pr.TemplateFormat.TEXT]:{extension:"txt",mimeType:"text/plain"},[Pr.TemplateFormat.PDF]:{extension:"pdf",mimeType:"application/pdf"}};class u3{static downloadFile(e,r){const n=URL.createObjectURL(e),s=document.createElement("a");s.href=n,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(n)}static getFileName(e,r){return`${e?.title||e.slug||"bolttech-page"}.${r}`}static html(e,r){const n=e.compile?e.compile(r):e.content,s=this.getFileName(e,"html"),o=new Blob([n],{type:"text/html"});this.downloadFile(o,s)}static async pdf(e,r){const n=await e.render(r),s=n instanceof Blob?n:new Blob([new Uint8Array(n)],{type:"application/pdf"}),o=this.getFileName(e,"pdf");this.downloadFile(s,o)}static async download(e,r){if(!e.format)throw new Error("Template format is missing. Please set a format for this template before downloading.");const n=Bh[e.format];if(!n)throw new Error(`Unsupported template format: ${e.format}. Supported formats: ${Object.keys(Bh).join(", ")}`);const{extension:s,mimeType:o}=n,i=await e.render(r),a=i instanceof Blob?i:new Blob([new Uint8Array(i)],{type:o}),l=this.getFileName(e,s);this.downloadFile(a,l)}}const c3=({message:t,type:e,onClose:r,duration:n=3e3})=>{const[s,o]=F.useState(!0),i=F.useMemo(()=>{const d=document.querySelector(".bolttech-template-editor");return d&&d.shadowRoot?d.shadowRoot:document.body},[]);F.useEffect(()=>{if(e!=="loading"&&n>0){const d=setTimeout(()=>{o(!1),setTimeout(r,300)},n);return()=>clearTimeout(d)}},[e,n,r]);const a=()=>{switch(e){case"loading":return h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#170F4F]",children:h.jsx(_.FiDownload,{className:"h-5 w-5 animate-pulse text-white"})});case"success":return h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#00BAC7]",children:h.jsx(_.FiCheck,{className:"h-5 w-5 text-white"})});case"error":return h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FF3B30]",children:h.jsx(_.FiAlertCircle,{className:"h-5 w-5 text-white"})})}},l=()=>{switch(e){case"loading":return"Downloading...";case"success":return"Success";case"error":return"Error"}},c=h.jsxs("div",{className:`absolute bottom-4 right-4 z-[10000] flex min-w-[320px] items-center gap-3 rounded-none border border-[#E8E7EE] bg-white px-4 py-3 shadow-lg transition-all duration-300 ${s?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"}`,children:[a(),h.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[h.jsx("span",{className:"text-sm font-semibold text-[#170F4F]",children:l()}),h.jsx("span",{className:"text-sm text-[#A29FB9]",children:t})]}),e!=="loading"&&h.jsx("button",{onClick:()=>{o(!1),setTimeout(r,300)},className:"rounded-none p-1 text-[#A29FB9] transition-colors hover:bg-[#F5F5F7] hover:text-[#170F4F]",children:h.jsx(_.FiX,{className:"h-4 w-4"})})]});return Ei.createPortal(c,i)},sl={desktop:{width:1200,height:800,name:"Desktop"},tablet:{width:768,height:1024,name:"Tablet"},mobile:{width:375,height:667,name:"Mobile"}},d3=({isPreviewMode:t,onExitPreview:e,initialPlaceholders:r={}})=>{const{getState:n,device:s,setDevice:o,isEmpty:i}=Fi(),{convertToHtml:a}=Zl(),{template:l}=Pn(),{toasts:c,showToast:d,hideToast:f}=l3(),[m,g]=F.useState(!1),[y,v]=F.useState(100),[w,D]=F.useState(!1),[E,N]=F.useState(r),A=F.useMemo(()=>{const O=document.querySelector(".bolttech-template-editor");return O&&O.shadowRoot?O.shadowRoot:document.body},[]),T=()=>{g(!0),setTimeout(()=>{e(),g(!1)},300)},j=async()=>{const O=d("Preparing download...","loading");try{const z=Fe.resolve(E);await u3.download(l,z),f(O),d("Download completed successfully!","success")}catch(z){f(O);const I=z instanceof Error?z.message:"Unknown error";d(`Failed to download: ${I}`,"error"),console.error("Error downloading file:",z)}},B=()=>{D(!w)};if(!t)return null;const $=h.jsxs("div",{className:`absolute inset-0 z-50 bg-[#F5F5F7] ${m?"animate-fade-out":"animate-fade-in"}`,children:[h.jsx("div",{className:m?"animate-slide-up-out":"animate-slide-down",children:h.jsx(n3,{canvasSize:s,onCanvasSizeChange:o,onExitPreview:T,onDownload:j,onOpenInNewTab:()=>{window.open()?.document.write(a(n()))},showPlayground:w,onTogglePlayground:B})}),h.jsxs("div",{className:"relative flex h-full overflow-hidden",children:[h.jsx("div",{className:m?"animate-slide-down-out":"animate-slide-up",style:{flex:1},children:h.jsx(r3,{canvasSize:s,hasCanvasContent:i,onZoomChange:v,placeholderData:E})}),h.jsx(a3,{isOpen:w,onToggle:B,placeholders:E,onPlaceholdersChange:N})]}),h.jsxs("div",{className:"absolute bottom-4 left-4 z-[60] rounded-none bg-[#170F4F] px-3 py-2 text-sm text-white shadow-md",children:[sl[s].name," • ",sl[s].width,"×",sl[s].height,"px • ",y.toFixed(3),"%"]}),c.map(O=>h.jsx(c3,{message:O.message,type:O.type,onClose:()=>f(O.id)},O.id))]});return Ei.createPortal($,A)},p3=({message:t="Loading...",size:e="md",fullScreen:r=!1})=>{const n={sm:"h-10 w-10",md:"h-16 w-16",lg:"h-24 w-24"},s=r?"fixed inset-0 z-50 flex items-center justify-center bg-white":"flex items-center justify-center";return h.jsx("div",{className:s,children:h.jsxs("div",{className:"flex flex-col items-center gap-6",children:[h.jsxs("div",{className:`relative ${n[e]}`,role:"status","aria-label":t,children:[h.jsx("div",{className:"absolute inset-0 animate-spin rounded-full border-4 border-border border-t-primary",style:{animationDuration:"1s"}}),h.jsx("div",{className:"absolute inset-2 animate-spin rounded-full border-4 border-border border-t-secondary",style:{animationDuration:"1.5s",animationDirection:"reverse"}})]}),t&&h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("p",{className:"text-sm font-medium text-primary",children:t}),h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-primary",style:{animationDelay:"0ms"}}),h.jsx("div",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-secondary",style:{animationDelay:"150ms"}}),h.jsx("div",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-accent",style:{animationDelay:"300ms"}})]})]})]})})},h3=Rs.reduce((t,e)=>(t[e.id]=e.component,t),{}),f3=({placeholders:t={}})=>{const e=Wh(),{error:r,loading:n,template:s}=Pn(),[o,i]=F.useState(!0);if(n)return h.jsx(p3,{message:"Loading template...",fullScreen:!0});const a=()=>{window.history.back()},l=()=>{i(!1)};return h.jsxs(h.Fragment,{children:[r&&o&&h.jsx(XD,{templateId:s?.id,errorMessage:r,onContinue:l,onGoBack:a}),h.jsxs(Q.Editor,{resolver:h3,onRender:t3,enabled:e.isEditorEnabled,children:[h.jsx(XT,{onPreviewToggle:e.togglePreview,showCodePanel:e.showCodePanel,onCodePanelToggle:e.toggleCodePanel,codePanelChildren:h.jsx(YD,{onClose:e.closeCodePanel})}),h.jsx(d3,{isPreviewMode:e.showPreview,onExitPreview:()=>e.togglePreview(),initialPlaceholders:t})]})]})},m3='@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Arial,Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 480px){.container{max-width:480px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1440px){.container{max-width:1440px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-2{inset:.5rem}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-0\\.5{right:-.125rem}.-top-0\\.5{top:-.125rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-4{bottom:1rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\\/2{left:50%}.left-3{left:.75rem}.left-4{left:1rem}.left-\\[75\\%\\]{left:75%}.left-auto{left:auto}.left-full{left:100%}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-auto{right:auto}.right-full{right:100%}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:.5rem}.top-\\[-2px\\]{top:-2px}.top-\\[-3px\\]{top:-3px}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.z-\\[10000\\]{z-index:10000}.z-\\[100\\]{z-index:100}.z-\\[60\\]{z-index:60}.z-\\[90\\]{z-index:90}.z-\\[9999\\]{z-index:9999}.mx-1\\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-\\[8px\\]{margin-bottom:8px}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-1\\.5{margin-right:.375rem}.mr-2\\.5{margin-right:.625rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\\[26px\\]{height:26px}.h-\\[400px\\]{height:400px}.h-\\[90vh\\]{height:90vh}.h-full{height:100%}.h-px{height:1px}.max-h-0{max-height:0px}.max-h-32{max-height:8rem}.max-h-96{max-height:24rem}.max-h-\\[42vh\\]{max-height:42vh}.min-h-\\[80px\\]{min-height:80px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-\\[10\\%\\]{width:10%}.w-\\[20\\%\\]{width:20%}.w-\\[26px\\]{width:26px}.w-\\[90\\%\\]{width:90%}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\\[120px\\]{min-width:120px}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[320px\\]{min-width:320px}.max-w-6xl{max-width:72rem}.max-w-\\[40vw\\]{max-width:40vw}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: .5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}.animate-fade-in{animation:fadeIn .4s ease-out}.animate-fade-out{animation:fadeOut .3s ease-in}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-slide-down{animation:slideDown .5s ease-out .1s both}.animate-slide-down-out{animation:slideDownOut .3s ease-in both}.animate-slide-up{animation:slideUp .5s ease-out .2s both}.animate-slide-up-out{animation:slideUpOut .3s ease-in both}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:4px}.rounded-none{border-radius:0}.rounded-sm{border-radius:2px}.rounded-l-lg{border-top-left-radius:8px;border-bottom-left-radius:8px}.rounded-r-lg{border-top-right-radius:8px;border-bottom-right-radius:8px}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\\[\\#00BAC7\\]{--tw-border-opacity: 1;border-color:rgb(0 186 199 / var(--tw-border-opacity, 1))}.border-\\[\\#170F4F\\],.border-\\[\\#170f4f\\]{--tw-border-opacity: 1;border-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.border-\\[\\#30aab3\\]{--tw-border-opacity: 1;border-color:rgb(48 170 179 / var(--tw-border-opacity, 1))}.border-\\[\\#3B82F6\\]{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-\\[\\#D1D5DB\\]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-\\[\\#E8E7EE\\]{--tw-border-opacity: 1;border-color:rgb(232 231 238 / var(--tw-border-opacity, 1))}.border-\\[\\#dce7fe\\]{--tw-border-opacity: 1;border-color:rgb(220 231 254 / var(--tw-border-opacity, 1))}.border-\\[\\#e8e7ee\\]{--tw-border-opacity: 1;border-color:rgb(232 231 238 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-border{--tw-border-opacity: 1;border-color:rgb(232 231 238 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-t-primary{--tw-border-opacity: 1;border-top-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.border-t-secondary{--tw-border-opacity: 1;border-top-color:rgb(48 170 179 / var(--tw-border-opacity, 1))}.bg-\\[\\#00BAC7\\]{--tw-bg-opacity: 1;background-color:rgb(0 186 199 / var(--tw-bg-opacity, 1))}.bg-\\[\\#170F4F\\]{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.bg-\\[\\#170F4F\\]\\/10{background-color:#170f4f1a}.bg-\\[\\#170f4f\\]{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.bg-\\[\\#181c24\\]{--tw-bg-opacity: 1;background-color:rgb(24 28 36 / var(--tw-bg-opacity, 1))}.bg-\\[\\#23272f\\]{--tw-bg-opacity: 1;background-color:rgb(35 39 47 / var(--tw-bg-opacity, 1))}.bg-\\[\\#CCF1F4\\]{--tw-bg-opacity: 1;background-color:rgb(204 241 244 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E8E7EE\\]{--tw-bg-opacity: 1;background-color:rgb(232 231 238 / var(--tw-bg-opacity, 1))}.bg-\\[\\#EFF6FF\\]{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F5F5F7\\]{--tw-bg-opacity: 1;background-color:rgb(245 245 247 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F9F8FE\\]{--tw-bg-opacity: 1;background-color:rgb(249 248 254 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FF3B30\\]{--tw-bg-opacity: 1;background-color:rgb(255 59 48 / var(--tw-bg-opacity, 1))}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(255 202 48 / var(--tw-bg-opacity, 1))}.bg-background-light{--tw-bg-opacity: 1;background-color:rgb(245 245 247 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\\/50{background-color:#00000080}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\\/50{background-color:#f9fafb80}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(48 170 179 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-opacity-100{--tw-bg-opacity: 1}.bg-opacity-40{--tw-bg-opacity: .4}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-gray-100{--tw-gradient-from: #f3f4f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(243 244 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-200{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\\[2px\\]{padding:2px}.px-0\\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\\[2px\\]{padding-top:2px;padding-bottom:2px}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-6{padding-bottom:1.5rem}.pb-8{padding-bottom:2rem}.pl-9{padding-left:2.25rem}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-9{padding-right:2.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[10px\\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:2px}.text-\\[\\#00BAC7\\]{--tw-text-opacity: 1;color:rgb(0 186 199 / var(--tw-text-opacity, 1))}.text-\\[\\#170F4F\\],.text-\\[\\#170f4f\\]{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.text-\\[\\#3B82F6\\]{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-\\[\\#6B7280\\]{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-\\[\\#A29FB9\\]{--tw-text-opacity: 1;color:rgb(162 159 185 / var(--tw-text-opacity, 1))}.text-\\[\\#FF3B30\\]{--tw-text-opacity: 1;color:rgb(255 59 48 / var(--tw-text-opacity, 1))}.text-\\[\\#FF9500\\]{--tw-text-opacity: 1;color:rgb(255 149 0 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted{--tw-text-opacity: 1;color:rgb(162 159 185 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-text{--tw-text-opacity: 1;color:rgb(53 65 86 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px rgba(0, 0, 0, .15);--tw-shadow-colored: 0 10px 15px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-yellow-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 224 71 / var(--tw-ring-opacity, 1))}.ring-yellow-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 204 21 / var(--tw-ring-opacity, 1))}.ring-opacity-50{--tw-ring-opacity: .5}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.avoid-transition,.avoid-transition *{transition:none!important}#canvas,#canvas *{transition:width .3s ease-in-out,height .3s ease-in-out,max-width .3s ease-in-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes slideDown{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideUpOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-20px)}}@keyframes slideDownOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(20px)}}@keyframes slideInRight{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}@keyframes slideOutRight{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(100%)}}.tiptap-global{border:1px solid #e8e7ee;padding:4px}#canvas ul,#canvas ol{padding:0 1rem;margin:1.25rem 1rem 1.25rem .4rem}#canvas ul li p,#canvas ol li p{margin-top:.25em;margin-bottom:.25em}#canvas ul{list-style:circle}#canvas ol{list-style:decimal}#canvas{h1,h2,h3,h4,h5,h6{line-height:1.1;text-wrap:pretty}h1,h2{margin-bottom:1.5rem}h1{font-size:1.4rem}h2{font-size:1.2rem}h3{font-size:1.1rem}h4,h5,h6{font-size:1rem}}.tiptap{:first-child{margin-top:0}padding:4px;min-height:100px;ul,ol{padding:0 1rem;margin:1.25rem 1rem 1.25rem .4rem;li p{margin-top:.25em;margin-bottom:.25em}}ul{list-style:circle}ol{list-style:decimal}h1,h2,h3,h4,h5,h6{line-height:1.1;text-wrap:pretty}h1,h2{margin-bottom:1.5rem}h1{font-size:1.4rem}h2{font-size:1.2rem}h3{font-size:1.1rem}h4,h5,h6{font-size:1rem}}.last\\:mb-0:last-child{margin-bottom:0}.hover\\:border-\\[\\#00BAC7\\]:hover{--tw-border-opacity: 1;border-color:rgb(0 186 199 / var(--tw-border-opacity, 1))}.hover\\:border-\\[\\#170F4F\\]:hover{--tw-border-opacity: 1;border-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.hover\\:border-\\[\\#170F4F\\]\\/30:hover{border-color:#170f4f4d}.hover\\:border-\\[\\#30aab3\\]:hover{--tw-border-opacity: 1;border-color:rgb(48 170 179 / var(--tw-border-opacity, 1))}.hover\\:border-red-300:hover{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.hover\\:bg-\\[\\#009CA8\\]:hover{--tw-bg-opacity: 1;background-color:rgb(0 156 168 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#00BAC7\\]:hover{--tw-bg-opacity: 1;background-color:rgb(0 186 199 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#170F4F\\]:hover{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#170F4F\\]\\/15:hover{background-color:#170f4f26}.hover\\:bg-\\[\\#30aab3\\]:hover{--tw-bg-opacity: 1;background-color:rgb(48 170 179 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#CCF1F4\\]:hover{--tw-bg-opacity: 1;background-color:rgb(204 241 244 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#F5F5F7\\]:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 247 / var(--tw-bg-opacity, 1))}.hover\\:bg-\\[\\#F9F8FE\\]:hover{--tw-bg-opacity: 1;background-color:rgb(249 248 254 / var(--tw-bg-opacity, 1))}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\\:bg-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(48 170 179 / var(--tw-bg-opacity, 1))}.hover\\:bg-surface:hover{--tw-bg-opacity: 1;background-color:rgb(243 242 247 / var(--tw-bg-opacity, 1))}.hover\\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[\\#00BAC7\\]:hover{--tw-text-opacity: 1;color:rgb(0 186 199 / var(--tw-text-opacity, 1))}.hover\\:text-\\[\\#170F4F\\]:hover,.hover\\:text-\\[\\#170f4f\\]:hover{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.hover\\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:shadow-md:hover{--tw-shadow: 0 4px 6px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 4px 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-sm:hover{--tw-shadow: 0 1px 2px rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\\:ring-gray-300:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.hover\\:ring-yellow-300:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 224 71 / var(--tw-ring-opacity, 1))}.hover\\:ring-opacity-50:hover{--tw-ring-opacity: .5}.focus\\:border-\\[\\#170F4F\\]:focus{--tw-border-opacity: 1;border-color:rgb(23 15 79 / var(--tw-border-opacity, 1))}.focus\\:bg-\\[\\#F9F8FE\\]:focus{--tw-bg-opacity: 1;background-color:rgb(249 248 254 / var(--tw-bg-opacity, 1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-inset:focus{--tw-ring-inset: inset}.focus\\:ring-\\[\\#170F4F\\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(23 15 79 / var(--tw-ring-opacity, 1))}.focus\\:ring-\\[\\#170F4F\\]\\/20:focus{--tw-ring-color: rgb(23 15 79 / .2)}.focus\\:ring-\\[\\#30aab3\\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(48 170 179 / var(--tw-ring-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-50:disabled{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.disabled\\:text-gray-600:disabled{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}.disabled\\:hover\\:bg-\\[\\#170F4F\\]:hover:disabled{--tw-bg-opacity: 1;background-color:rgb(23 15 79 / var(--tw-bg-opacity, 1))}.disabled\\:hover\\:shadow-sm:hover:disabled{--tw-shadow: 0 1px 2px rgba(0, 0, 0, .05);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group:hover .group-hover\\:block{display:block}.group:hover .group-hover\\:text-\\[\\#170F4F\\]{--tw-text-opacity: 1;color:rgb(23 15 79 / var(--tw-text-opacity, 1))}.group:hover .group-hover\\:opacity-100{opacity:1}@media (min-width: 768px){.sm\\:inline{display:inline}.sm\\:hidden{display:none}.sm\\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width: 900px){.min-\\[900px\\]\\:inline{display:inline}}';function T0({templateId:t,placeholders:e={},sdk:r={baseUrl:"",workspace:""},width:n="100%",height:s="100%"}){return h.jsxs(q2.default.div,{className:"bolttech-template-editor",style:{height:s,width:n,position:"relative",overflow:"hidden"},children:[h.jsx("style",{type:"text/css",children:m3}),h.jsx(JD,{templateId:t,baseUrl:r.baseUrl,workspace:r.workspace,children:h.jsx(f3,{placeholders:e})})]})}const ol=({name:t,value:e,path:r,onSelect:n,isSelected:s})=>{const o=typeof e=="object"&&e!==null&&!Array.isArray(e),i=Array.isArray(e),a=()=>e===null?"null":e===void 0?"undefined":typeof e=="string"?`"${e}"`:typeof e=="number"||typeof e=="boolean"?String(e):i?`Array(${e.length})`:o?`Object(${Object.keys(e).length})`:String(e),l=()=>e===null?"null":e===void 0?"undefined":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":i?"array":o?"object":typeof e;return h.jsxs("button",{onClick:()=>n(r,e),className:`flex min-w-[120px] flex-col items-center gap-1 rounded-none border border-[#e8e7ee] p-3 transition-all duration-200 ${s?"border-[#30aab3] bg-[#170f4f] text-white":"bg-white text-[#170f4f] hover:border-[#30aab3] hover:bg-gray-50"}`,children:[h.jsx("div",{className:"text-xs font-medium",children:t}),h.jsx("div",{className:`text-xs ${l()==="string"?"text-green-600":l()==="number"?"text-blue-600":l()==="boolean"?"text-purple-600":l()==="null"?"text-gray-500":"text-orange-600"} ${s?"text-white":""}`,children:a()}),h.jsxs("div",{className:`text-xs ${s?"text-gray-300":"text-gray-400"}`,children:["(",l(),")"]})]})},M0=({data:t,onPathSelect:e})=>{const[r,n]=F.useState([]),[s,o]=F.useState(null),[i,a]=F.useState(!1),l=(y,v)=>v.reduce((w,D)=>{if(w!=null){if(D.startsWith("[")&&D.endsWith("]")){const E=parseInt(D.slice(1,-1),10);return w[E]}return w[D]}},y),d=(()=>{const y=[];let v=[],w=t;y.push({path:[],value:t,isRoot:!0});for(const D of r)v=[...v,D],w=l(t,v),w!=null&&typeof w=="object"&&y.push({path:[...v],value:w,isRoot:!1});return y})(),f=(y,v,w)=>{if(typeof w=="object"&&w!==null&&(n(D=>[...D.slice(0,y),v]),e)){const D=[...d[y].path,v];e(D.join("."))}},m=(y,v,w)=>{if(typeof w!="object"||w===null){if(o({path:[...d[y].path,v],value:w}),e){const D=[...d[y].path,v];e(D.join("."))}}else o(null)},g=(y,v)=>{const w=y.value;return y.isRoot?h.jsx("div",{className:"flex min-w-[140px] flex-col gap-2",children:Object.entries(t).map(([D,E])=>h.jsx(ol,{name:D,value:E,path:D,onSelect:(N,A)=>typeof A=="object"&&A!==null?f(0,D,A):m(0,D,A),isSelected:r.length===0},D))},v):Array.isArray(w)?h.jsx("div",{className:"flex min-w-[140px] flex-col gap-2",children:w.map((D,E)=>h.jsx(ol,{name:`[${E}]`,value:D,path:`[${E}]`,onSelect:(N,A)=>typeof A=="object"&&A!==null?f(v,`[${E}]`,A):m(v,`[${E}]`,A),isSelected:!1},E))},v):typeof w=="object"&&w!==null?h.jsx("div",{className:"flex min-w-[140px] flex-col gap-2",children:Object.entries(w).map(([D,E])=>h.jsx(ol,{name:D,value:E,path:D,onSelect:(N,A)=>typeof A=="object"&&A!==null?f(v,D,A):m(v,D,A),isSelected:!1},D))},v):null};return h.jsxs("div",{className:"overflow-x-auto rounded-none border border-[#e8e7ee] bg-white",children:[h.jsx("div",{className:"border-b border-[#e8e7ee] bg-gray-50 px-4 py-2",children:h.jsx("h3",{className:"text-sm font-medium text-[#170f4f]",children:"Data Structure"})}),h.jsxs("div",{className:"flex gap-6 overflow-x-auto p-4",children:[d.map((y,v)=>g(y,v)),s&&h.jsx("div",{className:"flex min-w-[180px] flex-col gap-2",children:h.jsxs("div",{className:"mt-2 rounded-none border border-[#e8e7ee] bg-gray-50 p-3",children:[h.jsx("h4",{className:"mb-1 text-xs font-medium text-gray-600",children:"Selected Value"}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx("span",{className:"font-medium",children:"Path:"})," ",s.path.join("."),h.jsx("button",{className:"ml-1 text-gray-400 hover:text-gray-600",onClick:()=>{navigator.clipboard.writeText(s.path.join(".")),a(!0),setTimeout(()=>a(!1),2e3)},title:"Copy path",children:i?h.jsx(_.FiCheck,{size:14}):h.jsx(_.FiCopy,{size:14})})]}),h.jsxs("div",{className:"text-sm",children:[h.jsx("span",{className:"font-medium",children:"Value:"})," ",String(s.value)]}),h.jsxs("div",{className:"text-sm",children:[h.jsx("span",{className:"font-medium",children:"Type:"})," ",typeof s.value]})]})})]})]})},g3=({isOpen:t,onClose:e,onDataImport:r})=>{const[n,s]=F.useState("url"),[o,i]=F.useState(""),[a,l]=F.useState(""),[c,d]=F.useState(""),[f,m]=F.useState(!1),[g,y]=F.useState(""),[v,w]=F.useState(!1),[D,E]=F.useState(null);F.useEffect(()=>{if(t){const O=localStorage.getItem("bolttech_datasource");if(O)try{const z=JSON.parse(O);z&&typeof z=="object"&&z.data&&(E(z.data),z.url&&l(z.url))}catch{}}},[t]);const N=O=>{const z=O.target.files?.[0];if(!z)return;if(!z.name.endsWith(".json")){y("Please select a JSON file");return}const I=new FileReader;I.onload=q=>{try{const J=q.target?.result,K=JSON.parse(J);i(J),E(K),y("")}catch{y("Invalid JSON file"),i(""),E(null)}},I.readAsText(z)},A=async()=>{if(!a.trim()){y("Please enter a URL");return}m(!0),y("");try{const O=await fetch(a);if(!O.ok)throw new Error("Failed to fetch data");const z=await O.json();d(JSON.stringify(z,null,2)),E(z),y("")}catch{y("Failed to fetch data from URL")}finally{m(!1)}},T=O=>{d(O),y("");try{if(O.trim()){const z=JSON.parse(O);E(z)}else E(null)}catch{y("Invalid JSON format"),E(null)}},j=()=>{let O;try{switch(n){case"file":if(!o){y("Please select a file");return}O=JSON.parse(o);break;case"url":if(!c){y("Please fetch data from URL first");return}O=JSON.parse(c);break;case"code":if(!c.trim()){y("Please enter JSON data");return}O=JSON.parse(c);break}n==="url"?localStorage.setItem("bolttech_datasource",JSON.stringify({from:n,data:O,url:a})):localStorage.setItem("bolttech_datasource",JSON.stringify({from:n,data:O})),r(O),e()}catch{y("Invalid JSON data")}},B=()=>{navigator.clipboard.writeText(c),w(!0),setTimeout(()=>w(!1),2e3)},$=()=>{try{return c.trim()?(JSON.parse(c),!0):!1}catch{return!1}};return t?h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",onClick:O=>{O.target===O.currentTarget&&e()},children:h.jsxs("div",{className:"flex h-[90vh] w-full max-w-6xl flex-col rounded-none bg-white shadow-xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-[#e8e7ee] bg-white p-6",children:[h.jsx("h2",{className:"text-lg font-bold tracking-wide text-[#170f4f]",children:"DataSource"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>{localStorage.removeItem("bolttech_datasource"),E(null),i(""),l(""),d("")},className:"rounded-none p-2 text-gray-400 transition-colors duration-200 hover:bg-red-50 hover:text-red-600",title:"Clean Data",children:"🧹"}),h.jsx("button",{onClick:e,className:"rounded-none p-2 text-gray-400 transition-colors duration-200 hover:bg-gray-50 hover:text-gray-600",children:h.jsx(_.FiX,{size:18})})]})]}),h.jsx("div",{className:"max-h-[42vh] overflow-y-auto border-b border-[#e8e7ee] px-6 py-4",children:h.jsx(M0,{data:{root:D||{}}})}),h.jsxs("div",{className:"flex border-b border-[#e8e7ee]",children:[h.jsxs("button",{onClick:()=>s("url"),className:`flex items-center gap-2 px-6 py-3 text-sm font-medium transition-colors duration-200 ${n==="url"?"border-b-2 border-[#30aab3] text-[#170f4f]":"text-gray-500 hover:text-[#170f4f]"}`,children:[h.jsx(_.FiLink,{size:16}),"URL"]}),h.jsxs("button",{onClick:()=>s("file"),className:`flex items-center gap-2 px-6 py-3 text-sm font-medium transition-colors duration-200 ${n==="file"?"border-b-2 border-[#30aab3] text-[#170f4f]":"text-gray-500 hover:text-[#170f4f]"}`,children:[h.jsx(_.FiUpload,{size:16}),"Import File"]}),h.jsxs("button",{onClick:()=>s("code"),className:`flex items-center gap-2 px-6 py-3 text-sm font-medium transition-colors duration-200 ${n==="code"?"border-b-2 border-[#30aab3] text-[#170f4f]":"text-gray-500 hover:text-[#170f4f]"}`,children:[h.jsx(_.FiCode,{size:16}),"Custom Code"]})]}),h.jsxs("div",{className:"flex-1 overflow-hidden p-6",children:[n==="code"&&h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx("div",{className:"mb-4",children:h.jsx("p",{className:"mb-1 text-sm text-gray-500",children:"Enter your JSON data below"})}),h.jsxs("div",{className:"flex-1 overflow-hidden rounded-none bg-gray-900",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-gray-700 bg-gray-800 px-4 py-2",children:[h.jsx("span",{className:"text-sm font-medium text-gray-300",children:"JSON Editor"}),c&&h.jsxs("button",{onClick:B,className:"flex items-center gap-1 text-xs text-gray-400 hover:text-gray-300",children:[v?h.jsx(_.FiCheck,{size:12}):h.jsx(_.FiCopy,{size:12}),v?"Copied!":"Copy"]})]}),h.jsx("div",{className:"h-full overflow-auto pb-8",children:h.jsx("textarea",{value:c,onChange:O=>T(O.target.value),placeholder:'{"name": "John", "age": 30, "city": "New York"}',className:"h-full w-full resize-none border-none bg-transparent p-4 font-mono text-sm text-gray-300 outline-none"})})]})]}),n==="url"&&h.jsx("div",{className:"bte:flex bte:h-full bte:flex-col",children:h.jsxs("div",{className:"bte:mb-4",children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"JSON URL"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"url",value:a,onChange:O=>l(O.target.value),placeholder:"https://api.example.com/data.json",className:"flex-1 rounded-none border border-[#e8e7ee] px-3 py-2 focus:outline-none focus:ring-2 focus:ring-[#30aab3]"}),h.jsx("button",{onClick:A,disabled:f||!a.trim(),className:"rounded-none bg-[#170f4f] px-4 py-2 text-white transition-colors duration-200 hover:bg-[#30aab3] disabled:cursor-not-allowed disabled:opacity-50",children:f?"Loading...":"Fetch"})]})]})}),n==="file"&&h.jsxs("div",{className:"bte:flex bte:h-full bte:flex-col",children:[h.jsxs("div",{className:"bte:mb-4",children:[h.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700",children:"Select JSON File"}),h.jsxs("div",{className:"rounded-none border-2 border-dashed border-[#e8e7ee] p-8 text-center transition-colors duration-200 hover:border-[#30aab3]",children:[h.jsx("input",{type:"file",accept:".json",onChange:N,className:"hidden",id:"file-upload"}),h.jsxs("label",{htmlFor:"file-upload",className:"flex cursor-pointer flex-col items-center",children:[h.jsx(_.FiUpload,{size:48,className:"mb-4 text-gray-400"}),h.jsx(_.FiUpload,{size:48,className:"mb-4 text-gray-400"}),h.jsx("span",{className:"text-lg font-medium text-gray-700",children:"Click to upload JSON file"}),h.jsx("span",{className:"mt-1 text-sm text-gray-500",children:"or drag and drop"})]})]})]}),o&&h.jsxs("div",{className:"flex-1 overflow-hidden rounded-none bg-gray-900",children:[h.jsx("div",{className:"flex items-center justify-between border-b border-gray-700 bg-gray-800 px-4 py-2",children:h.jsx("span",{className:"text-sm font-medium text-gray-300",children:"File Preview"})}),h.jsx("div",{className:"h-32 overflow-auto",children:h.jsx("pre",{className:"whitespace-pre-wrap p-4 font-mono text-sm text-gray-300",children:h.jsx("code",{children:o})})})]})]}),g&&h.jsx("div",{className:"mt-4 rounded-none border border-red-200 bg-red-50 p-3",children:h.jsx("p",{className:"text-sm text-red-600",children:g})})]}),h.jsxs("div",{className:"flex items-center justify-end gap-3 border-t border-[#e8e7ee] p-6",children:[h.jsx("button",{onClick:e,className:"rounded-none bg-gray-100 px-4 py-2 text-gray-700 transition-colors duration-200 hover:bg-gray-200",children:"Cancel"}),h.jsx("button",{onClick:j,disabled:n==="file"&&!o||n==="url"&&!c||n==="code"&&!c||!$(),className:"rounded-none bg-[#170f4f] px-4 py-2 text-white transition-colors duration-200 hover:bg-[#30aab3] disabled:cursor-not-allowed disabled:opacity-50",children:"Import Data"})]})]})}):null},b3=Object.freeze({__proto__:null,DataSourceModal:g3,HorizontalDataView:M0});exports.TemplateEditor=T0;exports.default=T0;
|