bi-components-library 1.3.6-next.9 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
- (function(we,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom/client"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom/client","react-dom"],b):(we=typeof globalThis<"u"?globalThis:we||self,b(we.SealSeekBIComponents={},we.React,we.React,we.antd,we.AntdIcons,we.ReactDOM,we.ReactDOM))})(this,function(we,b,y,ue,Ut,cm,Ni){"use strict";const Cu=({variant:e="primary",loading:t=!1,children:n,...l})=>{const r=a=>{switch(a){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return b.jsx(ue.Button,{...l,type:r(e),loading:t,ghost:e==="ghost",children:n})};Cu.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const Su=({title:e,children:t,bordered:n=!0,hoverable:l=!1,size:r="default",...a})=>b.jsx(ue.Card,{...a,title:e,bordered:n,hoverable:l,size:r,children:t});Su.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const xu=({showDefaultFooter:e=!0,...t})=>{const n=t.footer!==void 0?t.footer:e?(l,{OkBtn:r,CancelBtn:a})=>b.jsxs(b.Fragment,{children:[b.jsx(r,{}),b.jsx(a,{})]}):null;return b.jsx(ue.Modal,{...t,footer:n})};xu.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const ku=({scrollX:e,showPagination:t=!0,defaultPageSize:n=10,...l})=>b.jsx(ue.Table,{...l,scroll:{x:e||"max-content",y:"50vh"},pagination:t?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:n,...l.pagination}:!1});ku.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const dm=Ut.createFromIconfontCN({scriptUrl:["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]}),Au=({name:e,size:t,color:n,style:l,...r})=>{const a={fontSize:t,color:n,...l};return b.jsx(dm,{...r,type:e,style:a})};Au.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Nu=({loading:e,description:t="暂无数据",className:n,emptyChildren:l,loadingText:r,emptyImage:a})=>e?b.jsxs(ue.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",vertical:!0,children:[b.jsx(ue.Spin,{size:"large"}),r&&b.jsx("div",{className:"mt-4 text-gray-500",children:r})]}):b.jsx(ue.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",children:b.jsx(ue.Empty,{image:a,description:t,imageStyle:{height:180},children:l})});Nu.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const wu=({onClick:e,showText:t=!1,className:n,size:l="small",type:r="default"})=>b.jsx(ue.Button,{size:l,type:r,icon:b.jsx(Ut.LeftOutlined,{}),className:`cursor-pointer ${n||""}`,onClick:e,children:t&&"返回"});wu.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const Iu=({removePadding:e=!0,className:t,...n})=>{const l=e?`px-0 h-auto ${t||""}`:t;return b.jsx(ue.Button,{type:"link",...n,className:l,children:n.children})};Iu.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:fm}=ue.Select,_u=({columns:e,request:t,searchFields:n=[],showSearch:l=!0,showRefresh:r=!0,defaultPageSize:a=10,pageSizeOptions:i=["10","20","50","100"],autoLoad:s=!0,externalParams:o={},...u})=>{const[c,d]=y.useState([]),[f,h]=y.useState(!1),[m,v]=y.useState({current:1,pageSize:a,total:0}),[g,E]=y.useState({}),[N,A]=y.useState({}),[L]=ue.Form.useForm(),O=y.useRef(m);O.current=m;const S=y.useRef(o);S.current=o;const _=y.useRef(!1),I=y.useMemo(()=>e.map(B=>{const{sortable:T,render:F,...V}=B;return{...V,sorter:T?!0:void 0,render:F||($=>$)}}),[e]),k=y.useCallback(async(B={})=>{if(t){h(!0);try{const T={page:O.current.current,pageSize:O.current.pageSize,sortField:N.field,sortOrder:N.order,searchParams:{...g,...S.current},...B},F=await t(T);F.success&&(d(F.data),v(V=>({...V,total:F.total,current:T.page||V.current})))}catch(T){console.error("加载数据失败:",T)}finally{h(!1)}}},[t,N,g]),R=y.useCallback(B=>{E(B),v(T=>({...T,current:1}))},[]),M=y.useCallback(()=>{L.resetFields(),E({}),v(B=>({...B,current:1}))},[L]),H=y.useCallback(()=>{k()},[k]),q=y.useCallback((B,T,F)=>{const V={current:B.current||1,pageSize:B.pageSize||a,total:B.total||0},$={field:F?.field,order:F?.order};v(V),A($)},[a]);return y.useEffect(()=>{const B=Object.keys(o).length>0;(s&&!_.current||B)&&(k(),_.current=!0)},[s,o,k]),b.jsxs("div",{children:[l&&n.length>0&&b.jsx(ue.Card,{size:"small",style:{marginBottom:16},children:b.jsxs(ue.Form,{form:L,layout:"inline",onFinish:R,initialValues:n.reduce((B,T)=>(T.defaultValue!==void 0&&(B[T.key]=T.defaultValue),B),{}),children:[n.map(B=>b.jsx(ue.Form.Item,{name:B.key,label:B.label,children:B.type==="input"?b.jsx(ue.Input,{placeholder:B.placeholder||`请输入${B.label}`,style:{width:200}}):b.jsx(ue.Select,{placeholder:B.placeholder||`请选择${B.label}`,style:{width:200},allowClear:!0,children:B.options?.map(T=>b.jsx(fm,{value:T.value,children:T.label},T.value))})},B.key)),b.jsx(ue.Form.Item,{children:b.jsxs(ue.Space,{children:[b.jsx(ue.Button,{type:"primary",htmlType:"submit",icon:b.jsx(Ut.SearchOutlined,{}),children:"查询"}),b.jsx(ue.Button,{onClick:M,children:"重置"}),r&&b.jsx(ue.Button,{icon:b.jsx(Ut.ReloadOutlined,{}),onClick:H,children:"刷新"})]})})]})}),b.jsx(ue.Table,{...u,columns:I,dataSource:c,loading:f,pagination:{...m,showSizeChanger:!0,showQuickJumper:!0,showTotal:(B,T)=>`第 ${T[0]}-${T[1]} 条/共 ${B} 条`,pageSizeOptions:i},onChange:q,scroll:{x:"max-content",y:"50vh"}})]})};_u.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}},ue.unstableSetRender((e,t)=>{const n=t;n._reactRootForAntd||=cm.createRoot(n);const l=n._reactRootForAntd;return l.render(e),async()=>{await new Promise(r=>setTimeout(r,0)),l.unmount()}});const hm=({node:e,value:t,onChange:n,index:l})=>{const r=e.key?`debug-node-${e.key}`:`debug-node-text-${l??0}`;return e.type==="text"||e.type==="tag"?b.jsx("span",{"data-testid":r,className:"rte-text",children:e.text}):b.jsx("input",{"data-testid":r,"data-value":Array.isArray(t)?t.join(","):t??"",value:Array.isArray(t)?t.join(","):t??"",onChange:a=>n(e.key,a.target.value),placeholder:`[${e.type}] ${e.placeholder??e.key??""}`})},pm=/[;;,,。.!!??::、]/,bm=e=>{const t=(e??"").trim();return t.length===1&&pm.test(t)},Ou=y.memo(({node:e})=>{if(bm(e.text)&&!e.className&&!e.exclusionGroup)return b.jsx("span",{"data-type":"text",className:"rte-inline-punct",contentEditable:!1,children:(e.text??"").trim()});const t=(e.text??"").replace(/\n/g,"<br/>"),n=b.jsx("span",{"data-type":"text",className:e.className,contentEditable:!1,dangerouslySetInnerHTML:{__html:t}});return e.exclusionGroup?b.jsx("span",{className:"exclusion-wrapper","data-group":e.exclusionGroup,children:n}):n});Ou.displayName="TextNode";const mm={background:"#0A0A0A",color:"#fff",fontSize:12,padding:12,borderRadius:8,boxShadow:"0 4px 20px 0 rgba(129, 124, 143, 0.2)",maxWidth:320,whiteSpace:"normal",wordBreak:"break-word"},$n=({children:e,placement:t="top",...n})=>b.jsx(ue.Tooltip,{...n,arrow:!1,color:"#0A0A0A",placement:t,overlayInnerStyle:mm,children:e}),gm=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Mu=y.memo(({node:e,hideClose:t,onClose:n,tooltipZIndex:l})=>{const r=gm(e.tooltip),a=b.jsx("span",{contentEditable:!1,className:["tag-node","group",e.className].filter(Boolean).join(" "),...r?{"data-tooltip":r,"data-tag-key":e.key||""}:{},children:b.jsx("span",{className:"tag-label",...!t&&n?{"data-tag-clickable":"true",onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},onClick:i=>{i.preventDefault(),i.stopPropagation(),n()}}:{},children:e.text})});return r?b.jsx($n,{title:r,zIndex:l,children:a}):a});Mu.displayName="TagNode";function Ww(){}function Yw(){}function Du(e){const t=[],n=String(e||"");let l=n.indexOf(","),r=0,a=!1;for(;!a;){l===-1&&(l=n.length,a=!0);const i=n.slice(r,l).trim();(i||!a)&&t.push(i),r=l+1,l=n.indexOf(",",r)}return t}function Lu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vm=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ym=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Em={};function Pu(e,t){return(Em.jsx?ym:vm).test(e)}const Tm=/[ \t\n\f\r]/g;function Cm(e){return typeof e=="object"?e.type==="text"?Bu(e.value):!1:Bu(e)}function Bu(e){return e.replace(Tm,"")===""}let Xl=class{constructor(t,n,l){this.normal=n,this.property=t,l&&(this.space=l)}};Xl.prototype.normal={},Xl.prototype.property={},Xl.prototype.space=void 0;function Ru(e,t){const n={},l={};for(const r of e)Object.assign(n,r.property),Object.assign(l,r.normal);return new Xl(n,l,t)}function Jl(e){return e.toLowerCase()}class mt{constructor(t,n){this.attribute=n,this.property=t}}mt.prototype.attribute="",mt.prototype.booleanish=!1,mt.prototype.boolean=!1,mt.prototype.commaOrSpaceSeparated=!1,mt.prototype.commaSeparated=!1,mt.prototype.defined=!1,mt.prototype.mustUseProperty=!1,mt.prototype.number=!1,mt.prototype.overloadedBoolean=!1,mt.prototype.property="",mt.prototype.spaceSeparated=!1,mt.prototype.space=void 0;let Sm=0;const Ee=qn(),Ve=qn(),wi=qn(),Q=qn(),Pe=qn(),vl=qn(),St=qn();function qn(){return 2**++Sm}const Ii=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:Ve,commaOrSpaceSeparated:St,commaSeparated:vl,number:Q,overloadedBoolean:wi,spaceSeparated:Pe},Symbol.toStringTag,{value:"Module"})),_i=Object.keys(Ii);class Oi extends mt{constructor(t,n,l,r){let a=-1;if(super(t,n),Fu(this,"space",r),typeof l=="number")for(;++a<_i.length;){const i=_i[a];Fu(this,_i[a],(l&Ii[i])===Ii[i])}}}Oi.prototype.defined=!0;function Fu(e,t,n){n&&(e[t]=n)}function yl(e){const t={},n={};for(const[l,r]of Object.entries(e.properties)){const a=new Oi(l,e.transform(e.attributes||{},l),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(a.mustUseProperty=!0),t[l]=a,n[Jl(l)]=l,n[Jl(a.attribute)]=l}return new Xl(t,n,e.space)}const Hu=yl({properties:{ariaActiveDescendant:null,ariaAtomic:Ve,ariaAutoComplete:null,ariaBusy:Ve,ariaChecked:Ve,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Pe,ariaCurrent:null,ariaDescribedBy:Pe,ariaDetails:null,ariaDisabled:Ve,ariaDropEffect:Pe,ariaErrorMessage:null,ariaExpanded:Ve,ariaFlowTo:Pe,ariaGrabbed:Ve,ariaHasPopup:null,ariaHidden:Ve,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pe,ariaLevel:Q,ariaLive:null,ariaModal:Ve,ariaMultiLine:Ve,ariaMultiSelectable:Ve,ariaOrientation:null,ariaOwns:Pe,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Ve,ariaReadOnly:Ve,ariaRelevant:null,ariaRequired:Ve,ariaRoleDescription:Pe,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Ve,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Uu(e,t){return t in e?e[t]:t}function zu(e,t){return Uu(e,t.toLowerCase())}const xm=yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vl,acceptCharset:Pe,accessKey:Pe,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:Pe,autoFocus:Ee,autoPlay:Ee,blocking:Pe,capture:null,charSet:null,checked:Ee,cite:null,className:Pe,cols:Q,colSpan:null,content:null,contentEditable:Ve,controls:Ee,controlsList:Pe,coords:Q|vl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:wi,draggable:Ve,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:Pe,height:Q,hidden:wi,high:Q,href:null,hrefLang:null,htmlFor:Pe,httpEquiv:Pe,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:Pe,itemRef:Pe,itemScope:Ee,itemType:Pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ee,optimum:Q,pattern:null,ping:Pe,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:Pe,required:Ee,reversed:Ee,rows:Q,rowSpan:Q,sandbox:Pe,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Ve,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:Ve,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pe,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Ve,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:zu}),km=yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:St,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Pe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:vl,g2:vl,glyphName:vl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:St,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:St,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:St,rev:St,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:St,requiredFeatures:St,requiredFonts:St,requiredFormats:St,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:St,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:St,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:St,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Uu}),Vu=yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),$u=yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zu}),qu=yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Am={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Nm=/[A-Z]/g,Wu=/-[a-z]/g,wm=/^data[-\w.:]+$/i;function ta(e,t){const n=Jl(t);let l=t,r=mt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wm.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Wu,_m);l="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Wu.test(a)){let i=a.replace(Nm,Im);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=Oi}return new r(l,t)}function Im(e){return"-"+e.toLowerCase()}function _m(e){return e.charAt(1).toUpperCase()}const Zl=Ru([Hu,xm,Vu,$u,qu],"html"),cn=Ru([Hu,km,Vu,$u,qu],"svg");function Yu(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ju(e){return e.join(" ").trim()}function Mi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var El={},Di,Ku;function Om(){if(Ku)return Di;Ku=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,o=`
2
- `,u="/",c="*",d="",f="comment",h="declaration";function m(g,E){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];E=E||{};var N=1,A=1;function L(B){var T=B.match(t);T&&(N+=T.length);var F=B.lastIndexOf(o);A=~F?B.length-F:A+B.length}function O(){var B={line:N,column:A};return function(T){return T.position=new S(B),k(),T}}function S(B){this.start=B,this.end={line:N,column:A},this.source=E.source}S.prototype.content=g;function _(B){var T=new Error(E.source+":"+N+":"+A+": "+B);if(T.reason=B,T.filename=E.source,T.line=N,T.column=A,T.source=g,!E.silent)throw T}function I(B){var T=B.exec(g);if(T){var F=T[0];return L(F),g=g.slice(F.length),T}}function k(){I(n)}function R(B){var T;for(B=B||[];T=M();)T!==!1&&B.push(T);return B}function M(){var B=O();if(!(u!=g.charAt(0)||c!=g.charAt(1))){for(var T=2;d!=g.charAt(T)&&(c!=g.charAt(T)||u!=g.charAt(T+1));)++T;if(T+=2,d===g.charAt(T-1))return _("End of comment missing");var F=g.slice(2,T-2);return A+=2,L(F),g=g.slice(T),A+=2,B({type:f,comment:F})}}function H(){var B=O(),T=I(l);if(T){if(M(),!I(r))return _("property missing ':'");var F=I(a),V=B({type:h,property:v(T[0].replace(e,d)),value:F?v(F[0].replace(e,d)):d});return I(i),V}}function q(){var B=[];R(B);for(var T;T=H();)T!==!1&&(B.push(T),R(B));return B}return k(),q()}function v(g){return g?g.replace(s,d):d}return Di=m,Di}var Gu;function Mm(){if(Gu)return El;Gu=1;var e=El&&El.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(El,"__esModule",{value:!0}),El.default=n;const t=e(Om());function n(l,r){let a=null;if(!l||typeof l!="string")return a;const i=(0,t.default)(l),s=typeof r=="function";return i.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:c}=o;s?r(u,c,o):c&&(a=a||{},a[u]=c)}),a}return El}var er={},Qu;function Dm(){if(Qu)return er;Qu=1,Object.defineProperty(er,"__esModule",{value:!0}),er.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},i=function(u,c){return c.toUpperCase()},s=function(u,c){return"".concat(c,"-")},o=function(u,c){return c===void 0&&(c={}),a(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(r,s):u=u.replace(l,s),u.replace(t,i))};return er.camelCase=o,er}var tr,Xu;function Lm(){if(Xu)return tr;Xu=1;var e=tr&&tr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(Mm()),n=Dm();function l(r,a){var i={};return!r||typeof r!="string"||(0,t.default)(r,function(s,o){s&&o&&(i[(0,n.camelCase)(s,a)]=o)}),i}return l.default=l,tr=l,tr}var Pm=Lm();const Bm=Mi(Pm),na=Ju("end"),zt=Ju("start");function Ju(e){return t;function t(n){const l=n&&n.position&&n.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Zu(e){const t=zt(e),n=na(e);if(t&&n)return{start:t,end:n}}function nr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ec(e.position):"start"in e||"end"in e?ec(e):"line"in e||"column"in e?Li(e):""}function Li(e){return tc(e&&e.line)+":"+tc(e&&e.column)}function ec(e){return Li(e&&e.start)+"-"+Li(e&&e.end)}function tc(e){return e&&typeof e=="number"?e:1}class rt extends Error{constructor(t,n,l){super(),typeof n=="string"&&(l=n,n=void 0);let r="",a={},i=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?r=t:!a.cause&&t&&(i=!0,r=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof l=="string"){const o=l.indexOf(":");o===-1?a.ruleId=l:(a.source=l.slice(0,o),a.ruleId=l.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=nr(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rt.prototype.file="",rt.prototype.name="",rt.prototype.reason="",rt.prototype.message="",rt.prototype.stack="",rt.prototype.column=void 0,rt.prototype.line=void 0,rt.prototype.ancestors=void 0,rt.prototype.cause=void 0,rt.prototype.fatal=void 0,rt.prototype.place=void 0,rt.prototype.ruleId=void 0,rt.prototype.source=void 0;const Pi={}.hasOwnProperty,Rm=new Map,Fm=/[A-Z]/g,Hm=new Set(["table","tbody","thead","tfoot","tr"]),Um=new Set(["td","th"]),nc="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zm(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let l;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=Gm(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=Km(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cn:Zl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=lc(r,e,void 0);return a&&typeof a!="string"?a:r.create(e,r.Fragment,{children:a||void 0},void 0)}function lc(e,t,n){if(t.type==="element")return Vm(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $m(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Wm(e,t,n);if(t.type==="mdxjsEsm")return qm(e,t);if(t.type==="root")return Ym(e,t,n);if(t.type==="text")return jm(e,t)}function Vm(e,t,n){const l=e.schema;let r=l;t.tagName.toLowerCase()==="svg"&&l.space==="html"&&(r=cn,e.schema=r),e.ancestors.push(t);const a=ac(e,t.tagName,!1),i=Qm(e,t);let s=Ri(e,t);return Hm.has(t.tagName)&&(s=s.filter(function(o){return typeof o=="string"?!Cm(o):!0})),rc(e,i,a,t),Bi(i,s),e.ancestors.pop(),e.schema=l,e.create(t,a,i,n)}function $m(e,t){if(t.data&&t.data.estree&&e.evaluater){const l=t.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}lr(e,t.position)}function qm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lr(e,t.position)}function Wm(e,t,n){const l=e.schema;let r=l;t.name==="svg"&&l.space==="html"&&(r=cn,e.schema=r),e.ancestors.push(t);const a=t.name===null?e.Fragment:ac(e,t.name,!0),i=Xm(e,t),s=Ri(e,t);return rc(e,i,a,t),Bi(i,s),e.ancestors.pop(),e.schema=l,e.create(t,a,i,n)}function Ym(e,t,n){const l={};return Bi(l,Ri(e,t)),e.create(t,e.Fragment,l,n)}function jm(e,t){return t.value}function rc(e,t,n,l){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=l)}function Bi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Km(e,t,n){return l;function l(r,a,i,s){const u=Array.isArray(i.children)?n:t;return s?u(a,i,s):u(a,i)}}function Gm(e,t){return n;function n(l,r,a,i){const s=Array.isArray(a.children),o=zt(l);return t(r,a,i,s,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function Qm(e,t){const n={};let l,r;for(r in t.properties)if(r!=="children"&&Pi.call(t.properties,r)){const a=Jm(e,r,t.properties[r]);if(a){const[i,s]=a;e.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&Um.has(t.tagName)?l=s:n[i]=s}}if(l){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return n}function Xm(e,t){const n={};for(const l of t.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const a=l.data.estree.body[0];a.type;const i=a.expression;i.type;const s=i.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else lr(e,t.position);else{const r=l.name;let a;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const s=l.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else lr(e,t.position);else a=l.value===null?!0:l.value;n[r]=a}return n}function Ri(e,t){const n=[];let l=-1;const r=e.passKeys?new Map:Rm;for(;++l<t.children.length;){const a=t.children[l];let i;if(e.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const u=r.get(o)||0;i=o+"-"+u,r.set(o,u+1)}}const s=lc(e,a,i);s!==void 0&&n.push(s)}return n}function Jm(e,t,n){const l=ta(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=l.commaSeparated?Lu(n):ju(n)),l.property==="style"){let r=typeof n=="object"?n:Zm(e,String(n));return e.stylePropertyNameCase==="css"&&(r=e1(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&l.space?Am[l.property]||l.property:l.attribute,n]}}function Zm(e,t){try{return Bm(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const l=n,r=new rt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=nc+"#cannot-parse-style-attribute",r}}function ac(e,t,n){let l;if(!n)l={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let a=-1,i;for(;++a<r.length;){const s=Pu(r[a])?{type:"Identifier",name:r[a]}:{type:"Literal",value:r[a]};i=i?{type:"MemberExpression",object:i,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}l=i}else l=Pu(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(l.type==="Literal"){const r=l.value;return Pi.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(l);lr(e)}function lr(e,t){const n=new rt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=nc+"#cannot-handle-mdx-estrees-without-createevaluater",n}function e1(e){const t={};let n;for(n in e)Pi.call(e,n)&&(t[t1(n)]=e[n]);return t}function t1(e){let t=e.replace(Fm,n1);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function n1(e){return"-"+e.toLowerCase()}const Fi={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},l1={};function r1(e,t){const n=l1,l=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ic(e,l,r)}function ic(e,t,n){if(a1(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return sc(e.children,t,n)}return Array.isArray(e)?sc(e,t,n):""}function sc(e,t,n){const l=[];let r=-1;for(;++r<e.length;)l[r]=ic(e[r],t,n);return l.join("")}function a1(e){return!!(e&&typeof e=="object")}const oc=document.createElement("i");function rr(e){const t="&"+e+";";oc.innerHTML=t;const n=oc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vt(e,t,n,l){const r=e.length;let a=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,l.length<1e4)i=Array.from(l),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<l.length;)i=l.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function It(e,t){return e.length>0?(Vt(e,e.length,0,t),e):t}const uc={}.hasOwnProperty;function i1(e){const t={};let n=-1;for(;++n<e.length;)s1(t,e[n]);return t}function s1(e,t){let n;for(n in t){const r=(uc.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let i;if(a)for(i in a){uc.call(r,i)||(r[i]=[]);const s=a[i];o1(r[i],Array.isArray(s)?s:s?[s]:[])}}}function o1(e,t){let n=-1;const l=[];for(;++n<t.length;)(t[n].add==="after"?e:l).push(t[n]);Vt(e,0,0,l)}function cc(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=dn(/[A-Za-z]/),xt=dn(/[\dA-Za-z]/),u1=dn(/[#-'*+\--9=?A-Z^-~]/);function Hi(e){return e!==null&&(e<32||e===127)}const Ui=dn(/\d/),c1=dn(/[\dA-Fa-f]/),d1=dn(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function He(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const ar=dn(new RegExp("\\p{P}|\\p{S}","u")),ir=dn(/\s/);function dn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Cl(e){const t=[];let n=-1,l=0,r=0;for(;++n<e.length;){const a=e.charCodeAt(n);let i="";if(a===37&&xt(e.charCodeAt(n+1))&&xt(e.charCodeAt(n+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(i=String.fromCharCode(a,s),r=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(l,n),encodeURIComponent(i)),l=n+r+1,i=""),r&&(n+=r,r=0)}return t.join("")+e.slice(l)}function _e(e,t,n,l){const r=l?l-1:Number.POSITIVE_INFINITY;let a=0;return i;function i(o){return Ie(o)?(e.enter(n),s(o)):t(o)}function s(o){return Ie(o)&&a++<r?(e.consume(o),s):(e.exit(n),t(o))}}const f1={tokenize:h1};function h1(e){const t=e.attempt(this.parser.constructs.contentInitial,l,r);let n;return t;function l(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),_e(e,t,"linePrefix")}function r(s){return e.enter("paragraph"),a(s)}function a(s){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return oe(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),i)}}const p1={tokenize:b1},dc={tokenize:m1};function b1(e){const t=this,n=[];let l=0,r,a,i;return s;function s(A){if(l<n.length){const L=n[l];return t.containerState=L[1],e.attempt(L[0].continuation,o,u)(A)}return u(A)}function o(A){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&N();const L=t.events.length;let O=L,S;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){S=t.events[O][1].end;break}E(l);let _=L;for(;_<t.events.length;)t.events[_][1].end={...S},_++;return Vt(t.events,O+1,0,t.events.slice(L)),t.events.length=_,u(A)}return s(A)}function u(A){if(l===n.length){if(!r)return f(A);if(r.currentConstruct&&r.currentConstruct.concrete)return m(A);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dc,c,d)(A)}function c(A){return r&&N(),E(l),f(A)}function d(A){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,m(A)}function f(A){return t.containerState={},e.attempt(dc,h,m)(A)}function h(A){return l++,n.push([t.currentConstruct,t.containerState]),f(A)}function m(A){if(A===null){r&&N(),E(0),e.consume(A);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),v(A)}function v(A){if(A===null){g(e.exit("chunkFlow"),!0),E(0),e.consume(A);return}return oe(A)?(e.consume(A),g(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(A),v)}function g(A,L){const O=t.sliceStream(A);if(L&&O.push(null),A.previous=a,a&&(a.next=A),a=A,r.defineSkip(A.start),r.write(O),t.parser.lazy[A.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<i&&(!r.events[S][1].end||r.events[S][1].end.offset>i))return;const _=t.events.length;let I=_,k,R;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(k){R=t.events[I][1].end;break}k=!0}for(E(l),S=_;S<t.events.length;)t.events[S][1].end={...R},S++;Vt(t.events,I+1,0,t.events.slice(_)),t.events.length=S}}function E(A){let L=n.length;for(;L-- >A;){const O=n[L];t.containerState=O[1],O[0].exit.call(t,e)}n.length=A}function N(){r.write([null]),a=void 0,r=void 0,t.containerState._closeFlow=void 0}}function m1(e,t,n){return _e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fc(e){if(e===null||He(e)||ir(e))return 1;if(ar(e))return 2}function zi(e,t,n){const l=[];let r=-1;for(;++r<e.length;){const a=e[r].resolveAll;a&&!l.includes(a)&&(t=a(t,n),l.push(a))}return t}const Vi={name:"attention",resolveAll:g1,tokenize:v1};function g1(e,t){let n=-1,l,r,a,i,s,o,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(l=n;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&t.sliceSerialize(e[l][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[l][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;o=e[l][1].end.offset-e[l][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[l][1].end},f={...e[n][1].start};hc(d,-o),hc(f,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[l][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:o>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[n][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[l][1].end={...i.start},e[n][1].start={...s.end},u=[],e[l][1].end.offset-e[l][1].start.offset&&(u=It(u,[["enter",e[l][1],t],["exit",e[l][1],t]])),u=It(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",a,t]]),u=It(u,zi(t.parser.constructs.insideSpan.null,e.slice(l+1,n),t)),u=It(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=It(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Vt(e,l-1,n-l+3,u),n=l+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function v1(e,t){const n=this.parser.constructs.attentionMarkers.null,l=this.previous,r=fc(l);let a;return i;function i(o){return a=o,e.enter("attentionSequence"),s(o)}function s(o){if(o===a)return e.consume(o),s;const u=e.exit("attentionSequence"),c=fc(o),d=!c||c===2&&r||n.includes(o),f=!r||r===2&&c||n.includes(l);return u._open=!!(a===42?d:d&&(r||!f)),u._close=!!(a===42?f:f&&(c||!d)),t(o)}}function hc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const y1={name:"autolink",tokenize:E1};function E1(e,t,n){let l=0;return r;function r(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(h){return $t(h)?(e.consume(h),i):h===64?n(h):u(h)}function i(h){return h===43||h===45||h===46||xt(h)?(l=1,s(h)):u(h)}function s(h){return h===58?(e.consume(h),l=0,o):(h===43||h===45||h===46||xt(h))&&l++<32?(e.consume(h),s):(l=0,u(h))}function o(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Hi(h)?n(h):(e.consume(h),o)}function u(h){return h===64?(e.consume(h),c):u1(h)?(e.consume(h),u):n(h)}function c(h){return xt(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),l=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||xt(h))&&l++<63){const m=h===45?f:d;return e.consume(h),m}return n(h)}}const la={partial:!0,tokenize:T1};function T1(e,t,n){return l;function l(a){return Ie(a)?_e(e,r,"linePrefix")(a):r(a)}function r(a){return a===null||oe(a)?t(a):n(a)}}const pc={continuation:{tokenize:S1},exit:x1,name:"blockQuote",tokenize:C1};function C1(e,t,n){const l=this;return r;function r(i){if(i===62){const s=l.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),a}return n(i)}function a(i){return Ie(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function S1(e,t,n){const l=this;return r;function r(i){return Ie(i)?_e(e,a,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return e.attempt(pc,t,n)(i)}}function x1(e){e.exit("blockQuote")}const bc={name:"characterEscape",tokenize:k1};function k1(e,t,n){return l;function l(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),r}function r(a){return d1(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const mc={name:"characterReference",tokenize:A1};function A1(e,t,n){const l=this;let r=0,a,i;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),o}function o(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,i=xt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,i=c1,c):(e.enter("characterReferenceValue"),a=7,i=Ui,c(d))}function c(d){if(d===59&&r){const f=e.exit("characterReferenceValue");return i===xt&&!rr(l.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<a?(e.consume(d),c):n(d)}}const gc={partial:!0,tokenize:w1},vc={concrete:!0,name:"codeFenced",tokenize:N1};function N1(e,t,n){const l=this,r={partial:!0,tokenize:O};let a=0,i=0,s;return o;function o(S){return u(S)}function u(S){const _=l.events[l.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,s=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===s?(i++,e.consume(S),c):i<3?n(S):(e.exit("codeFencedFenceSequence"),Ie(S)?_e(e,d,"whitespace")(S):d(S))}function d(S){return S===null||oe(S)?(e.exit("codeFencedFence"),l.interrupt?t(S):e.check(gc,v,L)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||oe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):Ie(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_e(e,h,"whitespace")(S)):S===96&&S===s?n(S):(e.consume(S),f)}function h(S){return S===null||oe(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||oe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===s?n(S):(e.consume(S),m)}function v(S){return e.attempt(r,L,g)(S)}function g(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),E}function E(S){return a>0&&Ie(S)?_e(e,N,"linePrefix",a+1)(S):N(S)}function N(S){return S===null||oe(S)?e.check(gc,v,L)(S):(e.enter("codeFlowValue"),A(S))}function A(S){return S===null||oe(S)?(e.exit("codeFlowValue"),N(S)):(e.consume(S),A)}function L(S){return e.exit("codeFenced"),t(S)}function O(S,_,I){let k=0;return R;function R(T){return S.enter("lineEnding"),S.consume(T),S.exit("lineEnding"),M}function M(T){return S.enter("codeFencedFence"),Ie(T)?_e(S,H,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):H(T)}function H(T){return T===s?(S.enter("codeFencedFenceSequence"),q(T)):I(T)}function q(T){return T===s?(k++,S.consume(T),q):k>=i?(S.exit("codeFencedFenceSequence"),Ie(T)?_e(S,B,"whitespace")(T):B(T)):I(T)}function B(T){return T===null||oe(T)?(S.exit("codeFencedFence"),_(T)):I(T)}}}function w1(e,t,n){const l=this;return r;function r(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a)}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}const $i={name:"codeIndented",tokenize:_1},I1={partial:!0,tokenize:O1};function _1(e,t,n){const l=this;return r;function r(u){return e.enter("codeIndented"),_e(e,a,"linePrefix",5)(u)}function a(u){const c=l.events[l.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):n(u)}function i(u){return u===null?o(u):oe(u)?e.attempt(I1,i,o)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||oe(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),s)}function o(u){return e.exit("codeIndented"),t(u)}}function O1(e,t,n){const l=this;return r;function r(i){return l.parser.lazy[l.now().line]?n(i):oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):_e(e,a,"linePrefix",5)(i)}function a(i){const s=l.events[l.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):oe(i)?r(i):n(i)}}const M1={name:"codeText",previous:L1,resolve:D1,tokenize:P1};function D1(e){let t=e.length-4,n=3,l,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(l=n;++l<t;)if(e[l][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(l=n-1,t++;++l<=t;)r===void 0?l!==t&&e[l][1].type!=="lineEnding"&&(r=l):(l===t||e[l][1].type==="lineEnding")&&(e[r][1].type="codeTextData",l!==r+2&&(e[r][1].end=e[l-1][1].end,e.splice(r+2,l-r-2),t-=l-r-2,l=r+2),r=void 0);return e}function L1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function P1(e,t,n){let l=0,r,a;return i;function i(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),l++,s):(e.exit("codeTextSequence"),o(d))}function o(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),o):d===96?(a=e.enter("codeTextSequence"),r=0,c(d)):oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||oe(d)?(e.exit("codeTextData"),o(d)):(e.consume(d),u)}function c(d){return d===96?(e.consume(d),r++,c):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class B1{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const l=n??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(t,l):t>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(t,n,l){const r=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return l&&sr(this.left,l),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),sr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),sr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);sr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);sr(this.left,n.reverse())}}}function sr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yc(e){const t={};let n=-1,l,r,a,i,s,o,u;const c=new B1(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(l=c.get(n),n&&l[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(o=l[1]._tokenizer.events,a=0,a<o.length&&o[a][1].type==="lineEndingBlank"&&(a+=2),a<o.length&&o[a][1].type==="content"))for(;++a<o.length&&o[a][1].type!=="content";)o[a][1].type==="chunkText"&&(o[a][1]._isInFirstContentOfListItem=!0,a++);if(l[0]==="enter")l[1].contentType&&(Object.assign(t,R1(c,n)),n=t[n],u=!0);else if(l[1]._container){for(a=n,r=void 0;a--;)if(i=c.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=a);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(l[1].end={...c.get(r)[1].start},s=c.slice(r,n),s.unshift(l),c.splice(r,n-r+1,s))}}return Vt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function R1(e,t){const n=e.get(t)[1],l=e.get(t)[2];let r=t-1;const a=[];let i=n._tokenizer;i||(i=l.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const s=i.events,o=[],u={};let c,d,f=-1,h=n,m=0,v=0;const g=[v];for(;h;){for(;e.get(++r)[1]!==h;);a.push(r),h._tokenizer||(c=l.sliceStream(h),h.next||c.push(null),d&&i.defineSkip(h.start),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(v=f+1,g.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(i.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){const E=s.slice(g[f],g[f+1]),N=a.pop();o.push([N,N+E.length-1]),e.splice(N,2,E)}for(o.reverse(),f=-1;++f<o.length;)u[m+o[f][0]]=m+o[f][1],m+=o[f][1]-o[f][0]-1;return u}const F1={resolve:U1,tokenize:z1},H1={partial:!0,tokenize:V1};function U1(e){return yc(e),e}function z1(e,t){let n;return l;function l(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(s)}function r(s){return s===null?a(s):oe(s)?e.check(H1,i,a)(s):(e.consume(s),r)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function V1(e,t,n){const l=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),_e(e,a,"linePrefix")}function a(i){if(i===null||oe(i))return n(i);const s=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(l.parser.constructs.flow,n,t)(i)}}function Ec(e,t,n,l,r,a,i,s,o){const u=o||Number.POSITIVE_INFINITY;let c=0;return d;function d(E){return E===60?(e.enter(l),e.enter(r),e.enter(a),e.consume(E),e.exit(a),f):E===null||E===32||E===41||Hi(E)?n(E):(e.enter(l),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(E))}function f(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(r),e.exit(l),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(e.exit("chunkString"),e.exit(s),f(E)):E===null||E===60||oe(E)?n(E):(e.consume(E),E===92?m:h)}function m(E){return E===60||E===62||E===92?(e.consume(E),h):h(E)}function v(E){return!c&&(E===null||E===41||He(E))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(l),t(E)):c<u&&E===40?(e.consume(E),c++,v):E===41?(e.consume(E),c--,v):E===null||E===32||E===40||Hi(E)?n(E):(e.consume(E),E===92?g:v)}function g(E){return E===40||E===41||E===92?(e.consume(E),v):v(E)}}function Tc(e,t,n,l,r,a){const i=this;let s=0,o;return u;function u(h){return e.enter(l),e.enter(r),e.consume(h),e.exit(r),e.enter(a),c}function c(h){return s>999||h===null||h===91||h===93&&!o||h===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(h):h===93?(e.exit(a),e.enter(r),e.consume(h),e.exit(r),e.exit(l),t):oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||oe(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),o||(o=!Ie(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),s++,d):d(h)}}function Cc(e,t,n,l,r,a){let i;return s;function s(f){return f===34||f===39||f===40?(e.enter(l),e.enter(r),e.consume(f),e.exit(r),i=f===40?41:f,o):n(f)}function o(f){return f===i?(e.enter(r),e.consume(f),e.exit(r),e.exit(l),t):(e.enter(a),u(f))}function u(f){return f===i?(e.exit(a),o(i)):f===null?n(f):oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),_e(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||oe(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===i||f===92?(e.consume(f),c):c(f)}}function Zt(e,t){let n;return l;function l(r){return oe(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,l):Ie(r)?_e(e,l,n?"linePrefix":"lineSuffix")(r):t(r)}}const $1={name:"definition",tokenize:W1},q1={partial:!0,tokenize:Y1};function W1(e,t,n){const l=this;let r;return a;function a(h){return e.enter("definition"),i(h)}function i(h){return Tc.call(l,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return r=Tl(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),o):n(h)}function o(h){return He(h)?Zt(e,u)(h):u(h)}function u(h){return Ec(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(q1,d,d)(h)}function d(h){return Ie(h)?_e(e,f,"whitespace")(h):f(h)}function f(h){return h===null||oe(h)?(e.exit("definition"),l.parser.defined.push(r),t(h)):n(h)}}function Y1(e,t,n){return l;function l(s){return He(s)?Zt(e,r)(s):n(s)}function r(s){return Cc(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Ie(s)?_e(e,i,"whitespace")(s):i(s)}function i(s){return s===null||oe(s)?t(s):n(s)}}const j1={name:"hardBreakEscape",tokenize:K1};function K1(e,t,n){return l;function l(a){return e.enter("hardBreakEscape"),e.consume(a),r}function r(a){return oe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const G1={name:"headingAtx",resolve:Q1,tokenize:X1};function Q1(e,t){let n=e.length-2,l=3,r,a;return e[l][1].type==="whitespace"&&(l+=2),n-2>l&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(l===n-1||n-4>l&&e[n-2][1].type==="whitespace")&&(n-=l+1===n?2:4),n>l&&(r={type:"atxHeadingText",start:e[l][1].start,end:e[n][1].end},a={type:"chunkText",start:e[l][1].start,end:e[n][1].end,contentType:"text"},Vt(e,l,n-l+1,[["enter",r,t],["enter",a,t],["exit",a,t],["exit",r,t]])),e}function X1(e,t,n){let l=0;return r;function r(c){return e.enter("atxHeading"),a(c)}function a(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&l++<6?(e.consume(c),i):c===null||He(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),o(c)):c===null||oe(c)?(e.exit("atxHeading"),t(c)):Ie(c)?_e(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function o(c){return c===35?(e.consume(c),o):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||He(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const J1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Sc=["pre","script","style","textarea"],Z1={concrete:!0,name:"htmlFlow",resolveTo:ng,tokenize:lg},eg={partial:!0,tokenize:ag},tg={partial:!0,tokenize:rg};function ng(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lg(e,t,n){const l=this;let r,a,i,s,o;return u;function u(D){return c(D)}function c(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),a=!0,v):D===63?(e.consume(D),r=3,l.interrupt?t:C):$t(D)?(e.consume(D),i=String.fromCharCode(D),g):n(D)}function f(D){return D===45?(e.consume(D),r=2,h):D===91?(e.consume(D),r=5,s=0,m):$t(D)?(e.consume(D),r=4,l.interrupt?t:C):n(D)}function h(D){return D===45?(e.consume(D),l.interrupt?t:C):n(D)}function m(D){const pe="CDATA[";return D===pe.charCodeAt(s++)?(e.consume(D),s===pe.length?l.interrupt?t:H:m):n(D)}function v(D){return $t(D)?(e.consume(D),i=String.fromCharCode(D),g):n(D)}function g(D){if(D===null||D===47||D===62||He(D)){const pe=D===47,Se=i.toLowerCase();return!pe&&!a&&Sc.includes(Se)?(r=1,l.interrupt?t(D):H(D)):J1.includes(i.toLowerCase())?(r=6,pe?(e.consume(D),E):l.interrupt?t(D):H(D)):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(D):a?N(D):A(D))}return D===45||xt(D)?(e.consume(D),i+=String.fromCharCode(D),g):n(D)}function E(D){return D===62?(e.consume(D),l.interrupt?t:H):n(D)}function N(D){return Ie(D)?(e.consume(D),N):R(D)}function A(D){return D===47?(e.consume(D),R):D===58||D===95||$t(D)?(e.consume(D),L):Ie(D)?(e.consume(D),A):R(D)}function L(D){return D===45||D===46||D===58||D===95||xt(D)?(e.consume(D),L):O(D)}function O(D){return D===61?(e.consume(D),S):Ie(D)?(e.consume(D),O):A(D)}function S(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),o=D,_):Ie(D)?(e.consume(D),S):I(D)}function _(D){return D===o?(e.consume(D),o=null,k):D===null||oe(D)?n(D):(e.consume(D),_)}function I(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||He(D)?O(D):(e.consume(D),I)}function k(D){return D===47||D===62||Ie(D)?A(D):n(D)}function R(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||oe(D)?H(D):Ie(D)?(e.consume(D),M):n(D)}function H(D){return D===45&&r===2?(e.consume(D),F):D===60&&r===1?(e.consume(D),V):D===62&&r===4?(e.consume(D),Z):D===63&&r===3?(e.consume(D),C):D===93&&r===5?(e.consume(D),X):oe(D)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(eg,ie,q)(D)):D===null||oe(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),H)}function q(D){return e.check(tg,B,ie)(D)}function B(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),T}function T(D){return D===null||oe(D)?q(D):(e.enter("htmlFlowData"),H(D))}function F(D){return D===45?(e.consume(D),C):H(D)}function V(D){return D===47?(e.consume(D),i="",$):H(D)}function $(D){if(D===62){const pe=i.toLowerCase();return Sc.includes(pe)?(e.consume(D),Z):H(D)}return $t(D)&&i.length<8?(e.consume(D),i+=String.fromCharCode(D),$):H(D)}function X(D){return D===93?(e.consume(D),C):H(D)}function C(D){return D===62?(e.consume(D),Z):D===45&&r===2?(e.consume(D),C):H(D)}function Z(D){return D===null||oe(D)?(e.exit("htmlFlowData"),ie(D)):(e.consume(D),Z)}function ie(D){return e.exit("htmlFlow"),t(D)}}function rg(e,t,n){const l=this;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):n(i)}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}function ag(e,t,n){return l;function l(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(la,t,n)}}const ig={name:"htmlText",tokenize:sg};function sg(e,t,n){const l=this;let r,a,i;return s;function s(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),o}function o(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),O):C===63?(e.consume(C),A):$t(C)?(e.consume(C),I):n(C)}function u(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),a=0,m):$t(C)?(e.consume(C),N):n(C)}function c(C){return C===45?(e.consume(C),h):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),f):oe(C)?(i=d,V(C)):(e.consume(C),d)}function f(C){return C===45?(e.consume(C),h):d(C)}function h(C){return C===62?F(C):C===45?f(C):d(C)}function m(C){const Z="CDATA[";return C===Z.charCodeAt(a++)?(e.consume(C),a===Z.length?v:m):n(C)}function v(C){return C===null?n(C):C===93?(e.consume(C),g):oe(C)?(i=v,V(C)):(e.consume(C),v)}function g(C){return C===93?(e.consume(C),E):v(C)}function E(C){return C===62?F(C):C===93?(e.consume(C),E):v(C)}function N(C){return C===null||C===62?F(C):oe(C)?(i=N,V(C)):(e.consume(C),N)}function A(C){return C===null?n(C):C===63?(e.consume(C),L):oe(C)?(i=A,V(C)):(e.consume(C),A)}function L(C){return C===62?F(C):A(C)}function O(C){return $t(C)?(e.consume(C),S):n(C)}function S(C){return C===45||xt(C)?(e.consume(C),S):_(C)}function _(C){return oe(C)?(i=_,V(C)):Ie(C)?(e.consume(C),_):F(C)}function I(C){return C===45||xt(C)?(e.consume(C),I):C===47||C===62||He(C)?k(C):n(C)}function k(C){return C===47?(e.consume(C),F):C===58||C===95||$t(C)?(e.consume(C),R):oe(C)?(i=k,V(C)):Ie(C)?(e.consume(C),k):F(C)}function R(C){return C===45||C===46||C===58||C===95||xt(C)?(e.consume(C),R):M(C)}function M(C){return C===61?(e.consume(C),H):oe(C)?(i=M,V(C)):Ie(C)?(e.consume(C),M):k(C)}function H(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),r=C,q):oe(C)?(i=H,V(C)):Ie(C)?(e.consume(C),H):(e.consume(C),B)}function q(C){return C===r?(e.consume(C),r=void 0,T):C===null?n(C):oe(C)?(i=q,V(C)):(e.consume(C),q)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||He(C)?k(C):(e.consume(C),B)}function T(C){return C===47||C===62||He(C)?k(C):n(C)}function F(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function V(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return Ie(C)?_e(e,X,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):X(C)}function X(C){return e.enter("htmlTextData"),i(C)}}const qi={name:"labelEnd",resolveAll:dg,resolveTo:fg,tokenize:hg},og={tokenize:pg},ug={tokenize:bg},cg={tokenize:mg};function dg(e){let t=-1;const n=[];for(;++t<e.length;){const l=e[t][1];if(n.push(e[t]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const r=l.type==="labelImage"?4:2;l.type="data",t+=r}}return e.length!==n.length&&Vt(e,0,e.length,n),e}function fg(e,t){let n=e.length,l=0,r,a,i,s;for(;n--;)if(r=e[n][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=n,r.type!=="labelLink")){l=2;break}}else r.type==="labelEnd"&&(i=n);const o={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[a+l+2][1].end},end:{...e[i-2][1].start}};return s=[["enter",o,t],["enter",u,t]],s=It(s,e.slice(a+1,a+l+3)),s=It(s,[["enter",c,t]]),s=It(s,zi(t.parser.constructs.insideSpan.null,e.slice(a+l+4,i-3),t)),s=It(s,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),s=It(s,e.slice(i+1)),s=It(s,[["exit",o,t]]),Vt(e,a,e.length,s),e}function hg(e,t,n){const l=this;let r=l.events.length,a,i;for(;r--;)if((l.events[r][1].type==="labelImage"||l.events[r][1].type==="labelLink")&&!l.events[r][1]._balanced){a=l.events[r][1];break}return s;function s(f){return a?a._inactive?d(f):(i=l.parser.defined.includes(Tl(l.sliceSerialize({start:a.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),o):n(f)}function o(f){return f===40?e.attempt(og,c,i?c:d)(f):f===91?e.attempt(ug,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(cg,c,d)(f)}function c(f){return t(f)}function d(f){return a._balanced=!0,n(f)}}function pg(e,t,n){return l;function l(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return He(d)?Zt(e,a)(d):a(d)}function a(d){return d===41?c(d):Ec(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return He(d)?Zt(e,o)(d):c(d)}function s(d){return n(d)}function o(d){return d===34||d===39||d===40?Cc(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return He(d)?Zt(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function bg(e,t,n){const l=this;return r;function r(s){return Tc.call(l,e,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return l.parser.defined.includes(Tl(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function i(s){return n(s)}}function mg(e,t,n){return l;function l(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),r}function r(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const gg={name:"labelStartImage",resolveAll:qi.resolveAll,tokenize:vg};function vg(e,t,n){const l=this;return r;function r(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),i):n(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in l.parser.constructs?n(s):t(s)}}const yg={name:"labelStartLink",resolveAll:qi.resolveAll,tokenize:Eg};function Eg(e,t,n){const l=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in l.parser.constructs?n(i):t(i)}}const Wi={name:"lineEnding",tokenize:Tg};function Tg(e,t){return n;function n(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),_e(e,t,"linePrefix")}}const ra={name:"thematicBreak",tokenize:Cg};function Cg(e,t,n){let l=0,r;return a;function a(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,s(u)}function s(u){return u===r?(e.enter("thematicBreakSequence"),o(u)):l>=3&&(u===null||oe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function o(u){return u===r?(e.consume(u),l++,o):(e.exit("thematicBreakSequence"),Ie(u)?_e(e,s,"whitespace")(u):s(u))}}const gt={continuation:{tokenize:Ag},exit:wg,name:"list",tokenize:kg},Sg={partial:!0,tokenize:Ig},xg={partial:!0,tokenize:Ng};function kg(e,t,n){const l=this,r=l.events[l.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return s;function s(h){const m=l.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!l.containerState.marker||h===l.containerState.marker:Ui(h)){if(l.containerState.type||(l.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(ra,n,u)(h):u(h);if(!l.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(h)}return n(h)}function o(h){return Ui(h)&&++i<10?(e.consume(h),o):(!l.interrupt||i<2)&&(l.containerState.marker?h===l.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||h,e.check(la,l.interrupt?n:c,e.attempt(Sg,f,d))}function c(h){return l.containerState.initialBlankLine=!0,a++,f(h)}function d(h){return Ie(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return l.containerState.size=a+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Ag(e,t,n){const l=this;return l.containerState._closeFlow=void 0,e.check(la,r,a);function r(s){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,_e(e,t,"listItemIndent",l.containerState.size+1)(s)}function a(s){return l.containerState.furtherBlankLines||!Ie(s)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,i(s)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(xg,t,i)(s))}function i(s){return l.containerState._closeFlow=!0,l.interrupt=void 0,_e(e,e.attempt(gt,t,n),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ng(e,t,n){const l=this;return _e(e,r,"listItemIndent",l.containerState.size+1);function r(a){const i=l.events[l.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===l.containerState.size?t(a):n(a)}}function wg(e){e.exit(this.containerState.type)}function Ig(e,t,n){const l=this;return _e(e,r,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const i=l.events[l.events.length-1];return!Ie(a)&&i&&i[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const xc={name:"setextUnderline",resolveTo:_g,tokenize:Og};function _g(e,t){let n=e.length,l,r,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){l=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const i={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",i,t]),e.splice(a+1,0,["exit",e[l][1],t]),e[l][1].end={...e[a][1].end}):e[l][1]=i,e.push(["exit",i,t]),e}function Og(e,t,n){const l=this;let r;return a;function a(u){let c=l.events.length,d;for(;c--;)if(l.events[c][1].type!=="lineEnding"&&l.events[c][1].type!=="linePrefix"&&l.events[c][1].type!=="content"){d=l.events[c][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):n(u)}function i(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===r?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),Ie(u)?_e(e,o,"lineSuffix")(u):o(u))}function o(u){return u===null||oe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Mg={tokenize:Dg};function Dg(e){const t=this,n=e.attempt(la,l,e.attempt(this.parser.constructs.flowInitial,r,_e(e,e.attempt(this.parser.constructs.flow,r,e.attempt(F1,r)),"linePrefix")));return n;function l(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Lg={resolveAll:Ac()},Pg=kc("string"),Bg=kc("text");function kc(e){return{resolveAll:Ac(e==="text"?Rg:void 0),tokenize:t};function t(n){const l=this,r=this.parser.constructs[e],a=n.attempt(r,i,s);return i;function i(c){return u(c)?a(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),o}function o(c){return u(c)?(n.exit("data"),a(c)):(n.consume(c),o)}function u(c){if(c===null)return!0;const d=r[c];let f=-1;if(d)for(;++f<d.length;){const h=d[f];if(!h.previous||h.previous.call(l,l.previous))return!0}return!1}}}function Ac(e){return t;function t(n,l){let r=-1,a;for(;++r<=n.length;)a===void 0?n[r]&&n[r][1].type==="data"&&(a=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==a+2&&(n[a][1].end=n[r-1][1].end,n.splice(a+2,r-a-2),r=a+2),a=void 0);return e?e(n,l):n}}function Rg(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const l=e[n-1][1],r=t.sliceStream(l);let a=r.length,i=-1,s=0,o;for(;a--;){const u=r[a];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(u===-2)o=!0,s++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||o||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?i:l.start._bufferIndex+i,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...u.start},l.start.offset===l.end.offset?Object.assign(l,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Fg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:$1},disable:{null:[]},document:{42:gt,43:gt,45:gt,48:gt,49:gt,50:gt,51:gt,52:gt,53:gt,54:gt,55:gt,56:gt,57:gt,62:pc},flow:{35:G1,42:ra,45:[xc,ra],60:Z1,61:xc,95:ra,96:vc,126:vc},flowInitial:{[-2]:$i,[-1]:$i,32:$i},insideSpan:{null:[Vi,Lg]},string:{38:mc,92:bc},text:{[-5]:Wi,[-4]:Wi,[-3]:Wi,33:gg,38:mc,42:Vi,60:[y1,ig],91:yg,92:[j1,bc],93:qi,95:Vi,96:M1}},Symbol.toStringTag,{value:"Module"}));function Hg(e,t,n){let l={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},a=[];let i=[],s=[];const o={attempt:_(O),check:_(S),consume:N,enter:A,exit:L,interrupt:_(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:h,write:d};let c=t.tokenize.call(u,o);return t.resolveAll&&a.push(t),u;function d(M){return i=It(i,M),g(),i[i.length-1]!==null?[]:(I(t,0),u.events=zi(a,u.events,u),u.events)}function f(M,H){return zg(h(M),H)}function h(M){return Ug(i,M)}function m(){const{_bufferIndex:M,_index:H,line:q,column:B,offset:T}=l;return{_bufferIndex:M,_index:H,line:q,column:B,offset:T}}function v(M){r[M.line]=M.column,R()}function g(){let M;for(;l._index<i.length;){const H=i[l._index];if(typeof H=="string")for(M=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===M&&l._bufferIndex<H.length;)E(H.charCodeAt(l._bufferIndex));else E(H)}}function E(M){c=c(M)}function N(M){oe(M)?(l.line++,l.column=1,l.offset+=M===-3?2:1,R()):M!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===i[l._index].length&&(l._bufferIndex=-1,l._index++)),u.previous=M}function A(M,H){const q=H||{};return q.type=M,q.start=m(),u.events.push(["enter",q,u]),s.push(q),q}function L(M){const H=s.pop();return H.end=m(),u.events.push(["exit",H,u]),H}function O(M,H){I(M,H.from)}function S(M,H){H.restore()}function _(M,H){return q;function q(B,T,F){let V,$,X,C;return Array.isArray(B)?ie(B):"tokenize"in B?ie([B]):Z(B);function Z(ke){return ce;function ce(Ne){const Oe=Ne!==null&&ke[Ne],Ae=Ne!==null&&ke.null,nt=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return ie(nt)(Ne)}}function ie(ke){return V=ke,$=0,ke.length===0?F:D(ke[$])}function D(ke){return ce;function ce(Ne){return C=k(),X=ke,ke.partial||(u.currentConstruct=ke),ke.name&&u.parser.constructs.disable.null.includes(ke.name)?Se():ke.tokenize.call(H?Object.assign(Object.create(u),H):u,o,pe,Se)(Ne)}}function pe(ke){return M(X,C),T}function Se(ke){return C.restore(),++$<V.length?D(V[$]):F}}}function I(M,H){M.resolveAll&&!a.includes(M)&&a.push(M),M.resolve&&Vt(u.events,H,u.events.length-H,M.resolve(u.events.slice(H),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function k(){const M=m(),H=u.previous,q=u.currentConstruct,B=u.events.length,T=Array.from(s);return{from:B,restore:F};function F(){l=M,u.previous=H,u.currentConstruct=q,u.events.length=B,s=T,R()}}function R(){l.line in r&&l.column<2&&(l.column=r[l.line],l.offset+=r[l.line]-1)}}function Ug(e,t){const n=t.start._index,l=t.start._bufferIndex,r=t.end._index,a=t.end._bufferIndex;let i;if(n===r)i=[e[n].slice(l,a)];else{if(i=e.slice(n,r),l>-1){const s=i[0];typeof s=="string"?i[0]=s.slice(l):i.shift()}a>0&&i.push(e[r].slice(0,a))}return i}function zg(e,t){let n=-1;const l=[];let r;for(;++n<e.length;){const a=e[n];let i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
1
+ (function(we,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom/client"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom/client","react-dom"],b):(we=typeof globalThis<"u"?globalThis:we||self,b(we.SealSeekBIComponents={},we.React,we.React,we.antd,we.AntdIcons,we.ReactDOM,we.ReactDOM))})(this,function(we,b,y,ue,Ut,cm,Ni){"use strict";const Cu=({variant:e="primary",loading:t=!1,children:n,...l})=>{const r=a=>{switch(a){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return b.jsx(ue.Button,{...l,type:r(e),loading:t,ghost:e==="ghost",children:n})};Cu.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const Su=({title:e,children:t,bordered:n=!0,hoverable:l=!1,size:r="default",...a})=>b.jsx(ue.Card,{...a,title:e,bordered:n,hoverable:l,size:r,children:t});Su.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const xu=({showDefaultFooter:e=!0,...t})=>{const n=t.footer!==void 0?t.footer:e?(l,{OkBtn:r,CancelBtn:a})=>b.jsxs(b.Fragment,{children:[b.jsx(r,{}),b.jsx(a,{})]}):null;return b.jsx(ue.Modal,{...t,footer:n})};xu.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const ku=({scrollX:e,showPagination:t=!0,defaultPageSize:n=10,...l})=>b.jsx(ue.Table,{...l,scroll:{x:e||"max-content",y:"50vh"},pagination:t?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:n,...l.pagination}:!1});ku.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const dm=Ut.createFromIconfontCN({scriptUrl:["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]}),Au=({name:e,size:t,color:n,style:l,...r})=>{const a={fontSize:t,color:n,...l};return b.jsx(dm,{...r,type:e,style:a})};Au.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Nu=({loading:e,description:t="暂无数据",className:n,emptyChildren:l,loadingText:r,emptyImage:a})=>e?b.jsxs(ue.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",vertical:!0,children:[b.jsx(ue.Spin,{size:"large"}),r&&b.jsx("div",{className:"mt-4 text-gray-500",children:r})]}):b.jsx(ue.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",children:b.jsx(ue.Empty,{image:a,description:t,imageStyle:{height:180},children:l})});Nu.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const wu=({onClick:e,showText:t=!1,className:n,size:l="small",type:r="default"})=>b.jsx(ue.Button,{size:l,type:r,icon:b.jsx(Ut.LeftOutlined,{}),className:`cursor-pointer ${n||""}`,onClick:e,children:t&&"返回"});wu.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const Iu=({removePadding:e=!0,className:t,...n})=>{const l=e?`px-0 h-auto ${t||""}`:t;return b.jsx(ue.Button,{type:"link",...n,className:l,children:n.children})};Iu.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:fm}=ue.Select,_u=({columns:e,request:t,searchFields:n=[],showSearch:l=!0,showRefresh:r=!0,defaultPageSize:a=10,pageSizeOptions:i=["10","20","50","100"],autoLoad:s=!0,externalParams:o={},...u})=>{const[c,d]=y.useState([]),[f,h]=y.useState(!1),[m,v]=y.useState({current:1,pageSize:a,total:0}),[g,E]=y.useState({}),[N,A]=y.useState({}),[L]=ue.Form.useForm(),O=y.useRef(m);O.current=m;const S=y.useRef(o);S.current=o;const _=y.useRef(!1),I=y.useMemo(()=>e.map(B=>{const{sortable:T,render:F,...V}=B;return{...V,sorter:T?!0:void 0,render:F||($=>$)}}),[e]),k=y.useCallback(async(B={})=>{if(t){h(!0);try{const T={page:O.current.current,pageSize:O.current.pageSize,sortField:N.field,sortOrder:N.order,searchParams:{...g,...S.current},...B},F=await t(T);F.success&&(d(F.data),v(V=>({...V,total:F.total,current:T.page||V.current})))}catch(T){console.error("加载数据失败:",T)}finally{h(!1)}}},[t,N,g]),R=y.useCallback(B=>{E(B),v(T=>({...T,current:1}))},[]),M=y.useCallback(()=>{L.resetFields(),E({}),v(B=>({...B,current:1}))},[L]),H=y.useCallback(()=>{k()},[k]),q=y.useCallback((B,T,F)=>{const V={current:B.current||1,pageSize:B.pageSize||a,total:B.total||0},$={field:F?.field,order:F?.order};v(V),A($)},[a]);return y.useEffect(()=>{const B=Object.keys(o).length>0;(s&&!_.current||B)&&(k(),_.current=!0)},[s,o,k]),b.jsxs("div",{children:[l&&n.length>0&&b.jsx(ue.Card,{size:"small",style:{marginBottom:16},children:b.jsxs(ue.Form,{form:L,layout:"inline",onFinish:R,initialValues:n.reduce((B,T)=>(T.defaultValue!==void 0&&(B[T.key]=T.defaultValue),B),{}),children:[n.map(B=>b.jsx(ue.Form.Item,{name:B.key,label:B.label,children:B.type==="input"?b.jsx(ue.Input,{placeholder:B.placeholder||`请输入${B.label}`,style:{width:200}}):b.jsx(ue.Select,{placeholder:B.placeholder||`请选择${B.label}`,style:{width:200},allowClear:!0,children:B.options?.map(T=>b.jsx(fm,{value:T.value,children:T.label},T.value))})},B.key)),b.jsx(ue.Form.Item,{children:b.jsxs(ue.Space,{children:[b.jsx(ue.Button,{type:"primary",htmlType:"submit",icon:b.jsx(Ut.SearchOutlined,{}),children:"查询"}),b.jsx(ue.Button,{onClick:M,children:"重置"}),r&&b.jsx(ue.Button,{icon:b.jsx(Ut.ReloadOutlined,{}),onClick:H,children:"刷新"})]})})]})}),b.jsx(ue.Table,{...u,columns:I,dataSource:c,loading:f,pagination:{...m,showSizeChanger:!0,showQuickJumper:!0,showTotal:(B,T)=>`第 ${T[0]}-${T[1]} 条/共 ${B} 条`,pageSizeOptions:i},onChange:q,scroll:{x:"max-content",y:"50vh"}})]})};_u.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}},ue.unstableSetRender((e,t)=>{const n=t;n._reactRootForAntd||=cm.createRoot(n);const l=n._reactRootForAntd;return l.render(e),async()=>{await new Promise(r=>setTimeout(r,0)),l.unmount()}});const hm=({node:e,value:t,onChange:n,index:l})=>{const r=e.key?`debug-node-${e.key}`:`debug-node-text-${l??0}`;return e.type==="text"||e.type==="tag"?b.jsx("span",{"data-testid":r,className:"rte-text",children:e.text}):b.jsx("input",{"data-testid":r,"data-value":Array.isArray(t)?t.join(","):t??"",value:Array.isArray(t)?t.join(","):t??"",onChange:a=>n(e.key,a.target.value),placeholder:`[${e.type}] ${e.placeholder??e.key??""}`})},pm=/[;;,,。.!!??::、]/,bm=e=>{const t=(e??"").trim();return t.length===1&&pm.test(t)},Ou=y.memo(({node:e})=>{if(bm(e.text)&&!e.className&&!e.exclusionGroup)return b.jsx("span",{"data-type":"text",className:"rte-inline-punct",contentEditable:!1,children:(e.text??"").trim()});const t=(e.text??"").replace(/\n/g,"<br/>"),n=b.jsx("span",{"data-type":"text",className:e.className,contentEditable:!1,dangerouslySetInnerHTML:{__html:t}});return e.exclusionGroup?b.jsx("span",{className:"exclusion-wrapper","data-group":e.exclusionGroup,children:n}):n});Ou.displayName="TextNode";const mm={background:"#0A0A0A",color:"#fff",fontSize:12,padding:12,borderRadius:8,boxShadow:"0 4px 20px 0 rgba(129, 124, 143, 0.2)",maxWidth:320,whiteSpace:"normal",wordBreak:"break-word"},$n=({children:e,placement:t="top",...n})=>b.jsx(ue.Tooltip,{...n,arrow:!1,color:"#0A0A0A",placement:t,overlayInnerStyle:mm,children:e}),gm=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Mu=y.memo(({node:e,hideClose:t,onClose:n,tooltipZIndex:l})=>{const r=gm(e.tooltip),a=b.jsx("span",{contentEditable:!1,className:["tag-node","group",e.className].filter(Boolean).join(" "),...r?{"data-tooltip":r,"data-tag-key":e.key||""}:{},children:b.jsx("span",{className:"tag-label",...!t&&n?{"data-tag-clickable":"true",onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},onClick:i=>{i.preventDefault(),i.stopPropagation(),n()}}:{},children:e.text})});return r?b.jsx($n,{title:r,zIndex:l,children:a}):a});Mu.displayName="TagNode";function Ww(){}function Yw(){}function Du(e){const t=[],n=String(e||"");let l=n.indexOf(","),r=0,a=!1;for(;!a;){l===-1&&(l=n.length,a=!0);const i=n.slice(r,l).trim();(i||!a)&&t.push(i),r=l+1,l=n.indexOf(",",r)}return t}function Lu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vm=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ym=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Em={};function Pu(e,t){return(Em.jsx?ym:vm).test(e)}const Tm=/[ \t\n\f\r]/g;function Cm(e){return typeof e=="object"?e.type==="text"?Bu(e.value):!1:Bu(e)}function Bu(e){return e.replace(Tm,"")===""}let Xl=class{constructor(t,n,l){this.normal=n,this.property=t,l&&(this.space=l)}};Xl.prototype.normal={},Xl.prototype.property={},Xl.prototype.space=void 0;function Ru(e,t){const n={},l={};for(const r of e)Object.assign(n,r.property),Object.assign(l,r.normal);return new Xl(n,l,t)}function Jl(e){return e.toLowerCase()}class mt{constructor(t,n){this.attribute=n,this.property=t}}mt.prototype.attribute="",mt.prototype.booleanish=!1,mt.prototype.boolean=!1,mt.prototype.commaOrSpaceSeparated=!1,mt.prototype.commaSeparated=!1,mt.prototype.defined=!1,mt.prototype.mustUseProperty=!1,mt.prototype.number=!1,mt.prototype.overloadedBoolean=!1,mt.prototype.property="",mt.prototype.spaceSeparated=!1,mt.prototype.space=void 0;let Sm=0;const Te=qn(),Ve=qn(),wi=qn(),Q=qn(),Pe=qn(),vl=qn(),St=qn();function qn(){return 2**++Sm}const Ii=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:Ve,commaOrSpaceSeparated:St,commaSeparated:vl,number:Q,overloadedBoolean:wi,spaceSeparated:Pe},Symbol.toStringTag,{value:"Module"})),_i=Object.keys(Ii);class Oi extends mt{constructor(t,n,l,r){let a=-1;if(super(t,n),Fu(this,"space",r),typeof l=="number")for(;++a<_i.length;){const i=_i[a];Fu(this,_i[a],(l&Ii[i])===Ii[i])}}}Oi.prototype.defined=!0;function Fu(e,t,n){n&&(e[t]=n)}function yl(e){const t={},n={};for(const[l,r]of Object.entries(e.properties)){const a=new Oi(l,e.transform(e.attributes||{},l),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(a.mustUseProperty=!0),t[l]=a,n[Jl(l)]=l,n[Jl(a.attribute)]=l}return new Xl(t,n,e.space)}const Hu=yl({properties:{ariaActiveDescendant:null,ariaAtomic:Ve,ariaAutoComplete:null,ariaBusy:Ve,ariaChecked:Ve,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Pe,ariaCurrent:null,ariaDescribedBy:Pe,ariaDetails:null,ariaDisabled:Ve,ariaDropEffect:Pe,ariaErrorMessage:null,ariaExpanded:Ve,ariaFlowTo:Pe,ariaGrabbed:Ve,ariaHasPopup:null,ariaHidden:Ve,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pe,ariaLevel:Q,ariaLive:null,ariaModal:Ve,ariaMultiLine:Ve,ariaMultiSelectable:Ve,ariaOrientation:null,ariaOwns:Pe,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Ve,ariaReadOnly:Ve,ariaRelevant:null,ariaRequired:Ve,ariaRoleDescription:Pe,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Ve,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Uu(e,t){return t in e?e[t]:t}function zu(e,t){return Uu(e,t.toLowerCase())}const xm=yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vl,acceptCharset:Pe,accessKey:Pe,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Pe,autoFocus:Te,autoPlay:Te,blocking:Pe,capture:null,charSet:null,checked:Te,cite:null,className:Pe,cols:Q,colSpan:null,content:null,contentEditable:Ve,controls:Te,controlsList:Pe,coords:Q|vl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:wi,draggable:Ve,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Pe,height:Q,hidden:wi,high:Q,href:null,hrefLang:null,htmlFor:Pe,httpEquiv:Pe,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Pe,itemRef:Pe,itemScope:Te,itemType:Pe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:Q,pattern:null,ping:Pe,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Pe,required:Te,reversed:Te,rows:Q,rowSpan:Q,sandbox:Pe,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Ve,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:Ve,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pe,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Ve,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Te,disableRemotePlayback:Te,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:zu}),km=yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:St,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Pe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:vl,g2:vl,glyphName:vl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:St,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:St,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:St,rev:St,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:St,requiredFeatures:St,requiredFonts:St,requiredFormats:St,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:St,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:St,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:St,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Uu}),Vu=yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),$u=yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zu}),qu=yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Am={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Nm=/[A-Z]/g,Wu=/-[a-z]/g,wm=/^data[-\w.:]+$/i;function ta(e,t){const n=Jl(t);let l=t,r=mt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wm.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Wu,_m);l="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Wu.test(a)){let i=a.replace(Nm,Im);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}r=Oi}return new r(l,t)}function Im(e){return"-"+e.toLowerCase()}function _m(e){return e.charAt(1).toUpperCase()}const Zl=Ru([Hu,xm,Vu,$u,qu],"html"),cn=Ru([Hu,km,Vu,$u,qu],"svg");function Yu(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ju(e){return e.join(" ").trim()}function Mi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var El={},Di,Ku;function Om(){if(Ku)return Di;Ku=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,o=`
2
+ `,u="/",c="*",d="",f="comment",h="declaration";function m(g,E){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];E=E||{};var N=1,A=1;function L(B){var T=B.match(t);T&&(N+=T.length);var F=B.lastIndexOf(o);A=~F?B.length-F:A+B.length}function O(){var B={line:N,column:A};return function(T){return T.position=new S(B),k(),T}}function S(B){this.start=B,this.end={line:N,column:A},this.source=E.source}S.prototype.content=g;function _(B){var T=new Error(E.source+":"+N+":"+A+": "+B);if(T.reason=B,T.filename=E.source,T.line=N,T.column=A,T.source=g,!E.silent)throw T}function I(B){var T=B.exec(g);if(T){var F=T[0];return L(F),g=g.slice(F.length),T}}function k(){I(n)}function R(B){var T;for(B=B||[];T=M();)T!==!1&&B.push(T);return B}function M(){var B=O();if(!(u!=g.charAt(0)||c!=g.charAt(1))){for(var T=2;d!=g.charAt(T)&&(c!=g.charAt(T)||u!=g.charAt(T+1));)++T;if(T+=2,d===g.charAt(T-1))return _("End of comment missing");var F=g.slice(2,T-2);return A+=2,L(F),g=g.slice(T),A+=2,B({type:f,comment:F})}}function H(){var B=O(),T=I(l);if(T){if(M(),!I(r))return _("property missing ':'");var F=I(a),V=B({type:h,property:v(T[0].replace(e,d)),value:F?v(F[0].replace(e,d)):d});return I(i),V}}function q(){var B=[];R(B);for(var T;T=H();)T!==!1&&(B.push(T),R(B));return B}return k(),q()}function v(g){return g?g.replace(s,d):d}return Di=m,Di}var Gu;function Mm(){if(Gu)return El;Gu=1;var e=El&&El.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(El,"__esModule",{value:!0}),El.default=n;const t=e(Om());function n(l,r){let a=null;if(!l||typeof l!="string")return a;const i=(0,t.default)(l),s=typeof r=="function";return i.forEach(o=>{if(o.type!=="declaration")return;const{property:u,value:c}=o;s?r(u,c,o):c&&(a=a||{},a[u]=c)}),a}return El}var er={},Qu;function Dm(){if(Qu)return er;Qu=1,Object.defineProperty(er,"__esModule",{value:!0}),er.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},i=function(u,c){return c.toUpperCase()},s=function(u,c){return"".concat(c,"-")},o=function(u,c){return c===void 0&&(c={}),a(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(r,s):u=u.replace(l,s),u.replace(t,i))};return er.camelCase=o,er}var tr,Xu;function Lm(){if(Xu)return tr;Xu=1;var e=tr&&tr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(Mm()),n=Dm();function l(r,a){var i={};return!r||typeof r!="string"||(0,t.default)(r,function(s,o){s&&o&&(i[(0,n.camelCase)(s,a)]=o)}),i}return l.default=l,tr=l,tr}var Pm=Lm();const Bm=Mi(Pm),na=Ju("end"),zt=Ju("start");function Ju(e){return t;function t(n){const l=n&&n.position&&n.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Zu(e){const t=zt(e),n=na(e);if(t&&n)return{start:t,end:n}}function nr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ec(e.position):"start"in e||"end"in e?ec(e):"line"in e||"column"in e?Li(e):""}function Li(e){return tc(e&&e.line)+":"+tc(e&&e.column)}function ec(e){return Li(e&&e.start)+"-"+Li(e&&e.end)}function tc(e){return e&&typeof e=="number"?e:1}class rt extends Error{constructor(t,n,l){super(),typeof n=="string"&&(l=n,n=void 0);let r="",a={},i=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?r=t:!a.cause&&t&&(i=!0,r=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof l=="string"){const o=l.indexOf(":");o===-1?a.ruleId=l:(a.source=l.slice(0,o),a.ruleId=l.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=nr(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rt.prototype.file="",rt.prototype.name="",rt.prototype.reason="",rt.prototype.message="",rt.prototype.stack="",rt.prototype.column=void 0,rt.prototype.line=void 0,rt.prototype.ancestors=void 0,rt.prototype.cause=void 0,rt.prototype.fatal=void 0,rt.prototype.place=void 0,rt.prototype.ruleId=void 0,rt.prototype.source=void 0;const Pi={}.hasOwnProperty,Rm=new Map,Fm=/[A-Z]/g,Hm=new Set(["table","tbody","thead","tfoot","tr"]),Um=new Set(["td","th"]),nc="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zm(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let l;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=Gm(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=Km(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cn:Zl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=lc(r,e,void 0);return a&&typeof a!="string"?a:r.create(e,r.Fragment,{children:a||void 0},void 0)}function lc(e,t,n){if(t.type==="element")return Vm(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $m(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Wm(e,t,n);if(t.type==="mdxjsEsm")return qm(e,t);if(t.type==="root")return Ym(e,t,n);if(t.type==="text")return jm(e,t)}function Vm(e,t,n){const l=e.schema;let r=l;t.tagName.toLowerCase()==="svg"&&l.space==="html"&&(r=cn,e.schema=r),e.ancestors.push(t);const a=ac(e,t.tagName,!1),i=Qm(e,t);let s=Ri(e,t);return Hm.has(t.tagName)&&(s=s.filter(function(o){return typeof o=="string"?!Cm(o):!0})),rc(e,i,a,t),Bi(i,s),e.ancestors.pop(),e.schema=l,e.create(t,a,i,n)}function $m(e,t){if(t.data&&t.data.estree&&e.evaluater){const l=t.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}lr(e,t.position)}function qm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lr(e,t.position)}function Wm(e,t,n){const l=e.schema;let r=l;t.name==="svg"&&l.space==="html"&&(r=cn,e.schema=r),e.ancestors.push(t);const a=t.name===null?e.Fragment:ac(e,t.name,!0),i=Xm(e,t),s=Ri(e,t);return rc(e,i,a,t),Bi(i,s),e.ancestors.pop(),e.schema=l,e.create(t,a,i,n)}function Ym(e,t,n){const l={};return Bi(l,Ri(e,t)),e.create(t,e.Fragment,l,n)}function jm(e,t){return t.value}function rc(e,t,n,l){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=l)}function Bi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Km(e,t,n){return l;function l(r,a,i,s){const u=Array.isArray(i.children)?n:t;return s?u(a,i,s):u(a,i)}}function Gm(e,t){return n;function n(l,r,a,i){const s=Array.isArray(a.children),o=zt(l);return t(r,a,i,s,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function Qm(e,t){const n={};let l,r;for(r in t.properties)if(r!=="children"&&Pi.call(t.properties,r)){const a=Jm(e,r,t.properties[r]);if(a){const[i,s]=a;e.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&Um.has(t.tagName)?l=s:n[i]=s}}if(l){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return n}function Xm(e,t){const n={};for(const l of t.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const a=l.data.estree.body[0];a.type;const i=a.expression;i.type;const s=i.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else lr(e,t.position);else{const r=l.name;let a;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const s=l.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else lr(e,t.position);else a=l.value===null?!0:l.value;n[r]=a}return n}function Ri(e,t){const n=[];let l=-1;const r=e.passKeys?new Map:Rm;for(;++l<t.children.length;){const a=t.children[l];let i;if(e.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const u=r.get(o)||0;i=o+"-"+u,r.set(o,u+1)}}const s=lc(e,a,i);s!==void 0&&n.push(s)}return n}function Jm(e,t,n){const l=ta(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=l.commaSeparated?Lu(n):ju(n)),l.property==="style"){let r=typeof n=="object"?n:Zm(e,String(n));return e.stylePropertyNameCase==="css"&&(r=e1(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&l.space?Am[l.property]||l.property:l.attribute,n]}}function Zm(e,t){try{return Bm(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const l=n,r=new rt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=nc+"#cannot-parse-style-attribute",r}}function ac(e,t,n){let l;if(!n)l={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let a=-1,i;for(;++a<r.length;){const s=Pu(r[a])?{type:"Identifier",name:r[a]}:{type:"Literal",value:r[a]};i=i?{type:"MemberExpression",object:i,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}l=i}else l=Pu(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(l.type==="Literal"){const r=l.value;return Pi.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(l);lr(e)}function lr(e,t){const n=new rt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=nc+"#cannot-handle-mdx-estrees-without-createevaluater",n}function e1(e){const t={};let n;for(n in e)Pi.call(e,n)&&(t[t1(n)]=e[n]);return t}function t1(e){let t=e.replace(Fm,n1);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function n1(e){return"-"+e.toLowerCase()}const Fi={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},l1={};function r1(e,t){const n=l1,l=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ic(e,l,r)}function ic(e,t,n){if(a1(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return sc(e.children,t,n)}return Array.isArray(e)?sc(e,t,n):""}function sc(e,t,n){const l=[];let r=-1;for(;++r<e.length;)l[r]=ic(e[r],t,n);return l.join("")}function a1(e){return!!(e&&typeof e=="object")}const oc=document.createElement("i");function rr(e){const t="&"+e+";";oc.innerHTML=t;const n=oc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vt(e,t,n,l){const r=e.length;let a=0,i;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,l.length<1e4)i=Array.from(l),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<l.length;)i=l.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function It(e,t){return e.length>0?(Vt(e,e.length,0,t),e):t}const uc={}.hasOwnProperty;function i1(e){const t={};let n=-1;for(;++n<e.length;)s1(t,e[n]);return t}function s1(e,t){let n;for(n in t){const r=(uc.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let i;if(a)for(i in a){uc.call(r,i)||(r[i]=[]);const s=a[i];o1(r[i],Array.isArray(s)?s:s?[s]:[])}}}function o1(e,t){let n=-1;const l=[];for(;++n<t.length;)(t[n].add==="after"?e:l).push(t[n]);Vt(e,0,0,l)}function cc(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=dn(/[A-Za-z]/),xt=dn(/[\dA-Za-z]/),u1=dn(/[#-'*+\--9=?A-Z^-~]/);function Hi(e){return e!==null&&(e<32||e===127)}const Ui=dn(/\d/),c1=dn(/[\dA-Fa-f]/),d1=dn(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function He(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const ar=dn(new RegExp("\\p{P}|\\p{S}","u")),ir=dn(/\s/);function dn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Cl(e){const t=[];let n=-1,l=0,r=0;for(;++n<e.length;){const a=e.charCodeAt(n);let i="";if(a===37&&xt(e.charCodeAt(n+1))&&xt(e.charCodeAt(n+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(i=String.fromCharCode(a,s),r=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(l,n),encodeURIComponent(i)),l=n+r+1,i=""),r&&(n+=r,r=0)}return t.join("")+e.slice(l)}function _e(e,t,n,l){const r=l?l-1:Number.POSITIVE_INFINITY;let a=0;return i;function i(o){return Ie(o)?(e.enter(n),s(o)):t(o)}function s(o){return Ie(o)&&a++<r?(e.consume(o),s):(e.exit(n),t(o))}}const f1={tokenize:h1};function h1(e){const t=e.attempt(this.parser.constructs.contentInitial,l,r);let n;return t;function l(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),_e(e,t,"linePrefix")}function r(s){return e.enter("paragraph"),a(s)}function a(s){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return oe(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),i)}}const p1={tokenize:b1},dc={tokenize:m1};function b1(e){const t=this,n=[];let l=0,r,a,i;return s;function s(A){if(l<n.length){const L=n[l];return t.containerState=L[1],e.attempt(L[0].continuation,o,u)(A)}return u(A)}function o(A){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&N();const L=t.events.length;let O=L,S;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){S=t.events[O][1].end;break}E(l);let _=L;for(;_<t.events.length;)t.events[_][1].end={...S},_++;return Vt(t.events,O+1,0,t.events.slice(L)),t.events.length=_,u(A)}return s(A)}function u(A){if(l===n.length){if(!r)return f(A);if(r.currentConstruct&&r.currentConstruct.concrete)return m(A);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dc,c,d)(A)}function c(A){return r&&N(),E(l),f(A)}function d(A){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,m(A)}function f(A){return t.containerState={},e.attempt(dc,h,m)(A)}function h(A){return l++,n.push([t.currentConstruct,t.containerState]),f(A)}function m(A){if(A===null){r&&N(),E(0),e.consume(A);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),v(A)}function v(A){if(A===null){g(e.exit("chunkFlow"),!0),E(0),e.consume(A);return}return oe(A)?(e.consume(A),g(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(A),v)}function g(A,L){const O=t.sliceStream(A);if(L&&O.push(null),A.previous=a,a&&(a.next=A),a=A,r.defineSkip(A.start),r.write(O),t.parser.lazy[A.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<i&&(!r.events[S][1].end||r.events[S][1].end.offset>i))return;const _=t.events.length;let I=_,k,R;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(k){R=t.events[I][1].end;break}k=!0}for(E(l),S=_;S<t.events.length;)t.events[S][1].end={...R},S++;Vt(t.events,I+1,0,t.events.slice(_)),t.events.length=S}}function E(A){let L=n.length;for(;L-- >A;){const O=n[L];t.containerState=O[1],O[0].exit.call(t,e)}n.length=A}function N(){r.write([null]),a=void 0,r=void 0,t.containerState._closeFlow=void 0}}function m1(e,t,n){return _e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fc(e){if(e===null||He(e)||ir(e))return 1;if(ar(e))return 2}function zi(e,t,n){const l=[];let r=-1;for(;++r<e.length;){const a=e[r].resolveAll;a&&!l.includes(a)&&(t=a(t,n),l.push(a))}return t}const Vi={name:"attention",resolveAll:g1,tokenize:v1};function g1(e,t){let n=-1,l,r,a,i,s,o,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(l=n;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&t.sliceSerialize(e[l][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[l][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;o=e[l][1].end.offset-e[l][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[l][1].end},f={...e[n][1].start};hc(d,-o),hc(f,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[l][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:o>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[n][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[l][1].end={...i.start},e[n][1].start={...s.end},u=[],e[l][1].end.offset-e[l][1].start.offset&&(u=It(u,[["enter",e[l][1],t],["exit",e[l][1],t]])),u=It(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",a,t]]),u=It(u,zi(t.parser.constructs.insideSpan.null,e.slice(l+1,n),t)),u=It(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=It(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Vt(e,l-1,n-l+3,u),n=l+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function v1(e,t){const n=this.parser.constructs.attentionMarkers.null,l=this.previous,r=fc(l);let a;return i;function i(o){return a=o,e.enter("attentionSequence"),s(o)}function s(o){if(o===a)return e.consume(o),s;const u=e.exit("attentionSequence"),c=fc(o),d=!c||c===2&&r||n.includes(o),f=!r||r===2&&c||n.includes(l);return u._open=!!(a===42?d:d&&(r||!f)),u._close=!!(a===42?f:f&&(c||!d)),t(o)}}function hc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const y1={name:"autolink",tokenize:E1};function E1(e,t,n){let l=0;return r;function r(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(h){return $t(h)?(e.consume(h),i):h===64?n(h):u(h)}function i(h){return h===43||h===45||h===46||xt(h)?(l=1,s(h)):u(h)}function s(h){return h===58?(e.consume(h),l=0,o):(h===43||h===45||h===46||xt(h))&&l++<32?(e.consume(h),s):(l=0,u(h))}function o(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Hi(h)?n(h):(e.consume(h),o)}function u(h){return h===64?(e.consume(h),c):u1(h)?(e.consume(h),u):n(h)}function c(h){return xt(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),l=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||xt(h))&&l++<63){const m=h===45?f:d;return e.consume(h),m}return n(h)}}const la={partial:!0,tokenize:T1};function T1(e,t,n){return l;function l(a){return Ie(a)?_e(e,r,"linePrefix")(a):r(a)}function r(a){return a===null||oe(a)?t(a):n(a)}}const pc={continuation:{tokenize:S1},exit:x1,name:"blockQuote",tokenize:C1};function C1(e,t,n){const l=this;return r;function r(i){if(i===62){const s=l.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),a}return n(i)}function a(i){return Ie(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function S1(e,t,n){const l=this;return r;function r(i){return Ie(i)?_e(e,a,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return e.attempt(pc,t,n)(i)}}function x1(e){e.exit("blockQuote")}const bc={name:"characterEscape",tokenize:k1};function k1(e,t,n){return l;function l(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),r}function r(a){return d1(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const mc={name:"characterReference",tokenize:A1};function A1(e,t,n){const l=this;let r=0,a,i;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),o}function o(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,i=xt,c(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,i=c1,c):(e.enter("characterReferenceValue"),a=7,i=Ui,c(d))}function c(d){if(d===59&&r){const f=e.exit("characterReferenceValue");return i===xt&&!rr(l.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(d)&&r++<a?(e.consume(d),c):n(d)}}const gc={partial:!0,tokenize:w1},vc={concrete:!0,name:"codeFenced",tokenize:N1};function N1(e,t,n){const l=this,r={partial:!0,tokenize:O};let a=0,i=0,s;return o;function o(S){return u(S)}function u(S){const _=l.events[l.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,s=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===s?(i++,e.consume(S),c):i<3?n(S):(e.exit("codeFencedFenceSequence"),Ie(S)?_e(e,d,"whitespace")(S):d(S))}function d(S){return S===null||oe(S)?(e.exit("codeFencedFence"),l.interrupt?t(S):e.check(gc,v,L)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||oe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):Ie(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_e(e,h,"whitespace")(S)):S===96&&S===s?n(S):(e.consume(S),f)}function h(S){return S===null||oe(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||oe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===s?n(S):(e.consume(S),m)}function v(S){return e.attempt(r,L,g)(S)}function g(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),E}function E(S){return a>0&&Ie(S)?_e(e,N,"linePrefix",a+1)(S):N(S)}function N(S){return S===null||oe(S)?e.check(gc,v,L)(S):(e.enter("codeFlowValue"),A(S))}function A(S){return S===null||oe(S)?(e.exit("codeFlowValue"),N(S)):(e.consume(S),A)}function L(S){return e.exit("codeFenced"),t(S)}function O(S,_,I){let k=0;return R;function R(T){return S.enter("lineEnding"),S.consume(T),S.exit("lineEnding"),M}function M(T){return S.enter("codeFencedFence"),Ie(T)?_e(S,H,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):H(T)}function H(T){return T===s?(S.enter("codeFencedFenceSequence"),q(T)):I(T)}function q(T){return T===s?(k++,S.consume(T),q):k>=i?(S.exit("codeFencedFenceSequence"),Ie(T)?_e(S,B,"whitespace")(T):B(T)):I(T)}function B(T){return T===null||oe(T)?(S.exit("codeFencedFence"),_(T)):I(T)}}}function w1(e,t,n){const l=this;return r;function r(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a)}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}const $i={name:"codeIndented",tokenize:_1},I1={partial:!0,tokenize:O1};function _1(e,t,n){const l=this;return r;function r(u){return e.enter("codeIndented"),_e(e,a,"linePrefix",5)(u)}function a(u){const c=l.events[l.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(u):n(u)}function i(u){return u===null?o(u):oe(u)?e.attempt(I1,i,o)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||oe(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),s)}function o(u){return e.exit("codeIndented"),t(u)}}function O1(e,t,n){const l=this;return r;function r(i){return l.parser.lazy[l.now().line]?n(i):oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r):_e(e,a,"linePrefix",5)(i)}function a(i){const s=l.events[l.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):oe(i)?r(i):n(i)}}const M1={name:"codeText",previous:L1,resolve:D1,tokenize:P1};function D1(e){let t=e.length-4,n=3,l,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(l=n;++l<t;)if(e[l][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(l=n-1,t++;++l<=t;)r===void 0?l!==t&&e[l][1].type!=="lineEnding"&&(r=l):(l===t||e[l][1].type==="lineEnding")&&(e[r][1].type="codeTextData",l!==r+2&&(e[r][1].end=e[l-1][1].end,e.splice(r+2,l-r-2),t-=l-r-2,l=r+2),r=void 0);return e}function L1(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function P1(e,t,n){let l=0,r,a;return i;function i(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),l++,s):(e.exit("codeTextSequence"),o(d))}function o(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),o):d===96?(a=e.enter("codeTextSequence"),r=0,c(d)):oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||oe(d)?(e.exit("codeTextData"),o(d)):(e.consume(d),u)}function c(d){return d===96?(e.consume(d),r++,c):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class B1{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const l=n??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(t,l):t>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(t,n,l){const r=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return l&&sr(this.left,l),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),sr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),sr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);sr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);sr(this.left,n.reverse())}}}function sr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yc(e){const t={};let n=-1,l,r,a,i,s,o,u;const c=new B1(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(l=c.get(n),n&&l[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(o=l[1]._tokenizer.events,a=0,a<o.length&&o[a][1].type==="lineEndingBlank"&&(a+=2),a<o.length&&o[a][1].type==="content"))for(;++a<o.length&&o[a][1].type!=="content";)o[a][1].type==="chunkText"&&(o[a][1]._isInFirstContentOfListItem=!0,a++);if(l[0]==="enter")l[1].contentType&&(Object.assign(t,R1(c,n)),n=t[n],u=!0);else if(l[1]._container){for(a=n,r=void 0;a--;)if(i=c.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=a);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;r&&(l[1].end={...c.get(r)[1].start},s=c.slice(r,n),s.unshift(l),c.splice(r,n-r+1,s))}}return Vt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function R1(e,t){const n=e.get(t)[1],l=e.get(t)[2];let r=t-1;const a=[];let i=n._tokenizer;i||(i=l.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const s=i.events,o=[],u={};let c,d,f=-1,h=n,m=0,v=0;const g=[v];for(;h;){for(;e.get(++r)[1]!==h;);a.push(r),h._tokenizer||(c=l.sliceStream(h),h.next||c.push(null),d&&i.defineSkip(h.start),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(v=f+1,g.push(v),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(i.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){const E=s.slice(g[f],g[f+1]),N=a.pop();o.push([N,N+E.length-1]),e.splice(N,2,E)}for(o.reverse(),f=-1;++f<o.length;)u[m+o[f][0]]=m+o[f][1],m+=o[f][1]-o[f][0]-1;return u}const F1={resolve:U1,tokenize:z1},H1={partial:!0,tokenize:V1};function U1(e){return yc(e),e}function z1(e,t){let n;return l;function l(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(s)}function r(s){return s===null?a(s):oe(s)?e.check(H1,i,a)(s):(e.consume(s),r)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function V1(e,t,n){const l=this;return r;function r(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),_e(e,a,"linePrefix")}function a(i){if(i===null||oe(i))return n(i);const s=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(l.parser.constructs.flow,n,t)(i)}}function Ec(e,t,n,l,r,a,i,s,o){const u=o||Number.POSITIVE_INFINITY;let c=0;return d;function d(E){return E===60?(e.enter(l),e.enter(r),e.enter(a),e.consume(E),e.exit(a),f):E===null||E===32||E===41||Hi(E)?n(E):(e.enter(l),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(E))}function f(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(r),e.exit(l),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(e.exit("chunkString"),e.exit(s),f(E)):E===null||E===60||oe(E)?n(E):(e.consume(E),E===92?m:h)}function m(E){return E===60||E===62||E===92?(e.consume(E),h):h(E)}function v(E){return!c&&(E===null||E===41||He(E))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(l),t(E)):c<u&&E===40?(e.consume(E),c++,v):E===41?(e.consume(E),c--,v):E===null||E===32||E===40||Hi(E)?n(E):(e.consume(E),E===92?g:v)}function g(E){return E===40||E===41||E===92?(e.consume(E),v):v(E)}}function Tc(e,t,n,l,r,a){const i=this;let s=0,o;return u;function u(h){return e.enter(l),e.enter(r),e.consume(h),e.exit(r),e.enter(a),c}function c(h){return s>999||h===null||h===91||h===93&&!o||h===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(h):h===93?(e.exit(a),e.enter(r),e.consume(h),e.exit(r),e.exit(l),t):oe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||oe(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),o||(o=!Ie(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),s++,d):d(h)}}function Cc(e,t,n,l,r,a){let i;return s;function s(f){return f===34||f===39||f===40?(e.enter(l),e.enter(r),e.consume(f),e.exit(r),i=f===40?41:f,o):n(f)}function o(f){return f===i?(e.enter(r),e.consume(f),e.exit(r),e.exit(l),t):(e.enter(a),u(f))}function u(f){return f===i?(e.exit(a),o(i)):f===null?n(f):oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),_e(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===i||f===null||oe(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===i||f===92?(e.consume(f),c):c(f)}}function Zt(e,t){let n;return l;function l(r){return oe(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,l):Ie(r)?_e(e,l,n?"linePrefix":"lineSuffix")(r):t(r)}}const $1={name:"definition",tokenize:W1},q1={partial:!0,tokenize:Y1};function W1(e,t,n){const l=this;let r;return a;function a(h){return e.enter("definition"),i(h)}function i(h){return Tc.call(l,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return r=Tl(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),o):n(h)}function o(h){return He(h)?Zt(e,u)(h):u(h)}function u(h){return Ec(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(q1,d,d)(h)}function d(h){return Ie(h)?_e(e,f,"whitespace")(h):f(h)}function f(h){return h===null||oe(h)?(e.exit("definition"),l.parser.defined.push(r),t(h)):n(h)}}function Y1(e,t,n){return l;function l(s){return He(s)?Zt(e,r)(s):n(s)}function r(s){return Cc(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Ie(s)?_e(e,i,"whitespace")(s):i(s)}function i(s){return s===null||oe(s)?t(s):n(s)}}const j1={name:"hardBreakEscape",tokenize:K1};function K1(e,t,n){return l;function l(a){return e.enter("hardBreakEscape"),e.consume(a),r}function r(a){return oe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const G1={name:"headingAtx",resolve:Q1,tokenize:X1};function Q1(e,t){let n=e.length-2,l=3,r,a;return e[l][1].type==="whitespace"&&(l+=2),n-2>l&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(l===n-1||n-4>l&&e[n-2][1].type==="whitespace")&&(n-=l+1===n?2:4),n>l&&(r={type:"atxHeadingText",start:e[l][1].start,end:e[n][1].end},a={type:"chunkText",start:e[l][1].start,end:e[n][1].end,contentType:"text"},Vt(e,l,n-l+1,[["enter",r,t],["enter",a,t],["exit",a,t],["exit",r,t]])),e}function X1(e,t,n){let l=0;return r;function r(c){return e.enter("atxHeading"),a(c)}function a(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&l++<6?(e.consume(c),i):c===null||He(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),o(c)):c===null||oe(c)?(e.exit("atxHeading"),t(c)):Ie(c)?_e(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function o(c){return c===35?(e.consume(c),o):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||He(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const J1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Sc=["pre","script","style","textarea"],Z1={concrete:!0,name:"htmlFlow",resolveTo:ng,tokenize:lg},eg={partial:!0,tokenize:ag},tg={partial:!0,tokenize:rg};function ng(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lg(e,t,n){const l=this;let r,a,i,s,o;return u;function u(D){return c(D)}function c(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),a=!0,v):D===63?(e.consume(D),r=3,l.interrupt?t:C):$t(D)?(e.consume(D),i=String.fromCharCode(D),g):n(D)}function f(D){return D===45?(e.consume(D),r=2,h):D===91?(e.consume(D),r=5,s=0,m):$t(D)?(e.consume(D),r=4,l.interrupt?t:C):n(D)}function h(D){return D===45?(e.consume(D),l.interrupt?t:C):n(D)}function m(D){const pe="CDATA[";return D===pe.charCodeAt(s++)?(e.consume(D),s===pe.length?l.interrupt?t:H:m):n(D)}function v(D){return $t(D)?(e.consume(D),i=String.fromCharCode(D),g):n(D)}function g(D){if(D===null||D===47||D===62||He(D)){const pe=D===47,ge=i.toLowerCase();return!pe&&!a&&Sc.includes(ge)?(r=1,l.interrupt?t(D):H(D)):J1.includes(i.toLowerCase())?(r=6,pe?(e.consume(D),E):l.interrupt?t(D):H(D)):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(D):a?N(D):A(D))}return D===45||xt(D)?(e.consume(D),i+=String.fromCharCode(D),g):n(D)}function E(D){return D===62?(e.consume(D),l.interrupt?t:H):n(D)}function N(D){return Ie(D)?(e.consume(D),N):R(D)}function A(D){return D===47?(e.consume(D),R):D===58||D===95||$t(D)?(e.consume(D),L):Ie(D)?(e.consume(D),A):R(D)}function L(D){return D===45||D===46||D===58||D===95||xt(D)?(e.consume(D),L):O(D)}function O(D){return D===61?(e.consume(D),S):Ie(D)?(e.consume(D),O):A(D)}function S(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),o=D,_):Ie(D)?(e.consume(D),S):I(D)}function _(D){return D===o?(e.consume(D),o=null,k):D===null||oe(D)?n(D):(e.consume(D),_)}function I(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||He(D)?O(D):(e.consume(D),I)}function k(D){return D===47||D===62||Ie(D)?A(D):n(D)}function R(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||oe(D)?H(D):Ie(D)?(e.consume(D),M):n(D)}function H(D){return D===45&&r===2?(e.consume(D),F):D===60&&r===1?(e.consume(D),V):D===62&&r===4?(e.consume(D),Z):D===63&&r===3?(e.consume(D),C):D===93&&r===5?(e.consume(D),X):oe(D)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(eg,ie,q)(D)):D===null||oe(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),H)}function q(D){return e.check(tg,B,ie)(D)}function B(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),T}function T(D){return D===null||oe(D)?q(D):(e.enter("htmlFlowData"),H(D))}function F(D){return D===45?(e.consume(D),C):H(D)}function V(D){return D===47?(e.consume(D),i="",$):H(D)}function $(D){if(D===62){const pe=i.toLowerCase();return Sc.includes(pe)?(e.consume(D),Z):H(D)}return $t(D)&&i.length<8?(e.consume(D),i+=String.fromCharCode(D),$):H(D)}function X(D){return D===93?(e.consume(D),C):H(D)}function C(D){return D===62?(e.consume(D),Z):D===45&&r===2?(e.consume(D),C):H(D)}function Z(D){return D===null||oe(D)?(e.exit("htmlFlowData"),ie(D)):(e.consume(D),Z)}function ie(D){return e.exit("htmlFlow"),t(D)}}function rg(e,t,n){const l=this;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):n(i)}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}function ag(e,t,n){return l;function l(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(la,t,n)}}const ig={name:"htmlText",tokenize:sg};function sg(e,t,n){const l=this;let r,a,i;return s;function s(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),o}function o(C){return C===33?(e.consume(C),u):C===47?(e.consume(C),O):C===63?(e.consume(C),A):$t(C)?(e.consume(C),I):n(C)}function u(C){return C===45?(e.consume(C),c):C===91?(e.consume(C),a=0,m):$t(C)?(e.consume(C),N):n(C)}function c(C){return C===45?(e.consume(C),h):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),f):oe(C)?(i=d,V(C)):(e.consume(C),d)}function f(C){return C===45?(e.consume(C),h):d(C)}function h(C){return C===62?F(C):C===45?f(C):d(C)}function m(C){const Z="CDATA[";return C===Z.charCodeAt(a++)?(e.consume(C),a===Z.length?v:m):n(C)}function v(C){return C===null?n(C):C===93?(e.consume(C),g):oe(C)?(i=v,V(C)):(e.consume(C),v)}function g(C){return C===93?(e.consume(C),E):v(C)}function E(C){return C===62?F(C):C===93?(e.consume(C),E):v(C)}function N(C){return C===null||C===62?F(C):oe(C)?(i=N,V(C)):(e.consume(C),N)}function A(C){return C===null?n(C):C===63?(e.consume(C),L):oe(C)?(i=A,V(C)):(e.consume(C),A)}function L(C){return C===62?F(C):A(C)}function O(C){return $t(C)?(e.consume(C),S):n(C)}function S(C){return C===45||xt(C)?(e.consume(C),S):_(C)}function _(C){return oe(C)?(i=_,V(C)):Ie(C)?(e.consume(C),_):F(C)}function I(C){return C===45||xt(C)?(e.consume(C),I):C===47||C===62||He(C)?k(C):n(C)}function k(C){return C===47?(e.consume(C),F):C===58||C===95||$t(C)?(e.consume(C),R):oe(C)?(i=k,V(C)):Ie(C)?(e.consume(C),k):F(C)}function R(C){return C===45||C===46||C===58||C===95||xt(C)?(e.consume(C),R):M(C)}function M(C){return C===61?(e.consume(C),H):oe(C)?(i=M,V(C)):Ie(C)?(e.consume(C),M):k(C)}function H(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),r=C,q):oe(C)?(i=H,V(C)):Ie(C)?(e.consume(C),H):(e.consume(C),B)}function q(C){return C===r?(e.consume(C),r=void 0,T):C===null?n(C):oe(C)?(i=q,V(C)):(e.consume(C),q)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||He(C)?k(C):(e.consume(C),B)}function T(C){return C===47||C===62||He(C)?k(C):n(C)}function F(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function V(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return Ie(C)?_e(e,X,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):X(C)}function X(C){return e.enter("htmlTextData"),i(C)}}const qi={name:"labelEnd",resolveAll:dg,resolveTo:fg,tokenize:hg},og={tokenize:pg},ug={tokenize:bg},cg={tokenize:mg};function dg(e){let t=-1;const n=[];for(;++t<e.length;){const l=e[t][1];if(n.push(e[t]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const r=l.type==="labelImage"?4:2;l.type="data",t+=r}}return e.length!==n.length&&Vt(e,0,e.length,n),e}function fg(e,t){let n=e.length,l=0,r,a,i,s;for(;n--;)if(r=e[n][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=n,r.type!=="labelLink")){l=2;break}}else r.type==="labelEnd"&&(i=n);const o={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[a+l+2][1].end},end:{...e[i-2][1].start}};return s=[["enter",o,t],["enter",u,t]],s=It(s,e.slice(a+1,a+l+3)),s=It(s,[["enter",c,t]]),s=It(s,zi(t.parser.constructs.insideSpan.null,e.slice(a+l+4,i-3),t)),s=It(s,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),s=It(s,e.slice(i+1)),s=It(s,[["exit",o,t]]),Vt(e,a,e.length,s),e}function hg(e,t,n){const l=this;let r=l.events.length,a,i;for(;r--;)if((l.events[r][1].type==="labelImage"||l.events[r][1].type==="labelLink")&&!l.events[r][1]._balanced){a=l.events[r][1];break}return s;function s(f){return a?a._inactive?d(f):(i=l.parser.defined.includes(Tl(l.sliceSerialize({start:a.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),o):n(f)}function o(f){return f===40?e.attempt(og,c,i?c:d)(f):f===91?e.attempt(ug,c,i?u:d)(f):i?c(f):d(f)}function u(f){return e.attempt(cg,c,d)(f)}function c(f){return t(f)}function d(f){return a._balanced=!0,n(f)}}function pg(e,t,n){return l;function l(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),r}function r(d){return He(d)?Zt(e,a)(d):a(d)}function a(d){return d===41?c(d):Ec(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return He(d)?Zt(e,o)(d):c(d)}function s(d){return n(d)}function o(d){return d===34||d===39||d===40?Cc(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function u(d){return He(d)?Zt(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function bg(e,t,n){const l=this;return r;function r(s){return Tc.call(l,e,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return l.parser.defined.includes(Tl(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function i(s){return n(s)}}function mg(e,t,n){return l;function l(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),r}function r(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const gg={name:"labelStartImage",resolveAll:qi.resolveAll,tokenize:vg};function vg(e,t,n){const l=this;return r;function r(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),i):n(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in l.parser.constructs?n(s):t(s)}}const yg={name:"labelStartLink",resolveAll:qi.resolveAll,tokenize:Eg};function Eg(e,t,n){const l=this;return r;function r(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in l.parser.constructs?n(i):t(i)}}const Wi={name:"lineEnding",tokenize:Tg};function Tg(e,t){return n;function n(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),_e(e,t,"linePrefix")}}const ra={name:"thematicBreak",tokenize:Cg};function Cg(e,t,n){let l=0,r;return a;function a(u){return e.enter("thematicBreak"),i(u)}function i(u){return r=u,s(u)}function s(u){return u===r?(e.enter("thematicBreakSequence"),o(u)):l>=3&&(u===null||oe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function o(u){return u===r?(e.consume(u),l++,o):(e.exit("thematicBreakSequence"),Ie(u)?_e(e,s,"whitespace")(u):s(u))}}const gt={continuation:{tokenize:Ag},exit:wg,name:"list",tokenize:kg},Sg={partial:!0,tokenize:Ig},xg={partial:!0,tokenize:Ng};function kg(e,t,n){const l=this,r=l.events[l.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,i=0;return s;function s(h){const m=l.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!l.containerState.marker||h===l.containerState.marker:Ui(h)){if(l.containerState.type||(l.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(ra,n,u)(h):u(h);if(!l.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(h)}return n(h)}function o(h){return Ui(h)&&++i<10?(e.consume(h),o):(!l.interrupt||i<2)&&(l.containerState.marker?h===l.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||h,e.check(la,l.interrupt?n:c,e.attempt(Sg,f,d))}function c(h){return l.containerState.initialBlankLine=!0,a++,f(h)}function d(h){return Ie(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return l.containerState.size=a+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Ag(e,t,n){const l=this;return l.containerState._closeFlow=void 0,e.check(la,r,a);function r(s){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,_e(e,t,"listItemIndent",l.containerState.size+1)(s)}function a(s){return l.containerState.furtherBlankLines||!Ie(s)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,i(s)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(xg,t,i)(s))}function i(s){return l.containerState._closeFlow=!0,l.interrupt=void 0,_e(e,e.attempt(gt,t,n),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ng(e,t,n){const l=this;return _e(e,r,"listItemIndent",l.containerState.size+1);function r(a){const i=l.events[l.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===l.containerState.size?t(a):n(a)}}function wg(e){e.exit(this.containerState.type)}function Ig(e,t,n){const l=this;return _e(e,r,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const i=l.events[l.events.length-1];return!Ie(a)&&i&&i[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const xc={name:"setextUnderline",resolveTo:_g,tokenize:Og};function _g(e,t){let n=e.length,l,r,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){l=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const i={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",i,t]),e.splice(a+1,0,["exit",e[l][1],t]),e[l][1].end={...e[a][1].end}):e[l][1]=i,e.push(["exit",i,t]),e}function Og(e,t,n){const l=this;let r;return a;function a(u){let c=l.events.length,d;for(;c--;)if(l.events[c][1].type!=="lineEnding"&&l.events[c][1].type!=="linePrefix"&&l.events[c][1].type!=="content"){d=l.events[c][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||d)?(e.enter("setextHeadingLine"),r=u,i(u)):n(u)}function i(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===r?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),Ie(u)?_e(e,o,"lineSuffix")(u):o(u))}function o(u){return u===null||oe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Mg={tokenize:Dg};function Dg(e){const t=this,n=e.attempt(la,l,e.attempt(this.parser.constructs.flowInitial,r,_e(e,e.attempt(this.parser.constructs.flow,r,e.attempt(F1,r)),"linePrefix")));return n;function l(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Lg={resolveAll:Ac()},Pg=kc("string"),Bg=kc("text");function kc(e){return{resolveAll:Ac(e==="text"?Rg:void 0),tokenize:t};function t(n){const l=this,r=this.parser.constructs[e],a=n.attempt(r,i,s);return i;function i(c){return u(c)?a(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),o}function o(c){return u(c)?(n.exit("data"),a(c)):(n.consume(c),o)}function u(c){if(c===null)return!0;const d=r[c];let f=-1;if(d)for(;++f<d.length;){const h=d[f];if(!h.previous||h.previous.call(l,l.previous))return!0}return!1}}}function Ac(e){return t;function t(n,l){let r=-1,a;for(;++r<=n.length;)a===void 0?n[r]&&n[r][1].type==="data"&&(a=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==a+2&&(n[a][1].end=n[r-1][1].end,n.splice(a+2,r-a-2),r=a+2),a=void 0);return e?e(n,l):n}}function Rg(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const l=e[n-1][1],r=t.sliceStream(l);let a=r.length,i=-1,s=0,o;for(;a--;){const u=r[a];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(u===-2)o=!0,s++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||o||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?i:l.start._bufferIndex+i,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...u.start},l.start.offset===l.end.offset?Object.assign(l,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Fg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:$1},disable:{null:[]},document:{42:gt,43:gt,45:gt,48:gt,49:gt,50:gt,51:gt,52:gt,53:gt,54:gt,55:gt,56:gt,57:gt,62:pc},flow:{35:G1,42:ra,45:[xc,ra],60:Z1,61:xc,95:ra,96:vc,126:vc},flowInitial:{[-2]:$i,[-1]:$i,32:$i},insideSpan:{null:[Vi,Lg]},string:{38:mc,92:bc},text:{[-5]:Wi,[-4]:Wi,[-3]:Wi,33:gg,38:mc,42:Vi,60:[y1,ig],91:yg,92:[j1,bc],93:qi,95:Vi,96:M1}},Symbol.toStringTag,{value:"Module"}));function Hg(e,t,n){let l={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},a=[];let i=[],s=[];const o={attempt:_(O),check:_(S),consume:N,enter:A,exit:L,interrupt:_(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:h,write:d};let c=t.tokenize.call(u,o);return t.resolveAll&&a.push(t),u;function d(M){return i=It(i,M),g(),i[i.length-1]!==null?[]:(I(t,0),u.events=zi(a,u.events,u),u.events)}function f(M,H){return zg(h(M),H)}function h(M){return Ug(i,M)}function m(){const{_bufferIndex:M,_index:H,line:q,column:B,offset:T}=l;return{_bufferIndex:M,_index:H,line:q,column:B,offset:T}}function v(M){r[M.line]=M.column,R()}function g(){let M;for(;l._index<i.length;){const H=i[l._index];if(typeof H=="string")for(M=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===M&&l._bufferIndex<H.length;)E(H.charCodeAt(l._bufferIndex));else E(H)}}function E(M){c=c(M)}function N(M){oe(M)?(l.line++,l.column=1,l.offset+=M===-3?2:1,R()):M!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===i[l._index].length&&(l._bufferIndex=-1,l._index++)),u.previous=M}function A(M,H){const q=H||{};return q.type=M,q.start=m(),u.events.push(["enter",q,u]),s.push(q),q}function L(M){const H=s.pop();return H.end=m(),u.events.push(["exit",H,u]),H}function O(M,H){I(M,H.from)}function S(M,H){H.restore()}function _(M,H){return q;function q(B,T,F){let V,$,X,C;return Array.isArray(B)?ie(B):"tokenize"in B?ie([B]):Z(B);function Z(ke){return ce;function ce(Ne){const Oe=Ne!==null&&ke[Ne],Ae=Ne!==null&&ke.null,nt=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return ie(nt)(Ne)}}function ie(ke){return V=ke,$=0,ke.length===0?F:D(ke[$])}function D(ke){return ce;function ce(Ne){return C=k(),X=ke,ke.partial||(u.currentConstruct=ke),ke.name&&u.parser.constructs.disable.null.includes(ke.name)?ge():ke.tokenize.call(H?Object.assign(Object.create(u),H):u,o,pe,ge)(Ne)}}function pe(ke){return M(X,C),T}function ge(ke){return C.restore(),++$<V.length?D(V[$]):F}}}function I(M,H){M.resolveAll&&!a.includes(M)&&a.push(M),M.resolve&&Vt(u.events,H,u.events.length-H,M.resolve(u.events.slice(H),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function k(){const M=m(),H=u.previous,q=u.currentConstruct,B=u.events.length,T=Array.from(s);return{from:B,restore:F};function F(){l=M,u.previous=H,u.currentConstruct=q,u.events.length=B,s=T,R()}}function R(){l.line in r&&l.column<2&&(l.column=r[l.line],l.offset+=r[l.line]-1)}}function Ug(e,t){const n=t.start._index,l=t.start._bufferIndex,r=t.end._index,a=t.end._bufferIndex;let i;if(n===r)i=[e[n].slice(l,a)];else{if(i=e.slice(n,r),l>-1){const s=i[0];typeof s=="string"?i[0]=s.slice(l):i.shift()}a>0&&i.push(e[r].slice(0,a))}return i}function zg(e,t){let n=-1;const l=[];let r;for(;++n<e.length;){const a=e[n];let i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
3
3
  `;break}case-3:{i=`\r
4
- `;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&r)continue;i=" ";break}default:i=String.fromCharCode(a)}r=a===-2,l.push(i)}return l.join("")}function Vg(e){const l={constructs:i1([Fg,...(e||{}).extensions||[]]),content:r(f1),defined:[],document:r(p1),flow:r(Mg),lazy:{},string:r(Pg),text:r(Bg)};return l;function r(a){return i;function i(s){return Hg(l,a,s)}}}function $g(e){for(;!yc(e););return e}const Nc=/[\0\t\n\r]/g;function qg(){let e=1,t="",n=!0,l;return r;function r(a,i,s){const o=[];let u,c,d,f,h;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(Nc.lastIndex=d,u=Nc.exec(a),f=u&&u.index!==void 0?u.index:a.length,h=a.charCodeAt(f),!u){t=a.slice(d);break}if(h===10&&d===f&&l)o.push(-3),l=void 0;else switch(l&&(o.push(-5),l=void 0),d<f&&(o.push(a.slice(d,f)),e+=f-d),h){case 0:{o.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,o.push(-2);e++<c;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:l=!0,e=1}d=f+1}return s&&(l&&o.push(-5),t&&o.push(t),o.push(null)),o}}const Wg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yg(e){return e.replace(Wg,jg)}function jg(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),a=r===120||r===88;return cc(n.slice(a?2:1),a?16:10)}return rr(n)||e}const wc={}.hasOwnProperty;function Kg(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Gg(n)($g(Vg(n).document().write(qg()(e,t,!0))))}function Gg(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Qt),autolinkProtocol:k,autolinkEmail:k,atxHeading:a(Rn),blockQuote:a(Ae),characterEscape:k,characterReference:k,codeFenced:a(nt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(nt,i),codeText:a(Ht,i),codeTextData:k,data:k,codeFlowValue:k,definition:a(sn),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(ze),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(Fe,i),htmlFlowData:k,htmlText:a(Fe,i),htmlTextData:k,image:a(on),label:i,link:a(Qt),listItem:a(Hn),listItemValue:f,listOrdered:a(Fn,d),listUnordered:a(Fn),paragraph:a(Mb),reference:D,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(Rn),strong:a(Db),thematicBreak:a(Un)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:Oe,autolinkProtocol:Ne,blockQuote:o(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:ke,characterReference:ce,codeFenced:o(g),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:o(E),codeText:o(T),codeTextData:R,data:R,definition:o(),definitionDestinationString:L,definitionLabelString:N,definitionTitleString:A,emphasis:o(),hardBreakEscape:o(H),hardBreakTrailing:o(H),htmlFlow:o(q),htmlFlowData:R,htmlText:o(B),htmlTextData:R,image:o(V),label:X,labelText:$,lineEnding:M,link:o(F),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:pe,resourceDestinationString:C,resourceTitleString:Z,resource:ie,setextHeading:o(I),setextHeadingLineSequence:_,setextHeadingText:S,strong:o(),thematicBreak:o()}};Ic(t,(e||{}).mdastExtensions||[]);const n={};return l;function l(Y){let te={type:"root",children:[]};const de={stack:[te],tokenStack:[],config:t,enter:s,exit:u,buffer:i,resume:c,data:n},me=[];let Me=-1;for(;++Me<Y.length;)if(Y[Me][1].type==="listOrdered"||Y[Me][1].type==="listUnordered")if(Y[Me][0]==="enter")me.push(Me);else{const wt=me.pop();Me=r(Y,wt,Me)}for(Me=-1;++Me<Y.length;){const wt=t[Y[Me][0]];wc.call(wt,Y[Me][1].type)&&wt[Y[Me][1].type].call(Object.assign({sliceSerialize:Y[Me][2].sliceSerialize},de),Y[Me][1])}if(de.tokenStack.length>0){const wt=de.tokenStack[de.tokenStack.length-1];(wt[1]||_c).call(de,void 0,wt[0])}for(te.position={start:fn(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:fn(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<t.transforms.length;)te=t.transforms[Me](te)||te;return te}function r(Y,te,de){let me=te-1,Me=-1,wt=!1,Pt,ct,zn,Vn;for(;++me<=de;){const Xe=Y[me];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Me++:Me--,Vn=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Pt&&!Vn&&!Me&&!zn&&(zn=me),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!Me&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Me===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Pt){let un=me;for(ct=void 0;un--;){const Tt=Y[un];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;ct&&(Y[ct][1].type="lineEndingBlank",wt=!0),Tt[1].type="lineEnding",ct=un}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}zn&&(!ct||zn<ct)&&(Pt._spread=!0),Pt.end=Object.assign({},ct?Y[ct][1].start:Xe[1].end),Y.splice(ct||me,0,["exit",Pt,Xe[2]]),me++,de++}if(Xe[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Pt=un,Y.splice(me,0,["enter",un,Xe[2]]),me++,de++,zn=void 0,Vn=!0}}}return Y[te][1]._spread=wt,de}function a(Y,te){return de;function de(me){s.call(this,Y(me),me),te&&te.call(this,me)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(Y,te,de){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([te,de||void 0]),Y.position={start:fn(te.start),end:void 0}}function o(Y){return te;function te(de){Y&&Y.call(this,de),u.call(this,de)}}function u(Y,te){const de=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==Y.type&&(te?te.call(this,Y,me[0]):(me[1]||_c).call(this,Y,me[0]));else throw new Error("Cannot close `"+Y.type+"` ("+nr({start:Y.start,end:Y.end})+"): it’s not open");de.position.end=fn(Y.end)}function c(){return r1(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Y){if(this.data.expectingFirstListItemValue){const te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function h(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.lang=Y}function m(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.meta=Y}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y.replace(/(\r?\n|\r)$/g,"")}function N(Y){const te=this.resume(),de=this.stack[this.stack.length-1];de.label=te,de.identifier=Tl(this.sliceSerialize(Y)).toLowerCase()}function A(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.title=Y}function L(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.url=Y}function O(Y){const te=this.stack[this.stack.length-1];if(!te.depth){const de=this.sliceSerialize(Y).length;te.depth=de}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function _(Y){const te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function k(Y){const de=this.stack[this.stack.length-1].children;let me=de[de.length-1];(!me||me.type!=="text")&&(me=Xt(),me.position={start:fn(Y.start),end:void 0},de.push(me)),this.stack.push(me)}function R(Y){const te=this.stack.pop();te.value+=this.sliceSerialize(Y),te.position.end=fn(Y.end)}function M(Y){const te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=te.children[te.children.length-1];de.position.end=fn(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(k.call(this,Y),R.call(this,Y))}function H(){this.data.atHardBreak=!0}function q(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y}function B(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y}function T(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y}function F(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=te,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function V(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=te,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function $(Y){const te=this.sliceSerialize(Y),de=this.stack[this.stack.length-2];de.label=Yg(te),de.identifier=Tl(te).toLowerCase()}function X(){const Y=this.stack[this.stack.length-1],te=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const me=Y.children;de.children=me}else de.alt=te}function C(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.url=Y}function Z(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.title=Y}function ie(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function pe(Y){const te=this.resume(),de=this.stack[this.stack.length-1];de.label=te,de.identifier=Tl(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function Se(Y){this.data.characterReferenceType=Y.type}function ke(Y){const te=this.sliceSerialize(Y),de=this.data.characterReferenceType;let me;de?(me=cc(te,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=rr(te);const Me=this.stack[this.stack.length-1];Me.value+=me}function ce(Y){const te=this.stack.pop();te.position.end=fn(Y.end)}function Ne(Y){R.call(this,Y);const te=this.stack[this.stack.length-1];te.url=this.sliceSerialize(Y)}function Oe(Y){R.call(this,Y);const te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize(Y)}function Ae(){return{type:"blockquote",children:[]}}function nt(){return{type:"code",lang:null,meta:null,value:""}}function Ht(){return{type:"inlineCode",value:""}}function sn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Rn(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function on(){return{type:"image",title:null,url:"",alt:null}}function Qt(){return{type:"link",title:null,url:"",children:[]}}function Fn(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Hn(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Mb(){return{type:"paragraph",children:[]}}function Db(){return{type:"strong",children:[]}}function Xt(){return{type:"text",value:""}}function Un(){return{type:"thematicBreak"}}}function fn(e){return{line:e.line,column:e.column,offset:e.offset}}function Ic(e,t){let n=-1;for(;++n<t.length;){const l=t[n];Array.isArray(l)?Ic(e,l):Qg(e,l)}}function Qg(e,t){let n;for(n in t)if(wc.call(t,n))switch(n){case"canContainEols":{const l=t[n];l&&e[n].push(...l);break}case"transforms":{const l=t[n];l&&e[n].push(...l);break}case"enter":case"exit":{const l=t[n];l&&Object.assign(e[n],l);break}}}function _c(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is still open")}function Xg(e){const t=this;t.parser=n;function n(l){return Kg(l,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Jg(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Zg(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
4
+ `;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&r)continue;i=" ";break}default:i=String.fromCharCode(a)}r=a===-2,l.push(i)}return l.join("")}function Vg(e){const l={constructs:i1([Fg,...(e||{}).extensions||[]]),content:r(f1),defined:[],document:r(p1),flow:r(Mg),lazy:{},string:r(Pg),text:r(Bg)};return l;function r(a){return i;function i(s){return Hg(l,a,s)}}}function $g(e){for(;!yc(e););return e}const Nc=/[\0\t\n\r]/g;function qg(){let e=1,t="",n=!0,l;return r;function r(a,i,s){const o=[];let u,c,d,f,h;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(Nc.lastIndex=d,u=Nc.exec(a),f=u&&u.index!==void 0?u.index:a.length,h=a.charCodeAt(f),!u){t=a.slice(d);break}if(h===10&&d===f&&l)o.push(-3),l=void 0;else switch(l&&(o.push(-5),l=void 0),d<f&&(o.push(a.slice(d,f)),e+=f-d),h){case 0:{o.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,o.push(-2);e++<c;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:l=!0,e=1}d=f+1}return s&&(l&&o.push(-5),t&&o.push(t),o.push(null)),o}}const Wg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yg(e){return e.replace(Wg,jg)}function jg(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),a=r===120||r===88;return cc(n.slice(a?2:1),a?16:10)}return rr(n)||e}const wc={}.hasOwnProperty;function Kg(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Gg(n)($g(Vg(n).document().write(qg()(e,t,!0))))}function Gg(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Qt),autolinkProtocol:k,autolinkEmail:k,atxHeading:a(Rn),blockQuote:a(Ae),characterEscape:k,characterReference:k,codeFenced:a(nt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(nt,i),codeText:a(Ht,i),codeTextData:k,data:k,codeFlowValue:k,definition:a(sn),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(ze),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(Fe,i),htmlFlowData:k,htmlText:a(Fe,i),htmlTextData:k,image:a(on),label:i,link:a(Qt),listItem:a(Hn),listItemValue:f,listOrdered:a(Fn,d),listUnordered:a(Fn),paragraph:a(Mb),reference:D,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(Rn),strong:a(Db),thematicBreak:a(Un)},exit:{atxHeading:o(),atxHeadingSequence:O,autolink:o(),autolinkEmail:Oe,autolinkProtocol:Ne,blockQuote:o(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:ke,characterReference:ce,codeFenced:o(g),codeFencedFence:v,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:o(E),codeText:o(T),codeTextData:R,data:R,definition:o(),definitionDestinationString:L,definitionLabelString:N,definitionTitleString:A,emphasis:o(),hardBreakEscape:o(H),hardBreakTrailing:o(H),htmlFlow:o(q),htmlFlowData:R,htmlText:o(B),htmlTextData:R,image:o(V),label:X,labelText:$,lineEnding:M,link:o(F),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:pe,resourceDestinationString:C,resourceTitleString:Z,resource:ie,setextHeading:o(I),setextHeadingLineSequence:_,setextHeadingText:S,strong:o(),thematicBreak:o()}};Ic(t,(e||{}).mdastExtensions||[]);const n={};return l;function l(Y){let te={type:"root",children:[]};const de={stack:[te],tokenStack:[],config:t,enter:s,exit:u,buffer:i,resume:c,data:n},me=[];let Me=-1;for(;++Me<Y.length;)if(Y[Me][1].type==="listOrdered"||Y[Me][1].type==="listUnordered")if(Y[Me][0]==="enter")me.push(Me);else{const wt=me.pop();Me=r(Y,wt,Me)}for(Me=-1;++Me<Y.length;){const wt=t[Y[Me][0]];wc.call(wt,Y[Me][1].type)&&wt[Y[Me][1].type].call(Object.assign({sliceSerialize:Y[Me][2].sliceSerialize},de),Y[Me][1])}if(de.tokenStack.length>0){const wt=de.tokenStack[de.tokenStack.length-1];(wt[1]||_c).call(de,void 0,wt[0])}for(te.position={start:fn(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:fn(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me<t.transforms.length;)te=t.transforms[Me](te)||te;return te}function r(Y,te,de){let me=te-1,Me=-1,wt=!1,Pt,ct,zn,Vn;for(;++me<=de;){const Xe=Y[me];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Me++:Me--,Vn=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Pt&&!Vn&&!Me&&!zn&&(zn=me),Vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vn=void 0}if(!Me&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Me===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Pt){let un=me;for(ct=void 0;un--;){const Tt=Y[un];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;ct&&(Y[ct][1].type="lineEndingBlank",wt=!0),Tt[1].type="lineEnding",ct=un}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}zn&&(!ct||zn<ct)&&(Pt._spread=!0),Pt.end=Object.assign({},ct?Y[ct][1].start:Xe[1].end),Y.splice(ct||me,0,["exit",Pt,Xe[2]]),me++,de++}if(Xe[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Pt=un,Y.splice(me,0,["enter",un,Xe[2]]),me++,de++,zn=void 0,Vn=!0}}}return Y[te][1]._spread=wt,de}function a(Y,te){return de;function de(me){s.call(this,Y(me),me),te&&te.call(this,me)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(Y,te,de){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([te,de||void 0]),Y.position={start:fn(te.start),end:void 0}}function o(Y){return te;function te(de){Y&&Y.call(this,de),u.call(this,de)}}function u(Y,te){const de=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==Y.type&&(te?te.call(this,Y,me[0]):(me[1]||_c).call(this,Y,me[0]));else throw new Error("Cannot close `"+Y.type+"` ("+nr({start:Y.start,end:Y.end})+"): it’s not open");de.position.end=fn(Y.end)}function c(){return r1(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Y){if(this.data.expectingFirstListItemValue){const te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function h(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.lang=Y}function m(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.meta=Y}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y.replace(/(\r?\n|\r)$/g,"")}function N(Y){const te=this.resume(),de=this.stack[this.stack.length-1];de.label=te,de.identifier=Tl(this.sliceSerialize(Y)).toLowerCase()}function A(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.title=Y}function L(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.url=Y}function O(Y){const te=this.stack[this.stack.length-1];if(!te.depth){const de=this.sliceSerialize(Y).length;te.depth=de}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function _(Y){const te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function k(Y){const de=this.stack[this.stack.length-1].children;let me=de[de.length-1];(!me||me.type!=="text")&&(me=Xt(),me.position={start:fn(Y.start),end:void 0},de.push(me)),this.stack.push(me)}function R(Y){const te=this.stack.pop();te.value+=this.sliceSerialize(Y),te.position.end=fn(Y.end)}function M(Y){const te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=te.children[te.children.length-1];de.position.end=fn(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(k.call(this,Y),R.call(this,Y))}function H(){this.data.atHardBreak=!0}function q(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y}function B(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y}function T(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.value=Y}function F(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=te,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function V(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=te,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function $(Y){const te=this.sliceSerialize(Y),de=this.stack[this.stack.length-2];de.label=Yg(te),de.identifier=Tl(te).toLowerCase()}function X(){const Y=this.stack[this.stack.length-1],te=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const me=Y.children;de.children=me}else de.alt=te}function C(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.url=Y}function Z(){const Y=this.resume(),te=this.stack[this.stack.length-1];te.title=Y}function ie(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function pe(Y){const te=this.resume(),de=this.stack[this.stack.length-1];de.label=te,de.identifier=Tl(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ge(Y){this.data.characterReferenceType=Y.type}function ke(Y){const te=this.sliceSerialize(Y),de=this.data.characterReferenceType;let me;de?(me=cc(te,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=rr(te);const Me=this.stack[this.stack.length-1];Me.value+=me}function ce(Y){const te=this.stack.pop();te.position.end=fn(Y.end)}function Ne(Y){R.call(this,Y);const te=this.stack[this.stack.length-1];te.url=this.sliceSerialize(Y)}function Oe(Y){R.call(this,Y);const te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize(Y)}function Ae(){return{type:"blockquote",children:[]}}function nt(){return{type:"code",lang:null,meta:null,value:""}}function Ht(){return{type:"inlineCode",value:""}}function sn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Rn(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function on(){return{type:"image",title:null,url:"",alt:null}}function Qt(){return{type:"link",title:null,url:"",children:[]}}function Fn(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Hn(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Mb(){return{type:"paragraph",children:[]}}function Db(){return{type:"strong",children:[]}}function Xt(){return{type:"text",value:""}}function Un(){return{type:"thematicBreak"}}}function fn(e){return{line:e.line,column:e.column,offset:e.offset}}function Ic(e,t){let n=-1;for(;++n<t.length;){const l=t[n];Array.isArray(l)?Ic(e,l):Qg(e,l)}}function Qg(e,t){let n;for(n in t)if(wc.call(t,n))switch(n){case"canContainEols":{const l=t[n];l&&e[n].push(...l);break}case"transforms":{const l=t[n];l&&e[n].push(...l);break}case"enter":case"exit":{const l=t[n];l&&Object.assign(e[n],l);break}}}function _c(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is still open")}function Xg(e){const t=this;t.parser=n;function n(l){return Kg(l,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Jg(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Zg(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
5
5
  `}]}function ev(e,t){const n=t.value?t.value+`
6
6
  `:"",l={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(l.className=["language-"+r[0]]);let a={type:"element",tagName:"code",properties:l,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function tv(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nv(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lv(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),r=Cl(l.toLowerCase()),a=e.footnoteOrder.indexOf(l);let i,s=e.footnoteCounts.get(l);s===void 0?(s=0,e.footnoteOrder.push(l),i=e.footnoteOrder.length):i=a+1,s+=1,e.footnoteCounts.set(l,s);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,o);const u={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,u),e.applyData(t,u)}function rv(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function av(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Oc(e,t){const n=t.referenceType;let l="]";if(n==="collapsed"?l+="[]":n==="full"&&(l+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+l}];const r=e.all(t),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const i=r[r.length-1];return i&&i.type==="text"?i.value+=l:r.push({type:"text",value:l}),r}function iv(e,t){const n=String(t.identifier).toUpperCase(),l=e.definitionById.get(n);if(!l)return Oc(e,t);const r={src:Cl(l.url||""),alt:t.alt};l.title!==null&&l.title!==void 0&&(r.title=l.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function sv(e,t){const n={src:Cl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const l={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,l),e.applyData(t,l)}function ov(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const l={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,l),e.applyData(t,l)}function uv(e,t){const n=String(t.identifier).toUpperCase(),l=e.definitionById.get(n);if(!l)return Oc(e,t);const r={href:Cl(l.url||"")};l.title!==null&&l.title!==void 0&&(r.title=l.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function cv(e,t){const n={href:Cl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const l={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function dv(e,t,n){const l=e.all(t),r=n?fv(n):Mc(t),a={},i=[];if(typeof t.checked=="boolean"){const c=l[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},l.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<l.length;){const c=l[s];(r||s!==0||c.type!=="element"||c.tagName!=="p")&&i.push({type:"text",value:`
7
7
  `}),c.type==="element"&&c.tagName==="p"&&!r?i.push(...c.children):i.push(c)}const o=l[l.length-1];o&&(r||o.type!=="element"||o.tagName!=="p")&&i.push({type:"text",value:`
@@ -18,19 +18,19 @@
18
18
  `+c)}return d(),f}function l(a,i){const s=a.attributes||{},o=[];let u,c,d,f;for(f in s)if(r3.call(s,f)&&s[f]!==void 0&&s[f]!==null){const h=String(s[f]);if(f==="id")d=t.preferShortcut!==!1&&hf.test(h)?"#"+h:r("id",h,a,i);else if(f==="class"){const m=h.split(/[\t\n\r ]+/g),v=[],g=[];let E=-1;for(;++E<m.length;)(t.preferShortcut!==!1&&hf.test(m[E])?g:v).push(m[E]);u=v.length>0?r("class",v.join(" "),a,i):"",c=g.length>0?"."+g.join("."):""}else o.push(r(f,h,a,i))}return u&&o.unshift(u),c&&o.unshift(c),d&&o.unshift(d),o.length>0?"{"+o.join(" ")+"}":""}function r(a,i,s,o){if(t.collapseEmptyAttributes!==!1&&!i)return a;if(t.preferUnquoted&&i3.test(i))return a+"="+i;const u=t.quote||o.options.quote||'"',c=u==='"'?"'":'"',d=t.quoteSmart&&of(i,u)>of(i,c)?c:u,f=s.type==="textDirective"?[d]:[d,`
19
19
  `,"\r"];return a+"="+d+l3(i,{subset:f})+d}}function u3(e){Ss.call(this,"containerDirective",e)}function c3(e){Ss.call(this,"leafDirective",e)}function d3(e){Ss.call(this,"textDirective",e)}function Ss(e,t){this.enter({type:e,name:"",attributes:{},children:[]},t)}function xs(e){const t=this.stack[this.stack.length-1];t.type==="containerDirective"||t.type==="leafDirective"||t.type,t.name=this.sliceSerialize(e)}function f3(e){this.enter({type:"paragraph",data:{directiveLabel:!0},children:[]},e)}function h3(e){this.exit(e)}function ks(){this.data.directiveAttributes=[],this.buffer()}function As(e){this.data.directiveAttributes.push(["id",Cs(this.sliceSerialize(e),{attribute:!0})])}function Ns(e){this.data.directiveAttributes.push(["class",Cs(this.sliceSerialize(e),{attribute:!0})])}function ws(e){const t=this.data.directiveAttributes;t[t.length-1][1]=Cs(this.sliceSerialize(e),{attribute:!0})}function Is(e){this.data.directiveAttributes.push([this.sliceSerialize(e),""])}function _s(){const e=this.data.directiveAttributes,t={};let n=-1;for(;++n<e.length;){const r=e[n];r[0]==="class"&&t.class?t.class+=" "+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();const l=this.stack[this.stack.length-1];l.type==="containerDirective"||l.type==="leafDirective"||l.type,l.attributes=t}function Os(e){this.exit(e)}function p3(){return":"}function pf(e){return!!(e&&e.type==="paragraph"&&e.data&&e.data.directiveLabel)}function b3(e){let t=0;return e.type==="containerDirective"?(Wc(e,function(n,l){if(n.type==="containerDirective"){let r=l.length,a=0;for(;r--;)l[r].type==="containerDirective"&&a++;a>t&&(t=a)}}),t+=3):e.type==="leafDirective"?t=2:t=1,":".repeat(t)}function Ms(e,t,n,l,r,a,i,s,o,u,c,d,f,h,m){let v,g;return E;function E(T){return e.enter(l),e.enter(r),e.consume(T),e.exit(r),N}function N(T){return T===35?(v=i,A(T)):T===46?(v=s,A(T)):m&&Ie(T)?_e(e,N,"whitespace")(T):!m&&He(T)?Zt(e,N)(T):T===null||oe(T)||ir(T)||ar(T)&&T!==45&&T!==95?B(T):(e.enter(a),e.enter(o),e.consume(T),S)}function A(T){const F=v+"Marker";return e.enter(a),e.enter(v),e.enter(F),e.consume(T),e.exit(F),L}function L(T){if(T===null||T===34||T===35||T===39||T===46||T===60||T===61||T===62||T===96||T===125||He(T))return n(T);const F=v+"Value";return e.enter(F),e.consume(T),O}function O(T){if(T===null||T===34||T===39||T===60||T===61||T===62||T===96)return n(T);if(T===35||T===46||T===125||He(T)){const F=v+"Value";return e.exit(F),e.exit(v),e.exit(a),N(T)}return e.consume(T),O}function S(T){return T===null||oe(T)||ir(T)||ar(T)&&T!==45&&T!==46&&T!==58&&T!==95?(e.exit(o),m&&Ie(T)?_e(e,_,"whitespace")(T):!m&&He(T)?Zt(e,_)(T):_(T)):(e.consume(T),S)}function _(T){return T===61?(e.enter(u),e.consume(T),e.exit(u),I):(e.exit(a),N(T))}function I(T){return T===null||T===60||T===61||T===62||T===96||T===125||m&&oe(T)?n(T):T===34||T===39?(e.enter(c),e.enter(f),e.consume(T),e.exit(f),g=T,R):m&&Ie(T)?_e(e,I,"whitespace")(T):!m&&He(T)?Zt(e,I)(T):(e.enter(d),e.enter(h),e.consume(T),g=void 0,k)}function k(T){return T===null||T===34||T===39||T===60||T===61||T===62||T===96?n(T):T===125||He(T)?(e.exit(h),e.exit(d),e.exit(a),N(T)):(e.consume(T),k)}function R(T){return T===g?(e.enter(f),e.consume(T),e.exit(f),e.exit(c),e.exit(a),q):(e.enter(d),M(T))}function M(T){return T===g?(e.exit(d),R(T)):T===null?n(T):oe(T)?m?n(T):Zt(e,M)(T):(e.enter(h),e.consume(T),H)}function H(T){return T===g||T===null||oe(T)?(e.exit(h),M(T)):(e.consume(T),H)}function q(T){return T===125||He(T)?N(T):B(T)}function B(T){return T===125?(e.enter(r),e.consume(T),e.exit(r),e.exit(l),t):n(T)}}function Ds(e,t,n,l,r,a,i){let s=0,o=0,u;return c;function c(g){return e.enter(l),e.enter(r),e.consume(g),e.exit(r),d}function d(g){return g===93?(e.enter(r),e.consume(g),e.exit(r),e.exit(l),t):(e.enter(a),f(g))}function f(g){if(g===93&&!o)return v(g);const E=e.enter("chunkText",{_contentTypeTextTrailing:!0,contentType:"text",previous:u});return u&&(u.next=E),u=E,h(g)}function h(g){return g===null||s>999||g===91&&++o>32?n(g):g===93&&!o--?(e.exit("chunkText"),v(g)):oe(g)?i?n(g):(e.consume(g),e.exit("chunkText"),f):(e.consume(g),g===92?m:h)}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,h):h(g)}function v(g){return e.exit(a),e.enter(r),e.consume(g),e.exit(r),e.exit(l),t}}function Ls(e,t,n,l){const r=this;return a;function a(s){return s===null||oe(s)||ar(s)||ir(s)?n(s):(e.enter(l),e.consume(s),i)}function i(s){return s===null||oe(s)||ir(s)||ar(s)&&s!==45&&s!==95?(e.exit(l),r.previous===45||r.previous===95?n(s):t(s)):(e.consume(s),i)}}const m3={tokenize:y3,concrete:!0},g3={tokenize:E3,partial:!0},v3={tokenize:T3,partial:!0},Ca={tokenize:C3,partial:!0};function y3(e,t,n){const l=this,r=l.events[l.events.length-1],a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0;let i=0,s;return o;function o(k){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),u(k)}function u(k){return k===58?(e.consume(k),i++,u):i<3?n(k):(e.exit("directiveContainerSequence"),Ls.call(l,e,c,n,"directiveContainerName")(k))}function c(k){return k===91?e.attempt(g3,d,d)(k):d(k)}function d(k){return k===123?e.attempt(v3,f,f)(k):f(k)}function f(k){return _e(e,h,"whitespace")(k)}function h(k){return e.exit("directiveContainerFence"),k===null?_(k):oe(k)?l.interrupt?t(k):e.attempt(Ca,m,_)(k):n(k)}function m(k){return k===null?_(k):oe(k)?e.check(Ca,A,_)(k):(e.enter("directiveContainerContent"),v(k))}function v(k){return e.attempt({tokenize:I,partial:!0},S,a?_e(e,g,"linePrefix",a+1):g)(k)}function g(k){return k===null?S(k):oe(k)?e.check(Ca,N,S)(k):N(k)}function E(k){if(k===null){const R=e.exit("chunkDocument");return l.parser.lazy[R.start.line]=!1,S(k)}return oe(k)?e.check(Ca,L,O)(k):(e.consume(k),E)}function N(k){const R=e.enter("chunkDocument",{contentType:"document",previous:s});return s&&(s.next=R),s=R,E(k)}function A(k){return e.enter("directiveContainerContent"),v(k)}function L(k){e.consume(k);const R=e.exit("chunkDocument");return l.parser.lazy[R.start.line]=!1,v}function O(k){const R=e.exit("chunkDocument");return l.parser.lazy[R.start.line]=!1,S(k)}function S(k){return e.exit("directiveContainerContent"),_(k)}function _(k){return e.exit("directiveContainer"),t(k)}function I(k,R,M){let H=0;return _e(k,q,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function q(F){return k.enter("directiveContainerFence"),k.enter("directiveContainerSequence"),B(F)}function B(F){return F===58?(k.consume(F),H++,B):H<i?M(F):(k.exit("directiveContainerSequence"),_e(k,T,"whitespace")(F))}function T(F){return F===null||oe(F)?(k.exit("directiveContainerFence"),R(F)):M(F)}}}function E3(e,t,n){return Ds(e,t,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function T3(e,t,n){return Ms(e,t,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function C3(e,t,n){const l=this;return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}const S3={tokenize:A3},x3={tokenize:N3,partial:!0},k3={tokenize:w3,partial:!0};function A3(e,t,n){const l=this;return r;function r(c){return e.enter("directiveLeaf"),e.enter("directiveLeafSequence"),e.consume(c),a}function a(c){return c===58?(e.consume(c),e.exit("directiveLeafSequence"),Ls.call(l,e,i,n,"directiveLeafName")):n(c)}function i(c){return c===91?e.attempt(x3,s,s)(c):s(c)}function s(c){return c===123?e.attempt(k3,o,o)(c):o(c)}function o(c){return _e(e,u,"whitespace")(c)}function u(c){return c===null||oe(c)?(e.exit("directiveLeaf"),t(c)):n(c)}}function N3(e,t,n){return Ds(e,t,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function w3(e,t,n){return Ms(e,t,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const I3={tokenize:D3,previous:M3},_3={tokenize:L3,partial:!0},O3={tokenize:P3,partial:!0};function M3(e){return e!==58||this.events[this.events.length-1][1].type==="characterEscape"}function D3(e,t,n){const l=this;return r;function r(o){return e.enter("directiveText"),e.enter("directiveTextMarker"),e.consume(o),e.exit("directiveTextMarker"),Ls.call(l,e,a,n,"directiveTextName")}function a(o){return o===58?n(o):o===91?e.attempt(_3,i,i)(o):i(o)}function i(o){return o===123?e.attempt(O3,s,s)(o):s(o)}function s(o){return e.exit("directiveText"),t(o)}}function L3(e,t,n){return Ds(e,t,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function P3(e,t,n){return Ms(e,t,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function B3(){return{text:{58:I3},flow:{58:[m3,S3]}}}function R3(){const t=this.data(),n=t.micromarkExtensions||(t.micromarkExtensions=[]),l=t.fromMarkdownExtensions||(t.fromMarkdownExtensions=[]),r=t.toMarkdownExtensions||(t.toMarkdownExtensions=[]);n.push(B3()),l.push(s3()),r.push(o3())}function bf(e){return!!e&&typeof e=="object"&&e.type==="steps"&&Array.isArray(e.platforms)&&e.platforms.length>0}function Sr(e){if(bf(e))return e;if(typeof e=="string"){const t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;try{const n=JSON.parse(t);return bf(n)?n:null}catch{return null}}return null}const F3={...Il,attributes:{...Il.attributes||{},span:[...(Il.attributes||{}).span||[],"style"],font:[...(Il.attributes||{}).font||[],"color"]}},H3=()=>e=>{ca(e,t=>{const n=t;if(!n||n.type!=="textDirective"&&n.type!=="leafDirective"&&n.type!=="containerDirective"||n.name!=="color")return;const l=n.attributes||{},r=l.hex??l.color??l.value,a=typeof r=="string"?r.trim():"",i=/^#([0-9a-fA-F]{6})$/.test(a)?a:"#7C3AED",s=l.bold,u=`${s===!0||s==="true"||s===1||s==="1"?"font-weight:700;":""}color:${i};`;n.data=n.data||{},n.data.hName="span",n.data.hProperties={style:u}})},U3=e=>e.replace(/\*\*([^*\n]+?)\*\*/g,"<strong>$1</strong>"),z3={p:({children:e})=>b.jsx("p",{style:{margin:0},children:e}),a:({href:e,children:t})=>b.jsxs("a",{className:"rte-steps-tooltip-link",href:e,target:"_blank",rel:"noopener noreferrer",onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:[b.jsx("span",{className:"rte-steps-tooltip-link-text",children:t}),b.jsx("i",{className:"iconfont icon-tiaozhuan2 rte-steps-tooltip-link-icon","aria-hidden":"true"})]})},V3=[R3,H3],$3=[MT,[VT,F3]],mf=e=>b.jsx(my,{remarkPlugins:V3,rehypePlugins:$3,components:z3,children:U3(e)}),gf=y.createContext(null),_l=()=>y.useContext(gf),q3=e=>document.body??e??document.documentElement,W3=({data:e,initialPlatformIndex:t=0,initialStepIndex:n=0,onClose:l})=>{const r=_l(),a=Array.isArray(e.platforms)?e.platforms:[],i=a.length,[s,o]=y.useState(t),[u,c]=y.useState(n),d=Math.min(Math.max(s,0),Math.max(i-1,0)),f=a[d],h=Array.isArray(f?.images)?f.images:[],m=Array.isArray(f?.stepDescriptions)?f.stepDescriptions:[],v=Math.min(h.length,m.length),g=Math.min(Math.max(u,0),Math.max(v-1,0)),E=h[g],N=m[g]||"",A=(e.description||"").trim(),L=(e.disclaimer||"").trim(),O=i>1;y.useEffect(()=>{const _=I=>{I.key==="Escape"?l():I.key==="ArrowLeft"&&g>0?c(g-1):I.key==="ArrowRight"&&g<v-1&&c(g+1)};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[g,v,l]);const S=_=>{_!==d&&(o(_),c(0))};return Ni.createPortal(b.jsx("div",{className:"rte-steps-preview-overlay",role:"dialog","aria-modal":"true",onClick:_=>{_.target===_.currentTarget&&l()},children:b.jsxs("div",{className:"rte-steps-preview-stage",onClick:_=>_.stopPropagation(),children:[b.jsxs("div",{className:"rte-steps-preview-header",children:[b.jsx("span",{className:"rte-steps-preview-title",children:e.title}),b.jsx("button",{type:"button","aria-label":"关闭",className:"rte-steps-preview-close",onClick:l,children:b.jsx("i",{className:"iconfont icon-guanbi","aria-hidden":"true"})})]}),b.jsxs("div",{className:"rte-steps-preview-body",children:[O||A?b.jsxs("div",{className:"rte-steps-preview-top-row"+(!O&&A?" is-description-only":""),children:[O?b.jsx("div",{className:"rte-steps-preview-platform-tabs",role:"tablist",children:a.map((_,I)=>b.jsx("button",{type:"button",role:"tab","aria-selected":I===d,className:"rte-steps-preview-platform-tab"+(I===d?" is-active":""),onClick:()=>S(I),children:_.label},`${_.label}-${I}`))}):null,A?b.jsx("div",{className:"rte-steps-preview-description",children:mf(A)}):null]}):null,b.jsxs("div",{className:"rte-steps-preview-image-wrap",children:[E?b.jsx("img",{className:"rte-steps-preview-image",src:E,alt:`step-${g+1}`}):null,v>0?b.jsxs("div",{className:"rte-steps-preview-step-badge",children:[b.jsx("span",{children:"步骤"}),b.jsxs("span",{children:[g+1,"/",v]})]}):null,v>1&&g>0?b.jsx("button",{type:"button","aria-label":"上一步",className:"rte-steps-preview-nav rte-steps-preview-nav-prev",onClick:()=>c(g-1),children:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang","aria-hidden":"true"})}):null,v>1&&g<v-1?b.jsx("button",{type:"button","aria-label":"下一步",className:"rte-steps-preview-nav rte-steps-preview-nav-next",onClick:()=>c(g+1),children:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang","aria-hidden":"true"})}):null,v>1?b.jsx("div",{className:"rte-steps-preview-dots",role:"presentation",children:Array.from({length:v}).map((_,I)=>b.jsx("span",{className:"rte-steps-preview-dot"+(I===g?" is-active":"")},I))}):null]}),N?b.jsx("div",{className:"rte-steps-preview-step-text",children:mf(N)}):null,L?b.jsxs("div",{className:"rte-steps-preview-warning",children:[b.jsx("i",{className:"iconfont icon-jinggao1 rte-steps-preview-warning-icon","aria-hidden":"true"}),b.jsx("span",{children:L})]}):null]})]})}),r??document.body)},Qn=({data:e,hidden:t})=>{const[n,l]=y.useState(!1);return t?null:b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"rte-tutorial-btn","data-node-type":"steps-tutorial",onClick:()=>l(!0),children:[b.jsx("i",{className:"iconfont icon-tishi rte-tutorial-btn-icon","aria-hidden":"true"}),b.jsx("span",{className:"rte-tutorial-btn-text",children:"查看教程"})]}),n?b.jsx(W3,{data:e,initialPlatformIndex:0,initialStepIndex:0,onClose:()=>l(!1)}):null]})},vf=e=>{const t=(e??"").trim();if(!t||!(t.startsWith("{")&&t.endsWith("}")))return!1;try{const n=JSON.parse(t);if(!n||typeof n!="object")return!1;const l=n;return l.type==="steps"&&Array.isArray(l.platforms)&&l.platforms.length>0}catch{return!1}},Ol=({tooltip:e,className:t="variable-info-icon",hidden:n,dataVariableKey:l,dataUploadKey:r})=>{const[a,i]=y.useState(!1),s=e??"";if(!s)return null;const o=b.jsx("i",{style:{fontWeight:100},className:`iconfont icon-tishi ${t}${n?" hidden":""}`,"data-tooltip":s,...l!=null?{"data-variable-key":l}:{},...r!=null?{"data-upload-key":r}:{},"aria-label":"提示",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1)});return vf(s)?o:b.jsxs(b.Fragment,{children:[o,b.jsx($n,{title:s,open:a,children:b.jsx("span",{className:"se-info-anchor","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none"}})})]})},Y3=e=>e?typeof e=="string"?e:JSON.stringify(e):"",yf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=Y3(e.tooltip),i=t??"",s=e.placeholder||"",o=i.length>0,u=Sr(e.tooltip),c=!!u,d=!!a&&!c&&!o,f=!!a&&!c,h=y.useRef(null),m=y.useRef(null),v=y.useRef(i),[g,E]=y.useState(()=>i.includes(`
20
20
  `)),N=e.allowNewline!==!1,A=y.useCallback(k=>{if(!e.key)return;const R=k.target.value,M=N?R:R.replace(/\n+/g," ");n(e.key,M)},[e.key,n,N]),L=y.useCallback(k=>{N||k.nativeEvent.isComposing||k.keyCode===229||k.key==="Enter"&&k.preventDefault()},[N]),O=y.useCallback(k=>{const R=m.current;if(!R)return;const M=window.getComputedStyle(R),H=Number.parseFloat(M.lineHeight)||22,q=Number.parseFloat(M.paddingTop)||0,B=Number.parseFloat(M.paddingBottom)||0,T=H+q+B,F=R.offsetHeight>T+1,V=i.includes(`
21
- `)||F;k?V&&E($=>$||!0):E($=>$===V?$:V)},[i]);y.useLayoutEffect(()=>{v.current!==i?(v.current=i,O(!1)):O(!0)},[O,i,s]),y.useEffect(()=>{const k=h.current;if(!k||typeof ResizeObserver>"u")return;const R=k.closest(".rte-editor");if(!R)return;const M=new ResizeObserver(()=>O(!0));return M.observe(R),()=>M.disconnect()},[O]);const S=(o?i:s)+" ",_=b.jsxs("span",{ref:h,className:"se-variable","data-type":"variable","data-key":e.key,"data-group":e.exclusionGroup,"data-tooltip":a||void 0,"data-variable-key":a?e.key:void 0,"data-error":r?"1":void 0,"data-has-icon":d?"1":void 0,"data-multiline":g?"1":void 0,children:[b.jsx("span",{ref:m,className:"se-variable-mirror","aria-hidden":"true",children:S}),b.jsx("textarea",{cols:1,rows:1,value:i,onChange:A,onKeyDown:L,disabled:l,placeholder:s,"aria-invalid":!!r}),f&&b.jsx(Ol,{tooltip:a,className:"variable-info-icon",hidden:!d,dataVariableKey:e.key})]}),I=c?b.jsxs(b.Fragment,{children:[_,b.jsx(Qn,{data:u,hidden:o})]}):_;return e.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),I]}):I});yf.displayName="VariableNode";const Ef=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=t===void 0&&typeof e.defaultNumber=="number"?String(e.defaultNumber):t??"",i=a!=="",s=y.useCallback(v=>{let g=v.target.value.replace(/[^\d.]/g,"");const E=g.indexOf(".");if(E!==-1){g=g.slice(0,E+1)+g.slice(E+1).replace(/\./g,"");const R=g.indexOf(".");g.length-R-1>2&&(g=g.slice(0,R+3))}const N=g.indexOf("."),A=N!==-1?g.length-N-1:0,L=g.endsWith(".")||N!==-1&&A===1;if(g===""){n(e.key,"");return}if(L){n(e.key,g);return}const O=parseFloat(g);if(!Number.isFinite(O)){n(e.key,"");return}const S=typeof e.min=="number"?e.min:0,_=typeof e.max=="number"?e.max:1/0;if(O===0&&0<S){n(e.key,"");return}const I=Math.min(Math.max(O,S),_),k=A>0?I.toFixed(A):String(I);n(e.key,k)},[e.key,e.min,e.max,n]),o=y.useCallback(v=>{const g=v.key;g==="Backspace"||g==="Delete"||g==="Tab"||g==="ArrowLeft"||g==="ArrowRight"||g==="ArrowUp"||g==="ArrowDown"||g==="Home"||g==="End"||g==="Enter"||v.ctrlKey||v.metaKey||/^[\d.]$/.test(g)||v.preventDefault()},[]),u=y.useRef(null),c=a||e.placeholder||"0",[d,f]=y.useState(0);y.useLayoutEffect(()=>{u.current&&f(u.current.offsetWidth)},[c]);const h=Math.max(24,Math.min(600,d+2)),m=b.jsxs("span",{className:"rte-number-input-wrap","data-placeholder":e.placeholder??"","data-has-value":i?"1":"0","data-group":e.exclusionGroup,children:[b.jsx("span",{ref:u,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",font:"inherit",pointerEvents:"none",top:0,left:0,padding:"0 6px"},children:c}),b.jsx("input",{className:`rte-number-input ${r?"rte-number-error":""}`,"data-type":"number-input","data-key":e.key,type:"text",inputMode:"numeric",value:a,onChange:s,onKeyDown:o,disabled:l,placeholder:e.placeholder,min:e.min,max:e.max,style:{width:h}})]});return e.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),m]}):m});Ef.displayName="NumberInputNode";const gn=({node:e,children:t})=>e.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),t]}):b.jsx(b.Fragment,{children:t});gn.displayName="RequiredMark";const Sa={adjustX:!0,adjustY:!0,shiftY:!1},xr=()=>document.body,Ps={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0},bottomRight:{points:["tr","br"],offset:[0,4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0},topRight:{points:["br","tr"],offset:[0,-4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0}},Tf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=y.useCallback(f=>n(e.key,f),[e.key,n]),i=t??e.defaultValue,s=y.useMemo(()=>{if(i!=null&&i!==""){const f=e.options?.find(h=>String(h.value)===String(i));return String(f?f.label??i:i)}return e.placeholder??"请选择"},[i,e.options,e.placeholder]),[o,u]=y.useState(64),c=y.useRef(null),d=y.useCallback(()=>{const f=c.current;if(!f)return;const h=f.querySelector(".ant-select-selection-item"),m=f.querySelector(".ant-select-selection-placeholder"),v=h||m,g=(v?.textContent||"").trim()||s,E=f.querySelector(".ant-select-selector"),N=v||E||f,A=window.getComputedStyle(N),L=v?A.fontSize:"16px",O=A.fontFamily||"sans-serif",S=A.fontWeight||"400",I=`${A.fontStyle||"normal"} ${S} ${L} ${O}`,R=document.createElement("canvas").getContext("2d"),M=R?Math.ceil((R.font=I,R.measureText(g).width||0)):0;let H=0;if(E){const $=window.getComputedStyle(E);H=(Number.parseFloat($.paddingLeft)||0)+(Number.parseFloat($.paddingRight)||0)}const q=f.querySelector(".ant-select-arrow"),B=q?Math.ceil(q.getBoundingClientRect().width):12,T=f.querySelector(".ant-select-clear");let F=0;if(T){const $=window.getComputedStyle(T);$.display!=="none"&&$.visibility!=="hidden"&&(F=Math.ceil(T.getBoundingClientRect().width))}const V=Math.max(36,M+H+B+F+6);u($=>$===V?$:V)},[s]);return y.useLayoutEffect(()=>{const f=window.requestAnimationFrame(()=>d()),h=window.setTimeout(()=>d(),60);return()=>{window.cancelAnimationFrame(f),window.clearTimeout(h)}},[d]),y.useEffect(()=>{if(!("fonts"in document))return;let f=!1;const h=document.fonts;if(h?.ready)return h.ready.then(()=>{f||d()}),()=>{f=!0}},[d]),b.jsx(gn,{node:e,children:b.jsx("span",{ref:c,className:`rte-select-wrapper${r?" rte-select-error":""}`,"data-type":"select","data-key":e.key,style:{width:o},children:b.jsx(ue.Select,{value:i,options:e.options,onChange:a,disabled:l,placeholder:e.placeholder??"请选择",allowClear:!e.required,size:"small",classNames:{popup:{root:"rte-select-dropdown"}},popupMatchSelectWidth:!1,placement:"bottomLeft",builtinPlacements:Ps,getPopupContainer:xr,suffixIcon:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:10,color:"#7C3AED"}})})})})});Tf.displayName="SelectNode";const Cf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=e.placeholder||"搜索或输入",i=y.useMemo(()=>e.options??[],[e.options]),s=t??e.defaultValue,o=y.useMemo(()=>s?i.some(I=>String(I.value)===String(s))?null:String(s):null,[s,i]),u=y.useMemo(()=>{const I=[...i];return o&&!i.some(k=>String(k.value)===o)&&I.unshift({label:o,value:o}),I},[i,o]),[c,d]=y.useState(""),[f,h]=y.useState(80),m=y.useRef(null),v=y.useMemo(()=>{const I=c.trim();if(!I)return u;const k=I.toLowerCase(),R=u.filter(H=>H.label.toLowerCase().includes(k)||String(H.value).toLowerCase().includes(k));return u.some(H=>H.label===I||String(H.value)===I)?R:[{label:I,value:I,isCustom:!0},...R]},[u,c]),g=y.useCallback(I=>{I!=null&&(d(""),n(e.key,I))},[e.key,n]),E=y.useCallback(I=>d(I),[]),N=y.useCallback(I=>{if(I.key==="Enter"&&c.trim()){I.preventDefault(),I.stopPropagation();const k=c.trim(),R=i.find(M=>M.label===k||String(M.value)===k);d(""),n(e.key,R?String(R.value):k)}},[c,i,e.key,n]),A=y.useCallback(()=>{d(""),n(e.key,"")},[e.key,n]),L=y.useCallback(()=>{if(s!=null&&s!==""){const I=u.find(k=>String(k.value)===String(s));return I?typeof I.label=="string"?I.label:String(I.label??s):String(s)}return a},[s,u,a]),O=y.useCallback(()=>{const I=m.current;if(!I)return;const k=I.querySelector(".ant-select-selection-item"),R=I.querySelector(".ant-select-selection-placeholder"),M=k||R,H=(M?.textContent||"").trim()||L(),q=I.querySelector(".ant-select-selector"),B=M||q||I,T=window.getComputedStyle(B),F=M?T.fontSize:"16px",V=T.fontFamily||"sans-serif",$=T.fontWeight||"400",C=`${T.fontStyle||"normal"} ${$} ${F} ${V}`,ie=document.createElement("canvas").getContext("2d"),D=ie?Math.ceil((ie.font=C,ie.measureText(H).width||0)):0;let pe=0;if(q){const Ae=window.getComputedStyle(q);pe=(Number.parseFloat(Ae.paddingLeft)||0)+(Number.parseFloat(Ae.paddingRight)||0)}const Se=I.querySelector(".ant-select-arrow"),ke=Se?Math.ceil(Se.getBoundingClientRect().width):12,ce=I.querySelector(".ant-select-clear");let Ne=0;if(ce){const Ae=window.getComputedStyle(ce);Ae.display!=="none"&&Ae.visibility!=="hidden"&&(Ne=Math.ceil(ce.getBoundingClientRect().width))}const Oe=Math.min(240,Math.max(80,D+pe+ke+Ne+4));h(Ae=>Ae===Oe?Ae:Oe)},[L]);y.useLayoutEffect(()=>{const I=window.requestAnimationFrame(()=>O()),k=window.setTimeout(()=>O(),60);return()=>{window.cancelAnimationFrame(I),window.clearTimeout(k)}},[O]),y.useEffect(()=>{if(!("fonts"in document))return;let I=!1;const k=document.fonts;if(k?.ready)return k.ready.then(()=>{I||O()}),()=>{I=!0}},[O]);const S=s!=null&&s!=="",_=s||void 0;return b.jsx(gn,{node:e,children:b.jsx("span",{ref:m,className:["rte-searchable-select-host",S?"rte-searchable-has-value":"",r?"rte-searchable-select-error":""].filter(Boolean).join(" "),"data-type":"searchable-select","data-key":e.key,style:{display:"inline-block",width:f},children:b.jsx(ue.Select,{"data-type":"searchable-select","data-key":e.key,showSearch:!0,value:_,searchValue:c,onChange:g,onSearch:E,onClear:A,onInputKeyDown:N,filterOption:!1,options:v,disabled:l,placeholder:a,style:{width:"100%"},allowClear:!e.required,size:"small",variant:"borderless",classNames:{popup:{root:"rte-searchable-select-dropdown"}},popupMatchSelectWidth:!1,placement:"bottomLeft",builtinPlacements:Ps,getPopupContainer:xr,notFoundContent:b.jsx("span",{style:{color:"#999",fontSize:13},children:"暂无数据"}),suffixIcon:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})})})})});Cf.displayName="SearchableSelectNode";function kr(e){"@babel/helpers - typeof";return kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(e)}function j3(e,t){if(kr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var l=n.call(e,t);if(kr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K3(e){var t=j3(e,"string");return kr(t)=="symbol"?t:t+""}function G3(e,t,n){return(t=K3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,l)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sf(Object(n),!0).forEach(function(l){G3(e,l,n[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(n,l))})}return e}var Q3={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},X3=xf(xf({},Q3),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});const J3={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},kf={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},X3),timePickerLocale:Object.assign({},J3)};kf.lang.ok="确定";var xa={exports:{}},Z3=xa.exports,Af;function Nf(){return Af||(Af=1,function(e,t){(function(n,l){e.exports=l()})(Z3,function(){var n=1e3,l=6e4,r=36e5,a="millisecond",i="second",s="minute",o="hour",u="day",c="week",d="month",f="quarter",h="year",m="date",v="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,N={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var T=["th","st","nd","rd"],F=B%100;return"["+B+(T[(F-20)%10]||T[F]||T[0])+"]"}},A=function(B,T,F){var V=String(B);return!V||V.length>=T?B:""+Array(T+1-V.length).join(F)+B},L={s:A,z:function(B){var T=-B.utcOffset(),F=Math.abs(T),V=Math.floor(F/60),$=F%60;return(T<=0?"+":"-")+A(V,2,"0")+":"+A($,2,"0")},m:function B(T,F){if(T.date()<F.date())return-B(F,T);var V=12*(F.year()-T.year())+(F.month()-T.month()),$=T.clone().add(V,d),X=F-$<0,C=T.clone().add(V+(X?-1:1),d);return+(-(V+(F-$)/(X?$-C:C-$))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:d,y:h,w:c,d:u,D:m,h:o,m:s,s:i,ms:a,Q:f}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},O="en",S={};S[O]=N;var _="$isDayjsObject",I=function(B){return B instanceof H||!(!B||!B[_])},k=function B(T,F,V){var $;if(!T)return O;if(typeof T=="string"){var X=T.toLowerCase();S[X]&&($=X),F&&(S[X]=F,$=X);var C=T.split("-");if(!$&&C.length>1)return B(C[0])}else{var Z=T.name;S[Z]=T,$=Z}return!V&&$&&(O=$),$||!V&&O},R=function(B,T){if(I(B))return B.clone();var F=typeof T=="object"?T:{};return F.date=B,F.args=arguments,new H(F)},M=L;M.l=k,M.i=I,M.w=function(B,T){return R(B,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var H=function(){function B(F){this.$L=k(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var T=B.prototype;return T.parse=function(F){this.$d=function(V){var $=V.date,X=V.utc;if($===null)return new Date(NaN);if(M.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var C=$.match(g);if(C){var Z=C[2]-1||0,ie=(C[7]||"0").substring(0,3);return X?new Date(Date.UTC(C[1],Z,C[3]||1,C[4]||0,C[5]||0,C[6]||0,ie)):new Date(C[1],Z,C[3]||1,C[4]||0,C[5]||0,C[6]||0,ie)}}return new Date($)}(F),this.init()},T.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},T.$utils=function(){return M},T.isValid=function(){return this.$d.toString()!==v},T.isSame=function(F,V){var $=R(F);return this.startOf(V)<=$&&$<=this.endOf(V)},T.isAfter=function(F,V){return R(F)<this.startOf(V)},T.isBefore=function(F,V){return this.endOf(V)<R(F)},T.$g=function(F,V,$){return M.u(F)?this[V]:this.set($,F)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(F,V){var $=this,X=!!M.u(V)||V,C=M.p(F),Z=function(Oe,Ae){var nt=M.w($.$u?Date.UTC($.$y,Ae,Oe):new Date($.$y,Ae,Oe),$);return X?nt:nt.endOf(u)},ie=function(Oe,Ae){return M.w($.toDate()[Oe].apply($.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(Ae)),$)},D=this.$W,pe=this.$M,Se=this.$D,ke="set"+(this.$u?"UTC":"");switch(C){case h:return X?Z(1,0):Z(31,11);case d:return X?Z(1,pe):Z(0,pe+1);case c:var ce=this.$locale().weekStart||0,Ne=(D<ce?D+7:D)-ce;return Z(X?Se-Ne:Se+(6-Ne),pe);case u:case m:return ie(ke+"Hours",0);case o:return ie(ke+"Minutes",1);case s:return ie(ke+"Seconds",2);case i:return ie(ke+"Milliseconds",3);default:return this.clone()}},T.endOf=function(F){return this.startOf(F,!1)},T.$set=function(F,V){var $,X=M.p(F),C="set"+(this.$u?"UTC":""),Z=($={},$[u]=C+"Date",$[m]=C+"Date",$[d]=C+"Month",$[h]=C+"FullYear",$[o]=C+"Hours",$[s]=C+"Minutes",$[i]=C+"Seconds",$[a]=C+"Milliseconds",$)[X],ie=X===u?this.$D+(V-this.$W):V;if(X===d||X===h){var D=this.clone().set(m,1);D.$d[Z](ie),D.init(),this.$d=D.set(m,Math.min(this.$D,D.daysInMonth())).$d}else Z&&this.$d[Z](ie);return this.init(),this},T.set=function(F,V){return this.clone().$set(F,V)},T.get=function(F){return this[M.p(F)]()},T.add=function(F,V){var $,X=this;F=Number(F);var C=M.p(V),Z=function(pe){var Se=R(X);return M.w(Se.date(Se.date()+Math.round(pe*F)),X)};if(C===d)return this.set(d,this.$M+F);if(C===h)return this.set(h,this.$y+F);if(C===u)return Z(1);if(C===c)return Z(7);var ie=($={},$[s]=l,$[o]=r,$[i]=n,$)[C]||1,D=this.$d.getTime()+F*ie;return M.w(D,this)},T.subtract=function(F,V){return this.add(-1*F,V)},T.format=function(F){var V=this,$=this.$locale();if(!this.isValid())return $.invalidDate||v;var X=F||"YYYY-MM-DDTHH:mm:ssZ",C=M.z(this),Z=this.$H,ie=this.$m,D=this.$M,pe=$.weekdays,Se=$.months,ke=$.meridiem,ce=function(Ae,nt,Ht,sn){return Ae&&(Ae[nt]||Ae(V,X))||Ht[nt].slice(0,sn)},Ne=function(Ae){return M.s(Z%12||12,Ae,"0")},Oe=ke||function(Ae,nt,Ht){var sn=Ae<12?"AM":"PM";return Ht?sn.toLowerCase():sn};return X.replace(E,function(Ae,nt){return nt||function(Ht){switch(Ht){case"YY":return String(V.$y).slice(-2);case"YYYY":return M.s(V.$y,4,"0");case"M":return D+1;case"MM":return M.s(D+1,2,"0");case"MMM":return ce($.monthsShort,D,Se,3);case"MMMM":return ce(Se,D);case"D":return V.$D;case"DD":return M.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return ce($.weekdaysMin,V.$W,pe,2);case"ddd":return ce($.weekdaysShort,V.$W,pe,3);case"dddd":return pe[V.$W];case"H":return String(Z);case"HH":return M.s(Z,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return Oe(Z,ie,!0);case"A":return Oe(Z,ie,!1);case"m":return String(ie);case"mm":return M.s(ie,2,"0");case"s":return String(V.$s);case"ss":return M.s(V.$s,2,"0");case"SSS":return M.s(V.$ms,3,"0");case"Z":return C}return null}(Ae)||C.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(F,V,$){var X,C=this,Z=M.p(V),ie=R(F),D=(ie.utcOffset()-this.utcOffset())*l,pe=this-ie,Se=function(){return M.m(C,ie)};switch(Z){case h:X=Se()/12;break;case d:X=Se();break;case f:X=Se()/3;break;case c:X=(pe-D)/6048e5;break;case u:X=(pe-D)/864e5;break;case o:X=pe/r;break;case s:X=pe/l;break;case i:X=pe/n;break;default:X=pe}return $?X:M.a(X)},T.daysInMonth=function(){return this.endOf(d).$D},T.$locale=function(){return S[this.$L]},T.locale=function(F,V){if(!F)return this.$L;var $=this.clone(),X=k(F,V,!0);return X&&($.$L=X),$},T.clone=function(){return M.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},B}(),q=H.prototype;return R.prototype=q,[["$ms",a],["$s",i],["$m",s],["$H",o],["$W",u],["$M",d],["$y",h],["$D",m]].forEach(function(B){q[B[1]]=function(T){return this.$g(T,B[0],B[1])}}),R.extend=function(B,T){return B.$i||(B(T,H,R),B.$i=!0),R},R.locale=k,R.isDayjs=I,R.unix=function(B){return R(1e3*B)},R.en=S[O],R.Ls=S,R.p={},R})}(xa)),xa.exports}var eC=Nf();const ka=Mi(eC);var Aa={exports:{}},tC=Aa.exports,wf;function nC(){return wf||(wf=1,function(e,t){(function(n,l){e.exports=l(Nf())})(tC,function(n){function l(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var r=l(n),a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(i,s){return s==="W"?i+"周":i+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(i,s){var o=100*i+s;return o<600?"凌晨":o<900?"早上":o<1100?"上午":o<1300?"中午":o<1800?"下午":"晚上"}};return r.default.locale(a,null,!0),a})}(Aa)),Aa.exports}nC(),ka.locale("zh-cn");const{RangePicker:lC}=ue.DatePicker,rC=e=>{if(!e)return null;const t=e.split(",");if(t.length!==2||!t[0]||!t[1])return null;const n=ka(t[0]),l=ka(t[1]);return n.isValid()&&l.isValid()?[n,l]:null},If=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=rC(t),[i,s]=y.useState(null),o=y.useCallback(f=>{s(null),f&&f[0]&&f[1]?n(e.key,`${f[0].format("YYYY-MM-DD")},${f[1].format("YYYY-MM-DD")}`):n(e.key,"")},[e.key,n]),u=y.useCallback(f=>s(f),[]),c=y.useCallback(f=>{s(f&&a?[a[0],a[1]]:null)},[a]),d=y.useCallback(f=>f?e.disableFuture&&f.isAfter(ka(),"day")?!0:typeof e.limitRange!="number"||!i||!i[0]?!1:Math.abs(f.diff(i[0],"days"))>e.limitRange:!1,[e.disableFuture,e.limitRange,i]);return b.jsx(gn,{node:e,children:b.jsx("span",{className:`rte-datepicker-host ${r?"rte-datepicker-error":""}`,"data-type":"datepicker","data-key":e.key,children:b.jsx(lC,{"data-type":"datepicker","data-key":e.key,value:a,disabledDate:d,onCalendarChange:u,onChange:o,onOpenChange:c,disabled:l,placeholder:[e.placeholder||"开始日期",e.placeholder||"结束日期"],size:"small",variant:"borderless",allowClear:!0,allowEmpty:[!0,!0],locale:kf,classNames:{popup:{root:"rte-datepicker-dropdown"}}})})})});If.displayName="DatePickerNode";const aC=[{label:"北京市",value:"北京市",children:[{label:"市辖区",value:"市辖区",children:[{label:"东城区",value:"东城区"},{label:"西城区",value:"西城区"},{label:"朝阳区",value:"朝阳区"},{label:"丰台区",value:"丰台区"},{label:"石景山区",value:"石景山区"},{label:"海淀区",value:"海淀区"},{label:"门头沟区",value:"门头沟区"},{label:"房山区",value:"房山区"},{label:"通州区",value:"通州区"},{label:"顺义区",value:"顺义区"},{label:"昌平区",value:"昌平区"},{label:"大兴区",value:"大兴区"},{label:"怀柔区",value:"怀柔区"},{label:"平谷区",value:"平谷区"},{label:"密云区",value:"密云区"},{label:"延庆区",value:"延庆区"}]}]},{label:"天津市",value:"天津市",children:[{label:"市辖区",value:"市辖区",children:[{label:"和平区",value:"和平区"},{label:"河东区",value:"河东区"},{label:"河西区",value:"河西区"},{label:"南开区",value:"南开区"},{label:"河北区",value:"河北区"},{label:"红桥区",value:"红桥区"},{label:"东丽区",value:"东丽区"},{label:"西青区",value:"西青区"},{label:"津南区",value:"津南区"},{label:"北辰区",value:"北辰区"},{label:"武清区",value:"武清区"},{label:"宝坻区",value:"宝坻区"},{label:"滨海新区",value:"滨海新区"},{label:"宁河区",value:"宁河区"},{label:"静海区",value:"静海区"},{label:"蓟州区",value:"蓟州区"}]}]},{label:"河北省",value:"河北省",children:[{label:"石家庄市",value:"石家庄市",children:[{label:"长安区",value:"长安区"},{label:"桥西区",value:"桥西区"},{label:"新华区",value:"新华区"},{label:"井陉矿区",value:"井陉矿区"},{label:"裕华区",value:"裕华区"},{label:"藁城区",value:"藁城区"},{label:"鹿泉区",value:"鹿泉区"},{label:"栾城区",value:"栾城区"},{label:"井陉县",value:"井陉县"},{label:"正定县",value:"正定县"},{label:"行唐县",value:"行唐县"},{label:"灵寿县",value:"灵寿县"},{label:"高邑县",value:"高邑县"},{label:"深泽县",value:"深泽县"},{label:"赞皇县",value:"赞皇县"},{label:"无极县",value:"无极县"},{label:"平山县",value:"平山县"},{label:"元氏县",value:"元氏县"},{label:"赵县",value:"赵县"},{label:"石家庄高新技术产业开发区",value:"石家庄高新技术产业开发区"},{label:"石家庄循环化工园区",value:"石家庄循环化工园区"},{label:"辛集市",value:"辛集市"},{label:"晋州市",value:"晋州市"},{label:"新乐市",value:"新乐市"}]},{label:"唐山市",value:"唐山市",children:[{label:"路南区",value:"路南区"},{label:"路北区",value:"路北区"},{label:"古冶区",value:"古冶区"},{label:"开平区",value:"开平区"},{label:"丰南区",value:"丰南区"},{label:"丰润区",value:"丰润区"},{label:"曹妃甸区",value:"曹妃甸区"},{label:"滦南县",value:"滦南县"},{label:"乐亭县",value:"乐亭县"},{label:"迁西县",value:"迁西县"},{label:"玉田县",value:"玉田县"},{label:"河北唐山芦台经济开发区",value:"河北唐山芦台经济开发区"},{label:"唐山市汉沽管理区",value:"唐山市汉沽管理区"},{label:"唐山高新技术产业开发区",value:"唐山高新技术产业开发区"},{label:"河北唐山海港经济开发区",value:"河北唐山海港经济开发区"},{label:"遵化市",value:"遵化市"},{label:"迁安市",value:"迁安市"},{label:"滦州市",value:"滦州市"}]},{label:"秦皇岛市",value:"秦皇岛市",children:[{label:"海港区",value:"海港区"},{label:"山海关区",value:"山海关区"},{label:"北戴河区",value:"北戴河区"},{label:"抚宁区",value:"抚宁区"},{label:"青龙满族自治县",value:"青龙满族自治县"},{label:"昌黎县",value:"昌黎县"},{label:"卢龙县",value:"卢龙县"},{label:"秦皇岛市经济技术开发区",value:"秦皇岛市经济技术开发区"},{label:"北戴河新区",value:"北戴河新区"}]},{label:"邯郸市",value:"邯郸市",children:[{label:"邯山区",value:"邯山区"},{label:"丛台区",value:"丛台区"},{label:"复兴区",value:"复兴区"},{label:"峰峰矿区",value:"峰峰矿区"},{label:"肥乡区",value:"肥乡区"},{label:"永年区",value:"永年区"},{label:"临漳县",value:"临漳县"},{label:"成安县",value:"成安县"},{label:"大名县",value:"大名县"},{label:"涉县",value:"涉县"},{label:"磁县",value:"磁县"},{label:"邱县",value:"邱县"},{label:"鸡泽县",value:"鸡泽县"},{label:"广平县",value:"广平县"},{label:"馆陶县",value:"馆陶县"},{label:"魏县",value:"魏县"},{label:"曲周县",value:"曲周县"},{label:"邯郸经济技术开发区",value:"邯郸经济技术开发区"},{label:"邯郸冀南新区",value:"邯郸冀南新区"},{label:"武安市",value:"武安市"}]},{label:"邢台市",value:"邢台市",children:[{label:"襄都区",value:"襄都区"},{label:"信都区",value:"信都区"},{label:"任泽区",value:"任泽区"},{label:"南和区",value:"南和区"},{label:"临城县",value:"临城县"},{label:"内丘县",value:"内丘县"},{label:"柏乡县",value:"柏乡县"},{label:"隆尧县",value:"隆尧县"},{label:"宁晋县",value:"宁晋县"},{label:"巨鹿县",value:"巨鹿县"},{label:"新河县",value:"新河县"},{label:"广宗县",value:"广宗县"},{label:"平乡县",value:"平乡县"},{label:"威县",value:"威县"},{label:"清河县",value:"清河县"},{label:"临西县",value:"临西县"},{label:"河北邢台经济开发区",value:"河北邢台经济开发区"},{label:"南宫市",value:"南宫市"},{label:"沙河市",value:"沙河市"}]},{label:"保定市",value:"保定市",children:[{label:"竞秀区",value:"竞秀区"},{label:"莲池区",value:"莲池区"},{label:"满城区",value:"满城区"},{label:"清苑区",value:"清苑区"},{label:"徐水区",value:"徐水区"},{label:"涞水县",value:"涞水县"},{label:"阜平县",value:"阜平县"},{label:"定兴县",value:"定兴县"},{label:"唐县",value:"唐县"},{label:"高阳县",value:"高阳县"},{label:"容城县",value:"容城县"},{label:"涞源县",value:"涞源县"},{label:"望都县",value:"望都县"},{label:"安新县",value:"安新县"},{label:"易县",value:"易县"},{label:"曲阳县",value:"曲阳县"},{label:"蠡县",value:"蠡县"},{label:"顺平县",value:"顺平县"},{label:"博野县",value:"博野县"},{label:"雄县",value:"雄县"},{label:"保定高新技术产业开发区",value:"保定高新技术产业开发区"},{label:"保定白沟新城",value:"保定白沟新城"},{label:"涿州市",value:"涿州市"},{label:"定州市",value:"定州市"},{label:"安国市",value:"安国市"},{label:"高碑店市",value:"高碑店市"}]},{label:"张家口市",value:"张家口市",children:[{label:"桥东区",value:"桥东区"},{label:"桥西区",value:"桥西区"},{label:"宣化区",value:"宣化区"},{label:"下花园区",value:"下花园区"},{label:"万全区",value:"万全区"},{label:"崇礼区",value:"崇礼区"},{label:"张北县",value:"张北县"},{label:"康保县",value:"康保县"},{label:"沽源县",value:"沽源县"},{label:"尚义县",value:"尚义县"},{label:"蔚县",value:"蔚县"},{label:"阳原县",value:"阳原县"},{label:"怀安县",value:"怀安县"},{label:"怀来县",value:"怀来县"},{label:"涿鹿县",value:"涿鹿县"},{label:"赤城县",value:"赤城县"},{label:"张家口经济开发区",value:"张家口经济开发区"},{label:"张家口市察北管理区",value:"张家口市察北管理区"},{label:"张家口市塞北管理区",value:"张家口市塞北管理区"}]},{label:"承德市",value:"承德市",children:[{label:"双桥区",value:"双桥区"},{label:"双滦区",value:"双滦区"},{label:"鹰手营子矿区",value:"鹰手营子矿区"},{label:"承德县",value:"承德县"},{label:"兴隆县",value:"兴隆县"},{label:"滦平县",value:"滦平县"},{label:"隆化县",value:"隆化县"},{label:"丰宁满族自治县",value:"丰宁满族自治县"},{label:"宽城满族自治县",value:"宽城满族自治县"},{label:"围场满族蒙古族自治县",value:"围场满族蒙古族自治县"},{label:"承德高新技术产业开发区",value:"承德高新技术产业开发区"},{label:"平泉市",value:"平泉市"}]},{label:"沧州市",value:"沧州市",children:[{label:"新华区",value:"新华区"},{label:"运河区",value:"运河区"},{label:"沧县",value:"沧县"},{label:"青县",value:"青县"},{label:"东光县",value:"东光县"},{label:"海兴县",value:"海兴县"},{label:"盐山县",value:"盐山县"},{label:"肃宁县",value:"肃宁县"},{label:"南皮县",value:"南皮县"},{label:"吴桥县",value:"吴桥县"},{label:"献县",value:"献县"},{label:"孟村回族自治县",value:"孟村回族自治县"},{label:"河北沧州经济开发区",value:"河北沧州经济开发区"},{label:"沧州高新技术产业开发区",value:"沧州高新技术产业开发区"},{label:"沧州渤海新区",value:"沧州渤海新区"},{label:"泊头市",value:"泊头市"},{label:"任丘市",value:"任丘市"},{label:"黄骅市",value:"黄骅市"},{label:"河间市",value:"河间市"}]},{label:"廊坊市",value:"廊坊市",children:[{label:"安次区",value:"安次区"},{label:"广阳区",value:"广阳区"},{label:"固安县",value:"固安县"},{label:"永清县",value:"永清县"},{label:"香河县",value:"香河县"},{label:"大城县",value:"大城县"},{label:"文安县",value:"文安县"},{label:"大厂回族自治县",value:"大厂回族自治县"},{label:"廊坊经济技术开发区",value:"廊坊经济技术开发区"},{label:"霸州市",value:"霸州市"},{label:"三河市",value:"三河市"}]},{label:"衡水市",value:"衡水市",children:[{label:"桃城区",value:"桃城区"},{label:"冀州区",value:"冀州区"},{label:"枣强县",value:"枣强县"},{label:"武邑县",value:"武邑县"},{label:"武强县",value:"武强县"},{label:"饶阳县",value:"饶阳县"},{label:"安平县",value:"安平县"},{label:"故城县",value:"故城县"},{label:"景县",value:"景县"},{label:"阜城县",value:"阜城县"},{label:"河北衡水高新技术产业开发区",value:"河北衡水高新技术产业开发区"},{label:"衡水滨湖新区",value:"衡水滨湖新区"},{label:"深州市",value:"深州市"}]}]},{label:"山西省",value:"山西省",children:[{label:"太原市",value:"太原市",children:[{label:"小店区",value:"小店区"},{label:"迎泽区",value:"迎泽区"},{label:"杏花岭区",value:"杏花岭区"},{label:"尖草坪区",value:"尖草坪区"},{label:"万柏林区",value:"万柏林区"},{label:"晋源区",value:"晋源区"},{label:"清徐县",value:"清徐县"},{label:"阳曲县",value:"阳曲县"},{label:"娄烦县",value:"娄烦县"},{label:"山西转型综合改革示范区",value:"山西转型综合改革示范区"},{label:"古交市",value:"古交市"}]},{label:"大同市",value:"大同市",children:[{label:"新荣区",value:"新荣区"},{label:"平城区",value:"平城区"},{label:"云冈区",value:"云冈区"},{label:"云州区",value:"云州区"},{label:"阳高县",value:"阳高县"},{label:"天镇县",value:"天镇县"},{label:"广灵县",value:"广灵县"},{label:"灵丘县",value:"灵丘县"},{label:"浑源县",value:"浑源县"},{label:"左云县",value:"左云县"},{label:"山西大同经济开发区",value:"山西大同经济开发区"}]},{label:"阳泉市",value:"阳泉市",children:[{label:"城区",value:"城区"},{label:"矿区",value:"矿区"},{label:"郊区",value:"郊区"},{label:"平定县",value:"平定县"},{label:"盂县",value:"盂县"}]},{label:"长治市",value:"长治市",children:[{label:"潞州区",value:"潞州区"},{label:"上党区",value:"上党区"},{label:"屯留区",value:"屯留区"},{label:"潞城区",value:"潞城区"},{label:"襄垣县",value:"襄垣县"},{label:"平顺县",value:"平顺县"},{label:"黎城县",value:"黎城县"},{label:"壶关县",value:"壶关县"},{label:"长子县",value:"长子县"},{label:"武乡县",value:"武乡县"},{label:"沁县",value:"沁县"},{label:"沁源县",value:"沁源县"}]},{label:"晋城市",value:"晋城市",children:[{label:"城区",value:"城区"},{label:"沁水县",value:"沁水县"},{label:"阳城县",value:"阳城县"},{label:"陵川县",value:"陵川县"},{label:"泽州县",value:"泽州县"},{label:"高平市",value:"高平市"}]},{label:"朔州市",value:"朔州市",children:[{label:"朔城区",value:"朔城区"},{label:"平鲁区",value:"平鲁区"},{label:"山阴县",value:"山阴县"},{label:"应县",value:"应县"},{label:"右玉县",value:"右玉县"},{label:"山西朔州经济开发区",value:"山西朔州经济开发区"},{label:"怀仁市",value:"怀仁市"}]},{label:"晋中市",value:"晋中市",children:[{label:"榆次区",value:"榆次区"},{label:"太谷区",value:"太谷区"},{label:"榆社县",value:"榆社县"},{label:"左权县",value:"左权县"},{label:"和顺县",value:"和顺县"},{label:"昔阳县",value:"昔阳县"},{label:"寿阳县",value:"寿阳县"},{label:"祁县",value:"祁县"},{label:"平遥县",value:"平遥县"},{label:"灵石县",value:"灵石县"},{label:"介休市",value:"介休市"}]},{label:"运城市",value:"运城市",children:[{label:"盐湖区",value:"盐湖区"},{label:"临猗县",value:"临猗县"},{label:"万荣县",value:"万荣县"},{label:"闻喜县",value:"闻喜县"},{label:"稷山县",value:"稷山县"},{label:"新绛县",value:"新绛县"},{label:"绛县",value:"绛县"},{label:"垣曲县",value:"垣曲县"},{label:"夏县",value:"夏县"},{label:"平陆县",value:"平陆县"},{label:"芮城县",value:"芮城县"},{label:"永济市",value:"永济市"},{label:"河津市",value:"河津市"}]},{label:"忻州市",value:"忻州市",children:[{label:"忻府区",value:"忻府区"},{label:"定襄县",value:"定襄县"},{label:"五台县",value:"五台县"},{label:"代县",value:"代县"},{label:"繁峙县",value:"繁峙县"},{label:"宁武县",value:"宁武县"},{label:"静乐县",value:"静乐县"},{label:"神池县",value:"神池县"},{label:"五寨县",value:"五寨县"},{label:"岢岚县",value:"岢岚县"},{label:"河曲县",value:"河曲县"},{label:"保德县",value:"保德县"},{label:"偏关县",value:"偏关县"},{label:"五台山风景名胜区",value:"五台山风景名胜区"},{label:"原平市",value:"原平市"}]},{label:"临汾市",value:"临汾市",children:[{label:"尧都区",value:"尧都区"},{label:"曲沃县",value:"曲沃县"},{label:"翼城县",value:"翼城县"},{label:"襄汾县",value:"襄汾县"},{label:"洪洞县",value:"洪洞县"},{label:"古县",value:"古县"},{label:"安泽县",value:"安泽县"},{label:"浮山县",value:"浮山县"},{label:"吉县",value:"吉县"},{label:"乡宁县",value:"乡宁县"},{label:"大宁县",value:"大宁县"},{label:"隰县",value:"隰县"},{label:"永和县",value:"永和县"},{label:"蒲县",value:"蒲县"},{label:"汾西县",value:"汾西县"},{label:"侯马市",value:"侯马市"},{label:"霍州市",value:"霍州市"}]},{label:"吕梁市",value:"吕梁市",children:[{label:"离石区",value:"离石区"},{label:"文水县",value:"文水县"},{label:"交城县",value:"交城县"},{label:"兴县",value:"兴县"},{label:"临县",value:"临县"},{label:"柳林县",value:"柳林县"},{label:"石楼县",value:"石楼县"},{label:"岚县",value:"岚县"},{label:"方山县",value:"方山县"},{label:"中阳县",value:"中阳县"},{label:"交口县",value:"交口县"},{label:"孝义市",value:"孝义市"},{label:"汾阳市",value:"汾阳市"}]}]},{label:"内蒙古自治区",value:"内蒙古自治区",children:[{label:"呼和浩特市",value:"呼和浩特市",children:[{label:"新城区",value:"新城区"},{label:"回民区",value:"回民区"},{label:"玉泉区",value:"玉泉区"},{label:"赛罕区",value:"赛罕区"},{label:"土默特左旗",value:"土默特左旗"},{label:"托克托县",value:"托克托县"},{label:"和林格尔县",value:"和林格尔县"},{label:"清水河县",value:"清水河县"},{label:"武川县",value:"武川县"},{label:"呼和浩特经济技术开发区",value:"呼和浩特经济技术开发区"}]},{label:"包头市",value:"包头市",children:[{label:"东河区",value:"东河区"},{label:"昆都仑区",value:"昆都仑区"},{label:"青山区",value:"青山区"},{label:"石拐区",value:"石拐区"},{label:"白云鄂博矿区",value:"白云鄂博矿区"},{label:"九原区",value:"九原区"},{label:"土默特右旗",value:"土默特右旗"},{label:"固阳县",value:"固阳县"},{label:"达尔罕茂明安联合旗",value:"达尔罕茂明安联合旗"},{label:"包头稀土高新技术产业开发区",value:"包头稀土高新技术产业开发区"}]},{label:"乌海市",value:"乌海市",children:[{label:"海勃湾区",value:"海勃湾区"},{label:"海南区",value:"海南区"},{label:"乌达区",value:"乌达区"}]},{label:"赤峰市",value:"赤峰市",children:[{label:"红山区",value:"红山区"},{label:"元宝山区",value:"元宝山区"},{label:"松山区",value:"松山区"},{label:"阿鲁科尔沁旗",value:"阿鲁科尔沁旗"},{label:"巴林左旗",value:"巴林左旗"},{label:"巴林右旗",value:"巴林右旗"},{label:"林西县",value:"林西县"},{label:"克什克腾旗",value:"克什克腾旗"},{label:"翁牛特旗",value:"翁牛特旗"},{label:"喀喇沁旗",value:"喀喇沁旗"},{label:"宁城县",value:"宁城县"},{label:"敖汉旗",value:"敖汉旗"}]},{label:"通辽市",value:"通辽市",children:[{label:"科尔沁区",value:"科尔沁区"},{label:"科尔沁左翼中旗",value:"科尔沁左翼中旗"},{label:"科尔沁左翼后旗",value:"科尔沁左翼后旗"},{label:"开鲁县",value:"开鲁县"},{label:"库伦旗",value:"库伦旗"},{label:"奈曼旗",value:"奈曼旗"},{label:"扎鲁特旗",value:"扎鲁特旗"},{label:"通辽经济技术开发区",value:"通辽经济技术开发区"},{label:"霍林郭勒市",value:"霍林郭勒市"}]},{label:"鄂尔多斯市",value:"鄂尔多斯市",children:[{label:"东胜区",value:"东胜区"},{label:"康巴什区",value:"康巴什区"},{label:"达拉特旗",value:"达拉特旗"},{label:"准格尔旗",value:"准格尔旗"},{label:"鄂托克前旗",value:"鄂托克前旗"},{label:"鄂托克旗",value:"鄂托克旗"},{label:"杭锦旗",value:"杭锦旗"},{label:"乌审旗",value:"乌审旗"},{label:"伊金霍洛旗",value:"伊金霍洛旗"}]},{label:"呼伦贝尔市",value:"呼伦贝尔市",children:[{label:"海拉尔区",value:"海拉尔区"},{label:"扎赉诺尔区",value:"扎赉诺尔区"},{label:"阿荣旗",value:"阿荣旗"},{label:"莫力达瓦达斡尔族自治旗",value:"莫力达瓦达斡尔族自治旗"},{label:"鄂伦春自治旗",value:"鄂伦春自治旗"},{label:"鄂温克族自治旗",value:"鄂温克族自治旗"},{label:"陈巴尔虎旗",value:"陈巴尔虎旗"},{label:"新巴尔虎左旗",value:"新巴尔虎左旗"},{label:"新巴尔虎右旗",value:"新巴尔虎右旗"},{label:"满洲里市",value:"满洲里市"},{label:"牙克石市",value:"牙克石市"},{label:"扎兰屯市",value:"扎兰屯市"},{label:"额尔古纳市",value:"额尔古纳市"},{label:"根河市",value:"根河市"}]},{label:"巴彦淖尔市",value:"巴彦淖尔市",children:[{label:"临河区",value:"临河区"},{label:"五原县",value:"五原县"},{label:"磴口县",value:"磴口县"},{label:"乌拉特前旗",value:"乌拉特前旗"},{label:"乌拉特中旗",value:"乌拉特中旗"},{label:"乌拉特后旗",value:"乌拉特后旗"},{label:"杭锦后旗",value:"杭锦后旗"}]},{label:"乌兰察布市",value:"乌兰察布市",children:[{label:"集宁区",value:"集宁区"},{label:"卓资县",value:"卓资县"},{label:"化德县",value:"化德县"},{label:"商都县",value:"商都县"},{label:"兴和县",value:"兴和县"},{label:"凉城县",value:"凉城县"},{label:"察哈尔右翼前旗",value:"察哈尔右翼前旗"},{label:"察哈尔右翼中旗",value:"察哈尔右翼中旗"},{label:"察哈尔右翼后旗",value:"察哈尔右翼后旗"},{label:"四子王旗",value:"四子王旗"},{label:"丰镇市",value:"丰镇市"}]},{label:"兴安盟",value:"兴安盟",children:[{label:"乌兰浩特市",value:"乌兰浩特市"},{label:"阿尔山市",value:"阿尔山市"},{label:"科尔沁右翼前旗",value:"科尔沁右翼前旗"},{label:"科尔沁右翼中旗",value:"科尔沁右翼中旗"},{label:"扎赉特旗",value:"扎赉特旗"},{label:"突泉县",value:"突泉县"}]},{label:"锡林郭勒盟",value:"锡林郭勒盟",children:[{label:"二连浩特市",value:"二连浩特市"},{label:"锡林浩特市",value:"锡林浩特市"},{label:"阿巴嘎旗",value:"阿巴嘎旗"},{label:"苏尼特左旗",value:"苏尼特左旗"},{label:"苏尼特右旗",value:"苏尼特右旗"},{label:"东乌珠穆沁旗",value:"东乌珠穆沁旗"},{label:"西乌珠穆沁旗",value:"西乌珠穆沁旗"},{label:"太仆寺旗",value:"太仆寺旗"},{label:"镶黄旗",value:"镶黄旗"},{label:"正镶白旗",value:"正镶白旗"},{label:"正蓝旗",value:"正蓝旗"},{label:"多伦县",value:"多伦县"},{label:"乌拉盖管理区管委会",value:"乌拉盖管理区管委会"}]},{label:"阿拉善盟",value:"阿拉善盟",children:[{label:"阿拉善左旗",value:"阿拉善左旗"},{label:"阿拉善右旗",value:"阿拉善右旗"},{label:"额济纳旗",value:"额济纳旗"},{label:"内蒙古阿拉善高新技术产业开发区",value:"内蒙古阿拉善高新技术产业开发区"}]}]},{label:"辽宁省",value:"辽宁省",children:[{label:"沈阳市",value:"沈阳市",children:[{label:"和平区",value:"和平区"},{label:"沈河区",value:"沈河区"},{label:"大东区",value:"大东区"},{label:"皇姑区",value:"皇姑区"},{label:"铁西区",value:"铁西区"},{label:"苏家屯区",value:"苏家屯区"},{label:"浑南区",value:"浑南区"},{label:"沈北新区",value:"沈北新区"},{label:"于洪区",value:"于洪区"},{label:"辽中区",value:"辽中区"},{label:"康平县",value:"康平县"},{label:"法库县",value:"法库县"},{label:"新民市",value:"新民市"}]},{label:"大连市",value:"大连市",children:[{label:"中山区",value:"中山区"},{label:"西岗区",value:"西岗区"},{label:"沙河口区",value:"沙河口区"},{label:"甘井子区",value:"甘井子区"},{label:"旅顺口区",value:"旅顺口区"},{label:"金州区",value:"金州区"},{label:"普兰店区",value:"普兰店区"},{label:"长海县",value:"长海县"},{label:"瓦房店市",value:"瓦房店市"},{label:"庄河市",value:"庄河市"}]},{label:"鞍山市",value:"鞍山市",children:[{label:"铁东区",value:"铁东区"},{label:"铁西区",value:"铁西区"},{label:"立山区",value:"立山区"},{label:"千山区",value:"千山区"},{label:"台安县",value:"台安县"},{label:"岫岩满族自治县",value:"岫岩满族自治县"},{label:"海城市",value:"海城市"}]},{label:"抚顺市",value:"抚顺市",children:[{label:"新抚区",value:"新抚区"},{label:"东洲区",value:"东洲区"},{label:"望花区",value:"望花区"},{label:"顺城区",value:"顺城区"},{label:"抚顺县",value:"抚顺县"},{label:"新宾满族自治县",value:"新宾满族自治县"},{label:"清原满族自治县",value:"清原满族自治县"}]},{label:"本溪市",value:"本溪市",children:[{label:"平山区",value:"平山区"},{label:"溪湖区",value:"溪湖区"},{label:"明山区",value:"明山区"},{label:"南芬区",value:"南芬区"},{label:"本溪满族自治县",value:"本溪满族自治县"},{label:"桓仁满族自治县",value:"桓仁满族自治县"}]},{label:"丹东市",value:"丹东市",children:[{label:"元宝区",value:"元宝区"},{label:"振兴区",value:"振兴区"},{label:"振安区",value:"振安区"},{label:"宽甸满族自治县",value:"宽甸满族自治县"},{label:"东港市",value:"东港市"},{label:"凤城市",value:"凤城市"}]},{label:"锦州市",value:"锦州市",children:[{label:"古塔区",value:"古塔区"},{label:"凌河区",value:"凌河区"},{label:"太和区",value:"太和区"},{label:"黑山县",value:"黑山县"},{label:"义县",value:"义县"},{label:"凌海市",value:"凌海市"},{label:"北镇市",value:"北镇市"}]},{label:"营口市",value:"营口市",children:[{label:"站前区",value:"站前区"},{label:"西市区",value:"西市区"},{label:"鲅鱼圈区",value:"鲅鱼圈区"},{label:"老边区",value:"老边区"},{label:"盖州市",value:"盖州市"},{label:"大石桥市",value:"大石桥市"}]},{label:"阜新市",value:"阜新市",children:[{label:"海州区",value:"海州区"},{label:"新邱区",value:"新邱区"},{label:"太平区",value:"太平区"},{label:"清河门区",value:"清河门区"},{label:"细河区",value:"细河区"},{label:"阜新蒙古族自治县",value:"阜新蒙古族自治县"},{label:"彰武县",value:"彰武县"}]},{label:"辽阳市",value:"辽阳市",children:[{label:"白塔区",value:"白塔区"},{label:"文圣区",value:"文圣区"},{label:"宏伟区",value:"宏伟区"},{label:"弓长岭区",value:"弓长岭区"},{label:"太子河区",value:"太子河区"},{label:"辽阳县",value:"辽阳县"},{label:"灯塔市",value:"灯塔市"}]},{label:"盘锦市",value:"盘锦市",children:[{label:"双台子区",value:"双台子区"},{label:"兴隆台区",value:"兴隆台区"},{label:"大洼区",value:"大洼区"},{label:"盘山县",value:"盘山县"}]},{label:"铁岭市",value:"铁岭市",children:[{label:"银州区",value:"银州区"},{label:"清河区",value:"清河区"},{label:"铁岭县",value:"铁岭县"},{label:"西丰县",value:"西丰县"},{label:"昌图县",value:"昌图县"},{label:"调兵山市",value:"调兵山市"},{label:"开原市",value:"开原市"}]},{label:"朝阳市",value:"朝阳市",children:[{label:"双塔区",value:"双塔区"},{label:"龙城区",value:"龙城区"},{label:"朝阳县",value:"朝阳县"},{label:"建平县",value:"建平县"},{label:"喀喇沁左翼蒙古族自治县",value:"喀喇沁左翼蒙古族自治县"},{label:"北票市",value:"北票市"},{label:"凌源市",value:"凌源市"}]},{label:"葫芦岛市",value:"葫芦岛市",children:[{label:"连山区",value:"连山区"},{label:"龙港区",value:"龙港区"},{label:"南票区",value:"南票区"},{label:"绥中县",value:"绥中县"},{label:"建昌县",value:"建昌县"},{label:"兴城市",value:"兴城市"}]}]},{label:"吉林省",value:"吉林省",children:[{label:"长春市",value:"长春市",children:[{label:"南关区",value:"南关区"},{label:"宽城区",value:"宽城区"},{label:"朝阳区",value:"朝阳区"},{label:"二道区",value:"二道区"},{label:"绿园区",value:"绿园区"},{label:"双阳区",value:"双阳区"},{label:"九台区",value:"九台区"},{label:"农安县",value:"农安县"},{label:"长春经济技术开发区",value:"长春经济技术开发区"},{label:"长春净月高新技术产业开发区",value:"长春净月高新技术产业开发区"},{label:"长春高新技术产业开发区",value:"长春高新技术产业开发区"},{label:"长春汽车经济技术开发区",value:"长春汽车经济技术开发区"},{label:"榆树市",value:"榆树市"},{label:"德惠市",value:"德惠市"},{label:"公主岭市",value:"公主岭市"}]},{label:"吉林市",value:"吉林市",children:[{label:"昌邑区",value:"昌邑区"},{label:"龙潭区",value:"龙潭区"},{label:"船营区",value:"船营区"},{label:"丰满区",value:"丰满区"},{label:"永吉县",value:"永吉县"},{label:"吉林经济开发区",value:"吉林经济开发区"},{label:"吉林高新技术产业开发区",value:"吉林高新技术产业开发区"},{label:"吉林中国新加坡食品区",value:"吉林中国新加坡食品区"},{label:"蛟河市",value:"蛟河市"},{label:"桦甸市",value:"桦甸市"},{label:"舒兰市",value:"舒兰市"},{label:"磐石市",value:"磐石市"}]},{label:"四平市",value:"四平市",children:[{label:"铁西区",value:"铁西区"},{label:"铁东区",value:"铁东区"},{label:"梨树县",value:"梨树县"},{label:"伊通满族自治县",value:"伊通满族自治县"},{label:"双辽市",value:"双辽市"}]},{label:"辽源市",value:"辽源市",children:[{label:"龙山区",value:"龙山区"},{label:"西安区",value:"西安区"},{label:"东丰县",value:"东丰县"},{label:"东辽县",value:"东辽县"}]},{label:"通化市",value:"通化市",children:[{label:"东昌区",value:"东昌区"},{label:"二道江区",value:"二道江区"},{label:"通化县",value:"通化县"},{label:"辉南县",value:"辉南县"},{label:"柳河县",value:"柳河县"},{label:"梅河口市",value:"梅河口市"},{label:"集安市",value:"集安市"}]},{label:"白山市",value:"白山市",children:[{label:"浑江区",value:"浑江区"},{label:"江源区",value:"江源区"},{label:"抚松县",value:"抚松县"},{label:"靖宇县",value:"靖宇县"},{label:"长白朝鲜族自治县",value:"长白朝鲜族自治县"},{label:"临江市",value:"临江市"}]},{label:"松原市",value:"松原市",children:[{label:"宁江区",value:"宁江区"},{label:"前郭尔罗斯蒙古族自治县",value:"前郭尔罗斯蒙古族自治县"},{label:"长岭县",value:"长岭县"},{label:"乾安县",value:"乾安县"},{label:"吉林松原经济开发区",value:"吉林松原经济开发区"},{label:"扶余市",value:"扶余市"}]},{label:"白城市",value:"白城市",children:[{label:"洮北区",value:"洮北区"},{label:"镇赉县",value:"镇赉县"},{label:"通榆县",value:"通榆县"},{label:"吉林白城经济开发区",value:"吉林白城经济开发区"},{label:"洮南市",value:"洮南市"},{label:"大安市",value:"大安市"}]},{label:"延边朝鲜族自治州",value:"延边朝鲜族自治州",children:[{label:"延吉市",value:"延吉市"},{label:"图们市",value:"图们市"},{label:"敦化市",value:"敦化市"},{label:"珲春市",value:"珲春市"},{label:"龙井市",value:"龙井市"},{label:"和龙市",value:"和龙市"},{label:"汪清县",value:"汪清县"},{label:"安图县",value:"安图县"}]}]},{label:"黑龙江省",value:"黑龙江省",children:[{label:"哈尔滨市",value:"哈尔滨市",children:[{label:"道里区",value:"道里区"},{label:"南岗区",value:"南岗区"},{label:"道外区",value:"道外区"},{label:"平房区",value:"平房区"},{label:"松北区",value:"松北区"},{label:"香坊区",value:"香坊区"},{label:"呼兰区",value:"呼兰区"},{label:"阿城区",value:"阿城区"},{label:"双城区",value:"双城区"},{label:"依兰县",value:"依兰县"},{label:"方正县",value:"方正县"},{label:"宾县",value:"宾县"},{label:"巴彦县",value:"巴彦县"},{label:"木兰县",value:"木兰县"},{label:"通河县",value:"通河县"},{label:"延寿县",value:"延寿县"},{label:"尚志市",value:"尚志市"},{label:"五常市",value:"五常市"}]},{label:"齐齐哈尔市",value:"齐齐哈尔市",children:[{label:"龙沙区",value:"龙沙区"},{label:"建华区",value:"建华区"},{label:"铁锋区",value:"铁锋区"},{label:"昂昂溪区",value:"昂昂溪区"},{label:"富拉尔基区",value:"富拉尔基区"},{label:"碾子山区",value:"碾子山区"},{label:"梅里斯达斡尔族区",value:"梅里斯达斡尔族区"},{label:"龙江县",value:"龙江县"},{label:"依安县",value:"依安县"},{label:"泰来县",value:"泰来县"},{label:"甘南县",value:"甘南县"},{label:"富裕县",value:"富裕县"},{label:"克山县",value:"克山县"},{label:"克东县",value:"克东县"},{label:"拜泉县",value:"拜泉县"},{label:"讷河市",value:"讷河市"}]},{label:"鸡西市",value:"鸡西市",children:[{label:"鸡冠区",value:"鸡冠区"},{label:"恒山区",value:"恒山区"},{label:"滴道区",value:"滴道区"},{label:"梨树区",value:"梨树区"},{label:"城子河区",value:"城子河区"},{label:"麻山区",value:"麻山区"},{label:"鸡东县",value:"鸡东县"},{label:"虎林市",value:"虎林市"},{label:"密山市",value:"密山市"}]},{label:"鹤岗市",value:"鹤岗市",children:[{label:"向阳区",value:"向阳区"},{label:"工农区",value:"工农区"},{label:"南山区",value:"南山区"},{label:"兴安区",value:"兴安区"},{label:"东山区",value:"东山区"},{label:"兴山区",value:"兴山区"},{label:"萝北县",value:"萝北县"},{label:"绥滨县",value:"绥滨县"}]},{label:"双鸭山市",value:"双鸭山市",children:[{label:"尖山区",value:"尖山区"},{label:"岭东区",value:"岭东区"},{label:"四方台区",value:"四方台区"},{label:"宝山区",value:"宝山区"},{label:"集贤县",value:"集贤县"},{label:"友谊县",value:"友谊县"},{label:"宝清县",value:"宝清县"},{label:"饶河县",value:"饶河县"}]},{label:"大庆市",value:"大庆市",children:[{label:"萨尔图区",value:"萨尔图区"},{label:"龙凤区",value:"龙凤区"},{label:"让胡路区",value:"让胡路区"},{label:"红岗区",value:"红岗区"},{label:"大同区",value:"大同区"},{label:"肇州县",value:"肇州县"},{label:"肇源县",value:"肇源县"},{label:"林甸县",value:"林甸县"},{label:"杜尔伯特蒙古族自治县",value:"杜尔伯特蒙古族自治县"},{label:"大庆高新技术产业开发区",value:"大庆高新技术产业开发区"}]},{label:"伊春市",value:"伊春市",children:[{label:"伊美区",value:"伊美区"},{label:"乌翠区",value:"乌翠区"},{label:"友好区",value:"友好区"},{label:"嘉荫县",value:"嘉荫县"},{label:"汤旺县",value:"汤旺县"},{label:"丰林县",value:"丰林县"},{label:"大箐山县",value:"大箐山县"},{label:"南岔县",value:"南岔县"},{label:"金林区",value:"金林区"},{label:"铁力市",value:"铁力市"}]},{label:"佳木斯市",value:"佳木斯市",children:[{label:"向阳区",value:"向阳区"},{label:"前进区",value:"前进区"},{label:"东风区",value:"东风区"},{label:"郊区",value:"郊区"},{label:"桦南县",value:"桦南县"},{label:"桦川县",value:"桦川县"},{label:"汤原县",value:"汤原县"},{label:"同江市",value:"同江市"},{label:"富锦市",value:"富锦市"},{label:"抚远市",value:"抚远市"}]},{label:"七台河市",value:"七台河市",children:[{label:"新兴区",value:"新兴区"},{label:"桃山区",value:"桃山区"},{label:"茄子河区",value:"茄子河区"},{label:"勃利县",value:"勃利县"}]},{label:"牡丹江市",value:"牡丹江市",children:[{label:"东安区",value:"东安区"},{label:"阳明区",value:"阳明区"},{label:"爱民区",value:"爱民区"},{label:"西安区",value:"西安区"},{label:"林口县",value:"林口县"},{label:"绥芬河市",value:"绥芬河市"},{label:"海林市",value:"海林市"},{label:"宁安市",value:"宁安市"},{label:"穆棱市",value:"穆棱市"},{label:"东宁市",value:"东宁市"}]},{label:"黑河市",value:"黑河市",children:[{label:"爱辉区",value:"爱辉区"},{label:"逊克县",value:"逊克县"},{label:"孙吴县",value:"孙吴县"},{label:"北安市",value:"北安市"},{label:"五大连池市",value:"五大连池市"},{label:"嫩江市",value:"嫩江市"}]},{label:"绥化市",value:"绥化市",children:[{label:"北林区",value:"北林区"},{label:"望奎县",value:"望奎县"},{label:"兰西县",value:"兰西县"},{label:"青冈县",value:"青冈县"},{label:"庆安县",value:"庆安县"},{label:"明水县",value:"明水县"},{label:"绥棱县",value:"绥棱县"},{label:"安达市",value:"安达市"},{label:"肇东市",value:"肇东市"},{label:"海伦市",value:"海伦市"}]},{label:"大兴安岭地区",value:"大兴安岭地区",children:[{label:"漠河市",value:"漠河市"},{label:"呼玛县",value:"呼玛县"},{label:"塔河县",value:"塔河县"},{label:"加格达奇区",value:"加格达奇区"},{label:"松岭区",value:"松岭区"},{label:"新林区",value:"新林区"},{label:"呼中区",value:"呼中区"}]}]},{label:"上海市",value:"上海市",children:[{label:"市辖区",value:"市辖区",children:[{label:"黄浦区",value:"黄浦区"},{label:"徐汇区",value:"徐汇区"},{label:"长宁区",value:"长宁区"},{label:"静安区",value:"静安区"},{label:"普陀区",value:"普陀区"},{label:"虹口区",value:"虹口区"},{label:"杨浦区",value:"杨浦区"},{label:"闵行区",value:"闵行区"},{label:"宝山区",value:"宝山区"},{label:"嘉定区",value:"嘉定区"},{label:"浦东新区",value:"浦东新区"},{label:"金山区",value:"金山区"},{label:"松江区",value:"松江区"},{label:"青浦区",value:"青浦区"},{label:"奉贤区",value:"奉贤区"},{label:"崇明区",value:"崇明区"}]}]},{label:"江苏省",value:"江苏省",children:[{label:"南京市",value:"南京市",children:[{label:"玄武区",value:"玄武区"},{label:"秦淮区",value:"秦淮区"},{label:"建邺区",value:"建邺区"},{label:"鼓楼区",value:"鼓楼区"},{label:"浦口区",value:"浦口区"},{label:"栖霞区",value:"栖霞区"},{label:"雨花台区",value:"雨花台区"},{label:"江宁区",value:"江宁区"},{label:"六合区",value:"六合区"},{label:"溧水区",value:"溧水区"},{label:"高淳区",value:"高淳区"}]},{label:"无锡市",value:"无锡市",children:[{label:"锡山区",value:"锡山区"},{label:"惠山区",value:"惠山区"},{label:"滨湖区",value:"滨湖区"},{label:"梁溪区",value:"梁溪区"},{label:"新吴区",value:"新吴区"},{label:"江阴市",value:"江阴市"},{label:"宜兴市",value:"宜兴市"}]},{label:"徐州市",value:"徐州市",children:[{label:"鼓楼区",value:"鼓楼区"},{label:"云龙区",value:"云龙区"},{label:"贾汪区",value:"贾汪区"},{label:"泉山区",value:"泉山区"},{label:"铜山区",value:"铜山区"},{label:"丰县",value:"丰县"},{label:"沛县",value:"沛县"},{label:"睢宁县",value:"睢宁县"},{label:"徐州经济技术开发区",value:"徐州经济技术开发区"},{label:"新沂市",value:"新沂市"},{label:"邳州市",value:"邳州市"}]},{label:"常州市",value:"常州市",children:[{label:"天宁区",value:"天宁区"},{label:"钟楼区",value:"钟楼区"},{label:"新北区",value:"新北区"},{label:"武进区",value:"武进区"},{label:"金坛区",value:"金坛区"},{label:"溧阳市",value:"溧阳市"}]},{label:"苏州市",value:"苏州市",children:[{label:"虎丘区",value:"虎丘区"},{label:"吴中区",value:"吴中区"},{label:"相城区",value:"相城区"},{label:"姑苏区",value:"姑苏区"},{label:"吴江区",value:"吴江区"},{label:"苏州工业园区",value:"苏州工业园区"},{label:"常熟市",value:"常熟市"},{label:"张家港市",value:"张家港市"},{label:"昆山市",value:"昆山市"},{label:"太仓市",value:"太仓市"}]},{label:"南通市",value:"南通市",children:[{label:"通州区",value:"通州区"},{label:"崇川区",value:"崇川区"},{label:"海门区",value:"海门区"},{label:"如东县",value:"如东县"},{label:"南通经济技术开发区",value:"南通经济技术开发区"},{label:"启东市",value:"启东市"},{label:"如皋市",value:"如皋市"},{label:"海安市",value:"海安市"}]},{label:"连云港市",value:"连云港市",children:[{label:"连云区",value:"连云区"},{label:"海州区",value:"海州区"},{label:"赣榆区",value:"赣榆区"},{label:"东海县",value:"东海县"},{label:"灌云县",value:"灌云县"},{label:"灌南县",value:"灌南县"},{label:"连云港经济技术开发区",value:"连云港经济技术开发区"}]},{label:"淮安市",value:"淮安市",children:[{label:"淮安区",value:"淮安区"},{label:"淮阴区",value:"淮阴区"},{label:"清江浦区",value:"清江浦区"},{label:"洪泽区",value:"洪泽区"},{label:"涟水县",value:"涟水县"},{label:"盱眙县",value:"盱眙县"},{label:"金湖县",value:"金湖县"},{label:"淮安经济技术开发区",value:"淮安经济技术开发区"}]},{label:"盐城市",value:"盐城市",children:[{label:"亭湖区",value:"亭湖区"},{label:"盐都区",value:"盐都区"},{label:"大丰区",value:"大丰区"},{label:"响水县",value:"响水县"},{label:"滨海县",value:"滨海县"},{label:"阜宁县",value:"阜宁县"},{label:"射阳县",value:"射阳县"},{label:"建湖县",value:"建湖县"},{label:"盐城经济技术开发区",value:"盐城经济技术开发区"},{label:"东台市",value:"东台市"}]},{label:"扬州市",value:"扬州市",children:[{label:"广陵区",value:"广陵区"},{label:"邗江区",value:"邗江区"},{label:"江都区",value:"江都区"},{label:"宝应县",value:"宝应县"},{label:"扬州经济技术开发区",value:"扬州经济技术开发区"},{label:"仪征市",value:"仪征市"},{label:"高邮市",value:"高邮市"}]},{label:"镇江市",value:"镇江市",children:[{label:"京口区",value:"京口区"},{label:"润州区",value:"润州区"},{label:"丹徒区",value:"丹徒区"},{label:"镇江新区",value:"镇江新区"},{label:"丹阳市",value:"丹阳市"},{label:"扬中市",value:"扬中市"},{label:"句容市",value:"句容市"}]},{label:"泰州市",value:"泰州市",children:[{label:"海陵区",value:"海陵区"},{label:"高港区",value:"高港区"},{label:"姜堰区",value:"姜堰区"},{label:"兴化市",value:"兴化市"},{label:"靖江市",value:"靖江市"},{label:"泰兴市",value:"泰兴市"}]},{label:"宿迁市",value:"宿迁市",children:[{label:"宿城区",value:"宿城区"},{label:"宿豫区",value:"宿豫区"},{label:"沭阳县",value:"沭阳县"},{label:"泗阳县",value:"泗阳县"},{label:"泗洪县",value:"泗洪县"},{label:"宿迁经济技术开发区",value:"宿迁经济技术开发区"}]}]},{label:"浙江省",value:"浙江省",children:[{label:"杭州市",value:"杭州市",children:[{label:"上城区",value:"上城区"},{label:"拱墅区",value:"拱墅区"},{label:"西湖区",value:"西湖区"},{label:"滨江区",value:"滨江区"},{label:"萧山区",value:"萧山区"},{label:"余杭区",value:"余杭区"},{label:"富阳区",value:"富阳区"},{label:"临安区",value:"临安区"},{label:"临平区",value:"临平区"},{label:"钱塘区",value:"钱塘区"},{label:"桐庐县",value:"桐庐县"},{label:"淳安县",value:"淳安县"},{label:"建德市",value:"建德市"}]},{label:"宁波市",value:"宁波市",children:[{label:"海曙区",value:"海曙区"},{label:"江北区",value:"江北区"},{label:"北仑区",value:"北仑区"},{label:"镇海区",value:"镇海区"},{label:"鄞州区",value:"鄞州区"},{label:"奉化区",value:"奉化区"},{label:"象山县",value:"象山县"},{label:"宁海县",value:"宁海县"},{label:"余姚市",value:"余姚市"},{label:"慈溪市",value:"慈溪市"}]},{label:"温州市",value:"温州市",children:[{label:"鹿城区",value:"鹿城区"},{label:"龙湾区",value:"龙湾区"},{label:"瓯海区",value:"瓯海区"},{label:"洞头区",value:"洞头区"},{label:"永嘉县",value:"永嘉县"},{label:"平阳县",value:"平阳县"},{label:"苍南县",value:"苍南县"},{label:"文成县",value:"文成县"},{label:"泰顺县",value:"泰顺县"},{label:"瑞安市",value:"瑞安市"},{label:"乐清市",value:"乐清市"},{label:"龙港市",value:"龙港市"}]},{label:"嘉兴市",value:"嘉兴市",children:[{label:"南湖区",value:"南湖区"},{label:"秀洲区",value:"秀洲区"},{label:"嘉善县",value:"嘉善县"},{label:"海盐县",value:"海盐县"},{label:"海宁市",value:"海宁市"},{label:"平湖市",value:"平湖市"},{label:"桐乡市",value:"桐乡市"}]},{label:"湖州市",value:"湖州市",children:[{label:"吴兴区",value:"吴兴区"},{label:"南浔区",value:"南浔区"},{label:"德清县",value:"德清县"},{label:"长兴县",value:"长兴县"},{label:"安吉县",value:"安吉县"}]},{label:"绍兴市",value:"绍兴市",children:[{label:"越城区",value:"越城区"},{label:"柯桥区",value:"柯桥区"},{label:"上虞区",value:"上虞区"},{label:"新昌县",value:"新昌县"},{label:"诸暨市",value:"诸暨市"},{label:"嵊州市",value:"嵊州市"}]},{label:"金华市",value:"金华市",children:[{label:"婺城区",value:"婺城区"},{label:"金东区",value:"金东区"},{label:"武义县",value:"武义县"},{label:"浦江县",value:"浦江县"},{label:"磐安县",value:"磐安县"},{label:"兰溪市",value:"兰溪市"},{label:"义乌市",value:"义乌市"},{label:"东阳市",value:"东阳市"},{label:"永康市",value:"永康市"}]},{label:"衢州市",value:"衢州市",children:[{label:"柯城区",value:"柯城区"},{label:"衢江区",value:"衢江区"},{label:"常山县",value:"常山县"},{label:"开化县",value:"开化县"},{label:"龙游县",value:"龙游县"},{label:"江山市",value:"江山市"}]},{label:"舟山市",value:"舟山市",children:[{label:"定海区",value:"定海区"},{label:"普陀区",value:"普陀区"},{label:"岱山县",value:"岱山县"},{label:"嵊泗县",value:"嵊泗县"}]},{label:"台州市",value:"台州市",children:[{label:"椒江区",value:"椒江区"},{label:"黄岩区",value:"黄岩区"},{label:"路桥区",value:"路桥区"},{label:"三门县",value:"三门县"},{label:"天台县",value:"天台县"},{label:"仙居县",value:"仙居县"},{label:"温岭市",value:"温岭市"},{label:"临海市",value:"临海市"},{label:"玉环市",value:"玉环市"}]},{label:"丽水市",value:"丽水市",children:[{label:"莲都区",value:"莲都区"},{label:"青田县",value:"青田县"},{label:"缙云县",value:"缙云县"},{label:"遂昌县",value:"遂昌县"},{label:"松阳县",value:"松阳县"},{label:"云和县",value:"云和县"},{label:"庆元县",value:"庆元县"},{label:"景宁畲族自治县",value:"景宁畲族自治县"},{label:"龙泉市",value:"龙泉市"}]}]},{label:"安徽省",value:"安徽省",children:[{label:"合肥市",value:"合肥市",children:[{label:"瑶海区",value:"瑶海区"},{label:"庐阳区",value:"庐阳区"},{label:"蜀山区",value:"蜀山区"},{label:"包河区",value:"包河区"},{label:"长丰县",value:"长丰县"},{label:"肥东县",value:"肥东县"},{label:"肥西县",value:"肥西县"},{label:"庐江县",value:"庐江县"},{label:"合肥高新技术产业开发区",value:"合肥高新技术产业开发区"},{label:"合肥经济技术开发区",value:"合肥经济技术开发区"},{label:"合肥新站高新技术产业开发区",value:"合肥新站高新技术产业开发区"},{label:"巢湖市",value:"巢湖市"}]},{label:"芜湖市",value:"芜湖市",children:[{label:"镜湖区",value:"镜湖区"},{label:"鸠江区",value:"鸠江区"},{label:"弋江区",value:"弋江区"},{label:"湾沚区",value:"湾沚区"},{label:"繁昌区",value:"繁昌区"},{label:"南陵县",value:"南陵县"},{label:"芜湖经济技术开发区",value:"芜湖经济技术开发区"},{label:"安徽芜湖三山经济开发区",value:"安徽芜湖三山经济开发区"},{label:"无为市",value:"无为市"}]},{label:"蚌埠市",value:"蚌埠市",children:[{label:"龙子湖区",value:"龙子湖区"},{label:"蚌山区",value:"蚌山区"},{label:"禹会区",value:"禹会区"},{label:"淮上区",value:"淮上区"},{label:"怀远县",value:"怀远县"},{label:"五河县",value:"五河县"},{label:"固镇县",value:"固镇县"},{label:"蚌埠市高新技术开发区",value:"蚌埠市高新技术开发区"},{label:"蚌埠市经济开发区",value:"蚌埠市经济开发区"}]},{label:"淮南市",value:"淮南市",children:[{label:"大通区",value:"大通区"},{label:"田家庵区",value:"田家庵区"},{label:"谢家集区",value:"谢家集区"},{label:"八公山区",value:"八公山区"},{label:"潘集区",value:"潘集区"},{label:"凤台县",value:"凤台县"},{label:"寿县",value:"寿县"}]},{label:"马鞍山市",value:"马鞍山市",children:[{label:"花山区",value:"花山区"},{label:"雨山区",value:"雨山区"},{label:"博望区",value:"博望区"},{label:"当涂县",value:"当涂县"},{label:"含山县",value:"含山县"},{label:"和县",value:"和县"}]},{label:"淮北市",value:"淮北市",children:[{label:"杜集区",value:"杜集区"},{label:"相山区",value:"相山区"},{label:"烈山区",value:"烈山区"},{label:"濉溪县",value:"濉溪县"}]},{label:"铜陵市",value:"铜陵市",children:[{label:"铜官区",value:"铜官区"},{label:"义安区",value:"义安区"},{label:"郊区",value:"郊区"},{label:"枞阳县",value:"枞阳县"}]},{label:"安庆市",value:"安庆市",children:[{label:"迎江区",value:"迎江区"},{label:"大观区",value:"大观区"},{label:"宜秀区",value:"宜秀区"},{label:"怀宁县",value:"怀宁县"},{label:"太湖县",value:"太湖县"},{label:"宿松县",value:"宿松县"},{label:"望江县",value:"望江县"},{label:"岳西县",value:"岳西县"},{label:"安徽安庆经济开发区",value:"安徽安庆经济开发区"},{label:"桐城市",value:"桐城市"},{label:"潜山市",value:"潜山市"}]},{label:"黄山市",value:"黄山市",children:[{label:"屯溪区",value:"屯溪区"},{label:"黄山区",value:"黄山区"},{label:"徽州区",value:"徽州区"},{label:"歙县",value:"歙县"},{label:"休宁县",value:"休宁县"},{label:"黟县",value:"黟县"},{label:"祁门县",value:"祁门县"}]},{label:"滁州市",value:"滁州市",children:[{label:"琅琊区",value:"琅琊区"},{label:"南谯区",value:"南谯区"},{label:"来安县",value:"来安县"},{label:"全椒县",value:"全椒县"},{label:"定远县",value:"定远县"},{label:"凤阳县",value:"凤阳县"},{label:"中新苏滁高新技术产业开发区",value:"中新苏滁高新技术产业开发区"},{label:"滁州经济技术开发区",value:"滁州经济技术开发区"},{label:"天长市",value:"天长市"},{label:"明光市",value:"明光市"}]},{label:"阜阳市",value:"阜阳市",children:[{label:"颍州区",value:"颍州区"},{label:"颍东区",value:"颍东区"},{label:"颍泉区",value:"颍泉区"},{label:"临泉县",value:"临泉县"},{label:"太和县",value:"太和县"},{label:"阜南县",value:"阜南县"},{label:"颍上县",value:"颍上县"},{label:"阜阳合肥现代产业园区",value:"阜阳合肥现代产业园区"},{label:"阜阳经济技术开发区",value:"阜阳经济技术开发区"},{label:"界首市",value:"界首市"}]},{label:"宿州市",value:"宿州市",children:[{label:"埇桥区",value:"埇桥区"},{label:"砀山县",value:"砀山县"},{label:"萧县",value:"萧县"},{label:"灵璧县",value:"灵璧县"},{label:"泗县",value:"泗县"},{label:"宿州马鞍山现代产业园区",value:"宿州马鞍山现代产业园区"},{label:"宿州经济技术开发区",value:"宿州经济技术开发区"}]},{label:"六安市",value:"六安市",children:[{label:"金安区",value:"金安区"},{label:"裕安区",value:"裕安区"},{label:"叶集区",value:"叶集区"},{label:"霍邱县",value:"霍邱县"},{label:"舒城县",value:"舒城县"},{label:"金寨县",value:"金寨县"},{label:"霍山县",value:"霍山县"}]},{label:"亳州市",value:"亳州市",children:[{label:"谯城区",value:"谯城区"},{label:"涡阳县",value:"涡阳县"},{label:"蒙城县",value:"蒙城县"},{label:"利辛县",value:"利辛县"}]},{label:"池州市",value:"池州市",children:[{label:"贵池区",value:"贵池区"},{label:"东至县",value:"东至县"},{label:"石台县",value:"石台县"},{label:"青阳县",value:"青阳县"}]},{label:"宣城市",value:"宣城市",children:[{label:"宣州区",value:"宣州区"},{label:"郎溪县",value:"郎溪县"},{label:"泾县",value:"泾县"},{label:"绩溪县",value:"绩溪县"},{label:"旌德县",value:"旌德县"},{label:"宣城市经济开发区",value:"宣城市经济开发区"},{label:"宁国市",value:"宁国市"},{label:"广德市",value:"广德市"}]}]},{label:"福建省",value:"福建省",children:[{label:"福州市",value:"福州市",children:[{label:"鼓楼区",value:"鼓楼区"},{label:"台江区",value:"台江区"},{label:"仓山区",value:"仓山区"},{label:"马尾区",value:"马尾区"},{label:"晋安区",value:"晋安区"},{label:"长乐区",value:"长乐区"},{label:"闽侯县",value:"闽侯县"},{label:"连江县",value:"连江县"},{label:"罗源县",value:"罗源县"},{label:"闽清县",value:"闽清县"},{label:"永泰县",value:"永泰县"},{label:"平潭县",value:"平潭县"},{label:"福清市",value:"福清市"}]},{label:"厦门市",value:"厦门市",children:[{label:"思明区",value:"思明区"},{label:"海沧区",value:"海沧区"},{label:"湖里区",value:"湖里区"},{label:"集美区",value:"集美区"},{label:"同安区",value:"同安区"},{label:"翔安区",value:"翔安区"}]},{label:"莆田市",value:"莆田市",children:[{label:"城厢区",value:"城厢区"},{label:"涵江区",value:"涵江区"},{label:"荔城区",value:"荔城区"},{label:"秀屿区",value:"秀屿区"},{label:"仙游县",value:"仙游县"}]},{label:"三明市",value:"三明市",children:[{label:"三元区",value:"三元区"},{label:"沙县区",value:"沙县区"},{label:"明溪县",value:"明溪县"},{label:"清流县",value:"清流县"},{label:"宁化县",value:"宁化县"},{label:"大田县",value:"大田县"},{label:"尤溪县",value:"尤溪县"},{label:"将乐县",value:"将乐县"},{label:"泰宁县",value:"泰宁县"},{label:"建宁县",value:"建宁县"},{label:"永安市",value:"永安市"}]},{label:"泉州市",value:"泉州市",children:[{label:"鲤城区",value:"鲤城区"},{label:"丰泽区",value:"丰泽区"},{label:"洛江区",value:"洛江区"},{label:"泉港区",value:"泉港区"},{label:"惠安县",value:"惠安县"},{label:"安溪县",value:"安溪县"},{label:"永春县",value:"永春县"},{label:"德化县",value:"德化县"},{label:"金门县",value:"金门县"},{label:"石狮市",value:"石狮市"},{label:"晋江市",value:"晋江市"},{label:"南安市",value:"南安市"}]},{label:"漳州市",value:"漳州市",children:[{label:"芗城区",value:"芗城区"},{label:"龙文区",value:"龙文区"},{label:"龙海区",value:"龙海区"},{label:"长泰区",value:"长泰区"},{label:"云霄县",value:"云霄县"},{label:"漳浦县",value:"漳浦县"},{label:"诏安县",value:"诏安县"},{label:"东山县",value:"东山县"},{label:"南靖县",value:"南靖县"},{label:"平和县",value:"平和县"},{label:"华安县",value:"华安县"}]},{label:"南平市",value:"南平市",children:[{label:"延平区",value:"延平区"},{label:"建阳区",value:"建阳区"},{label:"顺昌县",value:"顺昌县"},{label:"浦城县",value:"浦城县"},{label:"光泽县",value:"光泽县"},{label:"松溪县",value:"松溪县"},{label:"政和县",value:"政和县"},{label:"邵武市",value:"邵武市"},{label:"武夷山市",value:"武夷山市"},{label:"建瓯市",value:"建瓯市"}]},{label:"龙岩市",value:"龙岩市",children:[{label:"新罗区",value:"新罗区"},{label:"永定区",value:"永定区"},{label:"长汀县",value:"长汀县"},{label:"上杭县",value:"上杭县"},{label:"武平县",value:"武平县"},{label:"连城县",value:"连城县"},{label:"漳平市",value:"漳平市"}]},{label:"宁德市",value:"宁德市",children:[{label:"蕉城区",value:"蕉城区"},{label:"霞浦县",value:"霞浦县"},{label:"古田县",value:"古田县"},{label:"屏南县",value:"屏南县"},{label:"寿宁县",value:"寿宁县"},{label:"周宁县",value:"周宁县"},{label:"柘荣县",value:"柘荣县"},{label:"福安市",value:"福安市"},{label:"福鼎市",value:"福鼎市"}]}]},{label:"江西省",value:"江西省",children:[{label:"南昌市",value:"南昌市",children:[{label:"东湖区",value:"东湖区"},{label:"西湖区",value:"西湖区"},{label:"青云谱区",value:"青云谱区"},{label:"青山湖区",value:"青山湖区"},{label:"新建区",value:"新建区"},{label:"红谷滩区",value:"红谷滩区"},{label:"南昌县",value:"南昌县"},{label:"安义县",value:"安义县"},{label:"进贤县",value:"进贤县"}]},{label:"景德镇市",value:"景德镇市",children:[{label:"昌江区",value:"昌江区"},{label:"珠山区",value:"珠山区"},{label:"浮梁县",value:"浮梁县"},{label:"乐平市",value:"乐平市"}]},{label:"萍乡市",value:"萍乡市",children:[{label:"安源区",value:"安源区"},{label:"湘东区",value:"湘东区"},{label:"莲花县",value:"莲花县"},{label:"上栗县",value:"上栗县"},{label:"芦溪县",value:"芦溪县"}]},{label:"九江市",value:"九江市",children:[{label:"濂溪区",value:"濂溪区"},{label:"浔阳区",value:"浔阳区"},{label:"柴桑区",value:"柴桑区"},{label:"武宁县",value:"武宁县"},{label:"修水县",value:"修水县"},{label:"永修县",value:"永修县"},{label:"德安县",value:"德安县"},{label:"都昌县",value:"都昌县"},{label:"湖口县",value:"湖口县"},{label:"彭泽县",value:"彭泽县"},{label:"瑞昌市",value:"瑞昌市"},{label:"共青城市",value:"共青城市"},{label:"庐山市",value:"庐山市"}]},{label:"新余市",value:"新余市",children:[{label:"渝水区",value:"渝水区"},{label:"分宜县",value:"分宜县"}]},{label:"鹰潭市",value:"鹰潭市",children:[{label:"月湖区",value:"月湖区"},{label:"余江区",value:"余江区"},{label:"贵溪市",value:"贵溪市"}]},{label:"赣州市",value:"赣州市",children:[{label:"章贡区",value:"章贡区"},{label:"南康区",value:"南康区"},{label:"赣县区",value:"赣县区"},{label:"信丰县",value:"信丰县"},{label:"大余县",value:"大余县"},{label:"上犹县",value:"上犹县"},{label:"崇义县",value:"崇义县"},{label:"安远县",value:"安远县"},{label:"定南县",value:"定南县"},{label:"全南县",value:"全南县"},{label:"宁都县",value:"宁都县"},{label:"于都县",value:"于都县"},{label:"兴国县",value:"兴国县"},{label:"会昌县",value:"会昌县"},{label:"寻乌县",value:"寻乌县"},{label:"石城县",value:"石城县"},{label:"瑞金市",value:"瑞金市"},{label:"龙南市",value:"龙南市"}]},{label:"吉安市",value:"吉安市",children:[{label:"吉州区",value:"吉州区"},{label:"青原区",value:"青原区"},{label:"吉安县",value:"吉安县"},{label:"吉水县",value:"吉水县"},{label:"峡江县",value:"峡江县"},{label:"新干县",value:"新干县"},{label:"永丰县",value:"永丰县"},{label:"泰和县",value:"泰和县"},{label:"遂川县",value:"遂川县"},{label:"万安县",value:"万安县"},{label:"安福县",value:"安福县"},{label:"永新县",value:"永新县"},{label:"井冈山市",value:"井冈山市"}]},{label:"宜春市",value:"宜春市",children:[{label:"袁州区",value:"袁州区"},{label:"奉新县",value:"奉新县"},{label:"万载县",value:"万载县"},{label:"上高县",value:"上高县"},{label:"宜丰县",value:"宜丰县"},{label:"靖安县",value:"靖安县"},{label:"铜鼓县",value:"铜鼓县"},{label:"丰城市",value:"丰城市"},{label:"樟树市",value:"樟树市"},{label:"高安市",value:"高安市"}]},{label:"抚州市",value:"抚州市",children:[{label:"临川区",value:"临川区"},{label:"东乡区",value:"东乡区"},{label:"南城县",value:"南城县"},{label:"黎川县",value:"黎川县"},{label:"南丰县",value:"南丰县"},{label:"崇仁县",value:"崇仁县"},{label:"乐安县",value:"乐安县"},{label:"宜黄县",value:"宜黄县"},{label:"金溪县",value:"金溪县"},{label:"资溪县",value:"资溪县"},{label:"广昌县",value:"广昌县"}]},{label:"上饶市",value:"上饶市",children:[{label:"信州区",value:"信州区"},{label:"广丰区",value:"广丰区"},{label:"广信区",value:"广信区"},{label:"玉山县",value:"玉山县"},{label:"铅山县",value:"铅山县"},{label:"横峰县",value:"横峰县"},{label:"弋阳县",value:"弋阳县"},{label:"余干县",value:"余干县"},{label:"鄱阳县",value:"鄱阳县"},{label:"万年县",value:"万年县"},{label:"婺源县",value:"婺源县"},{label:"德兴市",value:"德兴市"}]}]},{label:"山东省",value:"山东省",children:[{label:"济南市",value:"济南市",children:[{label:"历下区",value:"历下区"},{label:"市中区",value:"市中区"},{label:"槐荫区",value:"槐荫区"},{label:"天桥区",value:"天桥区"},{label:"历城区",value:"历城区"},{label:"长清区",value:"长清区"},{label:"章丘区",value:"章丘区"},{label:"济阳区",value:"济阳区"},{label:"莱芜区",value:"莱芜区"},{label:"钢城区",value:"钢城区"},{label:"平阴县",value:"平阴县"},{label:"商河县",value:"商河县"},{label:"济南高新技术产业开发区",value:"济南高新技术产业开发区"}]},{label:"青岛市",value:"青岛市",children:[{label:"市南区",value:"市南区"},{label:"市北区",value:"市北区"},{label:"黄岛区",value:"黄岛区"},{label:"崂山区",value:"崂山区"},{label:"李沧区",value:"李沧区"},{label:"城阳区",value:"城阳区"},{label:"即墨区",value:"即墨区"},{label:"胶州市",value:"胶州市"},{label:"平度市",value:"平度市"},{label:"莱西市",value:"莱西市"}]},{label:"淄博市",value:"淄博市",children:[{label:"淄川区",value:"淄川区"},{label:"张店区",value:"张店区"},{label:"博山区",value:"博山区"},{label:"临淄区",value:"临淄区"},{label:"周村区",value:"周村区"},{label:"桓台县",value:"桓台县"},{label:"高青县",value:"高青县"},{label:"沂源县",value:"沂源县"}]},{label:"枣庄市",value:"枣庄市",children:[{label:"市中区",value:"市中区"},{label:"薛城区",value:"薛城区"},{label:"峄城区",value:"峄城区"},{label:"台儿庄区",value:"台儿庄区"},{label:"山亭区",value:"山亭区"},{label:"滕州市",value:"滕州市"}]},{label:"东营市",value:"东营市",children:[{label:"东营区",value:"东营区"},{label:"河口区",value:"河口区"},{label:"垦利区",value:"垦利区"},{label:"利津县",value:"利津县"},{label:"广饶县",value:"广饶县"},{label:"东营经济技术开发区",value:"东营经济技术开发区"},{label:"东营港经济开发区",value:"东营港经济开发区"}]},{label:"烟台市",value:"烟台市",children:[{label:"芝罘区",value:"芝罘区"},{label:"福山区",value:"福山区"},{label:"牟平区",value:"牟平区"},{label:"莱山区",value:"莱山区"},{label:"蓬莱区",value:"蓬莱区"},{label:"烟台高新技术产业开发区",value:"烟台高新技术产业开发区"},{label:"烟台经济技术开发区",value:"烟台经济技术开发区"},{label:"龙口市",value:"龙口市"},{label:"莱阳市",value:"莱阳市"},{label:"莱州市",value:"莱州市"},{label:"招远市",value:"招远市"},{label:"栖霞市",value:"栖霞市"},{label:"海阳市",value:"海阳市"}]},{label:"潍坊市",value:"潍坊市",children:[{label:"潍城区",value:"潍城区"},{label:"寒亭区",value:"寒亭区"},{label:"坊子区",value:"坊子区"},{label:"奎文区",value:"奎文区"},{label:"临朐县",value:"临朐县"},{label:"昌乐县",value:"昌乐县"},{label:"潍坊滨海经济技术开发区",value:"潍坊滨海经济技术开发区"},{label:"青州市",value:"青州市"},{label:"诸城市",value:"诸城市"},{label:"寿光市",value:"寿光市"},{label:"安丘市",value:"安丘市"},{label:"高密市",value:"高密市"},{label:"昌邑市",value:"昌邑市"}]},{label:"济宁市",value:"济宁市",children:[{label:"任城区",value:"任城区"},{label:"兖州区",value:"兖州区"},{label:"微山县",value:"微山县"},{label:"鱼台县",value:"鱼台县"},{label:"金乡县",value:"金乡县"},{label:"嘉祥县",value:"嘉祥县"},{label:"汶上县",value:"汶上县"},{label:"泗水县",value:"泗水县"},{label:"梁山县",value:"梁山县"},{label:"济宁高新技术产业开发区",value:"济宁高新技术产业开发区"},{label:"曲阜市",value:"曲阜市"},{label:"邹城市",value:"邹城市"}]},{label:"泰安市",value:"泰安市",children:[{label:"泰山区",value:"泰山区"},{label:"岱岳区",value:"岱岳区"},{label:"宁阳县",value:"宁阳县"},{label:"东平县",value:"东平县"},{label:"新泰市",value:"新泰市"},{label:"肥城市",value:"肥城市"}]},{label:"威海市",value:"威海市",children:[{label:"环翠区",value:"环翠区"},{label:"文登区",value:"文登区"},{label:"威海火炬高技术产业开发区",value:"威海火炬高技术产业开发区"},{label:"威海经济技术开发区",value:"威海经济技术开发区"},{label:"威海临港经济技术开发区",value:"威海临港经济技术开发区"},{label:"荣成市",value:"荣成市"},{label:"乳山市",value:"乳山市"}]},{label:"日照市",value:"日照市",children:[{label:"东港区",value:"东港区"},{label:"岚山区",value:"岚山区"},{label:"五莲县",value:"五莲县"},{label:"莒县",value:"莒县"},{label:"日照经济技术开发区",value:"日照经济技术开发区"}]},{label:"临沂市",value:"临沂市",children:[{label:"兰山区",value:"兰山区"},{label:"罗庄区",value:"罗庄区"},{label:"河东区",value:"河东区"},{label:"沂南县",value:"沂南县"},{label:"郯城县",value:"郯城县"},{label:"沂水县",value:"沂水县"},{label:"兰陵县",value:"兰陵县"},{label:"费县",value:"费县"},{label:"平邑县",value:"平邑县"},{label:"莒南县",value:"莒南县"},{label:"蒙阴县",value:"蒙阴县"},{label:"临沭县",value:"临沭县"},{label:"临沂高新技术产业开发区",value:"临沂高新技术产业开发区"}]},{label:"德州市",value:"德州市",children:[{label:"德城区",value:"德城区"},{label:"陵城区",value:"陵城区"},{label:"宁津县",value:"宁津县"},{label:"庆云县",value:"庆云县"},{label:"临邑县",value:"临邑县"},{label:"齐河县",value:"齐河县"},{label:"平原县",value:"平原县"},{label:"夏津县",value:"夏津县"},{label:"武城县",value:"武城县"},{label:"德州天衢新区",value:"德州天衢新区"},{label:"乐陵市",value:"乐陵市"},{label:"禹城市",value:"禹城市"}]},{label:"聊城市",value:"聊城市",children:[{label:"东昌府区",value:"东昌府区"},{label:"茌平区",value:"茌平区"},{label:"阳谷县",value:"阳谷县"},{label:"莘县",value:"莘县"},{label:"东阿县",value:"东阿县"},{label:"冠县",value:"冠县"},{label:"高唐县",value:"高唐县"},{label:"临清市",value:"临清市"}]},{label:"滨州市",value:"滨州市",children:[{label:"滨城区",value:"滨城区"},{label:"沾化区",value:"沾化区"},{label:"惠民县",value:"惠民县"},{label:"阳信县",value:"阳信县"},{label:"无棣县",value:"无棣县"},{label:"博兴县",value:"博兴县"},{label:"邹平市",value:"邹平市"}]},{label:"菏泽市",value:"菏泽市",children:[{label:"牡丹区",value:"牡丹区"},{label:"定陶区",value:"定陶区"},{label:"曹县",value:"曹县"},{label:"单县",value:"单县"},{label:"成武县",value:"成武县"},{label:"巨野县",value:"巨野县"},{label:"郓城县",value:"郓城县"},{label:"鄄城县",value:"鄄城县"},{label:"东明县",value:"东明县"},{label:"菏泽经济技术开发区",value:"菏泽经济技术开发区"},{label:"菏泽高新技术开发区",value:"菏泽高新技术开发区"}]}]},{label:"河南省",value:"河南省",children:[{label:"郑州市",value:"郑州市",children:[{label:"中原区",value:"中原区"},{label:"二七区",value:"二七区"},{label:"管城回族区",value:"管城回族区"},{label:"金水区",value:"金水区"},{label:"上街区",value:"上街区"},{label:"惠济区",value:"惠济区"},{label:"中牟县",value:"中牟县"},{label:"郑州经济技术开发区",value:"郑州经济技术开发区"},{label:"郑州高新技术产业开发区",value:"郑州高新技术产业开发区"},{label:"郑州航空港经济综合实验区",value:"郑州航空港经济综合实验区"},{label:"巩义市",value:"巩义市"},{label:"荥阳市",value:"荥阳市"},{label:"新密市",value:"新密市"},{label:"新郑市",value:"新郑市"},{label:"登封市",value:"登封市"}]},{label:"开封市",value:"开封市",children:[{label:"龙亭区",value:"龙亭区"},{label:"顺河回族区",value:"顺河回族区"},{label:"鼓楼区",value:"鼓楼区"},{label:"禹王台区",value:"禹王台区"},{label:"祥符区",value:"祥符区"},{label:"杞县",value:"杞县"},{label:"通许县",value:"通许县"},{label:"尉氏县",value:"尉氏县"},{label:"兰考县",value:"兰考县"}]},{label:"洛阳市",value:"洛阳市",children:[{label:"老城区",value:"老城区"},{label:"西工区",value:"西工区"},{label:"瀍河回族区",value:"瀍河回族区"},{label:"涧西区",value:"涧西区"},{label:"偃师区",value:"偃师区"},{label:"孟津区",value:"孟津区"},{label:"洛龙区",value:"洛龙区"},{label:"新安县",value:"新安县"},{label:"栾川县",value:"栾川县"},{label:"嵩县",value:"嵩县"},{label:"汝阳县",value:"汝阳县"},{label:"宜阳县",value:"宜阳县"},{label:"洛宁县",value:"洛宁县"},{label:"伊川县",value:"伊川县"},{label:"洛阳高新技术产业开发区",value:"洛阳高新技术产业开发区"}]},{label:"平顶山市",value:"平顶山市",children:[{label:"新华区",value:"新华区"},{label:"卫东区",value:"卫东区"},{label:"石龙区",value:"石龙区"},{label:"湛河区",value:"湛河区"},{label:"宝丰县",value:"宝丰县"},{label:"叶县",value:"叶县"},{label:"鲁山县",value:"鲁山县"},{label:"郏县",value:"郏县"},{label:"平顶山高新技术产业开发区",value:"平顶山高新技术产业开发区"},{label:"平顶山市城乡一体化示范区",value:"平顶山市城乡一体化示范区"},{label:"舞钢市",value:"舞钢市"},{label:"汝州市",value:"汝州市"}]},{label:"安阳市",value:"安阳市",children:[{label:"文峰区",value:"文峰区"},{label:"北关区",value:"北关区"},{label:"殷都区",value:"殷都区"},{label:"龙安区",value:"龙安区"},{label:"安阳县",value:"安阳县"},{label:"汤阴县",value:"汤阴县"},{label:"滑县",value:"滑县"},{label:"内黄县",value:"内黄县"},{label:"安阳高新技术产业开发区",value:"安阳高新技术产业开发区"},{label:"林州市",value:"林州市"}]},{label:"鹤壁市",value:"鹤壁市",children:[{label:"鹤山区",value:"鹤山区"},{label:"山城区",value:"山城区"},{label:"淇滨区",value:"淇滨区"},{label:"浚县",value:"浚县"},{label:"淇县",value:"淇县"},{label:"鹤壁经济技术开发区",value:"鹤壁经济技术开发区"}]},{label:"新乡市",value:"新乡市",children:[{label:"红旗区",value:"红旗区"},{label:"卫滨区",value:"卫滨区"},{label:"凤泉区",value:"凤泉区"},{label:"牧野区",value:"牧野区"},{label:"新乡县",value:"新乡县"},{label:"获嘉县",value:"获嘉县"},{label:"原阳县",value:"原阳县"},{label:"延津县",value:"延津县"},{label:"封丘县",value:"封丘县"},{label:"新乡高新技术产业开发区",value:"新乡高新技术产业开发区"},{label:"新乡经济技术开发区",value:"新乡经济技术开发区"},{label:"新乡市平原城乡一体化示范区",value:"新乡市平原城乡一体化示范区"},{label:"卫辉市",value:"卫辉市"},{label:"辉县市",value:"辉县市"},{label:"长垣市",value:"长垣市"}]},{label:"焦作市",value:"焦作市",children:[{label:"解放区",value:"解放区"},{label:"中站区",value:"中站区"},{label:"马村区",value:"马村区"},{label:"山阳区",value:"山阳区"},{label:"修武县",value:"修武县"},{label:"博爱县",value:"博爱县"},{label:"武陟县",value:"武陟县"},{label:"温县",value:"温县"},{label:"焦作城乡一体化示范区",value:"焦作城乡一体化示范区"},{label:"沁阳市",value:"沁阳市"},{label:"孟州市",value:"孟州市"}]},{label:"濮阳市",value:"濮阳市",children:[{label:"华龙区",value:"华龙区"},{label:"清丰县",value:"清丰县"},{label:"南乐县",value:"南乐县"},{label:"范县",value:"范县"},{label:"台前县",value:"台前县"},{label:"濮阳县",value:"濮阳县"},{label:"河南濮阳工业园区",value:"河南濮阳工业园区"},{label:"濮阳经济技术开发区",value:"濮阳经济技术开发区"}]},{label:"许昌市",value:"许昌市",children:[{label:"魏都区",value:"魏都区"},{label:"建安区",value:"建安区"},{label:"鄢陵县",value:"鄢陵县"},{label:"襄城县",value:"襄城县"},{label:"许昌经济技术开发区",value:"许昌经济技术开发区"},{label:"禹州市",value:"禹州市"},{label:"长葛市",value:"长葛市"}]},{label:"漯河市",value:"漯河市",children:[{label:"源汇区",value:"源汇区"},{label:"郾城区",value:"郾城区"},{label:"召陵区",value:"召陵区"},{label:"舞阳县",value:"舞阳县"},{label:"临颍县",value:"临颍县"},{label:"漯河经济技术开发区",value:"漯河经济技术开发区"}]},{label:"三门峡市",value:"三门峡市",children:[{label:"湖滨区",value:"湖滨区"},{label:"陕州区",value:"陕州区"},{label:"渑池县",value:"渑池县"},{label:"卢氏县",value:"卢氏县"},{label:"河南三门峡经济开发区",value:"河南三门峡经济开发区"},{label:"义马市",value:"义马市"},{label:"灵宝市",value:"灵宝市"}]},{label:"南阳市",value:"南阳市",children:[{label:"宛城区",value:"宛城区"},{label:"卧龙区",value:"卧龙区"},{label:"南召县",value:"南召县"},{label:"方城县",value:"方城县"},{label:"西峡县",value:"西峡县"},{label:"镇平县",value:"镇平县"},{label:"内乡县",value:"内乡县"},{label:"淅川县",value:"淅川县"},{label:"社旗县",value:"社旗县"},{label:"唐河县",value:"唐河县"},{label:"新野县",value:"新野县"},{label:"桐柏县",value:"桐柏县"},{label:"南阳高新技术产业开发区",value:"南阳高新技术产业开发区"},{label:"南阳市城乡一体化示范区",value:"南阳市城乡一体化示范区"},{label:"邓州市",value:"邓州市"}]},{label:"商丘市",value:"商丘市",children:[{label:"梁园区",value:"梁园区"},{label:"睢阳区",value:"睢阳区"},{label:"民权县",value:"民权县"},{label:"睢县",value:"睢县"},{label:"宁陵县",value:"宁陵县"},{label:"柘城县",value:"柘城县"},{label:"虞城县",value:"虞城县"},{label:"夏邑县",value:"夏邑县"},{label:"豫东综合物流产业聚集区",value:"豫东综合物流产业聚集区"},{label:"河南商丘经济开发区",value:"河南商丘经济开发区"},{label:"永城市",value:"永城市"}]},{label:"信阳市",value:"信阳市",children:[{label:"浉河区",value:"浉河区"},{label:"平桥区",value:"平桥区"},{label:"罗山县",value:"罗山县"},{label:"光山县",value:"光山县"},{label:"新县",value:"新县"},{label:"商城县",value:"商城县"},{label:"固始县",value:"固始县"},{label:"潢川县",value:"潢川县"},{label:"淮滨县",value:"淮滨县"},{label:"息县",value:"息县"},{label:"信阳高新技术产业开发区",value:"信阳高新技术产业开发区"}]},{label:"周口市",value:"周口市",children:[{label:"川汇区",value:"川汇区"},{label:"淮阳区",value:"淮阳区"},{label:"扶沟县",value:"扶沟县"},{label:"西华县",value:"西华县"},{label:"商水县",value:"商水县"},{label:"沈丘县",value:"沈丘县"},{label:"郸城县",value:"郸城县"},{label:"太康县",value:"太康县"},{label:"鹿邑县",value:"鹿邑县"},{label:"周口临港开发区",value:"周口临港开发区"},{label:"项城市",value:"项城市"}]},{label:"驻马店市",value:"驻马店市",children:[{label:"驿城区",value:"驿城区"},{label:"西平县",value:"西平县"},{label:"上蔡县",value:"上蔡县"},{label:"平舆县",value:"平舆县"},{label:"正阳县",value:"正阳县"},{label:"确山县",value:"确山县"},{label:"泌阳县",value:"泌阳县"},{label:"汝南县",value:"汝南县"},{label:"遂平县",value:"遂平县"},{label:"新蔡县",value:"新蔡县"},{label:"河南驻马店经济开发区",value:"河南驻马店经济开发区"}]},{label:"省直辖县级行政区划",value:"省直辖县级行政区划",children:[{label:"济源市",value:"济源市"}]}]},{label:"湖北省",value:"湖北省",children:[{label:"武汉市",value:"武汉市",children:[{label:"江岸区",value:"江岸区"},{label:"江汉区",value:"江汉区"},{label:"硚口区",value:"硚口区"},{label:"汉阳区",value:"汉阳区"},{label:"武昌区",value:"武昌区"},{label:"青山区",value:"青山区"},{label:"洪山区",value:"洪山区"},{label:"东西湖区",value:"东西湖区"},{label:"汉南区",value:"汉南区"},{label:"蔡甸区",value:"蔡甸区"},{label:"江夏区",value:"江夏区"},{label:"黄陂区",value:"黄陂区"},{label:"新洲区",value:"新洲区"}]},{label:"黄石市",value:"黄石市",children:[{label:"黄石港区",value:"黄石港区"},{label:"西塞山区",value:"西塞山区"},{label:"下陆区",value:"下陆区"},{label:"铁山区",value:"铁山区"},{label:"阳新县",value:"阳新县"},{label:"大冶市",value:"大冶市"}]},{label:"十堰市",value:"十堰市",children:[{label:"茅箭区",value:"茅箭区"},{label:"张湾区",value:"张湾区"},{label:"郧阳区",value:"郧阳区"},{label:"郧西县",value:"郧西县"},{label:"竹山县",value:"竹山县"},{label:"竹溪县",value:"竹溪县"},{label:"房县",value:"房县"},{label:"丹江口市",value:"丹江口市"}]},{label:"宜昌市",value:"宜昌市",children:[{label:"西陵区",value:"西陵区"},{label:"伍家岗区",value:"伍家岗区"},{label:"点军区",value:"点军区"},{label:"猇亭区",value:"猇亭区"},{label:"夷陵区",value:"夷陵区"},{label:"远安县",value:"远安县"},{label:"兴山县",value:"兴山县"},{label:"秭归县",value:"秭归县"},{label:"长阳土家族自治县",value:"长阳土家族自治县"},{label:"五峰土家族自治县",value:"五峰土家族自治县"},{label:"宜都市",value:"宜都市"},{label:"当阳市",value:"当阳市"},{label:"枝江市",value:"枝江市"}]},{label:"襄阳市",value:"襄阳市",children:[{label:"襄城区",value:"襄城区"},{label:"樊城区",value:"樊城区"},{label:"襄州区",value:"襄州区"},{label:"南漳县",value:"南漳县"},{label:"谷城县",value:"谷城县"},{label:"保康县",value:"保康县"},{label:"老河口市",value:"老河口市"},{label:"枣阳市",value:"枣阳市"},{label:"宜城市",value:"宜城市"}]},{label:"鄂州市",value:"鄂州市",children:[{label:"梁子湖区",value:"梁子湖区"},{label:"华容区",value:"华容区"},{label:"鄂城区",value:"鄂城区"}]},{label:"荆门市",value:"荆门市",children:[{label:"东宝区",value:"东宝区"},{label:"掇刀区",value:"掇刀区"},{label:"沙洋县",value:"沙洋县"},{label:"钟祥市",value:"钟祥市"},{label:"京山市",value:"京山市"}]},{label:"孝感市",value:"孝感市",children:[{label:"孝南区",value:"孝南区"},{label:"孝昌县",value:"孝昌县"},{label:"大悟县",value:"大悟县"},{label:"云梦县",value:"云梦县"},{label:"应城市",value:"应城市"},{label:"安陆市",value:"安陆市"},{label:"汉川市",value:"汉川市"}]},{label:"荆州市",value:"荆州市",children:[{label:"沙市区",value:"沙市区"},{label:"荆州区",value:"荆州区"},{label:"公安县",value:"公安县"},{label:"江陵县",value:"江陵县"},{label:"荆州经济技术开发区",value:"荆州经济技术开发区"},{label:"石首市",value:"石首市"},{label:"洪湖市",value:"洪湖市"},{label:"松滋市",value:"松滋市"},{label:"监利市",value:"监利市"}]},{label:"黄冈市",value:"黄冈市",children:[{label:"黄州区",value:"黄州区"},{label:"团风县",value:"团风县"},{label:"红安县",value:"红安县"},{label:"罗田县",value:"罗田县"},{label:"英山县",value:"英山县"},{label:"浠水县",value:"浠水县"},{label:"蕲春县",value:"蕲春县"},{label:"黄梅县",value:"黄梅县"},{label:"龙感湖管理区",value:"龙感湖管理区"},{label:"麻城市",value:"麻城市"},{label:"武穴市",value:"武穴市"}]},{label:"咸宁市",value:"咸宁市",children:[{label:"咸安区",value:"咸安区"},{label:"嘉鱼县",value:"嘉鱼县"},{label:"通城县",value:"通城县"},{label:"崇阳县",value:"崇阳县"},{label:"通山县",value:"通山县"},{label:"赤壁市",value:"赤壁市"}]},{label:"随州市",value:"随州市",children:[{label:"曾都区",value:"曾都区"},{label:"随县",value:"随县"},{label:"广水市",value:"广水市"}]},{label:"恩施土家族苗族自治州",value:"恩施土家族苗族自治州",children:[{label:"恩施市",value:"恩施市"},{label:"利川市",value:"利川市"},{label:"建始县",value:"建始县"},{label:"巴东县",value:"巴东县"},{label:"宣恩县",value:"宣恩县"},{label:"咸丰县",value:"咸丰县"},{label:"来凤县",value:"来凤县"},{label:"鹤峰县",value:"鹤峰县"}]},{label:"省直辖县级行政区划",value:"省直辖县级行政区划",children:[{label:"仙桃市",value:"仙桃市"},{label:"潜江市",value:"潜江市"},{label:"天门市",value:"天门市"},{label:"神农架林区",value:"神农架林区"}]}]},{label:"湖南省",value:"湖南省",children:[{label:"长沙市",value:"长沙市",children:[{label:"芙蓉区",value:"芙蓉区"},{label:"天心区",value:"天心区"},{label:"岳麓区",value:"岳麓区"},{label:"开福区",value:"开福区"},{label:"雨花区",value:"雨花区"},{label:"望城区",value:"望城区"},{label:"长沙县",value:"长沙县"},{label:"浏阳市",value:"浏阳市"},{label:"宁乡市",value:"宁乡市"}]},{label:"株洲市",value:"株洲市",children:[{label:"荷塘区",value:"荷塘区"},{label:"芦淞区",value:"芦淞区"},{label:"石峰区",value:"石峰区"},{label:"天元区",value:"天元区"},{label:"渌口区",value:"渌口区"},{label:"攸县",value:"攸县"},{label:"茶陵县",value:"茶陵县"},{label:"炎陵县",value:"炎陵县"},{label:"醴陵市",value:"醴陵市"}]},{label:"湘潭市",value:"湘潭市",children:[{label:"雨湖区",value:"雨湖区"},{label:"岳塘区",value:"岳塘区"},{label:"湘潭县",value:"湘潭县"},{label:"湖南湘潭高新技术产业园区",value:"湖南湘潭高新技术产业园区"},{label:"湘潭昭山示范区",value:"湘潭昭山示范区"},{label:"湘潭九华示范区",value:"湘潭九华示范区"},{label:"湘乡市",value:"湘乡市"},{label:"韶山市",value:"韶山市"}]},{label:"衡阳市",value:"衡阳市",children:[{label:"珠晖区",value:"珠晖区"},{label:"雁峰区",value:"雁峰区"},{label:"石鼓区",value:"石鼓区"},{label:"蒸湘区",value:"蒸湘区"},{label:"南岳区",value:"南岳区"},{label:"衡阳县",value:"衡阳县"},{label:"衡南县",value:"衡南县"},{label:"衡山县",value:"衡山县"},{label:"衡东县",value:"衡东县"},{label:"祁东县",value:"祁东县"},{label:"湖南衡阳松木经济开发区",value:"湖南衡阳松木经济开发区"},{label:"湖南衡阳高新技术产业园区",value:"湖南衡阳高新技术产业园区"},{label:"耒阳市",value:"耒阳市"},{label:"常宁市",value:"常宁市"}]},{label:"邵阳市",value:"邵阳市",children:[{label:"双清区",value:"双清区"},{label:"大祥区",value:"大祥区"},{label:"北塔区",value:"北塔区"},{label:"新邵县",value:"新邵县"},{label:"邵阳县",value:"邵阳县"},{label:"隆回县",value:"隆回县"},{label:"洞口县",value:"洞口县"},{label:"绥宁县",value:"绥宁县"},{label:"新宁县",value:"新宁县"},{label:"城步苗族自治县",value:"城步苗族自治县"},{label:"武冈市",value:"武冈市"},{label:"邵东市",value:"邵东市"}]},{label:"岳阳市",value:"岳阳市",children:[{label:"岳阳楼区",value:"岳阳楼区"},{label:"云溪区",value:"云溪区"},{label:"君山区",value:"君山区"},{label:"岳阳县",value:"岳阳县"},{label:"华容县",value:"华容县"},{label:"湘阴县",value:"湘阴县"},{label:"平江县",value:"平江县"},{label:"岳阳市屈原管理区",value:"岳阳市屈原管理区"},{label:"汨罗市",value:"汨罗市"},{label:"临湘市",value:"临湘市"}]},{label:"常德市",value:"常德市",children:[{label:"武陵区",value:"武陵区"},{label:"鼎城区",value:"鼎城区"},{label:"安乡县",value:"安乡县"},{label:"汉寿县",value:"汉寿县"},{label:"澧县",value:"澧县"},{label:"临澧县",value:"临澧县"},{label:"桃源县",value:"桃源县"},{label:"石门县",value:"石门县"},{label:"常德市西洞庭管理区",value:"常德市西洞庭管理区"},{label:"津市市",value:"津市市"}]},{label:"张家界市",value:"张家界市",children:[{label:"永定区",value:"永定区"},{label:"武陵源区",value:"武陵源区"},{label:"慈利县",value:"慈利县"},{label:"桑植县",value:"桑植县"}]},{label:"益阳市",value:"益阳市",children:[{label:"资阳区",value:"资阳区"},{label:"赫山区",value:"赫山区"},{label:"南县",value:"南县"},{label:"桃江县",value:"桃江县"},{label:"安化县",value:"安化县"},{label:"益阳市大通湖管理区",value:"益阳市大通湖管理区"},{label:"湖南益阳高新技术产业园区",value:"湖南益阳高新技术产业园区"},{label:"沅江市",value:"沅江市"}]},{label:"郴州市",value:"郴州市",children:[{label:"北湖区",value:"北湖区"},{label:"苏仙区",value:"苏仙区"},{label:"桂阳县",value:"桂阳县"},{label:"宜章县",value:"宜章县"},{label:"永兴县",value:"永兴县"},{label:"嘉禾县",value:"嘉禾县"},{label:"临武县",value:"临武县"},{label:"汝城县",value:"汝城县"},{label:"桂东县",value:"桂东县"},{label:"安仁县",value:"安仁县"},{label:"资兴市",value:"资兴市"}]},{label:"永州市",value:"永州市",children:[{label:"零陵区",value:"零陵区"},{label:"冷水滩区",value:"冷水滩区"},{label:"东安县",value:"东安县"},{label:"双牌县",value:"双牌县"},{label:"道县",value:"道县"},{label:"江永县",value:"江永县"},{label:"宁远县",value:"宁远县"},{label:"蓝山县",value:"蓝山县"},{label:"新田县",value:"新田县"},{label:"江华瑶族自治县",value:"江华瑶族自治县"},{label:"永州经济技术开发区",value:"永州经济技术开发区"},{label:"永州市回龙圩管理区",value:"永州市回龙圩管理区"},{label:"祁阳市",value:"祁阳市"}]},{label:"怀化市",value:"怀化市",children:[{label:"鹤城区",value:"鹤城区"},{label:"中方县",value:"中方县"},{label:"沅陵县",value:"沅陵县"},{label:"辰溪县",value:"辰溪县"},{label:"溆浦县",value:"溆浦县"},{label:"会同县",value:"会同县"},{label:"麻阳苗族自治县",value:"麻阳苗族自治县"},{label:"新晃侗族自治县",value:"新晃侗族自治县"},{label:"芷江侗族自治县",value:"芷江侗族自治县"},{label:"靖州苗族侗族自治县",value:"靖州苗族侗族自治县"},{label:"通道侗族自治县",value:"通道侗族自治县"},{label:"怀化市洪江管理区",value:"怀化市洪江管理区"},{label:"洪江市",value:"洪江市"}]},{label:"娄底市",value:"娄底市",children:[{label:"娄星区",value:"娄星区"},{label:"双峰县",value:"双峰县"},{label:"新化县",value:"新化县"},{label:"冷水江市",value:"冷水江市"},{label:"涟源市",value:"涟源市"}]},{label:"湘西土家族苗族自治州",value:"湘西土家族苗族自治州",children:[{label:"吉首市",value:"吉首市"},{label:"泸溪县",value:"泸溪县"},{label:"凤凰县",value:"凤凰县"},{label:"花垣县",value:"花垣县"},{label:"保靖县",value:"保靖县"},{label:"古丈县",value:"古丈县"},{label:"永顺县",value:"永顺县"},{label:"龙山县",value:"龙山县"}]}]},{label:"广东省",value:"广东省",children:[{label:"广州市",value:"广州市",children:[{label:"荔湾区",value:"荔湾区"},{label:"越秀区",value:"越秀区"},{label:"海珠区",value:"海珠区"},{label:"天河区",value:"天河区"},{label:"白云区",value:"白云区"},{label:"黄埔区",value:"黄埔区"},{label:"番禺区",value:"番禺区"},{label:"花都区",value:"花都区"},{label:"南沙区",value:"南沙区"},{label:"从化区",value:"从化区"},{label:"增城区",value:"增城区"}]},{label:"韶关市",value:"韶关市",children:[{label:"武江区",value:"武江区"},{label:"浈江区",value:"浈江区"},{label:"曲江区",value:"曲江区"},{label:"始兴县",value:"始兴县"},{label:"仁化县",value:"仁化县"},{label:"翁源县",value:"翁源县"},{label:"乳源瑶族自治县",value:"乳源瑶族自治县"},{label:"新丰县",value:"新丰县"},{label:"乐昌市",value:"乐昌市"},{label:"南雄市",value:"南雄市"}]},{label:"深圳市",value:"深圳市",children:[{label:"罗湖区",value:"罗湖区"},{label:"福田区",value:"福田区"},{label:"南山区",value:"南山区"},{label:"宝安区",value:"宝安区"},{label:"龙岗区",value:"龙岗区"},{label:"盐田区",value:"盐田区"},{label:"龙华区",value:"龙华区"},{label:"坪山区",value:"坪山区"},{label:"光明区",value:"光明区"}]},{label:"珠海市",value:"珠海市",children:[{label:"香洲区",value:"香洲区"},{label:"斗门区",value:"斗门区"},{label:"金湾区",value:"金湾区"}]},{label:"汕头市",value:"汕头市",children:[{label:"龙湖区",value:"龙湖区"},{label:"金平区",value:"金平区"},{label:"濠江区",value:"濠江区"},{label:"潮阳区",value:"潮阳区"},{label:"潮南区",value:"潮南区"},{label:"澄海区",value:"澄海区"},{label:"南澳县",value:"南澳县"}]},{label:"佛山市",value:"佛山市",children:[{label:"禅城区",value:"禅城区"},{label:"南海区",value:"南海区"},{label:"顺德区",value:"顺德区"},{label:"三水区",value:"三水区"},{label:"高明区",value:"高明区"}]},{label:"江门市",value:"江门市",children:[{label:"蓬江区",value:"蓬江区"},{label:"江海区",value:"江海区"},{label:"新会区",value:"新会区"},{label:"台山市",value:"台山市"},{label:"开平市",value:"开平市"},{label:"鹤山市",value:"鹤山市"},{label:"恩平市",value:"恩平市"}]},{label:"湛江市",value:"湛江市",children:[{label:"赤坎区",value:"赤坎区"},{label:"霞山区",value:"霞山区"},{label:"坡头区",value:"坡头区"},{label:"麻章区",value:"麻章区"},{label:"遂溪县",value:"遂溪县"},{label:"徐闻县",value:"徐闻县"},{label:"廉江市",value:"廉江市"},{label:"雷州市",value:"雷州市"},{label:"吴川市",value:"吴川市"}]},{label:"茂名市",value:"茂名市",children:[{label:"茂南区",value:"茂南区"},{label:"电白区",value:"电白区"},{label:"高州市",value:"高州市"},{label:"化州市",value:"化州市"},{label:"信宜市",value:"信宜市"}]},{label:"肇庆市",value:"肇庆市",children:[{label:"端州区",value:"端州区"},{label:"鼎湖区",value:"鼎湖区"},{label:"高要区",value:"高要区"},{label:"广宁县",value:"广宁县"},{label:"怀集县",value:"怀集县"},{label:"封开县",value:"封开县"},{label:"德庆县",value:"德庆县"},{label:"四会市",value:"四会市"}]},{label:"惠州市",value:"惠州市",children:[{label:"惠城区",value:"惠城区"},{label:"惠阳区",value:"惠阳区"},{label:"博罗县",value:"博罗县"},{label:"惠东县",value:"惠东县"},{label:"龙门县",value:"龙门县"}]},{label:"梅州市",value:"梅州市",children:[{label:"梅江区",value:"梅江区"},{label:"梅县区",value:"梅县区"},{label:"大埔县",value:"大埔县"},{label:"丰顺县",value:"丰顺县"},{label:"五华县",value:"五华县"},{label:"平远县",value:"平远县"},{label:"蕉岭县",value:"蕉岭县"},{label:"兴宁市",value:"兴宁市"}]},{label:"汕尾市",value:"汕尾市",children:[{label:"城区",value:"城区"},{label:"海丰县",value:"海丰县"},{label:"陆河县",value:"陆河县"},{label:"陆丰市",value:"陆丰市"}]},{label:"河源市",value:"河源市",children:[{label:"源城区",value:"源城区"},{label:"紫金县",value:"紫金县"},{label:"龙川县",value:"龙川县"},{label:"连平县",value:"连平县"},{label:"和平县",value:"和平县"},{label:"东源县",value:"东源县"}]},{label:"阳江市",value:"阳江市",children:[{label:"江城区",value:"江城区"},{label:"阳东区",value:"阳东区"},{label:"阳西县",value:"阳西县"},{label:"阳春市",value:"阳春市"}]},{label:"清远市",value:"清远市",children:[{label:"清城区",value:"清城区"},{label:"清新区",value:"清新区"},{label:"佛冈县",value:"佛冈县"},{label:"阳山县",value:"阳山县"},{label:"连山壮族瑶族自治县",value:"连山壮族瑶族自治县"},{label:"连南瑶族自治县",value:"连南瑶族自治县"},{label:"英德市",value:"英德市"},{label:"连州市",value:"连州市"}]},{label:"东莞市",value:"东莞市",children:[{label:"东城街道",value:"东城街道"},{label:"南城街道",value:"南城街道"},{label:"万江街道",value:"万江街道"},{label:"莞城街道",value:"莞城街道"},{label:"石碣镇",value:"石碣镇"},{label:"石龙镇",value:"石龙镇"},{label:"茶山镇",value:"茶山镇"},{label:"石排镇",value:"石排镇"},{label:"企石镇",value:"企石镇"},{label:"横沥镇",value:"横沥镇"},{label:"桥头镇",value:"桥头镇"},{label:"谢岗镇",value:"谢岗镇"},{label:"东坑镇",value:"东坑镇"},{label:"常平镇",value:"常平镇"},{label:"寮步镇",value:"寮步镇"},{label:"樟木头镇",value:"樟木头镇"},{label:"大朗镇",value:"大朗镇"},{label:"黄江镇",value:"黄江镇"},{label:"清溪镇",value:"清溪镇"},{label:"塘厦镇",value:"塘厦镇"},{label:"凤岗镇",value:"凤岗镇"},{label:"大岭山镇",value:"大岭山镇"},{label:"长安镇",value:"长安镇"},{label:"虎门镇",value:"虎门镇"},{label:"厚街镇",value:"厚街镇"},{label:"沙田镇",value:"沙田镇"},{label:"道滘镇",value:"道滘镇"},{label:"洪梅镇",value:"洪梅镇"},{label:"麻涌镇",value:"麻涌镇"},{label:"望牛墩镇",value:"望牛墩镇"},{label:"中堂镇",value:"中堂镇"},{label:"高埗镇",value:"高埗镇"},{label:"松山湖",value:"松山湖"},{label:"东莞港",value:"东莞港"},{label:"东莞生态园",value:"东莞生态园"},{label:"东莞滨海湾新区",value:"东莞滨海湾新区"}]},{label:"中山市",value:"中山市",children:[{label:"石岐街道",value:"石岐街道"},{label:"东区街道",value:"东区街道"},{label:"中山港街道",value:"中山港街道"},{label:"西区街道",value:"西区街道"},{label:"南区街道",value:"南区街道"},{label:"五桂山街道",value:"五桂山街道"},{label:"民众街道",value:"民众街道"},{label:"南朗街道",value:"南朗街道"},{label:"黄圃镇",value:"黄圃镇"},{label:"东凤镇",value:"东凤镇"},{label:"古镇镇",value:"古镇镇"},{label:"沙溪镇",value:"沙溪镇"},{label:"坦洲镇",value:"坦洲镇"},{label:"港口镇",value:"港口镇"},{label:"三角镇",value:"三角镇"},{label:"横栏镇",value:"横栏镇"},{label:"南头镇",value:"南头镇"},{label:"阜沙镇",value:"阜沙镇"},{label:"三乡镇",value:"三乡镇"},{label:"板芙镇",value:"板芙镇"},{label:"大涌镇",value:"大涌镇"},{label:"神湾镇",value:"神湾镇"},{label:"小榄镇",value:"小榄镇"}]},{label:"潮州市",value:"潮州市",children:[{label:"湘桥区",value:"湘桥区"},{label:"潮安区",value:"潮安区"},{label:"饶平县",value:"饶平县"}]},{label:"揭阳市",value:"揭阳市",children:[{label:"榕城区",value:"榕城区"},{label:"揭东区",value:"揭东区"},{label:"揭西县",value:"揭西县"},{label:"惠来县",value:"惠来县"},{label:"普宁市",value:"普宁市"}]},{label:"云浮市",value:"云浮市",children:[{label:"云城区",value:"云城区"},{label:"云安区",value:"云安区"},{label:"新兴县",value:"新兴县"},{label:"郁南县",value:"郁南县"},{label:"罗定市",value:"罗定市"}]}]},{label:"广西壮族自治区",value:"广西壮族自治区",children:[{label:"南宁市",value:"南宁市",children:[{label:"兴宁区",value:"兴宁区"},{label:"青秀区",value:"青秀区"},{label:"江南区",value:"江南区"},{label:"西乡塘区",value:"西乡塘区"},{label:"良庆区",value:"良庆区"},{label:"邕宁区",value:"邕宁区"},{label:"武鸣区",value:"武鸣区"},{label:"隆安县",value:"隆安县"},{label:"马山县",value:"马山县"},{label:"上林县",value:"上林县"},{label:"宾阳县",value:"宾阳县"},{label:"横州市",value:"横州市"}]},{label:"柳州市",value:"柳州市",children:[{label:"城中区",value:"城中区"},{label:"鱼峰区",value:"鱼峰区"},{label:"柳南区",value:"柳南区"},{label:"柳北区",value:"柳北区"},{label:"柳江区",value:"柳江区"},{label:"柳城县",value:"柳城县"},{label:"鹿寨县",value:"鹿寨县"},{label:"融安县",value:"融安县"},{label:"融水苗族自治县",value:"融水苗族自治县"},{label:"三江侗族自治县",value:"三江侗族自治县"}]},{label:"桂林市",value:"桂林市",children:[{label:"秀峰区",value:"秀峰区"},{label:"叠彩区",value:"叠彩区"},{label:"象山区",value:"象山区"},{label:"七星区",value:"七星区"},{label:"雁山区",value:"雁山区"},{label:"临桂区",value:"临桂区"},{label:"阳朔县",value:"阳朔县"},{label:"灵川县",value:"灵川县"},{label:"全州县",value:"全州县"},{label:"兴安县",value:"兴安县"},{label:"永福县",value:"永福县"},{label:"灌阳县",value:"灌阳县"},{label:"龙胜各族自治县",value:"龙胜各族自治县"},{label:"资源县",value:"资源县"},{label:"平乐县",value:"平乐县"},{label:"恭城瑶族自治县",value:"恭城瑶族自治县"},{label:"荔浦市",value:"荔浦市"}]},{label:"梧州市",value:"梧州市",children:[{label:"万秀区",value:"万秀区"},{label:"长洲区",value:"长洲区"},{label:"龙圩区",value:"龙圩区"},{label:"苍梧县",value:"苍梧县"},{label:"藤县",value:"藤县"},{label:"蒙山县",value:"蒙山县"},{label:"岑溪市",value:"岑溪市"}]},{label:"北海市",value:"北海市",children:[{label:"海城区",value:"海城区"},{label:"银海区",value:"银海区"},{label:"铁山港区",value:"铁山港区"},{label:"合浦县",value:"合浦县"}]},{label:"防城港市",value:"防城港市",children:[{label:"港口区",value:"港口区"},{label:"防城区",value:"防城区"},{label:"上思县",value:"上思县"},{label:"东兴市",value:"东兴市"}]},{label:"钦州市",value:"钦州市",children:[{label:"钦南区",value:"钦南区"},{label:"钦北区",value:"钦北区"},{label:"灵山县",value:"灵山县"},{label:"浦北县",value:"浦北县"}]},{label:"贵港市",value:"贵港市",children:[{label:"港北区",value:"港北区"},{label:"港南区",value:"港南区"},{label:"覃塘区",value:"覃塘区"},{label:"平南县",value:"平南县"},{label:"桂平市",value:"桂平市"}]},{label:"玉林市",value:"玉林市",children:[{label:"玉州区",value:"玉州区"},{label:"福绵区",value:"福绵区"},{label:"容县",value:"容县"},{label:"陆川县",value:"陆川县"},{label:"博白县",value:"博白县"},{label:"兴业县",value:"兴业县"},{label:"北流市",value:"北流市"}]},{label:"百色市",value:"百色市",children:[{label:"右江区",value:"右江区"},{label:"田阳区",value:"田阳区"},{label:"田东县",value:"田东县"},{label:"德保县",value:"德保县"},{label:"那坡县",value:"那坡县"},{label:"凌云县",value:"凌云县"},{label:"乐业县",value:"乐业县"},{label:"田林县",value:"田林县"},{label:"西林县",value:"西林县"},{label:"隆林各族自治县",value:"隆林各族自治县"},{label:"靖西市",value:"靖西市"},{label:"平果市",value:"平果市"}]},{label:"贺州市",value:"贺州市",children:[{label:"八步区",value:"八步区"},{label:"平桂区",value:"平桂区"},{label:"昭平县",value:"昭平县"},{label:"钟山县",value:"钟山县"},{label:"富川瑶族自治县",value:"富川瑶族自治县"}]},{label:"河池市",value:"河池市",children:[{label:"金城江区",value:"金城江区"},{label:"宜州区",value:"宜州区"},{label:"南丹县",value:"南丹县"},{label:"天峨县",value:"天峨县"},{label:"凤山县",value:"凤山县"},{label:"东兰县",value:"东兰县"},{label:"罗城仫佬族自治县",value:"罗城仫佬族自治县"},{label:"环江毛南族自治县",value:"环江毛南族自治县"},{label:"巴马瑶族自治县",value:"巴马瑶族自治县"},{label:"都安瑶族自治县",value:"都安瑶族自治县"},{label:"大化瑶族自治县",value:"大化瑶族自治县"}]},{label:"来宾市",value:"来宾市",children:[{label:"兴宾区",value:"兴宾区"},{label:"忻城县",value:"忻城县"},{label:"象州县",value:"象州县"},{label:"武宣县",value:"武宣县"},{label:"金秀瑶族自治县",value:"金秀瑶族自治县"},{label:"合山市",value:"合山市"}]},{label:"崇左市",value:"崇左市",children:[{label:"江州区",value:"江州区"},{label:"扶绥县",value:"扶绥县"},{label:"宁明县",value:"宁明县"},{label:"龙州县",value:"龙州县"},{label:"大新县",value:"大新县"},{label:"天等县",value:"天等县"},{label:"凭祥市",value:"凭祥市"}]}]},{label:"海南省",value:"海南省",children:[{label:"海口市",value:"海口市",children:[{label:"秀英区",value:"秀英区"},{label:"龙华区",value:"龙华区"},{label:"琼山区",value:"琼山区"},{label:"美兰区",value:"美兰区"}]},{label:"三亚市",value:"三亚市",children:[{label:"海棠区",value:"海棠区"},{label:"吉阳区",value:"吉阳区"},{label:"天涯区",value:"天涯区"},{label:"崖州区",value:"崖州区"}]},{label:"三沙市",value:"三沙市",children:[{label:"西沙群岛",value:"西沙群岛"},{label:"南沙群岛",value:"南沙群岛"},{label:"中沙群岛的岛礁及其海域",value:"中沙群岛的岛礁及其海域"}]},{label:"儋州市",value:"儋州市",children:[{label:"那大镇",value:"那大镇"},{label:"和庆镇",value:"和庆镇"},{label:"南丰镇",value:"南丰镇"},{label:"大成镇",value:"大成镇"},{label:"雅星镇",value:"雅星镇"},{label:"兰洋镇",value:"兰洋镇"},{label:"光村镇",value:"光村镇"},{label:"木棠镇",value:"木棠镇"},{label:"海头镇",value:"海头镇"},{label:"峨蔓镇",value:"峨蔓镇"},{label:"王五镇",value:"王五镇"},{label:"白马井镇",value:"白马井镇"},{label:"中和镇",value:"中和镇"},{label:"排浦镇",value:"排浦镇"},{label:"东成镇",value:"东成镇"},{label:"新州镇",value:"新州镇"},{label:"洋浦经济开发区",value:"洋浦经济开发区"},{label:"华南热作学院",value:"华南热作学院"}]},{label:"省直辖县级行政区划",value:"省直辖县级行政区划",children:[{label:"五指山市",value:"五指山市"},{label:"琼海市",value:"琼海市"},{label:"文昌市",value:"文昌市"},{label:"万宁市",value:"万宁市"},{label:"东方市",value:"东方市"},{label:"定安县",value:"定安县"},{label:"屯昌县",value:"屯昌县"},{label:"澄迈县",value:"澄迈县"},{label:"临高县",value:"临高县"},{label:"白沙黎族自治县",value:"白沙黎族自治县"},{label:"昌江黎族自治县",value:"昌江黎族自治县"},{label:"乐东黎族自治县",value:"乐东黎族自治县"},{label:"陵水黎族自治县",value:"陵水黎族自治县"},{label:"保亭黎族苗族自治县",value:"保亭黎族苗族自治县"},{label:"琼中黎族苗族自治县",value:"琼中黎族苗族自治县"}]}]},{label:"重庆市",value:"重庆市",children:[{label:"市辖区",value:"市辖区",children:[{label:"万州区",value:"万州区"},{label:"涪陵区",value:"涪陵区"},{label:"渝中区",value:"渝中区"},{label:"大渡口区",value:"大渡口区"},{label:"江北区",value:"江北区"},{label:"沙坪坝区",value:"沙坪坝区"},{label:"九龙坡区",value:"九龙坡区"},{label:"南岸区",value:"南岸区"},{label:"北碚区",value:"北碚区"},{label:"綦江区",value:"綦江区"},{label:"大足区",value:"大足区"},{label:"渝北区",value:"渝北区"},{label:"巴南区",value:"巴南区"},{label:"黔江区",value:"黔江区"},{label:"长寿区",value:"长寿区"},{label:"江津区",value:"江津区"},{label:"合川区",value:"合川区"},{label:"永川区",value:"永川区"},{label:"南川区",value:"南川区"},{label:"璧山区",value:"璧山区"},{label:"铜梁区",value:"铜梁区"},{label:"潼南区",value:"潼南区"},{label:"荣昌区",value:"荣昌区"},{label:"开州区",value:"开州区"},{label:"梁平区",value:"梁平区"},{label:"武隆区",value:"武隆区"}]},{label:"县",value:"县",children:[{label:"城口县",value:"城口县"},{label:"丰都县",value:"丰都县"},{label:"垫江县",value:"垫江县"},{label:"忠县",value:"忠县"},{label:"云阳县",value:"云阳县"},{label:"奉节县",value:"奉节县"},{label:"巫山县",value:"巫山县"},{label:"巫溪县",value:"巫溪县"},{label:"石柱土家族自治县",value:"石柱土家族自治县"},{label:"秀山土家族苗族自治县",value:"秀山土家族苗族自治县"},{label:"酉阳土家族苗族自治县",value:"酉阳土家族苗族自治县"},{label:"彭水苗族土家族自治县",value:"彭水苗族土家族自治县"}]}]},{label:"四川省",value:"四川省",children:[{label:"成都市",value:"成都市",children:[{label:"锦江区",value:"锦江区"},{label:"青羊区",value:"青羊区"},{label:"金牛区",value:"金牛区"},{label:"武侯区",value:"武侯区"},{label:"成华区",value:"成华区"},{label:"龙泉驿区",value:"龙泉驿区"},{label:"青白江区",value:"青白江区"},{label:"新都区",value:"新都区"},{label:"温江区",value:"温江区"},{label:"双流区",value:"双流区"},{label:"郫都区",value:"郫都区"},{label:"新津区",value:"新津区"},{label:"金堂县",value:"金堂县"},{label:"大邑县",value:"大邑县"},{label:"蒲江县",value:"蒲江县"},{label:"都江堰市",value:"都江堰市"},{label:"彭州市",value:"彭州市"},{label:"邛崃市",value:"邛崃市"},{label:"崇州市",value:"崇州市"},{label:"简阳市",value:"简阳市"}]},{label:"自贡市",value:"自贡市",children:[{label:"自流井区",value:"自流井区"},{label:"贡井区",value:"贡井区"},{label:"大安区",value:"大安区"},{label:"沿滩区",value:"沿滩区"},{label:"荣县",value:"荣县"},{label:"富顺县",value:"富顺县"}]},{label:"攀枝花市",value:"攀枝花市",children:[{label:"东区",value:"东区"},{label:"西区",value:"西区"},{label:"仁和区",value:"仁和区"},{label:"米易县",value:"米易县"},{label:"盐边县",value:"盐边县"}]},{label:"泸州市",value:"泸州市",children:[{label:"江阳区",value:"江阳区"},{label:"纳溪区",value:"纳溪区"},{label:"龙马潭区",value:"龙马潭区"},{label:"泸县",value:"泸县"},{label:"合江县",value:"合江县"},{label:"叙永县",value:"叙永县"},{label:"古蔺县",value:"古蔺县"}]},{label:"德阳市",value:"德阳市",children:[{label:"旌阳区",value:"旌阳区"},{label:"罗江区",value:"罗江区"},{label:"中江县",value:"中江县"},{label:"广汉市",value:"广汉市"},{label:"什邡市",value:"什邡市"},{label:"绵竹市",value:"绵竹市"}]},{label:"绵阳市",value:"绵阳市",children:[{label:"涪城区",value:"涪城区"},{label:"游仙区",value:"游仙区"},{label:"安州区",value:"安州区"},{label:"三台县",value:"三台县"},{label:"盐亭县",value:"盐亭县"},{label:"梓潼县",value:"梓潼县"},{label:"北川羌族自治县",value:"北川羌族自治县"},{label:"平武县",value:"平武县"},{label:"江油市",value:"江油市"}]},{label:"广元市",value:"广元市",children:[{label:"利州区",value:"利州区"},{label:"昭化区",value:"昭化区"},{label:"朝天区",value:"朝天区"},{label:"旺苍县",value:"旺苍县"},{label:"青川县",value:"青川县"},{label:"剑阁县",value:"剑阁县"},{label:"苍溪县",value:"苍溪县"}]},{label:"遂宁市",value:"遂宁市",children:[{label:"船山区",value:"船山区"},{label:"安居区",value:"安居区"},{label:"蓬溪县",value:"蓬溪县"},{label:"大英县",value:"大英县"},{label:"射洪市",value:"射洪市"}]},{label:"内江市",value:"内江市",children:[{label:"市中区",value:"市中区"},{label:"东兴区",value:"东兴区"},{label:"威远县",value:"威远县"},{label:"资中县",value:"资中县"},{label:"隆昌市",value:"隆昌市"}]},{label:"乐山市",value:"乐山市",children:[{label:"市中区",value:"市中区"},{label:"沙湾区",value:"沙湾区"},{label:"五通桥区",value:"五通桥区"},{label:"金口河区",value:"金口河区"},{label:"犍为县",value:"犍为县"},{label:"井研县",value:"井研县"},{label:"夹江县",value:"夹江县"},{label:"沐川县",value:"沐川县"},{label:"峨边彝族自治县",value:"峨边彝族自治县"},{label:"马边彝族自治县",value:"马边彝族自治县"},{label:"峨眉山市",value:"峨眉山市"}]},{label:"南充市",value:"南充市",children:[{label:"顺庆区",value:"顺庆区"},{label:"高坪区",value:"高坪区"},{label:"嘉陵区",value:"嘉陵区"},{label:"南部县",value:"南部县"},{label:"营山县",value:"营山县"},{label:"蓬安县",value:"蓬安县"},{label:"仪陇县",value:"仪陇县"},{label:"西充县",value:"西充县"},{label:"阆中市",value:"阆中市"}]},{label:"眉山市",value:"眉山市",children:[{label:"东坡区",value:"东坡区"},{label:"彭山区",value:"彭山区"},{label:"仁寿县",value:"仁寿县"},{label:"洪雅县",value:"洪雅县"},{label:"丹棱县",value:"丹棱县"},{label:"青神县",value:"青神县"}]},{label:"宜宾市",value:"宜宾市",children:[{label:"翠屏区",value:"翠屏区"},{label:"南溪区",value:"南溪区"},{label:"叙州区",value:"叙州区"},{label:"江安县",value:"江安县"},{label:"长宁县",value:"长宁县"},{label:"高县",value:"高县"},{label:"珙县",value:"珙县"},{label:"筠连县",value:"筠连县"},{label:"兴文县",value:"兴文县"},{label:"屏山县",value:"屏山县"}]},{label:"广安市",value:"广安市",children:[{label:"广安区",value:"广安区"},{label:"前锋区",value:"前锋区"},{label:"岳池县",value:"岳池县"},{label:"武胜县",value:"武胜县"},{label:"邻水县",value:"邻水县"},{label:"华蓥市",value:"华蓥市"}]},{label:"达州市",value:"达州市",children:[{label:"通川区",value:"通川区"},{label:"达川区",value:"达川区"},{label:"宣汉县",value:"宣汉县"},{label:"开江县",value:"开江县"},{label:"大竹县",value:"大竹县"},{label:"渠县",value:"渠县"},{label:"万源市",value:"万源市"}]},{label:"雅安市",value:"雅安市",children:[{label:"雨城区",value:"雨城区"},{label:"名山区",value:"名山区"},{label:"荥经县",value:"荥经县"},{label:"汉源县",value:"汉源县"},{label:"石棉县",value:"石棉县"},{label:"天全县",value:"天全县"},{label:"芦山县",value:"芦山县"},{label:"宝兴县",value:"宝兴县"}]},{label:"巴中市",value:"巴中市",children:[{label:"巴州区",value:"巴州区"},{label:"恩阳区",value:"恩阳区"},{label:"通江县",value:"通江县"},{label:"南江县",value:"南江县"},{label:"平昌县",value:"平昌县"}]},{label:"资阳市",value:"资阳市",children:[{label:"雁江区",value:"雁江区"},{label:"安岳县",value:"安岳县"},{label:"乐至县",value:"乐至县"}]},{label:"阿坝藏族羌族自治州",value:"阿坝藏族羌族自治州",children:[{label:"马尔康市",value:"马尔康市"},{label:"汶川县",value:"汶川县"},{label:"理县",value:"理县"},{label:"茂县",value:"茂县"},{label:"松潘县",value:"松潘县"},{label:"九寨沟县",value:"九寨沟县"},{label:"金川县",value:"金川县"},{label:"小金县",value:"小金县"},{label:"黑水县",value:"黑水县"},{label:"壤塘县",value:"壤塘县"},{label:"阿坝县",value:"阿坝县"},{label:"若尔盖县",value:"若尔盖县"},{label:"红原县",value:"红原县"}]},{label:"甘孜藏族自治州",value:"甘孜藏族自治州",children:[{label:"康定市",value:"康定市"},{label:"泸定县",value:"泸定县"},{label:"丹巴县",value:"丹巴县"},{label:"九龙县",value:"九龙县"},{label:"雅江县",value:"雅江县"},{label:"道孚县",value:"道孚县"},{label:"炉霍县",value:"炉霍县"},{label:"甘孜县",value:"甘孜县"},{label:"新龙县",value:"新龙县"},{label:"德格县",value:"德格县"},{label:"白玉县",value:"白玉县"},{label:"石渠县",value:"石渠县"},{label:"色达县",value:"色达县"},{label:"理塘县",value:"理塘县"},{label:"巴塘县",value:"巴塘县"},{label:"乡城县",value:"乡城县"},{label:"稻城县",value:"稻城县"},{label:"得荣县",value:"得荣县"}]},{label:"凉山彝族自治州",value:"凉山彝族自治州",children:[{label:"西昌市",value:"西昌市"},{label:"会理市",value:"会理市"},{label:"木里藏族自治县",value:"木里藏族自治县"},{label:"盐源县",value:"盐源县"},{label:"德昌县",value:"德昌县"},{label:"会东县",value:"会东县"},{label:"宁南县",value:"宁南县"},{label:"普格县",value:"普格县"},{label:"布拖县",value:"布拖县"},{label:"金阳县",value:"金阳县"},{label:"昭觉县",value:"昭觉县"},{label:"喜德县",value:"喜德县"},{label:"冕宁县",value:"冕宁县"},{label:"越西县",value:"越西县"},{label:"甘洛县",value:"甘洛县"},{label:"美姑县",value:"美姑县"},{label:"雷波县",value:"雷波县"}]}]},{label:"贵州省",value:"贵州省",children:[{label:"贵阳市",value:"贵阳市",children:[{label:"南明区",value:"南明区"},{label:"云岩区",value:"云岩区"},{label:"花溪区",value:"花溪区"},{label:"乌当区",value:"乌当区"},{label:"白云区",value:"白云区"},{label:"观山湖区",value:"观山湖区"},{label:"开阳县",value:"开阳县"},{label:"息烽县",value:"息烽县"},{label:"修文县",value:"修文县"},{label:"清镇市",value:"清镇市"}]},{label:"六盘水市",value:"六盘水市",children:[{label:"钟山区",value:"钟山区"},{label:"六枝特区",value:"六枝特区"},{label:"水城区",value:"水城区"},{label:"盘州市",value:"盘州市"}]},{label:"遵义市",value:"遵义市",children:[{label:"红花岗区",value:"红花岗区"},{label:"汇川区",value:"汇川区"},{label:"播州区",value:"播州区"},{label:"桐梓县",value:"桐梓县"},{label:"绥阳县",value:"绥阳县"},{label:"正安县",value:"正安县"},{label:"道真仡佬族苗族自治县",value:"道真仡佬族苗族自治县"},{label:"务川仡佬族苗族自治县",value:"务川仡佬族苗族自治县"},{label:"凤冈县",value:"凤冈县"},{label:"湄潭县",value:"湄潭县"},{label:"余庆县",value:"余庆县"},{label:"习水县",value:"习水县"},{label:"赤水市",value:"赤水市"},{label:"仁怀市",value:"仁怀市"}]},{label:"安顺市",value:"安顺市",children:[{label:"西秀区",value:"西秀区"},{label:"平坝区",value:"平坝区"},{label:"普定县",value:"普定县"},{label:"镇宁布依族苗族自治县",value:"镇宁布依族苗族自治县"},{label:"关岭布依族苗族自治县",value:"关岭布依族苗族自治县"},{label:"紫云苗族布依族自治县",value:"紫云苗族布依族自治县"}]},{label:"毕节市",value:"毕节市",children:[{label:"七星关区",value:"七星关区"},{label:"大方县",value:"大方县"},{label:"金沙县",value:"金沙县"},{label:"织金县",value:"织金县"},{label:"纳雍县",value:"纳雍县"},{label:"威宁彝族回族苗族自治县",value:"威宁彝族回族苗族自治县"},{label:"赫章县",value:"赫章县"},{label:"黔西市",value:"黔西市"}]},{label:"铜仁市",value:"铜仁市",children:[{label:"碧江区",value:"碧江区"},{label:"万山区",value:"万山区"},{label:"江口县",value:"江口县"},{label:"玉屏侗族自治县",value:"玉屏侗族自治县"},{label:"石阡县",value:"石阡县"},{label:"思南县",value:"思南县"},{label:"印江土家族苗族自治县",value:"印江土家族苗族自治县"},{label:"德江县",value:"德江县"},{label:"沿河土家族自治县",value:"沿河土家族自治县"},{label:"松桃苗族自治县",value:"松桃苗族自治县"}]},{label:"黔西南布依族苗族自治州",value:"黔西南布依族苗族自治州",children:[{label:"兴义市",value:"兴义市"},{label:"兴仁市",value:"兴仁市"},{label:"普安县",value:"普安县"},{label:"晴隆县",value:"晴隆县"},{label:"贞丰县",value:"贞丰县"},{label:"望谟县",value:"望谟县"},{label:"册亨县",value:"册亨县"},{label:"安龙县",value:"安龙县"}]},{label:"黔东南苗族侗族自治州",value:"黔东南苗族侗族自治州",children:[{label:"凯里市",value:"凯里市"},{label:"黄平县",value:"黄平县"},{label:"施秉县",value:"施秉县"},{label:"三穗县",value:"三穗县"},{label:"镇远县",value:"镇远县"},{label:"岑巩县",value:"岑巩县"},{label:"天柱县",value:"天柱县"},{label:"锦屏县",value:"锦屏县"},{label:"剑河县",value:"剑河县"},{label:"台江县",value:"台江县"},{label:"黎平县",value:"黎平县"},{label:"榕江县",value:"榕江县"},{label:"从江县",value:"从江县"},{label:"雷山县",value:"雷山县"},{label:"麻江县",value:"麻江县"},{label:"丹寨县",value:"丹寨县"}]},{label:"黔南布依族苗族自治州",value:"黔南布依族苗族自治州",children:[{label:"都匀市",value:"都匀市"},{label:"福泉市",value:"福泉市"},{label:"荔波县",value:"荔波县"},{label:"贵定县",value:"贵定县"},{label:"瓮安县",value:"瓮安县"},{label:"独山县",value:"独山县"},{label:"平塘县",value:"平塘县"},{label:"罗甸县",value:"罗甸县"},{label:"长顺县",value:"长顺县"},{label:"龙里县",value:"龙里县"},{label:"惠水县",value:"惠水县"},{label:"三都水族自治县",value:"三都水族自治县"}]}]},{label:"云南省",value:"云南省",children:[{label:"昆明市",value:"昆明市",children:[{label:"五华区",value:"五华区"},{label:"盘龙区",value:"盘龙区"},{label:"官渡区",value:"官渡区"},{label:"西山区",value:"西山区"},{label:"东川区",value:"东川区"},{label:"呈贡区",value:"呈贡区"},{label:"晋宁区",value:"晋宁区"},{label:"富民县",value:"富民县"},{label:"宜良县",value:"宜良县"},{label:"石林彝族自治县",value:"石林彝族自治县"},{label:"嵩明县",value:"嵩明县"},{label:"禄劝彝族苗族自治县",value:"禄劝彝族苗族自治县"},{label:"寻甸回族彝族自治县",value:"寻甸回族彝族自治县"},{label:"安宁市",value:"安宁市"}]},{label:"曲靖市",value:"曲靖市",children:[{label:"麒麟区",value:"麒麟区"},{label:"沾益区",value:"沾益区"},{label:"马龙区",value:"马龙区"},{label:"陆良县",value:"陆良县"},{label:"师宗县",value:"师宗县"},{label:"罗平县",value:"罗平县"},{label:"富源县",value:"富源县"},{label:"会泽县",value:"会泽县"},{label:"宣威市",value:"宣威市"}]},{label:"玉溪市",value:"玉溪市",children:[{label:"红塔区",value:"红塔区"},{label:"江川区",value:"江川区"},{label:"通海县",value:"通海县"},{label:"华宁县",value:"华宁县"},{label:"易门县",value:"易门县"},{label:"峨山彝族自治县",value:"峨山彝族自治县"},{label:"新平彝族傣族自治县",value:"新平彝族傣族自治县"},{label:"元江哈尼族彝族傣族自治县",value:"元江哈尼族彝族傣族自治县"},{label:"澄江市",value:"澄江市"}]},{label:"保山市",value:"保山市",children:[{label:"隆阳区",value:"隆阳区"},{label:"施甸县",value:"施甸县"},{label:"龙陵县",value:"龙陵县"},{label:"昌宁县",value:"昌宁县"},{label:"腾冲市",value:"腾冲市"}]},{label:"昭通市",value:"昭通市",children:[{label:"昭阳区",value:"昭阳区"},{label:"鲁甸县",value:"鲁甸县"},{label:"巧家县",value:"巧家县"},{label:"盐津县",value:"盐津县"},{label:"大关县",value:"大关县"},{label:"永善县",value:"永善县"},{label:"绥江县",value:"绥江县"},{label:"镇雄县",value:"镇雄县"},{label:"彝良县",value:"彝良县"},{label:"威信县",value:"威信县"},{label:"水富市",value:"水富市"}]},{label:"丽江市",value:"丽江市",children:[{label:"古城区",value:"古城区"},{label:"玉龙纳西族自治县",value:"玉龙纳西族自治县"},{label:"永胜县",value:"永胜县"},{label:"华坪县",value:"华坪县"},{label:"宁蒗彝族自治县",value:"宁蒗彝族自治县"}]},{label:"普洱市",value:"普洱市",children:[{label:"思茅区",value:"思茅区"},{label:"宁洱哈尼族彝族自治县",value:"宁洱哈尼族彝族自治县"},{label:"墨江哈尼族自治县",value:"墨江哈尼族自治县"},{label:"景东彝族自治县",value:"景东彝族自治县"},{label:"景谷傣族彝族自治县",value:"景谷傣族彝族自治县"},{label:"镇沅彝族哈尼族拉祜族自治县",value:"镇沅彝族哈尼族拉祜族自治县"},{label:"江城哈尼族彝族自治县",value:"江城哈尼族彝族自治县"},{label:"孟连傣族拉祜族佤族自治县",value:"孟连傣族拉祜族佤族自治县"},{label:"澜沧拉祜族自治县",value:"澜沧拉祜族自治县"},{label:"西盟佤族自治县",value:"西盟佤族自治县"}]},{label:"临沧市",value:"临沧市",children:[{label:"临翔区",value:"临翔区"},{label:"凤庆县",value:"凤庆县"},{label:"云县",value:"云县"},{label:"永德县",value:"永德县"},{label:"镇康县",value:"镇康县"},{label:"双江拉祜族佤族布朗族傣族自治县",value:"双江拉祜族佤族布朗族傣族自治县"},{label:"耿马傣族佤族自治县",value:"耿马傣族佤族自治县"},{label:"沧源佤族自治县",value:"沧源佤族自治县"}]},{label:"楚雄彝族自治州",value:"楚雄彝族自治州",children:[{label:"楚雄市",value:"楚雄市"},{label:"禄丰市",value:"禄丰市"},{label:"双柏县",value:"双柏县"},{label:"牟定县",value:"牟定县"},{label:"南华县",value:"南华县"},{label:"姚安县",value:"姚安县"},{label:"大姚县",value:"大姚县"},{label:"永仁县",value:"永仁县"},{label:"元谋县",value:"元谋县"},{label:"武定县",value:"武定县"}]},{label:"红河哈尼族彝族自治州",value:"红河哈尼族彝族自治州",children:[{label:"个旧市",value:"个旧市"},{label:"开远市",value:"开远市"},{label:"蒙自市",value:"蒙自市"},{label:"弥勒市",value:"弥勒市"},{label:"屏边苗族自治县",value:"屏边苗族自治县"},{label:"建水县",value:"建水县"},{label:"石屏县",value:"石屏县"},{label:"泸西县",value:"泸西县"},{label:"元阳县",value:"元阳县"},{label:"红河县",value:"红河县"},{label:"金平苗族瑶族傣族自治县",value:"金平苗族瑶族傣族自治县"},{label:"绿春县",value:"绿春县"},{label:"河口瑶族自治县",value:"河口瑶族自治县"}]},{label:"文山壮族苗族自治州",value:"文山壮族苗族自治州",children:[{label:"文山市",value:"文山市"},{label:"砚山县",value:"砚山县"},{label:"西畴县",value:"西畴县"},{label:"麻栗坡县",value:"麻栗坡县"},{label:"马关县",value:"马关县"},{label:"丘北县",value:"丘北县"},{label:"广南县",value:"广南县"},{label:"富宁县",value:"富宁县"}]},{label:"西双版纳傣族自治州",value:"西双版纳傣族自治州",children:[{label:"景洪市",value:"景洪市"},{label:"勐海县",value:"勐海县"},{label:"勐腊县",value:"勐腊县"}]},{label:"大理白族自治州",value:"大理白族自治州",children:[{label:"大理市",value:"大理市"},{label:"漾濞彝族自治县",value:"漾濞彝族自治县"},{label:"祥云县",value:"祥云县"},{label:"宾川县",value:"宾川县"},{label:"弥渡县",value:"弥渡县"},{label:"南涧彝族自治县",value:"南涧彝族自治县"},{label:"巍山彝族回族自治县",value:"巍山彝族回族自治县"},{label:"永平县",value:"永平县"},{label:"云龙县",value:"云龙县"},{label:"洱源县",value:"洱源县"},{label:"剑川县",value:"剑川县"},{label:"鹤庆县",value:"鹤庆县"}]},{label:"德宏傣族景颇族自治州",value:"德宏傣族景颇族自治州",children:[{label:"瑞丽市",value:"瑞丽市"},{label:"芒市",value:"芒市"},{label:"梁河县",value:"梁河县"},{label:"盈江县",value:"盈江县"},{label:"陇川县",value:"陇川县"}]},{label:"怒江傈僳族自治州",value:"怒江傈僳族自治州",children:[{label:"泸水市",value:"泸水市"},{label:"福贡县",value:"福贡县"},{label:"贡山独龙族怒族自治县",value:"贡山独龙族怒族自治县"},{label:"兰坪白族普米族自治县",value:"兰坪白族普米族自治县"}]},{label:"迪庆藏族自治州",value:"迪庆藏族自治州",children:[{label:"香格里拉市",value:"香格里拉市"},{label:"德钦县",value:"德钦县"},{label:"维西傈僳族自治县",value:"维西傈僳族自治县"}]}]},{label:"西藏自治区",value:"西藏自治区",children:[{label:"拉萨市",value:"拉萨市",children:[{label:"城关区",value:"城关区"},{label:"堆龙德庆区",value:"堆龙德庆区"},{label:"达孜区",value:"达孜区"},{label:"林周县",value:"林周县"},{label:"当雄县",value:"当雄县"},{label:"尼木县",value:"尼木县"},{label:"曲水县",value:"曲水县"},{label:"墨竹工卡县",value:"墨竹工卡县"},{label:"格尔木藏青工业园区",value:"格尔木藏青工业园区"},{label:"拉萨经济技术开发区",value:"拉萨经济技术开发区"},{label:"西藏文化旅游创意园区",value:"西藏文化旅游创意园区"},{label:"达孜工业园区",value:"达孜工业园区"}]},{label:"日喀则市",value:"日喀则市",children:[{label:"桑珠孜区",value:"桑珠孜区"},{label:"南木林县",value:"南木林县"},{label:"江孜县",value:"江孜县"},{label:"定日县",value:"定日县"},{label:"萨迦县",value:"萨迦县"},{label:"拉孜县",value:"拉孜县"},{label:"昂仁县",value:"昂仁县"},{label:"谢通门县",value:"谢通门县"},{label:"白朗县",value:"白朗县"},{label:"仁布县",value:"仁布县"},{label:"康马县",value:"康马县"},{label:"定结县",value:"定结县"},{label:"仲巴县",value:"仲巴县"},{label:"亚东县",value:"亚东县"},{label:"吉隆县",value:"吉隆县"},{label:"聂拉木县",value:"聂拉木县"},{label:"萨嘎县",value:"萨嘎县"},{label:"岗巴县",value:"岗巴县"}]},{label:"昌都市",value:"昌都市",children:[{label:"卡若区",value:"卡若区"},{label:"江达县",value:"江达县"},{label:"贡觉县",value:"贡觉县"},{label:"类乌齐县",value:"类乌齐县"},{label:"丁青县",value:"丁青县"},{label:"察雅县",value:"察雅县"},{label:"八宿县",value:"八宿县"},{label:"左贡县",value:"左贡县"},{label:"芒康县",value:"芒康县"},{label:"洛隆县",value:"洛隆县"},{label:"边坝县",value:"边坝县"}]},{label:"林芝市",value:"林芝市",children:[{label:"巴宜区",value:"巴宜区"},{label:"工布江达县",value:"工布江达县"},{label:"墨脱县",value:"墨脱县"},{label:"波密县",value:"波密县"},{label:"察隅县",value:"察隅县"},{label:"朗县",value:"朗县"},{label:"米林市",value:"米林市"}]},{label:"山南市",value:"山南市",children:[{label:"乃东区",value:"乃东区"},{label:"扎囊县",value:"扎囊县"},{label:"贡嘎县",value:"贡嘎县"},{label:"桑日县",value:"桑日县"},{label:"琼结县",value:"琼结县"},{label:"曲松县",value:"曲松县"},{label:"措美县",value:"措美县"},{label:"洛扎县",value:"洛扎县"},{label:"加查县",value:"加查县"},{label:"隆子县",value:"隆子县"},{label:"浪卡子县",value:"浪卡子县"},{label:"错那市",value:"错那市"}]},{label:"那曲市",value:"那曲市",children:[{label:"色尼区",value:"色尼区"},{label:"嘉黎县",value:"嘉黎县"},{label:"比如县",value:"比如县"},{label:"聂荣县",value:"聂荣县"},{label:"安多县",value:"安多县"},{label:"申扎县",value:"申扎县"},{label:"索县",value:"索县"},{label:"班戈县",value:"班戈县"},{label:"巴青县",value:"巴青县"},{label:"尼玛县",value:"尼玛县"},{label:"双湖县",value:"双湖县"}]},{label:"阿里地区",value:"阿里地区",children:[{label:"普兰县",value:"普兰县"},{label:"札达县",value:"札达县"},{label:"噶尔县",value:"噶尔县"},{label:"日土县",value:"日土县"},{label:"革吉县",value:"革吉县"},{label:"改则县",value:"改则县"},{label:"措勤县",value:"措勤县"}]}]},{label:"陕西省",value:"陕西省",children:[{label:"西安市",value:"西安市",children:[{label:"新城区",value:"新城区"},{label:"碑林区",value:"碑林区"},{label:"莲湖区",value:"莲湖区"},{label:"灞桥区",value:"灞桥区"},{label:"未央区",value:"未央区"},{label:"雁塔区",value:"雁塔区"},{label:"阎良区",value:"阎良区"},{label:"临潼区",value:"临潼区"},{label:"长安区",value:"长安区"},{label:"高陵区",value:"高陵区"},{label:"鄠邑区",value:"鄠邑区"},{label:"蓝田县",value:"蓝田县"},{label:"周至县",value:"周至县"}]},{label:"铜川市",value:"铜川市",children:[{label:"王益区",value:"王益区"},{label:"印台区",value:"印台区"},{label:"耀州区",value:"耀州区"},{label:"宜君县",value:"宜君县"}]},{label:"宝鸡市",value:"宝鸡市",children:[{label:"渭滨区",value:"渭滨区"},{label:"金台区",value:"金台区"},{label:"陈仓区",value:"陈仓区"},{label:"凤翔区",value:"凤翔区"},{label:"岐山县",value:"岐山县"},{label:"扶风县",value:"扶风县"},{label:"眉县",value:"眉县"},{label:"陇县",value:"陇县"},{label:"千阳县",value:"千阳县"},{label:"麟游县",value:"麟游县"},{label:"凤县",value:"凤县"},{label:"太白县",value:"太白县"}]},{label:"咸阳市",value:"咸阳市",children:[{label:"秦都区",value:"秦都区"},{label:"杨陵区",value:"杨陵区"},{label:"渭城区",value:"渭城区"},{label:"三原县",value:"三原县"},{label:"泾阳县",value:"泾阳县"},{label:"乾县",value:"乾县"},{label:"礼泉县",value:"礼泉县"},{label:"永寿县",value:"永寿县"},{label:"长武县",value:"长武县"},{label:"旬邑县",value:"旬邑县"},{label:"淳化县",value:"淳化县"},{label:"武功县",value:"武功县"},{label:"兴平市",value:"兴平市"},{label:"彬州市",value:"彬州市"}]},{label:"渭南市",value:"渭南市",children:[{label:"临渭区",value:"临渭区"},{label:"华州区",value:"华州区"},{label:"潼关县",value:"潼关县"},{label:"大荔县",value:"大荔县"},{label:"合阳县",value:"合阳县"},{label:"澄城县",value:"澄城县"},{label:"蒲城县",value:"蒲城县"},{label:"白水县",value:"白水县"},{label:"富平县",value:"富平县"},{label:"韩城市",value:"韩城市"},{label:"华阴市",value:"华阴市"}]},{label:"延安市",value:"延安市",children:[{label:"宝塔区",value:"宝塔区"},{label:"安塞区",value:"安塞区"},{label:"延长县",value:"延长县"},{label:"延川县",value:"延川县"},{label:"志丹县",value:"志丹县"},{label:"吴起县",value:"吴起县"},{label:"甘泉县",value:"甘泉县"},{label:"富县",value:"富县"},{label:"洛川县",value:"洛川县"},{label:"宜川县",value:"宜川县"},{label:"黄龙县",value:"黄龙县"},{label:"黄陵县",value:"黄陵县"},{label:"子长市",value:"子长市"}]},{label:"汉中市",value:"汉中市",children:[{label:"汉台区",value:"汉台区"},{label:"南郑区",value:"南郑区"},{label:"城固县",value:"城固县"},{label:"洋县",value:"洋县"},{label:"西乡县",value:"西乡县"},{label:"勉县",value:"勉县"},{label:"宁强县",value:"宁强县"},{label:"略阳县",value:"略阳县"},{label:"镇巴县",value:"镇巴县"},{label:"留坝县",value:"留坝县"},{label:"佛坪县",value:"佛坪县"}]},{label:"榆林市",value:"榆林市",children:[{label:"榆阳区",value:"榆阳区"},{label:"横山区",value:"横山区"},{label:"府谷县",value:"府谷县"},{label:"靖边县",value:"靖边县"},{label:"定边县",value:"定边县"},{label:"绥德县",value:"绥德县"},{label:"米脂县",value:"米脂县"},{label:"佳县",value:"佳县"},{label:"吴堡县",value:"吴堡县"},{label:"清涧县",value:"清涧县"},{label:"子洲县",value:"子洲县"},{label:"神木市",value:"神木市"}]},{label:"安康市",value:"安康市",children:[{label:"汉滨区",value:"汉滨区"},{label:"汉阴县",value:"汉阴县"},{label:"石泉县",value:"石泉县"},{label:"宁陕县",value:"宁陕县"},{label:"紫阳县",value:"紫阳县"},{label:"岚皋县",value:"岚皋县"},{label:"平利县",value:"平利县"},{label:"镇坪县",value:"镇坪县"},{label:"白河县",value:"白河县"},{label:"旬阳市",value:"旬阳市"}]},{label:"商洛市",value:"商洛市",children:[{label:"商州区",value:"商州区"},{label:"洛南县",value:"洛南县"},{label:"丹凤县",value:"丹凤县"},{label:"商南县",value:"商南县"},{label:"山阳县",value:"山阳县"},{label:"镇安县",value:"镇安县"},{label:"柞水县",value:"柞水县"}]}]},{label:"甘肃省",value:"甘肃省",children:[{label:"兰州市",value:"兰州市",children:[{label:"城关区",value:"城关区"},{label:"七里河区",value:"七里河区"},{label:"西固区",value:"西固区"},{label:"安宁区",value:"安宁区"},{label:"红古区",value:"红古区"},{label:"永登县",value:"永登县"},{label:"皋兰县",value:"皋兰县"},{label:"榆中县",value:"榆中县"},{label:"兰州新区",value:"兰州新区"}]},{label:"嘉峪关市",value:"嘉峪关市",children:[{label:"雄关街道",value:"雄关街道"},{label:"钢城街道",value:"钢城街道"},{label:"新城镇",value:"新城镇"},{label:"峪泉镇",value:"峪泉镇"},{label:"文殊镇",value:"文殊镇"}]},{label:"金昌市",value:"金昌市",children:[{label:"金川区",value:"金川区"},{label:"永昌县",value:"永昌县"}]},{label:"白银市",value:"白银市",children:[{label:"白银区",value:"白银区"},{label:"平川区",value:"平川区"},{label:"靖远县",value:"靖远县"},{label:"会宁县",value:"会宁县"},{label:"景泰县",value:"景泰县"}]},{label:"天水市",value:"天水市",children:[{label:"秦州区",value:"秦州区"},{label:"麦积区",value:"麦积区"},{label:"清水县",value:"清水县"},{label:"秦安县",value:"秦安县"},{label:"甘谷县",value:"甘谷县"},{label:"武山县",value:"武山县"},{label:"张家川回族自治县",value:"张家川回族自治县"}]},{label:"武威市",value:"武威市",children:[{label:"凉州区",value:"凉州区"},{label:"民勤县",value:"民勤县"},{label:"古浪县",value:"古浪县"},{label:"天祝藏族自治县",value:"天祝藏族自治县"}]},{label:"张掖市",value:"张掖市",children:[{label:"甘州区",value:"甘州区"},{label:"肃南裕固族自治县",value:"肃南裕固族自治县"},{label:"民乐县",value:"民乐县"},{label:"临泽县",value:"临泽县"},{label:"高台县",value:"高台县"},{label:"山丹县",value:"山丹县"}]},{label:"平凉市",value:"平凉市",children:[{label:"崆峒区",value:"崆峒区"},{label:"泾川县",value:"泾川县"},{label:"灵台县",value:"灵台县"},{label:"崇信县",value:"崇信县"},{label:"庄浪县",value:"庄浪县"},{label:"静宁县",value:"静宁县"},{label:"华亭市",value:"华亭市"}]},{label:"酒泉市",value:"酒泉市",children:[{label:"肃州区",value:"肃州区"},{label:"金塔县",value:"金塔县"},{label:"瓜州县",value:"瓜州县"},{label:"肃北蒙古族自治县",value:"肃北蒙古族自治县"},{label:"阿克塞哈萨克族自治县",value:"阿克塞哈萨克族自治县"},{label:"玉门市",value:"玉门市"},{label:"敦煌市",value:"敦煌市"}]},{label:"庆阳市",value:"庆阳市",children:[{label:"西峰区",value:"西峰区"},{label:"庆城县",value:"庆城县"},{label:"环县",value:"环县"},{label:"华池县",value:"华池县"},{label:"合水县",value:"合水县"},{label:"正宁县",value:"正宁县"},{label:"宁县",value:"宁县"},{label:"镇原县",value:"镇原县"}]},{label:"定西市",value:"定西市",children:[{label:"安定区",value:"安定区"},{label:"通渭县",value:"通渭县"},{label:"陇西县",value:"陇西县"},{label:"渭源县",value:"渭源县"},{label:"临洮县",value:"临洮县"},{label:"漳县",value:"漳县"},{label:"岷县",value:"岷县"}]},{label:"陇南市",value:"陇南市",children:[{label:"武都区",value:"武都区"},{label:"成县",value:"成县"},{label:"文县",value:"文县"},{label:"宕昌县",value:"宕昌县"},{label:"康县",value:"康县"},{label:"西和县",value:"西和县"},{label:"礼县",value:"礼县"},{label:"徽县",value:"徽县"},{label:"两当县",value:"两当县"}]},{label:"临夏回族自治州",value:"临夏回族自治州",children:[{label:"临夏市",value:"临夏市"},{label:"临夏县",value:"临夏县"},{label:"康乐县",value:"康乐县"},{label:"永靖县",value:"永靖县"},{label:"广河县",value:"广河县"},{label:"和政县",value:"和政县"},{label:"东乡族自治县",value:"东乡族自治县"},{label:"积石山保安族东乡族撒拉族自治县",value:"积石山保安族东乡族撒拉族自治县"}]},{label:"甘南藏族自治州",value:"甘南藏族自治州",children:[{label:"合作市",value:"合作市"},{label:"临潭县",value:"临潭县"},{label:"卓尼县",value:"卓尼县"},{label:"舟曲县",value:"舟曲县"},{label:"迭部县",value:"迭部县"},{label:"玛曲县",value:"玛曲县"},{label:"碌曲县",value:"碌曲县"},{label:"夏河县",value:"夏河县"}]}]},{label:"青海省",value:"青海省",children:[{label:"西宁市",value:"西宁市",children:[{label:"城东区",value:"城东区"},{label:"城中区",value:"城中区"},{label:"城西区",value:"城西区"},{label:"城北区",value:"城北区"},{label:"湟中区",value:"湟中区"},{label:"大通回族土族自治县",value:"大通回族土族自治县"},{label:"湟源县",value:"湟源县"}]},{label:"海东市",value:"海东市",children:[{label:"乐都区",value:"乐都区"},{label:"平安区",value:"平安区"},{label:"民和回族土族自治县",value:"民和回族土族自治县"},{label:"互助土族自治县",value:"互助土族自治县"},{label:"化隆回族自治县",value:"化隆回族自治县"},{label:"循化撒拉族自治县",value:"循化撒拉族自治县"}]},{label:"海北藏族自治州",value:"海北藏族自治州",children:[{label:"门源回族自治县",value:"门源回族自治县"},{label:"祁连县",value:"祁连县"},{label:"海晏县",value:"海晏县"},{label:"刚察县",value:"刚察县"}]},{label:"黄南藏族自治州",value:"黄南藏族自治州",children:[{label:"同仁市",value:"同仁市"},{label:"尖扎县",value:"尖扎县"},{label:"泽库县",value:"泽库县"},{label:"河南蒙古族自治县",value:"河南蒙古族自治县"}]},{label:"海南藏族自治州",value:"海南藏族自治州",children:[{label:"共和县",value:"共和县"},{label:"同德县",value:"同德县"},{label:"贵德县",value:"贵德县"},{label:"兴海县",value:"兴海县"},{label:"贵南县",value:"贵南县"}]},{label:"果洛藏族自治州",value:"果洛藏族自治州",children:[{label:"玛沁县",value:"玛沁县"},{label:"班玛县",value:"班玛县"},{label:"甘德县",value:"甘德县"},{label:"达日县",value:"达日县"},{label:"久治县",value:"久治县"},{label:"玛多县",value:"玛多县"}]},{label:"玉树藏族自治州",value:"玉树藏族自治州",children:[{label:"玉树市",value:"玉树市"},{label:"杂多县",value:"杂多县"},{label:"称多县",value:"称多县"},{label:"治多县",value:"治多县"},{label:"囊谦县",value:"囊谦县"},{label:"曲麻莱县",value:"曲麻莱县"}]},{label:"海西蒙古族藏族自治州",value:"海西蒙古族藏族自治州",children:[{label:"格尔木市",value:"格尔木市"},{label:"德令哈市",value:"德令哈市"},{label:"茫崖市",value:"茫崖市"},{label:"乌兰县",value:"乌兰县"},{label:"都兰县",value:"都兰县"},{label:"天峻县",value:"天峻县"},{label:"大柴旦行政委员会",value:"大柴旦行政委员会"}]}]},{label:"宁夏回族自治区",value:"宁夏回族自治区",children:[{label:"银川市",value:"银川市",children:[{label:"兴庆区",value:"兴庆区"},{label:"西夏区",value:"西夏区"},{label:"金凤区",value:"金凤区"},{label:"永宁县",value:"永宁县"},{label:"贺兰县",value:"贺兰县"},{label:"灵武市",value:"灵武市"}]},{label:"石嘴山市",value:"石嘴山市",children:[{label:"大武口区",value:"大武口区"},{label:"惠农区",value:"惠农区"},{label:"平罗县",value:"平罗县"}]},{label:"吴忠市",value:"吴忠市",children:[{label:"利通区",value:"利通区"},{label:"红寺堡区",value:"红寺堡区"},{label:"盐池县",value:"盐池县"},{label:"同心县",value:"同心县"},{label:"青铜峡市",value:"青铜峡市"}]},{label:"固原市",value:"固原市",children:[{label:"原州区",value:"原州区"},{label:"西吉县",value:"西吉县"},{label:"隆德县",value:"隆德县"},{label:"泾源县",value:"泾源县"},{label:"彭阳县",value:"彭阳县"}]},{label:"中卫市",value:"中卫市",children:[{label:"沙坡头区",value:"沙坡头区"},{label:"中宁县",value:"中宁县"},{label:"海原县",value:"海原县"}]}]},{label:"新疆维吾尔自治区",value:"新疆维吾尔自治区",children:[{label:"乌鲁木齐市",value:"乌鲁木齐市",children:[{label:"天山区",value:"天山区"},{label:"沙依巴克区",value:"沙依巴克区"},{label:"新市区",value:"新市区"},{label:"水磨沟区",value:"水磨沟区"},{label:"头屯河区",value:"头屯河区"},{label:"达坂城区",value:"达坂城区"},{label:"米东区",value:"米东区"},{label:"乌鲁木齐县",value:"乌鲁木齐县"}]},{label:"克拉玛依市",value:"克拉玛依市",children:[{label:"独山子区",value:"独山子区"},{label:"克拉玛依区",value:"克拉玛依区"},{label:"白碱滩区",value:"白碱滩区"},{label:"乌尔禾区",value:"乌尔禾区"}]},{label:"吐鲁番市",value:"吐鲁番市",children:[{label:"高昌区",value:"高昌区"},{label:"鄯善县",value:"鄯善县"},{label:"托克逊县",value:"托克逊县"}]},{label:"哈密市",value:"哈密市",children:[{label:"伊州区",value:"伊州区"},{label:"巴里坤哈萨克自治县",value:"巴里坤哈萨克自治县"},{label:"伊吾县",value:"伊吾县"}]},{label:"昌吉回族自治州",value:"昌吉回族自治州",children:[{label:"昌吉市",value:"昌吉市"},{label:"阜康市",value:"阜康市"},{label:"呼图壁县",value:"呼图壁县"},{label:"玛纳斯县",value:"玛纳斯县"},{label:"奇台县",value:"奇台县"},{label:"吉木萨尔县",value:"吉木萨尔县"},{label:"木垒哈萨克自治县",value:"木垒哈萨克自治县"}]},{label:"博尔塔拉蒙古自治州",value:"博尔塔拉蒙古自治州",children:[{label:"博乐市",value:"博乐市"},{label:"阿拉山口市",value:"阿拉山口市"},{label:"精河县",value:"精河县"},{label:"温泉县",value:"温泉县"}]},{label:"巴音郭楞蒙古自治州",value:"巴音郭楞蒙古自治州",children:[{label:"库尔勒市",value:"库尔勒市"},{label:"轮台县",value:"轮台县"},{label:"尉犁县",value:"尉犁县"},{label:"若羌县",value:"若羌县"},{label:"且末县",value:"且末县"},{label:"焉耆回族自治县",value:"焉耆回族自治县"},{label:"和静县",value:"和静县"},{label:"和硕县",value:"和硕县"},{label:"博湖县",value:"博湖县"}]},{label:"阿克苏地区",value:"阿克苏地区",children:[{label:"阿克苏市",value:"阿克苏市"},{label:"库车市",value:"库车市"},{label:"温宿县",value:"温宿县"},{label:"沙雅县",value:"沙雅县"},{label:"新和县",value:"新和县"},{label:"拜城县",value:"拜城县"},{label:"乌什县",value:"乌什县"},{label:"阿瓦提县",value:"阿瓦提县"},{label:"柯坪县",value:"柯坪县"}]},{label:"克孜勒苏柯尔克孜自治州",value:"克孜勒苏柯尔克孜自治州",children:[{label:"阿图什市",value:"阿图什市"},{label:"阿克陶县",value:"阿克陶县"},{label:"阿合奇县",value:"阿合奇县"},{label:"乌恰县",value:"乌恰县"}]},{label:"喀什地区",value:"喀什地区",children:[{label:"喀什市",value:"喀什市"},{label:"疏附县",value:"疏附县"},{label:"疏勒县",value:"疏勒县"},{label:"英吉沙县",value:"英吉沙县"},{label:"泽普县",value:"泽普县"},{label:"莎车县",value:"莎车县"},{label:"叶城县",value:"叶城县"},{label:"麦盖提县",value:"麦盖提县"},{label:"岳普湖县",value:"岳普湖县"},{label:"伽师县",value:"伽师县"},{label:"巴楚县",value:"巴楚县"},{label:"塔什库尔干塔吉克自治县",value:"塔什库尔干塔吉克自治县"}]},{label:"和田地区",value:"和田地区",children:[{label:"和田市",value:"和田市"},{label:"和田县",value:"和田县"},{label:"墨玉县",value:"墨玉县"},{label:"皮山县",value:"皮山县"},{label:"洛浦县",value:"洛浦县"},{label:"策勒县",value:"策勒县"},{label:"于田县",value:"于田县"},{label:"民丰县",value:"民丰县"}]},{label:"伊犁哈萨克自治州",value:"伊犁哈萨克自治州",children:[{label:"伊宁市",value:"伊宁市"},{label:"奎屯市",value:"奎屯市"},{label:"霍尔果斯市",value:"霍尔果斯市"},{label:"伊宁县",value:"伊宁县"},{label:"察布查尔锡伯自治县",value:"察布查尔锡伯自治县"},{label:"霍城县",value:"霍城县"},{label:"巩留县",value:"巩留县"},{label:"新源县",value:"新源县"},{label:"昭苏县",value:"昭苏县"},{label:"特克斯县",value:"特克斯县"},{label:"尼勒克县",value:"尼勒克县"}]},{label:"塔城地区",value:"塔城地区",children:[{label:"塔城市",value:"塔城市"},{label:"乌苏市",value:"乌苏市"},{label:"沙湾市",value:"沙湾市"},{label:"额敏县",value:"额敏县"},{label:"托里县",value:"托里县"},{label:"裕民县",value:"裕民县"},{label:"和布克赛尔蒙古自治县",value:"和布克赛尔蒙古自治县"}]},{label:"阿勒泰地区",value:"阿勒泰地区",children:[{label:"阿勒泰市",value:"阿勒泰市"},{label:"布尔津县",value:"布尔津县"},{label:"富蕴县",value:"富蕴县"},{label:"福海县",value:"福海县"},{label:"哈巴河县",value:"哈巴河县"},{label:"青河县",value:"青河县"},{label:"吉木乃县",value:"吉木乃县"}]},{label:"自治区直辖县级行政区划",value:"自治区直辖县级行政区划",children:[{label:"石河子市",value:"石河子市"},{label:"阿拉尔市",value:"阿拉尔市"},{label:"图木舒克市",value:"图木舒克市"},{label:"五家渠市",value:"五家渠市"},{label:"北屯市",value:"北屯市"},{label:"铁门关市",value:"铁门关市"},{label:"双河市",value:"双河市"},{label:"可克达拉市",value:"可克达拉市"},{label:"昆玉市",value:"昆玉市"},{label:"胡杨河市",value:"胡杨河市"},{label:"新星市",value:"新星市"},{label:"白杨市",value:"白杨市"}]}]},{label:"香港特别行政区",value:"香港特别行政区",children:[{label:"香港岛",value:"香港岛",children:[{label:"中西区",value:"中西区"},{label:"湾仔区",value:"湾仔区"},{label:"东区",value:"东区"},{label:"南区",value:"南区"}]},{label:"九龙",value:"九龙",children:[{label:"油尖旺区",value:"油尖旺区"},{label:"深水埗区",value:"深水埗区"},{label:"九龙城区",value:"九龙城区"},{label:"黄大仙区",value:"黄大仙区"},{label:"观塘区",value:"观塘区"}]},{label:"新界",value:"新界",children:[{label:"葵青区",value:"葵青区"},{label:"荃湾区",value:"荃湾区"},{label:"屯门区",value:"屯门区"},{label:"元朗区",value:"元朗区"},{label:"北区",value:"北区"},{label:"大埔区",value:"大埔区"},{label:"沙田区",value:"沙田区"},{label:"西贡区",value:"西贡区"},{label:"离岛区",value:"离岛区"}]}]},{label:"澳门特别行政区",value:"澳门特别行政区",children:[{label:"澳门半岛",value:"澳门半岛",children:[{label:"大堂区",value:"大堂区"},{label:"望德堂区",value:"望德堂区"},{label:"风顺堂区",value:"风顺堂区"},{label:"花地玛堂区",value:"花地玛堂区"},{label:"圣安多尼堂区",value:"圣安多尼堂区"}]},{label:"澳门外岛",value:"澳门外岛",children:[{label:"嘉模堂区(氹仔)",value:"嘉模堂区(氹仔)"},{label:"圣方济各堂区(路环)",value:"圣方济各堂区(路环)"}]}]},{label:"台湾省",value:"台湾省",children:[{label:"台北市",value:"台北市",children:[{label:"大安区",value:"大安区"},{label:"内湖区",value:"内湖区"},{label:"士林区",value:"士林区"},{label:"文山区",value:"文山区"},{label:"北投区",value:"北投区"},{label:"中山区",value:"中山区"},{label:"信义区",value:"信义区"},{label:"松山区",value:"松山区"},{label:"万华区",value:"万华区"},{label:"中正区",value:"中正区"},{label:"大同区",value:"大同区"},{label:"南港区",value:"南港区"}]},{label:"新北市",value:"新北市",children:[{label:"板桥区",value:"板桥区"},{label:"新庄区",value:"新庄区"},{label:"中和区",value:"中和区"},{label:"三重区",value:"三重区"},{label:"新店区",value:"新店区"},{label:"土城区",value:"土城区"},{label:"永和区",value:"永和区"},{label:"芦洲区",value:"芦洲区"},{label:"汐止区",value:"汐止区"},{label:"树林区",value:"树林区"},{label:"淡水区",value:"淡水区"},{label:"三峡区",value:"三峡区"},{label:"林口区",value:"林口区"},{label:"莺歌区",value:"莺歌区"},{label:"五股区",value:"五股区"},{label:"泰山区",value:"泰山区"},{label:"瑞芳区",value:"瑞芳区"},{label:"八里区",value:"八里区"},{label:"深坑区",value:"深坑区"},{label:"三芝区",value:"三芝区"},{label:"万里区",value:"万里区"},{label:"金山区",value:"金山区"},{label:"贡寮区",value:"贡寮区"},{label:"石门区",value:"石门区"},{label:"双溪区",value:"双溪区"},{label:"石碇区",value:"石碇区"},{label:"坪林区",value:"坪林区"},{label:"乌来区",value:"乌来区"},{label:"平溪区",value:"平溪区"}]},{label:"桃园市",value:"桃园市",children:[{label:"桃园区",value:"桃园区"},{label:"中坜区",value:"中坜区"},{label:"平镇区",value:"平镇区"},{label:"八德区",value:"八德区"},{label:"杨梅区",value:"杨梅区"},{label:"芦竹区",value:"芦竹区"},{label:"龟山区",value:"龟山区"},{label:"龙潭区",value:"龙潭区"},{label:"大溪区",value:"大溪区"},{label:"大园区",value:"大园区"},{label:"观音区",value:"观音区"},{label:"新屋区",value:"新屋区"},{label:"复兴区",value:"复兴区"}]},{label:"台中市",value:"台中市",children:[{label:"北屯区",value:"北屯区"},{label:"西屯区",value:"西屯区"},{label:"大里区",value:"大里区"},{label:"太平区",value:"太平区"},{label:"南屯区",value:"南屯区"},{label:"丰原区",value:"丰原区"},{label:"东区",value:"东区"},{label:"南区",value:"南区"},{label:"西区",value:"西区"},{label:"北区",value:"北区"},{label:"中区",value:"中区"},{label:"潭子区",value:"潭子区"},{label:"大雅区",value:"大雅区"},{label:"沙鹿区",value:"沙鹿区"},{label:"清水区",value:"清水区"},{label:"龙井区",value:"龙井区"},{label:"大甲区",value:"大甲区"},{label:"乌日区",value:"乌日区"},{label:"神冈区",value:"神冈区"},{label:"雾峰区",value:"雾峰区"},{label:"梧栖区",value:"梧栖区"},{label:"大肚区",value:"大肚区"},{label:"后里区",value:"后里区"},{label:"东势区",value:"东势区"},{label:"外埔区",value:"外埔区"},{label:"新社区",value:"新社区"},{label:"大安区",value:"大安区"},{label:"石冈区",value:"石冈区"},{label:"和平区",value:"和平区"}]},{label:"台南市",value:"台南市",children:[{label:"永康区",value:"永康区"},{label:"安南区",value:"安南区"},{label:"东区",value:"东区"},{label:"北区",value:"北区"},{label:"南区",value:"南区"},{label:"中西区",value:"中西区"},{label:"新营区",value:"新营区"},{label:"仁德区",value:"仁德区"},{label:"归仁区",value:"归仁区"},{label:"安平区",value:"安平区"},{label:"佳里区",value:"佳里区"},{label:"善化区",value:"善化区"},{label:"麻豆区",value:"麻豆区"},{label:"新化区",value:"新化区"},{label:"新市区",value:"新市区"},{label:"关庙区",value:"关庙区"},{label:"安定区",value:"安定区"},{label:"白河区",value:"白河区"},{label:"学甲区",value:"学甲区"},{label:"盐水区",value:"盐水区"},{label:"西港区",value:"西港区"},{label:"下营区",value:"下营区"},{label:"后壁区",value:"后壁区"},{label:"七股区",value:"七股区"},{label:"六甲区",value:"六甲区"},{label:"官田区",value:"官田区"},{label:"柳营区",value:"柳营区"},{label:"东山区",value:"东山区"},{label:"将军区",value:"将军区"},{label:"玉井区",value:"玉井区"},{label:"北门区",value:"北门区"},{label:"大内区",value:"大内区"},{label:"楠西区",value:"楠西区"},{label:"南化区",value:"南化区"},{label:"山上区",value:"山上区"},{label:"左镇区",value:"左镇区"},{label:"龙崎区",value:"龙崎区"}]},{label:"高雄市",value:"高雄市",children:[{label:"凤山区",value:"凤山区"},{label:"三民区",value:"三民区"},{label:"左营区",value:"左营区"},{label:"前镇区",value:"前镇区"},{label:"楠梓区",value:"楠梓区"},{label:"苓雅区",value:"苓雅区"},{label:"小港区",value:"小港区"},{label:"鼓山区",value:"鼓山区"},{label:"大寮区",value:"大寮区"},{label:"冈山区",value:"冈山区"},{label:"仁武区",value:"仁武区"},{label:"林园区",value:"林园区"},{label:"路竹区",value:"路竹区"},{label:"新兴区",value:"新兴区"},{label:"鸟松区",value:"鸟松区"},{label:"大树区",value:"大树区"},{label:"美浓区",value:"美浓区"},{label:"桥头区",value:"桥头区"},{label:"旗山区",value:"旗山区"},{label:"梓官区",value:"梓官区"},{label:"大社区",value:"大社区"},{label:"茄萣区",value:"茄萣区"},{label:"燕巢区",value:"燕巢区"},{label:"湖内区",value:"湖内区"},{label:"阿莲区",value:"阿莲区"},{label:"旗津区",value:"旗津区"},{label:"前金区",value:"前金区"},{label:"盐埕区",value:"盐埕区"},{label:"弥陀区",value:"弥陀区"},{label:"内门区",value:"内门区"},{label:"永安区",value:"永安区"},{label:"六龟区",value:"六龟区"},{label:"杉林区",value:"杉林区"},{label:"田寮区",value:"田寮区"},{label:"甲仙区",value:"甲仙区"},{label:"桃源区",value:"桃源区"},{label:"那玛夏区",value:"那玛夏区"},{label:"茂林区",value:"茂林区"}]},{label:"基隆市",value:"基隆市",children:[{label:"安乐区",value:"安乐区"},{label:"七堵区",value:"七堵区"},{label:"信义区",value:"信义区"},{label:"中正区",value:"中正区"},{label:"中山区",value:"中山区"},{label:"仁爱区",value:"仁爱区"},{label:"暖暖区",value:"暖暖区"}]},{label:"新竹市",value:"新竹市",children:[{label:"东区",value:"东区"},{label:"北区",value:"北区"},{label:"香山区",value:"香山区"}]},{label:"嘉义市",value:"嘉义市",children:[{label:"东区",value:"东区"},{label:"西区",value:"西区"}]},{label:"新竹县",value:"新竹县",children:[{label:"竹北市",value:"竹北市"},{label:"竹东镇",value:"竹东镇"},{label:"新埔镇",value:"新埔镇"},{label:"关西镇",value:"关西镇"},{label:"湖口乡",value:"湖口乡"},{label:"新丰乡",value:"新丰乡"},{label:"芎林乡",value:"芎林乡"},{label:"宝山乡",value:"宝山乡"},{label:"横山乡",value:"横山乡"},{label:"尖石乡",value:"尖石乡"},{label:"北埔乡",value:"北埔乡"},{label:"峨眉乡",value:"峨眉乡"},{label:"五峰乡",value:"五峰乡"}]},{label:"苗栗县",value:"苗栗县",children:[{label:"头份市",value:"头份市"},{label:"苗栗市",value:"苗栗市"},{label:"竹南镇",value:"竹南镇"},{label:"苑里镇",value:"苑里镇"},{label:"后龙镇",value:"后龙镇"},{label:"通霄镇",value:"通霄镇"},{label:"卓兰镇",value:"卓兰镇"},{label:"公馆乡",value:"公馆乡"},{label:"铜锣乡",value:"铜锣乡"},{label:"三义乡",value:"三义乡"},{label:"大湖乡",value:"大湖乡"},{label:"造桥乡",value:"造桥乡"},{label:"头屋乡",value:"头屋乡"},{label:"南庄乡",value:"南庄乡"},{label:"西湖乡",value:"西湖乡"},{label:"三湾乡",value:"三湾乡"},{label:"泰安乡",value:"泰安乡"},{label:"狮潭乡",value:"狮潭乡"}]},{label:"彰化县",value:"彰化县",children:[{label:"彰化市",value:"彰化市"},{label:"员林市",value:"员林市"},{label:"和美镇",value:"和美镇"},{label:"鹿港镇",value:"鹿港镇"},{label:"溪湖镇",value:"溪湖镇"},{label:"二林镇",value:"二林镇"},{label:"田中镇",value:"田中镇"},{label:"北斗镇",value:"北斗镇"},{label:"福兴乡",value:"福兴乡"},{label:"花坛乡",value:"花坛乡"},{label:"社头乡",value:"社头乡"},{label:"秀水乡",value:"秀水乡"},{label:"伸港乡",value:"伸港乡"},{label:"大村乡",value:"大村乡"},{label:"永靖乡",value:"永靖乡"},{label:"埔心乡",value:"埔心乡"},{label:"芳苑乡",value:"芳苑乡"},{label:"埔盐乡",value:"埔盐乡"},{label:"埤头乡",value:"埤头乡"},{label:"溪州乡",value:"溪州乡"},{label:"田尾乡",value:"田尾乡"},{label:"芬园乡",value:"芬园乡"},{label:"线西乡",value:"线西乡"},{label:"大城乡",value:"大城乡"},{label:"二水乡",value:"二水乡"},{label:"竹塘乡",value:"竹塘乡"}]},{label:"南投县",value:"南投县",children:[{label:"南投市",value:"南投市"},{label:"草屯镇",value:"草屯镇"},{label:"埔里镇",value:"埔里镇"},{label:"竹山镇",value:"竹山镇"},{label:"集集镇",value:"集集镇"},{label:"名间乡",value:"名间乡"},{label:"国姓乡",value:"国姓乡"},{label:"鹿谷乡",value:"鹿谷乡"},{label:"水里乡",value:"水里乡"},{label:"信义乡",value:"信义乡"},{label:"仁爱乡",value:"仁爱乡"},{label:"鱼池乡",value:"鱼池乡"},{label:"中寮乡",value:"中寮乡"}]},{label:"云林县",value:"云林县",children:[{label:"斗六市",value:"斗六市"},{label:"虎尾镇",value:"虎尾镇"},{label:"西螺镇",value:"西螺镇"},{label:"斗南镇",value:"斗南镇"},{label:"北港镇",value:"北港镇"},{label:"土库镇",value:"土库镇"},{label:"麦寮乡",value:"麦寮乡"},{label:"古坑乡",value:"古坑乡"},{label:"莿桐乡",value:"莿桐乡"},{label:"口湖乡",value:"口湖乡"},{label:"二仑乡",value:"二仑乡"},{label:"元长乡",value:"元长乡"},{label:"水林乡",value:"水林乡"},{label:"仑背乡",value:"仑背乡"},{label:"台西乡",value:"台西乡"},{label:"四湖乡",value:"四湖乡"},{label:"大埤乡",value:"大埤乡"},{label:"林内乡",value:"林内乡"},{label:"东势乡",value:"东势乡"},{label:"褒忠乡",value:"褒忠乡"}]},{label:"嘉义县",value:"嘉义县",children:[{label:"朴子市",value:"朴子市"},{label:"太保市",value:"太保市"},{label:"大林镇",value:"大林镇"},{label:"布袋镇",value:"布袋镇"},{label:"民雄乡",value:"民雄乡"},{label:"水上乡",value:"水上乡"},{label:"中埔乡",value:"中埔乡"},{label:"竹崎乡",value:"竹崎乡"},{label:"新港乡",value:"新港乡"},{label:"东石乡",value:"东石乡"},{label:"六脚乡",value:"六脚乡"},{label:"梅山乡",value:"梅山乡"},{label:"义竹乡",value:"义竹乡"},{label:"鹿草乡",value:"鹿草乡"},{label:"溪口乡",value:"溪口乡"},{label:"番路乡",value:"番路乡"},{label:"阿里山乡",value:"阿里山乡"},{label:"大埔乡",value:"大埔乡"}]},{label:"屏东县",value:"屏东县",children:[{label:"屏东市",value:"屏东市"},{label:"潮州镇",value:"潮州镇"},{label:"东港镇",value:"东港镇"},{label:"恒春镇",value:"恒春镇"},{label:"内埔乡",value:"内埔乡"},{label:"万丹乡",value:"万丹乡"},{label:"新园乡",value:"新园乡"},{label:"长治乡",value:"长治乡"},{label:"里港乡",value:"里港乡"},{label:"盐埔乡",value:"盐埔乡"},{label:"高树乡",value:"高树乡"},{label:"枋寮乡",value:"枋寮乡"},{label:"九如乡",value:"九如乡"},{label:"万峦乡",value:"万峦乡"},{label:"佳冬乡",value:"佳冬乡"},{label:"林边乡",value:"林边乡"},{label:"竹田乡",value:"竹田乡"},{label:"崁顶乡",value:"崁顶乡"},{label:"琉球乡",value:"琉球乡"},{label:"麟洛乡",value:"麟洛乡"},{label:"南州乡",value:"南州乡"},{label:"新埤乡",value:"新埤乡"},{label:"车城乡",value:"车城乡"},{label:"满州乡",value:"满州乡"},{label:"三地门乡",value:"三地门乡"},{label:"来义乡",value:"来义乡"},{label:"玛家乡",value:"玛家乡"},{label:"枋山乡",value:"枋山乡"},{label:"泰武乡",value:"泰武乡"},{label:"牡丹乡",value:"牡丹乡"},{label:"狮子乡",value:"狮子乡"},{label:"春日乡",value:"春日乡"},{label:"雾台乡",value:"雾台乡"}]},{label:"宜兰县",value:"宜兰县",children:[{label:"宜兰市",value:"宜兰市"},{label:"罗东镇",value:"罗东镇"},{label:"苏澳镇",value:"苏澳镇"},{label:"头城镇",value:"头城镇"},{label:"冬山乡",value:"冬山乡"},{label:"五结乡",value:"五结乡"},{label:"礁溪乡",value:"礁溪乡"},{label:"员山乡",value:"员山乡"},{label:"壮围乡",value:"壮围乡"},{label:"三星乡",value:"三星乡"},{label:"大同乡",value:"大同乡"},{label:"南澳乡",value:"南澳乡"}]},{label:"花莲县",value:"花莲县",children:[{label:"花莲市",value:"花莲市"},{label:"玉里镇",value:"玉里镇"},{label:"凤林镇",value:"凤林镇"},{label:"吉安乡",value:"吉安乡"},{label:"新城乡",value:"新城乡"},{label:"寿丰乡",value:"寿丰乡"},{label:"秀林乡",value:"秀林乡"},{label:"光复乡",value:"光复乡"},{label:"瑞穗乡",value:"瑞穗乡"},{label:"富里乡",value:"富里乡"},{label:"万荣乡",value:"万荣乡"},{label:"卓溪乡",value:"卓溪乡"},{label:"丰滨乡",value:"丰滨乡"}]},{label:"台东县",value:"台东县",children:[{label:"台东市",value:"台东市"},{label:"卑南乡",value:"卑南乡"},{label:"成功镇",value:"成功镇"},{label:"太麻里乡",value:"太麻里乡"},{label:"关山镇",value:"关山镇"},{label:"东河乡",value:"东河乡"},{label:"池上乡",value:"池上乡"},{label:"鹿野乡",value:"鹿野乡"},{label:"长滨乡",value:"长滨乡"},{label:"大武乡",value:"大武乡"},{label:"兰屿乡",value:"兰屿乡"},{label:"海端乡",value:"海端乡"},{label:"绿岛乡",value:"绿岛乡"},{label:"金峰乡",value:"金峰乡"},{label:"延平乡",value:"延平乡"},{label:"达仁乡",value:"达仁乡"}]},{label:"澎湖县",value:"澎湖县",children:[{label:"马公市",value:"马公市"},{label:"湖西乡",value:"湖西乡"},{label:"白沙乡",value:"白沙乡"},{label:"西屿乡",value:"西屿乡"},{label:"望安乡",value:"望安乡"},{label:"七美乡",value:"七美乡"}]}]},{label:"其他",value:"其他",children:[{label:"国外",value:"国外"}]}],Bs=e=>e?e.split("-"):[],iC=(e,t)=>{const n=[];let l=e;for(const r of t){const a=l?.find(i=>String(i.value)===r);if(!a)break;n.push(a.label),l=a.children}return n},_f=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=e.cascaderOptions&&e.cascaderOptions.length>0?e.cascaderOptions:aC,i=e.placeholder||"请选择省市区",s=t??e.defaultValue,[o,u]=y.useState(()=>Bs(s)),[c,d]=y.useState(0),[f,h]=y.useState(100),m=y.useRef(null);y.useEffect(()=>{u(Bs(s))},[s]);const v=o.length>=2,g=y.useCallback(O=>{u(O),n(e.key,O.join("-"))},[e.key,n]),E=y.useCallback(O=>{if(!O||O.length===0){g([]);return}O.length<2||g(O.map(String))},[g]),N=y.useCallback(O=>{O||(u(Bs(s)),d(S=>S+1))},[s]),A=y.useCallback(()=>{if(o.length>=2){const O=iC(a,o);return O.length?O.join("-"):o.join("-")}return i},[o,a,i]),L=y.useCallback(()=>{const O=m.current;if(!O)return;const S=A(),_=O.querySelector(".ant-select-selector"),I=O.querySelector(".ant-select-selection-item")||O.querySelector(".ant-select-selection-placeholder"),k=I||_||O,R=window.getComputedStyle(k),M=I?R.fontSize:"16px",H=R.fontFamily||"sans-serif",q=R.fontWeight||"400",T=`${R.fontStyle||"normal"} ${q} ${M} ${H}`,V=document.createElement("canvas").getContext("2d"),$=V?Math.ceil((V.font=T,V.measureText(S).width||0)):0;let X=0;if(_){const ie=window.getComputedStyle(_);X=(Number.parseFloat(ie.paddingLeft)||0)+(Number.parseFloat(ie.paddingRight)||0)}const Z=Math.max(80,$+X+16+10);h(ie=>ie===Z?ie:Z)},[A]);return y.useLayoutEffect(()=>{const O=window.requestAnimationFrame(()=>L()),S=window.setTimeout(()=>L(),60);return()=>{window.cancelAnimationFrame(O),window.clearTimeout(S)}},[L]),y.useEffect(()=>{if(!("fonts"in document))return;let O=!1;const S=document.fonts;if(S?.ready)return S.ready.then(()=>{O||L()}),()=>{O=!0}},[L]),b.jsx(gn,{node:e,children:b.jsx("span",{ref:m,className:["rte-cascader-host",r?"rte-cascader-error":""].filter(Boolean).join(" "),"data-type":"cascader","data-key":e.key,"data-has-value":v?"true":"false",contentEditable:!1,style:{display:"inline-block",width:f},children:b.jsx(ue.Cascader,{"data-type":"cascader","data-key":e.key,options:a,value:v?o:void 0,onChange:O=>E(O),onOpenChange:N,disabled:l,placeholder:i,changeOnSelect:!0,size:"small",variant:"borderless",allowClear:!0,showSearch:{filter:(O,S)=>S.some(_=>_.label.toLowerCase().includes(O.toLowerCase()))},popupClassName:"rte-cascader-dropdown",placement:"bottomLeft",builtinPlacements:Ps,getPopupContainer:xr,displayRender:O=>O.join("-"),style:{width:"100%"},suffixIcon:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})},c)})})});_f.displayName="CascaderNode";const Of=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,nodeDefaults:a})=>{const i=typeof e.maxHeight=="number"?e.maxHeight:a?.textarea?.maxHeight??252,s=y.useCallback(o=>n(e.key,o.target.value),[e.key,n]);return b.jsx(gn,{node:e,children:b.jsx("div",{className:`rte-textarea-wrapper ${r?"rte-textarea-error":""}`,"data-key":e.key,children:b.jsx(ue.Input.TextArea,{className:"rte-textarea","data-type":"textarea","data-key":e.key,value:t??"",onChange:s,disabled:l,placeholder:e.placeholder,autoSize:{minRows:1,maxRows:99},style:{maxHeight:i},variant:"borderless"})})})});Of.displayName="TextareaNode";const Rs=e=>{const t=e.trim();if(!t)return{url:""};let n=null;try{n=new URL(t)}catch{try{n=new URL(`https://${t}`)}catch{return{url:t}}}const l=n.pathname.split("/").filter(Boolean),r=l.findIndex(o=>o==="report"),a=r>=0?l[r+1]:void 0,i=l[0]&&l[0].length<=5?l[0]:void 0,s=n.searchParams.get("agentId")||void 0;return{url:t,reportId:a,agentId:s,lang:i}},sC="https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/website/kongzhuangtai.svg",oC=e=>{if(!e)return"";const t=Rs(e);return t.reportId?`report:${t.reportId}`:`url:${e.trim()}`},uC=({nodeKey:e,nodeType:t,fetch:n,onSelect:l,onGoGenerate:r,onViewReport:a,hideCurrentSessionReport:i,preciseMatchKey:s,open:o})=>{const[u,c]=y.useState(!1),[d,f]=y.useState(null),[h,m]=y.useState(""),v=y.useRef(0),g=y.useRef(null);y.useEffect(()=>{if(!o)return;const S=++v.current;c(!0),n({nodeKey:e,nodeType:t}).then(_=>{if(S!==v.current)return;const I=i?_.tabs.filter(M=>M.key!=="currentConversationReports"):_.tabs,k={..._,tabs:I};f(k);const R=I.find(M=>M.items.length>0);m(R?.key??I[0]?.key??"")}).catch(()=>{S===v.current&&f({tabs:[]})}).finally(()=>{S===v.current&&c(!1)})},[o,n,e,t,i]);const E=y.useCallback(S=>s?S.filter(_=>oC(_.url)===s):S,[s]);y.useEffect(()=>{if(!o||!s||!d)return;const S=d.tabs.find(_=>E(_.items).length>0);S&&m(_=>_===S.key?_:S.key)},[o,s,d,E]);const N=d?.tabs.find(S=>S.key===h),A=N?E(N.items):[],L=y.useCallback(S=>{const _=S.currentTarget;_.classList.add("is-scrolling"),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{_.classList.remove("is-scrolling"),g.current=null},300)},[]),O=y.useCallback((S,_)=>{S.stopPropagation(),a?a(_):window.open(_.viewUrl||_.url,"_blank")},[a]);return b.jsx("div",{className:"rte-report-dropdown-panel",onMouseDown:S=>S.preventDefault(),children:u?b.jsx("div",{className:"rte-report-dropdown-loading",children:b.jsx(ue.Spin,{size:"small"})}):d?b.jsxs(b.Fragment,{children:[d.tabs.length>1&&b.jsx("div",{className:"rte-report-dropdown-tab-outer",children:b.jsx("div",{className:"rte-report-dropdown-tab-inner",children:d.tabs.map(S=>b.jsx("div",{className:`rte-report-dropdown-tab-item${S.key===h?" active":""}`,onClick:()=>m(S.key),children:S.label},S.key))})}),b.jsx("div",{className:"rte-report-dropdown-list",onScroll:L,children:!N||A.length===0?b.jsxs("div",{className:"rte-report-dropdown-empty",children:[b.jsx("img",{className:"rte-report-dropdown-empty-img",src:sC,alt:""}),b.jsxs("div",{className:"rte-report-dropdown-empty-text",children:[b.jsx("span",{className:"rte-report-dropdown-empty-label",children:s?"未找到匹配的报告":"暂无生成的报告"}),r&&N?.agentType!==void 0&&b.jsx("span",{className:"rte-report-dropdown-empty-link",onClick:()=>r(N.agentType),children:"去生成"})]})]}):A.map((S,_)=>b.jsxs("div",{className:"rte-report-dropdown-item",onClick:()=>l(S),children:[b.jsx("span",{className:"rte-report-dropdown-item-name",title:S.name,children:S.name}),b.jsxs("span",{className:"rte-report-dropdown-item-action",onClick:I=>O(I,S),children:[b.jsx("i",{className:"iconfont icon-chakanbaogao"}),"查看报告"]})]},`${S.url}-${_}`))})]}):null})},Mf=({chipRef:e,nodeKey:t,nodeType:n,fetch:l,onSelect:r,onGoGenerate:a,onViewReport:i,hideCurrentSessionReport:s,preciseMatchKey:o="",quiet:u,openSignal:c})=>{const d=_l(),[f,h]=y.useState(!1),m=y.useRef(null),v=y.useRef({}).current,[g,E]=y.useState("bottomLeft"),[N,A]=y.useState(0),L=y.useCallback(()=>{const k=e.current,R=m.current;if(!k||!R)return;const M=k.getBoundingClientRect(),H=R.getBoundingClientRect();A(M.left-H.left);const q=236,B=window.innerHeight-M.bottom;E(B<q?"topLeft":"bottomLeft")},[e]);y.useLayoutEffect(()=>{f&&L()},[f,L]);const O=y.useMemo(()=>({offset:[N,g==="bottomLeft"?4:-4],overflow:{adjustX:!1,adjustY:!1}}),[N,g]),S=y.useCallback(()=>{document.dispatchEvent(new CustomEvent("rte-report-dropdown-opening",{detail:v})),h(!0)},[v]);y.useEffect(()=>{c!==void 0&&S()},[c,S]),y.useEffect(()=>{const k=R=>{R.detail!==v&&h(!1)};return document.addEventListener("rte-report-dropdown-opening",k),()=>document.removeEventListener("rte-report-dropdown-opening",k)},[v]),y.useEffect(()=>{if(!f)return;const k=R=>{const M=e.current,H=R.target;if(M?.contains(H))return;const q=document.querySelectorAll(".rte-report-dropdown-overlay");for(let B=0;B<q.length;B++)if(q[B].contains(H))return;h(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f,e]);const _=y.useCallback(k=>{h(!1),r(k)},[r]),I=f?b.jsx(uC,{nodeKey:t,nodeType:n,fetch:l,onSelect:_,onGoGenerate:a,onViewReport:i,hideCurrentSessionReport:s,preciseMatchKey:o,open:f}):null;return b.jsx(ue.Popover,{content:I,trigger:[],open:f,placement:g,align:O,autoAdjustOverflow:!1,getPopupContainer:()=>d??document.body,overlayClassName:"rte-report-dropdown-overlay",arrow:!1,children:b.jsx("span",{ref:m,className:["rte-report-dropdown-host",u?"rte-report-dropdown-host-quiet":""].filter(Boolean).join(" "),"data-key":t,"data-node-type":n,contentEditable:!1,onClick:k=>{k.stopPropagation(),f?h(!1):S()},children:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang rte-report-dropdown-icon","aria-label":"选择报告"})})})},cC={display:"inline-block",border:0,background:"transparent",outline:"none",padding:0,margin:0,font:"inherit",color:"inherit",boxSizing:"border-box",verticalAlign:"middle"},dC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Df=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,reportNames:u,onResolveName:c,onClearReport:d,onShiftReportNames:f})=>{const h=e.maxCount??9,m=e.minCount??1,v=dC(e.tooltip),g=!1,E=!!v,N=y.useMemo(()=>t??[],[t]),A=y.useMemo(()=>{const _=N.filter(R=>R&&R.trim().length>0),I=Math.max(m,Math.min(_.length+1,h)),k=Math.min(Math.max(N.length,I),h);return Array.from({length:k},(R,M)=>N[M]??"")},[N,m,h]),L=y.useCallback((_,I)=>{const k=[...A];if(k[_]=I,I.trim()===""){const R=k.reduce((M,H,q)=>H&&H.trim()?q:M,-1);_<R&&k.splice(_,1),k.length=R+1,f?.(e.key,_)}n(e.key,k)},[A,e.key,n,f]),O=y.useCallback((_,I)=>{const k=[...A];I.forEach((M,H)=>{const q=_+H;q<h&&(k[q]=M)});const R=k.reduce((M,H,q)=>H&&H.trim()?q:M,-1);k.length=R+1,n(e.key,k)},[A,h,e.key,n]),S=y.useCallback((_,I)=>{const k=[...A];k[_]=I.url,n(e.key,k)},[A,e.key,n]);return y.useCallback(_=>{L(_,"")},[L]),b.jsx(gn,{node:e,children:b.jsx("span",{className:`rte-multi-variable ${r?"rte-multi-variable-error":""}`,children:A.map((_,I)=>(`${e.key}${I}`,b.jsx(Lf,{nodeKey:e.key,idx:I,row:_,placeholder:e.placeholder,disabled:l,tooltip:v,onUpdate:k=>L(I,k),onBatchUpdate:k=>O(I,k),showDropdown:g,showInfoIcon:E,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,onSelectReport:k=>S(I,k),nodeType:"multi-variable",reportName:void 0,onResolveName:void 0,onClearName:void 0},I)))})})});Df.displayName="MultiVariableNode";const Lf=({nodeKey:e,idx:t,row:n,placeholder:l,disabled:r,tooltip:a,onUpdate:i,onBatchUpdate:s,showDropdown:o,showInfoIcon:u,reportListFetch:c,onReportGoGenerate:d,onViewReport:f,hideCurrentSessionReport:h,onSelectReport:m,nodeType:v,reportName:g,onResolveName:E,onClearName:N})=>{const A=y.useRef(null),L=`${e}_${t}`,O=!!g,S=!(n||"").trim(),_=u&&S,I=o||_||O,k=y.useRef(""),R=y.useCallback(async C=>{if(!E)return;const Z=(C||"").trim();/^https?:\/\//i.test(Z)&&k.current!==Z&&(k.current=Z,await E(Z))},[E]),M=y.useCallback(()=>{R(n)},[R,n]),H=y.useCallback(C=>{const Z=C.clipboardData.getData("text/plain"),ie=Z.trim();if(E&&/^https?:\/\//i.test(ie)){C.preventDefault(),i(ie),document.dispatchEvent(new CustomEvent("rte-report-dropdown-opening",{detail:null})),R(ie);return}if(s&&/[\n\s]/.test(Z)){C.preventDefault();const D=Z.split(/[\n\s]+/).filter(pe=>pe.trim().length>0);D.length>1?s(D):D.length===1&&i(D[0]);return}},[E,i,s,R]);y.useLayoutEffect(()=>{(n||"").trim()||(k.current="")},[n]);const q=y.useRef(null),B=n||l||"",[T,F]=y.useState(0),V=y.useCallback(()=>{q.current&&F(q.current.offsetWidth)},[]);y.useLayoutEffect(()=>{V();const C=document.fonts;C?.ready&&C.ready.then(V)},[B,V]);const $=T>0?Math.max(40,T+2):40,X=["variable-chip",O?"rte-report-name-chip":"",I?"rte-variable-with-icon":""].filter(Boolean).join(" ");return b.jsxs("span",{ref:A,className:X,"data-type":v==="multi-variable-select"?"multi-variable-select":"variable","data-key":L,"data-multi-key":e,"data-index":t,"data-report-url":O?n||!0:void 0,"data-report-name":g||void 0,...a&&!O&&S?{"data-tooltip":a,"data-variable-key":e}:{},children:[b.jsx("span",{ref:q,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"pre",font:"inherit",pointerEvents:"none",top:0,left:0},children:B}),O?b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"rte-report-name-chip-label",onClick:()=>{if(!o)return;A.current?.querySelector(".rte-report-dropdown-host")?.click()},children:g}),o&&c&&b.jsx(Mf,{chipRef:A,nodeKey:L,nodeType:v,fetch:c,onSelect:m,onGoGenerate:d,onViewReport:f,hideCurrentSessionReport:h,quiet:!0}),N&&b.jsx("span",{className:"rte-report-chip-clear-host",onMouseDown:C=>{C.preventDefault(),C.stopPropagation(),N()},children:b.jsx("span",{className:"rte-report-chip-clear-icon",title:"清除",children:b.jsx(Ut.CloseCircleFilled,{})})})]}):b.jsx("input",{"data-type":v==="multi-variable-select"?"multi-variable-select":"variable","data-key":L,value:n,onChange:C=>i(C.target.value),onBlur:M,onPaste:H,onClick:()=>{if(!o||n.trim())return;A.current?.querySelector(".rte-report-dropdown-host")?.click()},onScroll:C=>{const Z=C.currentTarget;document.activeElement!==Z&&Z.scrollLeft!==0&&(Z.scrollLeft=0)},disabled:r,placeholder:l,style:{...cC,width:$}}),!O&&o&&c&&b.jsx(Mf,{chipRef:A,nodeKey:L,nodeType:v,fetch:c,onSelect:m,onGoGenerate:d,onViewReport:f,hideCurrentSessionReport:h}),!O&&_&&b.jsx(Ol,{tooltip:a,className:"variable-info-icon",dataVariableKey:e})]})},fC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Pf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,reportNames:u,onResolveName:c,onClearReport:d,onShiftReportNames:f,onAnalyzeReport:h})=>{const m=e.maxCount??9,v=e.minCount??1,g=fC(e.tooltip),E=!!a&&!!g,N=!E&&!!g,A=y.useMemo(()=>{const I=t??[],k=I.reduce((R,M,H)=>M&&M.trim()?H:R,-1);return I.slice(0,k+1)},[t]),L=y.useMemo(()=>{const I=A.filter(M=>M&&M.trim().length>0),k=Math.max(v,Math.min(I.length+1,m)),R=Math.min(Math.max(A.length,k),m);return Array.from({length:R},(M,H)=>A[H]??"")},[A,v,m]),O=y.useCallback((I,k)=>{const R=[...L];if(R[I]=k,k.trim()===""){const M=R.reduce((H,q,B)=>q&&q.trim()?B:H,-1);I<M&&R.splice(I,1),R.length=M+1,f?.(e.key,I)}n(e.key,R)},[L,e.key,n,f]),S=y.useCallback((I,k)=>{const R=[...L];R[I]=k.url,n(e.key,R),h?.(`${e.key}_${I}`,k.url),c&&/^https?:\/\//i.test(k.url)&&c(`${e.key}_${I}`,k.url,"multi-variable-select")},[L,e.key,n,h,c]),_=y.useCallback(I=>{O(I,"")},[O]);return b.jsx(gn,{node:e,children:b.jsx("span",{className:`rte-multi-variable-select ${r?"rte-multi-variable-select-error":""}`,children:L.map((I,k)=>{const R=`${e.key}_${k}`;return b.jsx(Lf,{nodeKey:e.key,idx:k,row:I,placeholder:e.placeholder,disabled:l,tooltip:g,onUpdate:M=>O(k,M),showDropdown:E,showInfoIcon:N,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,onSelectReport:M=>S(k,M),nodeType:"multi-variable-select",reportName:u?.[R],onResolveName:c?M=>c(R,M,"multi-variable-select"):void 0,onClearName:d?()=>_(k):void 0},k)})})})});Pf.displayName="MultiVariableSelectNode";function Bf(e){const t=y.useMemo(()=>e==null?"":typeof e=="string"?e:typeof URL>"u"||typeof URL.createObjectURL!="function"?"":URL.createObjectURL(e),[e]);return y.useEffect(()=>{if(t&&!(typeof e!="object"||e===null))return()=>{typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&URL.revokeObjectURL(t)}},[e,t]),t}const hC=/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i,pC=e=>hC.test(e),bC=e=>/^image\//i.test(e.type),Na=y.memo(({slotKey:e,file:t,text:n,accept:l,tooltip:r,disabled:a,multiple:i,batch:s,exclusionGroup:o,onPick:u,onReplace:c,onRemove:d})=>{const f=y.useRef(null),h=y.useRef(null),m=_l(),[v,g]=y.useState(!1),E=t!=null,N=Bf(t),[A,L]=y.useState(!1),O=y.useCallback(()=>{a||f.current?.click()},[a]),S=y.useCallback($=>{const X=$.target.files;X&&X.length>0&&u(e,X),$.target.value=""},[u,e]),_=y.useCallback(()=>{a||h.current?.click()},[a]),I=y.useCallback($=>{const X=$.target.files;X&&X.length>0&&c(e,X),$.target.value=""},[c,e]),k=y.useCallback(()=>{a||g(!0)},[a]),R=y.useCallback($=>{$.stopPropagation(),!a&&d(e)},[d,e,a]),M=E?typeof t=="string"?decodeURIComponent(t.split("/").pop()?.split("?")[0]||"file"):t.name:null,H=(E?M:n)??"",q=E&&(typeof t=="string"&&pC(t)||typeof t=="object"&&t!==null&&bC(t)),B=q?b.jsx("img",{className:"upload-icon-img upload-icon-preview",src:N,alt:"preview"}):E?b.jsx("i",{className:"iconfont icon-exlwenjian"}):b.jsx("i",{className:"iconfont icon-shangchuan1"}),T=b.jsx("span",{className:"upload-label","data-file-name":H,children:H}),F=b.jsxs("span",{className:`upload-inner-wrapper${E?" has-file":""}`,children:[b.jsx("span",{className:"upload-icon",children:B}),E&&H&&!q?b.jsx($n,{title:H,align:{offset:[0,-8]},mouseLeaveDelay:0,children:T}):T,r&&b.jsx("i",{style:{fontWeight:100},className:`iconfont icon-tishi upload-info-icon${E?" hidden":""}`,"data-upload-key":e,"data-tooltip":r,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),onClick:$=>{$.stopPropagation(),$.preventDefault()}}),b.jsx("span",{className:`file-remove-btn${E?"":" hidden"}`,title:"移除文件",onClick:E?R:void 0,children:"×"})]});if(E){if(q){const $=b.jsxs("span",{className:`upload-chip${s?" upload-chip-batch":""}`,"data-type":"upload","data-key":e,"data-group":o,"data-tooltip":r||void 0,onClick:k,children:[F,b.jsx(ue.Image,{style:{display:"none"},src:N,preview:{visible:v,onVisibleChange:X=>g(X),getContainer:()=>q3(m)}})]});return b.jsx(ue.Tooltip,{getPopupContainer:xr,title:b.jsx("div",{className:"se-upload-preview",children:b.jsx("img",{className:"se-upload-preview-img",src:N,alt:"preview"})}),placement:"top",align:{offset:[0,-10]},arrow:!1,overlayInnerStyle:{background:"#fff",padding:0,borderRadius:4,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},children:$})}return b.jsxs("span",{className:`upload-chip${s?" upload-chip-batch":""}`,"data-type":"upload","data-key":e,"data-group":o,"data-tooltip":r||void 0,onClick:_,children:[F,b.jsx("input",{ref:h,type:"file",accept:l,multiple:!1,style:{display:"none"},onChange:I})]})}const V=b.jsxs("button",{type:"button",className:`upload-chip${s?" upload-chip-batch":""}`,"data-type":"upload","data-key":e,"data-group":o,"data-tooltip":r||void 0,onClick:O,disabled:a,children:[F,b.jsx("input",{ref:f,type:"file",accept:l,multiple:i,style:{display:"none"},onChange:S})]});return r?b.jsx($n,{title:r,open:A,trigger:[],children:V}):V});Na.displayName="UploadChip";const mC=10*1024*1024,gC=e=>e.size>mC,vC="文件大小不能超过 10MB",yC=1e3;let Rf=0;const EC=(e=Date.now())=>e-Rf<yC?!1:(Rf=e,!0),TC=32,CC=e=>{const[t,n]=y.useState(!1);return y.useLayoutEffect(()=>{const l=e.current;if(!l)return;const r=()=>n(l.offsetHeight>TC);if(r(),typeof ResizeObserver>"u")return;const a=new ResizeObserver(r);return a.observe(l),()=>a.disconnect()}),t},SC=e=>{if(e.accept)return e.accept;if(e.acceptType==="image")return"image/*";if(e.acceptType==="file")return".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json"},xC=e=>{if(e)return typeof e=="string"?e:JSON.stringify(e)},kC=12,Ff=y.memo(({node:e,files:t,onFileChange:n,disabled:l,error:r,onValidationError:a})=>{const{message:i}=ue.App.useApp(),s=typeof e.maxCount=="number"&&typeof e.minCount=="number"&&e.maxCount>1,o=SC(e),u=y.useRef(null),c=CC(u),d=Sr(e.tooltip),f=!!d,h=f?void 0:xC(e.tooltip),m=y.useCallback(M=>{a?a(M):i.error(M)},[a,i]),v=y.useCallback(M=>{const H=Array.from(M),q=[];let B=0;for(const T of H)gC(T)?B+=1:q.push(T);return B>0&&EC()&&m(vC),q},[m]),g=y.useCallback((M,H)=>{const q=v(H);q.length!==0&&n(M,q[0])},[n,v]),E=y.useCallback((M,H)=>{const q=v(H);if(q.length===0)return;const B=e.key,T=e.maxCount??0,F=(()=>{const $=M.match(/-(\d+)$/);return $?Number.parseInt($[1],10):0})();let V=Math.max(0,Math.min(F,T-1));for(const $ of q){for(;V<T&&t[`${B}-${V}`]!=null;)V+=1;if(V>=T)break;n(`${B}-${V}`,$),V+=1}},[t,e.key,e.maxCount,n,v]),N=y.useCallback(M=>{if(!s){n(M,null);return}const H=e.key,q=e.maxCount??0,B=[];for(let T=0;T<q;T+=1){const F=`${H}-${T}`;if(F===M)continue;const V=t[F];V!=null&&B.push(V)}for(let T=0;T<q;T+=1)n(`${H}-${T}`,T<B.length?B[T]:null)},[s,t,e.key,e.maxCount,n]),{filledEntries:A,emptyKeys:L}=y.useMemo(()=>{if(!s)return{filledEntries:[],emptyKeys:[]};const M=e.key,H=[],q=[];for(let B=0;B<(e.maxCount??0);B+=1){const T=`${M}-${B}`,F=t[T];F!=null?H.push({key:T,file:F}):q.push(T)}return{filledEntries:H,emptyKeys:q}},[t,s,e.key,e.maxCount]),O=A.length;if(!s){const M=e.key,H=t[M]??null,q=H!=null,B=(e.text||"").trim(),T=q&&e.showHint===!0&&B.length>=kC,F=b.jsx(Na,{slotKey:M,file:H,text:e.text,accept:o,tooltip:h,disabled:l,exclusionGroup:e.exclusionGroup,onPick:g,onReplace:g,onRemove:N}),V=T?b.jsx("span",{className:"exclusion-wrapper upload-hint","data-group":e.exclusionGroup,children:B}):null,$=f&&d?b.jsx(Qn,{data:d,hidden:q}):null;return e.required?b.jsxs("span",{className:r?"rte-upload-error":void 0,children:[b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),F]}),$,V]}):b.jsxs("span",{className:r?"rte-upload-error":void 0,children:[F,$,V]})}const S=e.minCount??1,_=e.maxCount??0,I=Math.min(_,Math.max(S,O+(O<_?1:0))),k=[];for(const{key:M,file:H}of A)k.push(b.jsx(Na,{slotKey:M,file:H,text:e.text,accept:o,tooltip:h,disabled:l,batch:!0,multiple:!0,exclusionGroup:e.exclusionGroup,onPick:E,onReplace:g,onRemove:N},M));const R=Math.max(0,I-O);for(const M of L.slice(0,R))k.push(b.jsx(Na,{slotKey:M,file:null,text:e.text,accept:o,tooltip:h,disabled:l,batch:!0,multiple:!0,exclusionGroup:e.exclusionGroup,onPick:E,onReplace:g,onRemove:N},M));return e.required?b.jsxs("span",{className:`exclusion-wrapper required-upload-group rte-required-upload-batch${c?" rte-batch-wrapped":""}${r?" rte-upload-error":""}`,"data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),b.jsx("span",{className:"rte-upload-batch-chips",ref:u,children:k}),f&&d?b.jsx(Qn,{data:d,hidden:O>0}):null]}):b.jsxs("span",{className:`rte-upload-batch-chips${c?" rte-batch-wrapped":""}${r?" rte-upload-error":""}`,ref:u,children:[k,f&&d?b.jsx(Qn,{data:d,hidden:O>0}):null]})});Ff.displayName="UploadNode";const Hf=2*Math.PI*6.5,Uf="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'%3E%3Crect fill='%23999' width='1' height='1'/%3E%3C/svg%3E",zf=e=>{const t=e.trim();try{const l=new URL(t);if(l.protocol==="http:"||l.protocol==="https:")return t}catch{}const n=t.match(/https?:\/\/[^\s一-鿿 -〿＀-￯]+/);return n?n[0]:t},AC=e=>new Promise((t,n)=>{const l=document.createElement("video"),r=URL.createObjectURL(e);l.preload="auto",l.muted=!0,l.src=r,l.onloadeddata=()=>{l.currentTime=0},l.onseeked=()=>{try{const a=document.createElement("canvas");a.width=l.videoWidth,a.height=l.videoHeight;const i=a.getContext("2d");if(!i){URL.revokeObjectURL(r),n(new Error("canvas context unavailable"));return}i.drawImage(l,0,0,a.width,a.height);const s=a.toDataURL("image/jpeg",.7);URL.revokeObjectURL(r),t(s)}catch(a){URL.revokeObjectURL(r),n(a)}},l.onerror=()=>{URL.revokeObjectURL(r),n(new Error("video load error"))}}),NC=e=>new Promise(t=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.preload="auto",n.muted=!0,n.playsInline=!0,n.src=e;const l=window.setTimeout(()=>{r(),t("")},1e4),r=()=>{window.clearTimeout(l),n.onloadeddata=null,n.onseeked=null,n.onerror=null};n.onloadeddata=()=>{n.currentTime=0},n.onseeked=()=>{try{const a=document.createElement("canvas");a.width=n.videoWidth||320,a.height=n.videoHeight||180;const i=a.getContext("2d");if(i){i.drawImage(n,0,0,a.width,a.height);const s=a.toDataURL("image/jpeg",.7);r(),t(s)}else r(),t("")}catch{r(),t("")}},n.onerror=()=>{r(),t("")}}),Vf=()=>b.jsxs("svg",{className:"video-play-icon",viewBox:"0 0 16 16",width:"16",height:"16",children:[b.jsx("circle",{cx:"8",cy:"8",r:"8",fill:"rgba(0,0,0,0.5)"}),b.jsx("polygon",{points:"6.5,4.5 6.5,11.5 12,8",fill:"#fff"})]}),$f=({percent:e})=>{const t=Math.min(Math.max(e,0),100),n=Hf*(1-t/100);return b.jsxs("svg",{className:"video-upload-progress-ring",viewBox:"0 0 16 16",width:"16",height:"16",children:[b.jsx("circle",{cx:"8",cy:"8",r:"6.5",fill:"none",stroke:"rgba(255,255,255,0.5)",strokeWidth:"1.5"}),b.jsx("circle",{cx:"8",cy:"8",r:"6.5",fill:"none",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:Hf,strokeDashoffset:n,transform:"rotate(-90 8 8)"})]})},wC={background:"#fff",padding:0,borderRadius:8,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},qf=({videoUrl:e,children:t})=>b.jsx(ue.Tooltip,{title:b.jsx("div",{className:"rte-video-preview",children:b.jsx("video",{src:e,autoPlay:!0,loop:!0,muted:!0,playsInline:!0})}),placement:"top",arrow:!1,overlayInnerStyle:wC,children:t}),IC={display:"inline-block",border:0,background:"transparent",outline:"none",padding:0,margin:0,font:"inherit",color:"inherit",minWidth:40,boxSizing:"border-box",verticalAlign:"middle"},_C=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Wf=y.memo(({node:e,value:t,thumbnail:n,onChange:l,onThumbnailChange:r,videoUrlParse:a,onParsingChange:i,disabled:s,error:o})=>{const[u,c]=y.useState("idle"),{message:d}=ue.App.useApp(),[f,h]=y.useState(0),[m,v]=y.useState(""),g=y.useRef(null),E=y.useRef(0),N=y.useRef(null),A=t||e.placeholder||"",[L,O]=y.useState(0),S=y.useCallback(()=>{N.current&&O(N.current.offsetWidth)},[]);y.useLayoutEffect(()=>{S();const C=N.current;if(!C||typeof ResizeObserver>"u")return;const Z=new ResizeObserver(()=>S());return Z.observe(C),()=>Z.disconnect()},[A,S]);const _=L>0?Math.max(40,L+2):40,I=Sr(e.tooltip),k=!!I,R=k?"":_C(e.tooltip),M=!!(t||n),H=y.useCallback(()=>{g.current&&(window.clearInterval(g.current),g.current=null)},[]),q=y.useCallback(()=>{H();let C=0;g.current=window.setInterval(()=>{C=Math.min(C+Math.random()*15+5,90),h(C)},400)},[H]);y.useEffect(()=>()=>H(),[H]);const B=y.useCallback(async C=>{if(!a)return;const Z=C.trim();if(!Z)return;const ie=zf(Z),D=E.current+=1;c("loading"),h(0),v(ie),q(),i?.(e.key,!0);try{const pe=await a({url:ie});if(H(),l(e.key,pe.videoUrl),r?.(e.key,pe.thumbnail||""),c("success"),!pe.thumbnail&&pe.videoUrl){const Se=`/api/download-report-pdf?url=${encodeURIComponent(pe.videoUrl)}`,ke=await NC(Se);ke&&E.current===D&&r?.(e.key,ke)}}catch(pe){H(),E.current+=1,l(e.key,""),r?.(e.key,""),v(""),c("idle"),d.error(pe instanceof Error?pe.message:"视频解析失败,请检查链接是否正确")}finally{i?.(e.key,!1)}},[a,e.key,l,r,i,q,H,d]),T=y.useCallback(()=>{if(u==="loading"||u==="success"||n)return;const C=t??"";C.trim()&&B(C)},[u,n,t,B]),F=y.useCallback(C=>{if(!a)return;const Z=C.clipboardData?.getData("text")??"";if(!Z.trim())return;C.preventDefault();const ie=zf(Z);l(e.key,ie),B(ie)},[a,e.key,l,B]),V=y.useCallback(C=>{C.stopPropagation(),E.current+=1,l(e.key,""),r?.(e.key,""),v(""),c("idle")},[e.key,l,r]),$=C=>{const Z=k&&I?b.jsx(Qn,{data:I,hidden:M}):null;return e.required?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),C]}),Z]}):Z?b.jsxs(b.Fragment,{children:[C,Z]}):C},X=t??"";if((u==="success"||n)&&X){const C=m||t||"",Z=b.jsx("span",{className:`video-chip ${o?"rte-video-error":""}`,"data-type":"video-url","data-key":e.key,"data-tooltip":R||void 0,"data-group":e.exclusionGroup,children:b.jsxs("span",{className:"video-inner-wrapper video-url-inner has-video",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[n?b.jsx("img",{src:n,className:"video-thumbnail rte-video-thumb",alt:"thumbnail"}):b.jsx("span",{className:"video-thumbnail video-thumbnail-placeholder",children:b.jsx("i",{className:"iconfont icon-shipin",style:{fontSize:20,color:"#8c8c8c"}})}),b.jsx(Vf,{})]}),b.jsx("span",{className:"video-label","data-file-name":C,children:C}),b.jsx("span",{className:"video-remove-btn rte-video-remove",title:"移除视频",onClick:V,children:"×"})]})});return $(b.jsx(qf,{videoUrl:X,children:Z}))}return $(u==="loading"?b.jsx("span",{className:`video-chip ${o?"rte-video-error":""}`,"data-type":"video-url","data-key":e.key,"data-tooltip":R||void 0,"data-group":e.exclusionGroup,children:b.jsxs("span",{className:"video-inner-wrapper video-upload-inner video-uploading",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[b.jsx("img",{className:"video-thumbnail",src:Uf,alt:"thumbnail"}),b.jsx("span",{className:"video-thumbnail-overlay"}),b.jsx($f,{percent:f})]}),b.jsx("span",{className:"video-label",children:"解析中..."})]})}):b.jsxs("span",{className:["variable-chip","rte-video-url",t?"":"show-placeholder",R?"rte-variable-with-icon":"",o?"rte-video-error":""].filter(Boolean).join(" "),"data-type":"video-url","data-key":e.key,"data-tooltip":R||void 0,"data-group":e.exclusionGroup,children:[b.jsx("span",{ref:N,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"pre",font:"inherit",pointerEvents:"none",top:0,left:0},children:A}),b.jsx("input",{"data-type":"video-url","data-key":e.key,value:t??"",onChange:C=>l(e.key,C.target.value),onBlur:T,onPaste:F,disabled:s,placeholder:e.placeholder??"请粘贴想要分析的抖音视频链接",style:{...IC,width:_}}),R&&b.jsx(Ol,{tooltip:R,className:"variable-info-icon",dataVariableKey:e.key})]}))});Wf.displayName="VideoUrlNode";const OC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",MC=1024*1024*1024,DC="视频文件不能超过1GB",Yf=y.memo(({node:e,value:t,thumbnail:n,onChange:l,onThumbnailChange:r,onFileChange:a,videoUpload:i,onParsingChange:s,disabled:o,error:u})=>{const{message:c}=ue.App.useApp(),d=y.useRef(null),[f,h]=y.useState("idle"),[m,v]=y.useState(0),[g,E]=y.useState(""),[N,A]=y.useState(""),[L,O]=y.useState(""),S=Sr(e.tooltip),_=!!S,I=_?"":OC(e.tooltip),k=!!t&&!!n,R=f==="loading",M=y.useCallback(()=>{o||R||!i||d.current?.click()},[o,R,i]),H=y.useCallback(async T=>{const F=T.target.files?.[0];if(T.target.value="",!F||!i)return;if(F.size>MC){c.warning(DC);return}h("loading"),v(0),A(F.name),O(""),E(""),s?.(e.key,!0);const V=await AC(F).catch(()=>"");V&&E(V);try{const $=await i(F,X=>v(X));l(e.key,$.videoUrl),r?.(e.key,$.thumbnail||V||""),a?.(e.key,F),h("idle"),E("")}catch($){h("error"),O($ instanceof Error?$.message:"上传失败"),E("")}finally{s?.(e.key,!1)}},[i,e.key,l,r,a,s,c]),q=y.useCallback(T=>{T.stopPropagation(),l(e.key,""),r?.(e.key,""),a?.(e.key,null),A(""),h("idle")},[e.key,l,r,a]),B=T=>{const F=_&&S?b.jsx(Qn,{data:S,hidden:k}):null;return e.required?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),T]}),F]}):F?b.jsxs(b.Fragment,{children:[T,F]}):T};if(k){const T=N||"视频文件",F=b.jsxs("span",{className:`video-chip ${u?"rte-video-error":""}`,"data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,children:[b.jsxs("span",{className:"video-inner-wrapper video-upload-inner has-video",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[n?b.jsx("img",{src:n,className:"video-thumbnail rte-video-thumb",alt:"thumbnail"}):b.jsx("span",{className:"video-thumbnail video-thumbnail-placeholder",children:b.jsx("i",{className:"iconfont icon-shipin",style:{fontSize:20,color:"#8c8c8c"}})}),b.jsx(Vf,{})]}),b.jsx("span",{className:"video-label","data-file-name":T,children:T}),b.jsx("span",{className:"video-remove-btn rte-video-remove",title:"移除视频",onClick:q,children:"×"})]}),b.jsx("input",{ref:d,type:"file",accept:"video/*",style:{display:"none"},onChange:H})]});return B(b.jsx(qf,{videoUrl:t,children:F}))}return B(R?b.jsx("span",{className:`video-chip ${u?"rte-video-error":""}`,"data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,children:b.jsxs("span",{className:"video-inner-wrapper video-upload-inner video-uploading",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[b.jsx("img",{className:"video-thumbnail",src:g||Uf,alt:"thumbnail"}),b.jsx("span",{className:"video-thumbnail-overlay"}),b.jsx($f,{percent:m})]}),b.jsx("span",{className:"video-label",children:N||"上传中..."})]})}):f==="error"?b.jsxs("span",{className:"video-chip rte-video-error","data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,children:[b.jsxs("span",{className:"video-inner-wrapper video-upload-inner",children:[b.jsx("span",{className:"video-label",children:L||"上传失败"}),b.jsx("span",{className:"video-remove-btn rte-video-remove",title:"重试",onClick:T=>{T.stopPropagation(),h("idle"),O("")},children:"×"})]}),b.jsx("input",{ref:d,type:"file",accept:"video/*",style:{display:"none"},onChange:H})]}):b.jsxs("button",{type:"button",className:`video-chip ${u?"rte-video-error":""}`,"data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,onClick:M,disabled:o,children:[b.jsxs("span",{className:"video-inner-wrapper video-upload-inner",children:[b.jsx("i",{className:"iconfont icon-shangchuan1",style:{fontSize:16}}),b.jsx("span",{className:"video-label",children:e.text??"请上传想要分析的视频文件"}),I&&b.jsx(Ol,{tooltip:I,className:"upload-info-icon",dataUploadKey:e.key})]}),b.jsx("input",{ref:d,type:"file",accept:"video/*",style:{display:"none"},onChange:H})]}))});Yf.displayName="VideoUploadNode";const LC="https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/website/kongzhuangtai.svg",PC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",BC={display:"inline-block",border:0,background:"transparent",outline:"none",padding:0,margin:0,font:"inherit",color:"inherit"},RC=e=>{let t=0;for(const n of e)t+=/[一-龥＀-￯]/.test(n)?16:9;return t},jf=e=>{if(!e)return"";const t=Rs(e);return t.reportId?`report:${t.reportId}`:`url:${e.trim()}`},FC=({nodeKey:e,fetch:t,onSelect:n,onGoGenerate:l,onViewReport:r,hideCurrentSessionReport:a,preciseMatchKey:i,open:s})=>{const[o,u]=y.useState(!1),[c,d]=y.useState(null),[f,h]=y.useState(""),m=y.useRef(0),v=y.useRef(null);y.useEffect(()=>{if(!s)return;const O=++m.current;u(!0),t({nodeKey:e,nodeType:"report-url"}).then(S=>{if(O!==m.current)return;const _=a?S.tabs.filter(R=>R.key!=="currentConversationReports"):S.tabs,I={...S,tabs:_};d(I);const k=_.find(R=>R.items.length>0);h(k?.key??_[0]?.key??"")}).catch(()=>{O===m.current&&d({tabs:[]})}).finally(()=>{O===m.current&&u(!1)})},[s,t,e,a]);const g=y.useCallback(O=>i?O.filter(S=>jf(S.url)===i):O,[i]);y.useEffect(()=>{if(!s||!i||!c)return;const O=c.tabs.find(S=>g(S.items).length>0);O&&h(S=>S===O.key?S:O.key)},[s,i,c,g]);const E=c?.tabs.find(O=>O.key===f),N=E?g(E.items):[],A=y.useCallback(O=>{const S=O.currentTarget;S.classList.add("is-scrolling"),v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.classList.remove("is-scrolling"),v.current=null},300)},[]),L=y.useCallback((O,S)=>{O.stopPropagation(),r?r(S):window.open(S.viewUrl||S.url,"_blank")},[r]);return b.jsx("div",{className:"rte-report-dropdown-panel",onMouseDown:O=>O.preventDefault(),children:o?b.jsx("div",{className:"rte-report-dropdown-loading",children:b.jsx(ue.Spin,{size:"small"})}):c?b.jsxs(b.Fragment,{children:[c.tabs.length>1&&b.jsx("div",{className:"rte-report-dropdown-tab-outer",children:b.jsx("div",{className:"rte-report-dropdown-tab-inner",children:c.tabs.map(O=>b.jsx("div",{className:`rte-report-dropdown-tab-item${O.key===f?" active":""}`,onClick:()=>h(O.key),children:O.label},O.key))})}),b.jsx("div",{className:"rte-report-dropdown-list",onScroll:A,children:!E||N.length===0?b.jsxs("div",{className:"rte-report-dropdown-empty",children:[b.jsx("img",{className:"rte-report-dropdown-empty-img",src:LC,alt:""}),b.jsxs("div",{className:"rte-report-dropdown-empty-text",children:[b.jsx("span",{className:"rte-report-dropdown-empty-label",children:i?"未找到匹配的报告":"暂无生成的报告"}),l&&E?.agentType!==void 0&&b.jsx("span",{className:"rte-report-dropdown-empty-link",onClick:()=>l(E.agentType),children:"去生成"})]})]}):N.map((O,S)=>b.jsxs("div",{className:"rte-report-dropdown-item",onClick:()=>n(O),children:[b.jsx("span",{className:"rte-report-dropdown-item-name",title:O.name,children:O.name}),b.jsxs("span",{className:"rte-report-dropdown-item-action",onClick:_=>L(_,O),children:[b.jsx("i",{className:"iconfont icon-chakanbaogao"}),"查看报告"]})]},`${O.url}-${S}`))})]}):null})},Kf=y.memo(({node:e,value:t,onChange:n,onParse:l,reportListFetch:r,onReportGoGenerate:a,reportName:i,onClearReport:s,onViewReport:o,hideCurrentSessionReport:u,disabled:c,error:d})=>{const f=_l(),h=PC(e.tooltip),m=t??"",v=!!i,g=!m&&!v,E=!!r,N=E&&!c&&(g||v),A=!E&&!!h&&g,L=N||A,[O,S]=y.useState(!1),[_,I]=y.useState(!1),k=y.useRef({}).current,R=y.useRef(""),M=y.useCallback(async ve=>{const Fe=ve.trim();if(!(!Fe||!l)&&R.current!==Fe){R.current=Fe,S(!0);try{await l(Fe)}finally{S(!1)}}},[l]);y.useEffect(()=>{m||(R.current="")},[m]);const H=y.useCallback(()=>{M(m)},[M,m]),q=y.useCallback(ve=>{if(!e.key)return;const Fe=ve.clipboardData.getData("text/plain");Fe.trim()&&(ve.preventDefault(),n(e.key,Fe),I(!1),M(Fe))},[e.key,n,M]),B=y.useCallback(()=>{document.dispatchEvent(new CustomEvent("rte-report-dropdown-opening",{detail:k})),I(!0)},[k]),T=y.useCallback(ve=>{e.key&&(n(e.key,ve.url),I(!1),/^https?:\/\//i.test(ve.url)&&M(ve.url))},[e.key,n,M]),F=y.useCallback(ve=>{ve.preventDefault(),ve.stopPropagation(),e.key&&n(e.key,""),s?.()},[e.key,n,s]);y.useEffect(()=>{const ve=Fe=>{Fe.detail!==k&&I(!1)};return document.addEventListener("rte-report-dropdown-opening",ve),()=>document.removeEventListener("rte-report-dropdown-opening",ve)},[k]);const V=["variable-chip","rte-report-url",v?"rte-report-name-chip":"",d?"rte-report-url-error":"",L?"rte-variable-with-icon":""].filter(Boolean).join(" "),$=y.useRef(null),X=y.useRef(null),[C,Z]=y.useState("bottomLeft"),ie=y.useCallback(()=>{const ve=X.current;if(!ve)return;const Fe=ve.getBoundingClientRect(),on=236,Qt=window.innerHeight-Fe.bottom;Z(Qt<on?"topLeft":"bottomLeft")},[]);y.useLayoutEffect(()=>{_&&ie()},[_,ie]);const D=y.useMemo(()=>({offset:[0,C==="bottomLeft"?4:-4],overflow:{adjustX:!1,adjustY:!1}}),[C]);y.useEffect(()=>{if(!_)return;const ve=Fe=>{const on=X.current,Qt=Fe.target;if(on?.contains(Qt))return;const Fn=document.querySelectorAll(".rte-report-dropdown-overlay");for(let Hn=0;Hn<Fn.length;Hn++)if(Fn[Hn].contains(Qt))return;I(!1)};return document.addEventListener("mousedown",ve),()=>document.removeEventListener("mousedown",ve)},[_]);const pe=N?b.jsx("span",{ref:$,className:["rte-report-dropdown-host",v?"rte-report-dropdown-host-quiet":""].filter(Boolean).join(" "),"data-key":e.key,"data-node-type":"report-url",contentEditable:!1,onClick:ve=>{ve.stopPropagation(),_?I(!1):B()},children:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang rte-report-dropdown-icon","aria-label":"选择报告"})}):A?b.jsx(Ol,{tooltip:h,className:"variable-info-icon",dataVariableKey:e.key}):null,Se=v?b.jsx("span",{className:"rte-report-chip-clear-host",contentEditable:!1,onMouseDown:F,children:b.jsx("span",{className:"rte-report-chip-clear-icon",title:"清除",children:b.jsx(Ut.CloseCircleFilled,{})})}):null,ke=e.placeholder??"粘贴报告链接",ce=m||ke,Ne=y.useRef(null),[Oe,Ae]=y.useState(0);y.useLayoutEffect(()=>{Ne.current&&Ae(Ne.current.offsetWidth)});const nt=Oe>0?Math.max(60,Oe+2):RC(ce)+6,Ht=y.useMemo(()=>{if(v)return"";const ve=m.trim();return/^https?:\/\//i.test(ve)?jf(ve):""},[m,v]),sn=y.useCallback(ve=>{if(!v||c||!N)return;const Fe=ve.target;Fe.closest(".rte-report-chip-clear-host")||Fe.closest(".rte-report-dropdown-host")||(ve.stopPropagation(),_?I(!1):B())},[v,c,N,_,B]),ze=b.jsxs("span",{ref:X,className:V,"data-type":"report-url","data-key":e.key,"data-placeholder":e.placeholder??"","data-group":e.exclusionGroup,"data-tooltip":h||void 0,"data-report-url":v?m||!0:void 0,"data-report-name":i||void 0,onClick:sn,children:[b.jsx("span",{ref:Ne,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"pre",font:"inherit",pointerEvents:"none",top:0,left:0},children:ce}),v?b.jsx("span",{className:"rte-report-name-chip-label",children:i}):b.jsx("input",{"data-type":"report-url","data-key":e.key,value:m,onChange:ve=>n(e.key,ve.target.value),onBlur:H,onPaste:q,onClick:()=>{if(!N||m.trim())return;X.current?.querySelector(".rte-report-dropdown-host")?.click()},disabled:c||O,placeholder:ke,style:{...BC,width:nt}}),pe,Se]}),Rn=N&&_?b.jsx(FC,{nodeKey:e.key,fetch:r,onSelect:T,onGoGenerate:a,onViewReport:o,hideCurrentSessionReport:u,preciseMatchKey:Ht,open:_}):null;return e.required?b.jsx(b.Fragment,{children:b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),b.jsx(ue.Popover,{content:Rn,trigger:[],open:N&&_,placement:C,align:D,autoAdjustOverflow:!1,getPopupContainer:()=>f??document.body,overlayClassName:"rte-report-dropdown-overlay",arrow:!1,children:ze})]})}):b.jsx(b.Fragment,{children:b.jsx(ue.Popover,{content:Rn,trigger:[],open:N&&_,placement:C,align:D,autoAdjustOverflow:!1,getPopupContainer:()=>f??document.body,overlayClassName:"rte-report-dropdown-overlay",arrow:!1,children:ze})})});Kf.displayName="ReportUrlNode";function HC(e,t){const n=y.memo(({node:l,value:r,onChange:a,disabled:i,error:s})=>{const o=l.moduleIndex??0,u=`${l.key}__module_${o}`,c=y.useRef(null),d=r??l.text??"";y.useLayoutEffect(()=>{const g=c.current;g&&g.innerHTML!==d&&(g.innerHTML=d)},[d]);const f=y.useCallback(g=>a(u,g.currentTarget.innerHTML),[u,a]),h=typeof l.minHeight=="number"?l.minHeight:80,m=typeof l.maxHeight=="number"?l.maxHeight:240,v=Math.max(m,h);return b.jsx("div",{className:`rte-richtext-container rte-${e}-container ${s?`rte-${e}-error`:""}`,"data-key":l.key,children:b.jsx("div",{className:`rte-richtext-wrapper rte-${e}-wrapper`,"data-key":l.key,children:b.jsx("div",{ref:c,className:`rte-richtext rte-${e}`,"data-type":"richtext","data-node-type":e,"data-key":l.key,"data-module-index":o,"data-placeholder":l.placeholder,contentEditable:!i,suppressContentEditableWarning:!0,onInput:f,style:{minHeight:h,maxHeight:v,overflow:"auto"}})})})});return n.displayName=t,n}const Gf={createModuleNode:HC},UC=Gf.createModuleNode("report-module","ReportModuleNode");function Qf(e,t){const n=y.memo(({node:l,value:r,onChange:a,onParse:i,disabled:s,error:o})=>{const u=y.useRef(null),[c,d]=y.useState(!1),f=y.useRef(!0);y.useLayoutEffect(()=>(f.current=!0,()=>{f.current=!1}),[]);const h=r??"";y.useLayoutEffect(()=>{const M=u.current;M&&(h?M.textContent!==h&&(M.textContent=h):M.innerHTML!==""&&(M.innerHTML=""))},[h]);const m=y.useCallback(M=>{l.key&&a(l.key,M.currentTarget.textContent??"")},[l.key,a]),v=y.useCallback(async M=>{const H=M.trim();if(!(!H||!i)){d(!0);try{await i(H)}finally{f.current&&d(!1)}}},[i]),g=y.useCallback(()=>v(h),[v,h]),E=y.useCallback(M=>{if(!i||!l.key)return;const H=M.clipboardData.getData("text/plain");H.trim()&&(M.preventDefault(),u.current&&(u.current.textContent=H),a(l.key,H),v(H))},[i,l.key,a,v]),N=!r,A=["variable-chip",e.chipClass];N&&A.push("show-placeholder"),o&&A.push(e.errorClass);const L=Sr(l.tooltip),O=l.tooltip==null?"":typeof l.tooltip=="string"?l.tooltip:JSON.stringify(l.tooltip),S=!!O&&!vf(O);S&&N&&A.push("rte-variable-with-icon");const _=l.placeholder??e.defaultPlaceholder,I=b.jsx("span",{ref:u,className:A.join(" "),"data-type":e.dataType,"data-key":l.key,"data-placeholder":_,contentEditable:!(s||c),suppressContentEditableWarning:!0,onInput:m,onBlur:g,onPaste:E}),k=S?b.jsxs("span",{className:"rte-markdown-host",children:[I,b.jsx(Ol,{tooltip:O,className:"variable-info-icon",hidden:!N,dataVariableKey:l.key})]}):I,R=b.jsxs(b.Fragment,{children:[k,L?b.jsx(Qn,{data:L,hidden:!N}):null]});return l.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":l.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),R]}):R});return n.displayName=t,n}const zC=Qf({chipClass:"rte-markdown-input",errorClass:"rte-markdown-error",dataType:"markdown",defaultPlaceholder:"粘贴 markdown 文本"},"MarkdownNode"),VC=Qf({chipClass:"rte-markdown-name",errorClass:"rte-markdown-name-error",dataType:"markdown-name",defaultPlaceholder:"输入名称"},"MarkdownNameNode"),$C=Gf.createModuleNode("markdown-module","MarkdownModuleNode");function Je(e){this.content=e}Je.prototype={constructor:Je,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var l=n&&n!=e?this.remove(n):this,r=l.find(e),a=l.content.slice();return r==-1?a.push(n||e,t):(a[r+1]=t,n&&(a[r]=n)),new Je(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Je(n)},addToStart:function(e,t){return new Je([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Je(n)},addBefore:function(e,t,n){var l=this.remove(t),r=l.content.slice(),a=l.find(e);return r.splice(a==-1?r.length:a,0,t,n),new Je(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Je.from(e),e.size?new Je(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Je.from(e),e.size?new Je(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Je.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Je.from=function(e){if(e instanceof Je)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Je(t)};function Xf(e,t,n){for(let l=0;;l++){if(l==e.childCount||l==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(l),a=t.child(l);if(r==a){n+=r.nodeSize;continue}if(!r.sameMarkup(a))return n;if(r.isText&&r.text!=a.text){for(let i=0;r.text[i]==a.text[i];i++)n++;return n}if(r.content.size||a.content.size){let i=Xf(r.content,a.content,n+1);if(i!=null)return i}n+=r.nodeSize}}function Jf(e,t,n,l){for(let r=e.childCount,a=t.childCount;;){if(r==0||a==0)return r==a?null:{a:n,b:l};let i=e.child(--r),s=t.child(--a),o=i.nodeSize;if(i==s){n-=o,l-=o;continue}if(!i.sameMarkup(s))return{a:n,b:l};if(i.isText&&i.text!=s.text){let u=0,c=Math.min(i.text.length,s.text.length);for(;u<c&&i.text[i.text.length-u-1]==s.text[s.text.length-u-1];)u++,n--,l--;return{a:n,b:l}}if(i.content.size||s.content.size){let u=Jf(i.content,s.content,n-1,l-1);if(u)return u}n-=o,l-=o}}class K{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let l=0;l<t.length;l++)this.size+=t[l].nodeSize}nodesBetween(t,n,l,r=0,a){for(let i=0,s=0;s<n;i++){let o=this.content[i],u=s+o.nodeSize;if(u>t&&l(o,r+s,a||null,i)!==!1&&o.content.size){let c=s+1;o.nodesBetween(Math.max(0,t-c),Math.min(o.content.size,n-c),l,r+c)}s=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,l,r){let a="",i=!0;return this.nodesBetween(t,n,(s,o)=>{let u=s.isText?s.text.slice(Math.max(t,o)-o,n-o):s.isLeaf?r?typeof r=="function"?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&l&&(i?i=!1:a+=l),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,l=t.firstChild,r=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(l)&&(r[r.length-1]=n.withText(n.text+l.text),a=1);a<t.content.length;a++)r.push(t.content[a]);return new K(r,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let l=[],r=0;if(n>t)for(let a=0,i=0;i<n;a++){let s=this.content[a],o=i+s.nodeSize;o>t&&((i<t||o>n)&&(s.isText?s=s.cut(Math.max(0,t-i),Math.min(s.text.length,n-i)):s=s.cut(Math.max(0,t-i-1),Math.min(s.content.size,n-i-1))),l.push(s),r+=s.nodeSize),i=o}return new K(l,r)}cutByIndex(t,n){return t==n?K.empty:t==0&&n==this.content.length?this:new K(this.content.slice(t,n))}replaceChild(t,n){let l=this.content[t];if(l==n)return this;let r=this.content.slice(),a=this.size+n.nodeSize-l.nodeSize;return r[t]=n,new K(r,a)}addToStart(t){return new K([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new K(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,l=0;n<this.content.length;n++){let r=this.content[n];t(r,l,n),l+=r.nodeSize}}findDiffStart(t,n=0){return Xf(this,t,n)}findDiffEnd(t,n=this.size,l=t.size){return Jf(this,t,n,l)}findIndex(t){if(t==0)return wa(0,t);if(t==this.size)return wa(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,l=0;;n++){let r=this.child(n),a=l+r.nodeSize;if(a>=t)return a==t?wa(n+1,a):wa(n,l);l=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return K.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return K.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return K.empty;let n,l=0;for(let r=0;r<t.length;r++){let a=t[r];l+=a.nodeSize,r&&a.isText&&t[r-1].sameMarkup(a)?(n||(n=t.slice(0,r)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new K(n||t,l)}static from(t){if(!t)return K.empty;if(t instanceof K)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new K([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}K.empty=new K([],0);const Fs={index:0,offset:0};function wa(e,t){return Fs.index=e,Fs.offset=t,Fs}function Ia(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let l=0;l<e.length;l++)if(!Ia(e[l],t[l]))return!1}else{for(let l in e)if(!(l in t)||!Ia(e[l],t[l]))return!1;for(let l in t)if(!(l in e))return!1}return!0}let Le=class yu{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,l=!1;for(let r=0;r<t.length;r++){let a=t[r];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,r));else{if(a.type.excludes(this.type))return t;!l&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,r)),n.push(this),l=!0),n&&n.push(a)}}return n||(n=t.slice()),l||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ia(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let l=t.marks[n.type];if(!l)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=l.create(n.attrs);return l.checkAttrs(r.attrs),r}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let l=0;l<t.length;l++)if(!t[l].eq(n[l]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return yu.none;if(t instanceof yu)return[t];let n=t.slice();return n.sort((l,r)=>l.type.rank-r.type.rank),n}};Le.none=[];class _a extends Error{}class ae{constructor(t,n,l){this.content=t,this.openStart=n,this.openEnd=l}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let l=eh(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return l&&new ae(l,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(Zf(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let l=n.openStart||0,r=n.openEnd||0;if(typeof l!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(K.fromJSON(t,n.content),l,r)}static maxOpen(t,n=!0){let l=0,r=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)l++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)r++;return new ae(t,l,r)}}ae.empty=new ae(K.empty,0,0);function Zf(e,t,n){let{index:l,offset:r}=e.findIndex(t),a=e.maybeChild(l),{index:i,offset:s}=e.findIndex(n);if(r==t||a.isText){if(s!=n&&!e.child(i).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(l!=i)throw new RangeError("Removing non-flat range");return e.replaceChild(l,a.copy(Zf(a.content,t-r-1,n-r-1)))}function eh(e,t,n,l,r,a){let{index:i,offset:s}=e.findIndex(t),o=e.maybeChild(i);if(s==t||o.isText)return a&&l<=0&&r<=0&&!a.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=eh(o.content,t-s-1,n,i==0?l-1:0,i==e.childCount-1?r-1:0,o);return u&&e.replaceChild(i,o.copy(u))}function qC(e,t,n){if(n.openStart>e.depth)throw new _a("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _a("Inconsistent open depths");return th(e,t,n,0)}function th(e,t,n,l){let r=e.index(l),a=e.node(l);if(r==t.index(l)&&l<e.depth-n.openStart){let i=th(e,t,n,l+1);return a.copy(a.content.replaceChild(r,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==l&&t.depth==l){let i=e.parent,s=i.content;return Jn(i,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:i,end:s}=WC(n,e);return Jn(a,lh(e,i,s,t,l))}else return Jn(a,Oa(e,t,l))}function nh(e,t){if(!t.type.compatibleContent(e.type))throw new _a("Cannot join "+t.type.name+" onto "+e.type.name)}function Hs(e,t,n){let l=e.node(n);return nh(l,t.node(n)),l}function Xn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ar(e,t,n,l){let r=(t||e).node(n),a=0,i=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Xn(e.nodeAfter,l),a++));for(let s=a;s<i;s++)Xn(r.child(s),l);t&&t.depth==n&&t.textOffset&&Xn(t.nodeBefore,l)}function Jn(e,t){return e.type.checkContent(t),e.copy(t)}function lh(e,t,n,l,r){let a=e.depth>r&&Hs(e,t,r+1),i=l.depth>r&&Hs(n,l,r+1),s=[];return Ar(null,e,r,s),a&&i&&t.index(r)==n.index(r)?(nh(a,i),Xn(Jn(a,lh(e,t,n,l,r+1)),s)):(a&&Xn(Jn(a,Oa(e,t,r+1)),s),Ar(t,n,r,s),i&&Xn(Jn(i,Oa(n,l,r+1)),s)),Ar(l,null,r,s),new K(s)}function Oa(e,t,n){let l=[];if(Ar(null,e,n,l),e.depth>n){let r=Hs(e,t,n+1);Xn(Jn(r,Oa(e,t,n+1)),l)}return Ar(t,null,n,l),new K(l)}function WC(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)r=t.node(a).copy(K.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Nr{constructor(t,n,l){this.pos=t,this.path=n,this.parentOffset=l,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let l=this.pos-this.path[this.path.length-1],r=t.child(n);return l?t.child(n).cut(l):r}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let l=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)r+=l.child(a).nodeSize;return r}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Le.none;if(this.textOffset)return t.child(n).marks;let l=t.maybeChild(n-1),r=t.maybeChild(n);if(!l){let s=l;l=r,r=s}let a=l.marks;for(var i=0;i<a.length;i++)a[i].type.spec.inclusive===!1&&(!r||!a[i].isInSet(r.marks))&&(a=a[i--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let l=n.marks,r=t.parent.maybeChild(t.index());for(var a=0;a<l.length;a++)l[a].type.spec.inclusive===!1&&(!r||!l[a].isInSet(r.marks))&&(l=l[a--].removeFromSet(l));return l}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let l=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);l>=0;l--)if(t.pos<=this.end(l)&&(!n||n(this.node(l))))return new Ma(this,t,l);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let l=[],r=0,a=n;for(let i=t;;){let{index:s,offset:o}=i.content.findIndex(a),u=a-o;if(l.push(i,s,r+o),!u||(i=i.child(s),i.isText))break;a=u-1,r+=o+1}return new Nr(n,l,a)}static resolveCached(t,n){let l=rh.get(t);if(l)for(let a=0;a<l.elts.length;a++){let i=l.elts[a];if(i.pos==n)return i}else rh.set(t,l=new YC);let r=l.elts[l.i]=Nr.resolve(t,n);return l.i=(l.i+1)%jC,r}}class YC{constructor(){this.elts=[],this.i=0}}const jC=12,rh=new WeakMap;class Ma{constructor(t,n,l){this.$from=t,this.$to=n,this.depth=l}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 KC=Object.create(null);let vn=class Eu{constructor(t,n,l,r=Le.none){this.type=t,this.attrs=n,this.marks=r,this.content=l||K.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,l,r=0){this.content.nodesBetween(t,n,l,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,l,r){return this.content.textBetween(t,n,l,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,l){return this.type==t&&Ia(this.attrs,n||t.defaultAttrs||KC)&&Le.sameSet(this.marks,l||Le.none)}copy(t=null){return t==this.content?this:new Eu(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Eu(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,l=!1){if(t==n)return ae.empty;let r=this.resolve(t),a=this.resolve(n),i=l?0:r.sharedDepth(n),s=r.start(i),u=r.node(i).content.cut(r.pos-s,a.pos-s);return new ae(u,r.depth-i,a.depth-i)}replace(t,n,l){return qC(this.resolve(t),this.resolve(n),l)}nodeAt(t){for(let n=this;;){let{index:l,offset:r}=n.content.findIndex(t);if(n=n.maybeChild(l),!n)return null;if(r==t||n.isText)return n;t-=r+1}}childAfter(t){let{index:n,offset:l}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:l}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:l}=this.content.findIndex(t);if(l<t)return{node:this.content.child(n),index:n,offset:l};let r=this.content.child(n-1);return{node:r,index:n-1,offset:l-r.nodeSize}}resolve(t){return Nr.resolveCached(this,t)}resolveNoCache(t){return Nr.resolve(this,t)}rangeHasMark(t,n,l){let r=!1;return n>t&&this.nodesBetween(t,n,a=>(l.isInSet(a.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ah(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,l=K.empty,r=0,a=l.childCount){let i=this.contentMatchAt(t).matchFragment(l,r,a),s=i&&i.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let o=r;o<a;o++)if(!this.type.allowsMarks(l.child(o).marks))return!1;return!0}canReplaceWith(t,n,l,r){if(r&&!this.type.allowsMarks(r))return!1;let a=this.contentMatchAt(t).matchType(l),i=a&&a.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Le.none;for(let n=0;n<this.marks.length;n++){let l=this.marks[n];l.type.checkAttrs(l.attrs),t=l.addToSet(t)}if(!Le.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let l;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");l=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,l)}let r=K.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,r,l);return a.type.checkAttrs(a.attrs),a}};vn.prototype.text=void 0;class Da extends vn{constructor(t,n,l,r){if(super(t,n,null,r),!l)throw new RangeError("Empty text nodes are not allowed");this.text=l}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ah(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Da(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Da(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function ah(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Zn{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let l=new GC(t,n);if(l.next==null)return Zn.empty;let r=ih(l);l.next&&l.err("Unexpected trailing text");let a=n6(t6(r));return l6(a,l),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,l=t.childCount){let r=this;for(let a=n;r&&a<l;a++)r=r.matchType(t.child(a).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let l=0;l<t.next.length;l++)if(this.next[n].type==t.next[l].type)return!0;return!1}fillBefore(t,n=!1,l=0){let r=[this];function a(i,s){let o=i.matchFragment(t,l);if(o&&(!n||o.validEnd))return K.from(s.map(u=>u.createAndFill()));for(let u=0;u<i.next.length;u++){let{type:c,next:d}=i.next[u];if(!(c.isText||c.hasRequiredAttrs())&&r.indexOf(d)==-1){r.push(d);let f=a(d,s.concat(c));if(f)return f}}return null}return a(this,[])}findWrapping(t){for(let l=0;l<this.wrapCache.length;l+=2)if(this.wrapCache[l]==t)return this.wrapCache[l+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),l=[{match:this,type:null,via:null}];for(;l.length;){let r=l.shift(),a=r.match;if(a.matchType(t)){let i=[];for(let s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(let i=0;i<a.next.length;i++){let{type:s,next:o}=a.next[i];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!r.type||o.validEnd)&&(l.push({match:s.contentMatch,type:s,via:r}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(l){t.push(l);for(let r=0;r<l.next.length;r++)t.indexOf(l.next[r].next)==-1&&n(l.next[r].next)}return n(this),t.map((l,r)=>{let a=r+(l.validEnd?"*":" ")+" ";for(let i=0;i<l.next.length;i++)a+=(i?", ":"")+l.next[i].type.name+"->"+t.indexOf(l.next[i].next);return a}).join(`
21
+ `)||F;k?V&&E($=>$||!0):E($=>$===V?$:V)},[i]);y.useLayoutEffect(()=>{v.current!==i?(v.current=i,O(!1)):O(!0)},[O,i,s]),y.useEffect(()=>{const k=h.current;if(!k||typeof ResizeObserver>"u")return;const R=k.closest(".rte-editor");if(!R)return;const M=new ResizeObserver(()=>O(!0));return M.observe(R),()=>M.disconnect()},[O]);const S=(o?i:s)+" ",_=b.jsxs("span",{ref:h,className:"se-variable","data-type":"variable","data-key":e.key,"data-group":e.exclusionGroup,"data-tooltip":a||void 0,"data-variable-key":a?e.key:void 0,"data-error":r?"1":void 0,"data-has-icon":d?"1":void 0,"data-multiline":g?"1":void 0,children:[b.jsx("span",{ref:m,className:"se-variable-mirror","aria-hidden":"true",children:S}),b.jsx("textarea",{cols:1,rows:1,value:i,onChange:A,onKeyDown:L,disabled:l,placeholder:s,"aria-invalid":!!r}),f&&b.jsx(Ol,{tooltip:a,className:"variable-info-icon",hidden:!d,dataVariableKey:e.key})]}),I=c?b.jsxs(b.Fragment,{children:[_,b.jsx(Qn,{data:u,hidden:o})]}):_;return e.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),I]}):I});yf.displayName="VariableNode";const Ef=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=t===void 0&&typeof e.defaultNumber=="number"?String(e.defaultNumber):t??"",i=a!=="",s=y.useCallback(v=>{let g=v.target.value.replace(/[^\d.]/g,"");const E=g.indexOf(".");if(E!==-1){g=g.slice(0,E+1)+g.slice(E+1).replace(/\./g,"");const R=g.indexOf(".");g.length-R-1>2&&(g=g.slice(0,R+3))}const N=g.indexOf("."),A=N!==-1?g.length-N-1:0,L=g.endsWith(".")||N!==-1&&A===1;if(g===""){n(e.key,"");return}if(L){n(e.key,g);return}const O=parseFloat(g);if(!Number.isFinite(O)){n(e.key,"");return}const S=typeof e.min=="number"?e.min:0,_=typeof e.max=="number"?e.max:1/0;if(O===0&&0<S){n(e.key,"");return}const I=Math.min(Math.max(O,S),_),k=A>0?I.toFixed(A):String(I);n(e.key,k)},[e.key,e.min,e.max,n]),o=y.useCallback(v=>{const g=v.key;g==="Backspace"||g==="Delete"||g==="Tab"||g==="ArrowLeft"||g==="ArrowRight"||g==="ArrowUp"||g==="ArrowDown"||g==="Home"||g==="End"||g==="Enter"||v.ctrlKey||v.metaKey||/^[\d.]$/.test(g)||v.preventDefault()},[]),u=y.useRef(null),c=a||e.placeholder||"0",[d,f]=y.useState(0);y.useLayoutEffect(()=>{u.current&&f(u.current.offsetWidth)},[c]);const h=Math.max(24,Math.min(600,d+2)),m=b.jsxs("span",{className:"rte-number-input-wrap","data-placeholder":e.placeholder??"","data-has-value":i?"1":"0","data-group":e.exclusionGroup,children:[b.jsx("span",{ref:u,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",font:"inherit",pointerEvents:"none",top:0,left:0,padding:"0 6px"},children:c}),b.jsx("input",{className:`rte-number-input ${r?"rte-number-error":""}`,"data-type":"number-input","data-key":e.key,type:"text",inputMode:"numeric",value:a,onChange:s,onKeyDown:o,disabled:l,placeholder:e.placeholder,min:e.min,max:e.max,style:{width:h}})]});return e.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),m]}):m});Ef.displayName="NumberInputNode";const gn=({node:e,children:t})=>e.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),t]}):b.jsx(b.Fragment,{children:t});gn.displayName="RequiredMark";const Sa={adjustX:!0,adjustY:!0,shiftY:!1},xr=()=>document.body,Ps={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0},bottomRight:{points:["tr","br"],offset:[0,4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0},topRight:{points:["br","tr"],offset:[0,-4],overflow:Sa,htmlRegion:"visible",dynamicInset:!0}},Tf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=y.useCallback(f=>n(e.key,f),[e.key,n]),i=t??e.defaultValue,s=y.useMemo(()=>{if(i!=null&&i!==""){const f=e.options?.find(h=>String(h.value)===String(i));return String(f?f.label??i:i)}return e.placeholder??"请选择"},[i,e.options,e.placeholder]),[o,u]=y.useState(64),c=y.useRef(null),d=y.useCallback(()=>{const f=c.current;if(!f)return;const h=f.querySelector(".ant-select-selection-item"),m=f.querySelector(".ant-select-selection-placeholder"),v=h||m,g=(v?.textContent||"").trim()||s,E=f.querySelector(".ant-select-selector"),N=v||E||f,A=window.getComputedStyle(N),L=v?A.fontSize:"16px",O=A.fontFamily||"sans-serif",S=A.fontWeight||"400",I=`${A.fontStyle||"normal"} ${S} ${L} ${O}`,R=document.createElement("canvas").getContext("2d"),M=R?Math.ceil((R.font=I,R.measureText(g).width||0)):0;let H=0;if(E){const $=window.getComputedStyle(E);H=(Number.parseFloat($.paddingLeft)||0)+(Number.parseFloat($.paddingRight)||0)}const q=f.querySelector(".ant-select-arrow"),B=q?Math.ceil(q.getBoundingClientRect().width):12,T=f.querySelector(".ant-select-clear");let F=0;if(T){const $=window.getComputedStyle(T);$.display!=="none"&&$.visibility!=="hidden"&&(F=Math.ceil(T.getBoundingClientRect().width))}const V=Math.max(36,M+H+B+F+6);u($=>$===V?$:V)},[s]);return y.useLayoutEffect(()=>{const f=window.requestAnimationFrame(()=>d()),h=window.setTimeout(()=>d(),60);return()=>{window.cancelAnimationFrame(f),window.clearTimeout(h)}},[d]),y.useEffect(()=>{if(!("fonts"in document))return;let f=!1;const h=document.fonts;if(h?.ready)return h.ready.then(()=>{f||d()}),()=>{f=!0}},[d]),b.jsx(gn,{node:e,children:b.jsx("span",{ref:c,className:`rte-select-wrapper${r?" rte-select-error":""}`,"data-type":"select","data-key":e.key,style:{width:o},children:b.jsx(ue.Select,{value:i,options:e.options,onChange:a,disabled:l,placeholder:e.placeholder??"请选择",allowClear:!e.required,size:"small",classNames:{popup:{root:"rte-select-dropdown"}},popupMatchSelectWidth:!1,placement:"bottomLeft",builtinPlacements:Ps,getPopupContainer:xr,suffixIcon:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:10,color:"#7C3AED"}})})})})});Tf.displayName="SelectNode";const Cf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=e.placeholder||"搜索或输入",i=y.useMemo(()=>e.options??[],[e.options]),s=t??e.defaultValue,o=y.useMemo(()=>s?i.some(I=>String(I.value)===String(s))?null:String(s):null,[s,i]),u=y.useMemo(()=>{const I=[...i];return o&&!i.some(k=>String(k.value)===o)&&I.unshift({label:o,value:o}),I},[i,o]),[c,d]=y.useState(""),[f,h]=y.useState(80),m=y.useRef(null),v=y.useMemo(()=>{const I=c.trim();if(!I)return u;const k=I.toLowerCase(),R=u.filter(H=>H.label.toLowerCase().includes(k)||String(H.value).toLowerCase().includes(k));return u.some(H=>H.label===I||String(H.value)===I)?R:[{label:I,value:I,isCustom:!0},...R]},[u,c]),g=y.useCallback(I=>{I!=null&&(d(""),n(e.key,I))},[e.key,n]),E=y.useCallback(I=>d(I),[]),N=y.useCallback(I=>{if(I.key==="Enter"&&c.trim()){I.preventDefault(),I.stopPropagation();const k=c.trim(),R=i.find(M=>M.label===k||String(M.value)===k);d(""),n(e.key,R?String(R.value):k)}},[c,i,e.key,n]),A=y.useCallback(()=>{d(""),n(e.key,"")},[e.key,n]),L=y.useCallback(()=>{if(s!=null&&s!==""){const I=u.find(k=>String(k.value)===String(s));return I?typeof I.label=="string"?I.label:String(I.label??s):String(s)}return a},[s,u,a]),O=y.useCallback(()=>{const I=m.current;if(!I)return;const k=I.querySelector(".ant-select-selection-item"),R=I.querySelector(".ant-select-selection-placeholder"),M=k||R,H=(M?.textContent||"").trim()||L(),q=I.querySelector(".ant-select-selector"),B=M||q||I,T=window.getComputedStyle(B),F=M?T.fontSize:"16px",V=T.fontFamily||"sans-serif",$=T.fontWeight||"400",C=`${T.fontStyle||"normal"} ${$} ${F} ${V}`,ie=document.createElement("canvas").getContext("2d"),D=ie?Math.ceil((ie.font=C,ie.measureText(H).width||0)):0;let pe=0;if(q){const Ae=window.getComputedStyle(q);pe=(Number.parseFloat(Ae.paddingLeft)||0)+(Number.parseFloat(Ae.paddingRight)||0)}const ge=I.querySelector(".ant-select-arrow"),ke=ge?Math.ceil(ge.getBoundingClientRect().width):12,ce=I.querySelector(".ant-select-clear");let Ne=0;if(ce){const Ae=window.getComputedStyle(ce);Ae.display!=="none"&&Ae.visibility!=="hidden"&&(Ne=Math.ceil(ce.getBoundingClientRect().width))}const Oe=Math.min(240,Math.max(80,D+pe+ke+Ne+4));h(Ae=>Ae===Oe?Ae:Oe)},[L]);y.useLayoutEffect(()=>{const I=window.requestAnimationFrame(()=>O()),k=window.setTimeout(()=>O(),60);return()=>{window.cancelAnimationFrame(I),window.clearTimeout(k)}},[O]),y.useEffect(()=>{if(!("fonts"in document))return;let I=!1;const k=document.fonts;if(k?.ready)return k.ready.then(()=>{I||O()}),()=>{I=!0}},[O]);const S=s!=null&&s!=="",_=s||void 0;return b.jsx(gn,{node:e,children:b.jsx("span",{ref:m,className:["rte-searchable-select-host",S?"rte-searchable-has-value":"",r?"rte-searchable-select-error":""].filter(Boolean).join(" "),"data-type":"searchable-select","data-key":e.key,style:{display:"inline-block",width:f},children:b.jsx(ue.Select,{"data-type":"searchable-select","data-key":e.key,showSearch:!0,value:_,searchValue:c,onChange:g,onSearch:E,onClear:A,onInputKeyDown:N,filterOption:!1,options:v,disabled:l,placeholder:a,style:{width:"100%"},allowClear:!e.required,size:"small",variant:"borderless",classNames:{popup:{root:"rte-searchable-select-dropdown"}},popupMatchSelectWidth:!1,placement:"bottomLeft",builtinPlacements:Ps,getPopupContainer:xr,notFoundContent:b.jsx("span",{style:{color:"#999",fontSize:13},children:"暂无数据"}),suffixIcon:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})})})})});Cf.displayName="SearchableSelectNode";function kr(e){"@babel/helpers - typeof";return kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(e)}function j3(e,t){if(kr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var l=n.call(e,t);if(kr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K3(e){var t=j3(e,"string");return kr(t)=="symbol"?t:t+""}function G3(e,t,n){return(t=K3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,l)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sf(Object(n),!0).forEach(function(l){G3(e,l,n[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach(function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(n,l))})}return e}var Q3={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},X3=xf(xf({},Q3),{},{locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1});const J3={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},kf={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},X3),timePickerLocale:Object.assign({},J3)};kf.lang.ok="确定";var xa={exports:{}},Z3=xa.exports,Af;function Nf(){return Af||(Af=1,function(e,t){(function(n,l){e.exports=l()})(Z3,function(){var n=1e3,l=6e4,r=36e5,a="millisecond",i="second",s="minute",o="hour",u="day",c="week",d="month",f="quarter",h="year",m="date",v="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,N={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var T=["th","st","nd","rd"],F=B%100;return"["+B+(T[(F-20)%10]||T[F]||T[0])+"]"}},A=function(B,T,F){var V=String(B);return!V||V.length>=T?B:""+Array(T+1-V.length).join(F)+B},L={s:A,z:function(B){var T=-B.utcOffset(),F=Math.abs(T),V=Math.floor(F/60),$=F%60;return(T<=0?"+":"-")+A(V,2,"0")+":"+A($,2,"0")},m:function B(T,F){if(T.date()<F.date())return-B(F,T);var V=12*(F.year()-T.year())+(F.month()-T.month()),$=T.clone().add(V,d),X=F-$<0,C=T.clone().add(V+(X?-1:1),d);return+(-(V+(F-$)/(X?$-C:C-$))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:d,y:h,w:c,d:u,D:m,h:o,m:s,s:i,ms:a,Q:f}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},O="en",S={};S[O]=N;var _="$isDayjsObject",I=function(B){return B instanceof H||!(!B||!B[_])},k=function B(T,F,V){var $;if(!T)return O;if(typeof T=="string"){var X=T.toLowerCase();S[X]&&($=X),F&&(S[X]=F,$=X);var C=T.split("-");if(!$&&C.length>1)return B(C[0])}else{var Z=T.name;S[Z]=T,$=Z}return!V&&$&&(O=$),$||!V&&O},R=function(B,T){if(I(B))return B.clone();var F=typeof T=="object"?T:{};return F.date=B,F.args=arguments,new H(F)},M=L;M.l=k,M.i=I,M.w=function(B,T){return R(B,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var H=function(){function B(F){this.$L=k(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var T=B.prototype;return T.parse=function(F){this.$d=function(V){var $=V.date,X=V.utc;if($===null)return new Date(NaN);if(M.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var C=$.match(g);if(C){var Z=C[2]-1||0,ie=(C[7]||"0").substring(0,3);return X?new Date(Date.UTC(C[1],Z,C[3]||1,C[4]||0,C[5]||0,C[6]||0,ie)):new Date(C[1],Z,C[3]||1,C[4]||0,C[5]||0,C[6]||0,ie)}}return new Date($)}(F),this.init()},T.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},T.$utils=function(){return M},T.isValid=function(){return this.$d.toString()!==v},T.isSame=function(F,V){var $=R(F);return this.startOf(V)<=$&&$<=this.endOf(V)},T.isAfter=function(F,V){return R(F)<this.startOf(V)},T.isBefore=function(F,V){return this.endOf(V)<R(F)},T.$g=function(F,V,$){return M.u(F)?this[V]:this.set($,F)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(F,V){var $=this,X=!!M.u(V)||V,C=M.p(F),Z=function(Oe,Ae){var nt=M.w($.$u?Date.UTC($.$y,Ae,Oe):new Date($.$y,Ae,Oe),$);return X?nt:nt.endOf(u)},ie=function(Oe,Ae){return M.w($.toDate()[Oe].apply($.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(Ae)),$)},D=this.$W,pe=this.$M,ge=this.$D,ke="set"+(this.$u?"UTC":"");switch(C){case h:return X?Z(1,0):Z(31,11);case d:return X?Z(1,pe):Z(0,pe+1);case c:var ce=this.$locale().weekStart||0,Ne=(D<ce?D+7:D)-ce;return Z(X?ge-Ne:ge+(6-Ne),pe);case u:case m:return ie(ke+"Hours",0);case o:return ie(ke+"Minutes",1);case s:return ie(ke+"Seconds",2);case i:return ie(ke+"Milliseconds",3);default:return this.clone()}},T.endOf=function(F){return this.startOf(F,!1)},T.$set=function(F,V){var $,X=M.p(F),C="set"+(this.$u?"UTC":""),Z=($={},$[u]=C+"Date",$[m]=C+"Date",$[d]=C+"Month",$[h]=C+"FullYear",$[o]=C+"Hours",$[s]=C+"Minutes",$[i]=C+"Seconds",$[a]=C+"Milliseconds",$)[X],ie=X===u?this.$D+(V-this.$W):V;if(X===d||X===h){var D=this.clone().set(m,1);D.$d[Z](ie),D.init(),this.$d=D.set(m,Math.min(this.$D,D.daysInMonth())).$d}else Z&&this.$d[Z](ie);return this.init(),this},T.set=function(F,V){return this.clone().$set(F,V)},T.get=function(F){return this[M.p(F)]()},T.add=function(F,V){var $,X=this;F=Number(F);var C=M.p(V),Z=function(pe){var ge=R(X);return M.w(ge.date(ge.date()+Math.round(pe*F)),X)};if(C===d)return this.set(d,this.$M+F);if(C===h)return this.set(h,this.$y+F);if(C===u)return Z(1);if(C===c)return Z(7);var ie=($={},$[s]=l,$[o]=r,$[i]=n,$)[C]||1,D=this.$d.getTime()+F*ie;return M.w(D,this)},T.subtract=function(F,V){return this.add(-1*F,V)},T.format=function(F){var V=this,$=this.$locale();if(!this.isValid())return $.invalidDate||v;var X=F||"YYYY-MM-DDTHH:mm:ssZ",C=M.z(this),Z=this.$H,ie=this.$m,D=this.$M,pe=$.weekdays,ge=$.months,ke=$.meridiem,ce=function(Ae,nt,Ht,sn){return Ae&&(Ae[nt]||Ae(V,X))||Ht[nt].slice(0,sn)},Ne=function(Ae){return M.s(Z%12||12,Ae,"0")},Oe=ke||function(Ae,nt,Ht){var sn=Ae<12?"AM":"PM";return Ht?sn.toLowerCase():sn};return X.replace(E,function(Ae,nt){return nt||function(Ht){switch(Ht){case"YY":return String(V.$y).slice(-2);case"YYYY":return M.s(V.$y,4,"0");case"M":return D+1;case"MM":return M.s(D+1,2,"0");case"MMM":return ce($.monthsShort,D,ge,3);case"MMMM":return ce(ge,D);case"D":return V.$D;case"DD":return M.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return ce($.weekdaysMin,V.$W,pe,2);case"ddd":return ce($.weekdaysShort,V.$W,pe,3);case"dddd":return pe[V.$W];case"H":return String(Z);case"HH":return M.s(Z,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return Oe(Z,ie,!0);case"A":return Oe(Z,ie,!1);case"m":return String(ie);case"mm":return M.s(ie,2,"0");case"s":return String(V.$s);case"ss":return M.s(V.$s,2,"0");case"SSS":return M.s(V.$ms,3,"0");case"Z":return C}return null}(Ae)||C.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(F,V,$){var X,C=this,Z=M.p(V),ie=R(F),D=(ie.utcOffset()-this.utcOffset())*l,pe=this-ie,ge=function(){return M.m(C,ie)};switch(Z){case h:X=ge()/12;break;case d:X=ge();break;case f:X=ge()/3;break;case c:X=(pe-D)/6048e5;break;case u:X=(pe-D)/864e5;break;case o:X=pe/r;break;case s:X=pe/l;break;case i:X=pe/n;break;default:X=pe}return $?X:M.a(X)},T.daysInMonth=function(){return this.endOf(d).$D},T.$locale=function(){return S[this.$L]},T.locale=function(F,V){if(!F)return this.$L;var $=this.clone(),X=k(F,V,!0);return X&&($.$L=X),$},T.clone=function(){return M.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},B}(),q=H.prototype;return R.prototype=q,[["$ms",a],["$s",i],["$m",s],["$H",o],["$W",u],["$M",d],["$y",h],["$D",m]].forEach(function(B){q[B[1]]=function(T){return this.$g(T,B[0],B[1])}}),R.extend=function(B,T){return B.$i||(B(T,H,R),B.$i=!0),R},R.locale=k,R.isDayjs=I,R.unix=function(B){return R(1e3*B)},R.en=S[O],R.Ls=S,R.p={},R})}(xa)),xa.exports}var eC=Nf();const ka=Mi(eC);var Aa={exports:{}},tC=Aa.exports,wf;function nC(){return wf||(wf=1,function(e,t){(function(n,l){e.exports=l(Nf())})(tC,function(n){function l(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var r=l(n),a={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(i,s){return s==="W"?i+"周":i+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(i,s){var o=100*i+s;return o<600?"凌晨":o<900?"早上":o<1100?"上午":o<1300?"中午":o<1800?"下午":"晚上"}};return r.default.locale(a,null,!0),a})}(Aa)),Aa.exports}nC(),ka.locale("zh-cn");const{RangePicker:lC}=ue.DatePicker,rC=e=>{if(!e)return null;const t=e.split(",");if(t.length!==2||!t[0]||!t[1])return null;const n=ka(t[0]),l=ka(t[1]);return n.isValid()&&l.isValid()?[n,l]:null},If=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=rC(t),[i,s]=y.useState(null),o=y.useCallback(f=>{s(null),f&&f[0]&&f[1]?n(e.key,`${f[0].format("YYYY-MM-DD")},${f[1].format("YYYY-MM-DD")}`):n(e.key,"")},[e.key,n]),u=y.useCallback(f=>s(f),[]),c=y.useCallback(f=>{s(f&&a?[a[0],a[1]]:null)},[a]),d=y.useCallback(f=>f?e.disableFuture&&f.isAfter(ka(),"day")?!0:typeof e.limitRange!="number"||!i||!i[0]?!1:Math.abs(f.diff(i[0],"days"))>e.limitRange:!1,[e.disableFuture,e.limitRange,i]);return b.jsx(gn,{node:e,children:b.jsx("span",{className:`rte-datepicker-host ${r?"rte-datepicker-error":""}`,"data-type":"datepicker","data-key":e.key,children:b.jsx(lC,{"data-type":"datepicker","data-key":e.key,value:a,disabledDate:d,onCalendarChange:u,onChange:o,onOpenChange:c,disabled:l,placeholder:[e.placeholder||"开始日期",e.placeholder||"结束日期"],size:"small",variant:"borderless",allowClear:!0,allowEmpty:[!0,!0],locale:kf,classNames:{popup:{root:"rte-datepicker-dropdown"}}})})})});If.displayName="DatePickerNode";const aC=[{label:"北京市",value:"北京市",children:[{label:"市辖区",value:"市辖区",children:[{label:"东城区",value:"东城区"},{label:"西城区",value:"西城区"},{label:"朝阳区",value:"朝阳区"},{label:"丰台区",value:"丰台区"},{label:"石景山区",value:"石景山区"},{label:"海淀区",value:"海淀区"},{label:"门头沟区",value:"门头沟区"},{label:"房山区",value:"房山区"},{label:"通州区",value:"通州区"},{label:"顺义区",value:"顺义区"},{label:"昌平区",value:"昌平区"},{label:"大兴区",value:"大兴区"},{label:"怀柔区",value:"怀柔区"},{label:"平谷区",value:"平谷区"},{label:"密云区",value:"密云区"},{label:"延庆区",value:"延庆区"}]}]},{label:"天津市",value:"天津市",children:[{label:"市辖区",value:"市辖区",children:[{label:"和平区",value:"和平区"},{label:"河东区",value:"河东区"},{label:"河西区",value:"河西区"},{label:"南开区",value:"南开区"},{label:"河北区",value:"河北区"},{label:"红桥区",value:"红桥区"},{label:"东丽区",value:"东丽区"},{label:"西青区",value:"西青区"},{label:"津南区",value:"津南区"},{label:"北辰区",value:"北辰区"},{label:"武清区",value:"武清区"},{label:"宝坻区",value:"宝坻区"},{label:"滨海新区",value:"滨海新区"},{label:"宁河区",value:"宁河区"},{label:"静海区",value:"静海区"},{label:"蓟州区",value:"蓟州区"}]}]},{label:"河北省",value:"河北省",children:[{label:"石家庄市",value:"石家庄市",children:[{label:"长安区",value:"长安区"},{label:"桥西区",value:"桥西区"},{label:"新华区",value:"新华区"},{label:"井陉矿区",value:"井陉矿区"},{label:"裕华区",value:"裕华区"},{label:"藁城区",value:"藁城区"},{label:"鹿泉区",value:"鹿泉区"},{label:"栾城区",value:"栾城区"},{label:"井陉县",value:"井陉县"},{label:"正定县",value:"正定县"},{label:"行唐县",value:"行唐县"},{label:"灵寿县",value:"灵寿县"},{label:"高邑县",value:"高邑县"},{label:"深泽县",value:"深泽县"},{label:"赞皇县",value:"赞皇县"},{label:"无极县",value:"无极县"},{label:"平山县",value:"平山县"},{label:"元氏县",value:"元氏县"},{label:"赵县",value:"赵县"},{label:"石家庄高新技术产业开发区",value:"石家庄高新技术产业开发区"},{label:"石家庄循环化工园区",value:"石家庄循环化工园区"},{label:"辛集市",value:"辛集市"},{label:"晋州市",value:"晋州市"},{label:"新乐市",value:"新乐市"}]},{label:"唐山市",value:"唐山市",children:[{label:"路南区",value:"路南区"},{label:"路北区",value:"路北区"},{label:"古冶区",value:"古冶区"},{label:"开平区",value:"开平区"},{label:"丰南区",value:"丰南区"},{label:"丰润区",value:"丰润区"},{label:"曹妃甸区",value:"曹妃甸区"},{label:"滦南县",value:"滦南县"},{label:"乐亭县",value:"乐亭县"},{label:"迁西县",value:"迁西县"},{label:"玉田县",value:"玉田县"},{label:"河北唐山芦台经济开发区",value:"河北唐山芦台经济开发区"},{label:"唐山市汉沽管理区",value:"唐山市汉沽管理区"},{label:"唐山高新技术产业开发区",value:"唐山高新技术产业开发区"},{label:"河北唐山海港经济开发区",value:"河北唐山海港经济开发区"},{label:"遵化市",value:"遵化市"},{label:"迁安市",value:"迁安市"},{label:"滦州市",value:"滦州市"}]},{label:"秦皇岛市",value:"秦皇岛市",children:[{label:"海港区",value:"海港区"},{label:"山海关区",value:"山海关区"},{label:"北戴河区",value:"北戴河区"},{label:"抚宁区",value:"抚宁区"},{label:"青龙满族自治县",value:"青龙满族自治县"},{label:"昌黎县",value:"昌黎县"},{label:"卢龙县",value:"卢龙县"},{label:"秦皇岛市经济技术开发区",value:"秦皇岛市经济技术开发区"},{label:"北戴河新区",value:"北戴河新区"}]},{label:"邯郸市",value:"邯郸市",children:[{label:"邯山区",value:"邯山区"},{label:"丛台区",value:"丛台区"},{label:"复兴区",value:"复兴区"},{label:"峰峰矿区",value:"峰峰矿区"},{label:"肥乡区",value:"肥乡区"},{label:"永年区",value:"永年区"},{label:"临漳县",value:"临漳县"},{label:"成安县",value:"成安县"},{label:"大名县",value:"大名县"},{label:"涉县",value:"涉县"},{label:"磁县",value:"磁县"},{label:"邱县",value:"邱县"},{label:"鸡泽县",value:"鸡泽县"},{label:"广平县",value:"广平县"},{label:"馆陶县",value:"馆陶县"},{label:"魏县",value:"魏县"},{label:"曲周县",value:"曲周县"},{label:"邯郸经济技术开发区",value:"邯郸经济技术开发区"},{label:"邯郸冀南新区",value:"邯郸冀南新区"},{label:"武安市",value:"武安市"}]},{label:"邢台市",value:"邢台市",children:[{label:"襄都区",value:"襄都区"},{label:"信都区",value:"信都区"},{label:"任泽区",value:"任泽区"},{label:"南和区",value:"南和区"},{label:"临城县",value:"临城县"},{label:"内丘县",value:"内丘县"},{label:"柏乡县",value:"柏乡县"},{label:"隆尧县",value:"隆尧县"},{label:"宁晋县",value:"宁晋县"},{label:"巨鹿县",value:"巨鹿县"},{label:"新河县",value:"新河县"},{label:"广宗县",value:"广宗县"},{label:"平乡县",value:"平乡县"},{label:"威县",value:"威县"},{label:"清河县",value:"清河县"},{label:"临西县",value:"临西县"},{label:"河北邢台经济开发区",value:"河北邢台经济开发区"},{label:"南宫市",value:"南宫市"},{label:"沙河市",value:"沙河市"}]},{label:"保定市",value:"保定市",children:[{label:"竞秀区",value:"竞秀区"},{label:"莲池区",value:"莲池区"},{label:"满城区",value:"满城区"},{label:"清苑区",value:"清苑区"},{label:"徐水区",value:"徐水区"},{label:"涞水县",value:"涞水县"},{label:"阜平县",value:"阜平县"},{label:"定兴县",value:"定兴县"},{label:"唐县",value:"唐县"},{label:"高阳县",value:"高阳县"},{label:"容城县",value:"容城县"},{label:"涞源县",value:"涞源县"},{label:"望都县",value:"望都县"},{label:"安新县",value:"安新县"},{label:"易县",value:"易县"},{label:"曲阳县",value:"曲阳县"},{label:"蠡县",value:"蠡县"},{label:"顺平县",value:"顺平县"},{label:"博野县",value:"博野县"},{label:"雄县",value:"雄县"},{label:"保定高新技术产业开发区",value:"保定高新技术产业开发区"},{label:"保定白沟新城",value:"保定白沟新城"},{label:"涿州市",value:"涿州市"},{label:"定州市",value:"定州市"},{label:"安国市",value:"安国市"},{label:"高碑店市",value:"高碑店市"}]},{label:"张家口市",value:"张家口市",children:[{label:"桥东区",value:"桥东区"},{label:"桥西区",value:"桥西区"},{label:"宣化区",value:"宣化区"},{label:"下花园区",value:"下花园区"},{label:"万全区",value:"万全区"},{label:"崇礼区",value:"崇礼区"},{label:"张北县",value:"张北县"},{label:"康保县",value:"康保县"},{label:"沽源县",value:"沽源县"},{label:"尚义县",value:"尚义县"},{label:"蔚县",value:"蔚县"},{label:"阳原县",value:"阳原县"},{label:"怀安县",value:"怀安县"},{label:"怀来县",value:"怀来县"},{label:"涿鹿县",value:"涿鹿县"},{label:"赤城县",value:"赤城县"},{label:"张家口经济开发区",value:"张家口经济开发区"},{label:"张家口市察北管理区",value:"张家口市察北管理区"},{label:"张家口市塞北管理区",value:"张家口市塞北管理区"}]},{label:"承德市",value:"承德市",children:[{label:"双桥区",value:"双桥区"},{label:"双滦区",value:"双滦区"},{label:"鹰手营子矿区",value:"鹰手营子矿区"},{label:"承德县",value:"承德县"},{label:"兴隆县",value:"兴隆县"},{label:"滦平县",value:"滦平县"},{label:"隆化县",value:"隆化县"},{label:"丰宁满族自治县",value:"丰宁满族自治县"},{label:"宽城满族自治县",value:"宽城满族自治县"},{label:"围场满族蒙古族自治县",value:"围场满族蒙古族自治县"},{label:"承德高新技术产业开发区",value:"承德高新技术产业开发区"},{label:"平泉市",value:"平泉市"}]},{label:"沧州市",value:"沧州市",children:[{label:"新华区",value:"新华区"},{label:"运河区",value:"运河区"},{label:"沧县",value:"沧县"},{label:"青县",value:"青县"},{label:"东光县",value:"东光县"},{label:"海兴县",value:"海兴县"},{label:"盐山县",value:"盐山县"},{label:"肃宁县",value:"肃宁县"},{label:"南皮县",value:"南皮县"},{label:"吴桥县",value:"吴桥县"},{label:"献县",value:"献县"},{label:"孟村回族自治县",value:"孟村回族自治县"},{label:"河北沧州经济开发区",value:"河北沧州经济开发区"},{label:"沧州高新技术产业开发区",value:"沧州高新技术产业开发区"},{label:"沧州渤海新区",value:"沧州渤海新区"},{label:"泊头市",value:"泊头市"},{label:"任丘市",value:"任丘市"},{label:"黄骅市",value:"黄骅市"},{label:"河间市",value:"河间市"}]},{label:"廊坊市",value:"廊坊市",children:[{label:"安次区",value:"安次区"},{label:"广阳区",value:"广阳区"},{label:"固安县",value:"固安县"},{label:"永清县",value:"永清县"},{label:"香河县",value:"香河县"},{label:"大城县",value:"大城县"},{label:"文安县",value:"文安县"},{label:"大厂回族自治县",value:"大厂回族自治县"},{label:"廊坊经济技术开发区",value:"廊坊经济技术开发区"},{label:"霸州市",value:"霸州市"},{label:"三河市",value:"三河市"}]},{label:"衡水市",value:"衡水市",children:[{label:"桃城区",value:"桃城区"},{label:"冀州区",value:"冀州区"},{label:"枣强县",value:"枣强县"},{label:"武邑县",value:"武邑县"},{label:"武强县",value:"武强县"},{label:"饶阳县",value:"饶阳县"},{label:"安平县",value:"安平县"},{label:"故城县",value:"故城县"},{label:"景县",value:"景县"},{label:"阜城县",value:"阜城县"},{label:"河北衡水高新技术产业开发区",value:"河北衡水高新技术产业开发区"},{label:"衡水滨湖新区",value:"衡水滨湖新区"},{label:"深州市",value:"深州市"}]}]},{label:"山西省",value:"山西省",children:[{label:"太原市",value:"太原市",children:[{label:"小店区",value:"小店区"},{label:"迎泽区",value:"迎泽区"},{label:"杏花岭区",value:"杏花岭区"},{label:"尖草坪区",value:"尖草坪区"},{label:"万柏林区",value:"万柏林区"},{label:"晋源区",value:"晋源区"},{label:"清徐县",value:"清徐县"},{label:"阳曲县",value:"阳曲县"},{label:"娄烦县",value:"娄烦县"},{label:"山西转型综合改革示范区",value:"山西转型综合改革示范区"},{label:"古交市",value:"古交市"}]},{label:"大同市",value:"大同市",children:[{label:"新荣区",value:"新荣区"},{label:"平城区",value:"平城区"},{label:"云冈区",value:"云冈区"},{label:"云州区",value:"云州区"},{label:"阳高县",value:"阳高县"},{label:"天镇县",value:"天镇县"},{label:"广灵县",value:"广灵县"},{label:"灵丘县",value:"灵丘县"},{label:"浑源县",value:"浑源县"},{label:"左云县",value:"左云县"},{label:"山西大同经济开发区",value:"山西大同经济开发区"}]},{label:"阳泉市",value:"阳泉市",children:[{label:"城区",value:"城区"},{label:"矿区",value:"矿区"},{label:"郊区",value:"郊区"},{label:"平定县",value:"平定县"},{label:"盂县",value:"盂县"}]},{label:"长治市",value:"长治市",children:[{label:"潞州区",value:"潞州区"},{label:"上党区",value:"上党区"},{label:"屯留区",value:"屯留区"},{label:"潞城区",value:"潞城区"},{label:"襄垣县",value:"襄垣县"},{label:"平顺县",value:"平顺县"},{label:"黎城县",value:"黎城县"},{label:"壶关县",value:"壶关县"},{label:"长子县",value:"长子县"},{label:"武乡县",value:"武乡县"},{label:"沁县",value:"沁县"},{label:"沁源县",value:"沁源县"}]},{label:"晋城市",value:"晋城市",children:[{label:"城区",value:"城区"},{label:"沁水县",value:"沁水县"},{label:"阳城县",value:"阳城县"},{label:"陵川县",value:"陵川县"},{label:"泽州县",value:"泽州县"},{label:"高平市",value:"高平市"}]},{label:"朔州市",value:"朔州市",children:[{label:"朔城区",value:"朔城区"},{label:"平鲁区",value:"平鲁区"},{label:"山阴县",value:"山阴县"},{label:"应县",value:"应县"},{label:"右玉县",value:"右玉县"},{label:"山西朔州经济开发区",value:"山西朔州经济开发区"},{label:"怀仁市",value:"怀仁市"}]},{label:"晋中市",value:"晋中市",children:[{label:"榆次区",value:"榆次区"},{label:"太谷区",value:"太谷区"},{label:"榆社县",value:"榆社县"},{label:"左权县",value:"左权县"},{label:"和顺县",value:"和顺县"},{label:"昔阳县",value:"昔阳县"},{label:"寿阳县",value:"寿阳县"},{label:"祁县",value:"祁县"},{label:"平遥县",value:"平遥县"},{label:"灵石县",value:"灵石县"},{label:"介休市",value:"介休市"}]},{label:"运城市",value:"运城市",children:[{label:"盐湖区",value:"盐湖区"},{label:"临猗县",value:"临猗县"},{label:"万荣县",value:"万荣县"},{label:"闻喜县",value:"闻喜县"},{label:"稷山县",value:"稷山县"},{label:"新绛县",value:"新绛县"},{label:"绛县",value:"绛县"},{label:"垣曲县",value:"垣曲县"},{label:"夏县",value:"夏县"},{label:"平陆县",value:"平陆县"},{label:"芮城县",value:"芮城县"},{label:"永济市",value:"永济市"},{label:"河津市",value:"河津市"}]},{label:"忻州市",value:"忻州市",children:[{label:"忻府区",value:"忻府区"},{label:"定襄县",value:"定襄县"},{label:"五台县",value:"五台县"},{label:"代县",value:"代县"},{label:"繁峙县",value:"繁峙县"},{label:"宁武县",value:"宁武县"},{label:"静乐县",value:"静乐县"},{label:"神池县",value:"神池县"},{label:"五寨县",value:"五寨县"},{label:"岢岚县",value:"岢岚县"},{label:"河曲县",value:"河曲县"},{label:"保德县",value:"保德县"},{label:"偏关县",value:"偏关县"},{label:"五台山风景名胜区",value:"五台山风景名胜区"},{label:"原平市",value:"原平市"}]},{label:"临汾市",value:"临汾市",children:[{label:"尧都区",value:"尧都区"},{label:"曲沃县",value:"曲沃县"},{label:"翼城县",value:"翼城县"},{label:"襄汾县",value:"襄汾县"},{label:"洪洞县",value:"洪洞县"},{label:"古县",value:"古县"},{label:"安泽县",value:"安泽县"},{label:"浮山县",value:"浮山县"},{label:"吉县",value:"吉县"},{label:"乡宁县",value:"乡宁县"},{label:"大宁县",value:"大宁县"},{label:"隰县",value:"隰县"},{label:"永和县",value:"永和县"},{label:"蒲县",value:"蒲县"},{label:"汾西县",value:"汾西县"},{label:"侯马市",value:"侯马市"},{label:"霍州市",value:"霍州市"}]},{label:"吕梁市",value:"吕梁市",children:[{label:"离石区",value:"离石区"},{label:"文水县",value:"文水县"},{label:"交城县",value:"交城县"},{label:"兴县",value:"兴县"},{label:"临县",value:"临县"},{label:"柳林县",value:"柳林县"},{label:"石楼县",value:"石楼县"},{label:"岚县",value:"岚县"},{label:"方山县",value:"方山县"},{label:"中阳县",value:"中阳县"},{label:"交口县",value:"交口县"},{label:"孝义市",value:"孝义市"},{label:"汾阳市",value:"汾阳市"}]}]},{label:"内蒙古自治区",value:"内蒙古自治区",children:[{label:"呼和浩特市",value:"呼和浩特市",children:[{label:"新城区",value:"新城区"},{label:"回民区",value:"回民区"},{label:"玉泉区",value:"玉泉区"},{label:"赛罕区",value:"赛罕区"},{label:"土默特左旗",value:"土默特左旗"},{label:"托克托县",value:"托克托县"},{label:"和林格尔县",value:"和林格尔县"},{label:"清水河县",value:"清水河县"},{label:"武川县",value:"武川县"},{label:"呼和浩特经济技术开发区",value:"呼和浩特经济技术开发区"}]},{label:"包头市",value:"包头市",children:[{label:"东河区",value:"东河区"},{label:"昆都仑区",value:"昆都仑区"},{label:"青山区",value:"青山区"},{label:"石拐区",value:"石拐区"},{label:"白云鄂博矿区",value:"白云鄂博矿区"},{label:"九原区",value:"九原区"},{label:"土默特右旗",value:"土默特右旗"},{label:"固阳县",value:"固阳县"},{label:"达尔罕茂明安联合旗",value:"达尔罕茂明安联合旗"},{label:"包头稀土高新技术产业开发区",value:"包头稀土高新技术产业开发区"}]},{label:"乌海市",value:"乌海市",children:[{label:"海勃湾区",value:"海勃湾区"},{label:"海南区",value:"海南区"},{label:"乌达区",value:"乌达区"}]},{label:"赤峰市",value:"赤峰市",children:[{label:"红山区",value:"红山区"},{label:"元宝山区",value:"元宝山区"},{label:"松山区",value:"松山区"},{label:"阿鲁科尔沁旗",value:"阿鲁科尔沁旗"},{label:"巴林左旗",value:"巴林左旗"},{label:"巴林右旗",value:"巴林右旗"},{label:"林西县",value:"林西县"},{label:"克什克腾旗",value:"克什克腾旗"},{label:"翁牛特旗",value:"翁牛特旗"},{label:"喀喇沁旗",value:"喀喇沁旗"},{label:"宁城县",value:"宁城县"},{label:"敖汉旗",value:"敖汉旗"}]},{label:"通辽市",value:"通辽市",children:[{label:"科尔沁区",value:"科尔沁区"},{label:"科尔沁左翼中旗",value:"科尔沁左翼中旗"},{label:"科尔沁左翼后旗",value:"科尔沁左翼后旗"},{label:"开鲁县",value:"开鲁县"},{label:"库伦旗",value:"库伦旗"},{label:"奈曼旗",value:"奈曼旗"},{label:"扎鲁特旗",value:"扎鲁特旗"},{label:"通辽经济技术开发区",value:"通辽经济技术开发区"},{label:"霍林郭勒市",value:"霍林郭勒市"}]},{label:"鄂尔多斯市",value:"鄂尔多斯市",children:[{label:"东胜区",value:"东胜区"},{label:"康巴什区",value:"康巴什区"},{label:"达拉特旗",value:"达拉特旗"},{label:"准格尔旗",value:"准格尔旗"},{label:"鄂托克前旗",value:"鄂托克前旗"},{label:"鄂托克旗",value:"鄂托克旗"},{label:"杭锦旗",value:"杭锦旗"},{label:"乌审旗",value:"乌审旗"},{label:"伊金霍洛旗",value:"伊金霍洛旗"}]},{label:"呼伦贝尔市",value:"呼伦贝尔市",children:[{label:"海拉尔区",value:"海拉尔区"},{label:"扎赉诺尔区",value:"扎赉诺尔区"},{label:"阿荣旗",value:"阿荣旗"},{label:"莫力达瓦达斡尔族自治旗",value:"莫力达瓦达斡尔族自治旗"},{label:"鄂伦春自治旗",value:"鄂伦春自治旗"},{label:"鄂温克族自治旗",value:"鄂温克族自治旗"},{label:"陈巴尔虎旗",value:"陈巴尔虎旗"},{label:"新巴尔虎左旗",value:"新巴尔虎左旗"},{label:"新巴尔虎右旗",value:"新巴尔虎右旗"},{label:"满洲里市",value:"满洲里市"},{label:"牙克石市",value:"牙克石市"},{label:"扎兰屯市",value:"扎兰屯市"},{label:"额尔古纳市",value:"额尔古纳市"},{label:"根河市",value:"根河市"}]},{label:"巴彦淖尔市",value:"巴彦淖尔市",children:[{label:"临河区",value:"临河区"},{label:"五原县",value:"五原县"},{label:"磴口县",value:"磴口县"},{label:"乌拉特前旗",value:"乌拉特前旗"},{label:"乌拉特中旗",value:"乌拉特中旗"},{label:"乌拉特后旗",value:"乌拉特后旗"},{label:"杭锦后旗",value:"杭锦后旗"}]},{label:"乌兰察布市",value:"乌兰察布市",children:[{label:"集宁区",value:"集宁区"},{label:"卓资县",value:"卓资县"},{label:"化德县",value:"化德县"},{label:"商都县",value:"商都县"},{label:"兴和县",value:"兴和县"},{label:"凉城县",value:"凉城县"},{label:"察哈尔右翼前旗",value:"察哈尔右翼前旗"},{label:"察哈尔右翼中旗",value:"察哈尔右翼中旗"},{label:"察哈尔右翼后旗",value:"察哈尔右翼后旗"},{label:"四子王旗",value:"四子王旗"},{label:"丰镇市",value:"丰镇市"}]},{label:"兴安盟",value:"兴安盟",children:[{label:"乌兰浩特市",value:"乌兰浩特市"},{label:"阿尔山市",value:"阿尔山市"},{label:"科尔沁右翼前旗",value:"科尔沁右翼前旗"},{label:"科尔沁右翼中旗",value:"科尔沁右翼中旗"},{label:"扎赉特旗",value:"扎赉特旗"},{label:"突泉县",value:"突泉县"}]},{label:"锡林郭勒盟",value:"锡林郭勒盟",children:[{label:"二连浩特市",value:"二连浩特市"},{label:"锡林浩特市",value:"锡林浩特市"},{label:"阿巴嘎旗",value:"阿巴嘎旗"},{label:"苏尼特左旗",value:"苏尼特左旗"},{label:"苏尼特右旗",value:"苏尼特右旗"},{label:"东乌珠穆沁旗",value:"东乌珠穆沁旗"},{label:"西乌珠穆沁旗",value:"西乌珠穆沁旗"},{label:"太仆寺旗",value:"太仆寺旗"},{label:"镶黄旗",value:"镶黄旗"},{label:"正镶白旗",value:"正镶白旗"},{label:"正蓝旗",value:"正蓝旗"},{label:"多伦县",value:"多伦县"},{label:"乌拉盖管理区管委会",value:"乌拉盖管理区管委会"}]},{label:"阿拉善盟",value:"阿拉善盟",children:[{label:"阿拉善左旗",value:"阿拉善左旗"},{label:"阿拉善右旗",value:"阿拉善右旗"},{label:"额济纳旗",value:"额济纳旗"},{label:"内蒙古阿拉善高新技术产业开发区",value:"内蒙古阿拉善高新技术产业开发区"}]}]},{label:"辽宁省",value:"辽宁省",children:[{label:"沈阳市",value:"沈阳市",children:[{label:"和平区",value:"和平区"},{label:"沈河区",value:"沈河区"},{label:"大东区",value:"大东区"},{label:"皇姑区",value:"皇姑区"},{label:"铁西区",value:"铁西区"},{label:"苏家屯区",value:"苏家屯区"},{label:"浑南区",value:"浑南区"},{label:"沈北新区",value:"沈北新区"},{label:"于洪区",value:"于洪区"},{label:"辽中区",value:"辽中区"},{label:"康平县",value:"康平县"},{label:"法库县",value:"法库县"},{label:"新民市",value:"新民市"}]},{label:"大连市",value:"大连市",children:[{label:"中山区",value:"中山区"},{label:"西岗区",value:"西岗区"},{label:"沙河口区",value:"沙河口区"},{label:"甘井子区",value:"甘井子区"},{label:"旅顺口区",value:"旅顺口区"},{label:"金州区",value:"金州区"},{label:"普兰店区",value:"普兰店区"},{label:"长海县",value:"长海县"},{label:"瓦房店市",value:"瓦房店市"},{label:"庄河市",value:"庄河市"}]},{label:"鞍山市",value:"鞍山市",children:[{label:"铁东区",value:"铁东区"},{label:"铁西区",value:"铁西区"},{label:"立山区",value:"立山区"},{label:"千山区",value:"千山区"},{label:"台安县",value:"台安县"},{label:"岫岩满族自治县",value:"岫岩满族自治县"},{label:"海城市",value:"海城市"}]},{label:"抚顺市",value:"抚顺市",children:[{label:"新抚区",value:"新抚区"},{label:"东洲区",value:"东洲区"},{label:"望花区",value:"望花区"},{label:"顺城区",value:"顺城区"},{label:"抚顺县",value:"抚顺县"},{label:"新宾满族自治县",value:"新宾满族自治县"},{label:"清原满族自治县",value:"清原满族自治县"}]},{label:"本溪市",value:"本溪市",children:[{label:"平山区",value:"平山区"},{label:"溪湖区",value:"溪湖区"},{label:"明山区",value:"明山区"},{label:"南芬区",value:"南芬区"},{label:"本溪满族自治县",value:"本溪满族自治县"},{label:"桓仁满族自治县",value:"桓仁满族自治县"}]},{label:"丹东市",value:"丹东市",children:[{label:"元宝区",value:"元宝区"},{label:"振兴区",value:"振兴区"},{label:"振安区",value:"振安区"},{label:"宽甸满族自治县",value:"宽甸满族自治县"},{label:"东港市",value:"东港市"},{label:"凤城市",value:"凤城市"}]},{label:"锦州市",value:"锦州市",children:[{label:"古塔区",value:"古塔区"},{label:"凌河区",value:"凌河区"},{label:"太和区",value:"太和区"},{label:"黑山县",value:"黑山县"},{label:"义县",value:"义县"},{label:"凌海市",value:"凌海市"},{label:"北镇市",value:"北镇市"}]},{label:"营口市",value:"营口市",children:[{label:"站前区",value:"站前区"},{label:"西市区",value:"西市区"},{label:"鲅鱼圈区",value:"鲅鱼圈区"},{label:"老边区",value:"老边区"},{label:"盖州市",value:"盖州市"},{label:"大石桥市",value:"大石桥市"}]},{label:"阜新市",value:"阜新市",children:[{label:"海州区",value:"海州区"},{label:"新邱区",value:"新邱区"},{label:"太平区",value:"太平区"},{label:"清河门区",value:"清河门区"},{label:"细河区",value:"细河区"},{label:"阜新蒙古族自治县",value:"阜新蒙古族自治县"},{label:"彰武县",value:"彰武县"}]},{label:"辽阳市",value:"辽阳市",children:[{label:"白塔区",value:"白塔区"},{label:"文圣区",value:"文圣区"},{label:"宏伟区",value:"宏伟区"},{label:"弓长岭区",value:"弓长岭区"},{label:"太子河区",value:"太子河区"},{label:"辽阳县",value:"辽阳县"},{label:"灯塔市",value:"灯塔市"}]},{label:"盘锦市",value:"盘锦市",children:[{label:"双台子区",value:"双台子区"},{label:"兴隆台区",value:"兴隆台区"},{label:"大洼区",value:"大洼区"},{label:"盘山县",value:"盘山县"}]},{label:"铁岭市",value:"铁岭市",children:[{label:"银州区",value:"银州区"},{label:"清河区",value:"清河区"},{label:"铁岭县",value:"铁岭县"},{label:"西丰县",value:"西丰县"},{label:"昌图县",value:"昌图县"},{label:"调兵山市",value:"调兵山市"},{label:"开原市",value:"开原市"}]},{label:"朝阳市",value:"朝阳市",children:[{label:"双塔区",value:"双塔区"},{label:"龙城区",value:"龙城区"},{label:"朝阳县",value:"朝阳县"},{label:"建平县",value:"建平县"},{label:"喀喇沁左翼蒙古族自治县",value:"喀喇沁左翼蒙古族自治县"},{label:"北票市",value:"北票市"},{label:"凌源市",value:"凌源市"}]},{label:"葫芦岛市",value:"葫芦岛市",children:[{label:"连山区",value:"连山区"},{label:"龙港区",value:"龙港区"},{label:"南票区",value:"南票区"},{label:"绥中县",value:"绥中县"},{label:"建昌县",value:"建昌县"},{label:"兴城市",value:"兴城市"}]}]},{label:"吉林省",value:"吉林省",children:[{label:"长春市",value:"长春市",children:[{label:"南关区",value:"南关区"},{label:"宽城区",value:"宽城区"},{label:"朝阳区",value:"朝阳区"},{label:"二道区",value:"二道区"},{label:"绿园区",value:"绿园区"},{label:"双阳区",value:"双阳区"},{label:"九台区",value:"九台区"},{label:"农安县",value:"农安县"},{label:"长春经济技术开发区",value:"长春经济技术开发区"},{label:"长春净月高新技术产业开发区",value:"长春净月高新技术产业开发区"},{label:"长春高新技术产业开发区",value:"长春高新技术产业开发区"},{label:"长春汽车经济技术开发区",value:"长春汽车经济技术开发区"},{label:"榆树市",value:"榆树市"},{label:"德惠市",value:"德惠市"},{label:"公主岭市",value:"公主岭市"}]},{label:"吉林市",value:"吉林市",children:[{label:"昌邑区",value:"昌邑区"},{label:"龙潭区",value:"龙潭区"},{label:"船营区",value:"船营区"},{label:"丰满区",value:"丰满区"},{label:"永吉县",value:"永吉县"},{label:"吉林经济开发区",value:"吉林经济开发区"},{label:"吉林高新技术产业开发区",value:"吉林高新技术产业开发区"},{label:"吉林中国新加坡食品区",value:"吉林中国新加坡食品区"},{label:"蛟河市",value:"蛟河市"},{label:"桦甸市",value:"桦甸市"},{label:"舒兰市",value:"舒兰市"},{label:"磐石市",value:"磐石市"}]},{label:"四平市",value:"四平市",children:[{label:"铁西区",value:"铁西区"},{label:"铁东区",value:"铁东区"},{label:"梨树县",value:"梨树县"},{label:"伊通满族自治县",value:"伊通满族自治县"},{label:"双辽市",value:"双辽市"}]},{label:"辽源市",value:"辽源市",children:[{label:"龙山区",value:"龙山区"},{label:"西安区",value:"西安区"},{label:"东丰县",value:"东丰县"},{label:"东辽县",value:"东辽县"}]},{label:"通化市",value:"通化市",children:[{label:"东昌区",value:"东昌区"},{label:"二道江区",value:"二道江区"},{label:"通化县",value:"通化县"},{label:"辉南县",value:"辉南县"},{label:"柳河县",value:"柳河县"},{label:"梅河口市",value:"梅河口市"},{label:"集安市",value:"集安市"}]},{label:"白山市",value:"白山市",children:[{label:"浑江区",value:"浑江区"},{label:"江源区",value:"江源区"},{label:"抚松县",value:"抚松县"},{label:"靖宇县",value:"靖宇县"},{label:"长白朝鲜族自治县",value:"长白朝鲜族自治县"},{label:"临江市",value:"临江市"}]},{label:"松原市",value:"松原市",children:[{label:"宁江区",value:"宁江区"},{label:"前郭尔罗斯蒙古族自治县",value:"前郭尔罗斯蒙古族自治县"},{label:"长岭县",value:"长岭县"},{label:"乾安县",value:"乾安县"},{label:"吉林松原经济开发区",value:"吉林松原经济开发区"},{label:"扶余市",value:"扶余市"}]},{label:"白城市",value:"白城市",children:[{label:"洮北区",value:"洮北区"},{label:"镇赉县",value:"镇赉县"},{label:"通榆县",value:"通榆县"},{label:"吉林白城经济开发区",value:"吉林白城经济开发区"},{label:"洮南市",value:"洮南市"},{label:"大安市",value:"大安市"}]},{label:"延边朝鲜族自治州",value:"延边朝鲜族自治州",children:[{label:"延吉市",value:"延吉市"},{label:"图们市",value:"图们市"},{label:"敦化市",value:"敦化市"},{label:"珲春市",value:"珲春市"},{label:"龙井市",value:"龙井市"},{label:"和龙市",value:"和龙市"},{label:"汪清县",value:"汪清县"},{label:"安图县",value:"安图县"}]}]},{label:"黑龙江省",value:"黑龙江省",children:[{label:"哈尔滨市",value:"哈尔滨市",children:[{label:"道里区",value:"道里区"},{label:"南岗区",value:"南岗区"},{label:"道外区",value:"道外区"},{label:"平房区",value:"平房区"},{label:"松北区",value:"松北区"},{label:"香坊区",value:"香坊区"},{label:"呼兰区",value:"呼兰区"},{label:"阿城区",value:"阿城区"},{label:"双城区",value:"双城区"},{label:"依兰县",value:"依兰县"},{label:"方正县",value:"方正县"},{label:"宾县",value:"宾县"},{label:"巴彦县",value:"巴彦县"},{label:"木兰县",value:"木兰县"},{label:"通河县",value:"通河县"},{label:"延寿县",value:"延寿县"},{label:"尚志市",value:"尚志市"},{label:"五常市",value:"五常市"}]},{label:"齐齐哈尔市",value:"齐齐哈尔市",children:[{label:"龙沙区",value:"龙沙区"},{label:"建华区",value:"建华区"},{label:"铁锋区",value:"铁锋区"},{label:"昂昂溪区",value:"昂昂溪区"},{label:"富拉尔基区",value:"富拉尔基区"},{label:"碾子山区",value:"碾子山区"},{label:"梅里斯达斡尔族区",value:"梅里斯达斡尔族区"},{label:"龙江县",value:"龙江县"},{label:"依安县",value:"依安县"},{label:"泰来县",value:"泰来县"},{label:"甘南县",value:"甘南县"},{label:"富裕县",value:"富裕县"},{label:"克山县",value:"克山县"},{label:"克东县",value:"克东县"},{label:"拜泉县",value:"拜泉县"},{label:"讷河市",value:"讷河市"}]},{label:"鸡西市",value:"鸡西市",children:[{label:"鸡冠区",value:"鸡冠区"},{label:"恒山区",value:"恒山区"},{label:"滴道区",value:"滴道区"},{label:"梨树区",value:"梨树区"},{label:"城子河区",value:"城子河区"},{label:"麻山区",value:"麻山区"},{label:"鸡东县",value:"鸡东县"},{label:"虎林市",value:"虎林市"},{label:"密山市",value:"密山市"}]},{label:"鹤岗市",value:"鹤岗市",children:[{label:"向阳区",value:"向阳区"},{label:"工农区",value:"工农区"},{label:"南山区",value:"南山区"},{label:"兴安区",value:"兴安区"},{label:"东山区",value:"东山区"},{label:"兴山区",value:"兴山区"},{label:"萝北县",value:"萝北县"},{label:"绥滨县",value:"绥滨县"}]},{label:"双鸭山市",value:"双鸭山市",children:[{label:"尖山区",value:"尖山区"},{label:"岭东区",value:"岭东区"},{label:"四方台区",value:"四方台区"},{label:"宝山区",value:"宝山区"},{label:"集贤县",value:"集贤县"},{label:"友谊县",value:"友谊县"},{label:"宝清县",value:"宝清县"},{label:"饶河县",value:"饶河县"}]},{label:"大庆市",value:"大庆市",children:[{label:"萨尔图区",value:"萨尔图区"},{label:"龙凤区",value:"龙凤区"},{label:"让胡路区",value:"让胡路区"},{label:"红岗区",value:"红岗区"},{label:"大同区",value:"大同区"},{label:"肇州县",value:"肇州县"},{label:"肇源县",value:"肇源县"},{label:"林甸县",value:"林甸县"},{label:"杜尔伯特蒙古族自治县",value:"杜尔伯特蒙古族自治县"},{label:"大庆高新技术产业开发区",value:"大庆高新技术产业开发区"}]},{label:"伊春市",value:"伊春市",children:[{label:"伊美区",value:"伊美区"},{label:"乌翠区",value:"乌翠区"},{label:"友好区",value:"友好区"},{label:"嘉荫县",value:"嘉荫县"},{label:"汤旺县",value:"汤旺县"},{label:"丰林县",value:"丰林县"},{label:"大箐山县",value:"大箐山县"},{label:"南岔县",value:"南岔县"},{label:"金林区",value:"金林区"},{label:"铁力市",value:"铁力市"}]},{label:"佳木斯市",value:"佳木斯市",children:[{label:"向阳区",value:"向阳区"},{label:"前进区",value:"前进区"},{label:"东风区",value:"东风区"},{label:"郊区",value:"郊区"},{label:"桦南县",value:"桦南县"},{label:"桦川县",value:"桦川县"},{label:"汤原县",value:"汤原县"},{label:"同江市",value:"同江市"},{label:"富锦市",value:"富锦市"},{label:"抚远市",value:"抚远市"}]},{label:"七台河市",value:"七台河市",children:[{label:"新兴区",value:"新兴区"},{label:"桃山区",value:"桃山区"},{label:"茄子河区",value:"茄子河区"},{label:"勃利县",value:"勃利县"}]},{label:"牡丹江市",value:"牡丹江市",children:[{label:"东安区",value:"东安区"},{label:"阳明区",value:"阳明区"},{label:"爱民区",value:"爱民区"},{label:"西安区",value:"西安区"},{label:"林口县",value:"林口县"},{label:"绥芬河市",value:"绥芬河市"},{label:"海林市",value:"海林市"},{label:"宁安市",value:"宁安市"},{label:"穆棱市",value:"穆棱市"},{label:"东宁市",value:"东宁市"}]},{label:"黑河市",value:"黑河市",children:[{label:"爱辉区",value:"爱辉区"},{label:"逊克县",value:"逊克县"},{label:"孙吴县",value:"孙吴县"},{label:"北安市",value:"北安市"},{label:"五大连池市",value:"五大连池市"},{label:"嫩江市",value:"嫩江市"}]},{label:"绥化市",value:"绥化市",children:[{label:"北林区",value:"北林区"},{label:"望奎县",value:"望奎县"},{label:"兰西县",value:"兰西县"},{label:"青冈县",value:"青冈县"},{label:"庆安县",value:"庆安县"},{label:"明水县",value:"明水县"},{label:"绥棱县",value:"绥棱县"},{label:"安达市",value:"安达市"},{label:"肇东市",value:"肇东市"},{label:"海伦市",value:"海伦市"}]},{label:"大兴安岭地区",value:"大兴安岭地区",children:[{label:"漠河市",value:"漠河市"},{label:"呼玛县",value:"呼玛县"},{label:"塔河县",value:"塔河县"},{label:"加格达奇区",value:"加格达奇区"},{label:"松岭区",value:"松岭区"},{label:"新林区",value:"新林区"},{label:"呼中区",value:"呼中区"}]}]},{label:"上海市",value:"上海市",children:[{label:"市辖区",value:"市辖区",children:[{label:"黄浦区",value:"黄浦区"},{label:"徐汇区",value:"徐汇区"},{label:"长宁区",value:"长宁区"},{label:"静安区",value:"静安区"},{label:"普陀区",value:"普陀区"},{label:"虹口区",value:"虹口区"},{label:"杨浦区",value:"杨浦区"},{label:"闵行区",value:"闵行区"},{label:"宝山区",value:"宝山区"},{label:"嘉定区",value:"嘉定区"},{label:"浦东新区",value:"浦东新区"},{label:"金山区",value:"金山区"},{label:"松江区",value:"松江区"},{label:"青浦区",value:"青浦区"},{label:"奉贤区",value:"奉贤区"},{label:"崇明区",value:"崇明区"}]}]},{label:"江苏省",value:"江苏省",children:[{label:"南京市",value:"南京市",children:[{label:"玄武区",value:"玄武区"},{label:"秦淮区",value:"秦淮区"},{label:"建邺区",value:"建邺区"},{label:"鼓楼区",value:"鼓楼区"},{label:"浦口区",value:"浦口区"},{label:"栖霞区",value:"栖霞区"},{label:"雨花台区",value:"雨花台区"},{label:"江宁区",value:"江宁区"},{label:"六合区",value:"六合区"},{label:"溧水区",value:"溧水区"},{label:"高淳区",value:"高淳区"}]},{label:"无锡市",value:"无锡市",children:[{label:"锡山区",value:"锡山区"},{label:"惠山区",value:"惠山区"},{label:"滨湖区",value:"滨湖区"},{label:"梁溪区",value:"梁溪区"},{label:"新吴区",value:"新吴区"},{label:"江阴市",value:"江阴市"},{label:"宜兴市",value:"宜兴市"}]},{label:"徐州市",value:"徐州市",children:[{label:"鼓楼区",value:"鼓楼区"},{label:"云龙区",value:"云龙区"},{label:"贾汪区",value:"贾汪区"},{label:"泉山区",value:"泉山区"},{label:"铜山区",value:"铜山区"},{label:"丰县",value:"丰县"},{label:"沛县",value:"沛县"},{label:"睢宁县",value:"睢宁县"},{label:"徐州经济技术开发区",value:"徐州经济技术开发区"},{label:"新沂市",value:"新沂市"},{label:"邳州市",value:"邳州市"}]},{label:"常州市",value:"常州市",children:[{label:"天宁区",value:"天宁区"},{label:"钟楼区",value:"钟楼区"},{label:"新北区",value:"新北区"},{label:"武进区",value:"武进区"},{label:"金坛区",value:"金坛区"},{label:"溧阳市",value:"溧阳市"}]},{label:"苏州市",value:"苏州市",children:[{label:"虎丘区",value:"虎丘区"},{label:"吴中区",value:"吴中区"},{label:"相城区",value:"相城区"},{label:"姑苏区",value:"姑苏区"},{label:"吴江区",value:"吴江区"},{label:"苏州工业园区",value:"苏州工业园区"},{label:"常熟市",value:"常熟市"},{label:"张家港市",value:"张家港市"},{label:"昆山市",value:"昆山市"},{label:"太仓市",value:"太仓市"}]},{label:"南通市",value:"南通市",children:[{label:"通州区",value:"通州区"},{label:"崇川区",value:"崇川区"},{label:"海门区",value:"海门区"},{label:"如东县",value:"如东县"},{label:"南通经济技术开发区",value:"南通经济技术开发区"},{label:"启东市",value:"启东市"},{label:"如皋市",value:"如皋市"},{label:"海安市",value:"海安市"}]},{label:"连云港市",value:"连云港市",children:[{label:"连云区",value:"连云区"},{label:"海州区",value:"海州区"},{label:"赣榆区",value:"赣榆区"},{label:"东海县",value:"东海县"},{label:"灌云县",value:"灌云县"},{label:"灌南县",value:"灌南县"},{label:"连云港经济技术开发区",value:"连云港经济技术开发区"}]},{label:"淮安市",value:"淮安市",children:[{label:"淮安区",value:"淮安区"},{label:"淮阴区",value:"淮阴区"},{label:"清江浦区",value:"清江浦区"},{label:"洪泽区",value:"洪泽区"},{label:"涟水县",value:"涟水县"},{label:"盱眙县",value:"盱眙县"},{label:"金湖县",value:"金湖县"},{label:"淮安经济技术开发区",value:"淮安经济技术开发区"}]},{label:"盐城市",value:"盐城市",children:[{label:"亭湖区",value:"亭湖区"},{label:"盐都区",value:"盐都区"},{label:"大丰区",value:"大丰区"},{label:"响水县",value:"响水县"},{label:"滨海县",value:"滨海县"},{label:"阜宁县",value:"阜宁县"},{label:"射阳县",value:"射阳县"},{label:"建湖县",value:"建湖县"},{label:"盐城经济技术开发区",value:"盐城经济技术开发区"},{label:"东台市",value:"东台市"}]},{label:"扬州市",value:"扬州市",children:[{label:"广陵区",value:"广陵区"},{label:"邗江区",value:"邗江区"},{label:"江都区",value:"江都区"},{label:"宝应县",value:"宝应县"},{label:"扬州经济技术开发区",value:"扬州经济技术开发区"},{label:"仪征市",value:"仪征市"},{label:"高邮市",value:"高邮市"}]},{label:"镇江市",value:"镇江市",children:[{label:"京口区",value:"京口区"},{label:"润州区",value:"润州区"},{label:"丹徒区",value:"丹徒区"},{label:"镇江新区",value:"镇江新区"},{label:"丹阳市",value:"丹阳市"},{label:"扬中市",value:"扬中市"},{label:"句容市",value:"句容市"}]},{label:"泰州市",value:"泰州市",children:[{label:"海陵区",value:"海陵区"},{label:"高港区",value:"高港区"},{label:"姜堰区",value:"姜堰区"},{label:"兴化市",value:"兴化市"},{label:"靖江市",value:"靖江市"},{label:"泰兴市",value:"泰兴市"}]},{label:"宿迁市",value:"宿迁市",children:[{label:"宿城区",value:"宿城区"},{label:"宿豫区",value:"宿豫区"},{label:"沭阳县",value:"沭阳县"},{label:"泗阳县",value:"泗阳县"},{label:"泗洪县",value:"泗洪县"},{label:"宿迁经济技术开发区",value:"宿迁经济技术开发区"}]}]},{label:"浙江省",value:"浙江省",children:[{label:"杭州市",value:"杭州市",children:[{label:"上城区",value:"上城区"},{label:"拱墅区",value:"拱墅区"},{label:"西湖区",value:"西湖区"},{label:"滨江区",value:"滨江区"},{label:"萧山区",value:"萧山区"},{label:"余杭区",value:"余杭区"},{label:"富阳区",value:"富阳区"},{label:"临安区",value:"临安区"},{label:"临平区",value:"临平区"},{label:"钱塘区",value:"钱塘区"},{label:"桐庐县",value:"桐庐县"},{label:"淳安县",value:"淳安县"},{label:"建德市",value:"建德市"}]},{label:"宁波市",value:"宁波市",children:[{label:"海曙区",value:"海曙区"},{label:"江北区",value:"江北区"},{label:"北仑区",value:"北仑区"},{label:"镇海区",value:"镇海区"},{label:"鄞州区",value:"鄞州区"},{label:"奉化区",value:"奉化区"},{label:"象山县",value:"象山县"},{label:"宁海县",value:"宁海县"},{label:"余姚市",value:"余姚市"},{label:"慈溪市",value:"慈溪市"}]},{label:"温州市",value:"温州市",children:[{label:"鹿城区",value:"鹿城区"},{label:"龙湾区",value:"龙湾区"},{label:"瓯海区",value:"瓯海区"},{label:"洞头区",value:"洞头区"},{label:"永嘉县",value:"永嘉县"},{label:"平阳县",value:"平阳县"},{label:"苍南县",value:"苍南县"},{label:"文成县",value:"文成县"},{label:"泰顺县",value:"泰顺县"},{label:"瑞安市",value:"瑞安市"},{label:"乐清市",value:"乐清市"},{label:"龙港市",value:"龙港市"}]},{label:"嘉兴市",value:"嘉兴市",children:[{label:"南湖区",value:"南湖区"},{label:"秀洲区",value:"秀洲区"},{label:"嘉善县",value:"嘉善县"},{label:"海盐县",value:"海盐县"},{label:"海宁市",value:"海宁市"},{label:"平湖市",value:"平湖市"},{label:"桐乡市",value:"桐乡市"}]},{label:"湖州市",value:"湖州市",children:[{label:"吴兴区",value:"吴兴区"},{label:"南浔区",value:"南浔区"},{label:"德清县",value:"德清县"},{label:"长兴县",value:"长兴县"},{label:"安吉县",value:"安吉县"}]},{label:"绍兴市",value:"绍兴市",children:[{label:"越城区",value:"越城区"},{label:"柯桥区",value:"柯桥区"},{label:"上虞区",value:"上虞区"},{label:"新昌县",value:"新昌县"},{label:"诸暨市",value:"诸暨市"},{label:"嵊州市",value:"嵊州市"}]},{label:"金华市",value:"金华市",children:[{label:"婺城区",value:"婺城区"},{label:"金东区",value:"金东区"},{label:"武义县",value:"武义县"},{label:"浦江县",value:"浦江县"},{label:"磐安县",value:"磐安县"},{label:"兰溪市",value:"兰溪市"},{label:"义乌市",value:"义乌市"},{label:"东阳市",value:"东阳市"},{label:"永康市",value:"永康市"}]},{label:"衢州市",value:"衢州市",children:[{label:"柯城区",value:"柯城区"},{label:"衢江区",value:"衢江区"},{label:"常山县",value:"常山县"},{label:"开化县",value:"开化县"},{label:"龙游县",value:"龙游县"},{label:"江山市",value:"江山市"}]},{label:"舟山市",value:"舟山市",children:[{label:"定海区",value:"定海区"},{label:"普陀区",value:"普陀区"},{label:"岱山县",value:"岱山县"},{label:"嵊泗县",value:"嵊泗县"}]},{label:"台州市",value:"台州市",children:[{label:"椒江区",value:"椒江区"},{label:"黄岩区",value:"黄岩区"},{label:"路桥区",value:"路桥区"},{label:"三门县",value:"三门县"},{label:"天台县",value:"天台县"},{label:"仙居县",value:"仙居县"},{label:"温岭市",value:"温岭市"},{label:"临海市",value:"临海市"},{label:"玉环市",value:"玉环市"}]},{label:"丽水市",value:"丽水市",children:[{label:"莲都区",value:"莲都区"},{label:"青田县",value:"青田县"},{label:"缙云县",value:"缙云县"},{label:"遂昌县",value:"遂昌县"},{label:"松阳县",value:"松阳县"},{label:"云和县",value:"云和县"},{label:"庆元县",value:"庆元县"},{label:"景宁畲族自治县",value:"景宁畲族自治县"},{label:"龙泉市",value:"龙泉市"}]}]},{label:"安徽省",value:"安徽省",children:[{label:"合肥市",value:"合肥市",children:[{label:"瑶海区",value:"瑶海区"},{label:"庐阳区",value:"庐阳区"},{label:"蜀山区",value:"蜀山区"},{label:"包河区",value:"包河区"},{label:"长丰县",value:"长丰县"},{label:"肥东县",value:"肥东县"},{label:"肥西县",value:"肥西县"},{label:"庐江县",value:"庐江县"},{label:"合肥高新技术产业开发区",value:"合肥高新技术产业开发区"},{label:"合肥经济技术开发区",value:"合肥经济技术开发区"},{label:"合肥新站高新技术产业开发区",value:"合肥新站高新技术产业开发区"},{label:"巢湖市",value:"巢湖市"}]},{label:"芜湖市",value:"芜湖市",children:[{label:"镜湖区",value:"镜湖区"},{label:"鸠江区",value:"鸠江区"},{label:"弋江区",value:"弋江区"},{label:"湾沚区",value:"湾沚区"},{label:"繁昌区",value:"繁昌区"},{label:"南陵县",value:"南陵县"},{label:"芜湖经济技术开发区",value:"芜湖经济技术开发区"},{label:"安徽芜湖三山经济开发区",value:"安徽芜湖三山经济开发区"},{label:"无为市",value:"无为市"}]},{label:"蚌埠市",value:"蚌埠市",children:[{label:"龙子湖区",value:"龙子湖区"},{label:"蚌山区",value:"蚌山区"},{label:"禹会区",value:"禹会区"},{label:"淮上区",value:"淮上区"},{label:"怀远县",value:"怀远县"},{label:"五河县",value:"五河县"},{label:"固镇县",value:"固镇县"},{label:"蚌埠市高新技术开发区",value:"蚌埠市高新技术开发区"},{label:"蚌埠市经济开发区",value:"蚌埠市经济开发区"}]},{label:"淮南市",value:"淮南市",children:[{label:"大通区",value:"大通区"},{label:"田家庵区",value:"田家庵区"},{label:"谢家集区",value:"谢家集区"},{label:"八公山区",value:"八公山区"},{label:"潘集区",value:"潘集区"},{label:"凤台县",value:"凤台县"},{label:"寿县",value:"寿县"}]},{label:"马鞍山市",value:"马鞍山市",children:[{label:"花山区",value:"花山区"},{label:"雨山区",value:"雨山区"},{label:"博望区",value:"博望区"},{label:"当涂县",value:"当涂县"},{label:"含山县",value:"含山县"},{label:"和县",value:"和县"}]},{label:"淮北市",value:"淮北市",children:[{label:"杜集区",value:"杜集区"},{label:"相山区",value:"相山区"},{label:"烈山区",value:"烈山区"},{label:"濉溪县",value:"濉溪县"}]},{label:"铜陵市",value:"铜陵市",children:[{label:"铜官区",value:"铜官区"},{label:"义安区",value:"义安区"},{label:"郊区",value:"郊区"},{label:"枞阳县",value:"枞阳县"}]},{label:"安庆市",value:"安庆市",children:[{label:"迎江区",value:"迎江区"},{label:"大观区",value:"大观区"},{label:"宜秀区",value:"宜秀区"},{label:"怀宁县",value:"怀宁县"},{label:"太湖县",value:"太湖县"},{label:"宿松县",value:"宿松县"},{label:"望江县",value:"望江县"},{label:"岳西县",value:"岳西县"},{label:"安徽安庆经济开发区",value:"安徽安庆经济开发区"},{label:"桐城市",value:"桐城市"},{label:"潜山市",value:"潜山市"}]},{label:"黄山市",value:"黄山市",children:[{label:"屯溪区",value:"屯溪区"},{label:"黄山区",value:"黄山区"},{label:"徽州区",value:"徽州区"},{label:"歙县",value:"歙县"},{label:"休宁县",value:"休宁县"},{label:"黟县",value:"黟县"},{label:"祁门县",value:"祁门县"}]},{label:"滁州市",value:"滁州市",children:[{label:"琅琊区",value:"琅琊区"},{label:"南谯区",value:"南谯区"},{label:"来安县",value:"来安县"},{label:"全椒县",value:"全椒县"},{label:"定远县",value:"定远县"},{label:"凤阳县",value:"凤阳县"},{label:"中新苏滁高新技术产业开发区",value:"中新苏滁高新技术产业开发区"},{label:"滁州经济技术开发区",value:"滁州经济技术开发区"},{label:"天长市",value:"天长市"},{label:"明光市",value:"明光市"}]},{label:"阜阳市",value:"阜阳市",children:[{label:"颍州区",value:"颍州区"},{label:"颍东区",value:"颍东区"},{label:"颍泉区",value:"颍泉区"},{label:"临泉县",value:"临泉县"},{label:"太和县",value:"太和县"},{label:"阜南县",value:"阜南县"},{label:"颍上县",value:"颍上县"},{label:"阜阳合肥现代产业园区",value:"阜阳合肥现代产业园区"},{label:"阜阳经济技术开发区",value:"阜阳经济技术开发区"},{label:"界首市",value:"界首市"}]},{label:"宿州市",value:"宿州市",children:[{label:"埇桥区",value:"埇桥区"},{label:"砀山县",value:"砀山县"},{label:"萧县",value:"萧县"},{label:"灵璧县",value:"灵璧县"},{label:"泗县",value:"泗县"},{label:"宿州马鞍山现代产业园区",value:"宿州马鞍山现代产业园区"},{label:"宿州经济技术开发区",value:"宿州经济技术开发区"}]},{label:"六安市",value:"六安市",children:[{label:"金安区",value:"金安区"},{label:"裕安区",value:"裕安区"},{label:"叶集区",value:"叶集区"},{label:"霍邱县",value:"霍邱县"},{label:"舒城县",value:"舒城县"},{label:"金寨县",value:"金寨县"},{label:"霍山县",value:"霍山县"}]},{label:"亳州市",value:"亳州市",children:[{label:"谯城区",value:"谯城区"},{label:"涡阳县",value:"涡阳县"},{label:"蒙城县",value:"蒙城县"},{label:"利辛县",value:"利辛县"}]},{label:"池州市",value:"池州市",children:[{label:"贵池区",value:"贵池区"},{label:"东至县",value:"东至县"},{label:"石台县",value:"石台县"},{label:"青阳县",value:"青阳县"}]},{label:"宣城市",value:"宣城市",children:[{label:"宣州区",value:"宣州区"},{label:"郎溪县",value:"郎溪县"},{label:"泾县",value:"泾县"},{label:"绩溪县",value:"绩溪县"},{label:"旌德县",value:"旌德县"},{label:"宣城市经济开发区",value:"宣城市经济开发区"},{label:"宁国市",value:"宁国市"},{label:"广德市",value:"广德市"}]}]},{label:"福建省",value:"福建省",children:[{label:"福州市",value:"福州市",children:[{label:"鼓楼区",value:"鼓楼区"},{label:"台江区",value:"台江区"},{label:"仓山区",value:"仓山区"},{label:"马尾区",value:"马尾区"},{label:"晋安区",value:"晋安区"},{label:"长乐区",value:"长乐区"},{label:"闽侯县",value:"闽侯县"},{label:"连江县",value:"连江县"},{label:"罗源县",value:"罗源县"},{label:"闽清县",value:"闽清县"},{label:"永泰县",value:"永泰县"},{label:"平潭县",value:"平潭县"},{label:"福清市",value:"福清市"}]},{label:"厦门市",value:"厦门市",children:[{label:"思明区",value:"思明区"},{label:"海沧区",value:"海沧区"},{label:"湖里区",value:"湖里区"},{label:"集美区",value:"集美区"},{label:"同安区",value:"同安区"},{label:"翔安区",value:"翔安区"}]},{label:"莆田市",value:"莆田市",children:[{label:"城厢区",value:"城厢区"},{label:"涵江区",value:"涵江区"},{label:"荔城区",value:"荔城区"},{label:"秀屿区",value:"秀屿区"},{label:"仙游县",value:"仙游县"}]},{label:"三明市",value:"三明市",children:[{label:"三元区",value:"三元区"},{label:"沙县区",value:"沙县区"},{label:"明溪县",value:"明溪县"},{label:"清流县",value:"清流县"},{label:"宁化县",value:"宁化县"},{label:"大田县",value:"大田县"},{label:"尤溪县",value:"尤溪县"},{label:"将乐县",value:"将乐县"},{label:"泰宁县",value:"泰宁县"},{label:"建宁县",value:"建宁县"},{label:"永安市",value:"永安市"}]},{label:"泉州市",value:"泉州市",children:[{label:"鲤城区",value:"鲤城区"},{label:"丰泽区",value:"丰泽区"},{label:"洛江区",value:"洛江区"},{label:"泉港区",value:"泉港区"},{label:"惠安县",value:"惠安县"},{label:"安溪县",value:"安溪县"},{label:"永春县",value:"永春县"},{label:"德化县",value:"德化县"},{label:"金门县",value:"金门县"},{label:"石狮市",value:"石狮市"},{label:"晋江市",value:"晋江市"},{label:"南安市",value:"南安市"}]},{label:"漳州市",value:"漳州市",children:[{label:"芗城区",value:"芗城区"},{label:"龙文区",value:"龙文区"},{label:"龙海区",value:"龙海区"},{label:"长泰区",value:"长泰区"},{label:"云霄县",value:"云霄县"},{label:"漳浦县",value:"漳浦县"},{label:"诏安县",value:"诏安县"},{label:"东山县",value:"东山县"},{label:"南靖县",value:"南靖县"},{label:"平和县",value:"平和县"},{label:"华安县",value:"华安县"}]},{label:"南平市",value:"南平市",children:[{label:"延平区",value:"延平区"},{label:"建阳区",value:"建阳区"},{label:"顺昌县",value:"顺昌县"},{label:"浦城县",value:"浦城县"},{label:"光泽县",value:"光泽县"},{label:"松溪县",value:"松溪县"},{label:"政和县",value:"政和县"},{label:"邵武市",value:"邵武市"},{label:"武夷山市",value:"武夷山市"},{label:"建瓯市",value:"建瓯市"}]},{label:"龙岩市",value:"龙岩市",children:[{label:"新罗区",value:"新罗区"},{label:"永定区",value:"永定区"},{label:"长汀县",value:"长汀县"},{label:"上杭县",value:"上杭县"},{label:"武平县",value:"武平县"},{label:"连城县",value:"连城县"},{label:"漳平市",value:"漳平市"}]},{label:"宁德市",value:"宁德市",children:[{label:"蕉城区",value:"蕉城区"},{label:"霞浦县",value:"霞浦县"},{label:"古田县",value:"古田县"},{label:"屏南县",value:"屏南县"},{label:"寿宁县",value:"寿宁县"},{label:"周宁县",value:"周宁县"},{label:"柘荣县",value:"柘荣县"},{label:"福安市",value:"福安市"},{label:"福鼎市",value:"福鼎市"}]}]},{label:"江西省",value:"江西省",children:[{label:"南昌市",value:"南昌市",children:[{label:"东湖区",value:"东湖区"},{label:"西湖区",value:"西湖区"},{label:"青云谱区",value:"青云谱区"},{label:"青山湖区",value:"青山湖区"},{label:"新建区",value:"新建区"},{label:"红谷滩区",value:"红谷滩区"},{label:"南昌县",value:"南昌县"},{label:"安义县",value:"安义县"},{label:"进贤县",value:"进贤县"}]},{label:"景德镇市",value:"景德镇市",children:[{label:"昌江区",value:"昌江区"},{label:"珠山区",value:"珠山区"},{label:"浮梁县",value:"浮梁县"},{label:"乐平市",value:"乐平市"}]},{label:"萍乡市",value:"萍乡市",children:[{label:"安源区",value:"安源区"},{label:"湘东区",value:"湘东区"},{label:"莲花县",value:"莲花县"},{label:"上栗县",value:"上栗县"},{label:"芦溪县",value:"芦溪县"}]},{label:"九江市",value:"九江市",children:[{label:"濂溪区",value:"濂溪区"},{label:"浔阳区",value:"浔阳区"},{label:"柴桑区",value:"柴桑区"},{label:"武宁县",value:"武宁县"},{label:"修水县",value:"修水县"},{label:"永修县",value:"永修县"},{label:"德安县",value:"德安县"},{label:"都昌县",value:"都昌县"},{label:"湖口县",value:"湖口县"},{label:"彭泽县",value:"彭泽县"},{label:"瑞昌市",value:"瑞昌市"},{label:"共青城市",value:"共青城市"},{label:"庐山市",value:"庐山市"}]},{label:"新余市",value:"新余市",children:[{label:"渝水区",value:"渝水区"},{label:"分宜县",value:"分宜县"}]},{label:"鹰潭市",value:"鹰潭市",children:[{label:"月湖区",value:"月湖区"},{label:"余江区",value:"余江区"},{label:"贵溪市",value:"贵溪市"}]},{label:"赣州市",value:"赣州市",children:[{label:"章贡区",value:"章贡区"},{label:"南康区",value:"南康区"},{label:"赣县区",value:"赣县区"},{label:"信丰县",value:"信丰县"},{label:"大余县",value:"大余县"},{label:"上犹县",value:"上犹县"},{label:"崇义县",value:"崇义县"},{label:"安远县",value:"安远县"},{label:"定南县",value:"定南县"},{label:"全南县",value:"全南县"},{label:"宁都县",value:"宁都县"},{label:"于都县",value:"于都县"},{label:"兴国县",value:"兴国县"},{label:"会昌县",value:"会昌县"},{label:"寻乌县",value:"寻乌县"},{label:"石城县",value:"石城县"},{label:"瑞金市",value:"瑞金市"},{label:"龙南市",value:"龙南市"}]},{label:"吉安市",value:"吉安市",children:[{label:"吉州区",value:"吉州区"},{label:"青原区",value:"青原区"},{label:"吉安县",value:"吉安县"},{label:"吉水县",value:"吉水县"},{label:"峡江县",value:"峡江县"},{label:"新干县",value:"新干县"},{label:"永丰县",value:"永丰县"},{label:"泰和县",value:"泰和县"},{label:"遂川县",value:"遂川县"},{label:"万安县",value:"万安县"},{label:"安福县",value:"安福县"},{label:"永新县",value:"永新县"},{label:"井冈山市",value:"井冈山市"}]},{label:"宜春市",value:"宜春市",children:[{label:"袁州区",value:"袁州区"},{label:"奉新县",value:"奉新县"},{label:"万载县",value:"万载县"},{label:"上高县",value:"上高县"},{label:"宜丰县",value:"宜丰县"},{label:"靖安县",value:"靖安县"},{label:"铜鼓县",value:"铜鼓县"},{label:"丰城市",value:"丰城市"},{label:"樟树市",value:"樟树市"},{label:"高安市",value:"高安市"}]},{label:"抚州市",value:"抚州市",children:[{label:"临川区",value:"临川区"},{label:"东乡区",value:"东乡区"},{label:"南城县",value:"南城县"},{label:"黎川县",value:"黎川县"},{label:"南丰县",value:"南丰县"},{label:"崇仁县",value:"崇仁县"},{label:"乐安县",value:"乐安县"},{label:"宜黄县",value:"宜黄县"},{label:"金溪县",value:"金溪县"},{label:"资溪县",value:"资溪县"},{label:"广昌县",value:"广昌县"}]},{label:"上饶市",value:"上饶市",children:[{label:"信州区",value:"信州区"},{label:"广丰区",value:"广丰区"},{label:"广信区",value:"广信区"},{label:"玉山县",value:"玉山县"},{label:"铅山县",value:"铅山县"},{label:"横峰县",value:"横峰县"},{label:"弋阳县",value:"弋阳县"},{label:"余干县",value:"余干县"},{label:"鄱阳县",value:"鄱阳县"},{label:"万年县",value:"万年县"},{label:"婺源县",value:"婺源县"},{label:"德兴市",value:"德兴市"}]}]},{label:"山东省",value:"山东省",children:[{label:"济南市",value:"济南市",children:[{label:"历下区",value:"历下区"},{label:"市中区",value:"市中区"},{label:"槐荫区",value:"槐荫区"},{label:"天桥区",value:"天桥区"},{label:"历城区",value:"历城区"},{label:"长清区",value:"长清区"},{label:"章丘区",value:"章丘区"},{label:"济阳区",value:"济阳区"},{label:"莱芜区",value:"莱芜区"},{label:"钢城区",value:"钢城区"},{label:"平阴县",value:"平阴县"},{label:"商河县",value:"商河县"},{label:"济南高新技术产业开发区",value:"济南高新技术产业开发区"}]},{label:"青岛市",value:"青岛市",children:[{label:"市南区",value:"市南区"},{label:"市北区",value:"市北区"},{label:"黄岛区",value:"黄岛区"},{label:"崂山区",value:"崂山区"},{label:"李沧区",value:"李沧区"},{label:"城阳区",value:"城阳区"},{label:"即墨区",value:"即墨区"},{label:"胶州市",value:"胶州市"},{label:"平度市",value:"平度市"},{label:"莱西市",value:"莱西市"}]},{label:"淄博市",value:"淄博市",children:[{label:"淄川区",value:"淄川区"},{label:"张店区",value:"张店区"},{label:"博山区",value:"博山区"},{label:"临淄区",value:"临淄区"},{label:"周村区",value:"周村区"},{label:"桓台县",value:"桓台县"},{label:"高青县",value:"高青县"},{label:"沂源县",value:"沂源县"}]},{label:"枣庄市",value:"枣庄市",children:[{label:"市中区",value:"市中区"},{label:"薛城区",value:"薛城区"},{label:"峄城区",value:"峄城区"},{label:"台儿庄区",value:"台儿庄区"},{label:"山亭区",value:"山亭区"},{label:"滕州市",value:"滕州市"}]},{label:"东营市",value:"东营市",children:[{label:"东营区",value:"东营区"},{label:"河口区",value:"河口区"},{label:"垦利区",value:"垦利区"},{label:"利津县",value:"利津县"},{label:"广饶县",value:"广饶县"},{label:"东营经济技术开发区",value:"东营经济技术开发区"},{label:"东营港经济开发区",value:"东营港经济开发区"}]},{label:"烟台市",value:"烟台市",children:[{label:"芝罘区",value:"芝罘区"},{label:"福山区",value:"福山区"},{label:"牟平区",value:"牟平区"},{label:"莱山区",value:"莱山区"},{label:"蓬莱区",value:"蓬莱区"},{label:"烟台高新技术产业开发区",value:"烟台高新技术产业开发区"},{label:"烟台经济技术开发区",value:"烟台经济技术开发区"},{label:"龙口市",value:"龙口市"},{label:"莱阳市",value:"莱阳市"},{label:"莱州市",value:"莱州市"},{label:"招远市",value:"招远市"},{label:"栖霞市",value:"栖霞市"},{label:"海阳市",value:"海阳市"}]},{label:"潍坊市",value:"潍坊市",children:[{label:"潍城区",value:"潍城区"},{label:"寒亭区",value:"寒亭区"},{label:"坊子区",value:"坊子区"},{label:"奎文区",value:"奎文区"},{label:"临朐县",value:"临朐县"},{label:"昌乐县",value:"昌乐县"},{label:"潍坊滨海经济技术开发区",value:"潍坊滨海经济技术开发区"},{label:"青州市",value:"青州市"},{label:"诸城市",value:"诸城市"},{label:"寿光市",value:"寿光市"},{label:"安丘市",value:"安丘市"},{label:"高密市",value:"高密市"},{label:"昌邑市",value:"昌邑市"}]},{label:"济宁市",value:"济宁市",children:[{label:"任城区",value:"任城区"},{label:"兖州区",value:"兖州区"},{label:"微山县",value:"微山县"},{label:"鱼台县",value:"鱼台县"},{label:"金乡县",value:"金乡县"},{label:"嘉祥县",value:"嘉祥县"},{label:"汶上县",value:"汶上县"},{label:"泗水县",value:"泗水县"},{label:"梁山县",value:"梁山县"},{label:"济宁高新技术产业开发区",value:"济宁高新技术产业开发区"},{label:"曲阜市",value:"曲阜市"},{label:"邹城市",value:"邹城市"}]},{label:"泰安市",value:"泰安市",children:[{label:"泰山区",value:"泰山区"},{label:"岱岳区",value:"岱岳区"},{label:"宁阳县",value:"宁阳县"},{label:"东平县",value:"东平县"},{label:"新泰市",value:"新泰市"},{label:"肥城市",value:"肥城市"}]},{label:"威海市",value:"威海市",children:[{label:"环翠区",value:"环翠区"},{label:"文登区",value:"文登区"},{label:"威海火炬高技术产业开发区",value:"威海火炬高技术产业开发区"},{label:"威海经济技术开发区",value:"威海经济技术开发区"},{label:"威海临港经济技术开发区",value:"威海临港经济技术开发区"},{label:"荣成市",value:"荣成市"},{label:"乳山市",value:"乳山市"}]},{label:"日照市",value:"日照市",children:[{label:"东港区",value:"东港区"},{label:"岚山区",value:"岚山区"},{label:"五莲县",value:"五莲县"},{label:"莒县",value:"莒县"},{label:"日照经济技术开发区",value:"日照经济技术开发区"}]},{label:"临沂市",value:"临沂市",children:[{label:"兰山区",value:"兰山区"},{label:"罗庄区",value:"罗庄区"},{label:"河东区",value:"河东区"},{label:"沂南县",value:"沂南县"},{label:"郯城县",value:"郯城县"},{label:"沂水县",value:"沂水县"},{label:"兰陵县",value:"兰陵县"},{label:"费县",value:"费县"},{label:"平邑县",value:"平邑县"},{label:"莒南县",value:"莒南县"},{label:"蒙阴县",value:"蒙阴县"},{label:"临沭县",value:"临沭县"},{label:"临沂高新技术产业开发区",value:"临沂高新技术产业开发区"}]},{label:"德州市",value:"德州市",children:[{label:"德城区",value:"德城区"},{label:"陵城区",value:"陵城区"},{label:"宁津县",value:"宁津县"},{label:"庆云县",value:"庆云县"},{label:"临邑县",value:"临邑县"},{label:"齐河县",value:"齐河县"},{label:"平原县",value:"平原县"},{label:"夏津县",value:"夏津县"},{label:"武城县",value:"武城县"},{label:"德州天衢新区",value:"德州天衢新区"},{label:"乐陵市",value:"乐陵市"},{label:"禹城市",value:"禹城市"}]},{label:"聊城市",value:"聊城市",children:[{label:"东昌府区",value:"东昌府区"},{label:"茌平区",value:"茌平区"},{label:"阳谷县",value:"阳谷县"},{label:"莘县",value:"莘县"},{label:"东阿县",value:"东阿县"},{label:"冠县",value:"冠县"},{label:"高唐县",value:"高唐县"},{label:"临清市",value:"临清市"}]},{label:"滨州市",value:"滨州市",children:[{label:"滨城区",value:"滨城区"},{label:"沾化区",value:"沾化区"},{label:"惠民县",value:"惠民县"},{label:"阳信县",value:"阳信县"},{label:"无棣县",value:"无棣县"},{label:"博兴县",value:"博兴县"},{label:"邹平市",value:"邹平市"}]},{label:"菏泽市",value:"菏泽市",children:[{label:"牡丹区",value:"牡丹区"},{label:"定陶区",value:"定陶区"},{label:"曹县",value:"曹县"},{label:"单县",value:"单县"},{label:"成武县",value:"成武县"},{label:"巨野县",value:"巨野县"},{label:"郓城县",value:"郓城县"},{label:"鄄城县",value:"鄄城县"},{label:"东明县",value:"东明县"},{label:"菏泽经济技术开发区",value:"菏泽经济技术开发区"},{label:"菏泽高新技术开发区",value:"菏泽高新技术开发区"}]}]},{label:"河南省",value:"河南省",children:[{label:"郑州市",value:"郑州市",children:[{label:"中原区",value:"中原区"},{label:"二七区",value:"二七区"},{label:"管城回族区",value:"管城回族区"},{label:"金水区",value:"金水区"},{label:"上街区",value:"上街区"},{label:"惠济区",value:"惠济区"},{label:"中牟县",value:"中牟县"},{label:"郑州经济技术开发区",value:"郑州经济技术开发区"},{label:"郑州高新技术产业开发区",value:"郑州高新技术产业开发区"},{label:"郑州航空港经济综合实验区",value:"郑州航空港经济综合实验区"},{label:"巩义市",value:"巩义市"},{label:"荥阳市",value:"荥阳市"},{label:"新密市",value:"新密市"},{label:"新郑市",value:"新郑市"},{label:"登封市",value:"登封市"}]},{label:"开封市",value:"开封市",children:[{label:"龙亭区",value:"龙亭区"},{label:"顺河回族区",value:"顺河回族区"},{label:"鼓楼区",value:"鼓楼区"},{label:"禹王台区",value:"禹王台区"},{label:"祥符区",value:"祥符区"},{label:"杞县",value:"杞县"},{label:"通许县",value:"通许县"},{label:"尉氏县",value:"尉氏县"},{label:"兰考县",value:"兰考县"}]},{label:"洛阳市",value:"洛阳市",children:[{label:"老城区",value:"老城区"},{label:"西工区",value:"西工区"},{label:"瀍河回族区",value:"瀍河回族区"},{label:"涧西区",value:"涧西区"},{label:"偃师区",value:"偃师区"},{label:"孟津区",value:"孟津区"},{label:"洛龙区",value:"洛龙区"},{label:"新安县",value:"新安县"},{label:"栾川县",value:"栾川县"},{label:"嵩县",value:"嵩县"},{label:"汝阳县",value:"汝阳县"},{label:"宜阳县",value:"宜阳县"},{label:"洛宁县",value:"洛宁县"},{label:"伊川县",value:"伊川县"},{label:"洛阳高新技术产业开发区",value:"洛阳高新技术产业开发区"}]},{label:"平顶山市",value:"平顶山市",children:[{label:"新华区",value:"新华区"},{label:"卫东区",value:"卫东区"},{label:"石龙区",value:"石龙区"},{label:"湛河区",value:"湛河区"},{label:"宝丰县",value:"宝丰县"},{label:"叶县",value:"叶县"},{label:"鲁山县",value:"鲁山县"},{label:"郏县",value:"郏县"},{label:"平顶山高新技术产业开发区",value:"平顶山高新技术产业开发区"},{label:"平顶山市城乡一体化示范区",value:"平顶山市城乡一体化示范区"},{label:"舞钢市",value:"舞钢市"},{label:"汝州市",value:"汝州市"}]},{label:"安阳市",value:"安阳市",children:[{label:"文峰区",value:"文峰区"},{label:"北关区",value:"北关区"},{label:"殷都区",value:"殷都区"},{label:"龙安区",value:"龙安区"},{label:"安阳县",value:"安阳县"},{label:"汤阴县",value:"汤阴县"},{label:"滑县",value:"滑县"},{label:"内黄县",value:"内黄县"},{label:"安阳高新技术产业开发区",value:"安阳高新技术产业开发区"},{label:"林州市",value:"林州市"}]},{label:"鹤壁市",value:"鹤壁市",children:[{label:"鹤山区",value:"鹤山区"},{label:"山城区",value:"山城区"},{label:"淇滨区",value:"淇滨区"},{label:"浚县",value:"浚县"},{label:"淇县",value:"淇县"},{label:"鹤壁经济技术开发区",value:"鹤壁经济技术开发区"}]},{label:"新乡市",value:"新乡市",children:[{label:"红旗区",value:"红旗区"},{label:"卫滨区",value:"卫滨区"},{label:"凤泉区",value:"凤泉区"},{label:"牧野区",value:"牧野区"},{label:"新乡县",value:"新乡县"},{label:"获嘉县",value:"获嘉县"},{label:"原阳县",value:"原阳县"},{label:"延津县",value:"延津县"},{label:"封丘县",value:"封丘县"},{label:"新乡高新技术产业开发区",value:"新乡高新技术产业开发区"},{label:"新乡经济技术开发区",value:"新乡经济技术开发区"},{label:"新乡市平原城乡一体化示范区",value:"新乡市平原城乡一体化示范区"},{label:"卫辉市",value:"卫辉市"},{label:"辉县市",value:"辉县市"},{label:"长垣市",value:"长垣市"}]},{label:"焦作市",value:"焦作市",children:[{label:"解放区",value:"解放区"},{label:"中站区",value:"中站区"},{label:"马村区",value:"马村区"},{label:"山阳区",value:"山阳区"},{label:"修武县",value:"修武县"},{label:"博爱县",value:"博爱县"},{label:"武陟县",value:"武陟县"},{label:"温县",value:"温县"},{label:"焦作城乡一体化示范区",value:"焦作城乡一体化示范区"},{label:"沁阳市",value:"沁阳市"},{label:"孟州市",value:"孟州市"}]},{label:"濮阳市",value:"濮阳市",children:[{label:"华龙区",value:"华龙区"},{label:"清丰县",value:"清丰县"},{label:"南乐县",value:"南乐县"},{label:"范县",value:"范县"},{label:"台前县",value:"台前县"},{label:"濮阳县",value:"濮阳县"},{label:"河南濮阳工业园区",value:"河南濮阳工业园区"},{label:"濮阳经济技术开发区",value:"濮阳经济技术开发区"}]},{label:"许昌市",value:"许昌市",children:[{label:"魏都区",value:"魏都区"},{label:"建安区",value:"建安区"},{label:"鄢陵县",value:"鄢陵县"},{label:"襄城县",value:"襄城县"},{label:"许昌经济技术开发区",value:"许昌经济技术开发区"},{label:"禹州市",value:"禹州市"},{label:"长葛市",value:"长葛市"}]},{label:"漯河市",value:"漯河市",children:[{label:"源汇区",value:"源汇区"},{label:"郾城区",value:"郾城区"},{label:"召陵区",value:"召陵区"},{label:"舞阳县",value:"舞阳县"},{label:"临颍县",value:"临颍县"},{label:"漯河经济技术开发区",value:"漯河经济技术开发区"}]},{label:"三门峡市",value:"三门峡市",children:[{label:"湖滨区",value:"湖滨区"},{label:"陕州区",value:"陕州区"},{label:"渑池县",value:"渑池县"},{label:"卢氏县",value:"卢氏县"},{label:"河南三门峡经济开发区",value:"河南三门峡经济开发区"},{label:"义马市",value:"义马市"},{label:"灵宝市",value:"灵宝市"}]},{label:"南阳市",value:"南阳市",children:[{label:"宛城区",value:"宛城区"},{label:"卧龙区",value:"卧龙区"},{label:"南召县",value:"南召县"},{label:"方城县",value:"方城县"},{label:"西峡县",value:"西峡县"},{label:"镇平县",value:"镇平县"},{label:"内乡县",value:"内乡县"},{label:"淅川县",value:"淅川县"},{label:"社旗县",value:"社旗县"},{label:"唐河县",value:"唐河县"},{label:"新野县",value:"新野县"},{label:"桐柏县",value:"桐柏县"},{label:"南阳高新技术产业开发区",value:"南阳高新技术产业开发区"},{label:"南阳市城乡一体化示范区",value:"南阳市城乡一体化示范区"},{label:"邓州市",value:"邓州市"}]},{label:"商丘市",value:"商丘市",children:[{label:"梁园区",value:"梁园区"},{label:"睢阳区",value:"睢阳区"},{label:"民权县",value:"民权县"},{label:"睢县",value:"睢县"},{label:"宁陵县",value:"宁陵县"},{label:"柘城县",value:"柘城县"},{label:"虞城县",value:"虞城县"},{label:"夏邑县",value:"夏邑县"},{label:"豫东综合物流产业聚集区",value:"豫东综合物流产业聚集区"},{label:"河南商丘经济开发区",value:"河南商丘经济开发区"},{label:"永城市",value:"永城市"}]},{label:"信阳市",value:"信阳市",children:[{label:"浉河区",value:"浉河区"},{label:"平桥区",value:"平桥区"},{label:"罗山县",value:"罗山县"},{label:"光山县",value:"光山县"},{label:"新县",value:"新县"},{label:"商城县",value:"商城县"},{label:"固始县",value:"固始县"},{label:"潢川县",value:"潢川县"},{label:"淮滨县",value:"淮滨县"},{label:"息县",value:"息县"},{label:"信阳高新技术产业开发区",value:"信阳高新技术产业开发区"}]},{label:"周口市",value:"周口市",children:[{label:"川汇区",value:"川汇区"},{label:"淮阳区",value:"淮阳区"},{label:"扶沟县",value:"扶沟县"},{label:"西华县",value:"西华县"},{label:"商水县",value:"商水县"},{label:"沈丘县",value:"沈丘县"},{label:"郸城县",value:"郸城县"},{label:"太康县",value:"太康县"},{label:"鹿邑县",value:"鹿邑县"},{label:"周口临港开发区",value:"周口临港开发区"},{label:"项城市",value:"项城市"}]},{label:"驻马店市",value:"驻马店市",children:[{label:"驿城区",value:"驿城区"},{label:"西平县",value:"西平县"},{label:"上蔡县",value:"上蔡县"},{label:"平舆县",value:"平舆县"},{label:"正阳县",value:"正阳县"},{label:"确山县",value:"确山县"},{label:"泌阳县",value:"泌阳县"},{label:"汝南县",value:"汝南县"},{label:"遂平县",value:"遂平县"},{label:"新蔡县",value:"新蔡县"},{label:"河南驻马店经济开发区",value:"河南驻马店经济开发区"}]},{label:"省直辖县级行政区划",value:"省直辖县级行政区划",children:[{label:"济源市",value:"济源市"}]}]},{label:"湖北省",value:"湖北省",children:[{label:"武汉市",value:"武汉市",children:[{label:"江岸区",value:"江岸区"},{label:"江汉区",value:"江汉区"},{label:"硚口区",value:"硚口区"},{label:"汉阳区",value:"汉阳区"},{label:"武昌区",value:"武昌区"},{label:"青山区",value:"青山区"},{label:"洪山区",value:"洪山区"},{label:"东西湖区",value:"东西湖区"},{label:"汉南区",value:"汉南区"},{label:"蔡甸区",value:"蔡甸区"},{label:"江夏区",value:"江夏区"},{label:"黄陂区",value:"黄陂区"},{label:"新洲区",value:"新洲区"}]},{label:"黄石市",value:"黄石市",children:[{label:"黄石港区",value:"黄石港区"},{label:"西塞山区",value:"西塞山区"},{label:"下陆区",value:"下陆区"},{label:"铁山区",value:"铁山区"},{label:"阳新县",value:"阳新县"},{label:"大冶市",value:"大冶市"}]},{label:"十堰市",value:"十堰市",children:[{label:"茅箭区",value:"茅箭区"},{label:"张湾区",value:"张湾区"},{label:"郧阳区",value:"郧阳区"},{label:"郧西县",value:"郧西县"},{label:"竹山县",value:"竹山县"},{label:"竹溪县",value:"竹溪县"},{label:"房县",value:"房县"},{label:"丹江口市",value:"丹江口市"}]},{label:"宜昌市",value:"宜昌市",children:[{label:"西陵区",value:"西陵区"},{label:"伍家岗区",value:"伍家岗区"},{label:"点军区",value:"点军区"},{label:"猇亭区",value:"猇亭区"},{label:"夷陵区",value:"夷陵区"},{label:"远安县",value:"远安县"},{label:"兴山县",value:"兴山县"},{label:"秭归县",value:"秭归县"},{label:"长阳土家族自治县",value:"长阳土家族自治县"},{label:"五峰土家族自治县",value:"五峰土家族自治县"},{label:"宜都市",value:"宜都市"},{label:"当阳市",value:"当阳市"},{label:"枝江市",value:"枝江市"}]},{label:"襄阳市",value:"襄阳市",children:[{label:"襄城区",value:"襄城区"},{label:"樊城区",value:"樊城区"},{label:"襄州区",value:"襄州区"},{label:"南漳县",value:"南漳县"},{label:"谷城县",value:"谷城县"},{label:"保康县",value:"保康县"},{label:"老河口市",value:"老河口市"},{label:"枣阳市",value:"枣阳市"},{label:"宜城市",value:"宜城市"}]},{label:"鄂州市",value:"鄂州市",children:[{label:"梁子湖区",value:"梁子湖区"},{label:"华容区",value:"华容区"},{label:"鄂城区",value:"鄂城区"}]},{label:"荆门市",value:"荆门市",children:[{label:"东宝区",value:"东宝区"},{label:"掇刀区",value:"掇刀区"},{label:"沙洋县",value:"沙洋县"},{label:"钟祥市",value:"钟祥市"},{label:"京山市",value:"京山市"}]},{label:"孝感市",value:"孝感市",children:[{label:"孝南区",value:"孝南区"},{label:"孝昌县",value:"孝昌县"},{label:"大悟县",value:"大悟县"},{label:"云梦县",value:"云梦县"},{label:"应城市",value:"应城市"},{label:"安陆市",value:"安陆市"},{label:"汉川市",value:"汉川市"}]},{label:"荆州市",value:"荆州市",children:[{label:"沙市区",value:"沙市区"},{label:"荆州区",value:"荆州区"},{label:"公安县",value:"公安县"},{label:"江陵县",value:"江陵县"},{label:"荆州经济技术开发区",value:"荆州经济技术开发区"},{label:"石首市",value:"石首市"},{label:"洪湖市",value:"洪湖市"},{label:"松滋市",value:"松滋市"},{label:"监利市",value:"监利市"}]},{label:"黄冈市",value:"黄冈市",children:[{label:"黄州区",value:"黄州区"},{label:"团风县",value:"团风县"},{label:"红安县",value:"红安县"},{label:"罗田县",value:"罗田县"},{label:"英山县",value:"英山县"},{label:"浠水县",value:"浠水县"},{label:"蕲春县",value:"蕲春县"},{label:"黄梅县",value:"黄梅县"},{label:"龙感湖管理区",value:"龙感湖管理区"},{label:"麻城市",value:"麻城市"},{label:"武穴市",value:"武穴市"}]},{label:"咸宁市",value:"咸宁市",children:[{label:"咸安区",value:"咸安区"},{label:"嘉鱼县",value:"嘉鱼县"},{label:"通城县",value:"通城县"},{label:"崇阳县",value:"崇阳县"},{label:"通山县",value:"通山县"},{label:"赤壁市",value:"赤壁市"}]},{label:"随州市",value:"随州市",children:[{label:"曾都区",value:"曾都区"},{label:"随县",value:"随县"},{label:"广水市",value:"广水市"}]},{label:"恩施土家族苗族自治州",value:"恩施土家族苗族自治州",children:[{label:"恩施市",value:"恩施市"},{label:"利川市",value:"利川市"},{label:"建始县",value:"建始县"},{label:"巴东县",value:"巴东县"},{label:"宣恩县",value:"宣恩县"},{label:"咸丰县",value:"咸丰县"},{label:"来凤县",value:"来凤县"},{label:"鹤峰县",value:"鹤峰县"}]},{label:"省直辖县级行政区划",value:"省直辖县级行政区划",children:[{label:"仙桃市",value:"仙桃市"},{label:"潜江市",value:"潜江市"},{label:"天门市",value:"天门市"},{label:"神农架林区",value:"神农架林区"}]}]},{label:"湖南省",value:"湖南省",children:[{label:"长沙市",value:"长沙市",children:[{label:"芙蓉区",value:"芙蓉区"},{label:"天心区",value:"天心区"},{label:"岳麓区",value:"岳麓区"},{label:"开福区",value:"开福区"},{label:"雨花区",value:"雨花区"},{label:"望城区",value:"望城区"},{label:"长沙县",value:"长沙县"},{label:"浏阳市",value:"浏阳市"},{label:"宁乡市",value:"宁乡市"}]},{label:"株洲市",value:"株洲市",children:[{label:"荷塘区",value:"荷塘区"},{label:"芦淞区",value:"芦淞区"},{label:"石峰区",value:"石峰区"},{label:"天元区",value:"天元区"},{label:"渌口区",value:"渌口区"},{label:"攸县",value:"攸县"},{label:"茶陵县",value:"茶陵县"},{label:"炎陵县",value:"炎陵县"},{label:"醴陵市",value:"醴陵市"}]},{label:"湘潭市",value:"湘潭市",children:[{label:"雨湖区",value:"雨湖区"},{label:"岳塘区",value:"岳塘区"},{label:"湘潭县",value:"湘潭县"},{label:"湖南湘潭高新技术产业园区",value:"湖南湘潭高新技术产业园区"},{label:"湘潭昭山示范区",value:"湘潭昭山示范区"},{label:"湘潭九华示范区",value:"湘潭九华示范区"},{label:"湘乡市",value:"湘乡市"},{label:"韶山市",value:"韶山市"}]},{label:"衡阳市",value:"衡阳市",children:[{label:"珠晖区",value:"珠晖区"},{label:"雁峰区",value:"雁峰区"},{label:"石鼓区",value:"石鼓区"},{label:"蒸湘区",value:"蒸湘区"},{label:"南岳区",value:"南岳区"},{label:"衡阳县",value:"衡阳县"},{label:"衡南县",value:"衡南县"},{label:"衡山县",value:"衡山县"},{label:"衡东县",value:"衡东县"},{label:"祁东县",value:"祁东县"},{label:"湖南衡阳松木经济开发区",value:"湖南衡阳松木经济开发区"},{label:"湖南衡阳高新技术产业园区",value:"湖南衡阳高新技术产业园区"},{label:"耒阳市",value:"耒阳市"},{label:"常宁市",value:"常宁市"}]},{label:"邵阳市",value:"邵阳市",children:[{label:"双清区",value:"双清区"},{label:"大祥区",value:"大祥区"},{label:"北塔区",value:"北塔区"},{label:"新邵县",value:"新邵县"},{label:"邵阳县",value:"邵阳县"},{label:"隆回县",value:"隆回县"},{label:"洞口县",value:"洞口县"},{label:"绥宁县",value:"绥宁县"},{label:"新宁县",value:"新宁县"},{label:"城步苗族自治县",value:"城步苗族自治县"},{label:"武冈市",value:"武冈市"},{label:"邵东市",value:"邵东市"}]},{label:"岳阳市",value:"岳阳市",children:[{label:"岳阳楼区",value:"岳阳楼区"},{label:"云溪区",value:"云溪区"},{label:"君山区",value:"君山区"},{label:"岳阳县",value:"岳阳县"},{label:"华容县",value:"华容县"},{label:"湘阴县",value:"湘阴县"},{label:"平江县",value:"平江县"},{label:"岳阳市屈原管理区",value:"岳阳市屈原管理区"},{label:"汨罗市",value:"汨罗市"},{label:"临湘市",value:"临湘市"}]},{label:"常德市",value:"常德市",children:[{label:"武陵区",value:"武陵区"},{label:"鼎城区",value:"鼎城区"},{label:"安乡县",value:"安乡县"},{label:"汉寿县",value:"汉寿县"},{label:"澧县",value:"澧县"},{label:"临澧县",value:"临澧县"},{label:"桃源县",value:"桃源县"},{label:"石门县",value:"石门县"},{label:"常德市西洞庭管理区",value:"常德市西洞庭管理区"},{label:"津市市",value:"津市市"}]},{label:"张家界市",value:"张家界市",children:[{label:"永定区",value:"永定区"},{label:"武陵源区",value:"武陵源区"},{label:"慈利县",value:"慈利县"},{label:"桑植县",value:"桑植县"}]},{label:"益阳市",value:"益阳市",children:[{label:"资阳区",value:"资阳区"},{label:"赫山区",value:"赫山区"},{label:"南县",value:"南县"},{label:"桃江县",value:"桃江县"},{label:"安化县",value:"安化县"},{label:"益阳市大通湖管理区",value:"益阳市大通湖管理区"},{label:"湖南益阳高新技术产业园区",value:"湖南益阳高新技术产业园区"},{label:"沅江市",value:"沅江市"}]},{label:"郴州市",value:"郴州市",children:[{label:"北湖区",value:"北湖区"},{label:"苏仙区",value:"苏仙区"},{label:"桂阳县",value:"桂阳县"},{label:"宜章县",value:"宜章县"},{label:"永兴县",value:"永兴县"},{label:"嘉禾县",value:"嘉禾县"},{label:"临武县",value:"临武县"},{label:"汝城县",value:"汝城县"},{label:"桂东县",value:"桂东县"},{label:"安仁县",value:"安仁县"},{label:"资兴市",value:"资兴市"}]},{label:"永州市",value:"永州市",children:[{label:"零陵区",value:"零陵区"},{label:"冷水滩区",value:"冷水滩区"},{label:"东安县",value:"东安县"},{label:"双牌县",value:"双牌县"},{label:"道县",value:"道县"},{label:"江永县",value:"江永县"},{label:"宁远县",value:"宁远县"},{label:"蓝山县",value:"蓝山县"},{label:"新田县",value:"新田县"},{label:"江华瑶族自治县",value:"江华瑶族自治县"},{label:"永州经济技术开发区",value:"永州经济技术开发区"},{label:"永州市回龙圩管理区",value:"永州市回龙圩管理区"},{label:"祁阳市",value:"祁阳市"}]},{label:"怀化市",value:"怀化市",children:[{label:"鹤城区",value:"鹤城区"},{label:"中方县",value:"中方县"},{label:"沅陵县",value:"沅陵县"},{label:"辰溪县",value:"辰溪县"},{label:"溆浦县",value:"溆浦县"},{label:"会同县",value:"会同县"},{label:"麻阳苗族自治县",value:"麻阳苗族自治县"},{label:"新晃侗族自治县",value:"新晃侗族自治县"},{label:"芷江侗族自治县",value:"芷江侗族自治县"},{label:"靖州苗族侗族自治县",value:"靖州苗族侗族自治县"},{label:"通道侗族自治县",value:"通道侗族自治县"},{label:"怀化市洪江管理区",value:"怀化市洪江管理区"},{label:"洪江市",value:"洪江市"}]},{label:"娄底市",value:"娄底市",children:[{label:"娄星区",value:"娄星区"},{label:"双峰县",value:"双峰县"},{label:"新化县",value:"新化县"},{label:"冷水江市",value:"冷水江市"},{label:"涟源市",value:"涟源市"}]},{label:"湘西土家族苗族自治州",value:"湘西土家族苗族自治州",children:[{label:"吉首市",value:"吉首市"},{label:"泸溪县",value:"泸溪县"},{label:"凤凰县",value:"凤凰县"},{label:"花垣县",value:"花垣县"},{label:"保靖县",value:"保靖县"},{label:"古丈县",value:"古丈县"},{label:"永顺县",value:"永顺县"},{label:"龙山县",value:"龙山县"}]}]},{label:"广东省",value:"广东省",children:[{label:"广州市",value:"广州市",children:[{label:"荔湾区",value:"荔湾区"},{label:"越秀区",value:"越秀区"},{label:"海珠区",value:"海珠区"},{label:"天河区",value:"天河区"},{label:"白云区",value:"白云区"},{label:"黄埔区",value:"黄埔区"},{label:"番禺区",value:"番禺区"},{label:"花都区",value:"花都区"},{label:"南沙区",value:"南沙区"},{label:"从化区",value:"从化区"},{label:"增城区",value:"增城区"}]},{label:"韶关市",value:"韶关市",children:[{label:"武江区",value:"武江区"},{label:"浈江区",value:"浈江区"},{label:"曲江区",value:"曲江区"},{label:"始兴县",value:"始兴县"},{label:"仁化县",value:"仁化县"},{label:"翁源县",value:"翁源县"},{label:"乳源瑶族自治县",value:"乳源瑶族自治县"},{label:"新丰县",value:"新丰县"},{label:"乐昌市",value:"乐昌市"},{label:"南雄市",value:"南雄市"}]},{label:"深圳市",value:"深圳市",children:[{label:"罗湖区",value:"罗湖区"},{label:"福田区",value:"福田区"},{label:"南山区",value:"南山区"},{label:"宝安区",value:"宝安区"},{label:"龙岗区",value:"龙岗区"},{label:"盐田区",value:"盐田区"},{label:"龙华区",value:"龙华区"},{label:"坪山区",value:"坪山区"},{label:"光明区",value:"光明区"}]},{label:"珠海市",value:"珠海市",children:[{label:"香洲区",value:"香洲区"},{label:"斗门区",value:"斗门区"},{label:"金湾区",value:"金湾区"}]},{label:"汕头市",value:"汕头市",children:[{label:"龙湖区",value:"龙湖区"},{label:"金平区",value:"金平区"},{label:"濠江区",value:"濠江区"},{label:"潮阳区",value:"潮阳区"},{label:"潮南区",value:"潮南区"},{label:"澄海区",value:"澄海区"},{label:"南澳县",value:"南澳县"}]},{label:"佛山市",value:"佛山市",children:[{label:"禅城区",value:"禅城区"},{label:"南海区",value:"南海区"},{label:"顺德区",value:"顺德区"},{label:"三水区",value:"三水区"},{label:"高明区",value:"高明区"}]},{label:"江门市",value:"江门市",children:[{label:"蓬江区",value:"蓬江区"},{label:"江海区",value:"江海区"},{label:"新会区",value:"新会区"},{label:"台山市",value:"台山市"},{label:"开平市",value:"开平市"},{label:"鹤山市",value:"鹤山市"},{label:"恩平市",value:"恩平市"}]},{label:"湛江市",value:"湛江市",children:[{label:"赤坎区",value:"赤坎区"},{label:"霞山区",value:"霞山区"},{label:"坡头区",value:"坡头区"},{label:"麻章区",value:"麻章区"},{label:"遂溪县",value:"遂溪县"},{label:"徐闻县",value:"徐闻县"},{label:"廉江市",value:"廉江市"},{label:"雷州市",value:"雷州市"},{label:"吴川市",value:"吴川市"}]},{label:"茂名市",value:"茂名市",children:[{label:"茂南区",value:"茂南区"},{label:"电白区",value:"电白区"},{label:"高州市",value:"高州市"},{label:"化州市",value:"化州市"},{label:"信宜市",value:"信宜市"}]},{label:"肇庆市",value:"肇庆市",children:[{label:"端州区",value:"端州区"},{label:"鼎湖区",value:"鼎湖区"},{label:"高要区",value:"高要区"},{label:"广宁县",value:"广宁县"},{label:"怀集县",value:"怀集县"},{label:"封开县",value:"封开县"},{label:"德庆县",value:"德庆县"},{label:"四会市",value:"四会市"}]},{label:"惠州市",value:"惠州市",children:[{label:"惠城区",value:"惠城区"},{label:"惠阳区",value:"惠阳区"},{label:"博罗县",value:"博罗县"},{label:"惠东县",value:"惠东县"},{label:"龙门县",value:"龙门县"}]},{label:"梅州市",value:"梅州市",children:[{label:"梅江区",value:"梅江区"},{label:"梅县区",value:"梅县区"},{label:"大埔县",value:"大埔县"},{label:"丰顺县",value:"丰顺县"},{label:"五华县",value:"五华县"},{label:"平远县",value:"平远县"},{label:"蕉岭县",value:"蕉岭县"},{label:"兴宁市",value:"兴宁市"}]},{label:"汕尾市",value:"汕尾市",children:[{label:"城区",value:"城区"},{label:"海丰县",value:"海丰县"},{label:"陆河县",value:"陆河县"},{label:"陆丰市",value:"陆丰市"}]},{label:"河源市",value:"河源市",children:[{label:"源城区",value:"源城区"},{label:"紫金县",value:"紫金县"},{label:"龙川县",value:"龙川县"},{label:"连平县",value:"连平县"},{label:"和平县",value:"和平县"},{label:"东源县",value:"东源县"}]},{label:"阳江市",value:"阳江市",children:[{label:"江城区",value:"江城区"},{label:"阳东区",value:"阳东区"},{label:"阳西县",value:"阳西县"},{label:"阳春市",value:"阳春市"}]},{label:"清远市",value:"清远市",children:[{label:"清城区",value:"清城区"},{label:"清新区",value:"清新区"},{label:"佛冈县",value:"佛冈县"},{label:"阳山县",value:"阳山县"},{label:"连山壮族瑶族自治县",value:"连山壮族瑶族自治县"},{label:"连南瑶族自治县",value:"连南瑶族自治县"},{label:"英德市",value:"英德市"},{label:"连州市",value:"连州市"}]},{label:"东莞市",value:"东莞市",children:[{label:"东城街道",value:"东城街道"},{label:"南城街道",value:"南城街道"},{label:"万江街道",value:"万江街道"},{label:"莞城街道",value:"莞城街道"},{label:"石碣镇",value:"石碣镇"},{label:"石龙镇",value:"石龙镇"},{label:"茶山镇",value:"茶山镇"},{label:"石排镇",value:"石排镇"},{label:"企石镇",value:"企石镇"},{label:"横沥镇",value:"横沥镇"},{label:"桥头镇",value:"桥头镇"},{label:"谢岗镇",value:"谢岗镇"},{label:"东坑镇",value:"东坑镇"},{label:"常平镇",value:"常平镇"},{label:"寮步镇",value:"寮步镇"},{label:"樟木头镇",value:"樟木头镇"},{label:"大朗镇",value:"大朗镇"},{label:"黄江镇",value:"黄江镇"},{label:"清溪镇",value:"清溪镇"},{label:"塘厦镇",value:"塘厦镇"},{label:"凤岗镇",value:"凤岗镇"},{label:"大岭山镇",value:"大岭山镇"},{label:"长安镇",value:"长安镇"},{label:"虎门镇",value:"虎门镇"},{label:"厚街镇",value:"厚街镇"},{label:"沙田镇",value:"沙田镇"},{label:"道滘镇",value:"道滘镇"},{label:"洪梅镇",value:"洪梅镇"},{label:"麻涌镇",value:"麻涌镇"},{label:"望牛墩镇",value:"望牛墩镇"},{label:"中堂镇",value:"中堂镇"},{label:"高埗镇",value:"高埗镇"},{label:"松山湖",value:"松山湖"},{label:"东莞港",value:"东莞港"},{label:"东莞生态园",value:"东莞生态园"},{label:"东莞滨海湾新区",value:"东莞滨海湾新区"}]},{label:"中山市",value:"中山市",children:[{label:"石岐街道",value:"石岐街道"},{label:"东区街道",value:"东区街道"},{label:"中山港街道",value:"中山港街道"},{label:"西区街道",value:"西区街道"},{label:"南区街道",value:"南区街道"},{label:"五桂山街道",value:"五桂山街道"},{label:"民众街道",value:"民众街道"},{label:"南朗街道",value:"南朗街道"},{label:"黄圃镇",value:"黄圃镇"},{label:"东凤镇",value:"东凤镇"},{label:"古镇镇",value:"古镇镇"},{label:"沙溪镇",value:"沙溪镇"},{label:"坦洲镇",value:"坦洲镇"},{label:"港口镇",value:"港口镇"},{label:"三角镇",value:"三角镇"},{label:"横栏镇",value:"横栏镇"},{label:"南头镇",value:"南头镇"},{label:"阜沙镇",value:"阜沙镇"},{label:"三乡镇",value:"三乡镇"},{label:"板芙镇",value:"板芙镇"},{label:"大涌镇",value:"大涌镇"},{label:"神湾镇",value:"神湾镇"},{label:"小榄镇",value:"小榄镇"}]},{label:"潮州市",value:"潮州市",children:[{label:"湘桥区",value:"湘桥区"},{label:"潮安区",value:"潮安区"},{label:"饶平县",value:"饶平县"}]},{label:"揭阳市",value:"揭阳市",children:[{label:"榕城区",value:"榕城区"},{label:"揭东区",value:"揭东区"},{label:"揭西县",value:"揭西县"},{label:"惠来县",value:"惠来县"},{label:"普宁市",value:"普宁市"}]},{label:"云浮市",value:"云浮市",children:[{label:"云城区",value:"云城区"},{label:"云安区",value:"云安区"},{label:"新兴县",value:"新兴县"},{label:"郁南县",value:"郁南县"},{label:"罗定市",value:"罗定市"}]}]},{label:"广西壮族自治区",value:"广西壮族自治区",children:[{label:"南宁市",value:"南宁市",children:[{label:"兴宁区",value:"兴宁区"},{label:"青秀区",value:"青秀区"},{label:"江南区",value:"江南区"},{label:"西乡塘区",value:"西乡塘区"},{label:"良庆区",value:"良庆区"},{label:"邕宁区",value:"邕宁区"},{label:"武鸣区",value:"武鸣区"},{label:"隆安县",value:"隆安县"},{label:"马山县",value:"马山县"},{label:"上林县",value:"上林县"},{label:"宾阳县",value:"宾阳县"},{label:"横州市",value:"横州市"}]},{label:"柳州市",value:"柳州市",children:[{label:"城中区",value:"城中区"},{label:"鱼峰区",value:"鱼峰区"},{label:"柳南区",value:"柳南区"},{label:"柳北区",value:"柳北区"},{label:"柳江区",value:"柳江区"},{label:"柳城县",value:"柳城县"},{label:"鹿寨县",value:"鹿寨县"},{label:"融安县",value:"融安县"},{label:"融水苗族自治县",value:"融水苗族自治县"},{label:"三江侗族自治县",value:"三江侗族自治县"}]},{label:"桂林市",value:"桂林市",children:[{label:"秀峰区",value:"秀峰区"},{label:"叠彩区",value:"叠彩区"},{label:"象山区",value:"象山区"},{label:"七星区",value:"七星区"},{label:"雁山区",value:"雁山区"},{label:"临桂区",value:"临桂区"},{label:"阳朔县",value:"阳朔县"},{label:"灵川县",value:"灵川县"},{label:"全州县",value:"全州县"},{label:"兴安县",value:"兴安县"},{label:"永福县",value:"永福县"},{label:"灌阳县",value:"灌阳县"},{label:"龙胜各族自治县",value:"龙胜各族自治县"},{label:"资源县",value:"资源县"},{label:"平乐县",value:"平乐县"},{label:"恭城瑶族自治县",value:"恭城瑶族自治县"},{label:"荔浦市",value:"荔浦市"}]},{label:"梧州市",value:"梧州市",children:[{label:"万秀区",value:"万秀区"},{label:"长洲区",value:"长洲区"},{label:"龙圩区",value:"龙圩区"},{label:"苍梧县",value:"苍梧县"},{label:"藤县",value:"藤县"},{label:"蒙山县",value:"蒙山县"},{label:"岑溪市",value:"岑溪市"}]},{label:"北海市",value:"北海市",children:[{label:"海城区",value:"海城区"},{label:"银海区",value:"银海区"},{label:"铁山港区",value:"铁山港区"},{label:"合浦县",value:"合浦县"}]},{label:"防城港市",value:"防城港市",children:[{label:"港口区",value:"港口区"},{label:"防城区",value:"防城区"},{label:"上思县",value:"上思县"},{label:"东兴市",value:"东兴市"}]},{label:"钦州市",value:"钦州市",children:[{label:"钦南区",value:"钦南区"},{label:"钦北区",value:"钦北区"},{label:"灵山县",value:"灵山县"},{label:"浦北县",value:"浦北县"}]},{label:"贵港市",value:"贵港市",children:[{label:"港北区",value:"港北区"},{label:"港南区",value:"港南区"},{label:"覃塘区",value:"覃塘区"},{label:"平南县",value:"平南县"},{label:"桂平市",value:"桂平市"}]},{label:"玉林市",value:"玉林市",children:[{label:"玉州区",value:"玉州区"},{label:"福绵区",value:"福绵区"},{label:"容县",value:"容县"},{label:"陆川县",value:"陆川县"},{label:"博白县",value:"博白县"},{label:"兴业县",value:"兴业县"},{label:"北流市",value:"北流市"}]},{label:"百色市",value:"百色市",children:[{label:"右江区",value:"右江区"},{label:"田阳区",value:"田阳区"},{label:"田东县",value:"田东县"},{label:"德保县",value:"德保县"},{label:"那坡县",value:"那坡县"},{label:"凌云县",value:"凌云县"},{label:"乐业县",value:"乐业县"},{label:"田林县",value:"田林县"},{label:"西林县",value:"西林县"},{label:"隆林各族自治县",value:"隆林各族自治县"},{label:"靖西市",value:"靖西市"},{label:"平果市",value:"平果市"}]},{label:"贺州市",value:"贺州市",children:[{label:"八步区",value:"八步区"},{label:"平桂区",value:"平桂区"},{label:"昭平县",value:"昭平县"},{label:"钟山县",value:"钟山县"},{label:"富川瑶族自治县",value:"富川瑶族自治县"}]},{label:"河池市",value:"河池市",children:[{label:"金城江区",value:"金城江区"},{label:"宜州区",value:"宜州区"},{label:"南丹县",value:"南丹县"},{label:"天峨县",value:"天峨县"},{label:"凤山县",value:"凤山县"},{label:"东兰县",value:"东兰县"},{label:"罗城仫佬族自治县",value:"罗城仫佬族自治县"},{label:"环江毛南族自治县",value:"环江毛南族自治县"},{label:"巴马瑶族自治县",value:"巴马瑶族自治县"},{label:"都安瑶族自治县",value:"都安瑶族自治县"},{label:"大化瑶族自治县",value:"大化瑶族自治县"}]},{label:"来宾市",value:"来宾市",children:[{label:"兴宾区",value:"兴宾区"},{label:"忻城县",value:"忻城县"},{label:"象州县",value:"象州县"},{label:"武宣县",value:"武宣县"},{label:"金秀瑶族自治县",value:"金秀瑶族自治县"},{label:"合山市",value:"合山市"}]},{label:"崇左市",value:"崇左市",children:[{label:"江州区",value:"江州区"},{label:"扶绥县",value:"扶绥县"},{label:"宁明县",value:"宁明县"},{label:"龙州县",value:"龙州县"},{label:"大新县",value:"大新县"},{label:"天等县",value:"天等县"},{label:"凭祥市",value:"凭祥市"}]}]},{label:"海南省",value:"海南省",children:[{label:"海口市",value:"海口市",children:[{label:"秀英区",value:"秀英区"},{label:"龙华区",value:"龙华区"},{label:"琼山区",value:"琼山区"},{label:"美兰区",value:"美兰区"}]},{label:"三亚市",value:"三亚市",children:[{label:"海棠区",value:"海棠区"},{label:"吉阳区",value:"吉阳区"},{label:"天涯区",value:"天涯区"},{label:"崖州区",value:"崖州区"}]},{label:"三沙市",value:"三沙市",children:[{label:"西沙群岛",value:"西沙群岛"},{label:"南沙群岛",value:"南沙群岛"},{label:"中沙群岛的岛礁及其海域",value:"中沙群岛的岛礁及其海域"}]},{label:"儋州市",value:"儋州市",children:[{label:"那大镇",value:"那大镇"},{label:"和庆镇",value:"和庆镇"},{label:"南丰镇",value:"南丰镇"},{label:"大成镇",value:"大成镇"},{label:"雅星镇",value:"雅星镇"},{label:"兰洋镇",value:"兰洋镇"},{label:"光村镇",value:"光村镇"},{label:"木棠镇",value:"木棠镇"},{label:"海头镇",value:"海头镇"},{label:"峨蔓镇",value:"峨蔓镇"},{label:"王五镇",value:"王五镇"},{label:"白马井镇",value:"白马井镇"},{label:"中和镇",value:"中和镇"},{label:"排浦镇",value:"排浦镇"},{label:"东成镇",value:"东成镇"},{label:"新州镇",value:"新州镇"},{label:"洋浦经济开发区",value:"洋浦经济开发区"},{label:"华南热作学院",value:"华南热作学院"}]},{label:"省直辖县级行政区划",value:"省直辖县级行政区划",children:[{label:"五指山市",value:"五指山市"},{label:"琼海市",value:"琼海市"},{label:"文昌市",value:"文昌市"},{label:"万宁市",value:"万宁市"},{label:"东方市",value:"东方市"},{label:"定安县",value:"定安县"},{label:"屯昌县",value:"屯昌县"},{label:"澄迈县",value:"澄迈县"},{label:"临高县",value:"临高县"},{label:"白沙黎族自治县",value:"白沙黎族自治县"},{label:"昌江黎族自治县",value:"昌江黎族自治县"},{label:"乐东黎族自治县",value:"乐东黎族自治县"},{label:"陵水黎族自治县",value:"陵水黎族自治县"},{label:"保亭黎族苗族自治县",value:"保亭黎族苗族自治县"},{label:"琼中黎族苗族自治县",value:"琼中黎族苗族自治县"}]}]},{label:"重庆市",value:"重庆市",children:[{label:"市辖区",value:"市辖区",children:[{label:"万州区",value:"万州区"},{label:"涪陵区",value:"涪陵区"},{label:"渝中区",value:"渝中区"},{label:"大渡口区",value:"大渡口区"},{label:"江北区",value:"江北区"},{label:"沙坪坝区",value:"沙坪坝区"},{label:"九龙坡区",value:"九龙坡区"},{label:"南岸区",value:"南岸区"},{label:"北碚区",value:"北碚区"},{label:"綦江区",value:"綦江区"},{label:"大足区",value:"大足区"},{label:"渝北区",value:"渝北区"},{label:"巴南区",value:"巴南区"},{label:"黔江区",value:"黔江区"},{label:"长寿区",value:"长寿区"},{label:"江津区",value:"江津区"},{label:"合川区",value:"合川区"},{label:"永川区",value:"永川区"},{label:"南川区",value:"南川区"},{label:"璧山区",value:"璧山区"},{label:"铜梁区",value:"铜梁区"},{label:"潼南区",value:"潼南区"},{label:"荣昌区",value:"荣昌区"},{label:"开州区",value:"开州区"},{label:"梁平区",value:"梁平区"},{label:"武隆区",value:"武隆区"}]},{label:"县",value:"县",children:[{label:"城口县",value:"城口县"},{label:"丰都县",value:"丰都县"},{label:"垫江县",value:"垫江县"},{label:"忠县",value:"忠县"},{label:"云阳县",value:"云阳县"},{label:"奉节县",value:"奉节县"},{label:"巫山县",value:"巫山县"},{label:"巫溪县",value:"巫溪县"},{label:"石柱土家族自治县",value:"石柱土家族自治县"},{label:"秀山土家族苗族自治县",value:"秀山土家族苗族自治县"},{label:"酉阳土家族苗族自治县",value:"酉阳土家族苗族自治县"},{label:"彭水苗族土家族自治县",value:"彭水苗族土家族自治县"}]}]},{label:"四川省",value:"四川省",children:[{label:"成都市",value:"成都市",children:[{label:"锦江区",value:"锦江区"},{label:"青羊区",value:"青羊区"},{label:"金牛区",value:"金牛区"},{label:"武侯区",value:"武侯区"},{label:"成华区",value:"成华区"},{label:"龙泉驿区",value:"龙泉驿区"},{label:"青白江区",value:"青白江区"},{label:"新都区",value:"新都区"},{label:"温江区",value:"温江区"},{label:"双流区",value:"双流区"},{label:"郫都区",value:"郫都区"},{label:"新津区",value:"新津区"},{label:"金堂县",value:"金堂县"},{label:"大邑县",value:"大邑县"},{label:"蒲江县",value:"蒲江县"},{label:"都江堰市",value:"都江堰市"},{label:"彭州市",value:"彭州市"},{label:"邛崃市",value:"邛崃市"},{label:"崇州市",value:"崇州市"},{label:"简阳市",value:"简阳市"}]},{label:"自贡市",value:"自贡市",children:[{label:"自流井区",value:"自流井区"},{label:"贡井区",value:"贡井区"},{label:"大安区",value:"大安区"},{label:"沿滩区",value:"沿滩区"},{label:"荣县",value:"荣县"},{label:"富顺县",value:"富顺县"}]},{label:"攀枝花市",value:"攀枝花市",children:[{label:"东区",value:"东区"},{label:"西区",value:"西区"},{label:"仁和区",value:"仁和区"},{label:"米易县",value:"米易县"},{label:"盐边县",value:"盐边县"}]},{label:"泸州市",value:"泸州市",children:[{label:"江阳区",value:"江阳区"},{label:"纳溪区",value:"纳溪区"},{label:"龙马潭区",value:"龙马潭区"},{label:"泸县",value:"泸县"},{label:"合江县",value:"合江县"},{label:"叙永县",value:"叙永县"},{label:"古蔺县",value:"古蔺县"}]},{label:"德阳市",value:"德阳市",children:[{label:"旌阳区",value:"旌阳区"},{label:"罗江区",value:"罗江区"},{label:"中江县",value:"中江县"},{label:"广汉市",value:"广汉市"},{label:"什邡市",value:"什邡市"},{label:"绵竹市",value:"绵竹市"}]},{label:"绵阳市",value:"绵阳市",children:[{label:"涪城区",value:"涪城区"},{label:"游仙区",value:"游仙区"},{label:"安州区",value:"安州区"},{label:"三台县",value:"三台县"},{label:"盐亭县",value:"盐亭县"},{label:"梓潼县",value:"梓潼县"},{label:"北川羌族自治县",value:"北川羌族自治县"},{label:"平武县",value:"平武县"},{label:"江油市",value:"江油市"}]},{label:"广元市",value:"广元市",children:[{label:"利州区",value:"利州区"},{label:"昭化区",value:"昭化区"},{label:"朝天区",value:"朝天区"},{label:"旺苍县",value:"旺苍县"},{label:"青川县",value:"青川县"},{label:"剑阁县",value:"剑阁县"},{label:"苍溪县",value:"苍溪县"}]},{label:"遂宁市",value:"遂宁市",children:[{label:"船山区",value:"船山区"},{label:"安居区",value:"安居区"},{label:"蓬溪县",value:"蓬溪县"},{label:"大英县",value:"大英县"},{label:"射洪市",value:"射洪市"}]},{label:"内江市",value:"内江市",children:[{label:"市中区",value:"市中区"},{label:"东兴区",value:"东兴区"},{label:"威远县",value:"威远县"},{label:"资中县",value:"资中县"},{label:"隆昌市",value:"隆昌市"}]},{label:"乐山市",value:"乐山市",children:[{label:"市中区",value:"市中区"},{label:"沙湾区",value:"沙湾区"},{label:"五通桥区",value:"五通桥区"},{label:"金口河区",value:"金口河区"},{label:"犍为县",value:"犍为县"},{label:"井研县",value:"井研县"},{label:"夹江县",value:"夹江县"},{label:"沐川县",value:"沐川县"},{label:"峨边彝族自治县",value:"峨边彝族自治县"},{label:"马边彝族自治县",value:"马边彝族自治县"},{label:"峨眉山市",value:"峨眉山市"}]},{label:"南充市",value:"南充市",children:[{label:"顺庆区",value:"顺庆区"},{label:"高坪区",value:"高坪区"},{label:"嘉陵区",value:"嘉陵区"},{label:"南部县",value:"南部县"},{label:"营山县",value:"营山县"},{label:"蓬安县",value:"蓬安县"},{label:"仪陇县",value:"仪陇县"},{label:"西充县",value:"西充县"},{label:"阆中市",value:"阆中市"}]},{label:"眉山市",value:"眉山市",children:[{label:"东坡区",value:"东坡区"},{label:"彭山区",value:"彭山区"},{label:"仁寿县",value:"仁寿县"},{label:"洪雅县",value:"洪雅县"},{label:"丹棱县",value:"丹棱县"},{label:"青神县",value:"青神县"}]},{label:"宜宾市",value:"宜宾市",children:[{label:"翠屏区",value:"翠屏区"},{label:"南溪区",value:"南溪区"},{label:"叙州区",value:"叙州区"},{label:"江安县",value:"江安县"},{label:"长宁县",value:"长宁县"},{label:"高县",value:"高县"},{label:"珙县",value:"珙县"},{label:"筠连县",value:"筠连县"},{label:"兴文县",value:"兴文县"},{label:"屏山县",value:"屏山县"}]},{label:"广安市",value:"广安市",children:[{label:"广安区",value:"广安区"},{label:"前锋区",value:"前锋区"},{label:"岳池县",value:"岳池县"},{label:"武胜县",value:"武胜县"},{label:"邻水县",value:"邻水县"},{label:"华蓥市",value:"华蓥市"}]},{label:"达州市",value:"达州市",children:[{label:"通川区",value:"通川区"},{label:"达川区",value:"达川区"},{label:"宣汉县",value:"宣汉县"},{label:"开江县",value:"开江县"},{label:"大竹县",value:"大竹县"},{label:"渠县",value:"渠县"},{label:"万源市",value:"万源市"}]},{label:"雅安市",value:"雅安市",children:[{label:"雨城区",value:"雨城区"},{label:"名山区",value:"名山区"},{label:"荥经县",value:"荥经县"},{label:"汉源县",value:"汉源县"},{label:"石棉县",value:"石棉县"},{label:"天全县",value:"天全县"},{label:"芦山县",value:"芦山县"},{label:"宝兴县",value:"宝兴县"}]},{label:"巴中市",value:"巴中市",children:[{label:"巴州区",value:"巴州区"},{label:"恩阳区",value:"恩阳区"},{label:"通江县",value:"通江县"},{label:"南江县",value:"南江县"},{label:"平昌县",value:"平昌县"}]},{label:"资阳市",value:"资阳市",children:[{label:"雁江区",value:"雁江区"},{label:"安岳县",value:"安岳县"},{label:"乐至县",value:"乐至县"}]},{label:"阿坝藏族羌族自治州",value:"阿坝藏族羌族自治州",children:[{label:"马尔康市",value:"马尔康市"},{label:"汶川县",value:"汶川县"},{label:"理县",value:"理县"},{label:"茂县",value:"茂县"},{label:"松潘县",value:"松潘县"},{label:"九寨沟县",value:"九寨沟县"},{label:"金川县",value:"金川县"},{label:"小金县",value:"小金县"},{label:"黑水县",value:"黑水县"},{label:"壤塘县",value:"壤塘县"},{label:"阿坝县",value:"阿坝县"},{label:"若尔盖县",value:"若尔盖县"},{label:"红原县",value:"红原县"}]},{label:"甘孜藏族自治州",value:"甘孜藏族自治州",children:[{label:"康定市",value:"康定市"},{label:"泸定县",value:"泸定县"},{label:"丹巴县",value:"丹巴县"},{label:"九龙县",value:"九龙县"},{label:"雅江县",value:"雅江县"},{label:"道孚县",value:"道孚县"},{label:"炉霍县",value:"炉霍县"},{label:"甘孜县",value:"甘孜县"},{label:"新龙县",value:"新龙县"},{label:"德格县",value:"德格县"},{label:"白玉县",value:"白玉县"},{label:"石渠县",value:"石渠县"},{label:"色达县",value:"色达县"},{label:"理塘县",value:"理塘县"},{label:"巴塘县",value:"巴塘县"},{label:"乡城县",value:"乡城县"},{label:"稻城县",value:"稻城县"},{label:"得荣县",value:"得荣县"}]},{label:"凉山彝族自治州",value:"凉山彝族自治州",children:[{label:"西昌市",value:"西昌市"},{label:"会理市",value:"会理市"},{label:"木里藏族自治县",value:"木里藏族自治县"},{label:"盐源县",value:"盐源县"},{label:"德昌县",value:"德昌县"},{label:"会东县",value:"会东县"},{label:"宁南县",value:"宁南县"},{label:"普格县",value:"普格县"},{label:"布拖县",value:"布拖县"},{label:"金阳县",value:"金阳县"},{label:"昭觉县",value:"昭觉县"},{label:"喜德县",value:"喜德县"},{label:"冕宁县",value:"冕宁县"},{label:"越西县",value:"越西县"},{label:"甘洛县",value:"甘洛县"},{label:"美姑县",value:"美姑县"},{label:"雷波县",value:"雷波县"}]}]},{label:"贵州省",value:"贵州省",children:[{label:"贵阳市",value:"贵阳市",children:[{label:"南明区",value:"南明区"},{label:"云岩区",value:"云岩区"},{label:"花溪区",value:"花溪区"},{label:"乌当区",value:"乌当区"},{label:"白云区",value:"白云区"},{label:"观山湖区",value:"观山湖区"},{label:"开阳县",value:"开阳县"},{label:"息烽县",value:"息烽县"},{label:"修文县",value:"修文县"},{label:"清镇市",value:"清镇市"}]},{label:"六盘水市",value:"六盘水市",children:[{label:"钟山区",value:"钟山区"},{label:"六枝特区",value:"六枝特区"},{label:"水城区",value:"水城区"},{label:"盘州市",value:"盘州市"}]},{label:"遵义市",value:"遵义市",children:[{label:"红花岗区",value:"红花岗区"},{label:"汇川区",value:"汇川区"},{label:"播州区",value:"播州区"},{label:"桐梓县",value:"桐梓县"},{label:"绥阳县",value:"绥阳县"},{label:"正安县",value:"正安县"},{label:"道真仡佬族苗族自治县",value:"道真仡佬族苗族自治县"},{label:"务川仡佬族苗族自治县",value:"务川仡佬族苗族自治县"},{label:"凤冈县",value:"凤冈县"},{label:"湄潭县",value:"湄潭县"},{label:"余庆县",value:"余庆县"},{label:"习水县",value:"习水县"},{label:"赤水市",value:"赤水市"},{label:"仁怀市",value:"仁怀市"}]},{label:"安顺市",value:"安顺市",children:[{label:"西秀区",value:"西秀区"},{label:"平坝区",value:"平坝区"},{label:"普定县",value:"普定县"},{label:"镇宁布依族苗族自治县",value:"镇宁布依族苗族自治县"},{label:"关岭布依族苗族自治县",value:"关岭布依族苗族自治县"},{label:"紫云苗族布依族自治县",value:"紫云苗族布依族自治县"}]},{label:"毕节市",value:"毕节市",children:[{label:"七星关区",value:"七星关区"},{label:"大方县",value:"大方县"},{label:"金沙县",value:"金沙县"},{label:"织金县",value:"织金县"},{label:"纳雍县",value:"纳雍县"},{label:"威宁彝族回族苗族自治县",value:"威宁彝族回族苗族自治县"},{label:"赫章县",value:"赫章县"},{label:"黔西市",value:"黔西市"}]},{label:"铜仁市",value:"铜仁市",children:[{label:"碧江区",value:"碧江区"},{label:"万山区",value:"万山区"},{label:"江口县",value:"江口县"},{label:"玉屏侗族自治县",value:"玉屏侗族自治县"},{label:"石阡县",value:"石阡县"},{label:"思南县",value:"思南县"},{label:"印江土家族苗族自治县",value:"印江土家族苗族自治县"},{label:"德江县",value:"德江县"},{label:"沿河土家族自治县",value:"沿河土家族自治县"},{label:"松桃苗族自治县",value:"松桃苗族自治县"}]},{label:"黔西南布依族苗族自治州",value:"黔西南布依族苗族自治州",children:[{label:"兴义市",value:"兴义市"},{label:"兴仁市",value:"兴仁市"},{label:"普安县",value:"普安县"},{label:"晴隆县",value:"晴隆县"},{label:"贞丰县",value:"贞丰县"},{label:"望谟县",value:"望谟县"},{label:"册亨县",value:"册亨县"},{label:"安龙县",value:"安龙县"}]},{label:"黔东南苗族侗族自治州",value:"黔东南苗族侗族自治州",children:[{label:"凯里市",value:"凯里市"},{label:"黄平县",value:"黄平县"},{label:"施秉县",value:"施秉县"},{label:"三穗县",value:"三穗县"},{label:"镇远县",value:"镇远县"},{label:"岑巩县",value:"岑巩县"},{label:"天柱县",value:"天柱县"},{label:"锦屏县",value:"锦屏县"},{label:"剑河县",value:"剑河县"},{label:"台江县",value:"台江县"},{label:"黎平县",value:"黎平县"},{label:"榕江县",value:"榕江县"},{label:"从江县",value:"从江县"},{label:"雷山县",value:"雷山县"},{label:"麻江县",value:"麻江县"},{label:"丹寨县",value:"丹寨县"}]},{label:"黔南布依族苗族自治州",value:"黔南布依族苗族自治州",children:[{label:"都匀市",value:"都匀市"},{label:"福泉市",value:"福泉市"},{label:"荔波县",value:"荔波县"},{label:"贵定县",value:"贵定县"},{label:"瓮安县",value:"瓮安县"},{label:"独山县",value:"独山县"},{label:"平塘县",value:"平塘县"},{label:"罗甸县",value:"罗甸县"},{label:"长顺县",value:"长顺县"},{label:"龙里县",value:"龙里县"},{label:"惠水县",value:"惠水县"},{label:"三都水族自治县",value:"三都水族自治县"}]}]},{label:"云南省",value:"云南省",children:[{label:"昆明市",value:"昆明市",children:[{label:"五华区",value:"五华区"},{label:"盘龙区",value:"盘龙区"},{label:"官渡区",value:"官渡区"},{label:"西山区",value:"西山区"},{label:"东川区",value:"东川区"},{label:"呈贡区",value:"呈贡区"},{label:"晋宁区",value:"晋宁区"},{label:"富民县",value:"富民县"},{label:"宜良县",value:"宜良县"},{label:"石林彝族自治县",value:"石林彝族自治县"},{label:"嵩明县",value:"嵩明县"},{label:"禄劝彝族苗族自治县",value:"禄劝彝族苗族自治县"},{label:"寻甸回族彝族自治县",value:"寻甸回族彝族自治县"},{label:"安宁市",value:"安宁市"}]},{label:"曲靖市",value:"曲靖市",children:[{label:"麒麟区",value:"麒麟区"},{label:"沾益区",value:"沾益区"},{label:"马龙区",value:"马龙区"},{label:"陆良县",value:"陆良县"},{label:"师宗县",value:"师宗县"},{label:"罗平县",value:"罗平县"},{label:"富源县",value:"富源县"},{label:"会泽县",value:"会泽县"},{label:"宣威市",value:"宣威市"}]},{label:"玉溪市",value:"玉溪市",children:[{label:"红塔区",value:"红塔区"},{label:"江川区",value:"江川区"},{label:"通海县",value:"通海县"},{label:"华宁县",value:"华宁县"},{label:"易门县",value:"易门县"},{label:"峨山彝族自治县",value:"峨山彝族自治县"},{label:"新平彝族傣族自治县",value:"新平彝族傣族自治县"},{label:"元江哈尼族彝族傣族自治县",value:"元江哈尼族彝族傣族自治县"},{label:"澄江市",value:"澄江市"}]},{label:"保山市",value:"保山市",children:[{label:"隆阳区",value:"隆阳区"},{label:"施甸县",value:"施甸县"},{label:"龙陵县",value:"龙陵县"},{label:"昌宁县",value:"昌宁县"},{label:"腾冲市",value:"腾冲市"}]},{label:"昭通市",value:"昭通市",children:[{label:"昭阳区",value:"昭阳区"},{label:"鲁甸县",value:"鲁甸县"},{label:"巧家县",value:"巧家县"},{label:"盐津县",value:"盐津县"},{label:"大关县",value:"大关县"},{label:"永善县",value:"永善县"},{label:"绥江县",value:"绥江县"},{label:"镇雄县",value:"镇雄县"},{label:"彝良县",value:"彝良县"},{label:"威信县",value:"威信县"},{label:"水富市",value:"水富市"}]},{label:"丽江市",value:"丽江市",children:[{label:"古城区",value:"古城区"},{label:"玉龙纳西族自治县",value:"玉龙纳西族自治县"},{label:"永胜县",value:"永胜县"},{label:"华坪县",value:"华坪县"},{label:"宁蒗彝族自治县",value:"宁蒗彝族自治县"}]},{label:"普洱市",value:"普洱市",children:[{label:"思茅区",value:"思茅区"},{label:"宁洱哈尼族彝族自治县",value:"宁洱哈尼族彝族自治县"},{label:"墨江哈尼族自治县",value:"墨江哈尼族自治县"},{label:"景东彝族自治县",value:"景东彝族自治县"},{label:"景谷傣族彝族自治县",value:"景谷傣族彝族自治县"},{label:"镇沅彝族哈尼族拉祜族自治县",value:"镇沅彝族哈尼族拉祜族自治县"},{label:"江城哈尼族彝族自治县",value:"江城哈尼族彝族自治县"},{label:"孟连傣族拉祜族佤族自治县",value:"孟连傣族拉祜族佤族自治县"},{label:"澜沧拉祜族自治县",value:"澜沧拉祜族自治县"},{label:"西盟佤族自治县",value:"西盟佤族自治县"}]},{label:"临沧市",value:"临沧市",children:[{label:"临翔区",value:"临翔区"},{label:"凤庆县",value:"凤庆县"},{label:"云县",value:"云县"},{label:"永德县",value:"永德县"},{label:"镇康县",value:"镇康县"},{label:"双江拉祜族佤族布朗族傣族自治县",value:"双江拉祜族佤族布朗族傣族自治县"},{label:"耿马傣族佤族自治县",value:"耿马傣族佤族自治县"},{label:"沧源佤族自治县",value:"沧源佤族自治县"}]},{label:"楚雄彝族自治州",value:"楚雄彝族自治州",children:[{label:"楚雄市",value:"楚雄市"},{label:"禄丰市",value:"禄丰市"},{label:"双柏县",value:"双柏县"},{label:"牟定县",value:"牟定县"},{label:"南华县",value:"南华县"},{label:"姚安县",value:"姚安县"},{label:"大姚县",value:"大姚县"},{label:"永仁县",value:"永仁县"},{label:"元谋县",value:"元谋县"},{label:"武定县",value:"武定县"}]},{label:"红河哈尼族彝族自治州",value:"红河哈尼族彝族自治州",children:[{label:"个旧市",value:"个旧市"},{label:"开远市",value:"开远市"},{label:"蒙自市",value:"蒙自市"},{label:"弥勒市",value:"弥勒市"},{label:"屏边苗族自治县",value:"屏边苗族自治县"},{label:"建水县",value:"建水县"},{label:"石屏县",value:"石屏县"},{label:"泸西县",value:"泸西县"},{label:"元阳县",value:"元阳县"},{label:"红河县",value:"红河县"},{label:"金平苗族瑶族傣族自治县",value:"金平苗族瑶族傣族自治县"},{label:"绿春县",value:"绿春县"},{label:"河口瑶族自治县",value:"河口瑶族自治县"}]},{label:"文山壮族苗族自治州",value:"文山壮族苗族自治州",children:[{label:"文山市",value:"文山市"},{label:"砚山县",value:"砚山县"},{label:"西畴县",value:"西畴县"},{label:"麻栗坡县",value:"麻栗坡县"},{label:"马关县",value:"马关县"},{label:"丘北县",value:"丘北县"},{label:"广南县",value:"广南县"},{label:"富宁县",value:"富宁县"}]},{label:"西双版纳傣族自治州",value:"西双版纳傣族自治州",children:[{label:"景洪市",value:"景洪市"},{label:"勐海县",value:"勐海县"},{label:"勐腊县",value:"勐腊县"}]},{label:"大理白族自治州",value:"大理白族自治州",children:[{label:"大理市",value:"大理市"},{label:"漾濞彝族自治县",value:"漾濞彝族自治县"},{label:"祥云县",value:"祥云县"},{label:"宾川县",value:"宾川县"},{label:"弥渡县",value:"弥渡县"},{label:"南涧彝族自治县",value:"南涧彝族自治县"},{label:"巍山彝族回族自治县",value:"巍山彝族回族自治县"},{label:"永平县",value:"永平县"},{label:"云龙县",value:"云龙县"},{label:"洱源县",value:"洱源县"},{label:"剑川县",value:"剑川县"},{label:"鹤庆县",value:"鹤庆县"}]},{label:"德宏傣族景颇族自治州",value:"德宏傣族景颇族自治州",children:[{label:"瑞丽市",value:"瑞丽市"},{label:"芒市",value:"芒市"},{label:"梁河县",value:"梁河县"},{label:"盈江县",value:"盈江县"},{label:"陇川县",value:"陇川县"}]},{label:"怒江傈僳族自治州",value:"怒江傈僳族自治州",children:[{label:"泸水市",value:"泸水市"},{label:"福贡县",value:"福贡县"},{label:"贡山独龙族怒族自治县",value:"贡山独龙族怒族自治县"},{label:"兰坪白族普米族自治县",value:"兰坪白族普米族自治县"}]},{label:"迪庆藏族自治州",value:"迪庆藏族自治州",children:[{label:"香格里拉市",value:"香格里拉市"},{label:"德钦县",value:"德钦县"},{label:"维西傈僳族自治县",value:"维西傈僳族自治县"}]}]},{label:"西藏自治区",value:"西藏自治区",children:[{label:"拉萨市",value:"拉萨市",children:[{label:"城关区",value:"城关区"},{label:"堆龙德庆区",value:"堆龙德庆区"},{label:"达孜区",value:"达孜区"},{label:"林周县",value:"林周县"},{label:"当雄县",value:"当雄县"},{label:"尼木县",value:"尼木县"},{label:"曲水县",value:"曲水县"},{label:"墨竹工卡县",value:"墨竹工卡县"},{label:"格尔木藏青工业园区",value:"格尔木藏青工业园区"},{label:"拉萨经济技术开发区",value:"拉萨经济技术开发区"},{label:"西藏文化旅游创意园区",value:"西藏文化旅游创意园区"},{label:"达孜工业园区",value:"达孜工业园区"}]},{label:"日喀则市",value:"日喀则市",children:[{label:"桑珠孜区",value:"桑珠孜区"},{label:"南木林县",value:"南木林县"},{label:"江孜县",value:"江孜县"},{label:"定日县",value:"定日县"},{label:"萨迦县",value:"萨迦县"},{label:"拉孜县",value:"拉孜县"},{label:"昂仁县",value:"昂仁县"},{label:"谢通门县",value:"谢通门县"},{label:"白朗县",value:"白朗县"},{label:"仁布县",value:"仁布县"},{label:"康马县",value:"康马县"},{label:"定结县",value:"定结县"},{label:"仲巴县",value:"仲巴县"},{label:"亚东县",value:"亚东县"},{label:"吉隆县",value:"吉隆县"},{label:"聂拉木县",value:"聂拉木县"},{label:"萨嘎县",value:"萨嘎县"},{label:"岗巴县",value:"岗巴县"}]},{label:"昌都市",value:"昌都市",children:[{label:"卡若区",value:"卡若区"},{label:"江达县",value:"江达县"},{label:"贡觉县",value:"贡觉县"},{label:"类乌齐县",value:"类乌齐县"},{label:"丁青县",value:"丁青县"},{label:"察雅县",value:"察雅县"},{label:"八宿县",value:"八宿县"},{label:"左贡县",value:"左贡县"},{label:"芒康县",value:"芒康县"},{label:"洛隆县",value:"洛隆县"},{label:"边坝县",value:"边坝县"}]},{label:"林芝市",value:"林芝市",children:[{label:"巴宜区",value:"巴宜区"},{label:"工布江达县",value:"工布江达县"},{label:"墨脱县",value:"墨脱县"},{label:"波密县",value:"波密县"},{label:"察隅县",value:"察隅县"},{label:"朗县",value:"朗县"},{label:"米林市",value:"米林市"}]},{label:"山南市",value:"山南市",children:[{label:"乃东区",value:"乃东区"},{label:"扎囊县",value:"扎囊县"},{label:"贡嘎县",value:"贡嘎县"},{label:"桑日县",value:"桑日县"},{label:"琼结县",value:"琼结县"},{label:"曲松县",value:"曲松县"},{label:"措美县",value:"措美县"},{label:"洛扎县",value:"洛扎县"},{label:"加查县",value:"加查县"},{label:"隆子县",value:"隆子县"},{label:"浪卡子县",value:"浪卡子县"},{label:"错那市",value:"错那市"}]},{label:"那曲市",value:"那曲市",children:[{label:"色尼区",value:"色尼区"},{label:"嘉黎县",value:"嘉黎县"},{label:"比如县",value:"比如县"},{label:"聂荣县",value:"聂荣县"},{label:"安多县",value:"安多县"},{label:"申扎县",value:"申扎县"},{label:"索县",value:"索县"},{label:"班戈县",value:"班戈县"},{label:"巴青县",value:"巴青县"},{label:"尼玛县",value:"尼玛县"},{label:"双湖县",value:"双湖县"}]},{label:"阿里地区",value:"阿里地区",children:[{label:"普兰县",value:"普兰县"},{label:"札达县",value:"札达县"},{label:"噶尔县",value:"噶尔县"},{label:"日土县",value:"日土县"},{label:"革吉县",value:"革吉县"},{label:"改则县",value:"改则县"},{label:"措勤县",value:"措勤县"}]}]},{label:"陕西省",value:"陕西省",children:[{label:"西安市",value:"西安市",children:[{label:"新城区",value:"新城区"},{label:"碑林区",value:"碑林区"},{label:"莲湖区",value:"莲湖区"},{label:"灞桥区",value:"灞桥区"},{label:"未央区",value:"未央区"},{label:"雁塔区",value:"雁塔区"},{label:"阎良区",value:"阎良区"},{label:"临潼区",value:"临潼区"},{label:"长安区",value:"长安区"},{label:"高陵区",value:"高陵区"},{label:"鄠邑区",value:"鄠邑区"},{label:"蓝田县",value:"蓝田县"},{label:"周至县",value:"周至县"}]},{label:"铜川市",value:"铜川市",children:[{label:"王益区",value:"王益区"},{label:"印台区",value:"印台区"},{label:"耀州区",value:"耀州区"},{label:"宜君县",value:"宜君县"}]},{label:"宝鸡市",value:"宝鸡市",children:[{label:"渭滨区",value:"渭滨区"},{label:"金台区",value:"金台区"},{label:"陈仓区",value:"陈仓区"},{label:"凤翔区",value:"凤翔区"},{label:"岐山县",value:"岐山县"},{label:"扶风县",value:"扶风县"},{label:"眉县",value:"眉县"},{label:"陇县",value:"陇县"},{label:"千阳县",value:"千阳县"},{label:"麟游县",value:"麟游县"},{label:"凤县",value:"凤县"},{label:"太白县",value:"太白县"}]},{label:"咸阳市",value:"咸阳市",children:[{label:"秦都区",value:"秦都区"},{label:"杨陵区",value:"杨陵区"},{label:"渭城区",value:"渭城区"},{label:"三原县",value:"三原县"},{label:"泾阳县",value:"泾阳县"},{label:"乾县",value:"乾县"},{label:"礼泉县",value:"礼泉县"},{label:"永寿县",value:"永寿县"},{label:"长武县",value:"长武县"},{label:"旬邑县",value:"旬邑县"},{label:"淳化县",value:"淳化县"},{label:"武功县",value:"武功县"},{label:"兴平市",value:"兴平市"},{label:"彬州市",value:"彬州市"}]},{label:"渭南市",value:"渭南市",children:[{label:"临渭区",value:"临渭区"},{label:"华州区",value:"华州区"},{label:"潼关县",value:"潼关县"},{label:"大荔县",value:"大荔县"},{label:"合阳县",value:"合阳县"},{label:"澄城县",value:"澄城县"},{label:"蒲城县",value:"蒲城县"},{label:"白水县",value:"白水县"},{label:"富平县",value:"富平县"},{label:"韩城市",value:"韩城市"},{label:"华阴市",value:"华阴市"}]},{label:"延安市",value:"延安市",children:[{label:"宝塔区",value:"宝塔区"},{label:"安塞区",value:"安塞区"},{label:"延长县",value:"延长县"},{label:"延川县",value:"延川县"},{label:"志丹县",value:"志丹县"},{label:"吴起县",value:"吴起县"},{label:"甘泉县",value:"甘泉县"},{label:"富县",value:"富县"},{label:"洛川县",value:"洛川县"},{label:"宜川县",value:"宜川县"},{label:"黄龙县",value:"黄龙县"},{label:"黄陵县",value:"黄陵县"},{label:"子长市",value:"子长市"}]},{label:"汉中市",value:"汉中市",children:[{label:"汉台区",value:"汉台区"},{label:"南郑区",value:"南郑区"},{label:"城固县",value:"城固县"},{label:"洋县",value:"洋县"},{label:"西乡县",value:"西乡县"},{label:"勉县",value:"勉县"},{label:"宁强县",value:"宁强县"},{label:"略阳县",value:"略阳县"},{label:"镇巴县",value:"镇巴县"},{label:"留坝县",value:"留坝县"},{label:"佛坪县",value:"佛坪县"}]},{label:"榆林市",value:"榆林市",children:[{label:"榆阳区",value:"榆阳区"},{label:"横山区",value:"横山区"},{label:"府谷县",value:"府谷县"},{label:"靖边县",value:"靖边县"},{label:"定边县",value:"定边县"},{label:"绥德县",value:"绥德县"},{label:"米脂县",value:"米脂县"},{label:"佳县",value:"佳县"},{label:"吴堡县",value:"吴堡县"},{label:"清涧县",value:"清涧县"},{label:"子洲县",value:"子洲县"},{label:"神木市",value:"神木市"}]},{label:"安康市",value:"安康市",children:[{label:"汉滨区",value:"汉滨区"},{label:"汉阴县",value:"汉阴县"},{label:"石泉县",value:"石泉县"},{label:"宁陕县",value:"宁陕县"},{label:"紫阳县",value:"紫阳县"},{label:"岚皋县",value:"岚皋县"},{label:"平利县",value:"平利县"},{label:"镇坪县",value:"镇坪县"},{label:"白河县",value:"白河县"},{label:"旬阳市",value:"旬阳市"}]},{label:"商洛市",value:"商洛市",children:[{label:"商州区",value:"商州区"},{label:"洛南县",value:"洛南县"},{label:"丹凤县",value:"丹凤县"},{label:"商南县",value:"商南县"},{label:"山阳县",value:"山阳县"},{label:"镇安县",value:"镇安县"},{label:"柞水县",value:"柞水县"}]}]},{label:"甘肃省",value:"甘肃省",children:[{label:"兰州市",value:"兰州市",children:[{label:"城关区",value:"城关区"},{label:"七里河区",value:"七里河区"},{label:"西固区",value:"西固区"},{label:"安宁区",value:"安宁区"},{label:"红古区",value:"红古区"},{label:"永登县",value:"永登县"},{label:"皋兰县",value:"皋兰县"},{label:"榆中县",value:"榆中县"},{label:"兰州新区",value:"兰州新区"}]},{label:"嘉峪关市",value:"嘉峪关市",children:[{label:"雄关街道",value:"雄关街道"},{label:"钢城街道",value:"钢城街道"},{label:"新城镇",value:"新城镇"},{label:"峪泉镇",value:"峪泉镇"},{label:"文殊镇",value:"文殊镇"}]},{label:"金昌市",value:"金昌市",children:[{label:"金川区",value:"金川区"},{label:"永昌县",value:"永昌县"}]},{label:"白银市",value:"白银市",children:[{label:"白银区",value:"白银区"},{label:"平川区",value:"平川区"},{label:"靖远县",value:"靖远县"},{label:"会宁县",value:"会宁县"},{label:"景泰县",value:"景泰县"}]},{label:"天水市",value:"天水市",children:[{label:"秦州区",value:"秦州区"},{label:"麦积区",value:"麦积区"},{label:"清水县",value:"清水县"},{label:"秦安县",value:"秦安县"},{label:"甘谷县",value:"甘谷县"},{label:"武山县",value:"武山县"},{label:"张家川回族自治县",value:"张家川回族自治县"}]},{label:"武威市",value:"武威市",children:[{label:"凉州区",value:"凉州区"},{label:"民勤县",value:"民勤县"},{label:"古浪县",value:"古浪县"},{label:"天祝藏族自治县",value:"天祝藏族自治县"}]},{label:"张掖市",value:"张掖市",children:[{label:"甘州区",value:"甘州区"},{label:"肃南裕固族自治县",value:"肃南裕固族自治县"},{label:"民乐县",value:"民乐县"},{label:"临泽县",value:"临泽县"},{label:"高台县",value:"高台县"},{label:"山丹县",value:"山丹县"}]},{label:"平凉市",value:"平凉市",children:[{label:"崆峒区",value:"崆峒区"},{label:"泾川县",value:"泾川县"},{label:"灵台县",value:"灵台县"},{label:"崇信县",value:"崇信县"},{label:"庄浪县",value:"庄浪县"},{label:"静宁县",value:"静宁县"},{label:"华亭市",value:"华亭市"}]},{label:"酒泉市",value:"酒泉市",children:[{label:"肃州区",value:"肃州区"},{label:"金塔县",value:"金塔县"},{label:"瓜州县",value:"瓜州县"},{label:"肃北蒙古族自治县",value:"肃北蒙古族自治县"},{label:"阿克塞哈萨克族自治县",value:"阿克塞哈萨克族自治县"},{label:"玉门市",value:"玉门市"},{label:"敦煌市",value:"敦煌市"}]},{label:"庆阳市",value:"庆阳市",children:[{label:"西峰区",value:"西峰区"},{label:"庆城县",value:"庆城县"},{label:"环县",value:"环县"},{label:"华池县",value:"华池县"},{label:"合水县",value:"合水县"},{label:"正宁县",value:"正宁县"},{label:"宁县",value:"宁县"},{label:"镇原县",value:"镇原县"}]},{label:"定西市",value:"定西市",children:[{label:"安定区",value:"安定区"},{label:"通渭县",value:"通渭县"},{label:"陇西县",value:"陇西县"},{label:"渭源县",value:"渭源县"},{label:"临洮县",value:"临洮县"},{label:"漳县",value:"漳县"},{label:"岷县",value:"岷县"}]},{label:"陇南市",value:"陇南市",children:[{label:"武都区",value:"武都区"},{label:"成县",value:"成县"},{label:"文县",value:"文县"},{label:"宕昌县",value:"宕昌县"},{label:"康县",value:"康县"},{label:"西和县",value:"西和县"},{label:"礼县",value:"礼县"},{label:"徽县",value:"徽县"},{label:"两当县",value:"两当县"}]},{label:"临夏回族自治州",value:"临夏回族自治州",children:[{label:"临夏市",value:"临夏市"},{label:"临夏县",value:"临夏县"},{label:"康乐县",value:"康乐县"},{label:"永靖县",value:"永靖县"},{label:"广河县",value:"广河县"},{label:"和政县",value:"和政县"},{label:"东乡族自治县",value:"东乡族自治县"},{label:"积石山保安族东乡族撒拉族自治县",value:"积石山保安族东乡族撒拉族自治县"}]},{label:"甘南藏族自治州",value:"甘南藏族自治州",children:[{label:"合作市",value:"合作市"},{label:"临潭县",value:"临潭县"},{label:"卓尼县",value:"卓尼县"},{label:"舟曲县",value:"舟曲县"},{label:"迭部县",value:"迭部县"},{label:"玛曲县",value:"玛曲县"},{label:"碌曲县",value:"碌曲县"},{label:"夏河县",value:"夏河县"}]}]},{label:"青海省",value:"青海省",children:[{label:"西宁市",value:"西宁市",children:[{label:"城东区",value:"城东区"},{label:"城中区",value:"城中区"},{label:"城西区",value:"城西区"},{label:"城北区",value:"城北区"},{label:"湟中区",value:"湟中区"},{label:"大通回族土族自治县",value:"大通回族土族自治县"},{label:"湟源县",value:"湟源县"}]},{label:"海东市",value:"海东市",children:[{label:"乐都区",value:"乐都区"},{label:"平安区",value:"平安区"},{label:"民和回族土族自治县",value:"民和回族土族自治县"},{label:"互助土族自治县",value:"互助土族自治县"},{label:"化隆回族自治县",value:"化隆回族自治县"},{label:"循化撒拉族自治县",value:"循化撒拉族自治县"}]},{label:"海北藏族自治州",value:"海北藏族自治州",children:[{label:"门源回族自治县",value:"门源回族自治县"},{label:"祁连县",value:"祁连县"},{label:"海晏县",value:"海晏县"},{label:"刚察县",value:"刚察县"}]},{label:"黄南藏族自治州",value:"黄南藏族自治州",children:[{label:"同仁市",value:"同仁市"},{label:"尖扎县",value:"尖扎县"},{label:"泽库县",value:"泽库县"},{label:"河南蒙古族自治县",value:"河南蒙古族自治县"}]},{label:"海南藏族自治州",value:"海南藏族自治州",children:[{label:"共和县",value:"共和县"},{label:"同德县",value:"同德县"},{label:"贵德县",value:"贵德县"},{label:"兴海县",value:"兴海县"},{label:"贵南县",value:"贵南县"}]},{label:"果洛藏族自治州",value:"果洛藏族自治州",children:[{label:"玛沁县",value:"玛沁县"},{label:"班玛县",value:"班玛县"},{label:"甘德县",value:"甘德县"},{label:"达日县",value:"达日县"},{label:"久治县",value:"久治县"},{label:"玛多县",value:"玛多县"}]},{label:"玉树藏族自治州",value:"玉树藏族自治州",children:[{label:"玉树市",value:"玉树市"},{label:"杂多县",value:"杂多县"},{label:"称多县",value:"称多县"},{label:"治多县",value:"治多县"},{label:"囊谦县",value:"囊谦县"},{label:"曲麻莱县",value:"曲麻莱县"}]},{label:"海西蒙古族藏族自治州",value:"海西蒙古族藏族自治州",children:[{label:"格尔木市",value:"格尔木市"},{label:"德令哈市",value:"德令哈市"},{label:"茫崖市",value:"茫崖市"},{label:"乌兰县",value:"乌兰县"},{label:"都兰县",value:"都兰县"},{label:"天峻县",value:"天峻县"},{label:"大柴旦行政委员会",value:"大柴旦行政委员会"}]}]},{label:"宁夏回族自治区",value:"宁夏回族自治区",children:[{label:"银川市",value:"银川市",children:[{label:"兴庆区",value:"兴庆区"},{label:"西夏区",value:"西夏区"},{label:"金凤区",value:"金凤区"},{label:"永宁县",value:"永宁县"},{label:"贺兰县",value:"贺兰县"},{label:"灵武市",value:"灵武市"}]},{label:"石嘴山市",value:"石嘴山市",children:[{label:"大武口区",value:"大武口区"},{label:"惠农区",value:"惠农区"},{label:"平罗县",value:"平罗县"}]},{label:"吴忠市",value:"吴忠市",children:[{label:"利通区",value:"利通区"},{label:"红寺堡区",value:"红寺堡区"},{label:"盐池县",value:"盐池县"},{label:"同心县",value:"同心县"},{label:"青铜峡市",value:"青铜峡市"}]},{label:"固原市",value:"固原市",children:[{label:"原州区",value:"原州区"},{label:"西吉县",value:"西吉县"},{label:"隆德县",value:"隆德县"},{label:"泾源县",value:"泾源县"},{label:"彭阳县",value:"彭阳县"}]},{label:"中卫市",value:"中卫市",children:[{label:"沙坡头区",value:"沙坡头区"},{label:"中宁县",value:"中宁县"},{label:"海原县",value:"海原县"}]}]},{label:"新疆维吾尔自治区",value:"新疆维吾尔自治区",children:[{label:"乌鲁木齐市",value:"乌鲁木齐市",children:[{label:"天山区",value:"天山区"},{label:"沙依巴克区",value:"沙依巴克区"},{label:"新市区",value:"新市区"},{label:"水磨沟区",value:"水磨沟区"},{label:"头屯河区",value:"头屯河区"},{label:"达坂城区",value:"达坂城区"},{label:"米东区",value:"米东区"},{label:"乌鲁木齐县",value:"乌鲁木齐县"}]},{label:"克拉玛依市",value:"克拉玛依市",children:[{label:"独山子区",value:"独山子区"},{label:"克拉玛依区",value:"克拉玛依区"},{label:"白碱滩区",value:"白碱滩区"},{label:"乌尔禾区",value:"乌尔禾区"}]},{label:"吐鲁番市",value:"吐鲁番市",children:[{label:"高昌区",value:"高昌区"},{label:"鄯善县",value:"鄯善县"},{label:"托克逊县",value:"托克逊县"}]},{label:"哈密市",value:"哈密市",children:[{label:"伊州区",value:"伊州区"},{label:"巴里坤哈萨克自治县",value:"巴里坤哈萨克自治县"},{label:"伊吾县",value:"伊吾县"}]},{label:"昌吉回族自治州",value:"昌吉回族自治州",children:[{label:"昌吉市",value:"昌吉市"},{label:"阜康市",value:"阜康市"},{label:"呼图壁县",value:"呼图壁县"},{label:"玛纳斯县",value:"玛纳斯县"},{label:"奇台县",value:"奇台县"},{label:"吉木萨尔县",value:"吉木萨尔县"},{label:"木垒哈萨克自治县",value:"木垒哈萨克自治县"}]},{label:"博尔塔拉蒙古自治州",value:"博尔塔拉蒙古自治州",children:[{label:"博乐市",value:"博乐市"},{label:"阿拉山口市",value:"阿拉山口市"},{label:"精河县",value:"精河县"},{label:"温泉县",value:"温泉县"}]},{label:"巴音郭楞蒙古自治州",value:"巴音郭楞蒙古自治州",children:[{label:"库尔勒市",value:"库尔勒市"},{label:"轮台县",value:"轮台县"},{label:"尉犁县",value:"尉犁县"},{label:"若羌县",value:"若羌县"},{label:"且末县",value:"且末县"},{label:"焉耆回族自治县",value:"焉耆回族自治县"},{label:"和静县",value:"和静县"},{label:"和硕县",value:"和硕县"},{label:"博湖县",value:"博湖县"}]},{label:"阿克苏地区",value:"阿克苏地区",children:[{label:"阿克苏市",value:"阿克苏市"},{label:"库车市",value:"库车市"},{label:"温宿县",value:"温宿县"},{label:"沙雅县",value:"沙雅县"},{label:"新和县",value:"新和县"},{label:"拜城县",value:"拜城县"},{label:"乌什县",value:"乌什县"},{label:"阿瓦提县",value:"阿瓦提县"},{label:"柯坪县",value:"柯坪县"}]},{label:"克孜勒苏柯尔克孜自治州",value:"克孜勒苏柯尔克孜自治州",children:[{label:"阿图什市",value:"阿图什市"},{label:"阿克陶县",value:"阿克陶县"},{label:"阿合奇县",value:"阿合奇县"},{label:"乌恰县",value:"乌恰县"}]},{label:"喀什地区",value:"喀什地区",children:[{label:"喀什市",value:"喀什市"},{label:"疏附县",value:"疏附县"},{label:"疏勒县",value:"疏勒县"},{label:"英吉沙县",value:"英吉沙县"},{label:"泽普县",value:"泽普县"},{label:"莎车县",value:"莎车县"},{label:"叶城县",value:"叶城县"},{label:"麦盖提县",value:"麦盖提县"},{label:"岳普湖县",value:"岳普湖县"},{label:"伽师县",value:"伽师县"},{label:"巴楚县",value:"巴楚县"},{label:"塔什库尔干塔吉克自治县",value:"塔什库尔干塔吉克自治县"}]},{label:"和田地区",value:"和田地区",children:[{label:"和田市",value:"和田市"},{label:"和田县",value:"和田县"},{label:"墨玉县",value:"墨玉县"},{label:"皮山县",value:"皮山县"},{label:"洛浦县",value:"洛浦县"},{label:"策勒县",value:"策勒县"},{label:"于田县",value:"于田县"},{label:"民丰县",value:"民丰县"}]},{label:"伊犁哈萨克自治州",value:"伊犁哈萨克自治州",children:[{label:"伊宁市",value:"伊宁市"},{label:"奎屯市",value:"奎屯市"},{label:"霍尔果斯市",value:"霍尔果斯市"},{label:"伊宁县",value:"伊宁县"},{label:"察布查尔锡伯自治县",value:"察布查尔锡伯自治县"},{label:"霍城县",value:"霍城县"},{label:"巩留县",value:"巩留县"},{label:"新源县",value:"新源县"},{label:"昭苏县",value:"昭苏县"},{label:"特克斯县",value:"特克斯县"},{label:"尼勒克县",value:"尼勒克县"}]},{label:"塔城地区",value:"塔城地区",children:[{label:"塔城市",value:"塔城市"},{label:"乌苏市",value:"乌苏市"},{label:"沙湾市",value:"沙湾市"},{label:"额敏县",value:"额敏县"},{label:"托里县",value:"托里县"},{label:"裕民县",value:"裕民县"},{label:"和布克赛尔蒙古自治县",value:"和布克赛尔蒙古自治县"}]},{label:"阿勒泰地区",value:"阿勒泰地区",children:[{label:"阿勒泰市",value:"阿勒泰市"},{label:"布尔津县",value:"布尔津县"},{label:"富蕴县",value:"富蕴县"},{label:"福海县",value:"福海县"},{label:"哈巴河县",value:"哈巴河县"},{label:"青河县",value:"青河县"},{label:"吉木乃县",value:"吉木乃县"}]},{label:"自治区直辖县级行政区划",value:"自治区直辖县级行政区划",children:[{label:"石河子市",value:"石河子市"},{label:"阿拉尔市",value:"阿拉尔市"},{label:"图木舒克市",value:"图木舒克市"},{label:"五家渠市",value:"五家渠市"},{label:"北屯市",value:"北屯市"},{label:"铁门关市",value:"铁门关市"},{label:"双河市",value:"双河市"},{label:"可克达拉市",value:"可克达拉市"},{label:"昆玉市",value:"昆玉市"},{label:"胡杨河市",value:"胡杨河市"},{label:"新星市",value:"新星市"},{label:"白杨市",value:"白杨市"}]}]},{label:"香港特别行政区",value:"香港特别行政区",children:[{label:"香港岛",value:"香港岛",children:[{label:"中西区",value:"中西区"},{label:"湾仔区",value:"湾仔区"},{label:"东区",value:"东区"},{label:"南区",value:"南区"}]},{label:"九龙",value:"九龙",children:[{label:"油尖旺区",value:"油尖旺区"},{label:"深水埗区",value:"深水埗区"},{label:"九龙城区",value:"九龙城区"},{label:"黄大仙区",value:"黄大仙区"},{label:"观塘区",value:"观塘区"}]},{label:"新界",value:"新界",children:[{label:"葵青区",value:"葵青区"},{label:"荃湾区",value:"荃湾区"},{label:"屯门区",value:"屯门区"},{label:"元朗区",value:"元朗区"},{label:"北区",value:"北区"},{label:"大埔区",value:"大埔区"},{label:"沙田区",value:"沙田区"},{label:"西贡区",value:"西贡区"},{label:"离岛区",value:"离岛区"}]}]},{label:"澳门特别行政区",value:"澳门特别行政区",children:[{label:"澳门半岛",value:"澳门半岛",children:[{label:"大堂区",value:"大堂区"},{label:"望德堂区",value:"望德堂区"},{label:"风顺堂区",value:"风顺堂区"},{label:"花地玛堂区",value:"花地玛堂区"},{label:"圣安多尼堂区",value:"圣安多尼堂区"}]},{label:"澳门外岛",value:"澳门外岛",children:[{label:"嘉模堂区(氹仔)",value:"嘉模堂区(氹仔)"},{label:"圣方济各堂区(路环)",value:"圣方济各堂区(路环)"}]}]},{label:"台湾省",value:"台湾省",children:[{label:"台北市",value:"台北市",children:[{label:"大安区",value:"大安区"},{label:"内湖区",value:"内湖区"},{label:"士林区",value:"士林区"},{label:"文山区",value:"文山区"},{label:"北投区",value:"北投区"},{label:"中山区",value:"中山区"},{label:"信义区",value:"信义区"},{label:"松山区",value:"松山区"},{label:"万华区",value:"万华区"},{label:"中正区",value:"中正区"},{label:"大同区",value:"大同区"},{label:"南港区",value:"南港区"}]},{label:"新北市",value:"新北市",children:[{label:"板桥区",value:"板桥区"},{label:"新庄区",value:"新庄区"},{label:"中和区",value:"中和区"},{label:"三重区",value:"三重区"},{label:"新店区",value:"新店区"},{label:"土城区",value:"土城区"},{label:"永和区",value:"永和区"},{label:"芦洲区",value:"芦洲区"},{label:"汐止区",value:"汐止区"},{label:"树林区",value:"树林区"},{label:"淡水区",value:"淡水区"},{label:"三峡区",value:"三峡区"},{label:"林口区",value:"林口区"},{label:"莺歌区",value:"莺歌区"},{label:"五股区",value:"五股区"},{label:"泰山区",value:"泰山区"},{label:"瑞芳区",value:"瑞芳区"},{label:"八里区",value:"八里区"},{label:"深坑区",value:"深坑区"},{label:"三芝区",value:"三芝区"},{label:"万里区",value:"万里区"},{label:"金山区",value:"金山区"},{label:"贡寮区",value:"贡寮区"},{label:"石门区",value:"石门区"},{label:"双溪区",value:"双溪区"},{label:"石碇区",value:"石碇区"},{label:"坪林区",value:"坪林区"},{label:"乌来区",value:"乌来区"},{label:"平溪区",value:"平溪区"}]},{label:"桃园市",value:"桃园市",children:[{label:"桃园区",value:"桃园区"},{label:"中坜区",value:"中坜区"},{label:"平镇区",value:"平镇区"},{label:"八德区",value:"八德区"},{label:"杨梅区",value:"杨梅区"},{label:"芦竹区",value:"芦竹区"},{label:"龟山区",value:"龟山区"},{label:"龙潭区",value:"龙潭区"},{label:"大溪区",value:"大溪区"},{label:"大园区",value:"大园区"},{label:"观音区",value:"观音区"},{label:"新屋区",value:"新屋区"},{label:"复兴区",value:"复兴区"}]},{label:"台中市",value:"台中市",children:[{label:"北屯区",value:"北屯区"},{label:"西屯区",value:"西屯区"},{label:"大里区",value:"大里区"},{label:"太平区",value:"太平区"},{label:"南屯区",value:"南屯区"},{label:"丰原区",value:"丰原区"},{label:"东区",value:"东区"},{label:"南区",value:"南区"},{label:"西区",value:"西区"},{label:"北区",value:"北区"},{label:"中区",value:"中区"},{label:"潭子区",value:"潭子区"},{label:"大雅区",value:"大雅区"},{label:"沙鹿区",value:"沙鹿区"},{label:"清水区",value:"清水区"},{label:"龙井区",value:"龙井区"},{label:"大甲区",value:"大甲区"},{label:"乌日区",value:"乌日区"},{label:"神冈区",value:"神冈区"},{label:"雾峰区",value:"雾峰区"},{label:"梧栖区",value:"梧栖区"},{label:"大肚区",value:"大肚区"},{label:"后里区",value:"后里区"},{label:"东势区",value:"东势区"},{label:"外埔区",value:"外埔区"},{label:"新社区",value:"新社区"},{label:"大安区",value:"大安区"},{label:"石冈区",value:"石冈区"},{label:"和平区",value:"和平区"}]},{label:"台南市",value:"台南市",children:[{label:"永康区",value:"永康区"},{label:"安南区",value:"安南区"},{label:"东区",value:"东区"},{label:"北区",value:"北区"},{label:"南区",value:"南区"},{label:"中西区",value:"中西区"},{label:"新营区",value:"新营区"},{label:"仁德区",value:"仁德区"},{label:"归仁区",value:"归仁区"},{label:"安平区",value:"安平区"},{label:"佳里区",value:"佳里区"},{label:"善化区",value:"善化区"},{label:"麻豆区",value:"麻豆区"},{label:"新化区",value:"新化区"},{label:"新市区",value:"新市区"},{label:"关庙区",value:"关庙区"},{label:"安定区",value:"安定区"},{label:"白河区",value:"白河区"},{label:"学甲区",value:"学甲区"},{label:"盐水区",value:"盐水区"},{label:"西港区",value:"西港区"},{label:"下营区",value:"下营区"},{label:"后壁区",value:"后壁区"},{label:"七股区",value:"七股区"},{label:"六甲区",value:"六甲区"},{label:"官田区",value:"官田区"},{label:"柳营区",value:"柳营区"},{label:"东山区",value:"东山区"},{label:"将军区",value:"将军区"},{label:"玉井区",value:"玉井区"},{label:"北门区",value:"北门区"},{label:"大内区",value:"大内区"},{label:"楠西区",value:"楠西区"},{label:"南化区",value:"南化区"},{label:"山上区",value:"山上区"},{label:"左镇区",value:"左镇区"},{label:"龙崎区",value:"龙崎区"}]},{label:"高雄市",value:"高雄市",children:[{label:"凤山区",value:"凤山区"},{label:"三民区",value:"三民区"},{label:"左营区",value:"左营区"},{label:"前镇区",value:"前镇区"},{label:"楠梓区",value:"楠梓区"},{label:"苓雅区",value:"苓雅区"},{label:"小港区",value:"小港区"},{label:"鼓山区",value:"鼓山区"},{label:"大寮区",value:"大寮区"},{label:"冈山区",value:"冈山区"},{label:"仁武区",value:"仁武区"},{label:"林园区",value:"林园区"},{label:"路竹区",value:"路竹区"},{label:"新兴区",value:"新兴区"},{label:"鸟松区",value:"鸟松区"},{label:"大树区",value:"大树区"},{label:"美浓区",value:"美浓区"},{label:"桥头区",value:"桥头区"},{label:"旗山区",value:"旗山区"},{label:"梓官区",value:"梓官区"},{label:"大社区",value:"大社区"},{label:"茄萣区",value:"茄萣区"},{label:"燕巢区",value:"燕巢区"},{label:"湖内区",value:"湖内区"},{label:"阿莲区",value:"阿莲区"},{label:"旗津区",value:"旗津区"},{label:"前金区",value:"前金区"},{label:"盐埕区",value:"盐埕区"},{label:"弥陀区",value:"弥陀区"},{label:"内门区",value:"内门区"},{label:"永安区",value:"永安区"},{label:"六龟区",value:"六龟区"},{label:"杉林区",value:"杉林区"},{label:"田寮区",value:"田寮区"},{label:"甲仙区",value:"甲仙区"},{label:"桃源区",value:"桃源区"},{label:"那玛夏区",value:"那玛夏区"},{label:"茂林区",value:"茂林区"}]},{label:"基隆市",value:"基隆市",children:[{label:"安乐区",value:"安乐区"},{label:"七堵区",value:"七堵区"},{label:"信义区",value:"信义区"},{label:"中正区",value:"中正区"},{label:"中山区",value:"中山区"},{label:"仁爱区",value:"仁爱区"},{label:"暖暖区",value:"暖暖区"}]},{label:"新竹市",value:"新竹市",children:[{label:"东区",value:"东区"},{label:"北区",value:"北区"},{label:"香山区",value:"香山区"}]},{label:"嘉义市",value:"嘉义市",children:[{label:"东区",value:"东区"},{label:"西区",value:"西区"}]},{label:"新竹县",value:"新竹县",children:[{label:"竹北市",value:"竹北市"},{label:"竹东镇",value:"竹东镇"},{label:"新埔镇",value:"新埔镇"},{label:"关西镇",value:"关西镇"},{label:"湖口乡",value:"湖口乡"},{label:"新丰乡",value:"新丰乡"},{label:"芎林乡",value:"芎林乡"},{label:"宝山乡",value:"宝山乡"},{label:"横山乡",value:"横山乡"},{label:"尖石乡",value:"尖石乡"},{label:"北埔乡",value:"北埔乡"},{label:"峨眉乡",value:"峨眉乡"},{label:"五峰乡",value:"五峰乡"}]},{label:"苗栗县",value:"苗栗县",children:[{label:"头份市",value:"头份市"},{label:"苗栗市",value:"苗栗市"},{label:"竹南镇",value:"竹南镇"},{label:"苑里镇",value:"苑里镇"},{label:"后龙镇",value:"后龙镇"},{label:"通霄镇",value:"通霄镇"},{label:"卓兰镇",value:"卓兰镇"},{label:"公馆乡",value:"公馆乡"},{label:"铜锣乡",value:"铜锣乡"},{label:"三义乡",value:"三义乡"},{label:"大湖乡",value:"大湖乡"},{label:"造桥乡",value:"造桥乡"},{label:"头屋乡",value:"头屋乡"},{label:"南庄乡",value:"南庄乡"},{label:"西湖乡",value:"西湖乡"},{label:"三湾乡",value:"三湾乡"},{label:"泰安乡",value:"泰安乡"},{label:"狮潭乡",value:"狮潭乡"}]},{label:"彰化县",value:"彰化县",children:[{label:"彰化市",value:"彰化市"},{label:"员林市",value:"员林市"},{label:"和美镇",value:"和美镇"},{label:"鹿港镇",value:"鹿港镇"},{label:"溪湖镇",value:"溪湖镇"},{label:"二林镇",value:"二林镇"},{label:"田中镇",value:"田中镇"},{label:"北斗镇",value:"北斗镇"},{label:"福兴乡",value:"福兴乡"},{label:"花坛乡",value:"花坛乡"},{label:"社头乡",value:"社头乡"},{label:"秀水乡",value:"秀水乡"},{label:"伸港乡",value:"伸港乡"},{label:"大村乡",value:"大村乡"},{label:"永靖乡",value:"永靖乡"},{label:"埔心乡",value:"埔心乡"},{label:"芳苑乡",value:"芳苑乡"},{label:"埔盐乡",value:"埔盐乡"},{label:"埤头乡",value:"埤头乡"},{label:"溪州乡",value:"溪州乡"},{label:"田尾乡",value:"田尾乡"},{label:"芬园乡",value:"芬园乡"},{label:"线西乡",value:"线西乡"},{label:"大城乡",value:"大城乡"},{label:"二水乡",value:"二水乡"},{label:"竹塘乡",value:"竹塘乡"}]},{label:"南投县",value:"南投县",children:[{label:"南投市",value:"南投市"},{label:"草屯镇",value:"草屯镇"},{label:"埔里镇",value:"埔里镇"},{label:"竹山镇",value:"竹山镇"},{label:"集集镇",value:"集集镇"},{label:"名间乡",value:"名间乡"},{label:"国姓乡",value:"国姓乡"},{label:"鹿谷乡",value:"鹿谷乡"},{label:"水里乡",value:"水里乡"},{label:"信义乡",value:"信义乡"},{label:"仁爱乡",value:"仁爱乡"},{label:"鱼池乡",value:"鱼池乡"},{label:"中寮乡",value:"中寮乡"}]},{label:"云林县",value:"云林县",children:[{label:"斗六市",value:"斗六市"},{label:"虎尾镇",value:"虎尾镇"},{label:"西螺镇",value:"西螺镇"},{label:"斗南镇",value:"斗南镇"},{label:"北港镇",value:"北港镇"},{label:"土库镇",value:"土库镇"},{label:"麦寮乡",value:"麦寮乡"},{label:"古坑乡",value:"古坑乡"},{label:"莿桐乡",value:"莿桐乡"},{label:"口湖乡",value:"口湖乡"},{label:"二仑乡",value:"二仑乡"},{label:"元长乡",value:"元长乡"},{label:"水林乡",value:"水林乡"},{label:"仑背乡",value:"仑背乡"},{label:"台西乡",value:"台西乡"},{label:"四湖乡",value:"四湖乡"},{label:"大埤乡",value:"大埤乡"},{label:"林内乡",value:"林内乡"},{label:"东势乡",value:"东势乡"},{label:"褒忠乡",value:"褒忠乡"}]},{label:"嘉义县",value:"嘉义县",children:[{label:"朴子市",value:"朴子市"},{label:"太保市",value:"太保市"},{label:"大林镇",value:"大林镇"},{label:"布袋镇",value:"布袋镇"},{label:"民雄乡",value:"民雄乡"},{label:"水上乡",value:"水上乡"},{label:"中埔乡",value:"中埔乡"},{label:"竹崎乡",value:"竹崎乡"},{label:"新港乡",value:"新港乡"},{label:"东石乡",value:"东石乡"},{label:"六脚乡",value:"六脚乡"},{label:"梅山乡",value:"梅山乡"},{label:"义竹乡",value:"义竹乡"},{label:"鹿草乡",value:"鹿草乡"},{label:"溪口乡",value:"溪口乡"},{label:"番路乡",value:"番路乡"},{label:"阿里山乡",value:"阿里山乡"},{label:"大埔乡",value:"大埔乡"}]},{label:"屏东县",value:"屏东县",children:[{label:"屏东市",value:"屏东市"},{label:"潮州镇",value:"潮州镇"},{label:"东港镇",value:"东港镇"},{label:"恒春镇",value:"恒春镇"},{label:"内埔乡",value:"内埔乡"},{label:"万丹乡",value:"万丹乡"},{label:"新园乡",value:"新园乡"},{label:"长治乡",value:"长治乡"},{label:"里港乡",value:"里港乡"},{label:"盐埔乡",value:"盐埔乡"},{label:"高树乡",value:"高树乡"},{label:"枋寮乡",value:"枋寮乡"},{label:"九如乡",value:"九如乡"},{label:"万峦乡",value:"万峦乡"},{label:"佳冬乡",value:"佳冬乡"},{label:"林边乡",value:"林边乡"},{label:"竹田乡",value:"竹田乡"},{label:"崁顶乡",value:"崁顶乡"},{label:"琉球乡",value:"琉球乡"},{label:"麟洛乡",value:"麟洛乡"},{label:"南州乡",value:"南州乡"},{label:"新埤乡",value:"新埤乡"},{label:"车城乡",value:"车城乡"},{label:"满州乡",value:"满州乡"},{label:"三地门乡",value:"三地门乡"},{label:"来义乡",value:"来义乡"},{label:"玛家乡",value:"玛家乡"},{label:"枋山乡",value:"枋山乡"},{label:"泰武乡",value:"泰武乡"},{label:"牡丹乡",value:"牡丹乡"},{label:"狮子乡",value:"狮子乡"},{label:"春日乡",value:"春日乡"},{label:"雾台乡",value:"雾台乡"}]},{label:"宜兰县",value:"宜兰县",children:[{label:"宜兰市",value:"宜兰市"},{label:"罗东镇",value:"罗东镇"},{label:"苏澳镇",value:"苏澳镇"},{label:"头城镇",value:"头城镇"},{label:"冬山乡",value:"冬山乡"},{label:"五结乡",value:"五结乡"},{label:"礁溪乡",value:"礁溪乡"},{label:"员山乡",value:"员山乡"},{label:"壮围乡",value:"壮围乡"},{label:"三星乡",value:"三星乡"},{label:"大同乡",value:"大同乡"},{label:"南澳乡",value:"南澳乡"}]},{label:"花莲县",value:"花莲县",children:[{label:"花莲市",value:"花莲市"},{label:"玉里镇",value:"玉里镇"},{label:"凤林镇",value:"凤林镇"},{label:"吉安乡",value:"吉安乡"},{label:"新城乡",value:"新城乡"},{label:"寿丰乡",value:"寿丰乡"},{label:"秀林乡",value:"秀林乡"},{label:"光复乡",value:"光复乡"},{label:"瑞穗乡",value:"瑞穗乡"},{label:"富里乡",value:"富里乡"},{label:"万荣乡",value:"万荣乡"},{label:"卓溪乡",value:"卓溪乡"},{label:"丰滨乡",value:"丰滨乡"}]},{label:"台东县",value:"台东县",children:[{label:"台东市",value:"台东市"},{label:"卑南乡",value:"卑南乡"},{label:"成功镇",value:"成功镇"},{label:"太麻里乡",value:"太麻里乡"},{label:"关山镇",value:"关山镇"},{label:"东河乡",value:"东河乡"},{label:"池上乡",value:"池上乡"},{label:"鹿野乡",value:"鹿野乡"},{label:"长滨乡",value:"长滨乡"},{label:"大武乡",value:"大武乡"},{label:"兰屿乡",value:"兰屿乡"},{label:"海端乡",value:"海端乡"},{label:"绿岛乡",value:"绿岛乡"},{label:"金峰乡",value:"金峰乡"},{label:"延平乡",value:"延平乡"},{label:"达仁乡",value:"达仁乡"}]},{label:"澎湖县",value:"澎湖县",children:[{label:"马公市",value:"马公市"},{label:"湖西乡",value:"湖西乡"},{label:"白沙乡",value:"白沙乡"},{label:"西屿乡",value:"西屿乡"},{label:"望安乡",value:"望安乡"},{label:"七美乡",value:"七美乡"}]}]},{label:"其他",value:"其他",children:[{label:"国外",value:"国外"}]}],Bs=e=>e?e.split("-"):[],iC=(e,t)=>{const n=[];let l=e;for(const r of t){const a=l?.find(i=>String(i.value)===r);if(!a)break;n.push(a.label),l=a.children}return n},_f=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r})=>{const a=e.cascaderOptions&&e.cascaderOptions.length>0?e.cascaderOptions:aC,i=e.placeholder||"请选择省市区",s=t??e.defaultValue,[o,u]=y.useState(()=>Bs(s)),[c,d]=y.useState(0),[f,h]=y.useState(100),m=y.useRef(null);y.useEffect(()=>{u(Bs(s))},[s]);const v=o.length>=2,g=y.useCallback(O=>{u(O),n(e.key,O.join("-"))},[e.key,n]),E=y.useCallback(O=>{if(!O||O.length===0){g([]);return}O.length<2||g(O.map(String))},[g]),N=y.useCallback(O=>{O||(u(Bs(s)),d(S=>S+1))},[s]),A=y.useCallback(()=>{if(o.length>=2){const O=iC(a,o);return O.length?O.join("-"):o.join("-")}return i},[o,a,i]),L=y.useCallback(()=>{const O=m.current;if(!O)return;const S=A(),_=O.querySelector(".ant-select-selector"),I=O.querySelector(".ant-select-selection-item")||O.querySelector(".ant-select-selection-placeholder"),k=I||_||O,R=window.getComputedStyle(k),M=I?R.fontSize:"16px",H=R.fontFamily||"sans-serif",q=R.fontWeight||"400",T=`${R.fontStyle||"normal"} ${q} ${M} ${H}`,V=document.createElement("canvas").getContext("2d"),$=V?Math.ceil((V.font=T,V.measureText(S).width||0)):0;let X=0;if(_){const ie=window.getComputedStyle(_);X=(Number.parseFloat(ie.paddingLeft)||0)+(Number.parseFloat(ie.paddingRight)||0)}const Z=Math.max(80,$+X+16+10);h(ie=>ie===Z?ie:Z)},[A]);return y.useLayoutEffect(()=>{const O=window.requestAnimationFrame(()=>L()),S=window.setTimeout(()=>L(),60);return()=>{window.cancelAnimationFrame(O),window.clearTimeout(S)}},[L]),y.useEffect(()=>{if(!("fonts"in document))return;let O=!1;const S=document.fonts;if(S?.ready)return S.ready.then(()=>{O||L()}),()=>{O=!0}},[L]),b.jsx(gn,{node:e,children:b.jsx("span",{ref:m,className:["rte-cascader-host",r?"rte-cascader-error":""].filter(Boolean).join(" "),"data-type":"cascader","data-key":e.key,"data-has-value":v?"true":"false",contentEditable:!1,style:{display:"inline-block",width:f},children:b.jsx(ue.Cascader,{"data-type":"cascader","data-key":e.key,options:a,value:v?o:void 0,onChange:O=>E(O),onOpenChange:N,disabled:l,placeholder:i,changeOnSelect:!0,size:"small",variant:"borderless",allowClear:!0,showSearch:{filter:(O,S)=>S.some(_=>_.label.toLowerCase().includes(O.toLowerCase()))},popupClassName:"rte-cascader-dropdown",placement:"bottomLeft",builtinPlacements:Ps,getPopupContainer:xr,displayRender:O=>O.join("-"),style:{width:"100%"},suffixIcon:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})},c)})})});_f.displayName="CascaderNode";const Of=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,nodeDefaults:a})=>{const i=typeof e.maxHeight=="number"?e.maxHeight:a?.textarea?.maxHeight??252,s=y.useCallback(o=>n(e.key,o.target.value),[e.key,n]);return b.jsx(gn,{node:e,children:b.jsx("div",{className:`rte-textarea-wrapper ${r?"rte-textarea-error":""}`,"data-key":e.key,children:b.jsx(ue.Input.TextArea,{className:"rte-textarea","data-type":"textarea","data-key":e.key,value:t??"",onChange:s,disabled:l,placeholder:e.placeholder,autoSize:{minRows:1,maxRows:99},style:{maxHeight:i},variant:"borderless"})})})});Of.displayName="TextareaNode";const Rs=e=>{const t=e.trim();if(!t)return{url:""};let n=null;try{n=new URL(t)}catch{try{n=new URL(`https://${t}`)}catch{return{url:t}}}const l=n.pathname.split("/").filter(Boolean),r=l.findIndex(o=>o==="report"),a=r>=0?l[r+1]:void 0,i=l[0]&&l[0].length<=5?l[0]:void 0,s=n.searchParams.get("agentId")||void 0;return{url:t,reportId:a,agentId:s,lang:i}},sC="https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/website/kongzhuangtai.svg",oC=e=>{if(!e)return"";const t=Rs(e);return t.reportId?`report:${t.reportId}`:`url:${e.trim()}`},uC=({nodeKey:e,nodeType:t,fetch:n,onSelect:l,onGoGenerate:r,onViewReport:a,hideCurrentSessionReport:i,preciseMatchKey:s,open:o})=>{const[u,c]=y.useState(!1),[d,f]=y.useState(null),[h,m]=y.useState(""),v=y.useRef(0),g=y.useRef(null);y.useEffect(()=>{if(!o)return;const S=++v.current;c(!0),n({nodeKey:e,nodeType:t}).then(_=>{if(S!==v.current)return;const I=i?_.tabs.filter(M=>M.key!=="currentConversationReports"):_.tabs,k={..._,tabs:I};f(k);const R=I.find(M=>M.items.length>0);m(R?.key??I[0]?.key??"")}).catch(()=>{S===v.current&&f({tabs:[]})}).finally(()=>{S===v.current&&c(!1)})},[o,n,e,t,i]);const E=y.useCallback(S=>s?S.filter(_=>oC(_.url)===s):S,[s]);y.useEffect(()=>{if(!o||!s||!d)return;const S=d.tabs.find(_=>E(_.items).length>0);S&&m(_=>_===S.key?_:S.key)},[o,s,d,E]);const N=d?.tabs.find(S=>S.key===h),A=N?E(N.items):[],L=y.useCallback(S=>{const _=S.currentTarget;_.classList.add("is-scrolling"),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{_.classList.remove("is-scrolling"),g.current=null},300)},[]),O=y.useCallback((S,_)=>{S.stopPropagation(),a?a(_):window.open(_.viewUrl||_.url,"_blank")},[a]);return b.jsx("div",{className:"rte-report-dropdown-panel",onMouseDown:S=>S.preventDefault(),children:u?b.jsx("div",{className:"rte-report-dropdown-loading",children:b.jsx(ue.Spin,{size:"small"})}):d?b.jsxs(b.Fragment,{children:[d.tabs.length>1&&b.jsx("div",{className:"rte-report-dropdown-tab-outer",children:b.jsx("div",{className:"rte-report-dropdown-tab-inner",children:d.tabs.map(S=>b.jsx("div",{className:`rte-report-dropdown-tab-item${S.key===h?" active":""}`,onClick:()=>m(S.key),children:S.label},S.key))})}),b.jsx("div",{className:"rte-report-dropdown-list",onScroll:L,children:!N||A.length===0?b.jsxs("div",{className:"rte-report-dropdown-empty",children:[b.jsx("img",{className:"rte-report-dropdown-empty-img",src:sC,alt:""}),b.jsxs("div",{className:"rte-report-dropdown-empty-text",children:[b.jsx("span",{className:"rte-report-dropdown-empty-label",children:s?"未找到匹配的报告":"暂无生成的报告"}),r&&N?.agentType!==void 0&&b.jsx("span",{className:"rte-report-dropdown-empty-link",onClick:()=>r(N.agentType),children:"去生成"})]})]}):A.map((S,_)=>b.jsxs("div",{className:"rte-report-dropdown-item",onClick:()=>l(S),children:[b.jsx("span",{className:"rte-report-dropdown-item-name",title:S.name,children:S.name}),b.jsxs("span",{className:"rte-report-dropdown-item-action",onClick:I=>O(I,S),children:[b.jsx("i",{className:"iconfont icon-chakanbaogao"}),"查看报告"]})]},`${S.url}-${_}`))})]}):null})},Mf=({chipRef:e,nodeKey:t,nodeType:n,fetch:l,onSelect:r,onGoGenerate:a,onViewReport:i,hideCurrentSessionReport:s,preciseMatchKey:o="",quiet:u,openSignal:c})=>{const d=_l(),[f,h]=y.useState(!1),m=y.useRef(null),v=y.useRef({}).current,[g,E]=y.useState("bottomLeft"),[N,A]=y.useState(0),L=y.useCallback(()=>{const k=e.current,R=m.current;if(!k||!R)return;const M=k.getBoundingClientRect(),H=R.getBoundingClientRect();A(M.left-H.left);const q=236,B=window.innerHeight-M.bottom;E(B<q?"topLeft":"bottomLeft")},[e]);y.useLayoutEffect(()=>{f&&L()},[f,L]);const O=y.useMemo(()=>({offset:[N,g==="bottomLeft"?4:-4],overflow:{adjustX:!1,adjustY:!1}}),[N,g]),S=y.useCallback(()=>{document.dispatchEvent(new CustomEvent("rte-report-dropdown-opening",{detail:v})),h(!0)},[v]);y.useEffect(()=>{c!==void 0&&S()},[c,S]),y.useEffect(()=>{const k=R=>{R.detail!==v&&h(!1)};return document.addEventListener("rte-report-dropdown-opening",k),()=>document.removeEventListener("rte-report-dropdown-opening",k)},[v]),y.useEffect(()=>{if(!f)return;const k=R=>{const M=e.current,H=R.target;if(M?.contains(H))return;const q=document.querySelectorAll(".rte-report-dropdown-overlay");for(let B=0;B<q.length;B++)if(q[B].contains(H))return;h(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f,e]);const _=y.useCallback(k=>{h(!1),r(k)},[r]),I=f?b.jsx(uC,{nodeKey:t,nodeType:n,fetch:l,onSelect:_,onGoGenerate:a,onViewReport:i,hideCurrentSessionReport:s,preciseMatchKey:o,open:f}):null;return b.jsx(ue.Popover,{content:I,trigger:[],open:f,placement:g,align:O,autoAdjustOverflow:!1,getPopupContainer:()=>d??document.body,overlayClassName:"rte-report-dropdown-overlay",arrow:!1,children:b.jsx("span",{ref:m,className:["rte-report-dropdown-host",u?"rte-report-dropdown-host-quiet":""].filter(Boolean).join(" "),"data-key":t,"data-node-type":n,contentEditable:!1,onClick:k=>{k.stopPropagation(),f?h(!1):S()},children:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang rte-report-dropdown-icon","aria-label":"选择报告"})})})},cC={display:"inline-block",border:0,background:"transparent",outline:"none",padding:0,margin:0,font:"inherit",color:"inherit",boxSizing:"border-box",verticalAlign:"middle"},dC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Df=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,reportNames:u,onResolveName:c,onClearReport:d,onShiftReportNames:f})=>{const h=e.maxCount??9,m=e.minCount??1,v=dC(e.tooltip),g=!1,E=!!v,N=y.useMemo(()=>t??[],[t]),A=y.useMemo(()=>{const _=N.filter(R=>R&&R.trim().length>0),I=Math.max(m,Math.min(_.length+1,h)),k=Math.min(Math.max(N.length,I),h);return Array.from({length:k},(R,M)=>N[M]??"")},[N,m,h]),L=y.useCallback((_,I)=>{const k=[...A];if(k[_]=I,I.trim()===""){const R=k.reduce((M,H,q)=>H&&H.trim()?q:M,-1);_<R&&k.splice(_,1),k.length=R+1,f?.(e.key,_)}n(e.key,k)},[A,e.key,n,f]),O=y.useCallback((_,I)=>{const k=[...A];I.forEach((M,H)=>{const q=_+H;q<h&&(k[q]=M)});const R=k.reduce((M,H,q)=>H&&H.trim()?q:M,-1);k.length=R+1,n(e.key,k)},[A,h,e.key,n]),S=y.useCallback((_,I)=>{const k=[...A];k[_]=I.url,n(e.key,k)},[A,e.key,n]);return y.useCallback(_=>{L(_,"")},[L]),b.jsx(gn,{node:e,children:b.jsx("span",{className:`rte-multi-variable ${r?"rte-multi-variable-error":""}`,children:A.map((_,I)=>(`${e.key}${I}`,b.jsx(Lf,{nodeKey:e.key,idx:I,row:_,placeholder:e.placeholder,disabled:l,tooltip:v,onUpdate:k=>L(I,k),onBatchUpdate:k=>O(I,k),showDropdown:g,showInfoIcon:E,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,onSelectReport:k=>S(I,k),nodeType:"multi-variable",reportName:void 0,onResolveName:void 0,onClearName:void 0},I)))})})});Df.displayName="MultiVariableNode";const Lf=({nodeKey:e,idx:t,row:n,placeholder:l,disabled:r,tooltip:a,onUpdate:i,onBatchUpdate:s,showDropdown:o,showInfoIcon:u,reportListFetch:c,onReportGoGenerate:d,onViewReport:f,hideCurrentSessionReport:h,onSelectReport:m,nodeType:v,reportName:g,onResolveName:E,onClearName:N})=>{const A=y.useRef(null),L=`${e}_${t}`,O=!!g,S=!(n||"").trim(),_=u&&S,I=o||_||O,k=y.useRef(""),R=y.useCallback(async C=>{if(!E)return;const Z=(C||"").trim();/^https?:\/\//i.test(Z)&&k.current!==Z&&(k.current=Z,await E(Z))},[E]),M=y.useCallback(()=>{R(n)},[R,n]),H=y.useCallback(C=>{const Z=C.clipboardData.getData("text/plain"),ie=Z.trim();if(E&&/^https?:\/\//i.test(ie)){C.preventDefault(),i(ie),document.dispatchEvent(new CustomEvent("rte-report-dropdown-opening",{detail:null})),R(ie);return}if(s&&/[\n\s]/.test(Z)){C.preventDefault();const D=Z.split(/[\n\s]+/).filter(pe=>pe.trim().length>0);D.length>1?s(D):D.length===1&&i(D[0]);return}},[E,i,s,R]);y.useLayoutEffect(()=>{(n||"").trim()||(k.current="")},[n]);const q=y.useRef(null),B=n||l||"",[T,F]=y.useState(0),V=y.useCallback(()=>{q.current&&F(q.current.offsetWidth)},[]);y.useLayoutEffect(()=>{V();const C=document.fonts;C?.ready&&C.ready.then(V)},[B,V]);const $=T>0?Math.max(40,T+2):40,X=["variable-chip",O?"rte-report-name-chip":"",I?"rte-variable-with-icon":""].filter(Boolean).join(" ");return b.jsxs("span",{ref:A,className:X,"data-type":v==="multi-variable-select"?"multi-variable-select":"variable","data-key":L,"data-multi-key":e,"data-index":t,"data-report-url":O?n||!0:void 0,"data-report-name":g||void 0,...a&&!O&&S?{"data-tooltip":a,"data-variable-key":e}:{},children:[b.jsx("span",{ref:q,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"pre",font:"inherit",pointerEvents:"none",top:0,left:0},children:B}),O?b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"rte-report-name-chip-label",onClick:()=>{if(!o)return;A.current?.querySelector(".rte-report-dropdown-host")?.click()},children:g}),o&&c&&b.jsx(Mf,{chipRef:A,nodeKey:L,nodeType:v,fetch:c,onSelect:m,onGoGenerate:d,onViewReport:f,hideCurrentSessionReport:h,quiet:!0}),N&&b.jsx("span",{className:"rte-report-chip-clear-host",onMouseDown:C=>{C.preventDefault(),C.stopPropagation(),N()},children:b.jsx("span",{className:"rte-report-chip-clear-icon",title:"清除",children:b.jsx(Ut.CloseCircleFilled,{})})})]}):b.jsx("input",{"data-type":v==="multi-variable-select"?"multi-variable-select":"variable","data-key":L,value:n,onChange:C=>i(C.target.value),onBlur:M,onPaste:H,onClick:()=>{if(!o||n.trim())return;A.current?.querySelector(".rte-report-dropdown-host")?.click()},onScroll:C=>{const Z=C.currentTarget;document.activeElement!==Z&&Z.scrollLeft!==0&&(Z.scrollLeft=0)},disabled:r,placeholder:l,style:{...cC,width:$}}),!O&&o&&c&&b.jsx(Mf,{chipRef:A,nodeKey:L,nodeType:v,fetch:c,onSelect:m,onGoGenerate:d,onViewReport:f,hideCurrentSessionReport:h}),!O&&_&&b.jsx(Ol,{tooltip:a,className:"variable-info-icon",dataVariableKey:e})]})},fC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Pf=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,reportNames:u,onResolveName:c,onClearReport:d,onShiftReportNames:f,onAnalyzeReport:h})=>{const m=e.maxCount??9,v=e.minCount??1,g=fC(e.tooltip),E=!!a&&!!g,N=!E&&!!g,A=y.useMemo(()=>{const I=t??[],k=I.reduce((R,M,H)=>M&&M.trim()?H:R,-1);return I.slice(0,k+1)},[t]),L=y.useMemo(()=>{const I=A.filter(M=>M&&M.trim().length>0),k=Math.max(v,Math.min(I.length+1,m)),R=Math.min(Math.max(A.length,k),m);return Array.from({length:R},(M,H)=>A[H]??"")},[A,v,m]),O=y.useCallback((I,k)=>{const R=[...L];if(R[I]=k,k.trim()===""){const M=R.reduce((H,q,B)=>q&&q.trim()?B:H,-1);I<M&&R.splice(I,1),R.length=M+1,f?.(e.key,I)}n(e.key,R)},[L,e.key,n,f]),S=y.useCallback((I,k)=>{const R=[...L];R[I]=k.url,n(e.key,R),h?.(`${e.key}_${I}`,k.url),c&&/^https?:\/\//i.test(k.url)&&c(`${e.key}_${I}`,k.url,"multi-variable-select")},[L,e.key,n,h,c]),_=y.useCallback(I=>{O(I,"")},[O]);return b.jsx(gn,{node:e,children:b.jsx("span",{className:`rte-multi-variable-select ${r?"rte-multi-variable-select-error":""}`,children:L.map((I,k)=>{const R=`${e.key}_${k}`;return b.jsx(Lf,{nodeKey:e.key,idx:k,row:I,placeholder:e.placeholder,disabled:l,tooltip:g,onUpdate:M=>O(k,M),showDropdown:E,showInfoIcon:N,reportListFetch:a,onReportGoGenerate:i,onViewReport:s,hideCurrentSessionReport:o,onSelectReport:M=>S(k,M),nodeType:"multi-variable-select",reportName:u?.[R],onResolveName:c?M=>c(R,M,"multi-variable-select"):void 0,onClearName:d?()=>_(k):void 0},k)})})})});Pf.displayName="MultiVariableSelectNode";function Bf(e){const t=y.useMemo(()=>e==null?"":typeof e=="string"?e:typeof URL>"u"||typeof URL.createObjectURL!="function"?"":URL.createObjectURL(e),[e]);return y.useEffect(()=>{if(t&&!(typeof e!="object"||e===null))return()=>{typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&URL.revokeObjectURL(t)}},[e,t]),t}const hC=/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i,pC=e=>hC.test(e),bC=e=>/^image\//i.test(e.type),Na=y.memo(({slotKey:e,file:t,text:n,accept:l,tooltip:r,disabled:a,multiple:i,batch:s,exclusionGroup:o,onPick:u,onReplace:c,onRemove:d})=>{const f=y.useRef(null),h=y.useRef(null),m=_l(),[v,g]=y.useState(!1),E=t!=null,N=Bf(t),[A,L]=y.useState(!1),O=y.useCallback(()=>{a||f.current?.click()},[a]),S=y.useCallback($=>{const X=$.target.files;X&&X.length>0&&u(e,X),$.target.value=""},[u,e]),_=y.useCallback(()=>{a||h.current?.click()},[a]),I=y.useCallback($=>{const X=$.target.files;X&&X.length>0&&c(e,X),$.target.value=""},[c,e]),k=y.useCallback(()=>{a||g(!0)},[a]),R=y.useCallback($=>{$.stopPropagation(),!a&&d(e)},[d,e,a]),M=E?typeof t=="string"?decodeURIComponent(t.split("/").pop()?.split("?")[0]||"file"):t.name:null,H=(E?M:n)??"",q=E&&(typeof t=="string"&&pC(t)||typeof t=="object"&&t!==null&&bC(t)),B=q?b.jsx("img",{className:"upload-icon-img upload-icon-preview",src:N,alt:"preview"}):E?b.jsx("i",{className:"iconfont icon-exlwenjian"}):b.jsx("i",{className:"iconfont icon-shangchuan1"}),T=b.jsx("span",{className:"upload-label","data-file-name":H,children:H}),F=b.jsxs("span",{className:`upload-inner-wrapper${E?" has-file":""}`,children:[b.jsx("span",{className:"upload-icon",children:B}),E&&H&&!q?b.jsx($n,{title:H,align:{offset:[0,-8]},mouseLeaveDelay:0,children:T}):T,r&&b.jsx("i",{style:{fontWeight:100},className:`iconfont icon-tishi upload-info-icon${E?" hidden":""}`,"data-upload-key":e,"data-tooltip":r,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),onClick:$=>{$.stopPropagation(),$.preventDefault()}}),b.jsx("span",{className:`file-remove-btn${E?"":" hidden"}`,title:"移除文件",onClick:E?R:void 0,children:"×"})]});if(E){if(q){const $=b.jsxs("span",{className:`upload-chip${s?" upload-chip-batch":""}`,"data-type":"upload","data-key":e,"data-group":o,"data-tooltip":r||void 0,onClick:k,children:[F,b.jsx(ue.Image,{style:{display:"none"},src:N,preview:{visible:v,onVisibleChange:X=>g(X),getContainer:()=>q3(m)}})]});return b.jsx(ue.Tooltip,{getPopupContainer:xr,title:b.jsx("div",{className:"se-upload-preview",children:b.jsx("img",{className:"se-upload-preview-img",src:N,alt:"preview"})}),placement:"top",align:{offset:[0,-10]},arrow:!1,overlayInnerStyle:{background:"#fff",padding:0,borderRadius:4,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},children:$})}return b.jsxs("span",{className:`upload-chip${s?" upload-chip-batch":""}`,"data-type":"upload","data-key":e,"data-group":o,"data-tooltip":r||void 0,onClick:_,children:[F,b.jsx("input",{ref:h,type:"file",accept:l,multiple:!1,style:{display:"none"},onChange:I})]})}const V=b.jsxs("button",{type:"button",className:`upload-chip${s?" upload-chip-batch":""}`,"data-type":"upload","data-key":e,"data-group":o,"data-tooltip":r||void 0,onClick:O,disabled:a,children:[F,b.jsx("input",{ref:f,type:"file",accept:l,multiple:i,style:{display:"none"},onChange:S})]});return r?b.jsx($n,{title:r,open:A,trigger:[],children:V}):V});Na.displayName="UploadChip";const mC=10*1024*1024,gC=e=>e.size>mC,vC="文件大小不能超过 10MB",yC=1e3;let Rf=0;const EC=(e=Date.now())=>e-Rf<yC?!1:(Rf=e,!0),TC=32,CC=e=>{const[t,n]=y.useState(!1);return y.useLayoutEffect(()=>{const l=e.current;if(!l)return;const r=()=>n(l.offsetHeight>TC);if(r(),typeof ResizeObserver>"u")return;const a=new ResizeObserver(r);return a.observe(l),()=>a.disconnect()}),t},SC=e=>{if(e.accept)return e.accept;if(e.acceptType==="image")return"image/*";if(e.acceptType==="file")return".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json"},xC=e=>{if(e)return typeof e=="string"?e:JSON.stringify(e)},kC=12,Ff=y.memo(({node:e,files:t,onFileChange:n,disabled:l,error:r,onValidationError:a})=>{const{message:i}=ue.App.useApp(),s=typeof e.maxCount=="number"&&typeof e.minCount=="number"&&e.maxCount>1,o=SC(e),u=y.useRef(null),c=CC(u),d=Sr(e.tooltip),f=!!d,h=f?void 0:xC(e.tooltip),m=y.useCallback(M=>{a?a(M):i.error(M)},[a,i]),v=y.useCallback(M=>{const H=Array.from(M),q=[];let B=0;for(const T of H)gC(T)?B+=1:q.push(T);return B>0&&EC()&&m(vC),q},[m]),g=y.useCallback((M,H)=>{const q=v(H);q.length!==0&&n(M,q[0])},[n,v]),E=y.useCallback((M,H)=>{const q=v(H);if(q.length===0)return;const B=e.key,T=e.maxCount??0,F=(()=>{const $=M.match(/-(\d+)$/);return $?Number.parseInt($[1],10):0})();let V=Math.max(0,Math.min(F,T-1));for(const $ of q){for(;V<T&&t[`${B}-${V}`]!=null;)V+=1;if(V>=T)break;n(`${B}-${V}`,$),V+=1}},[t,e.key,e.maxCount,n,v]),N=y.useCallback(M=>{if(!s){n(M,null);return}const H=e.key,q=e.maxCount??0,B=[];for(let T=0;T<q;T+=1){const F=`${H}-${T}`;if(F===M)continue;const V=t[F];V!=null&&B.push(V)}for(let T=0;T<q;T+=1)n(`${H}-${T}`,T<B.length?B[T]:null)},[s,t,e.key,e.maxCount,n]),{filledEntries:A,emptyKeys:L}=y.useMemo(()=>{if(!s)return{filledEntries:[],emptyKeys:[]};const M=e.key,H=[],q=[];for(let B=0;B<(e.maxCount??0);B+=1){const T=`${M}-${B}`,F=t[T];F!=null?H.push({key:T,file:F}):q.push(T)}return{filledEntries:H,emptyKeys:q}},[t,s,e.key,e.maxCount]),O=A.length;if(!s){const M=e.key,H=t[M]??null,q=H!=null,B=(e.text||"").trim(),T=q&&e.showHint===!0&&B.length>=kC,F=b.jsx(Na,{slotKey:M,file:H,text:e.text,accept:o,tooltip:h,disabled:l,exclusionGroup:e.exclusionGroup,onPick:g,onReplace:g,onRemove:N}),V=T?b.jsx("span",{className:"exclusion-wrapper upload-hint","data-group":e.exclusionGroup,children:B}):null,$=f&&d?b.jsx(Qn,{data:d,hidden:q}):null;return e.required?b.jsxs("span",{className:r?"rte-upload-error":void 0,children:[b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),F]}),$,V]}):b.jsxs("span",{className:r?"rte-upload-error":void 0,children:[F,$,V]})}const S=e.minCount??1,_=e.maxCount??0,I=Math.min(_,Math.max(S,O+(O<_?1:0))),k=[];for(const{key:M,file:H}of A)k.push(b.jsx(Na,{slotKey:M,file:H,text:e.text,accept:o,tooltip:h,disabled:l,batch:!0,multiple:!0,exclusionGroup:e.exclusionGroup,onPick:E,onReplace:g,onRemove:N},M));const R=Math.max(0,I-O);for(const M of L.slice(0,R))k.push(b.jsx(Na,{slotKey:M,file:null,text:e.text,accept:o,tooltip:h,disabled:l,batch:!0,multiple:!0,exclusionGroup:e.exclusionGroup,onPick:E,onReplace:g,onRemove:N},M));return e.required?b.jsxs("span",{className:`exclusion-wrapper required-upload-group rte-required-upload-batch${c?" rte-batch-wrapped":""}${r?" rte-upload-error":""}`,"data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),b.jsx("span",{className:"rte-upload-batch-chips",ref:u,children:k}),f&&d?b.jsx(Qn,{data:d,hidden:O>0}):null]}):b.jsxs("span",{className:`rte-upload-batch-chips${c?" rte-batch-wrapped":""}${r?" rte-upload-error":""}`,ref:u,children:[k,f&&d?b.jsx(Qn,{data:d,hidden:O>0}):null]})});Ff.displayName="UploadNode";const Hf=2*Math.PI*6.5,Uf="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'%3E%3Crect fill='%23999' width='1' height='1'/%3E%3C/svg%3E",zf=e=>{const t=e.trim();try{const l=new URL(t);if(l.protocol==="http:"||l.protocol==="https:")return t}catch{}const n=t.match(/https?:\/\/[^\s一-鿿 -〿＀-￯]+/);return n?n[0]:t},AC=e=>new Promise((t,n)=>{const l=document.createElement("video"),r=URL.createObjectURL(e);l.preload="auto",l.muted=!0,l.src=r,l.onloadeddata=()=>{l.currentTime=0},l.onseeked=()=>{try{const a=document.createElement("canvas");a.width=l.videoWidth,a.height=l.videoHeight;const i=a.getContext("2d");if(!i){URL.revokeObjectURL(r),n(new Error("canvas context unavailable"));return}i.drawImage(l,0,0,a.width,a.height);const s=a.toDataURL("image/jpeg",.7);URL.revokeObjectURL(r),t(s)}catch(a){URL.revokeObjectURL(r),n(a)}},l.onerror=()=>{URL.revokeObjectURL(r),n(new Error("video load error"))}}),NC=e=>new Promise(t=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.preload="auto",n.muted=!0,n.playsInline=!0,n.src=e;const l=window.setTimeout(()=>{r(),t("")},1e4),r=()=>{window.clearTimeout(l),n.onloadeddata=null,n.onseeked=null,n.onerror=null};n.onloadeddata=()=>{n.currentTime=0},n.onseeked=()=>{try{const a=document.createElement("canvas");a.width=n.videoWidth||320,a.height=n.videoHeight||180;const i=a.getContext("2d");if(i){i.drawImage(n,0,0,a.width,a.height);const s=a.toDataURL("image/jpeg",.7);r(),t(s)}else r(),t("")}catch{r(),t("")}},n.onerror=()=>{r(),t("")}}),Vf=()=>b.jsxs("svg",{className:"video-play-icon",viewBox:"0 0 16 16",width:"16",height:"16",children:[b.jsx("circle",{cx:"8",cy:"8",r:"8",fill:"rgba(0,0,0,0.5)"}),b.jsx("polygon",{points:"6.5,4.5 6.5,11.5 12,8",fill:"#fff"})]}),$f=({percent:e})=>{const t=Math.min(Math.max(e,0),100),n=Hf*(1-t/100);return b.jsxs("svg",{className:"video-upload-progress-ring",viewBox:"0 0 16 16",width:"16",height:"16",children:[b.jsx("circle",{cx:"8",cy:"8",r:"6.5",fill:"none",stroke:"rgba(255,255,255,0.5)",strokeWidth:"1.5"}),b.jsx("circle",{cx:"8",cy:"8",r:"6.5",fill:"none",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:Hf,strokeDashoffset:n,transform:"rotate(-90 8 8)"})]})},wC={background:"#fff",padding:0,borderRadius:8,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},qf=({videoUrl:e,children:t})=>b.jsx(ue.Tooltip,{title:b.jsx("div",{className:"rte-video-preview",children:b.jsx("video",{src:e,autoPlay:!0,loop:!0,muted:!0,playsInline:!0})}),placement:"top",arrow:!1,overlayInnerStyle:wC,children:t}),IC={display:"inline-block",border:0,background:"transparent",outline:"none",padding:0,margin:0,font:"inherit",color:"inherit",minWidth:40,boxSizing:"border-box",verticalAlign:"middle"},_C=e=>e?typeof e=="string"?e:JSON.stringify(e):"",Wf=y.memo(({node:e,value:t,thumbnail:n,onChange:l,onThumbnailChange:r,videoUrlParse:a,onParsingChange:i,disabled:s,error:o})=>{const[u,c]=y.useState("idle"),{message:d}=ue.App.useApp(),[f,h]=y.useState(0),[m,v]=y.useState(""),g=y.useRef(null),E=y.useRef(0),N=y.useRef(null),A=t||e.placeholder||"",[L,O]=y.useState(0),S=y.useCallback(()=>{N.current&&O(N.current.offsetWidth)},[]);y.useLayoutEffect(()=>{S();const C=N.current;if(!C||typeof ResizeObserver>"u")return;const Z=new ResizeObserver(()=>S());return Z.observe(C),()=>Z.disconnect()},[A,S]);const _=L>0?Math.max(40,L+2):40,I=Sr(e.tooltip),k=!!I,R=k?"":_C(e.tooltip),M=!!(t||n),H=y.useCallback(()=>{g.current&&(window.clearInterval(g.current),g.current=null)},[]),q=y.useCallback(()=>{H();let C=0;g.current=window.setInterval(()=>{C=Math.min(C+Math.random()*15+5,90),h(C)},400)},[H]);y.useEffect(()=>()=>H(),[H]);const B=y.useCallback(async C=>{if(!a)return;const Z=C.trim();if(!Z)return;const ie=zf(Z),D=E.current+=1;c("loading"),h(0),v(ie),q(),i?.(e.key,!0);try{const pe=await a({url:ie});if(H(),l(e.key,pe.videoUrl),r?.(e.key,pe.thumbnail||""),c("success"),!pe.thumbnail&&pe.videoUrl){const ge=`/api/download-report-pdf?url=${encodeURIComponent(pe.videoUrl)}`,ke=await NC(ge);ke&&E.current===D&&r?.(e.key,ke)}}catch(pe){H(),E.current+=1,l(e.key,""),r?.(e.key,""),v(""),c("idle"),d.error(pe instanceof Error?pe.message:"视频解析失败,请检查链接是否正确")}finally{i?.(e.key,!1)}},[a,e.key,l,r,i,q,H,d]),T=y.useCallback(()=>{if(u==="loading"||u==="success"||n)return;const C=t??"";C.trim()&&B(C)},[u,n,t,B]),F=y.useCallback(C=>{if(!a)return;const Z=C.clipboardData?.getData("text")??"";if(!Z.trim())return;C.preventDefault();const ie=zf(Z);l(e.key,ie),B(ie)},[a,e.key,l,B]),V=y.useCallback(C=>{C.stopPropagation(),E.current+=1,l(e.key,""),r?.(e.key,""),v(""),c("idle")},[e.key,l,r]),$=C=>{const Z=k&&I?b.jsx(Qn,{data:I,hidden:M}):null;return e.required?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),C]}),Z]}):Z?b.jsxs(b.Fragment,{children:[C,Z]}):C},X=t??"";if((u==="success"||n)&&X){const C=m||t||"",Z=b.jsx("span",{className:`video-chip ${o?"rte-video-error":""}`,"data-type":"video-url","data-key":e.key,"data-tooltip":R||void 0,"data-group":e.exclusionGroup,children:b.jsxs("span",{className:"video-inner-wrapper video-url-inner has-video",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[n?b.jsx("img",{src:n,className:"video-thumbnail rte-video-thumb",alt:"thumbnail"}):b.jsx("span",{className:"video-thumbnail video-thumbnail-placeholder",children:b.jsx("i",{className:"iconfont icon-shipin",style:{fontSize:20,color:"#8c8c8c"}})}),b.jsx(Vf,{})]}),b.jsx("span",{className:"video-label","data-file-name":C,children:C}),b.jsx("span",{className:"video-remove-btn rte-video-remove",title:"移除视频",onClick:V,children:"×"})]})});return $(b.jsx(qf,{videoUrl:X,children:Z}))}return $(u==="loading"?b.jsx("span",{className:`video-chip ${o?"rte-video-error":""}`,"data-type":"video-url","data-key":e.key,"data-tooltip":R||void 0,"data-group":e.exclusionGroup,children:b.jsxs("span",{className:"video-inner-wrapper video-upload-inner video-uploading",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[b.jsx("img",{className:"video-thumbnail",src:Uf,alt:"thumbnail"}),b.jsx("span",{className:"video-thumbnail-overlay"}),b.jsx($f,{percent:f})]}),b.jsx("span",{className:"video-label",children:"解析中..."})]})}):b.jsxs("span",{className:["variable-chip","rte-video-url",t?"":"show-placeholder",R?"rte-variable-with-icon":"",o?"rte-video-error":""].filter(Boolean).join(" "),"data-type":"video-url","data-key":e.key,"data-tooltip":R||void 0,"data-group":e.exclusionGroup,children:[b.jsx("span",{ref:N,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"pre",font:"inherit",pointerEvents:"none",top:0,left:0},children:A}),b.jsx("input",{"data-type":"video-url","data-key":e.key,value:t??"",onChange:C=>l(e.key,C.target.value),onBlur:T,onPaste:F,disabled:s,placeholder:e.placeholder??"请粘贴想要分析的抖音视频链接",style:{...IC,width:_}}),R&&b.jsx(Ol,{tooltip:R,className:"variable-info-icon",dataVariableKey:e.key})]}))});Wf.displayName="VideoUrlNode";const OC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",MC=1024*1024*1024,DC="视频文件不能超过1GB",Yf=y.memo(({node:e,value:t,thumbnail:n,onChange:l,onThumbnailChange:r,onFileChange:a,videoUpload:i,onParsingChange:s,disabled:o,error:u})=>{const{message:c}=ue.App.useApp(),d=y.useRef(null),[f,h]=y.useState("idle"),[m,v]=y.useState(0),[g,E]=y.useState(""),[N,A]=y.useState(""),[L,O]=y.useState(""),S=Sr(e.tooltip),_=!!S,I=_?"":OC(e.tooltip),k=!!t&&!!n,R=f==="loading",M=y.useCallback(()=>{o||R||!i||d.current?.click()},[o,R,i]),H=y.useCallback(async T=>{const F=T.target.files?.[0];if(T.target.value="",!F||!i)return;if(F.size>MC){c.warning(DC);return}h("loading"),v(0),A(F.name),O(""),E(""),s?.(e.key,!0);const V=await AC(F).catch(()=>"");V&&E(V);try{const $=await i(F,X=>v(X));l(e.key,$.videoUrl),r?.(e.key,$.thumbnail||V||""),a?.(e.key,F),h("idle"),E("")}catch($){h("error"),O($ instanceof Error?$.message:"上传失败"),E("")}finally{s?.(e.key,!1)}},[i,e.key,l,r,a,s,c]),q=y.useCallback(T=>{T.stopPropagation(),l(e.key,""),r?.(e.key,""),a?.(e.key,null),A(""),h("idle")},[e.key,l,r,a]),B=T=>{const F=_&&S?b.jsx(Qn,{data:S,hidden:k}):null;return e.required?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),T]}),F]}):F?b.jsxs(b.Fragment,{children:[T,F]}):T};if(k){const T=N||"视频文件",F=b.jsxs("span",{className:`video-chip ${u?"rte-video-error":""}`,"data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,children:[b.jsxs("span",{className:"video-inner-wrapper video-upload-inner has-video",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[n?b.jsx("img",{src:n,className:"video-thumbnail rte-video-thumb",alt:"thumbnail"}):b.jsx("span",{className:"video-thumbnail video-thumbnail-placeholder",children:b.jsx("i",{className:"iconfont icon-shipin",style:{fontSize:20,color:"#8c8c8c"}})}),b.jsx(Vf,{})]}),b.jsx("span",{className:"video-label","data-file-name":T,children:T}),b.jsx("span",{className:"video-remove-btn rte-video-remove",title:"移除视频",onClick:q,children:"×"})]}),b.jsx("input",{ref:d,type:"file",accept:"video/*",style:{display:"none"},onChange:H})]});return B(b.jsx(qf,{videoUrl:t,children:F}))}return B(R?b.jsx("span",{className:`video-chip ${u?"rte-video-error":""}`,"data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,children:b.jsxs("span",{className:"video-inner-wrapper video-upload-inner video-uploading",children:[b.jsxs("span",{className:"video-thumbnail-wrapper",children:[b.jsx("img",{className:"video-thumbnail",src:g||Uf,alt:"thumbnail"}),b.jsx("span",{className:"video-thumbnail-overlay"}),b.jsx($f,{percent:m})]}),b.jsx("span",{className:"video-label",children:N||"上传中..."})]})}):f==="error"?b.jsxs("span",{className:"video-chip rte-video-error","data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,children:[b.jsxs("span",{className:"video-inner-wrapper video-upload-inner",children:[b.jsx("span",{className:"video-label",children:L||"上传失败"}),b.jsx("span",{className:"video-remove-btn rte-video-remove",title:"重试",onClick:T=>{T.stopPropagation(),h("idle"),O("")},children:"×"})]}),b.jsx("input",{ref:d,type:"file",accept:"video/*",style:{display:"none"},onChange:H})]}):b.jsxs("button",{type:"button",className:`video-chip ${u?"rte-video-error":""}`,"data-type":"video-upload","data-key":e.key,"data-tooltip":I||void 0,"data-group":e.exclusionGroup,onClick:M,disabled:o,children:[b.jsxs("span",{className:"video-inner-wrapper video-upload-inner",children:[b.jsx("i",{className:"iconfont icon-shangchuan1",style:{fontSize:16}}),b.jsx("span",{className:"video-label",children:e.text??"请上传想要分析的视频文件"}),I&&b.jsx(Ol,{tooltip:I,className:"upload-info-icon",dataUploadKey:e.key})]}),b.jsx("input",{ref:d,type:"file",accept:"video/*",style:{display:"none"},onChange:H})]}))});Yf.displayName="VideoUploadNode";const LC="https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/website/kongzhuangtai.svg",PC=e=>e?typeof e=="string"?e:JSON.stringify(e):"",BC={display:"inline-block",border:0,background:"transparent",outline:"none",padding:0,margin:0,font:"inherit",color:"inherit"},RC=e=>{let t=0;for(const n of e)t+=/[一-龥＀-￯]/.test(n)?16:9;return t},jf=e=>{if(!e)return"";const t=Rs(e);return t.reportId?`report:${t.reportId}`:`url:${e.trim()}`},FC=({nodeKey:e,fetch:t,onSelect:n,onGoGenerate:l,onViewReport:r,hideCurrentSessionReport:a,preciseMatchKey:i,open:s})=>{const[o,u]=y.useState(!1),[c,d]=y.useState(null),[f,h]=y.useState(""),m=y.useRef(0),v=y.useRef(null);y.useEffect(()=>{if(!s)return;const O=++m.current;u(!0),t({nodeKey:e,nodeType:"report-url"}).then(S=>{if(O!==m.current)return;const _=a?S.tabs.filter(R=>R.key!=="currentConversationReports"):S.tabs,I={...S,tabs:_};d(I);const k=_.find(R=>R.items.length>0);h(k?.key??_[0]?.key??"")}).catch(()=>{O===m.current&&d({tabs:[]})}).finally(()=>{O===m.current&&u(!1)})},[s,t,e,a]);const g=y.useCallback(O=>i?O.filter(S=>jf(S.url)===i):O,[i]);y.useEffect(()=>{if(!s||!i||!c)return;const O=c.tabs.find(S=>g(S.items).length>0);O&&h(S=>S===O.key?S:O.key)},[s,i,c,g]);const E=c?.tabs.find(O=>O.key===f),N=E?g(E.items):[],A=y.useCallback(O=>{const S=O.currentTarget;S.classList.add("is-scrolling"),v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.classList.remove("is-scrolling"),v.current=null},300)},[]),L=y.useCallback((O,S)=>{O.stopPropagation(),r?r(S):window.open(S.viewUrl||S.url,"_blank")},[r]);return b.jsx("div",{className:"rte-report-dropdown-panel",onMouseDown:O=>O.preventDefault(),children:o?b.jsx("div",{className:"rte-report-dropdown-loading",children:b.jsx(ue.Spin,{size:"small"})}):c?b.jsxs(b.Fragment,{children:[c.tabs.length>1&&b.jsx("div",{className:"rte-report-dropdown-tab-outer",children:b.jsx("div",{className:"rte-report-dropdown-tab-inner",children:c.tabs.map(O=>b.jsx("div",{className:`rte-report-dropdown-tab-item${O.key===f?" active":""}`,onClick:()=>h(O.key),children:O.label},O.key))})}),b.jsx("div",{className:"rte-report-dropdown-list",onScroll:A,children:!E||N.length===0?b.jsxs("div",{className:"rte-report-dropdown-empty",children:[b.jsx("img",{className:"rte-report-dropdown-empty-img",src:LC,alt:""}),b.jsxs("div",{className:"rte-report-dropdown-empty-text",children:[b.jsx("span",{className:"rte-report-dropdown-empty-label",children:i?"未找到匹配的报告":"暂无生成的报告"}),l&&E?.agentType!==void 0&&b.jsx("span",{className:"rte-report-dropdown-empty-link",onClick:()=>l(E.agentType),children:"去生成"})]})]}):N.map((O,S)=>b.jsxs("div",{className:"rte-report-dropdown-item",onClick:()=>n(O),children:[b.jsx("span",{className:"rte-report-dropdown-item-name",title:O.name,children:O.name}),b.jsxs("span",{className:"rte-report-dropdown-item-action",onClick:_=>L(_,O),children:[b.jsx("i",{className:"iconfont icon-chakanbaogao"}),"查看报告"]})]},`${O.url}-${S}`))})]}):null})},Kf=y.memo(({node:e,value:t,onChange:n,onParse:l,reportListFetch:r,onReportGoGenerate:a,reportName:i,onClearReport:s,onViewReport:o,hideCurrentSessionReport:u,disabled:c,error:d})=>{const f=_l(),h=PC(e.tooltip),m=t??"",v=!!i,g=!m&&!v,E=!!r,N=E&&!c&&(g||v),A=!E&&!!h&&g,L=N||A,[O,S]=y.useState(!1),[_,I]=y.useState(!1),k=y.useRef({}).current,R=y.useRef(""),M=y.useCallback(async ye=>{const Fe=ye.trim();if(!(!Fe||!l)&&R.current!==Fe){R.current=Fe,S(!0);try{await l(Fe)}finally{S(!1)}}},[l]);y.useEffect(()=>{m||(R.current="")},[m]);const H=y.useCallback(()=>{M(m)},[M,m]),q=y.useCallback(ye=>{if(!e.key)return;const Fe=ye.clipboardData.getData("text/plain");Fe.trim()&&(ye.preventDefault(),n(e.key,Fe),I(!1),M(Fe))},[e.key,n,M]),B=y.useCallback(()=>{document.dispatchEvent(new CustomEvent("rte-report-dropdown-opening",{detail:k})),I(!0)},[k]),T=y.useCallback(ye=>{e.key&&(n(e.key,ye.url),I(!1),/^https?:\/\//i.test(ye.url)&&M(ye.url))},[e.key,n,M]),F=y.useCallback(ye=>{ye.preventDefault(),ye.stopPropagation(),e.key&&n(e.key,""),s?.()},[e.key,n,s]);y.useEffect(()=>{const ye=Fe=>{Fe.detail!==k&&I(!1)};return document.addEventListener("rte-report-dropdown-opening",ye),()=>document.removeEventListener("rte-report-dropdown-opening",ye)},[k]);const V=["variable-chip","rte-report-url",v?"rte-report-name-chip":"",d?"rte-report-url-error":"",L?"rte-variable-with-icon":""].filter(Boolean).join(" "),$=y.useRef(null),X=y.useRef(null),[C,Z]=y.useState("bottomLeft"),ie=y.useCallback(()=>{const ye=X.current;if(!ye)return;const Fe=ye.getBoundingClientRect(),on=236,Qt=window.innerHeight-Fe.bottom;Z(Qt<on?"topLeft":"bottomLeft")},[]);y.useLayoutEffect(()=>{_&&ie()},[_,ie]);const D=y.useMemo(()=>({offset:[0,C==="bottomLeft"?4:-4],overflow:{adjustX:!1,adjustY:!1}}),[C]);y.useEffect(()=>{if(!_)return;const ye=Fe=>{const on=X.current,Qt=Fe.target;if(on?.contains(Qt))return;const Fn=document.querySelectorAll(".rte-report-dropdown-overlay");for(let Hn=0;Hn<Fn.length;Hn++)if(Fn[Hn].contains(Qt))return;I(!1)};return document.addEventListener("mousedown",ye),()=>document.removeEventListener("mousedown",ye)},[_]);const pe=N?b.jsx("span",{ref:$,className:["rte-report-dropdown-host",v?"rte-report-dropdown-host-quiet":""].filter(Boolean).join(" "),"data-key":e.key,"data-node-type":"report-url",contentEditable:!1,onClick:ye=>{ye.stopPropagation(),_?I(!1):B()},children:b.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang rte-report-dropdown-icon","aria-label":"选择报告"})}):A?b.jsx(Ol,{tooltip:h,className:"variable-info-icon",dataVariableKey:e.key}):null,ge=v?b.jsx("span",{className:"rte-report-chip-clear-host",contentEditable:!1,onMouseDown:F,children:b.jsx("span",{className:"rte-report-chip-clear-icon",title:"清除",children:b.jsx(Ut.CloseCircleFilled,{})})}):null,ke=e.placeholder??"粘贴报告链接",ce=m||ke,Ne=y.useRef(null),[Oe,Ae]=y.useState(0);y.useLayoutEffect(()=>{Ne.current&&Ae(Ne.current.offsetWidth)});const nt=Oe>0?Math.max(60,Oe+2):RC(ce)+6,Ht=y.useMemo(()=>{if(v)return"";const ye=m.trim();return/^https?:\/\//i.test(ye)?jf(ye):""},[m,v]),sn=y.useCallback(ye=>{if(!v||c||!N)return;const Fe=ye.target;Fe.closest(".rte-report-chip-clear-host")||Fe.closest(".rte-report-dropdown-host")||(ye.stopPropagation(),_?I(!1):B())},[v,c,N,_,B]),ze=b.jsxs("span",{ref:X,className:V,"data-type":"report-url","data-key":e.key,"data-placeholder":e.placeholder??"","data-group":e.exclusionGroup,"data-tooltip":h||void 0,"data-report-url":v?m||!0:void 0,"data-report-name":i||void 0,onClick:sn,children:[b.jsx("span",{ref:Ne,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",whiteSpace:"pre",font:"inherit",pointerEvents:"none",top:0,left:0},children:ce}),v?b.jsx("span",{className:"rte-report-name-chip-label",children:i}):b.jsx("input",{"data-type":"report-url","data-key":e.key,value:m,onChange:ye=>n(e.key,ye.target.value),onBlur:H,onPaste:q,onClick:()=>{if(!N||m.trim())return;X.current?.querySelector(".rte-report-dropdown-host")?.click()},disabled:c||O,placeholder:ke,style:{...BC,width:nt}}),pe,ge]}),Rn=N&&_?b.jsx(FC,{nodeKey:e.key,fetch:r,onSelect:T,onGoGenerate:a,onViewReport:o,hideCurrentSessionReport:u,preciseMatchKey:Ht,open:_}):null;return e.required?b.jsx(b.Fragment,{children:b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":e.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),b.jsx(ue.Popover,{content:Rn,trigger:[],open:N&&_,placement:C,align:D,autoAdjustOverflow:!1,getPopupContainer:()=>f??document.body,overlayClassName:"rte-report-dropdown-overlay",arrow:!1,children:ze})]})}):b.jsx(b.Fragment,{children:b.jsx(ue.Popover,{content:Rn,trigger:[],open:N&&_,placement:C,align:D,autoAdjustOverflow:!1,getPopupContainer:()=>f??document.body,overlayClassName:"rte-report-dropdown-overlay",arrow:!1,children:ze})})});Kf.displayName="ReportUrlNode";function HC(e,t){const n=y.memo(({node:l,value:r,onChange:a,disabled:i,error:s})=>{const o=l.moduleIndex??0,u=`${l.key}__module_${o}`,c=y.useRef(null),d=r??l.text??"";y.useLayoutEffect(()=>{const g=c.current;g&&g.innerHTML!==d&&(g.innerHTML=d)},[d]);const f=y.useCallback(g=>a(u,g.currentTarget.innerHTML),[u,a]),h=typeof l.minHeight=="number"?l.minHeight:80,m=typeof l.maxHeight=="number"?l.maxHeight:240,v=Math.max(m,h);return b.jsx("div",{className:`rte-richtext-container rte-${e}-container ${s?`rte-${e}-error`:""}`,"data-key":l.key,children:b.jsx("div",{className:`rte-richtext-wrapper rte-${e}-wrapper`,"data-key":l.key,children:b.jsx("div",{ref:c,className:`rte-richtext rte-${e}`,"data-type":"richtext","data-node-type":e,"data-key":l.key,"data-module-index":o,"data-placeholder":l.placeholder,contentEditable:!i,suppressContentEditableWarning:!0,onInput:f,style:{minHeight:h,maxHeight:v,overflow:"auto"}})})})});return n.displayName=t,n}const Gf={createModuleNode:HC},UC=Gf.createModuleNode("report-module","ReportModuleNode");function Qf(e,t){const n=y.memo(({node:l,value:r,onChange:a,onParse:i,disabled:s,error:o})=>{const u=y.useRef(null),[c,d]=y.useState(!1),f=y.useRef(!0);y.useLayoutEffect(()=>(f.current=!0,()=>{f.current=!1}),[]);const h=r??"";y.useLayoutEffect(()=>{const M=u.current;M&&(h?M.textContent!==h&&(M.textContent=h):M.innerHTML!==""&&(M.innerHTML=""))},[h]);const m=y.useCallback(M=>{l.key&&a(l.key,M.currentTarget.textContent??"")},[l.key,a]),v=y.useCallback(async M=>{const H=M.trim();if(!(!H||!i)){d(!0);try{await i(H)}finally{f.current&&d(!1)}}},[i]),g=y.useCallback(()=>v(h),[v,h]),E=y.useCallback(M=>{if(!i||!l.key)return;const H=M.clipboardData.getData("text/plain");H.trim()&&(M.preventDefault(),u.current&&(u.current.textContent=H),a(l.key,H),v(H))},[i,l.key,a,v]),N=!r,A=["variable-chip",e.chipClass];N&&A.push("show-placeholder"),o&&A.push(e.errorClass);const L=Sr(l.tooltip),O=l.tooltip==null?"":typeof l.tooltip=="string"?l.tooltip:JSON.stringify(l.tooltip),S=!!O&&!vf(O);S&&N&&A.push("rte-variable-with-icon");const _=l.placeholder??e.defaultPlaceholder,I=b.jsx("span",{ref:u,className:A.join(" "),"data-type":e.dataType,"data-key":l.key,"data-placeholder":_,contentEditable:!(s||c),suppressContentEditableWarning:!0,onInput:m,onBlur:g,onPaste:E}),k=S?b.jsxs("span",{className:"rte-markdown-host",children:[I,b.jsx(Ol,{tooltip:O,className:"variable-info-icon",hidden:!N,dataVariableKey:l.key})]}):I,R=b.jsxs(b.Fragment,{children:[k,L?b.jsx(Qn,{data:L,hidden:!N}):null]});return l.required?b.jsxs("span",{className:"exclusion-wrapper required-upload-group","data-group":l.exclusionGroup,children:[b.jsx("span",{className:"rte-text-required",children:b.jsx("i",{className:"iconfont icon-bitian",style:{fontSize:10}})}),R]}):R});return n.displayName=t,n}const zC=Qf({chipClass:"rte-markdown-input",errorClass:"rte-markdown-error",dataType:"markdown",defaultPlaceholder:"粘贴 markdown 文本"},"MarkdownNode"),VC=Qf({chipClass:"rte-markdown-name",errorClass:"rte-markdown-name-error",dataType:"markdown-name",defaultPlaceholder:"输入名称"},"MarkdownNameNode"),$C=Gf.createModuleNode("markdown-module","MarkdownModuleNode");function Je(e){this.content=e}Je.prototype={constructor:Je,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var l=n&&n!=e?this.remove(n):this,r=l.find(e),a=l.content.slice();return r==-1?a.push(n||e,t):(a[r+1]=t,n&&(a[r]=n)),new Je(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Je(n)},addToStart:function(e,t){return new Je([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Je(n)},addBefore:function(e,t,n){var l=this.remove(t),r=l.content.slice(),a=l.find(e);return r.splice(a==-1?r.length:a,0,t,n),new Je(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Je.from(e),e.size?new Je(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Je.from(e),e.size?new Je(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Je.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Je.from=function(e){if(e instanceof Je)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Je(t)};function Xf(e,t,n){for(let l=0;;l++){if(l==e.childCount||l==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(l),a=t.child(l);if(r==a){n+=r.nodeSize;continue}if(!r.sameMarkup(a))return n;if(r.isText&&r.text!=a.text){for(let i=0;r.text[i]==a.text[i];i++)n++;return n}if(r.content.size||a.content.size){let i=Xf(r.content,a.content,n+1);if(i!=null)return i}n+=r.nodeSize}}function Jf(e,t,n,l){for(let r=e.childCount,a=t.childCount;;){if(r==0||a==0)return r==a?null:{a:n,b:l};let i=e.child(--r),s=t.child(--a),o=i.nodeSize;if(i==s){n-=o,l-=o;continue}if(!i.sameMarkup(s))return{a:n,b:l};if(i.isText&&i.text!=s.text){let u=0,c=Math.min(i.text.length,s.text.length);for(;u<c&&i.text[i.text.length-u-1]==s.text[s.text.length-u-1];)u++,n--,l--;return{a:n,b:l}}if(i.content.size||s.content.size){let u=Jf(i.content,s.content,n-1,l-1);if(u)return u}n-=o,l-=o}}class K{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let l=0;l<t.length;l++)this.size+=t[l].nodeSize}nodesBetween(t,n,l,r=0,a){for(let i=0,s=0;s<n;i++){let o=this.content[i],u=s+o.nodeSize;if(u>t&&l(o,r+s,a||null,i)!==!1&&o.content.size){let c=s+1;o.nodesBetween(Math.max(0,t-c),Math.min(o.content.size,n-c),l,r+c)}s=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,l,r){let a="",i=!0;return this.nodesBetween(t,n,(s,o)=>{let u=s.isText?s.text.slice(Math.max(t,o)-o,n-o):s.isLeaf?r?typeof r=="function"?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&l&&(i?i=!1:a+=l),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,l=t.firstChild,r=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(l)&&(r[r.length-1]=n.withText(n.text+l.text),a=1);a<t.content.length;a++)r.push(t.content[a]);return new K(r,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let l=[],r=0;if(n>t)for(let a=0,i=0;i<n;a++){let s=this.content[a],o=i+s.nodeSize;o>t&&((i<t||o>n)&&(s.isText?s=s.cut(Math.max(0,t-i),Math.min(s.text.length,n-i)):s=s.cut(Math.max(0,t-i-1),Math.min(s.content.size,n-i-1))),l.push(s),r+=s.nodeSize),i=o}return new K(l,r)}cutByIndex(t,n){return t==n?K.empty:t==0&&n==this.content.length?this:new K(this.content.slice(t,n))}replaceChild(t,n){let l=this.content[t];if(l==n)return this;let r=this.content.slice(),a=this.size+n.nodeSize-l.nodeSize;return r[t]=n,new K(r,a)}addToStart(t){return new K([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new K(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,l=0;n<this.content.length;n++){let r=this.content[n];t(r,l,n),l+=r.nodeSize}}findDiffStart(t,n=0){return Xf(this,t,n)}findDiffEnd(t,n=this.size,l=t.size){return Jf(this,t,n,l)}findIndex(t){if(t==0)return wa(0,t);if(t==this.size)return wa(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,l=0;;n++){let r=this.child(n),a=l+r.nodeSize;if(a>=t)return a==t?wa(n+1,a):wa(n,l);l=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return K.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return K.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return K.empty;let n,l=0;for(let r=0;r<t.length;r++){let a=t[r];l+=a.nodeSize,r&&a.isText&&t[r-1].sameMarkup(a)?(n||(n=t.slice(0,r)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new K(n||t,l)}static from(t){if(!t)return K.empty;if(t instanceof K)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new K([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}K.empty=new K([],0);const Fs={index:0,offset:0};function wa(e,t){return Fs.index=e,Fs.offset=t,Fs}function Ia(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let l=0;l<e.length;l++)if(!Ia(e[l],t[l]))return!1}else{for(let l in e)if(!(l in t)||!Ia(e[l],t[l]))return!1;for(let l in t)if(!(l in e))return!1}return!0}let Le=class yu{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,l=!1;for(let r=0;r<t.length;r++){let a=t[r];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,r));else{if(a.type.excludes(this.type))return t;!l&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,r)),n.push(this),l=!0),n&&n.push(a)}}return n||(n=t.slice()),l||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ia(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let l=t.marks[n.type];if(!l)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=l.create(n.attrs);return l.checkAttrs(r.attrs),r}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let l=0;l<t.length;l++)if(!t[l].eq(n[l]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return yu.none;if(t instanceof yu)return[t];let n=t.slice();return n.sort((l,r)=>l.type.rank-r.type.rank),n}};Le.none=[];class _a extends Error{}class ae{constructor(t,n,l){this.content=t,this.openStart=n,this.openEnd=l}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let l=eh(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return l&&new ae(l,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(Zf(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let l=n.openStart||0,r=n.openEnd||0;if(typeof l!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(K.fromJSON(t,n.content),l,r)}static maxOpen(t,n=!0){let l=0,r=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)l++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)r++;return new ae(t,l,r)}}ae.empty=new ae(K.empty,0,0);function Zf(e,t,n){let{index:l,offset:r}=e.findIndex(t),a=e.maybeChild(l),{index:i,offset:s}=e.findIndex(n);if(r==t||a.isText){if(s!=n&&!e.child(i).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(l!=i)throw new RangeError("Removing non-flat range");return e.replaceChild(l,a.copy(Zf(a.content,t-r-1,n-r-1)))}function eh(e,t,n,l,r,a){let{index:i,offset:s}=e.findIndex(t),o=e.maybeChild(i);if(s==t||o.isText)return a&&l<=0&&r<=0&&!a.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=eh(o.content,t-s-1,n,i==0?l-1:0,i==e.childCount-1?r-1:0,o);return u&&e.replaceChild(i,o.copy(u))}function qC(e,t,n){if(n.openStart>e.depth)throw new _a("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _a("Inconsistent open depths");return th(e,t,n,0)}function th(e,t,n,l){let r=e.index(l),a=e.node(l);if(r==t.index(l)&&l<e.depth-n.openStart){let i=th(e,t,n,l+1);return a.copy(a.content.replaceChild(r,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==l&&t.depth==l){let i=e.parent,s=i.content;return Jn(i,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:i,end:s}=WC(n,e);return Jn(a,lh(e,i,s,t,l))}else return Jn(a,Oa(e,t,l))}function nh(e,t){if(!t.type.compatibleContent(e.type))throw new _a("Cannot join "+t.type.name+" onto "+e.type.name)}function Hs(e,t,n){let l=e.node(n);return nh(l,t.node(n)),l}function Xn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ar(e,t,n,l){let r=(t||e).node(n),a=0,i=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Xn(e.nodeAfter,l),a++));for(let s=a;s<i;s++)Xn(r.child(s),l);t&&t.depth==n&&t.textOffset&&Xn(t.nodeBefore,l)}function Jn(e,t){return e.type.checkContent(t),e.copy(t)}function lh(e,t,n,l,r){let a=e.depth>r&&Hs(e,t,r+1),i=l.depth>r&&Hs(n,l,r+1),s=[];return Ar(null,e,r,s),a&&i&&t.index(r)==n.index(r)?(nh(a,i),Xn(Jn(a,lh(e,t,n,l,r+1)),s)):(a&&Xn(Jn(a,Oa(e,t,r+1)),s),Ar(t,n,r,s),i&&Xn(Jn(i,Oa(n,l,r+1)),s)),Ar(l,null,r,s),new K(s)}function Oa(e,t,n){let l=[];if(Ar(null,e,n,l),e.depth>n){let r=Hs(e,t,n+1);Xn(Jn(r,Oa(e,t,n+1)),l)}return Ar(t,null,n,l),new K(l)}function WC(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)r=t.node(a).copy(K.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Nr{constructor(t,n,l){this.pos=t,this.path=n,this.parentOffset=l,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let l=this.pos-this.path[this.path.length-1],r=t.child(n);return l?t.child(n).cut(l):r}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let l=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)r+=l.child(a).nodeSize;return r}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Le.none;if(this.textOffset)return t.child(n).marks;let l=t.maybeChild(n-1),r=t.maybeChild(n);if(!l){let s=l;l=r,r=s}let a=l.marks;for(var i=0;i<a.length;i++)a[i].type.spec.inclusive===!1&&(!r||!a[i].isInSet(r.marks))&&(a=a[i--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let l=n.marks,r=t.parent.maybeChild(t.index());for(var a=0;a<l.length;a++)l[a].type.spec.inclusive===!1&&(!r||!l[a].isInSet(r.marks))&&(l=l[a--].removeFromSet(l));return l}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let l=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);l>=0;l--)if(t.pos<=this.end(l)&&(!n||n(this.node(l))))return new Ma(this,t,l);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let l=[],r=0,a=n;for(let i=t;;){let{index:s,offset:o}=i.content.findIndex(a),u=a-o;if(l.push(i,s,r+o),!u||(i=i.child(s),i.isText))break;a=u-1,r+=o+1}return new Nr(n,l,a)}static resolveCached(t,n){let l=rh.get(t);if(l)for(let a=0;a<l.elts.length;a++){let i=l.elts[a];if(i.pos==n)return i}else rh.set(t,l=new YC);let r=l.elts[l.i]=Nr.resolve(t,n);return l.i=(l.i+1)%jC,r}}class YC{constructor(){this.elts=[],this.i=0}}const jC=12,rh=new WeakMap;class Ma{constructor(t,n,l){this.$from=t,this.$to=n,this.depth=l}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 KC=Object.create(null);let vn=class Eu{constructor(t,n,l,r=Le.none){this.type=t,this.attrs=n,this.marks=r,this.content=l||K.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,l,r=0){this.content.nodesBetween(t,n,l,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,l,r){return this.content.textBetween(t,n,l,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,l){return this.type==t&&Ia(this.attrs,n||t.defaultAttrs||KC)&&Le.sameSet(this.marks,l||Le.none)}copy(t=null){return t==this.content?this:new Eu(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Eu(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,l=!1){if(t==n)return ae.empty;let r=this.resolve(t),a=this.resolve(n),i=l?0:r.sharedDepth(n),s=r.start(i),u=r.node(i).content.cut(r.pos-s,a.pos-s);return new ae(u,r.depth-i,a.depth-i)}replace(t,n,l){return qC(this.resolve(t),this.resolve(n),l)}nodeAt(t){for(let n=this;;){let{index:l,offset:r}=n.content.findIndex(t);if(n=n.maybeChild(l),!n)return null;if(r==t||n.isText)return n;t-=r+1}}childAfter(t){let{index:n,offset:l}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:l}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:l}=this.content.findIndex(t);if(l<t)return{node:this.content.child(n),index:n,offset:l};let r=this.content.child(n-1);return{node:r,index:n-1,offset:l-r.nodeSize}}resolve(t){return Nr.resolveCached(this,t)}resolveNoCache(t){return Nr.resolve(this,t)}rangeHasMark(t,n,l){let r=!1;return n>t&&this.nodesBetween(t,n,a=>(l.isInSet(a.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ah(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,l=K.empty,r=0,a=l.childCount){let i=this.contentMatchAt(t).matchFragment(l,r,a),s=i&&i.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let o=r;o<a;o++)if(!this.type.allowsMarks(l.child(o).marks))return!1;return!0}canReplaceWith(t,n,l,r){if(r&&!this.type.allowsMarks(r))return!1;let a=this.contentMatchAt(t).matchType(l),i=a&&a.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Le.none;for(let n=0;n<this.marks.length;n++){let l=this.marks[n];l.type.checkAttrs(l.attrs),t=l.addToSet(t)}if(!Le.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let l;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");l=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,l)}let r=K.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,r,l);return a.type.checkAttrs(a.attrs),a}};vn.prototype.text=void 0;class Da extends vn{constructor(t,n,l,r){if(super(t,n,null,r),!l)throw new RangeError("Empty text nodes are not allowed");this.text=l}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ah(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Da(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Da(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function ah(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Zn{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let l=new GC(t,n);if(l.next==null)return Zn.empty;let r=ih(l);l.next&&l.err("Unexpected trailing text");let a=n6(t6(r));return l6(a,l),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,l=t.childCount){let r=this;for(let a=n;r&&a<l;a++)r=r.matchType(t.child(a).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let l=0;l<t.next.length;l++)if(this.next[n].type==t.next[l].type)return!0;return!1}fillBefore(t,n=!1,l=0){let r=[this];function a(i,s){let o=i.matchFragment(t,l);if(o&&(!n||o.validEnd))return K.from(s.map(u=>u.createAndFill()));for(let u=0;u<i.next.length;u++){let{type:c,next:d}=i.next[u];if(!(c.isText||c.hasRequiredAttrs())&&r.indexOf(d)==-1){r.push(d);let f=a(d,s.concat(c));if(f)return f}}return null}return a(this,[])}findWrapping(t){for(let l=0;l<this.wrapCache.length;l+=2)if(this.wrapCache[l]==t)return this.wrapCache[l+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),l=[{match:this,type:null,via:null}];for(;l.length;){let r=l.shift(),a=r.match;if(a.matchType(t)){let i=[];for(let s=r;s.type;s=s.via)i.push(s.type);return i.reverse()}for(let i=0;i<a.next.length;i++){let{type:s,next:o}=a.next[i];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!r.type||o.validEnd)&&(l.push({match:s.contentMatch,type:s,via:r}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(l){t.push(l);for(let r=0;r<l.next.length;r++)t.indexOf(l.next[r].next)==-1&&n(l.next[r].next)}return n(this),t.map((l,r)=>{let a=r+(l.validEnd?"*":" ")+" ";for(let i=0;i<l.next.length;i++)a+=(i?", ":"")+l.next[i].type.name+"->"+t.indexOf(l.next[i].next);return a}).join(`
22
22
  `)}}Zn.empty=new Zn(!0);class GC{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function ih(e){let t=[];do t.push(QC(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function QC(e){let t=[];do t.push(XC(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function XC(e){let t=e6(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=JC(e,t);else break;return t}function sh(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function JC(e,t){let n=sh(e),l=n;return e.eat(",")&&(e.next!="}"?l=sh(e):l=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:l,expr:t}}function ZC(e,t){let n=e.nodeTypes,l=n[t];if(l)return[l];let r=[];for(let a in n){let i=n[a];i.isInGroup(t)&&r.push(i)}return r.length==0&&e.err("No node type or group '"+t+"' found"),r}function e6(e){if(e.eat("(")){let t=ih(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=ZC(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function t6(e){let t=[[]];return r(a(e,0),n()),t;function n(){return t.push([])-1}function l(i,s,o){let u={term:o,to:s};return t[i].push(u),u}function r(i,s){i.forEach(o=>o.to=s)}function a(i,s){if(i.type=="choice")return i.exprs.reduce((o,u)=>o.concat(a(u,s)),[]);if(i.type=="seq")for(let o=0;;o++){let u=a(i.exprs[o],s);if(o==i.exprs.length-1)return u;r(u,s=n())}else if(i.type=="star"){let o=n();return l(s,o),r(a(i.expr,o),o),[l(o)]}else if(i.type=="plus"){let o=n();return r(a(i.expr,s),o),r(a(i.expr,o),o),[l(o)]}else{if(i.type=="opt")return[l(s)].concat(a(i.expr,s));if(i.type=="range"){let o=s;for(let u=0;u<i.min;u++){let c=n();r(a(i.expr,o),c),o=c}if(i.max==-1)r(a(i.expr,o),o);else for(let u=i.min;u<i.max;u++){let c=n();l(o,c),r(a(i.expr,o),c),o=c}return[l(o)]}else{if(i.type=="name")return[l(s,void 0,i.value)];throw new Error("Unknown expr type")}}}}function oh(e,t){return t-e}function uh(e,t){let n=[];return l(t),n.sort(oh);function l(r){let a=e[r];if(a.length==1&&!a[0].term)return l(a[0].to);n.push(r);for(let i=0;i<a.length;i++){let{term:s,to:o}=a[i];!s&&n.indexOf(o)==-1&&l(o)}}}function n6(e){let t=Object.create(null);return n(uh(e,0));function n(l){let r=[];l.forEach(i=>{e[i].forEach(({term:s,to:o})=>{if(!s)return;let u;for(let c=0;c<r.length;c++)r[c][0]==s&&(u=r[c][1]);uh(e,o).forEach(c=>{u||r.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=t[l.join(",")]=new Zn(l.indexOf(e.length-1)>-1);for(let i=0;i<r.length;i++){let s=r[i][1].sort(oh);a.next.push({type:r[i][0],next:t[s.join(",")]||n(s)})}return a}}function l6(e,t){for(let n=0,l=[e];n<l.length;n++){let r=l[n],a=!r.validEnd,i=[];for(let s=0;s<r.next.length;s++){let{type:o,next:u}=r.next[s];i.push(o.name),a&&!(o.isText||o.hasRequiredAttrs())&&(a=!1),l.indexOf(u)==-1&&l.push(u)}a&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ch(e){let t=Object.create(null);for(let n in e){let l=e[n];if(!l.hasDefault)return null;t[n]=l.default}return t}function dh(e,t){let n=Object.create(null);for(let l in e){let r=t&&t[l];if(r===void 0){let a=e[l];if(a.hasDefault)r=a.default;else throw new RangeError("No value supplied for attribute "+l)}n[l]=r}return n}function fh(e,t,n,l){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let r in e){let a=e[r];a.validate&&a.validate(t[r])}}function hh(e,t){let n=Object.create(null);if(t)for(let l in t)n[l]=new a6(e,l,t[l]);return n}let ph=class um{constructor(t,n,l){this.name=t,this.schema=n,this.spec=l,this.markSet=null,this.groups=l.group?l.group.split(" "):[],this.attrs=hh(t,l.attrs),this.defaultAttrs=ch(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(l.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:dh(this.attrs,t)}create(t=null,n,l){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new vn(this,this.computeAttrs(t),K.from(n),Le.setFrom(l))}createChecked(t=null,n,l){return n=K.from(n),this.checkContent(n),new vn(this,this.computeAttrs(t),n,Le.setFrom(l))}createAndFill(t=null,n,l){if(t=this.computeAttrs(t),n=K.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let r=this.contentMatch.matchFragment(n),a=r&&r.fillBefore(K.empty,!0);return a?new vn(this,t,n.append(a),Le.setFrom(l)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let l=0;l<t.childCount;l++)if(!this.allowsMarks(t.child(l).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){fh(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let l=0;l<t.length;l++)this.allowsMarkType(t[l].type)?n&&n.push(t[l]):n||(n=t.slice(0,l));return n?n.length?n:Le.none:t}static compile(t,n){let l=Object.create(null);t.forEach((a,i)=>l[a]=new um(a,n,i));let r=n.spec.topNode||"doc";if(!l[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!l.text)throw new RangeError("Every schema needs a 'text' type");for(let a in l.text.attrs)throw new RangeError("The text node type should not have attributes");return l}};function r6(e,t,n){let l=n.split("|");return r=>{let a=r===null?"null":typeof r;if(l.indexOf(a)<0)throw new RangeError(`Expected value of type ${l} for attribute ${t} on type ${e}, got ${a}`)}}class a6{constructor(t,n,l){this.hasDefault=Object.prototype.hasOwnProperty.call(l,"default"),this.default=l.default,this.validate=typeof l.validate=="string"?r6(t,n,l.validate):l.validate}get isRequired(){return!this.hasDefault}}class La{constructor(t,n,l,r){this.name=t,this.rank=n,this.schema=l,this.spec=r,this.attrs=hh(t,r.attrs),this.excluded=null;let a=ch(this.attrs);this.instance=a?new Le(this,a):null}create(t=null){return!t&&this.instance?this.instance:new Le(this,dh(this.attrs,t))}static compile(t,n){let l=Object.create(null),r=0;return t.forEach((a,i)=>l[a]=new La(a,r++,n,i)),l}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){fh(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class bh{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Je.from(t.nodes),n.marks=Je.from(t.marks||{}),this.nodes=ph.compile(this.spec.nodes,this),this.marks=La.compile(this.spec.marks,this);let l=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let a=this.nodes[r],i=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=l[i]||(l[i]=Zn.parse(i,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?mh(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let r in this.marks){let a=this.marks[r],i=a.spec.excludes;a.excluded=i==null?[a]:i==""?[]:mh(this,i.split(" "))}this.nodeFromJSON=r=>vn.fromJSON(this,r),this.markFromJSON=r=>Le.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,l,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ph){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,l,r)}text(t,n){let l=this.nodes.text;return new Da(l,l.defaultAttrs,t,Le.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function mh(e,t){let n=[];for(let l=0;l<t.length;l++){let r=t[l],a=e.marks[r],i=a;if(a)n.push(a);else for(let s in e.marks){let o=e.marks[s];(r=="_"||o.spec.group&&o.spec.group.split(" ").indexOf(r)>-1)&&n.push(i=o)}if(!i)throw new SyntaxError("Unknown mark type: '"+t[l]+"'")}return n}function i6(e){return e.tag!=null}function s6(e){return e.style!=null}let wr=class Tu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let l=this.matchedStyles=[];n.forEach(r=>{if(i6(r))this.tags.push(r);else if(s6(r)){let a=/[^=]*/.exec(r.style)[0];l.indexOf(a)<0&&l.push(a),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let a=t.nodes[r.node];return a.contentMatch.matchType(a)})}parse(t,n={}){let l=new Eh(this,n,!1);return l.addAll(t,Le.none,n.from,n.to),l.finish()}parseSlice(t,n={}){let l=new Eh(this,n,!0);return l.addAll(t,Le.none,n.from,n.to),ae.maxOpen(l.finish())}matchTag(t,n,l){for(let r=l?this.tags.indexOf(l)+1:0;r<this.tags.length;r++){let a=this.tags[r];if(c6(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let i=a.getAttrs(t);if(i===!1)continue;a.attrs=i||void 0}return a}}}matchStyle(t,n,l,r){for(let a=r?this.styles.indexOf(r)+1:0;a<this.styles.length;a++){let i=this.styles[a],s=i.style;if(!(s.indexOf(t)!=0||i.context&&!l.matchesContext(i.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(i.getAttrs){let o=i.getAttrs(n);if(o===!1)continue;i.attrs=o||void 0}return i}}}static schemaRules(t){let n=[];function l(r){let a=r.priority==null?50:r.priority,i=0;for(;i<n.length;i++){let s=n[i];if((s.priority==null?50:s.priority)<a)break}n.splice(i,0,r)}for(let r in t.marks){let a=t.marks[r].spec.parseDOM;a&&a.forEach(i=>{l(i=Th(i)),i.mark||i.ignore||i.clearMark||(i.mark=r)})}for(let r in t.nodes){let a=t.nodes[r].spec.parseDOM;a&&a.forEach(i=>{l(i=Th(i)),i.node||i.ignore||i.mark||(i.node=r)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Tu(t,Tu.schemaRules(t)))}};const gh={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},o6={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},vh={ol:!0,ul:!0},Ir=1,Us=2,_r=4;function yh(e,t,n){return t!=null?(t?Ir:0)|(t==="full"?Us:0):e&&e.whitespace=="pre"?Ir|Us:n&~_r}class Pa{constructor(t,n,l,r,a,i){this.type=t,this.attrs=n,this.marks=l,this.solid=r,this.options=i,this.content=[],this.activeMarks=Le.none,this.match=a||(i&_r?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(K.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let l=this.type.contentMatch,r;return(r=l.findWrapping(t.type))?(this.match=l,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Ir)){let l=this.content[this.content.length-1],r;if(l&&l.isText&&(r=/[ \t\r\n\u000c]+$/.exec(l.text))){let a=l;l.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-r[0].length))}}let n=K.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!gh.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Eh{constructor(t,n,l){this.parser=t,this.options=n,this.isOpen=l,this.open=0,this.localPreserveWS=!1;let r=n.topNode,a,i=yh(null,n.preserveWhitespace,0)|(l?_r:0);r?a=new Pa(r.type,r.attrs,Le.none,!0,n.topMatch||r.type.contentMatch,i):l?a=new Pa(null,null,Le.none,!0,null,i):a=new Pa(t.schema.topNodeType,null,Le.none,!0,null,i),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let l=t.nodeValue,r=this.top,a=r.options&Us?"full":this.localPreserveWS||(r.options&Ir)>0,{schema:i}=this.parser;if(a==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(l)){if(a)if(a==="full")l=l.replace(/\r\n?/g,`
23
23
  `);else if(i.linebreakReplacement&&/[\r\n]/.test(l)&&this.top.findWrapping(i.linebreakReplacement.create())){let s=l.split(/\r?\n|\r/);for(let o=0;o<s.length;o++)o&&this.insertNode(i.linebreakReplacement.create(),n,!0),s[o]&&this.insertNode(i.text(s[o]),n,!/\S/.test(s[o]));l=""}else l=l.replace(/\r?\n|\r/g," ");else if(l=l.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(l)&&this.open==this.nodes.length-1){let s=r.content[r.content.length-1],o=t.previousSibling;(!s||o&&o.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(l=l.slice(1))}l&&this.insertNode(i.text(l),n,!/\S/.test(l)),this.findInText(t)}else this.findInside(t)}addElement(t,n,l){let r=this.localPreserveWS,a=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let i=t.nodeName.toLowerCase(),s;vh.hasOwnProperty(i)&&this.parser.normalizeLists&&u6(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,l));e:if(o?o.ignore:o6.hasOwnProperty(i))this.findInside(t),this.ignoreFallback(t,n);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let u,c=this.needsBlock;if(gh.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let d=o&&o.skip?n:this.readStyles(t,n);d&&this.addAll(t,d),u&&this.sync(a),this.needsBlock=c}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,o,u,o.consuming===!1?s:void 0)}this.localPreserveWS=r}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
24
24
  `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let l=t.style;if(l&&l.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let a=this.parser.matchedStyles[r],i=l.getPropertyValue(a);if(i)for(let s=void 0;;){let o=this.parser.matchStyle(a,i,this,s);if(!o)break;if(o.ignore)return null;if(o.clearMark?n=n.filter(u=>!o.clearMark(u)):n=n.concat(this.parser.schema.marks[o.mark].create(o.attrs)),o.consuming===!1)s=o;else break}}return n}addElementByRule(t,n,l,r){let a,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),l,t.nodeName=="BR")||this.leafFallback(t,l);else{let o=this.enter(i,n.attrs||null,l,n.preserveWhitespace);o&&(a=!0,l=o)}else{let o=this.parser.schema.marks[n.mark];l=l.concat(o.create(n.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,l,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(o=>this.insertNode(o,l,!1));else{let o=t;typeof n.contentElement=="string"?o=t.querySelector(n.contentElement):typeof n.contentElement=="function"?o=n.contentElement(t):n.contentElement&&(o=n.contentElement),this.findAround(t,o,!0),this.addAll(o,l),this.findAround(t,o,!1)}a&&this.sync(s)&&this.open--}addAll(t,n,l,r){let a=l||0;for(let i=l?t.childNodes[l]:t.firstChild,s=r==null?null:t.childNodes[r];i!=s;i=i.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(i,n);this.findAtPoint(t,a)}findPlace(t,n,l){let r,a;for(let i=this.open,s=0;i>=0;i--){let o=this.nodes[i],u=o.findWrapping(t);if(u&&(!r||r.length>u.length+s)&&(r=u,a=o,!u.length))break;if(o.solid){if(l)break;s+=2}}if(!r)return null;this.sync(a);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(t,n,l){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let r=this.findPlace(t,n,l);if(r){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let i=Le.none;for(let s of r.concat(t.marks))(a.type?a.type.allowsMarkType(s.type):Ch(s.type,t.type))&&(i=s.addToSet(i));return a.content.push(t.mark(i)),!0}return!1}enter(t,n,l,r){let a=this.findPlace(t.create(n),l,!1);return a&&(a=this.enterInner(t,n,l,!0,r)),a}enterInner(t,n,l,r=!1,a){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(t);let s=yh(t,a,i.options);i.options&_r&&i.content.length==0&&(s|=_r);let o=Le.none;return l=l.filter(u=>(i.type?i.type.allowsMarkType(u.type):Ch(u.type,t))?(o=u.addToSet(o),!1):!0),this.nodes.push(new Pa(t,n,o,r,null,s)),this.open++,l}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Ir)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let l=this.nodes[n].content;for(let r=l.length-1;r>=0;r--)t+=l[r].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let l=0;l<this.find.length;l++)this.find[l].node==t&&this.find[l].offset==n&&(this.find[l].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,l){if(t!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(l?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),l=this.options.context,r=!this.isOpen&&(!l||l.parent.type==this.nodes[0].type),a=-(l?l.depth+1:0)+(r?0:1),i=(s,o)=>{for(;s>=0;s--){let u=n[s];if(u==""){if(s==n.length-1||s==0)continue;for(;o>=a;o--)if(i(s-1,o))return!0;return!1}else{let c=o>0||o==0&&r?this.nodes[o].type:l&&o>=a?l.node(o-a).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;o--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let l=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(l&&l.isTextblock&&l.defaultAttrs)return l}for(let n in this.parser.schema.nodes){let l=this.parser.schema.nodes[n];if(l.isTextblock&&l.defaultAttrs)return l}}}function u6(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let l=t.nodeType==1?t.nodeName.toLowerCase():null;l&&vh.hasOwnProperty(l)&&n?(n.appendChild(t),t=n):l=="li"?n=t:l&&(n=null)}}function c6(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Th(e){let t={};for(let n in e)t[n]=e[n];return t}function Ch(e,t){let n=t.schema.nodes;for(let l in n){let r=n[l];if(!r.allowsMarkType(e))continue;let a=[],i=s=>{a.push(s);for(let o=0;o<s.edgeCount;o++){let{type:u,next:c}=s.edge(o);if(u==t||a.indexOf(c)<0&&i(c))return!0}};if(i(r.contentMatch))return!0}}class el{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},l){l||(l=Ba(n).createDocumentFragment());let r=l,a=[];return t.forEach(i=>{if(a.length||i.marks.length){let s=0,o=0;for(;s<a.length&&o<i.marks.length;){let u=i.marks[o];if(!this.marks[u.type.name]){o++;continue}if(!u.eq(a[s][0])||u.type.spec.spanning===!1)break;s++,o++}for(;s<a.length;)r=a.pop()[1];for(;o<i.marks.length;){let u=i.marks[o++],c=this.serializeMark(u,i.isInline,n);c&&(a.push([u,r]),r.appendChild(c.dom),r=c.contentDOM||c.dom)}}r.appendChild(this.serializeNodeInner(i,n))}),l}serializeNodeInner(t,n){if(t.isText)return Ba(n).createTextNode(t.text);let{dom:l,contentDOM:r}=Ra(Ba(n),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,r)}return l}serializeNode(t,n={}){let l=this.serializeNodeInner(t,n);for(let r=t.marks.length-1;r>=0;r--){let a=this.serializeMark(t.marks[r],t.isInline,n);a&&((a.contentDOM||a.dom).appendChild(l),l=a.dom)}return l}serializeMark(t,n,l={}){let r=this.marks[t.type.name];return r&&Ra(Ba(l),r(t,n),null,t.attrs)}static renderSpec(t,n,l=null,r){return typeof n=="string"?{dom:t.createTextNode(n)}:Ra(t,n,l,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new el(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Sh(t.nodes);return n.text||(n.text=l=>l.text),n}static marksFromSchema(t){return Sh(t.marks)}}function Sh(e){let t={};for(let n in e){let l=e[n].spec.toDOM;l&&(t[n]=l)}return t}function Ba(e){return e.document||window.document}const xh=new WeakMap;function d6(e){let t=xh.get(e);return t===void 0&&xh.set(e,t=f6(e)),t}function f6(e){let t=null;function n(l){if(l&&typeof l=="object")if(Array.isArray(l))if(typeof l[0]=="string")t||(t=[]),t.push(l);else for(let r=0;r<l.length;r++)n(l[r]);else for(let r in l)n(l[r])}return n(e),t}function Ra(e,t,n,l){if(t.nodeType==3)return{dom:t};if(t.dom&&t.dom.nodeType==3)return t;let r=t[0],a;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(l&&(a=d6(l))&&a.indexOf(t)>-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=r.indexOf(" ");i>0&&(n=r.slice(0,i),r=r.slice(i+1));let s,o=n?e.createElementNS(n,r):e.createElement(r),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?o.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&o.style?o.style.cssText=u[d]:o.setAttribute(d,u[d])}}for(let d=c;d<t.length;d++){let f=t[d];if(f===0){if(d<t.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:o,contentDOM:o}}else if(typeof f=="string")o.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Ra(e,f,n,l);if(o.appendChild(h),m){if(s)throw new RangeError("Multiple content holes");s=m}}}return{dom:o,contentDOM:s}}const kh=65535,Ah=Math.pow(2,16);function h6(e,t){return e+t*Ah}function Nh(e){return e&kh}function p6(e){return(e-(e&kh))/Ah}const wh=1,Ih=2,Fa=4,_h=8;class zs{constructor(t,n,l){this.pos=t,this.delInfo=n,this.recover=l}get deleted(){return(this.delInfo&_h)>0}get deletedBefore(){return(this.delInfo&(wh|Fa))>0}get deletedAfter(){return(this.delInfo&(Ih|Fa))>0}get deletedAcross(){return(this.delInfo&Fa)>0}}class kt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&kt.empty)return kt.empty}recover(t){let n=0,l=Nh(t);if(!this.inverted)for(let r=0;r<l;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[l*3]+n+p6(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,l){let r=0,a=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let o=this.ranges[s]-(this.inverted?r:0);if(o>t)break;let u=this.ranges[s+a],c=this.ranges[s+i],d=o+u;if(t<=d){let f=u?t==o?-1:t==d?1:n:n,h=o+r+(f<0?0:c);if(l)return h;let m=t==(n<0?o:d)?null:h6(s/3,t-o),v=t==o?Ih:t==d?wh:Fa;return(n<0?t!=o:t!=d)&&(v|=_h),new zs(h,v,m)}r+=c-u}return l?t+r:new zs(t+r,0,null)}touches(t,n){let l=0,r=Nh(n),a=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let o=this.ranges[s]-(this.inverted?l:0);if(o>t)break;let u=this.ranges[s+a],c=o+u;if(t<=c&&s==r*3)return!0;l+=this.ranges[s+i]-u}return!1}forEach(t){let n=this.inverted?2:1,l=this.inverted?1:2;for(let r=0,a=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?a:0),o=i+(this.inverted?0:a),u=this.ranges[r+n],c=this.ranges[r+l];t(s,s+u,o,o+c),a+=c-u}}invert(){return new kt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?kt.empty:new kt(t<0?[0,-t,0]:[0,0,t])}}kt.empty=new kt([]);class Or{constructor(t,n,l=0,r=t?t.length:0){this.mirror=n,this.from=l,this.to=r,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Or(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,l=this._maps.length;n<t._maps.length;n++){let r=t.getMirror(n);this.appendMap(t._maps[n],r!=null&&r<n?l+r:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,l=this._maps.length+t._maps.length;n>=0;n--){let r=t.getMirror(n);this.appendMap(t._maps[n].invert(),r!=null&&r>n?l-r-1:void 0)}}invert(){let t=new Or;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let l=this.from;l<this.to;l++)t=this._maps[l].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,l){let r=0;for(let a=this.from;a<this.to;a++){let i=this._maps[a],s=i.mapResult(t,n);if(s.recover!=null){let o=this.getMirror(a);if(o!=null&&o>a&&o<this.to){a=o,t=this._maps[o].recover(s.recover);continue}}r|=s.delInfo,t=s.pos}return l?t:new zs(t,r,null)}}const Vs=Object.create(null);class it{getMap(){return kt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let l=Vs[n.stepType];if(!l)throw new RangeError(`No step type ${n.stepType} defined`);return l.fromJSON(t,n)}static jsonID(t,n){if(t in Vs)throw new RangeError("Duplicate use of step JSON ID "+t);return Vs[t]=n,n.prototype.jsonID=t,n}}class $e{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new $e(t,null)}static fail(t){return new $e(null,t)}static fromReplace(t,n,l,r){try{return $e.ok(t.replace(n,l,r))}catch(a){if(a instanceof _a)return $e.fail(a.message);throw a}}}function $s(e,t,n){let l=[];for(let r=0;r<e.childCount;r++){let a=e.child(r);a.content.size&&(a=a.copy($s(a.content,t,a))),a.isInline&&(a=t(a,n,r)),l.push(a)}return K.fromArray(l)}class yn extends it{constructor(t,n,l){super(),this.from=t,this.to=n,this.mark=l}apply(t){let n=t.slice(this.from,this.to),l=t.resolve(this.from),r=l.node(l.sharedDepth(this.to)),a=new ae($s(n.content,(i,s)=>!i.isAtom||!s.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),r),n.openStart,n.openEnd);return $e.fromReplace(t,this.from,this.to,a)}invert(){return new Yt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),l=t.mapResult(this.to,-1);return n.deleted&&l.deleted||n.pos>=l.pos?null:new yn(n.pos,l.pos,this.mark)}merge(t){return t instanceof yn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new yn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new yn(n.from,n.to,t.markFromJSON(n.mark))}}it.jsonID("addMark",yn);class Yt extends it{constructor(t,n,l){super(),this.from=t,this.to=n,this.mark=l}apply(t){let n=t.slice(this.from,this.to),l=new ae($s(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),n.openStart,n.openEnd);return $e.fromReplace(t,this.from,this.to,l)}invert(){return new yn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),l=t.mapResult(this.to,-1);return n.deleted&&l.deleted||n.pos>=l.pos?null:new Yt(n.pos,l.pos,this.mark)}merge(t){return t instanceof Yt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Yt(n.from,n.to,t.markFromJSON(n.mark))}}it.jsonID("removeMark",Yt);class En extends it{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let l=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $e.fromReplace(t,this.pos,this.pos+1,new ae(K.from(l),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let l=this.mark.addToSet(n.marks);if(l.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(l))return new En(this.pos,n.marks[r]);return new En(this.pos,this.mark)}}return new tl(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new En(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new En(n.pos,t.markFromJSON(n.mark))}}it.jsonID("addNodeMark",En);class tl extends it{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let l=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return $e.fromReplace(t,this.pos,this.pos+1,new ae(K.from(l),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new En(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new tl(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new tl(n.pos,t.markFromJSON(n.mark))}}it.jsonID("removeNodeMark",tl);class qe extends it{constructor(t,n,l,r=!1){super(),this.from=t,this.to=n,this.slice=l,this.structure=r}apply(t){return this.structure&&qs(t,this.from,this.to)?$e.fail("Structure replace would overwrite content"):$e.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new kt([this.from,this.to-this.from,this.slice.size])}invert(t){return new qe(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),l=this.from==this.to&&qe.MAP_BIAS<0?n:t.mapResult(this.from,1);return l.deletedAcross&&n.deletedAcross?null:new qe(l.pos,Math.max(l.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof qe)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new qe(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new qe(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qe(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}qe.MAP_BIAS=1,it.jsonID("replace",qe);class Ke extends it{constructor(t,n,l,r,a,i,s=!1){super(),this.from=t,this.to=n,this.gapFrom=l,this.gapTo=r,this.slice=a,this.insert=i,this.structure=s}apply(t){if(this.structure&&(qs(t,this.from,this.gapFrom)||qs(t,this.gapTo,this.to)))return $e.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return $e.fail("Gap is not a flat range");let l=this.slice.insertAt(this.insert,n.content);return l?$e.fromReplace(t,this.from,this.to,l):$e.fail("Content does not fit in gap")}getMap(){return new kt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),l=t.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?l.pos:t.map(this.gapTo,1);return n.deletedAcross&&l.deletedAcross||r<n.pos||a>l.pos?null:new Ke(n.pos,l.pos,r,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}it.jsonID("replaceAround",Ke);function qs(e,t,n){let l=e.resolve(t),r=n-t,a=l.depth;for(;r>0&&a>0&&l.indexAfter(a)==l.node(a).childCount;)a--,r--;if(r>0){let i=l.node(a).maybeChild(l.indexAfter(a));for(;r>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,r--}}return!1}function b6(e,t,n,l){let r=[],a=[],i,s;e.doc.nodesBetween(t,n,(o,u,c)=>{if(!o.isInline)return;let d=o.marks;if(!l.isInSet(d)&&c.type.allowsMarkType(l.type)){let f=Math.max(u,t),h=Math.min(u+o.nodeSize,n),m=l.addToSet(d);for(let v=0;v<d.length;v++)d[v].isInSet(m)||(i&&i.to==f&&i.mark.eq(d[v])?i.to=h:r.push(i=new Yt(f,h,d[v])));s&&s.to==f?s.to=h:a.push(s=new yn(f,h,l))}}),r.forEach(o=>e.step(o)),a.forEach(o=>e.step(o))}function m6(e,t,n,l){let r=[],a=0;e.doc.nodesBetween(t,n,(i,s)=>{if(!i.isInline)return;a++;let o=null;if(l instanceof La){let u=i.marks,c;for(;c=l.isInSet(u);)(o||(o=[])).push(c),u=c.removeFromSet(u)}else l?l.isInSet(i.marks)&&(o=[l]):o=i.marks;if(o&&o.length){let u=Math.min(s+i.nodeSize,n);for(let c=0;c<o.length;c++){let d=o[c],f;for(let h=0;h<r.length;h++){let m=r[h];m.step==a-1&&d.eq(r[h].style)&&(f=m)}f?(f.to=u,f.step=a):r.push({style:d,from:Math.max(s,t),to:u,step:a})}}}),r.forEach(i=>e.step(new Yt(i.from,i.to,i.style)))}function Ws(e,t,n,l=n.contentMatch,r=!0){let a=e.doc.nodeAt(t),i=[],s=t+1;for(let o=0;o<a.childCount;o++){let u=a.child(o),c=s+u.nodeSize,d=l.matchType(u.type);if(!d)i.push(new qe(s,c,ae.empty));else{l=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||e.step(new Yt(s,c,u.marks[f]));if(r&&u.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(u.text);)m||(m=new ae(K.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),i.push(new qe(s+f.index,s+f.index+f[0].length,m))}}s=c}if(!l.validEnd){let o=l.fillBefore(K.empty,!0);e.replace(s,s,new ae(o,0,0))}for(let o=i.length-1;o>=0;o--)e.step(i[o])}function g6(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ml(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let l=e.depth,r=0,a=0;;--l){let i=e.$from.node(l),s=e.$from.index(l)+r,o=e.$to.indexAfter(l)-a;if(l<e.depth&&i.canReplace(s,o,n))return l;if(l==0||i.type.spec.isolating||!g6(i,s,o))break;s&&(r=1),o<i.childCount&&(a=1)}return null}function v6(e,t,n){let{$from:l,$to:r,depth:a}=t,i=l.before(a+1),s=r.after(a+1),o=i,u=s,c=K.empty,d=0;for(let m=a,v=!1;m>n;m--)v||l.index(m)>0?(v=!0,c=K.from(l.node(m).copy(c)),d++):o--;let f=K.empty,h=0;for(let m=a,v=!1;m>n;m--)v||r.after(m+1)<r.end(m)?(v=!0,f=K.from(r.node(m).copy(f)),h++):u++;e.step(new Ke(o,u,i,s,new ae(c.append(f),d,h),c.size-d,!0))}function Ys(e,t,n=null,l=e){let r=y6(e,t),a=r&&E6(l,t);return a?r.map(Oh).concat({type:t,attrs:n}).concat(a.map(Oh)):null}function Oh(e){return{type:e,attrs:null}}function y6(e,t){let{parent:n,startIndex:l,endIndex:r}=e,a=n.contentMatchAt(l).findWrapping(t);if(!a)return null;let i=a.length?a[0]:t;return n.canReplaceWith(l,r,i)?a:null}function E6(e,t){let{parent:n,startIndex:l,endIndex:r}=e,a=n.child(l),i=t.contentMatch.findWrapping(a.type);if(!i)return null;let o=(i.length?i[i.length-1]:t).contentMatch;for(let u=l;o&&u<r;u++)o=o.matchType(n.child(u).type);return!o||!o.validEnd?null:i}function T6(e,t,n){let l=K.empty;for(let i=n.length-1;i>=0;i--){if(l.size){let s=n[i].type.contentMatch.matchFragment(l);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}l=K.from(n[i].type.create(n[i].attrs,l))}let r=t.start,a=t.end;e.step(new Ke(r,a,r,a,new ae(l,0,0),n.length,!0))}function C6(e,t,n,l,r){if(!l.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=e.steps.length;e.doc.nodesBetween(t,n,(i,s)=>{let o=typeof r=="function"?r(i):r;if(i.isTextblock&&!i.hasMarkup(l,o)&&S6(e.doc,e.mapping.slice(a).map(s),l)){let u=null;if(l.schema.linebreakReplacement){let h=l.whitespace=="pre",m=!!l.contentMatch.matchType(l.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&Dh(e,i,s,a),Ws(e,e.mapping.slice(a).map(s,1),l,void 0,u===null);let c=e.mapping.slice(a),d=c.map(s,1),f=c.map(s+i.nodeSize,1);return e.step(new Ke(d,f,d+1,f-1,new ae(K.from(l.create(o,null,i.marks)),0,0),1,!0)),u===!0&&Mh(e,i,s,a),!1}})}function Mh(e,t,n,l){t.forEach((r,a)=>{if(r.isText){let i,s=/\r?\n|\r/g;for(;i=s.exec(r.text);){let o=e.mapping.slice(l).map(n+1+a+i.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function Dh(e,t,n,l){t.forEach((r,a)=>{if(r.type==r.type.schema.linebreakReplacement){let i=e.mapping.slice(l).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
25
- `))}})}function S6(e,t,n){let l=e.resolve(t),r=l.index();return l.parent.canReplaceWith(r,r+1,n)}function x6(e,t,n,l,r){let a=e.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");n||(n=a.type);let i=n.create(l,null,r||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,i);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ke(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new ae(K.from(i),0,0),1,!0))}function tn(e,t,n=1,l){let r=e.resolve(t),a=r.depth-n,i=l&&l[l.length-1]||r.parent;if(a<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!i.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,c=n-2;u>a;u--,c--){let d=r.node(u),f=r.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=l&&l[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let v=l&&l[c]||d;if(!d.canReplace(f+1,d.childCount)||!v.type.validContent(h))return!1}let s=r.indexAfter(a),o=l&&l[0];return r.node(a).canReplaceWith(s,s,o?o.type:r.node(a+1).type)}function k6(e,t,n=1,l){let r=e.doc.resolve(t),a=K.empty,i=K.empty;for(let s=r.depth,o=r.depth-n,u=n-1;s>o;s--,u--){a=K.from(r.node(s).copy(a));let c=l&&l[u];i=K.from(c?c.type.create(c.attrs,i):r.node(s).copy(i))}e.step(new qe(t,t,new ae(a.append(i),n,n),!0))}function Tn(e,t){let n=e.resolve(t),l=n.index();return Lh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(l,l+1)}function A6(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:l}=e.type.schema;for(let r=0;r<t.childCount;r++){let a=t.child(r),i=a.type==l?e.type.schema.nodes.text:a.type;if(n=n.matchType(i),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Lh(e,t){return!!(e&&t&&!e.isLeaf&&A6(e,t))}function Ha(e,t,n=-1){let l=e.resolve(t);for(let r=l.depth;;r--){let a,i,s=l.index(r);if(r==l.depth?(a=l.nodeBefore,i=l.nodeAfter):n>0?(a=l.node(r+1),s++,i=l.node(r).maybeChild(s)):(a=l.node(r).maybeChild(s-1),i=l.node(r+1)),a&&!a.isTextblock&&Lh(a,i)&&l.node(r).canReplace(s,s+1))return t;if(r==0)break;t=n<0?l.before(r):l.after(r)}}function N6(e,t,n){let l=null,{linebreakReplacement:r}=e.doc.type.schema,a=e.doc.resolve(t-n),i=a.node().type;if(r&&i.inlineContent){let c=i.whitespace=="pre",d=!!i.contentMatch.matchType(r);c&&!d?l=!1:!c&&d&&(l=!0)}let s=e.steps.length;if(l===!1){let c=e.doc.resolve(t+n);Dh(e,c.node(),c.before(),s)}i.inlineContent&&Ws(e,t+n-1,i,a.node().contentMatchAt(a.index()),l==null);let o=e.mapping.slice(s),u=o.map(t-n);if(e.step(new qe(u,o.map(t+n,-1),ae.empty,!0)),l===!0){let c=e.doc.resolve(u);Mh(e,c.node(),c.before(),e.steps.length)}return e}function w6(e,t,n){let l=e.resolve(t);if(l.parent.canReplaceWith(l.index(),l.index(),n))return t;if(l.parentOffset==0)for(let r=l.depth-1;r>=0;r--){let a=l.index(r);if(l.node(r).canReplaceWith(a,a,n))return l.before(r+1);if(a>0)return null}if(l.parentOffset==l.parent.content.size)for(let r=l.depth-1;r>=0;r--){let a=l.indexAfter(r);if(l.node(r).canReplaceWith(a,a,n))return l.after(r+1);if(a<l.node(r).childCount)return null}return null}function Ph(e,t,n){let l=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let a=0;a<n.openStart;a++)r=r.firstChild.content;for(let a=1;a<=(n.openStart==0&&n.size?2:1);a++)for(let i=l.depth;i>=0;i--){let s=i==l.depth?0:l.pos<=(l.start(i+1)+l.end(i+1))/2?-1:1,o=l.index(i)+(s>0?1:0),u=l.node(i),c=!1;if(a==1)c=u.canReplace(o,o,r);else{let d=u.contentMatchAt(o).findWrapping(r.firstChild.type);c=d&&u.canReplaceWith(o,o,d[0])}if(c)return s==0?l.pos:s<0?l.before(i+1):l.after(i+1)}return null}function Ua(e,t,n=t,l=ae.empty){if(t==n&&!l.size)return null;let r=e.resolve(t),a=e.resolve(n);return Bh(r,a,l)?new qe(t,n,l):new I6(r,a,l).fit()}function Bh(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class I6{constructor(t,n,l){this.$from=t,this.$to=n,this.unplaced=l,this.frontier=[],this.placed=K.empty;for(let r=0;r<=t.depth;r++){let a=t.node(r);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=K.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,l=this.$from,r=this.close(t<0?this.$to:l.doc.resolve(t));if(!r)return null;let a=this.placed,i=l.depth,s=r.depth;for(;i&&s&&a.childCount==1;)a=a.firstChild.content,i--,s--;let o=new ae(a,i,s);return t>-1?new Ke(l.pos,t,this.$to.pos,this.$to.end(),o,n):o.size||l.pos!=this.$to.pos?new qe(l.pos,r.pos,o):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,l=0,r=this.unplaced.openEnd;l<t;l++){let a=n.firstChild;if(n.childCount>1&&(r=0),a.type.spec.isolating&&r<=l){t=l;break}n=a.content}for(let n=1;n<=2;n++)for(let l=n==1?t:this.unplaced.openStart;l>=0;l--){let r,a=null;l?(a=js(this.unplaced.content,l-1).firstChild,r=a.content):r=this.unplaced.content;let i=r.firstChild;for(let s=this.depth;s>=0;s--){let{type:o,match:u}=this.frontier[s],c,d=null;if(n==1&&(i?u.matchType(i.type)||(d=u.fillBefore(K.from(i),!1)):a&&o.compatibleContent(a.type)))return{sliceDepth:l,frontierDepth:s,parent:a,inject:d};if(n==2&&i&&(c=u.findWrapping(i.type)))return{sliceDepth:l,frontierDepth:s,parent:a,wrap:c};if(a&&u.matchType(a.type))break}}}openMore(){let{content:t,openStart:n,openEnd:l}=this.unplaced,r=js(t,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(l,r.size+n>=t.size-l?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:l}=this.unplaced,r=js(t,n);if(r.childCount<=1&&n>0){let a=t.size-n<=n+r.size;this.unplaced=new ae(Mr(t,n-1,1),n-1,a?n-1:l)}else this.unplaced=new ae(Mr(t,n,1),n,l)}placeNodes({sliceDepth:t,frontierDepth:n,parent:l,inject:r,wrap:a}){for(;this.depth>n;)this.closeFrontierNode();if(a)for(let v=0;v<a.length;v++)this.openFrontierNode(a[v]);let i=this.unplaced,s=l?l.content:i.content,o=i.openStart-t,u=0,c=[],{match:d,type:f}=this.frontier[n];if(r){for(let v=0;v<r.childCount;v++)c.push(r.child(v));d=d.matchFragment(r)}let h=s.size+t-(i.content.size-i.openEnd);for(;u<s.childCount;){let v=s.child(u),g=d.matchType(v.type);if(!g)break;u++,(u>1||o==0||v.content.size)&&(d=g,c.push(Rh(v.mark(f.allowedMarks(v.marks)),u==1?o:0,u==s.childCount?h:-1)))}let m=u==s.childCount;m||(h=-1),this.placed=Dr(this.placed,n,K.from(c)),this.frontier[n].match=d,m&&h<0&&l&&l.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,g=s;v<h;v++){let E=g.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),g=E.content}this.unplaced=m?t==0?ae.empty:new ae(Mr(i.content,t-1,1),t-1,h<0?i.openEnd:t-1):new ae(Mr(i.content,t,u),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Ks(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:l}=this.$to,r=this.$to.after(l);for(;l>1&&r==this.$to.end(--l);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:l,type:r}=this.frontier[n],a=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),i=Ks(t,n,r,l,a);if(i){for(let s=n-1;s>=0;s--){let{match:o,type:u}=this.frontier[s],c=Ks(t,s,u,o,!0);if(!c||c.childCount)continue e}return{depth:n,fit:i,move:a?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Dr(this.placed,n.depth,n.fit)),t=n.move;for(let l=n.depth+1;l<=t.depth;l++){let r=t.node(l),a=r.type.contentMatch.fillBefore(r.content,!0,t.index(l));this.openFrontierNode(r.type,r.attrs,a)}return t}openFrontierNode(t,n=null,l){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Dr(this.placed,this.depth,K.from(t.create(n,l))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=Dr(this.placed,this.frontier.length,n))}}function Mr(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Mr(e.firstChild.content,t-1,n)))}function Dr(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Dr(e.lastChild.content,t-1,n)))}function js(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Rh(e,t,n){if(t<=0)return e;let l=e.content;return t>1&&(l=l.replaceChild(0,Rh(l.firstChild,t-1,l.childCount==1?n-1:0))),t>0&&(l=e.type.contentMatch.fillBefore(l).append(l),n<=0&&(l=l.append(e.type.contentMatch.matchFragment(l).fillBefore(K.empty,!0)))),e.copy(l)}function Ks(e,t,n,l,r){let a=e.node(t),i=r?e.indexAfter(t):e.index(t);if(i==a.childCount&&!n.compatibleContent(a.type))return null;let s=l.fillBefore(a.content,!0,i);return s&&!_6(n,a.content,i)?s:null}function _6(e,t,n){for(let l=n;l<t.childCount;l++)if(!e.allowsMarks(t.child(l).marks))return!0;return!1}function O6(e){return e.spec.defining||e.spec.definingForContent}function M6(e,t,n,l){if(!l.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),a=e.doc.resolve(n);if(Bh(r,a,l))return e.step(new qe(t,n,l));let i=Hh(r,a);i[i.length-1]==0&&i.pop();let s=-(r.depth+1);i.unshift(s);for(let f=r.depth,h=r.pos-1;f>0;f--,h--){let m=r.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;i.indexOf(f)>-1?s=f:r.before(f)==h&&i.splice(1,0,-f)}let o=i.indexOf(s),u=[],c=l.openStart;for(let f=l.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==l.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=O6(h.type);if(m&&!h.sameMarkup(r.node(Math.abs(s)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=l.openStart;f>=0;f--){let h=(f+c+1)%(l.openStart+1),m=u[h];if(m)for(let v=0;v<i.length;v++){let g=i[(v+o)%i.length],E=!0;g<0&&(E=!1,g=-g);let N=r.node(g-1),A=r.index(g-1);if(N.canReplaceWith(A,A,m.type,m.marks))return e.replace(r.before(g),E?a.after(g):n,new ae(Fh(l.content,0,l.openStart,h),h,l.openEnd))}}let d=e.steps.length;for(let f=i.length-1;f>=0&&(e.replace(t,n,l),!(e.steps.length>d));f--){let h=i[f];h<0||(t=r.before(h),n=a.after(h))}}function Fh(e,t,n,l,r){if(t<n){let a=e.firstChild;e=e.replaceChild(0,a.copy(Fh(a.content,t+1,n,l,a)))}if(t>l){let a=r.contentMatchAt(0),i=a.fillBefore(e).append(e);e=i.append(a.matchFragment(i).fillBefore(K.empty,!0))}return e}function D6(e,t,n,l){if(!l.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=w6(e.doc,t,l.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new ae(K.from(l),0,0))}function L6(e,t,n){let l=e.doc.resolve(t),r=e.doc.resolve(n);if(l.parent.isTextblock&&r.parent.isTextblock&&l.start()!=r.start()&&l.parentOffset==0&&r.parentOffset==0){let i=l.sharedDepth(n),s=!1;for(let o=l.depth;o>i;o--)l.node(o).type.spec.isolating&&(s=!0);for(let o=r.depth;o>i;o--)r.node(o).type.spec.isolating&&(s=!0);if(!s){for(let o=l.depth;o>0&&t==l.start(o);o--)t=l.before(o);for(let o=r.depth;o>0&&n==r.start(o);o--)n=r.before(o);l=e.doc.resolve(t),r=e.doc.resolve(n)}}let a=Hh(l,r);for(let i=0;i<a.length;i++){let s=a[i],o=i==a.length-1;if(o&&s==0||l.node(s).type.contentMatch.validEnd)return e.delete(l.start(s),r.end(s));if(s>0&&(o||l.node(s-1).canReplace(l.index(s-1),r.indexAfter(s-1))))return e.delete(l.before(s),r.after(s))}for(let i=1;i<=l.depth&&i<=r.depth;i++)if(t-l.start(i)==l.depth-i&&n>l.end(i)&&r.end(i)-n!=r.depth-i&&l.start(i-1)==r.start(i-1)&&l.node(i-1).canReplace(l.index(i-1),r.index(i-1)))return e.delete(l.before(i),n);e.delete(t,n)}function Hh(e,t){let n=[],l=Math.min(e.depth,t.depth);for(let r=l;r>=0;r--){let a=e.start(r);if(a<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(a==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==a-1)&&n.push(r)}return n}class Dl extends it{constructor(t,n,l){super(),this.pos=t,this.attr=n,this.value=l}apply(t){let n=t.nodeAt(this.pos);if(!n)return $e.fail("No node at attribute step's position");let l=Object.create(null);for(let a in n.attrs)l[a]=n.attrs[a];l[this.attr]=this.value;let r=n.type.create(l,null,n.marks);return $e.fromReplace(t,this.pos,this.pos+1,new ae(K.from(r),0,n.isLeaf?0:1))}getMap(){return kt.empty}invert(t){return new Dl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Dl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Dl(n.pos,n.attr,n.value)}}it.jsonID("attr",Dl);class Lr extends it{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let l=t.type.create(n,t.content,t.marks);return $e.ok(l)}getMap(){return kt.empty}invert(t){return new Lr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Lr(n.attr,n.value)}}it.jsonID("docAttr",Lr);let Ll=class extends Error{};Ll=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Ll.prototype=Object.create(Error.prototype),Ll.prototype.constructor=Ll,Ll.prototype.name="TransformError";class P6{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Or}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ll(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let l=0;l<this.mapping.maps.length;l++){let r=this.mapping.maps[l];l&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((a,i,s,o)=>{t=Math.min(t,s),n=Math.max(n,o)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,l=ae.empty){let r=Ua(this.doc,t,n,l);return r&&this.step(r),this}replaceWith(t,n,l){return this.replace(t,n,new ae(K.from(l),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,l){return M6(this,t,n,l),this}replaceRangeWith(t,n,l){return D6(this,t,n,l),this}deleteRange(t,n){return L6(this,t,n),this}lift(t,n){return v6(this,t,n),this}join(t,n=1){return N6(this,t,n),this}wrap(t,n){return T6(this,t,n),this}setBlockType(t,n=t,l,r=null){return C6(this,t,n,l,r),this}setNodeMarkup(t,n,l=null,r){return x6(this,t,n,l,r),this}setNodeAttribute(t,n,l){return this.step(new Dl(t,n,l)),this}setDocAttribute(t,n){return this.step(new Lr(t,n)),this}addNodeMark(t,n){return this.step(new En(t,n)),this}removeNodeMark(t,n){let l=this.doc.nodeAt(t);if(!l)throw new RangeError("No node at position "+t);if(n instanceof Le)n.isInSet(l.marks)&&this.step(new tl(t,n));else{let r=l.marks,a,i=[];for(;a=n.isInSet(r);)i.push(new tl(t,a)),r=a.removeFromSet(r);for(let s=i.length-1;s>=0;s--)this.step(i[s])}return this}split(t,n=1,l){return k6(this,t,n,l),this}addMark(t,n,l){return b6(this,t,n,l),this}removeMark(t,n,l){return m6(this,t,n,l),this}clearIncompatible(t,n,l){return Ws(this,t,n,l),this}}const Gs=Object.create(null);class Te{constructor(t,n,l){this.$anchor=t,this.$head=n,this.ranges=l||[new B6(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let l=n.content.lastChild,r=null;for(let s=0;s<n.openEnd;s++)r=l,l=l.lastChild;let a=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:u}=i[s],c=t.mapping.slice(a);t.replaceRange(c.map(o.pos),c.map(u.pos),s?ae.empty:n),s==0&&Vh(t,a,(l?l.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let l=t.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:i,$to:s}=r[a],o=t.mapping.slice(l),u=o.map(i.pos),c=o.map(s.pos);a?t.deleteRange(u,c):(t.replaceRangeWith(u,c,n),Vh(t,l,n.isInline?-1:1))}}static findFrom(t,n,l=!1){let r=t.parent.inlineContent?new be(t):Pl(t.node(0),t.parent,t.pos,t.index(),n,l);if(r)return r;for(let a=t.depth-1;a>=0;a--){let i=n<0?Pl(t.node(0),t.node(a),t.before(a+1),t.index(a),n,l):Pl(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,l);if(i)return i}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new At(t.node(0))}static atStart(t){return Pl(t,t,0,0,1)||new At(t)}static atEnd(t){return Pl(t,t,t.content.size,t.childCount,-1)||new At(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let l=Gs[n.type];if(!l)throw new RangeError(`No selection type ${n.type} defined`);return l.fromJSON(t,n)}static jsonID(t,n){if(t in Gs)throw new RangeError("Duplicate use of selection JSON ID "+t);return Gs[t]=n,n.prototype.jsonID=t,n}getBookmark(){return be.between(this.$anchor,this.$head).getBookmark()}}Te.prototype.visible=!0;class B6{constructor(t,n){this.$from=t,this.$to=n}}let Uh=!1;function zh(e){!Uh&&!e.parent.inlineContent&&(Uh=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class be extends Te{constructor(t,n=t){zh(t),zh(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let l=t.resolve(n.map(this.head));if(!l.parent.inlineContent)return Te.near(l);let r=t.resolve(n.map(this.anchor));return new be(r.parent.inlineContent?r:l,l)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let l=this.$from.marksAcross(this.$to);l&&t.ensureMarks(l)}}eq(t){return t instanceof be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new za(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,l=n){let r=t.resolve(n);return new this(r,l==n?r:t.resolve(l))}static between(t,n,l){let r=t.pos-n.pos;if((!l||r)&&(l=r>=0?1:-1),!n.parent.inlineContent){let a=Te.findFrom(n,l,!0)||Te.findFrom(n,-l,!0);if(a)n=a.$head;else return Te.near(n,l)}return t.parent.inlineContent||(r==0?t=n:(t=(Te.findFrom(t,-l,!0)||Te.findFrom(t,l,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new be(t,n)}}Te.jsonID("text",be);class za{constructor(t,n){this.anchor=t,this.head=n}map(t){return new za(t.map(this.anchor),t.map(this.head))}resolve(t){return be.between(t.resolve(this.anchor),t.resolve(this.head))}}class he extends Te{constructor(t){let n=t.nodeAfter,l=t.node(0).resolve(t.pos+n.nodeSize);super(t,l),this.node=n}map(t,n){let{deleted:l,pos:r}=n.mapResult(this.anchor),a=t.resolve(r);return l?Te.near(a):new he(a)}content(){return new ae(K.from(this.node),0,0)}eq(t){return t instanceof he&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qs(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new he(t.resolve(n.anchor))}static create(t,n){return new he(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}he.prototype.visible=!1,Te.jsonID("node",he);class Qs{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:l}=t.mapResult(this.anchor);return n?new za(l,l):new Qs(l)}resolve(t){let n=t.resolve(this.anchor),l=n.nodeAfter;return l&&he.isSelectable(l)?new he(n):Te.near(n)}}class At extends Te{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let l=Te.atStart(t.doc);l.eq(t.selection)||t.setSelection(l)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new At(t)}map(t){return new At(t)}eq(t){return t instanceof At}getBookmark(){return R6}}Te.jsonID("all",At);const R6={map(){return this},resolve(e){return new At(e)}};function Pl(e,t,n,l,r,a=!1){if(t.inlineContent)return be.create(e,n);for(let i=l-(r>0?0:1);r>0?i<t.childCount:i>=0;i+=r){let s=t.child(i);if(s.isAtom){if(!a&&he.isSelectable(s))return he.create(e,n-(r<0?s.nodeSize:0))}else{let o=Pl(e,s,n+r,r<0?s.childCount:0,r,a);if(o)return o}n+=s.nodeSize*r}return null}function Vh(e,t,n){let l=e.steps.length-1;if(l<t)return;let r=e.steps[l];if(!(r instanceof qe||r instanceof Ke))return;let a=e.mapping.maps[l],i;a.forEach((s,o,u,c)=>{i==null&&(i=c)}),e.setSelection(Te.near(e.doc.resolve(i),n))}const $h=1,Va=2,qh=4;class F6 extends P6{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|$h)&~Va,this.storedMarks=null,this}get selectionSet(){return(this.updated&$h)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Va,this}ensureMarks(t){return Le.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Va)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Va,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let l=this.selection;return n&&(t=t.mark(this.storedMarks||(l.empty?l.$from.marks():l.$from.marksAcross(l.$to)||Le.none))),l.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,l){let r=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(l==null&&(l=n),!t)return this.deleteRange(n,l);let a=this.storedMarks;if(!a){let i=this.doc.resolve(n);a=l==n?i.marks():i.marksAcross(this.doc.resolve(l))}return this.replaceRangeWith(n,l,r.text(t,a)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Te.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qh,this}get scrolledIntoView(){return(this.updated&qh)>0}}function Wh(e,t){return!t||!e?e:e.bind(t)}class Pr{constructor(t,n,l){this.name=t,this.init=Wh(n.init,l),this.apply=Wh(n.apply,l)}}const H6=[new Pr("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Pr("selection",{init(e,t){return e.selection||Te.atStart(t.doc)},apply(e){return e.selection}}),new Pr("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,l){return l.selection.$cursor?e.storedMarks:null}}),new Pr("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Xs{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=H6.slice(),n&&n.forEach(l=>{if(this.pluginsByKey[l.key])throw new RangeError("Adding different instances of a keyed plugin ("+l.key+")");this.plugins.push(l),this.pluginsByKey[l.key]=l,l.spec.state&&this.fields.push(new Pr(l.key,l.spec.state,l))})}}class Bl{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let l=0;l<this.config.plugins.length;l++)if(l!=n){let r=this.config.plugins[l];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],l=this.applyInner(t),r=null;for(;;){let a=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let o=r?r[i].n:0,u=r?r[i].state:this,c=o<n.length&&s.spec.appendTransaction.call(s,o?n.slice(o):n,u,l);if(c&&l.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let d=0;d<this.config.plugins.length;d++)r.push(d<i?{state:l,n:n.length}:{state:this,n:0})}n.push(c),l=l.applyInner(c),a=!0}r&&(r[i]={state:l,n:n.length})}}if(!a)return{state:l,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Bl(this.config),l=this.config.fields;for(let r=0;r<l.length;r++){let a=l[r];n[a.name]=a.apply(t,this[a.name],this,n)}return n}get tr(){return new F6(this)}static create(t){let n=new Xs(t.doc?t.doc.type.schema:t.schema,t.plugins),l=new Bl(n);for(let r=0;r<n.fields.length;r++)l[n.fields[r].name]=n.fields[r].init(t,l);return l}reconfigure(t){let n=new Xs(this.schema,t.plugins),l=n.fields,r=new Bl(n);for(let a=0;a<l.length;a++){let i=l[a].name;r[i]=this.hasOwnProperty(i)?this[i]:l[a].init(t,r)}return r}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(l=>l.toJSON())),t&&typeof t=="object")for(let l in t){if(l=="doc"||l=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[l],a=r.spec.state;a&&a.toJSON&&(n[l]=a.toJSON.call(r,this[r.key]))}return n}static fromJSON(t,n,l){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new Xs(t.schema,t.plugins),a=new Bl(r);return r.fields.forEach(i=>{if(i.name=="doc")a.doc=vn.fromJSON(t.schema,n.doc);else if(i.name=="selection")a.selection=Te.fromJSON(a.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(l)for(let s in l){let o=l[s],u=o.spec.state;if(o.key==i.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,s)){a[i.name]=u.fromJSON.call(o,t,n[s],a);return}}a[i.name]=i.init(t,a)}}),a}}function Yh(e,t,n){for(let l in e){let r=e[l];r instanceof Function?r=r.bind(t):l=="handleDOMEvents"&&(r=Yh(r,t,{})),n[l]=r}return n}class ft{constructor(t){this.spec=t,this.props={},t.props&&Yh(t.props,this,this.props),this.key=t.key?t.key.key:jh("plugin")}getState(t){return t[this.key]}}const Js=Object.create(null);function jh(e){return e in Js?e+"$"+ ++Js[e]:(Js[e]=0,e+"$")}class Rt{constructor(t="key"){this.key=jh(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Ze=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Rl=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Zs=null;const nn=function(e,t,n){let l=Zs||(Zs=document.createRange());return l.setEnd(e,n??e.nodeValue.length),l.setStart(e,t||0),l},U6=function(){Zs=null},nl=function(e,t,n,l){return n&&(Kh(e,t,n,l,-1)||Kh(e,t,n,l,1))},z6=/^(img|br|input|textarea|hr)$/i;function Kh(e,t,n,l,r){for(var a;;){if(e==n&&t==l)return!0;if(t==(r<0?0:Ot(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Br(e)||z6.test(e.nodeName)||e.contentEditable=="false")return!1;t=Ze(e)+(r<0?0:1),e=i}else if(e.nodeType==1){let i=e.childNodes[t+(r<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((a=i.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=r;else return!1;else e=i,t=r<0?Ot(e):0}else return!1}}function Ot(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function V6(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Ot(e)}else if(e.parentNode&&!Br(e))t=Ze(e),e=e.parentNode;else return null}}function $6(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Br(e))t=Ze(e)+1,e=e.parentNode;else return null}}function q6(e,t,n){for(let l=t==0,r=t==Ot(e);l||r;){if(e==n)return!0;let a=Ze(e);if(e=e.parentNode,!e)return!1;l=l&&a==0,r=r&&a==Ot(e)}}function Br(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const $a=function(e){return e.focusNode&&nl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ll(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function W6(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Y6(e,t,n){if(e.caretPositionFromPoint)try{let l=e.caretPositionFromPoint(t,n);if(l)return{node:l.offsetNode,offset:Math.min(Ot(l.offsetNode),l.offset)}}catch{}if(e.caretRangeFromPoint){let l=e.caretRangeFromPoint(t,n);if(l)return{node:l.startContainer,offset:Math.min(Ot(l.startContainer),l.startOffset)}}}const jt=typeof navigator<"u"?navigator:null,Gh=typeof document<"u"?document:null,Cn=jt&&jt.userAgent||"",eo=/Edge\/(\d+)/.exec(Cn),Qh=/MSIE \d/.exec(Cn),to=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Cn),yt=!!(Qh||to||eo),Sn=Qh?document.documentMode:to?+to[1]:eo?+eo[1]:0,Mt=!yt&&/gecko\/(\d+)/i.test(Cn);Mt&&+(/Firefox\/(\d+)/.exec(Cn)||[0,0])[1];const no=!yt&&/Chrome\/(\d+)/.exec(Cn),et=!!no,Xh=no?+no[1]:0,st=!yt&&!!jt&&/Apple Computer/.test(jt.vendor),Fl=st&&(/Mobile\/\w+/.test(Cn)||!!jt&&jt.maxTouchPoints>2),Dt=Fl||(jt?/Mac/.test(jt.platform):!1),Jh=jt?/Win/.test(jt.platform):!1,ln=/Android \d/.test(Cn),Rr=!!Gh&&"webkitFontSmoothing"in Gh.documentElement.style,j6=Rr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function K6(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rn(e,t){return typeof e=="number"?e:e[t]}function G6(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,l=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*l}}function Zh(e,t,n){let l=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,a=e.dom.ownerDocument;for(let i=n||e.dom;i;){if(i.nodeType!=1){i=Rl(i);continue}let s=i,o=s==a.body,u=o?K6(a):G6(s),c=0,d=0;if(t.top<u.top+rn(l,"top")?d=-(u.top-t.top+rn(r,"top")):t.bottom>u.bottom-rn(l,"bottom")&&(d=t.bottom-t.top>u.bottom-u.top?t.top+rn(r,"top")-u.top:t.bottom-u.bottom+rn(r,"bottom")),t.left<u.left+rn(l,"left")?c=-(u.left-t.left+rn(r,"left")):t.right>u.right-rn(l,"right")&&(c=t.right-u.right+rn(r,"right")),c||d)if(o)a.defaultView.scrollBy(c,d);else{let h=s.scrollLeft,m=s.scrollTop;d&&(s.scrollTop+=d),c&&(s.scrollLeft+=c);let v=s.scrollLeft-h,g=s.scrollTop-m;t={left:t.left-v,top:t.top-g,right:t.right-v,bottom:t.bottom-g}}let f=o?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(f))break;i=f=="absolute"?i.offsetParent:Rl(i)}}function Q6(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),l,r;for(let a=(t.left+t.right)/2,i=n+1;i<Math.min(innerHeight,t.bottom);i+=5){let s=e.root.elementFromPoint(a,i);if(!s||s==e.dom||!e.dom.contains(s))continue;let o=s.getBoundingClientRect();if(o.top>=n-20){l=s,r=o.top;break}}return{refDOM:l,refTop:r,stack:ep(e.dom)}}function ep(e){let t=[],n=e.ownerDocument;for(let l=e;l&&(t.push({dom:l,top:l.scrollTop,left:l.scrollLeft}),e!=n);l=Rl(l));return t}function X6({refDOM:e,refTop:t,stack:n}){let l=e?e.getBoundingClientRect().top:0;tp(n,l==0?0:l-t)}function tp(e,t){for(let n=0;n<e.length;n++){let{dom:l,top:r,left:a}=e[n];l.scrollTop!=r+t&&(l.scrollTop=r+t),l.scrollLeft!=a&&(l.scrollLeft=a)}}let Hl=null;function J6(e){if(e.setActive)return e.setActive();if(Hl)return e.focus(Hl);let t=ep(e);e.focus(Hl==null?{get preventScroll(){return Hl={preventScroll:!0},!0}}:void 0),Hl||(Hl=!1,tp(t,0))}function np(e,t){let n,l=2e8,r,a=0,i=t.top,s=t.top,o,u;for(let c=e.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=nn(c).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=i&&m.bottom>=s){i=Math.max(m.bottom,i),s=Math.min(m.top,s);let v=m.left>t.left?m.left-t.left:m.right<t.left?t.left-m.right:0;if(v<l){n=c,l=v,r=v&&n.nodeType==3?{left:m.right<t.left?m.right:m.left,top:t.top}:t,c.nodeType==1&&v&&(a=d+(t.left>=(m.left+m.right)/2?1:0));continue}}else m.top>t.top&&!o&&m.left<=t.left&&m.right>=t.left&&(o=c,u={left:Math.max(m.left,Math.min(m.right,t.left)),top:m.top});!n&&(t.left>=m.right&&t.top>=m.top||t.left>=m.left&&t.top>=m.bottom)&&(a=d+1)}}return!n&&o&&(n=o,r=u,l=0),n&&n.nodeType==3?Z6(n,r):!n||l&&n.nodeType==1?{node:e,offset:a}:np(n,r)}function Z6(e,t){let n=e.nodeValue.length,l=document.createRange(),r;for(let a=0;a<n;a++){l.setEnd(e,a+1),l.setStart(e,a);let i=xn(l,1);if(i.top!=i.bottom&&lo(t,i)){r={node:e,offset:a+(t.left>=(i.left+i.right)/2?1:0)};break}}return l.detach(),r||{node:e,offset:0}}function lo(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function eS(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function tS(e,t,n){let{node:l,offset:r}=np(t,n),a=-1;if(l.nodeType==1&&!l.firstChild){let i=l.getBoundingClientRect();a=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return e.docView.posFromDOM(l,r,a)}function nS(e,t,n,l){let r=-1;for(let a=t,i=!1;a!=e.dom;){let s=e.docView.nearestDesc(a,!0),o;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((o=s.dom.getBoundingClientRect()).width||o.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&o.left>l.left||o.top>l.top?r=s.posBefore:(!i&&o.right<l.left||o.bottom<l.top)&&(r=s.posAfter),i=!0),!s.contentDOM&&r<0&&!s.node.isText))return(s.node.isBlock?l.top<(o.top+o.bottom)/2:l.left<(o.left+o.right)/2)?s.posBefore:s.posAfter;a=s.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,n,-1)}function lp(e,t,n){let l=e.childNodes.length;if(l&&n.top<n.bottom)for(let r=Math.max(0,Math.min(l-1,Math.floor(l*(t.top-n.top)/(n.bottom-n.top))-2)),a=r;;){let i=e.childNodes[a];if(i.nodeType==1){let s=i.getClientRects();for(let o=0;o<s.length;o++){let u=s[o];if(lo(t,u))return lp(i,t,u)}}if((a=(a+1)%l)==r)break}return e}function lS(e,t){let n=e.dom.ownerDocument,l,r=0,a=Y6(n,t.left,t.top);a&&({node:l,offset:r}=a);let i=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!i||!e.dom.contains(i.nodeType!=1?i.parentNode:i)){let u=e.dom.getBoundingClientRect();if(!lo(t,u)||(i=lp(e.dom,t,u),!i))return null}if(st)for(let u=i;l&&u;u=Rl(u))u.draggable&&(l=void 0);if(i=eS(i,t),l){if(Mt&&l.nodeType==1&&(r=Math.min(r,l.childNodes.length),r<l.childNodes.length)){let c=l.childNodes[r],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&r++}let u;Rr&&r&&l.nodeType==1&&(u=l.childNodes[r-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&r--,l==e.dom&&r==l.childNodes.length-1&&l.lastChild.nodeType==1&&t.top>l.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(r==0||l.nodeType!=1||l.childNodes[r-1].nodeName!="BR")&&(s=nS(e,l,r,t))}s==null&&(s=tS(e,i,t));let o=e.docView.nearestDesc(i,!0);return{pos:s,inside:o?o.posAtStart-o.border:-1}}function rp(e){return e.top<e.bottom||e.left<e.right}function xn(e,t){let n=e.getClientRects();if(n.length){let l=n[t<0?0:n.length-1];if(rp(l))return l}return Array.prototype.find.call(n,rp)||e.getBoundingClientRect()}const rS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ap(e,t,n){let{node:l,offset:r,atom:a}=e.docView.domFromPos(t,n<0?-1:1),i=Rr||Mt;if(l.nodeType==3)if(i&&(rS.test(l.nodeValue)||(n<0?!r:r==l.nodeValue.length))){let o=xn(nn(l,r,r),n);if(Mt&&r&&/\s/.test(l.nodeValue[r-1])&&r<l.nodeValue.length){let u=xn(nn(l,r-1,r-1),-1);if(u.top==o.top){let c=xn(nn(l,r,r+1),-1);if(c.top!=o.top)return Fr(c,c.left<u.left)}}return o}else{let o=r,u=r,c=n<0?1:-1;return n<0&&!r?(u++,c=-1):n>=0&&r==l.nodeValue.length?(o--,c=1):n<0?o--:u++,Fr(xn(nn(l,o,u),c),c<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&r&&(n<0||r==Ot(l))){let o=l.childNodes[r-1];if(o.nodeType==1)return ro(o.getBoundingClientRect(),!1)}if(a==null&&r<Ot(l)){let o=l.childNodes[r];if(o.nodeType==1)return ro(o.getBoundingClientRect(),!0)}return ro(l.getBoundingClientRect(),n>=0)}if(a==null&&r&&(n<0||r==Ot(l))){let o=l.childNodes[r-1],u=o.nodeType==3?nn(o,Ot(o)-(i?0:1)):o.nodeType==1&&(o.nodeName!="BR"||!o.nextSibling)?o:null;if(u)return Fr(xn(u,1),!1)}if(a==null&&r<Ot(l)){let o=l.childNodes[r];for(;o.pmViewDesc&&o.pmViewDesc.ignoreForCoords;)o=o.nextSibling;let u=o?o.nodeType==3?nn(o,0,i?0:1):o.nodeType==1?o:null:null;if(u)return Fr(xn(u,-1),!0)}return Fr(xn(l.nodeType==3?nn(l):l,-n),n>=0)}function Fr(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ro(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ip(e,t,n){let l=e.state,r=e.root.activeElement;l!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{l!=t&&e.updateState(l),r!=e.dom&&r&&r.focus()}}function aS(e,t,n){let l=t.selection,r=n=="up"?l.$from:l.$to;return ip(e,t,()=>{let{node:a}=e.docView.domFromPos(r.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(a,!0);if(!s)break;if(s.node.isBlock){a=s.contentDOM||s.dom;break}a=s.dom.parentNode}let i=ap(e,r.pos,1);for(let s=a.firstChild;s;s=s.nextSibling){let o;if(s.nodeType==1)o=s.getClientRects();else if(s.nodeType==3)o=nn(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;u<o.length;u++){let c=o[u];if(c.bottom>c.top+1&&(n=="up"?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})}const iS=/[\u0590-\u08ac]/;function sS(e,t,n){let{$head:l}=t.selection;if(!l.parent.isTextblock)return!1;let r=l.parentOffset,a=!r,i=r==l.parent.content.size,s=e.domSelection();return s?!iS.test(l.parent.textContent)||!s.modify?n=="left"||n=="backward"?a:i:ip(e,t,()=>{let{focusNode:o,focusOffset:u,anchorNode:c,anchorOffset:d}=e.domSelectionRange(),f=s.caretBidiLevel;s.modify("move",n,"character");let h=l.depth?e.docView.domAfterPos(l.before()):e.dom,{focusNode:m,focusOffset:v}=e.domSelectionRange(),g=m&&!h.contains(m.nodeType==1?m:m.parentNode)||o==m&&u==v;try{s.collapse(c,d),o&&(o!=c||u!=d)&&s.extend&&s.extend(o,u)}catch{}return f!=null&&(s.caretBidiLevel=f),g}):l.pos==l.start()||l.pos==l.end()}let sp=null,op=null,up=!1;function oS(e,t,n){return sp==t&&op==n?up:(sp=t,op=n,up=n=="up"||n=="down"?aS(e,t,n):sS(e,t,n))}const Lt=0,cp=1,rl=2,Kt=3;class Hr{constructor(t,n,l,r){this.parent=t,this.children=n,this.dom=l,this.contentDOM=r,this.dirty=Lt,l.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,l){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,l=this.posAtStart;;n++){let r=this.children[n];if(r==t)return l;l+=r.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(t,n,l){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(l<0){let a,i;if(t==this.contentDOM)a=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.previousSibling}for(;a&&!((i=a.pmViewDesc)&&i.parent==this);)a=a.previousSibling;return a?this.posBeforeChild(i)+i.size:this.posAtStart}else{let a,i;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((i=a.pmViewDesc)&&i.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(i):this.posAtEnd}let r;if(t==this.dom&&this.contentDOM)r=n>Ze(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let a=t;;a=a.parentNode){if(a==this.dom){r=!1;break}if(a.previousSibling)break}if(r==null&&n==t.childNodes.length)for(let a=t;;a=a.parentNode){if(a==this.dom){r=!0;break}if(a.nextSibling)break}}return r??l>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let l=!0,r=t;r;r=r.parentNode){let a=this.getDesc(r),i;if(a&&(!n||a.node))if(l&&(i=a.nodeDOM)&&!(i.nodeType==1?i.contains(t.nodeType==1?t:t.parentNode):i==t))l=!1;else return a}}getDesc(t){let n=t.pmViewDesc;for(let l=n;l;l=l.parent)if(l==this)return n}posFromDOM(t,n,l){for(let r=t;r;r=r.parentNode){let a=this.getDesc(r);if(a)return a.localPosFromDOM(t,n,l)}return-1}descAt(t){for(let n=0,l=0;n<this.children.length;n++){let r=this.children[n],a=l+r.size;if(l==t&&a!=l){for(;!r.border&&r.children.length;)for(let i=0;i<r.children.length;i++){let s=r.children[i];if(s.size){r=s;break}}return r}if(t<a)return r.descAt(t-l-r.border);l=a}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let l=0,r=0;for(let a=0;l<this.children.length;l++){let i=this.children[l],s=a+i.size;if(s>t||i instanceof hp){r=t-a;break}a=s}if(r)return this.children[l].domFromPos(r-this.children[l].border,n);for(let a;l&&!(a=this.children[l-1]).size&&a instanceof dp&&a.side>=0;l--);if(n<=0){let a,i=!0;for(;a=l?this.children[l-1]:null,!(!a||a.dom.parentNode==this.contentDOM);l--,i=!1);return a&&n&&i&&!a.border&&!a.domAtom?a.domFromPos(a.size,n):{node:this.contentDOM,offset:a?Ze(a.dom)+1:0}}else{let a,i=!0;for(;a=l<this.children.length?this.children[l]:null,!(!a||a.dom.parentNode==this.contentDOM);l++,i=!1);return a&&i&&!a.border&&!a.domAtom?a.domFromPos(0,n):{node:this.contentDOM,offset:a?Ze(a.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,l=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,a=-1;for(let i=l,s=0;;s++){let o=this.children[s],u=i+o.size;if(r==-1&&t<=u){let c=i+o.border;if(t>=c&&n<=u-o.border&&o.node&&o.contentDOM&&this.contentDOM.contains(o.contentDOM))return o.parseRange(t,n,c);t=i;for(let d=s;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=Ze(f.dom)+1;break}t-=f.size}r==-1&&(r=0)}if(r>-1&&(u>n||s==this.children.length-1)){n=u;for(let c=s+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){a=Ze(d.dom);break}n+=d.size}a==-1&&(a=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:t,to:n,fromOffset:r,toOffset:a}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:l}=this.domFromPos(t,0);if(n.nodeType!=1||l==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[l]}setSelection(t,n,l,r=!1){let a=Math.min(t,n),i=Math.max(t,n);for(let h=0,m=0;h<this.children.length;h++){let v=this.children[h],g=m+v.size;if(a>m&&i<g)return v.setSelection(t-m-v.border,n-m-v.border,l,r);m=g}let s=this.domFromPos(t,t?-1:1),o=n==t?s:this.domFromPos(n,n?-1:1),u=l.root.getSelection(),c=l.domSelectionRange(),d=!1;if((Mt||st)&&t==n){let{node:h,offset:m}=s;if(h.nodeType==3){if(d=!!(m&&h.nodeValue[m-1]==`
26
- `),d&&m==h.nodeValue.length)for(let v=h,g;v;v=v.parentNode){if(g=v.nextSibling){g.nodeName=="BR"&&(s=o={node:g.parentNode,offset:Ze(g)+1});break}let E=v.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let v=h.childNodes[m-1];d=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Mt&&c.focusNode&&c.focusNode!=o.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(r=!0)}if(!(r||d&&st)&&nl(s.node,s.offset,c.anchorNode,c.anchorOffset)&&nl(o.node,o.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||t==n)&&!(d&&Mt)){u.collapse(s.node,s.offset);try{t!=n&&u.extend(o.node,o.offset),f=!0}catch{}}if(!f){if(t>n){let m=s;s=o,o=m}let h=document.createRange();h.setEnd(o.node,o.offset),h.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let l=0,r=0;r<this.children.length;r++){let a=this.children[r],i=l+a.size;if(l==i?t<=i&&n>=l:t<i&&n>l){let s=l+a.border,o=i-a.border;if(t>=s&&n<=o){this.dirty=t==l||n==i?rl:cp,t==s&&n==o&&(a.contentLost||a.dom.parentNode!=this.contentDOM)?a.dirty=Kt:a.markDirty(t-s,n-s);return}else a.dirty=a.dom==a.contentDOM&&a.dom.parentNode==this.contentDOM&&!a.children.length?rl:Kt}l=i}this.dirty=rl}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let l=t==1?rl:cp;n.dirty<l&&(n.dirty=l)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class dp extends Hr{constructor(t,n,l,r){let a,i=n.type.toDOM;if(typeof i=="function"&&(i=i(l,()=>{if(!a)return r;if(a.parent)return a.parent.posBeforeChild(a)})),!n.type.spec.raw){if(i.nodeType!=1){let s=document.createElement("span");s.appendChild(i),i=s}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=n,this.widget=n,a=this}matchesWidget(t){return this.dirty==Lt&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.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 uS extends Hr{constructor(t,n,l,r){super(t,[],n,null),this.textDOM=l,this.text=r}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class al extends Hr{constructor(t,n,l,r,a){super(t,[],l,r),this.mark=n,this.spec=a}static create(t,n,l,r){let a=r.nodeViews[n.type.name],i=a&&a(n,r,l);return(!i||!i.dom)&&(i=el.renderSpec(document,n.type.spec.toDOM(n,l),null,n.attrs)),new al(t,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Kt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Kt&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Lt){let l=this.parent;for(;!l.node;)l=l.parent;l.dirty<this.dirty&&(l.dirty=this.dirty),this.dirty=Lt}}slice(t,n,l){let r=al.create(this.parent,this.mark,!0,l),a=this.children,i=this.size;n<i&&(a=io(a,n,i,l)),t>0&&(a=io(a,0,t,l));for(let s=0;s<a.length;s++)a[s].parent=r;return r.children=a,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kn extends Hr{constructor(t,n,l,r,a,i,s,o,u){super(t,[],a,i),this.node=n,this.outerDeco=l,this.innerDeco=r,this.nodeDOM=s}static create(t,n,l,r,a,i){let s=a.nodeViews[n.type.name],o,u=s&&s(n,a,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)},l,r),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=el.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=mp(c,l,n),u?o=new cS(t,n,l,r,c,d||null,f,u,a,i+1):n.isText?new qa(t,n,l,r,c,f,a):new kn(t,n,l,r,c,d||null,f,a,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let l=this.children[n];if(this.dom.contains(l.dom.parentNode)){t.contentElement=l.dom.parentNode;break}}t.contentElement||(t.getContent=()=>K.empty)}return t}matchesNode(t,n,l){return this.dirty==Lt&&t.eq(this.node)&&Wa(n,this.outerDeco)&&l.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let l=this.node.inlineContent,r=n,a=t.composing?this.localCompositionInfo(t,n):null,i=a&&a.pos>-1?a:null,s=a&&a.pos<0,o=new fS(this,i&&i.node,t);bS(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?o.syncToMarks(u.spec.marks,l,t,c):u.type.side>=0&&!d&&o.syncToMarks(c==this.node.childCount?Le.none:this.node.child(c).marks,l,t,c),o.placeWidget(u,t,r)},(u,c,d,f)=>{o.syncToMarks(u.marks,l,t,f);let h;o.findNodeMatch(u,c,d,f)||s&&t.state.selection.from>r&&t.state.selection.to<r+u.nodeSize&&(h=o.findIndexWithChild(a.node))>-1&&o.updateNodeAt(u,c,d,h,t)||o.updateNextNode(u,c,d,t,f,r)||o.addNode(u,c,d,t,r),r+=u.nodeSize}),o.syncToMarks([],l,t,0),this.node.isTextblock&&o.addTextblockHacks(),o.destroyRest(),(o.changed||this.dirty==rl)&&(i&&this.protectLocalComposition(t,i),pp(this.contentDOM,this.children,t),Fl&&mS(this.dom))}localCompositionInfo(t,n){let{from:l,to:r}=t.state.selection;if(!(t.state.selection instanceof be)||l<n||r>n+this.node.content.size)return null;let a=t.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let i=a.nodeValue,s=gS(this.node.content,i,l-n,r-n);return s<0?null:{node:a,pos:s,text:i}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:l,text:r}){if(this.getDesc(n))return;let a=n;for(;a.parentNode!=this.contentDOM;a=a.parentNode){for(;a.previousSibling;)a.parentNode.removeChild(a.previousSibling);for(;a.nextSibling;)a.parentNode.removeChild(a.nextSibling);a.pmViewDesc&&(a.pmViewDesc=void 0)}let i=new uS(this,a,n,r);t.input.compositionNodes.push(i),this.children=io(this.children,l,l+r.length,t,i)}update(t,n,l,r){return this.dirty==Kt||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,l,r),!0)}updateInner(t,n,l,r){this.updateOuterDeco(n),this.node=t,this.innerDeco=l,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Lt}updateOuterDeco(t){if(Wa(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,l=this.dom;this.dom=bp(this.dom,this.nodeDOM,ao(this.outerDeco,this.node,n),ao(t,this.node,n)),this.dom!=l&&(l.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}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 fp(e,t,n,l,r){mp(l,t,e);let a=new kn(void 0,e,t,n,l,l,l,r,0);return a.contentDOM&&a.updateChildren(r,0),a}class qa extends kn{constructor(t,n,l,r,a,i,s){super(t,n,l,r,a,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,l,r){return this.dirty==Kt||this.dirty!=Lt&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Lt||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=Lt,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,l){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,l)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,l){let r=this.node.cut(t,n),a=document.createTextNode(r.text);return new qa(this.parent,r,this.outerDeco,this.innerDeco,a,a,l)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Kt)}get domAtom(){return!1}isText(t){return this.node.text==t}}class hp extends Hr{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Lt&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cS extends kn{constructor(t,n,l,r,a,i,s,o,u,c){super(t,n,l,r,a,i,s,u,c),this.spec=o}update(t,n,l,r){if(this.dirty==Kt)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let a=this.spec.update(t,n,l);return a&&this.updateInner(t,n,l,r),a}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,l,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,l,r){this.spec.setSelection?this.spec.setSelection(t,n,l.root):super.setSelection(t,n,l,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function pp(e,t,n){let l=e.firstChild,r=!1;for(let a=0;a<t.length;a++){let i=t[a],s=i.dom;if(s.parentNode==e){for(;s!=l;)l=gp(l),r=!0;l=l.nextSibling}else r=!0,e.insertBefore(s,l);if(i instanceof al){let o=l?l.previousSibling:e.lastChild;pp(i.contentDOM,i.children,n),l=o?o.nextSibling:e.firstChild}}for(;l;)l=gp(l),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const Ur=function(e){e&&(this.nodeName=e)};Ur.prototype=Object.create(null);const il=[new Ur];function ao(e,t,n){if(e.length==0)return il;let l=n?il[0]:new Ur,r=[l];for(let a=0;a<e.length;a++){let i=e[a].type.attrs;if(i){i.nodeName&&r.push(l=new Ur(i.nodeName));for(let s in i){let o=i[s];o!=null&&(n&&r.length==1&&r.push(l=new Ur(t.isInline?"span":"div")),s=="class"?l.class=(l.class?l.class+" ":"")+o:s=="style"?l.style=(l.style?l.style+";":"")+o:s!="nodeName"&&(l[s]=o))}}}return r}function bp(e,t,n,l){if(n==il&&l==il)return t;let r=t;for(let a=0;a<l.length;a++){let i=l[a],s=n[a];if(a){let o;s&&s.nodeName==i.nodeName&&r!=e&&(o=r.parentNode)&&o.nodeName.toLowerCase()==i.nodeName||(o=document.createElement(i.nodeName),o.pmIsDeco=!0,o.appendChild(r),s=il[0]),r=o}dS(r,s||il[0],i)}return r}function dS(e,t,n){for(let l in t)l!="class"&&l!="style"&&l!="nodeName"&&!(l in n)&&e.removeAttribute(l);for(let l in n)l!="class"&&l!="style"&&l!="nodeName"&&n[l]!=t[l]&&e.setAttribute(l,n[l]);if(t.class!=n.class){let l=t.class?t.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let a=0;a<l.length;a++)r.indexOf(l[a])==-1&&e.classList.remove(l[a]);for(let a=0;a<r.length;a++)l.indexOf(r[a])==-1&&e.classList.add(r[a]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=l.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function mp(e,t,n){return bp(e,e,il,ao(t,n,e.nodeType!=1))}function Wa(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function gp(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class fS{constructor(t,n,l){this.lock=n,this.view=l,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=hS(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let l=t;l<n;l++)this.top.children[l].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,l,r){let a=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;a<s&&(a==i-1?this.top:this.stack[a+1<<1]).matchesMark(t[a])&&t[a].type.spec.spanning!==!1;)a++;for(;a<i;)this.destroyRest(),this.top.dirty=Lt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let o=-1,u=this.top.children.length;r<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(t[i])&&!this.isLocked(d.dom)){o=c;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let c=al.create(this.top,t[i],n,l);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,l,r){let a=-1,i;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,n,l))a=this.top.children.indexOf(i,this.index);else for(let s=this.index,o=Math.min(this.top.children.length,s+5);s<o;s++){let u=this.top.children[s];if(u.matchesNode(t,n,l)&&!this.preMatch.matched.has(u)){a=s;break}}return a<0?!1:(this.destroyBetween(this.index,a),this.index++,!0)}updateNodeAt(t,n,l,r,a){let i=this.top.children[r];return i.dirty==Kt&&i.dom==i.contentDOM&&(i.dirty=rl),i.update(t,n,l,a)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let l=t.pmViewDesc;if(l){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==l)return r}return-1}t=n}}updateNextNode(t,n,l,r,a,i){for(let s=this.index;s<this.top.children.length;s++){let o=this.top.children[s];if(o instanceof kn){let u=this.preMatch.matched.get(o);if(u!=null&&u!=a)return!1;let c=o.dom,d,f=this.isLocked(c)&&!(t.isText&&o.node&&o.node.isText&&o.nodeDOM.nodeValue==t.text&&o.dirty!=Kt&&Wa(n,o.outerDeco));if(!f&&o.update(t,n,l,r))return this.destroyBetween(this.index,s),o.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(o,t,n,l,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=rl,d.updateChildren(r,i+1),d.dirty=Lt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,l,r,a,i){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Wa(l,t.outerDeco)||!r.eq(t.innerDeco))return null;let s=kn.create(this.top,n,l,r,a,i);if(s.contentDOM){s.children=t.children,t.children=[];for(let o of s.children)o.parent=s}return t.destroy(),s}addNode(t,n,l,r,a){let i=kn.create(this.top,t,n,l,r,a);i.contentDOM&&i.updateChildren(r,a+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,n,l){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(t)&&(t==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let a=new dp(this.top,t,n,l);this.top.children.splice(this.index++,0,a),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof al;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof qa)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((st||et)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let l=document.createElement(t);t=="IMG"&&(l.className="ProseMirror-separator",l.alt=""),t=="BR"&&(l.className="ProseMirror-trailingBreak");let r=new hp(this.top,[],l,null);n!=this.top?n.children.push(r):n.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function hS(e,t){let n=t,l=n.children.length,r=e.childCount,a=new Map,i=[];e:for(;r>0;){let s;for(;;)if(l){let u=n.children[l-1];if(u instanceof al)n=u,l=u.children.length;else{s=u,l--;break}}else{if(n==t)break e;l=n.parent.children.indexOf(n),n=n.parent}let o=s.node;if(o){if(o!=e.child(r-1))break;--r,a.set(s,r),i.push(s)}}return{index:r,matched:a,matches:i.reverse()}}function pS(e,t){return e.type.side-t.type.side}function bS(e,t,n,l){let r=t.locals(e),a=0;if(r.length==0){for(let u=0;u<e.childCount;u++){let c=e.child(u);l(c,r,t.forChild(a,c),u),a+=c.nodeSize}return}let i=0,s=[],o=null;for(let u=0;;){let c,d;for(;i<r.length&&r[i].to==a;){let g=r[i++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(pS);for(let g=0;g<d.length;g++)n(d[g],u,!!o)}else n(c,u,!!o);let f,h;if(o)h=-1,f=o,o=null;else if(u<e.childCount)h=u,f=e.child(u++);else break;for(let g=0;g<s.length;g++)s[g].to<=a&&s.splice(g--,1);for(;i<r.length&&r[i].from<=a&&r[i].to>a;)s.push(r[i++]);let m=a+f.nodeSize;if(f.isText){let g=m;i<r.length&&r[i].from<g&&(g=r[i].from);for(let E=0;E<s.length;E++)s[E].to<g&&(g=s[E].to);g<m&&(o=f.cut(g-a),f=f.cut(0,g-a),m=g,h=-1)}else for(;i<r.length&&r[i].to<m;)i++;let v=f.isInline&&!f.isLeaf?s.filter(g=>!g.inline):s.slice();l(f,v,t.forChild(a,f),h),a=m}}function mS(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function gS(e,t,n,l){for(let r=0,a=0;r<e.childCount&&a<=l;){let i=e.child(r++),s=a;if(a+=i.nodeSize,!i.isText)continue;let o=i.text;for(;r<e.childCount;){let u=e.child(r++);if(a+=u.nodeSize,!u.isText)break;o+=u.text}if(a>=n){if(a>=l&&o.slice(l-t.length-s,l-s)==t)return l-t.length;let u=s<l?o.lastIndexOf(t,l-s-1):-1;if(u>=0&&u+t.length+s>=n)return s+u;if(n==l&&o.length>=l+t.length-s&&o.slice(l-s,l-s+t.length)==t)return l}}return-1}function io(e,t,n,l,r){let a=[];for(let i=0,s=0;i<e.length;i++){let o=e[i],u=s,c=s+=o.size;u>=n||c<=t?a.push(o):(u<t&&a.push(o.slice(0,t-u,l)),r&&(a.push(r),r=void 0),c>n&&a.push(o.slice(n-u,o.size,l)))}return a}function so(e,t=null){let n=e.domSelectionRange(),l=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),a=r&&r.size==0,i=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let s=l.resolve(i),o,u;if($a(n)){for(o=i;r&&!r.node;)r=r.parent;let d=r.node;if(r&&d.isAtom&&he.isSelectable(d)&&r.parent&&!(d.isInline&&q6(n.focusNode,n.focusOffset,r.dom))){let f=r.posBefore;u=new he(i==f?s:l.resolve(f))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=i,f=i;for(let h=0;h<n.rangeCount;h++){let m=n.getRangeAt(h);d=Math.min(d,e.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,e.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[o,i]=f==e.state.selection.anchor?[f,d]:[d,f],s=l.resolve(i)}else o=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(o<0)return null}let c=l.resolve(o);if(!u){let d=t=="pointer"||e.state.selection.head<s.pos&&!a?1:-1;u=uo(e,c,s,d)}return u}function vp(e){return e.editable?e.hasFocus():kp(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function an(e,t=!1){let n=e.state.selection;if(Cp(e,n),!!vp(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&et){let l=e.domSelectionRange(),r=e.domObserver.currentSelection;if(l.anchorNode&&r.anchorNode&&nl(l.anchorNode,l.anchorOffset,r.anchorNode,r.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)yS(e);else{let{anchor:l,head:r}=n,a,i;yp&&!(n instanceof be)&&(n.$from.parent.inlineContent||(a=Ep(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=Ep(e,n.to))),e.docView.setSelection(l,r,e,t),yp&&(a&&Tp(a),i&&Tp(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vS(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const yp=st||et&&Xh<63;function Ep(e,t){let{node:n,offset:l}=e.docView.domFromPos(t,0),r=l<n.childNodes.length?n.childNodes[l]:null,a=l?n.childNodes[l-1]:null;if(st&&r&&r.contentEditable=="false")return oo(r);if((!r||r.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(r)return oo(r);if(a)return oo(a)}}function oo(e){return e.contentEditable="true",st&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Tp(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function vS(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),l=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=l||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!vp(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function yS(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,l=n.nodeName=="IMG";l?t.collapse(n.parentNode,Ze(n)+1):t.collapse(n,0),!l&&!e.state.selection.visible&&yt&&Sn<=11&&(n.disabled=!0,n.disabled=!1)}function Cp(e,t){if(t instanceof he){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Sp(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Sp(e)}function Sp(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function uo(e,t,n,l){return e.someProp("createSelectionBetween",r=>r(e,t,n))||be.between(t,n,l)}function xp(e){return e.editable&&!e.hasFocus()?!1:kp(e)}function kp(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ES(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return nl(t.node,t.offset,n.anchorNode,n.anchorOffset)}function co(e,t){let{$anchor:n,$head:l}=e.selection,r=t>0?n.max(l):n.min(l),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&Te.findFrom(a,t)}function An(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ap(e,t,n){let l=e.state.selection;if(l instanceof be)if(n.indexOf("s")>-1){let{$head:r}=l,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let i=e.state.doc.resolve(r.pos+a.nodeSize*(t<0?-1:1));return An(e,new be(l.$anchor,i))}else if(l.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=co(e.state,t);return r&&r instanceof he?An(e,r):!1}else if(!(Dt&&n.indexOf("m")>-1)){let r=l.$head,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,i;if(!a||a.isText)return!1;let s=t<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(i=e.docView.descAt(s))&&!i.contentDOM?he.isSelectable(a)?An(e,new he(t<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Rr?An(e,new be(e.state.doc.resolve(t<0?s:s+a.nodeSize))):!1:!1}}else return!1;else{if(l instanceof he&&l.node.isInline)return An(e,new be(t>0?l.$to:l.$from));{let r=co(e.state,t);return r?An(e,r):!1}}}function Ya(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function zr(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Ul(e,t){return t<0?TS(e):CS(e)}function TS(e){let t=e.domSelectionRange(),n=t.focusNode,l=t.focusOffset;if(!n)return;let r,a,i=!1;for(Mt&&n.nodeType==1&&l<Ya(n)&&zr(n.childNodes[l],-1)&&(i=!0);;)if(l>0){if(n.nodeType!=1)break;{let s=n.childNodes[l-1];if(zr(s,-1))r=n,a=--l;else if(s.nodeType==3)n=s,l=n.nodeValue.length;else break}}else{if(Np(n))break;{let s=n.previousSibling;for(;s&&zr(s,-1);)r=n.parentNode,a=Ze(s),s=s.previousSibling;if(s)n=s,l=Ya(n);else{if(n=n.parentNode,n==e.dom)break;l=0}}}i?fo(e,n,l):r&&fo(e,r,a)}function CS(e){let t=e.domSelectionRange(),n=t.focusNode,l=t.focusOffset;if(!n)return;let r=Ya(n),a,i;for(;;)if(l<r){if(n.nodeType!=1)break;let s=n.childNodes[l];if(zr(s,1))a=n,i=++l;else break}else{if(Np(n))break;{let s=n.nextSibling;for(;s&&zr(s,1);)a=s.parentNode,i=Ze(s)+1,s=s.nextSibling;if(s)n=s,l=0,r=Ya(n);else{if(n=n.parentNode,n==e.dom)break;l=r=0}}}a&&fo(e,a,i)}function Np(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function SS(e,t){for(;e&&t==e.childNodes.length&&!Br(e);)t=Ze(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function xS(e,t){for(;e&&!t&&!Br(e);)t=Ze(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function fo(e,t,n){if(t.nodeType!=3){let a,i;(i=SS(t,n))?(t=i,n=0):(a=xS(t,n))&&(t=a,n=a.nodeValue.length)}let l=e.domSelection();if(!l)return;if($a(l)){let a=document.createRange();a.setEnd(t,n),a.setStart(t,n),l.removeAllRanges(),l.addRange(a)}else l.extend&&l.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&an(e)},50)}function wp(e,t){let n=e.state.doc.resolve(t);if(!(et||Jh)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let a=e.coordsAtPos(t-1),i=(a.top+a.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(a.left-r.left)>1)return a.left<r.left?"ltr":"rtl"}if(t<n.end()){let a=e.coordsAtPos(t+1),i=(a.top+a.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Ip(e,t,n){let l=e.state.selection;if(l instanceof be&&!l.empty||n.indexOf("s")>-1||Dt&&n.indexOf("m")>-1)return!1;let{$from:r,$to:a}=l;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let i=co(e.state,t);if(i&&i instanceof he)return An(e,i)}if(!r.parent.inlineContent){let i=t<0?r:a,s=l instanceof At?Te.near(i,t):Te.findFrom(i,t);return s?An(e,s):!1}return!1}function _p(e,t){if(!(e.state.selection instanceof be))return!0;let{$head:n,$anchor:l,empty:r}=e.state.selection;if(!n.sameParent(l))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let i=e.state.tr;return t<0?i.delete(n.pos-a.nodeSize,n.pos):i.delete(n.pos,n.pos+a.nodeSize),e.dispatch(i),!0}return!1}function Op(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function kS(e){if(!st||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let l=t.firstChild;Op(e,l,"true"),setTimeout(()=>Op(e,l,"false"),20)}return!1}function AS(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function NS(e,t){let n=t.keyCode,l=AS(t);if(n==8||Dt&&n==72&&l=="c")return _p(e,-1)||Ul(e,-1);if(n==46&&!t.shiftKey||Dt&&n==68&&l=="c")return _p(e,1)||Ul(e,1);if(n==13||n==27)return!0;if(n==37||Dt&&n==66&&l=="c"){let r=n==37?wp(e,e.state.selection.from)=="ltr"?-1:1:-1;return Ap(e,r,l)||Ul(e,r)}else if(n==39||Dt&&n==70&&l=="c"){let r=n==39?wp(e,e.state.selection.from)=="ltr"?1:-1:1;return Ap(e,r,l)||Ul(e,r)}else{if(n==38||Dt&&n==80&&l=="c")return Ip(e,-1,l)||Ul(e,-1);if(n==40||Dt&&n==78&&l=="c")return kS(e)||Ip(e,1,l)||Ul(e,1);if(l==(Dt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ho(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:l,openStart:r,openEnd:a}=t;for(;r>1&&a>1&&l.childCount==1&&l.firstChild.childCount==1;){r--,a--;let h=l.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),l=h.content}let i=e.someProp("clipboardSerializer")||el.fromSchema(e.state.schema),s=Hp(),o=s.createElement("div");o.appendChild(i.serializeFragment(l,{document:s}));let u=o.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Rp[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let m=s.createElement(c[h]);for(;o.firstChild;)m.appendChild(o.firstChild);o.appendChild(m),d++}u=o.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${a}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
25
+ `))}})}function S6(e,t,n){let l=e.resolve(t),r=l.index();return l.parent.canReplaceWith(r,r+1,n)}function x6(e,t,n,l,r){let a=e.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");n||(n=a.type);let i=n.create(l,null,r||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,i);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ke(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new ae(K.from(i),0,0),1,!0))}function tn(e,t,n=1,l){let r=e.resolve(t),a=r.depth-n,i=l&&l[l.length-1]||r.parent;if(a<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!i.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,c=n-2;u>a;u--,c--){let d=r.node(u),f=r.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=l&&l[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let v=l&&l[c]||d;if(!d.canReplace(f+1,d.childCount)||!v.type.validContent(h))return!1}let s=r.indexAfter(a),o=l&&l[0];return r.node(a).canReplaceWith(s,s,o?o.type:r.node(a+1).type)}function k6(e,t,n=1,l){let r=e.doc.resolve(t),a=K.empty,i=K.empty;for(let s=r.depth,o=r.depth-n,u=n-1;s>o;s--,u--){a=K.from(r.node(s).copy(a));let c=l&&l[u];i=K.from(c?c.type.create(c.attrs,i):r.node(s).copy(i))}e.step(new qe(t,t,new ae(a.append(i),n,n),!0))}function Tn(e,t){let n=e.resolve(t),l=n.index();return Lh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(l,l+1)}function A6(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:l}=e.type.schema;for(let r=0;r<t.childCount;r++){let a=t.child(r),i=a.type==l?e.type.schema.nodes.text:a.type;if(n=n.matchType(i),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Lh(e,t){return!!(e&&t&&!e.isLeaf&&A6(e,t))}function Ha(e,t,n=-1){let l=e.resolve(t);for(let r=l.depth;;r--){let a,i,s=l.index(r);if(r==l.depth?(a=l.nodeBefore,i=l.nodeAfter):n>0?(a=l.node(r+1),s++,i=l.node(r).maybeChild(s)):(a=l.node(r).maybeChild(s-1),i=l.node(r+1)),a&&!a.isTextblock&&Lh(a,i)&&l.node(r).canReplace(s,s+1))return t;if(r==0)break;t=n<0?l.before(r):l.after(r)}}function N6(e,t,n){let l=null,{linebreakReplacement:r}=e.doc.type.schema,a=e.doc.resolve(t-n),i=a.node().type;if(r&&i.inlineContent){let c=i.whitespace=="pre",d=!!i.contentMatch.matchType(r);c&&!d?l=!1:!c&&d&&(l=!0)}let s=e.steps.length;if(l===!1){let c=e.doc.resolve(t+n);Dh(e,c.node(),c.before(),s)}i.inlineContent&&Ws(e,t+n-1,i,a.node().contentMatchAt(a.index()),l==null);let o=e.mapping.slice(s),u=o.map(t-n);if(e.step(new qe(u,o.map(t+n,-1),ae.empty,!0)),l===!0){let c=e.doc.resolve(u);Mh(e,c.node(),c.before(),e.steps.length)}return e}function w6(e,t,n){let l=e.resolve(t);if(l.parent.canReplaceWith(l.index(),l.index(),n))return t;if(l.parentOffset==0)for(let r=l.depth-1;r>=0;r--){let a=l.index(r);if(l.node(r).canReplaceWith(a,a,n))return l.before(r+1);if(a>0)return null}if(l.parentOffset==l.parent.content.size)for(let r=l.depth-1;r>=0;r--){let a=l.indexAfter(r);if(l.node(r).canReplaceWith(a,a,n))return l.after(r+1);if(a<l.node(r).childCount)return null}return null}function Ph(e,t,n){let l=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let a=0;a<n.openStart;a++)r=r.firstChild.content;for(let a=1;a<=(n.openStart==0&&n.size?2:1);a++)for(let i=l.depth;i>=0;i--){let s=i==l.depth?0:l.pos<=(l.start(i+1)+l.end(i+1))/2?-1:1,o=l.index(i)+(s>0?1:0),u=l.node(i),c=!1;if(a==1)c=u.canReplace(o,o,r);else{let d=u.contentMatchAt(o).findWrapping(r.firstChild.type);c=d&&u.canReplaceWith(o,o,d[0])}if(c)return s==0?l.pos:s<0?l.before(i+1):l.after(i+1)}return null}function Ua(e,t,n=t,l=ae.empty){if(t==n&&!l.size)return null;let r=e.resolve(t),a=e.resolve(n);return Bh(r,a,l)?new qe(t,n,l):new I6(r,a,l).fit()}function Bh(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class I6{constructor(t,n,l){this.$from=t,this.$to=n,this.unplaced=l,this.frontier=[],this.placed=K.empty;for(let r=0;r<=t.depth;r++){let a=t.node(r);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=K.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,l=this.$from,r=this.close(t<0?this.$to:l.doc.resolve(t));if(!r)return null;let a=this.placed,i=l.depth,s=r.depth;for(;i&&s&&a.childCount==1;)a=a.firstChild.content,i--,s--;let o=new ae(a,i,s);return t>-1?new Ke(l.pos,t,this.$to.pos,this.$to.end(),o,n):o.size||l.pos!=this.$to.pos?new qe(l.pos,r.pos,o):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,l=0,r=this.unplaced.openEnd;l<t;l++){let a=n.firstChild;if(n.childCount>1&&(r=0),a.type.spec.isolating&&r<=l){t=l;break}n=a.content}for(let n=1;n<=2;n++)for(let l=n==1?t:this.unplaced.openStart;l>=0;l--){let r,a=null;l?(a=js(this.unplaced.content,l-1).firstChild,r=a.content):r=this.unplaced.content;let i=r.firstChild;for(let s=this.depth;s>=0;s--){let{type:o,match:u}=this.frontier[s],c,d=null;if(n==1&&(i?u.matchType(i.type)||(d=u.fillBefore(K.from(i),!1)):a&&o.compatibleContent(a.type)))return{sliceDepth:l,frontierDepth:s,parent:a,inject:d};if(n==2&&i&&(c=u.findWrapping(i.type)))return{sliceDepth:l,frontierDepth:s,parent:a,wrap:c};if(a&&u.matchType(a.type))break}}}openMore(){let{content:t,openStart:n,openEnd:l}=this.unplaced,r=js(t,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(l,r.size+n>=t.size-l?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:l}=this.unplaced,r=js(t,n);if(r.childCount<=1&&n>0){let a=t.size-n<=n+r.size;this.unplaced=new ae(Mr(t,n-1,1),n-1,a?n-1:l)}else this.unplaced=new ae(Mr(t,n,1),n,l)}placeNodes({sliceDepth:t,frontierDepth:n,parent:l,inject:r,wrap:a}){for(;this.depth>n;)this.closeFrontierNode();if(a)for(let v=0;v<a.length;v++)this.openFrontierNode(a[v]);let i=this.unplaced,s=l?l.content:i.content,o=i.openStart-t,u=0,c=[],{match:d,type:f}=this.frontier[n];if(r){for(let v=0;v<r.childCount;v++)c.push(r.child(v));d=d.matchFragment(r)}let h=s.size+t-(i.content.size-i.openEnd);for(;u<s.childCount;){let v=s.child(u),g=d.matchType(v.type);if(!g)break;u++,(u>1||o==0||v.content.size)&&(d=g,c.push(Rh(v.mark(f.allowedMarks(v.marks)),u==1?o:0,u==s.childCount?h:-1)))}let m=u==s.childCount;m||(h=-1),this.placed=Dr(this.placed,n,K.from(c)),this.frontier[n].match=d,m&&h<0&&l&&l.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,g=s;v<h;v++){let E=g.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),g=E.content}this.unplaced=m?t==0?ae.empty:new ae(Mr(i.content,t-1,1),t-1,h<0?i.openEnd:t-1):new ae(Mr(i.content,t,u),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Ks(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:l}=this.$to,r=this.$to.after(l);for(;l>1&&r==this.$to.end(--l);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:l,type:r}=this.frontier[n],a=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),i=Ks(t,n,r,l,a);if(i){for(let s=n-1;s>=0;s--){let{match:o,type:u}=this.frontier[s],c=Ks(t,s,u,o,!0);if(!c||c.childCount)continue e}return{depth:n,fit:i,move:a?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Dr(this.placed,n.depth,n.fit)),t=n.move;for(let l=n.depth+1;l<=t.depth;l++){let r=t.node(l),a=r.type.contentMatch.fillBefore(r.content,!0,t.index(l));this.openFrontierNode(r.type,r.attrs,a)}return t}openFrontierNode(t,n=null,l){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Dr(this.placed,this.depth,K.from(t.create(n,l))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=Dr(this.placed,this.frontier.length,n))}}function Mr(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Mr(e.firstChild.content,t-1,n)))}function Dr(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Dr(e.lastChild.content,t-1,n)))}function js(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Rh(e,t,n){if(t<=0)return e;let l=e.content;return t>1&&(l=l.replaceChild(0,Rh(l.firstChild,t-1,l.childCount==1?n-1:0))),t>0&&(l=e.type.contentMatch.fillBefore(l).append(l),n<=0&&(l=l.append(e.type.contentMatch.matchFragment(l).fillBefore(K.empty,!0)))),e.copy(l)}function Ks(e,t,n,l,r){let a=e.node(t),i=r?e.indexAfter(t):e.index(t);if(i==a.childCount&&!n.compatibleContent(a.type))return null;let s=l.fillBefore(a.content,!0,i);return s&&!_6(n,a.content,i)?s:null}function _6(e,t,n){for(let l=n;l<t.childCount;l++)if(!e.allowsMarks(t.child(l).marks))return!0;return!1}function O6(e){return e.spec.defining||e.spec.definingForContent}function M6(e,t,n,l){if(!l.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),a=e.doc.resolve(n);if(Bh(r,a,l))return e.step(new qe(t,n,l));let i=Hh(r,a);i[i.length-1]==0&&i.pop();let s=-(r.depth+1);i.unshift(s);for(let f=r.depth,h=r.pos-1;f>0;f--,h--){let m=r.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;i.indexOf(f)>-1?s=f:r.before(f)==h&&i.splice(1,0,-f)}let o=i.indexOf(s),u=[],c=l.openStart;for(let f=l.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==l.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=O6(h.type);if(m&&!h.sameMarkup(r.node(Math.abs(s)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=l.openStart;f>=0;f--){let h=(f+c+1)%(l.openStart+1),m=u[h];if(m)for(let v=0;v<i.length;v++){let g=i[(v+o)%i.length],E=!0;g<0&&(E=!1,g=-g);let N=r.node(g-1),A=r.index(g-1);if(N.canReplaceWith(A,A,m.type,m.marks))return e.replace(r.before(g),E?a.after(g):n,new ae(Fh(l.content,0,l.openStart,h),h,l.openEnd))}}let d=e.steps.length;for(let f=i.length-1;f>=0&&(e.replace(t,n,l),!(e.steps.length>d));f--){let h=i[f];h<0||(t=r.before(h),n=a.after(h))}}function Fh(e,t,n,l,r){if(t<n){let a=e.firstChild;e=e.replaceChild(0,a.copy(Fh(a.content,t+1,n,l,a)))}if(t>l){let a=r.contentMatchAt(0),i=a.fillBefore(e).append(e);e=i.append(a.matchFragment(i).fillBefore(K.empty,!0))}return e}function D6(e,t,n,l){if(!l.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=w6(e.doc,t,l.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new ae(K.from(l),0,0))}function L6(e,t,n){let l=e.doc.resolve(t),r=e.doc.resolve(n);if(l.parent.isTextblock&&r.parent.isTextblock&&l.start()!=r.start()&&l.parentOffset==0&&r.parentOffset==0){let i=l.sharedDepth(n),s=!1;for(let o=l.depth;o>i;o--)l.node(o).type.spec.isolating&&(s=!0);for(let o=r.depth;o>i;o--)r.node(o).type.spec.isolating&&(s=!0);if(!s){for(let o=l.depth;o>0&&t==l.start(o);o--)t=l.before(o);for(let o=r.depth;o>0&&n==r.start(o);o--)n=r.before(o);l=e.doc.resolve(t),r=e.doc.resolve(n)}}let a=Hh(l,r);for(let i=0;i<a.length;i++){let s=a[i],o=i==a.length-1;if(o&&s==0||l.node(s).type.contentMatch.validEnd)return e.delete(l.start(s),r.end(s));if(s>0&&(o||l.node(s-1).canReplace(l.index(s-1),r.indexAfter(s-1))))return e.delete(l.before(s),r.after(s))}for(let i=1;i<=l.depth&&i<=r.depth;i++)if(t-l.start(i)==l.depth-i&&n>l.end(i)&&r.end(i)-n!=r.depth-i&&l.start(i-1)==r.start(i-1)&&l.node(i-1).canReplace(l.index(i-1),r.index(i-1)))return e.delete(l.before(i),n);e.delete(t,n)}function Hh(e,t){let n=[],l=Math.min(e.depth,t.depth);for(let r=l;r>=0;r--){let a=e.start(r);if(a<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(a==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==a-1)&&n.push(r)}return n}class Dl extends it{constructor(t,n,l){super(),this.pos=t,this.attr=n,this.value=l}apply(t){let n=t.nodeAt(this.pos);if(!n)return $e.fail("No node at attribute step's position");let l=Object.create(null);for(let a in n.attrs)l[a]=n.attrs[a];l[this.attr]=this.value;let r=n.type.create(l,null,n.marks);return $e.fromReplace(t,this.pos,this.pos+1,new ae(K.from(r),0,n.isLeaf?0:1))}getMap(){return kt.empty}invert(t){return new Dl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Dl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Dl(n.pos,n.attr,n.value)}}it.jsonID("attr",Dl);class Lr extends it{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let l=t.type.create(n,t.content,t.marks);return $e.ok(l)}getMap(){return kt.empty}invert(t){return new Lr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Lr(n.attr,n.value)}}it.jsonID("docAttr",Lr);let Ll=class extends Error{};Ll=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Ll.prototype=Object.create(Error.prototype),Ll.prototype.constructor=Ll,Ll.prototype.name="TransformError";class P6{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Or}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ll(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let l=0;l<this.mapping.maps.length;l++){let r=this.mapping.maps[l];l&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((a,i,s,o)=>{t=Math.min(t,s),n=Math.max(n,o)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,l=ae.empty){let r=Ua(this.doc,t,n,l);return r&&this.step(r),this}replaceWith(t,n,l){return this.replace(t,n,new ae(K.from(l),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,l){return M6(this,t,n,l),this}replaceRangeWith(t,n,l){return D6(this,t,n,l),this}deleteRange(t,n){return L6(this,t,n),this}lift(t,n){return v6(this,t,n),this}join(t,n=1){return N6(this,t,n),this}wrap(t,n){return T6(this,t,n),this}setBlockType(t,n=t,l,r=null){return C6(this,t,n,l,r),this}setNodeMarkup(t,n,l=null,r){return x6(this,t,n,l,r),this}setNodeAttribute(t,n,l){return this.step(new Dl(t,n,l)),this}setDocAttribute(t,n){return this.step(new Lr(t,n)),this}addNodeMark(t,n){return this.step(new En(t,n)),this}removeNodeMark(t,n){let l=this.doc.nodeAt(t);if(!l)throw new RangeError("No node at position "+t);if(n instanceof Le)n.isInSet(l.marks)&&this.step(new tl(t,n));else{let r=l.marks,a,i=[];for(;a=n.isInSet(r);)i.push(new tl(t,a)),r=a.removeFromSet(r);for(let s=i.length-1;s>=0;s--)this.step(i[s])}return this}split(t,n=1,l){return k6(this,t,n,l),this}addMark(t,n,l){return b6(this,t,n,l),this}removeMark(t,n,l){return m6(this,t,n,l),this}clearIncompatible(t,n,l){return Ws(this,t,n,l),this}}const Gs=Object.create(null);class Ce{constructor(t,n,l){this.$anchor=t,this.$head=n,this.ranges=l||[new B6(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let l=n.content.lastChild,r=null;for(let s=0;s<n.openEnd;s++)r=l,l=l.lastChild;let a=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:u}=i[s],c=t.mapping.slice(a);t.replaceRange(c.map(o.pos),c.map(u.pos),s?ae.empty:n),s==0&&Vh(t,a,(l?l.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let l=t.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:i,$to:s}=r[a],o=t.mapping.slice(l),u=o.map(i.pos),c=o.map(s.pos);a?t.deleteRange(u,c):(t.replaceRangeWith(u,c,n),Vh(t,l,n.isInline?-1:1))}}static findFrom(t,n,l=!1){let r=t.parent.inlineContent?new be(t):Pl(t.node(0),t.parent,t.pos,t.index(),n,l);if(r)return r;for(let a=t.depth-1;a>=0;a--){let i=n<0?Pl(t.node(0),t.node(a),t.before(a+1),t.index(a),n,l):Pl(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,l);if(i)return i}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new At(t.node(0))}static atStart(t){return Pl(t,t,0,0,1)||new At(t)}static atEnd(t){return Pl(t,t,t.content.size,t.childCount,-1)||new At(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let l=Gs[n.type];if(!l)throw new RangeError(`No selection type ${n.type} defined`);return l.fromJSON(t,n)}static jsonID(t,n){if(t in Gs)throw new RangeError("Duplicate use of selection JSON ID "+t);return Gs[t]=n,n.prototype.jsonID=t,n}getBookmark(){return be.between(this.$anchor,this.$head).getBookmark()}}Ce.prototype.visible=!0;class B6{constructor(t,n){this.$from=t,this.$to=n}}let Uh=!1;function zh(e){!Uh&&!e.parent.inlineContent&&(Uh=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class be extends Ce{constructor(t,n=t){zh(t),zh(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let l=t.resolve(n.map(this.head));if(!l.parent.inlineContent)return Ce.near(l);let r=t.resolve(n.map(this.anchor));return new be(r.parent.inlineContent?r:l,l)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let l=this.$from.marksAcross(this.$to);l&&t.ensureMarks(l)}}eq(t){return t instanceof be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new za(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,l=n){let r=t.resolve(n);return new this(r,l==n?r:t.resolve(l))}static between(t,n,l){let r=t.pos-n.pos;if((!l||r)&&(l=r>=0?1:-1),!n.parent.inlineContent){let a=Ce.findFrom(n,l,!0)||Ce.findFrom(n,-l,!0);if(a)n=a.$head;else return Ce.near(n,l)}return t.parent.inlineContent||(r==0?t=n:(t=(Ce.findFrom(t,-l,!0)||Ce.findFrom(t,l,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new be(t,n)}}Ce.jsonID("text",be);class za{constructor(t,n){this.anchor=t,this.head=n}map(t){return new za(t.map(this.anchor),t.map(this.head))}resolve(t){return be.between(t.resolve(this.anchor),t.resolve(this.head))}}class he extends Ce{constructor(t){let n=t.nodeAfter,l=t.node(0).resolve(t.pos+n.nodeSize);super(t,l),this.node=n}map(t,n){let{deleted:l,pos:r}=n.mapResult(this.anchor),a=t.resolve(r);return l?Ce.near(a):new he(a)}content(){return new ae(K.from(this.node),0,0)}eq(t){return t instanceof he&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qs(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new he(t.resolve(n.anchor))}static create(t,n){return new he(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}he.prototype.visible=!1,Ce.jsonID("node",he);class Qs{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:l}=t.mapResult(this.anchor);return n?new za(l,l):new Qs(l)}resolve(t){let n=t.resolve(this.anchor),l=n.nodeAfter;return l&&he.isSelectable(l)?new he(n):Ce.near(n)}}class At extends Ce{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let l=Ce.atStart(t.doc);l.eq(t.selection)||t.setSelection(l)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new At(t)}map(t){return new At(t)}eq(t){return t instanceof At}getBookmark(){return R6}}Ce.jsonID("all",At);const R6={map(){return this},resolve(e){return new At(e)}};function Pl(e,t,n,l,r,a=!1){if(t.inlineContent)return be.create(e,n);for(let i=l-(r>0?0:1);r>0?i<t.childCount:i>=0;i+=r){let s=t.child(i);if(s.isAtom){if(!a&&he.isSelectable(s))return he.create(e,n-(r<0?s.nodeSize:0))}else{let o=Pl(e,s,n+r,r<0?s.childCount:0,r,a);if(o)return o}n+=s.nodeSize*r}return null}function Vh(e,t,n){let l=e.steps.length-1;if(l<t)return;let r=e.steps[l];if(!(r instanceof qe||r instanceof Ke))return;let a=e.mapping.maps[l],i;a.forEach((s,o,u,c)=>{i==null&&(i=c)}),e.setSelection(Ce.near(e.doc.resolve(i),n))}const $h=1,Va=2,qh=4;class F6 extends P6{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|$h)&~Va,this.storedMarks=null,this}get selectionSet(){return(this.updated&$h)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Va,this}ensureMarks(t){return Le.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Va)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Va,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let l=this.selection;return n&&(t=t.mark(this.storedMarks||(l.empty?l.$from.marks():l.$from.marksAcross(l.$to)||Le.none))),l.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,l){let r=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(l==null&&(l=n),!t)return this.deleteRange(n,l);let a=this.storedMarks;if(!a){let i=this.doc.resolve(n);a=l==n?i.marks():i.marksAcross(this.doc.resolve(l))}return this.replaceRangeWith(n,l,r.text(t,a)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Ce.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qh,this}get scrolledIntoView(){return(this.updated&qh)>0}}function Wh(e,t){return!t||!e?e:e.bind(t)}class Pr{constructor(t,n,l){this.name=t,this.init=Wh(n.init,l),this.apply=Wh(n.apply,l)}}const H6=[new Pr("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Pr("selection",{init(e,t){return e.selection||Ce.atStart(t.doc)},apply(e){return e.selection}}),new Pr("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,l){return l.selection.$cursor?e.storedMarks:null}}),new Pr("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Xs{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=H6.slice(),n&&n.forEach(l=>{if(this.pluginsByKey[l.key])throw new RangeError("Adding different instances of a keyed plugin ("+l.key+")");this.plugins.push(l),this.pluginsByKey[l.key]=l,l.spec.state&&this.fields.push(new Pr(l.key,l.spec.state,l))})}}class Bl{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let l=0;l<this.config.plugins.length;l++)if(l!=n){let r=this.config.plugins[l];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],l=this.applyInner(t),r=null;for(;;){let a=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let o=r?r[i].n:0,u=r?r[i].state:this,c=o<n.length&&s.spec.appendTransaction.call(s,o?n.slice(o):n,u,l);if(c&&l.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let d=0;d<this.config.plugins.length;d++)r.push(d<i?{state:l,n:n.length}:{state:this,n:0})}n.push(c),l=l.applyInner(c),a=!0}r&&(r[i]={state:l,n:n.length})}}if(!a)return{state:l,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Bl(this.config),l=this.config.fields;for(let r=0;r<l.length;r++){let a=l[r];n[a.name]=a.apply(t,this[a.name],this,n)}return n}get tr(){return new F6(this)}static create(t){let n=new Xs(t.doc?t.doc.type.schema:t.schema,t.plugins),l=new Bl(n);for(let r=0;r<n.fields.length;r++)l[n.fields[r].name]=n.fields[r].init(t,l);return l}reconfigure(t){let n=new Xs(this.schema,t.plugins),l=n.fields,r=new Bl(n);for(let a=0;a<l.length;a++){let i=l[a].name;r[i]=this.hasOwnProperty(i)?this[i]:l[a].init(t,r)}return r}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(l=>l.toJSON())),t&&typeof t=="object")for(let l in t){if(l=="doc"||l=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[l],a=r.spec.state;a&&a.toJSON&&(n[l]=a.toJSON.call(r,this[r.key]))}return n}static fromJSON(t,n,l){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new Xs(t.schema,t.plugins),a=new Bl(r);return r.fields.forEach(i=>{if(i.name=="doc")a.doc=vn.fromJSON(t.schema,n.doc);else if(i.name=="selection")a.selection=Ce.fromJSON(a.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(l)for(let s in l){let o=l[s],u=o.spec.state;if(o.key==i.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,s)){a[i.name]=u.fromJSON.call(o,t,n[s],a);return}}a[i.name]=i.init(t,a)}}),a}}function Yh(e,t,n){for(let l in e){let r=e[l];r instanceof Function?r=r.bind(t):l=="handleDOMEvents"&&(r=Yh(r,t,{})),n[l]=r}return n}class ft{constructor(t){this.spec=t,this.props={},t.props&&Yh(t.props,this,this.props),this.key=t.key?t.key.key:jh("plugin")}getState(t){return t[this.key]}}const Js=Object.create(null);function jh(e){return e in Js?e+"$"+ ++Js[e]:(Js[e]=0,e+"$")}class Rt{constructor(t="key"){this.key=jh(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Ze=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Rl=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Zs=null;const nn=function(e,t,n){let l=Zs||(Zs=document.createRange());return l.setEnd(e,n??e.nodeValue.length),l.setStart(e,t||0),l},U6=function(){Zs=null},nl=function(e,t,n,l){return n&&(Kh(e,t,n,l,-1)||Kh(e,t,n,l,1))},z6=/^(img|br|input|textarea|hr)$/i;function Kh(e,t,n,l,r){for(var a;;){if(e==n&&t==l)return!0;if(t==(r<0?0:Ot(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Br(e)||z6.test(e.nodeName)||e.contentEditable=="false")return!1;t=Ze(e)+(r<0?0:1),e=i}else if(e.nodeType==1){let i=e.childNodes[t+(r<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((a=i.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=r;else return!1;else e=i,t=r<0?Ot(e):0}else return!1}}function Ot(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function V6(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Ot(e)}else if(e.parentNode&&!Br(e))t=Ze(e),e=e.parentNode;else return null}}function $6(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Br(e))t=Ze(e)+1,e=e.parentNode;else return null}}function q6(e,t,n){for(let l=t==0,r=t==Ot(e);l||r;){if(e==n)return!0;let a=Ze(e);if(e=e.parentNode,!e)return!1;l=l&&a==0,r=r&&a==Ot(e)}}function Br(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const $a=function(e){return e.focusNode&&nl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ll(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function W6(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Y6(e,t,n){if(e.caretPositionFromPoint)try{let l=e.caretPositionFromPoint(t,n);if(l)return{node:l.offsetNode,offset:Math.min(Ot(l.offsetNode),l.offset)}}catch{}if(e.caretRangeFromPoint){let l=e.caretRangeFromPoint(t,n);if(l)return{node:l.startContainer,offset:Math.min(Ot(l.startContainer),l.startOffset)}}}const jt=typeof navigator<"u"?navigator:null,Gh=typeof document<"u"?document:null,Cn=jt&&jt.userAgent||"",eo=/Edge\/(\d+)/.exec(Cn),Qh=/MSIE \d/.exec(Cn),to=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Cn),yt=!!(Qh||to||eo),Sn=Qh?document.documentMode:to?+to[1]:eo?+eo[1]:0,Mt=!yt&&/gecko\/(\d+)/i.test(Cn);Mt&&+(/Firefox\/(\d+)/.exec(Cn)||[0,0])[1];const no=!yt&&/Chrome\/(\d+)/.exec(Cn),et=!!no,Xh=no?+no[1]:0,st=!yt&&!!jt&&/Apple Computer/.test(jt.vendor),Fl=st&&(/Mobile\/\w+/.test(Cn)||!!jt&&jt.maxTouchPoints>2),Dt=Fl||(jt?/Mac/.test(jt.platform):!1),Jh=jt?/Win/.test(jt.platform):!1,ln=/Android \d/.test(Cn),Rr=!!Gh&&"webkitFontSmoothing"in Gh.documentElement.style,j6=Rr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function K6(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rn(e,t){return typeof e=="number"?e:e[t]}function G6(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,l=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*l}}function Zh(e,t,n){let l=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,a=e.dom.ownerDocument;for(let i=n||e.dom;i;){if(i.nodeType!=1){i=Rl(i);continue}let s=i,o=s==a.body,u=o?K6(a):G6(s),c=0,d=0;if(t.top<u.top+rn(l,"top")?d=-(u.top-t.top+rn(r,"top")):t.bottom>u.bottom-rn(l,"bottom")&&(d=t.bottom-t.top>u.bottom-u.top?t.top+rn(r,"top")-u.top:t.bottom-u.bottom+rn(r,"bottom")),t.left<u.left+rn(l,"left")?c=-(u.left-t.left+rn(r,"left")):t.right>u.right-rn(l,"right")&&(c=t.right-u.right+rn(r,"right")),c||d)if(o)a.defaultView.scrollBy(c,d);else{let h=s.scrollLeft,m=s.scrollTop;d&&(s.scrollTop+=d),c&&(s.scrollLeft+=c);let v=s.scrollLeft-h,g=s.scrollTop-m;t={left:t.left-v,top:t.top-g,right:t.right-v,bottom:t.bottom-g}}let f=o?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(f))break;i=f=="absolute"?i.offsetParent:Rl(i)}}function Q6(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),l,r;for(let a=(t.left+t.right)/2,i=n+1;i<Math.min(innerHeight,t.bottom);i+=5){let s=e.root.elementFromPoint(a,i);if(!s||s==e.dom||!e.dom.contains(s))continue;let o=s.getBoundingClientRect();if(o.top>=n-20){l=s,r=o.top;break}}return{refDOM:l,refTop:r,stack:ep(e.dom)}}function ep(e){let t=[],n=e.ownerDocument;for(let l=e;l&&(t.push({dom:l,top:l.scrollTop,left:l.scrollLeft}),e!=n);l=Rl(l));return t}function X6({refDOM:e,refTop:t,stack:n}){let l=e?e.getBoundingClientRect().top:0;tp(n,l==0?0:l-t)}function tp(e,t){for(let n=0;n<e.length;n++){let{dom:l,top:r,left:a}=e[n];l.scrollTop!=r+t&&(l.scrollTop=r+t),l.scrollLeft!=a&&(l.scrollLeft=a)}}let Hl=null;function J6(e){if(e.setActive)return e.setActive();if(Hl)return e.focus(Hl);let t=ep(e);e.focus(Hl==null?{get preventScroll(){return Hl={preventScroll:!0},!0}}:void 0),Hl||(Hl=!1,tp(t,0))}function np(e,t){let n,l=2e8,r,a=0,i=t.top,s=t.top,o,u;for(let c=e.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=nn(c).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=i&&m.bottom>=s){i=Math.max(m.bottom,i),s=Math.min(m.top,s);let v=m.left>t.left?m.left-t.left:m.right<t.left?t.left-m.right:0;if(v<l){n=c,l=v,r=v&&n.nodeType==3?{left:m.right<t.left?m.right:m.left,top:t.top}:t,c.nodeType==1&&v&&(a=d+(t.left>=(m.left+m.right)/2?1:0));continue}}else m.top>t.top&&!o&&m.left<=t.left&&m.right>=t.left&&(o=c,u={left:Math.max(m.left,Math.min(m.right,t.left)),top:m.top});!n&&(t.left>=m.right&&t.top>=m.top||t.left>=m.left&&t.top>=m.bottom)&&(a=d+1)}}return!n&&o&&(n=o,r=u,l=0),n&&n.nodeType==3?Z6(n,r):!n||l&&n.nodeType==1?{node:e,offset:a}:np(n,r)}function Z6(e,t){let n=e.nodeValue.length,l=document.createRange(),r;for(let a=0;a<n;a++){l.setEnd(e,a+1),l.setStart(e,a);let i=xn(l,1);if(i.top!=i.bottom&&lo(t,i)){r={node:e,offset:a+(t.left>=(i.left+i.right)/2?1:0)};break}}return l.detach(),r||{node:e,offset:0}}function lo(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function eS(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function tS(e,t,n){let{node:l,offset:r}=np(t,n),a=-1;if(l.nodeType==1&&!l.firstChild){let i=l.getBoundingClientRect();a=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return e.docView.posFromDOM(l,r,a)}function nS(e,t,n,l){let r=-1;for(let a=t,i=!1;a!=e.dom;){let s=e.docView.nearestDesc(a,!0),o;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((o=s.dom.getBoundingClientRect()).width||o.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&o.left>l.left||o.top>l.top?r=s.posBefore:(!i&&o.right<l.left||o.bottom<l.top)&&(r=s.posAfter),i=!0),!s.contentDOM&&r<0&&!s.node.isText))return(s.node.isBlock?l.top<(o.top+o.bottom)/2:l.left<(o.left+o.right)/2)?s.posBefore:s.posAfter;a=s.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,n,-1)}function lp(e,t,n){let l=e.childNodes.length;if(l&&n.top<n.bottom)for(let r=Math.max(0,Math.min(l-1,Math.floor(l*(t.top-n.top)/(n.bottom-n.top))-2)),a=r;;){let i=e.childNodes[a];if(i.nodeType==1){let s=i.getClientRects();for(let o=0;o<s.length;o++){let u=s[o];if(lo(t,u))return lp(i,t,u)}}if((a=(a+1)%l)==r)break}return e}function lS(e,t){let n=e.dom.ownerDocument,l,r=0,a=Y6(n,t.left,t.top);a&&({node:l,offset:r}=a);let i=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!i||!e.dom.contains(i.nodeType!=1?i.parentNode:i)){let u=e.dom.getBoundingClientRect();if(!lo(t,u)||(i=lp(e.dom,t,u),!i))return null}if(st)for(let u=i;l&&u;u=Rl(u))u.draggable&&(l=void 0);if(i=eS(i,t),l){if(Mt&&l.nodeType==1&&(r=Math.min(r,l.childNodes.length),r<l.childNodes.length)){let c=l.childNodes[r],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&r++}let u;Rr&&r&&l.nodeType==1&&(u=l.childNodes[r-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&r--,l==e.dom&&r==l.childNodes.length-1&&l.lastChild.nodeType==1&&t.top>l.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(r==0||l.nodeType!=1||l.childNodes[r-1].nodeName!="BR")&&(s=nS(e,l,r,t))}s==null&&(s=tS(e,i,t));let o=e.docView.nearestDesc(i,!0);return{pos:s,inside:o?o.posAtStart-o.border:-1}}function rp(e){return e.top<e.bottom||e.left<e.right}function xn(e,t){let n=e.getClientRects();if(n.length){let l=n[t<0?0:n.length-1];if(rp(l))return l}return Array.prototype.find.call(n,rp)||e.getBoundingClientRect()}const rS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ap(e,t,n){let{node:l,offset:r,atom:a}=e.docView.domFromPos(t,n<0?-1:1),i=Rr||Mt;if(l.nodeType==3)if(i&&(rS.test(l.nodeValue)||(n<0?!r:r==l.nodeValue.length))){let o=xn(nn(l,r,r),n);if(Mt&&r&&/\s/.test(l.nodeValue[r-1])&&r<l.nodeValue.length){let u=xn(nn(l,r-1,r-1),-1);if(u.top==o.top){let c=xn(nn(l,r,r+1),-1);if(c.top!=o.top)return Fr(c,c.left<u.left)}}return o}else{let o=r,u=r,c=n<0?1:-1;return n<0&&!r?(u++,c=-1):n>=0&&r==l.nodeValue.length?(o--,c=1):n<0?o--:u++,Fr(xn(nn(l,o,u),c),c<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&r&&(n<0||r==Ot(l))){let o=l.childNodes[r-1];if(o.nodeType==1)return ro(o.getBoundingClientRect(),!1)}if(a==null&&r<Ot(l)){let o=l.childNodes[r];if(o.nodeType==1)return ro(o.getBoundingClientRect(),!0)}return ro(l.getBoundingClientRect(),n>=0)}if(a==null&&r&&(n<0||r==Ot(l))){let o=l.childNodes[r-1],u=o.nodeType==3?nn(o,Ot(o)-(i?0:1)):o.nodeType==1&&(o.nodeName!="BR"||!o.nextSibling)?o:null;if(u)return Fr(xn(u,1),!1)}if(a==null&&r<Ot(l)){let o=l.childNodes[r];for(;o.pmViewDesc&&o.pmViewDesc.ignoreForCoords;)o=o.nextSibling;let u=o?o.nodeType==3?nn(o,0,i?0:1):o.nodeType==1?o:null:null;if(u)return Fr(xn(u,-1),!0)}return Fr(xn(l.nodeType==3?nn(l):l,-n),n>=0)}function Fr(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ro(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ip(e,t,n){let l=e.state,r=e.root.activeElement;l!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{l!=t&&e.updateState(l),r!=e.dom&&r&&r.focus()}}function aS(e,t,n){let l=t.selection,r=n=="up"?l.$from:l.$to;return ip(e,t,()=>{let{node:a}=e.docView.domFromPos(r.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(a,!0);if(!s)break;if(s.node.isBlock){a=s.contentDOM||s.dom;break}a=s.dom.parentNode}let i=ap(e,r.pos,1);for(let s=a.firstChild;s;s=s.nextSibling){let o;if(s.nodeType==1)o=s.getClientRects();else if(s.nodeType==3)o=nn(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;u<o.length;u++){let c=o[u];if(c.bottom>c.top+1&&(n=="up"?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})}const iS=/[\u0590-\u08ac]/;function sS(e,t,n){let{$head:l}=t.selection;if(!l.parent.isTextblock)return!1;let r=l.parentOffset,a=!r,i=r==l.parent.content.size,s=e.domSelection();return s?!iS.test(l.parent.textContent)||!s.modify?n=="left"||n=="backward"?a:i:ip(e,t,()=>{let{focusNode:o,focusOffset:u,anchorNode:c,anchorOffset:d}=e.domSelectionRange(),f=s.caretBidiLevel;s.modify("move",n,"character");let h=l.depth?e.docView.domAfterPos(l.before()):e.dom,{focusNode:m,focusOffset:v}=e.domSelectionRange(),g=m&&!h.contains(m.nodeType==1?m:m.parentNode)||o==m&&u==v;try{s.collapse(c,d),o&&(o!=c||u!=d)&&s.extend&&s.extend(o,u)}catch{}return f!=null&&(s.caretBidiLevel=f),g}):l.pos==l.start()||l.pos==l.end()}let sp=null,op=null,up=!1;function oS(e,t,n){return sp==t&&op==n?up:(sp=t,op=n,up=n=="up"||n=="down"?aS(e,t,n):sS(e,t,n))}const Lt=0,cp=1,rl=2,Kt=3;class Hr{constructor(t,n,l,r){this.parent=t,this.children=n,this.dom=l,this.contentDOM=r,this.dirty=Lt,l.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,l){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,l=this.posAtStart;;n++){let r=this.children[n];if(r==t)return l;l+=r.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(t,n,l){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(l<0){let a,i;if(t==this.contentDOM)a=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.previousSibling}for(;a&&!((i=a.pmViewDesc)&&i.parent==this);)a=a.previousSibling;return a?this.posBeforeChild(i)+i.size:this.posAtStart}else{let a,i;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((i=a.pmViewDesc)&&i.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(i):this.posAtEnd}let r;if(t==this.dom&&this.contentDOM)r=n>Ze(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let a=t;;a=a.parentNode){if(a==this.dom){r=!1;break}if(a.previousSibling)break}if(r==null&&n==t.childNodes.length)for(let a=t;;a=a.parentNode){if(a==this.dom){r=!0;break}if(a.nextSibling)break}}return r??l>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let l=!0,r=t;r;r=r.parentNode){let a=this.getDesc(r),i;if(a&&(!n||a.node))if(l&&(i=a.nodeDOM)&&!(i.nodeType==1?i.contains(t.nodeType==1?t:t.parentNode):i==t))l=!1;else return a}}getDesc(t){let n=t.pmViewDesc;for(let l=n;l;l=l.parent)if(l==this)return n}posFromDOM(t,n,l){for(let r=t;r;r=r.parentNode){let a=this.getDesc(r);if(a)return a.localPosFromDOM(t,n,l)}return-1}descAt(t){for(let n=0,l=0;n<this.children.length;n++){let r=this.children[n],a=l+r.size;if(l==t&&a!=l){for(;!r.border&&r.children.length;)for(let i=0;i<r.children.length;i++){let s=r.children[i];if(s.size){r=s;break}}return r}if(t<a)return r.descAt(t-l-r.border);l=a}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let l=0,r=0;for(let a=0;l<this.children.length;l++){let i=this.children[l],s=a+i.size;if(s>t||i instanceof hp){r=t-a;break}a=s}if(r)return this.children[l].domFromPos(r-this.children[l].border,n);for(let a;l&&!(a=this.children[l-1]).size&&a instanceof dp&&a.side>=0;l--);if(n<=0){let a,i=!0;for(;a=l?this.children[l-1]:null,!(!a||a.dom.parentNode==this.contentDOM);l--,i=!1);return a&&n&&i&&!a.border&&!a.domAtom?a.domFromPos(a.size,n):{node:this.contentDOM,offset:a?Ze(a.dom)+1:0}}else{let a,i=!0;for(;a=l<this.children.length?this.children[l]:null,!(!a||a.dom.parentNode==this.contentDOM);l++,i=!1);return a&&i&&!a.border&&!a.domAtom?a.domFromPos(0,n):{node:this.contentDOM,offset:a?Ze(a.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,l=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,a=-1;for(let i=l,s=0;;s++){let o=this.children[s],u=i+o.size;if(r==-1&&t<=u){let c=i+o.border;if(t>=c&&n<=u-o.border&&o.node&&o.contentDOM&&this.contentDOM.contains(o.contentDOM))return o.parseRange(t,n,c);t=i;for(let d=s;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=Ze(f.dom)+1;break}t-=f.size}r==-1&&(r=0)}if(r>-1&&(u>n||s==this.children.length-1)){n=u;for(let c=s+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){a=Ze(d.dom);break}n+=d.size}a==-1&&(a=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:t,to:n,fromOffset:r,toOffset:a}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:l}=this.domFromPos(t,0);if(n.nodeType!=1||l==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[l]}setSelection(t,n,l,r=!1){let a=Math.min(t,n),i=Math.max(t,n);for(let h=0,m=0;h<this.children.length;h++){let v=this.children[h],g=m+v.size;if(a>m&&i<g)return v.setSelection(t-m-v.border,n-m-v.border,l,r);m=g}let s=this.domFromPos(t,t?-1:1),o=n==t?s:this.domFromPos(n,n?-1:1),u=l.root.getSelection(),c=l.domSelectionRange(),d=!1;if((Mt||st)&&t==n){let{node:h,offset:m}=s;if(h.nodeType==3){if(d=!!(m&&h.nodeValue[m-1]==`
26
+ `),d&&m==h.nodeValue.length)for(let v=h,g;v;v=v.parentNode){if(g=v.nextSibling){g.nodeName=="BR"&&(s=o={node:g.parentNode,offset:Ze(g)+1});break}let E=v.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let v=h.childNodes[m-1];d=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Mt&&c.focusNode&&c.focusNode!=o.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(r=!0)}if(!(r||d&&st)&&nl(s.node,s.offset,c.anchorNode,c.anchorOffset)&&nl(o.node,o.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||t==n)&&!(d&&Mt)){u.collapse(s.node,s.offset);try{t!=n&&u.extend(o.node,o.offset),f=!0}catch{}}if(!f){if(t>n){let m=s;s=o,o=m}let h=document.createRange();h.setEnd(o.node,o.offset),h.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let l=0,r=0;r<this.children.length;r++){let a=this.children[r],i=l+a.size;if(l==i?t<=i&&n>=l:t<i&&n>l){let s=l+a.border,o=i-a.border;if(t>=s&&n<=o){this.dirty=t==l||n==i?rl:cp,t==s&&n==o&&(a.contentLost||a.dom.parentNode!=this.contentDOM)?a.dirty=Kt:a.markDirty(t-s,n-s);return}else a.dirty=a.dom==a.contentDOM&&a.dom.parentNode==this.contentDOM&&!a.children.length?rl:Kt}l=i}this.dirty=rl}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let l=t==1?rl:cp;n.dirty<l&&(n.dirty=l)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class dp extends Hr{constructor(t,n,l,r){let a,i=n.type.toDOM;if(typeof i=="function"&&(i=i(l,()=>{if(!a)return r;if(a.parent)return a.parent.posBeforeChild(a)})),!n.type.spec.raw){if(i.nodeType!=1){let s=document.createElement("span");s.appendChild(i),i=s}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=n,this.widget=n,a=this}matchesWidget(t){return this.dirty==Lt&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.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 uS extends Hr{constructor(t,n,l,r){super(t,[],n,null),this.textDOM=l,this.text=r}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class al extends Hr{constructor(t,n,l,r,a){super(t,[],l,r),this.mark=n,this.spec=a}static create(t,n,l,r){let a=r.nodeViews[n.type.name],i=a&&a(n,r,l);return(!i||!i.dom)&&(i=el.renderSpec(document,n.type.spec.toDOM(n,l),null,n.attrs)),new al(t,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Kt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Kt&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Lt){let l=this.parent;for(;!l.node;)l=l.parent;l.dirty<this.dirty&&(l.dirty=this.dirty),this.dirty=Lt}}slice(t,n,l){let r=al.create(this.parent,this.mark,!0,l),a=this.children,i=this.size;n<i&&(a=io(a,n,i,l)),t>0&&(a=io(a,0,t,l));for(let s=0;s<a.length;s++)a[s].parent=r;return r.children=a,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class kn extends Hr{constructor(t,n,l,r,a,i,s,o,u){super(t,[],a,i),this.node=n,this.outerDeco=l,this.innerDeco=r,this.nodeDOM=s}static create(t,n,l,r,a,i){let s=a.nodeViews[n.type.name],o,u=s&&s(n,a,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)},l,r),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=el.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=mp(c,l,n),u?o=new cS(t,n,l,r,c,d||null,f,u,a,i+1):n.isText?new qa(t,n,l,r,c,f,a):new kn(t,n,l,r,c,d||null,f,a,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let l=this.children[n];if(this.dom.contains(l.dom.parentNode)){t.contentElement=l.dom.parentNode;break}}t.contentElement||(t.getContent=()=>K.empty)}return t}matchesNode(t,n,l){return this.dirty==Lt&&t.eq(this.node)&&Wa(n,this.outerDeco)&&l.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let l=this.node.inlineContent,r=n,a=t.composing?this.localCompositionInfo(t,n):null,i=a&&a.pos>-1?a:null,s=a&&a.pos<0,o=new fS(this,i&&i.node,t);bS(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?o.syncToMarks(u.spec.marks,l,t,c):u.type.side>=0&&!d&&o.syncToMarks(c==this.node.childCount?Le.none:this.node.child(c).marks,l,t,c),o.placeWidget(u,t,r)},(u,c,d,f)=>{o.syncToMarks(u.marks,l,t,f);let h;o.findNodeMatch(u,c,d,f)||s&&t.state.selection.from>r&&t.state.selection.to<r+u.nodeSize&&(h=o.findIndexWithChild(a.node))>-1&&o.updateNodeAt(u,c,d,h,t)||o.updateNextNode(u,c,d,t,f,r)||o.addNode(u,c,d,t,r),r+=u.nodeSize}),o.syncToMarks([],l,t,0),this.node.isTextblock&&o.addTextblockHacks(),o.destroyRest(),(o.changed||this.dirty==rl)&&(i&&this.protectLocalComposition(t,i),pp(this.contentDOM,this.children,t),Fl&&mS(this.dom))}localCompositionInfo(t,n){let{from:l,to:r}=t.state.selection;if(!(t.state.selection instanceof be)||l<n||r>n+this.node.content.size)return null;let a=t.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let i=a.nodeValue,s=gS(this.node.content,i,l-n,r-n);return s<0?null:{node:a,pos:s,text:i}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:l,text:r}){if(this.getDesc(n))return;let a=n;for(;a.parentNode!=this.contentDOM;a=a.parentNode){for(;a.previousSibling;)a.parentNode.removeChild(a.previousSibling);for(;a.nextSibling;)a.parentNode.removeChild(a.nextSibling);a.pmViewDesc&&(a.pmViewDesc=void 0)}let i=new uS(this,a,n,r);t.input.compositionNodes.push(i),this.children=io(this.children,l,l+r.length,t,i)}update(t,n,l,r){return this.dirty==Kt||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,l,r),!0)}updateInner(t,n,l,r){this.updateOuterDeco(n),this.node=t,this.innerDeco=l,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Lt}updateOuterDeco(t){if(Wa(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,l=this.dom;this.dom=bp(this.dom,this.nodeDOM,ao(this.outerDeco,this.node,n),ao(t,this.node,n)),this.dom!=l&&(l.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}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 fp(e,t,n,l,r){mp(l,t,e);let a=new kn(void 0,e,t,n,l,l,l,r,0);return a.contentDOM&&a.updateChildren(r,0),a}class qa extends kn{constructor(t,n,l,r,a,i,s){super(t,n,l,r,a,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,l,r){return this.dirty==Kt||this.dirty!=Lt&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Lt||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=Lt,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,l){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,l)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,l){let r=this.node.cut(t,n),a=document.createTextNode(r.text);return new qa(this.parent,r,this.outerDeco,this.innerDeco,a,a,l)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Kt)}get domAtom(){return!1}isText(t){return this.node.text==t}}class hp extends Hr{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Lt&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cS extends kn{constructor(t,n,l,r,a,i,s,o,u,c){super(t,n,l,r,a,i,s,u,c),this.spec=o}update(t,n,l,r){if(this.dirty==Kt)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let a=this.spec.update(t,n,l);return a&&this.updateInner(t,n,l,r),a}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,l,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,l,r){this.spec.setSelection?this.spec.setSelection(t,n,l.root):super.setSelection(t,n,l,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function pp(e,t,n){let l=e.firstChild,r=!1;for(let a=0;a<t.length;a++){let i=t[a],s=i.dom;if(s.parentNode==e){for(;s!=l;)l=gp(l),r=!0;l=l.nextSibling}else r=!0,e.insertBefore(s,l);if(i instanceof al){let o=l?l.previousSibling:e.lastChild;pp(i.contentDOM,i.children,n),l=o?o.nextSibling:e.firstChild}}for(;l;)l=gp(l),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}const Ur=function(e){e&&(this.nodeName=e)};Ur.prototype=Object.create(null);const il=[new Ur];function ao(e,t,n){if(e.length==0)return il;let l=n?il[0]:new Ur,r=[l];for(let a=0;a<e.length;a++){let i=e[a].type.attrs;if(i){i.nodeName&&r.push(l=new Ur(i.nodeName));for(let s in i){let o=i[s];o!=null&&(n&&r.length==1&&r.push(l=new Ur(t.isInline?"span":"div")),s=="class"?l.class=(l.class?l.class+" ":"")+o:s=="style"?l.style=(l.style?l.style+";":"")+o:s!="nodeName"&&(l[s]=o))}}}return r}function bp(e,t,n,l){if(n==il&&l==il)return t;let r=t;for(let a=0;a<l.length;a++){let i=l[a],s=n[a];if(a){let o;s&&s.nodeName==i.nodeName&&r!=e&&(o=r.parentNode)&&o.nodeName.toLowerCase()==i.nodeName||(o=document.createElement(i.nodeName),o.pmIsDeco=!0,o.appendChild(r),s=il[0]),r=o}dS(r,s||il[0],i)}return r}function dS(e,t,n){for(let l in t)l!="class"&&l!="style"&&l!="nodeName"&&!(l in n)&&e.removeAttribute(l);for(let l in n)l!="class"&&l!="style"&&l!="nodeName"&&n[l]!=t[l]&&e.setAttribute(l,n[l]);if(t.class!=n.class){let l=t.class?t.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let a=0;a<l.length;a++)r.indexOf(l[a])==-1&&e.classList.remove(l[a]);for(let a=0;a<r.length;a++)l.indexOf(r[a])==-1&&e.classList.add(r[a]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=l.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function mp(e,t,n){return bp(e,e,il,ao(t,n,e.nodeType!=1))}function Wa(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function gp(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class fS{constructor(t,n,l){this.lock=n,this.view=l,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=hS(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let l=t;l<n;l++)this.top.children[l].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,l,r){let a=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;a<s&&(a==i-1?this.top:this.stack[a+1<<1]).matchesMark(t[a])&&t[a].type.spec.spanning!==!1;)a++;for(;a<i;)this.destroyRest(),this.top.dirty=Lt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let o=-1,u=this.top.children.length;r<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(t[i])&&!this.isLocked(d.dom)){o=c;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let c=al.create(this.top,t[i],n,l);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,l,r){let a=-1,i;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,n,l))a=this.top.children.indexOf(i,this.index);else for(let s=this.index,o=Math.min(this.top.children.length,s+5);s<o;s++){let u=this.top.children[s];if(u.matchesNode(t,n,l)&&!this.preMatch.matched.has(u)){a=s;break}}return a<0?!1:(this.destroyBetween(this.index,a),this.index++,!0)}updateNodeAt(t,n,l,r,a){let i=this.top.children[r];return i.dirty==Kt&&i.dom==i.contentDOM&&(i.dirty=rl),i.update(t,n,l,a)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let l=t.pmViewDesc;if(l){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==l)return r}return-1}t=n}}updateNextNode(t,n,l,r,a,i){for(let s=this.index;s<this.top.children.length;s++){let o=this.top.children[s];if(o instanceof kn){let u=this.preMatch.matched.get(o);if(u!=null&&u!=a)return!1;let c=o.dom,d,f=this.isLocked(c)&&!(t.isText&&o.node&&o.node.isText&&o.nodeDOM.nodeValue==t.text&&o.dirty!=Kt&&Wa(n,o.outerDeco));if(!f&&o.update(t,n,l,r))return this.destroyBetween(this.index,s),o.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(o,t,n,l,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=rl,d.updateChildren(r,i+1),d.dirty=Lt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,l,r,a,i){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Wa(l,t.outerDeco)||!r.eq(t.innerDeco))return null;let s=kn.create(this.top,n,l,r,a,i);if(s.contentDOM){s.children=t.children,t.children=[];for(let o of s.children)o.parent=s}return t.destroy(),s}addNode(t,n,l,r,a){let i=kn.create(this.top,t,n,l,r,a);i.contentDOM&&i.updateChildren(r,a+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,n,l){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(t)&&(t==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let a=new dp(this.top,t,n,l);this.top.children.splice(this.index++,0,a),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof al;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof qa)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((st||et)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let l=document.createElement(t);t=="IMG"&&(l.className="ProseMirror-separator",l.alt=""),t=="BR"&&(l.className="ProseMirror-trailingBreak");let r=new hp(this.top,[],l,null);n!=this.top?n.children.push(r):n.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function hS(e,t){let n=t,l=n.children.length,r=e.childCount,a=new Map,i=[];e:for(;r>0;){let s;for(;;)if(l){let u=n.children[l-1];if(u instanceof al)n=u,l=u.children.length;else{s=u,l--;break}}else{if(n==t)break e;l=n.parent.children.indexOf(n),n=n.parent}let o=s.node;if(o){if(o!=e.child(r-1))break;--r,a.set(s,r),i.push(s)}}return{index:r,matched:a,matches:i.reverse()}}function pS(e,t){return e.type.side-t.type.side}function bS(e,t,n,l){let r=t.locals(e),a=0;if(r.length==0){for(let u=0;u<e.childCount;u++){let c=e.child(u);l(c,r,t.forChild(a,c),u),a+=c.nodeSize}return}let i=0,s=[],o=null;for(let u=0;;){let c,d;for(;i<r.length&&r[i].to==a;){let g=r[i++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(pS);for(let g=0;g<d.length;g++)n(d[g],u,!!o)}else n(c,u,!!o);let f,h;if(o)h=-1,f=o,o=null;else if(u<e.childCount)h=u,f=e.child(u++);else break;for(let g=0;g<s.length;g++)s[g].to<=a&&s.splice(g--,1);for(;i<r.length&&r[i].from<=a&&r[i].to>a;)s.push(r[i++]);let m=a+f.nodeSize;if(f.isText){let g=m;i<r.length&&r[i].from<g&&(g=r[i].from);for(let E=0;E<s.length;E++)s[E].to<g&&(g=s[E].to);g<m&&(o=f.cut(g-a),f=f.cut(0,g-a),m=g,h=-1)}else for(;i<r.length&&r[i].to<m;)i++;let v=f.isInline&&!f.isLeaf?s.filter(g=>!g.inline):s.slice();l(f,v,t.forChild(a,f),h),a=m}}function mS(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function gS(e,t,n,l){for(let r=0,a=0;r<e.childCount&&a<=l;){let i=e.child(r++),s=a;if(a+=i.nodeSize,!i.isText)continue;let o=i.text;for(;r<e.childCount;){let u=e.child(r++);if(a+=u.nodeSize,!u.isText)break;o+=u.text}if(a>=n){if(a>=l&&o.slice(l-t.length-s,l-s)==t)return l-t.length;let u=s<l?o.lastIndexOf(t,l-s-1):-1;if(u>=0&&u+t.length+s>=n)return s+u;if(n==l&&o.length>=l+t.length-s&&o.slice(l-s,l-s+t.length)==t)return l}}return-1}function io(e,t,n,l,r){let a=[];for(let i=0,s=0;i<e.length;i++){let o=e[i],u=s,c=s+=o.size;u>=n||c<=t?a.push(o):(u<t&&a.push(o.slice(0,t-u,l)),r&&(a.push(r),r=void 0),c>n&&a.push(o.slice(n-u,o.size,l)))}return a}function so(e,t=null){let n=e.domSelectionRange(),l=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),a=r&&r.size==0,i=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let s=l.resolve(i),o,u;if($a(n)){for(o=i;r&&!r.node;)r=r.parent;let d=r.node;if(r&&d.isAtom&&he.isSelectable(d)&&r.parent&&!(d.isInline&&q6(n.focusNode,n.focusOffset,r.dom))){let f=r.posBefore;u=new he(i==f?s:l.resolve(f))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=i,f=i;for(let h=0;h<n.rangeCount;h++){let m=n.getRangeAt(h);d=Math.min(d,e.docView.posFromDOM(m.startContainer,m.startOffset,1)),f=Math.max(f,e.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[o,i]=f==e.state.selection.anchor?[f,d]:[d,f],s=l.resolve(i)}else o=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(o<0)return null}let c=l.resolve(o);if(!u){let d=t=="pointer"||e.state.selection.head<s.pos&&!a?1:-1;u=uo(e,c,s,d)}return u}function vp(e){return e.editable?e.hasFocus():kp(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function an(e,t=!1){let n=e.state.selection;if(Cp(e,n),!!vp(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&et){let l=e.domSelectionRange(),r=e.domObserver.currentSelection;if(l.anchorNode&&r.anchorNode&&nl(l.anchorNode,l.anchorOffset,r.anchorNode,r.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)yS(e);else{let{anchor:l,head:r}=n,a,i;yp&&!(n instanceof be)&&(n.$from.parent.inlineContent||(a=Ep(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=Ep(e,n.to))),e.docView.setSelection(l,r,e,t),yp&&(a&&Tp(a),i&&Tp(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vS(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const yp=st||et&&Xh<63;function Ep(e,t){let{node:n,offset:l}=e.docView.domFromPos(t,0),r=l<n.childNodes.length?n.childNodes[l]:null,a=l?n.childNodes[l-1]:null;if(st&&r&&r.contentEditable=="false")return oo(r);if((!r||r.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(r)return oo(r);if(a)return oo(a)}}function oo(e){return e.contentEditable="true",st&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Tp(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function vS(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),l=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=l||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!vp(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function yS(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,l=n.nodeName=="IMG";l?t.collapse(n.parentNode,Ze(n)+1):t.collapse(n,0),!l&&!e.state.selection.visible&&yt&&Sn<=11&&(n.disabled=!0,n.disabled=!1)}function Cp(e,t){if(t instanceof he){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Sp(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Sp(e)}function Sp(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function uo(e,t,n,l){return e.someProp("createSelectionBetween",r=>r(e,t,n))||be.between(t,n,l)}function xp(e){return e.editable&&!e.hasFocus()?!1:kp(e)}function kp(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ES(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return nl(t.node,t.offset,n.anchorNode,n.anchorOffset)}function co(e,t){let{$anchor:n,$head:l}=e.selection,r=t>0?n.max(l):n.min(l),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&Ce.findFrom(a,t)}function An(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ap(e,t,n){let l=e.state.selection;if(l instanceof be)if(n.indexOf("s")>-1){let{$head:r}=l,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let i=e.state.doc.resolve(r.pos+a.nodeSize*(t<0?-1:1));return An(e,new be(l.$anchor,i))}else if(l.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=co(e.state,t);return r&&r instanceof he?An(e,r):!1}else if(!(Dt&&n.indexOf("m")>-1)){let r=l.$head,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,i;if(!a||a.isText)return!1;let s=t<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(i=e.docView.descAt(s))&&!i.contentDOM?he.isSelectable(a)?An(e,new he(t<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Rr?An(e,new be(e.state.doc.resolve(t<0?s:s+a.nodeSize))):!1:!1}}else return!1;else{if(l instanceof he&&l.node.isInline)return An(e,new be(t>0?l.$to:l.$from));{let r=co(e.state,t);return r?An(e,r):!1}}}function Ya(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function zr(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Ul(e,t){return t<0?TS(e):CS(e)}function TS(e){let t=e.domSelectionRange(),n=t.focusNode,l=t.focusOffset;if(!n)return;let r,a,i=!1;for(Mt&&n.nodeType==1&&l<Ya(n)&&zr(n.childNodes[l],-1)&&(i=!0);;)if(l>0){if(n.nodeType!=1)break;{let s=n.childNodes[l-1];if(zr(s,-1))r=n,a=--l;else if(s.nodeType==3)n=s,l=n.nodeValue.length;else break}}else{if(Np(n))break;{let s=n.previousSibling;for(;s&&zr(s,-1);)r=n.parentNode,a=Ze(s),s=s.previousSibling;if(s)n=s,l=Ya(n);else{if(n=n.parentNode,n==e.dom)break;l=0}}}i?fo(e,n,l):r&&fo(e,r,a)}function CS(e){let t=e.domSelectionRange(),n=t.focusNode,l=t.focusOffset;if(!n)return;let r=Ya(n),a,i;for(;;)if(l<r){if(n.nodeType!=1)break;let s=n.childNodes[l];if(zr(s,1))a=n,i=++l;else break}else{if(Np(n))break;{let s=n.nextSibling;for(;s&&zr(s,1);)a=s.parentNode,i=Ze(s)+1,s=s.nextSibling;if(s)n=s,l=0,r=Ya(n);else{if(n=n.parentNode,n==e.dom)break;l=r=0}}}a&&fo(e,a,i)}function Np(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function SS(e,t){for(;e&&t==e.childNodes.length&&!Br(e);)t=Ze(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function xS(e,t){for(;e&&!t&&!Br(e);)t=Ze(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function fo(e,t,n){if(t.nodeType!=3){let a,i;(i=SS(t,n))?(t=i,n=0):(a=xS(t,n))&&(t=a,n=a.nodeValue.length)}let l=e.domSelection();if(!l)return;if($a(l)){let a=document.createRange();a.setEnd(t,n),a.setStart(t,n),l.removeAllRanges(),l.addRange(a)}else l.extend&&l.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&an(e)},50)}function wp(e,t){let n=e.state.doc.resolve(t);if(!(et||Jh)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let a=e.coordsAtPos(t-1),i=(a.top+a.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(a.left-r.left)>1)return a.left<r.left?"ltr":"rtl"}if(t<n.end()){let a=e.coordsAtPos(t+1),i=(a.top+a.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Ip(e,t,n){let l=e.state.selection;if(l instanceof be&&!l.empty||n.indexOf("s")>-1||Dt&&n.indexOf("m")>-1)return!1;let{$from:r,$to:a}=l;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let i=co(e.state,t);if(i&&i instanceof he)return An(e,i)}if(!r.parent.inlineContent){let i=t<0?r:a,s=l instanceof At?Ce.near(i,t):Ce.findFrom(i,t);return s?An(e,s):!1}return!1}function _p(e,t){if(!(e.state.selection instanceof be))return!0;let{$head:n,$anchor:l,empty:r}=e.state.selection;if(!n.sameParent(l))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let i=e.state.tr;return t<0?i.delete(n.pos-a.nodeSize,n.pos):i.delete(n.pos,n.pos+a.nodeSize),e.dispatch(i),!0}return!1}function Op(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function kS(e){if(!st||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let l=t.firstChild;Op(e,l,"true"),setTimeout(()=>Op(e,l,"false"),20)}return!1}function AS(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function NS(e,t){let n=t.keyCode,l=AS(t);if(n==8||Dt&&n==72&&l=="c")return _p(e,-1)||Ul(e,-1);if(n==46&&!t.shiftKey||Dt&&n==68&&l=="c")return _p(e,1)||Ul(e,1);if(n==13||n==27)return!0;if(n==37||Dt&&n==66&&l=="c"){let r=n==37?wp(e,e.state.selection.from)=="ltr"?-1:1:-1;return Ap(e,r,l)||Ul(e,r)}else if(n==39||Dt&&n==70&&l=="c"){let r=n==39?wp(e,e.state.selection.from)=="ltr"?1:-1:1;return Ap(e,r,l)||Ul(e,r)}else{if(n==38||Dt&&n==80&&l=="c")return Ip(e,-1,l)||Ul(e,-1);if(n==40||Dt&&n==78&&l=="c")return kS(e)||Ip(e,1,l)||Ul(e,1);if(l==(Dt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ho(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:l,openStart:r,openEnd:a}=t;for(;r>1&&a>1&&l.childCount==1&&l.firstChild.childCount==1;){r--,a--;let h=l.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),l=h.content}let i=e.someProp("clipboardSerializer")||el.fromSchema(e.state.schema),s=Hp(),o=s.createElement("div");o.appendChild(i.serializeFragment(l,{document:s}));let u=o.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Rp[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let m=s.createElement(c[h]);for(;o.firstChild;)m.appendChild(o.firstChild);o.appendChild(m),d++}u=o.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${a}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
27
27
 
28
28
  `);return{dom:o,text:f,slice:t}}function Mp(e,t,n,l,r){let a=r.parent.type.spec.code,i,s;if(!n&&!t)return null;let o=!!t&&(l||a||!n);if(o){if(e.someProp("transformPastedText",f=>{t=f(t,a||l,e)}),a)return s=new ae(K.from(e.state.schema.text(t.replace(/\r\n?/g,`
29
- `))),0,0),e.someProp("transformPasted",f=>{s=f(s,e,!0)}),s;let d=e.someProp("clipboardTextParser",f=>f(t,r,l,e));if(d)s=d;else{let f=r.marks(),{schema:h}=e.state,m=el.fromSchema(h);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let g=i.appendChild(document.createElement("p"));v&&g.appendChild(m.serializeNode(h.text(v,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),i=OS(n),Rr&&MS(i);let u=i&&i.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||wr.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(o||c),context:r,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!wS.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)s=DS(Bp(s,+c[1],+c[2]),c[4]);else if(s=ae.maxOpen(IS(s.content,r),!0),s.openStart||s.openEnd){let d=0,f=0;for(let h=s.content.firstChild;d<s.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=s.content.lastChild;f<s.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);s=Bp(s,d,f)}return e.someProp("transformPasted",d=>{s=d(s,e,o)}),s}const wS=/^(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 IS(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),a,i=[];if(e.forEach(s=>{if(!i)return;let o=r.findWrapping(s.type),u;if(!o)return i=null;if(u=i.length&&a.length&&Lp(o,a,s,i[i.length-1],0))i[i.length-1]=u;else{i.length&&(i[i.length-1]=Pp(i[i.length-1],a.length));let c=Dp(s,o);i.push(c),r=r.matchType(c.type),a=o}}),i)return K.from(i)}return e}function Dp(e,t,n=0){for(let l=t.length-1;l>=n;l--)e=t[l].create(null,K.from(e));return e}function Lp(e,t,n,l,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let a=Lp(e,t,n,l.lastChild,r+1);if(a)return l.copy(l.content.replaceChild(l.childCount-1,a));if(l.contentMatchAt(l.childCount).matchType(r==e.length-1?n.type:e[r+1]))return l.copy(l.content.append(K.from(Dp(n,e,r+1))))}}function Pp(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Pp(e.lastChild,t-1)),l=e.contentMatchAt(e.childCount).fillBefore(K.empty,!0);return e.copy(n.append(l))}function po(e,t,n,l,r,a){let i=t<0?e.firstChild:e.lastChild,s=i.content;return e.childCount>1&&(a=0),r<l-1&&(s=po(s,t,n,l,r+1,a)),r>=n&&(s=t<0?i.contentMatchAt(0).fillBefore(s,a<=r).append(s):s.append(i.contentMatchAt(i.childCount).fillBefore(K.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,i.copy(s))}function Bp(e,t,n){return t<e.openStart&&(e=new ae(po(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(po(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Rp={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 Fp=null;function Hp(){return Fp||(Fp=document.implementation.createHTMLDocument("title"))}let bo=null;function _S(e){let t=window.trustedTypes;return t?(bo||(bo=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),bo.createHTML(e)):e}function OS(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Hp().createElement("div"),l=/<([a-z][^>\s]+)/i.exec(e),r;if((r=l&&Rp[l[1].toLowerCase()])&&(e=r.map(a=>"<"+a+">").join("")+e+r.map(a=>"</"+a+">").reverse().join("")),n.innerHTML=_S(e),r)for(let a=0;a<r.length;a++)n=n.querySelector(r[a])||n;return n}function MS(e){let t=e.querySelectorAll(et?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let l=t[n];l.childNodes.length==1&&l.textContent==" "&&l.parentNode&&l.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),l)}}function DS(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,l;try{l=JSON.parse(t)}catch{return e}let{content:r,openStart:a,openEnd:i}=e;for(let s=l.length-2;s>=0;s-=2){let o=n.nodes[l[s]];if(!o||o.hasRequiredAttrs())break;r=K.from(o.create(l[s+1],r)),a++,i++}return new ae(r,a,i)}const ht={},pt={},LS={touchstart:!0,touchmove:!0};class PS{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function BS(e){for(let t in ht){let n=ht[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=l=>{FS(e,l)&&!go(e,l)&&(e.editable||!(l.type in pt))&&n(e,l)},LS[t]?{passive:!0}:void 0)}st&&e.dom.addEventListener("input",()=>null),mo(e)}function Nn(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function RS(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function mo(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=l=>go(e,l))})}function go(e,t){return e.someProp("handleDOMEvents",n=>{let l=n[t.type];return l?l(e,t)||t.defaultPrevented:!1})}function FS(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function HS(e,t){!go(e,t)&&ht[t.type]&&(e.editable||!(t.type in pt))&&ht[t.type](e,t)}pt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!zp(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(ln&&et&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Fl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let l=Date.now();e.input.lastIOSEnter=l,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==l&&(e.someProp("handleKeyDown",r=>r(e,ll(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",l=>l(e,n))||NS(e,n)?n.preventDefault():Nn(e,"key")},pt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},pt.keypress=(e,t)=>{let n=t;if(zp(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Dt&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let l=e.state.selection;if(!(l instanceof be)||!l.$from.sameParent(l.$to)){let r=String.fromCharCode(n.charCode),a=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",i=>i(e,l.$from.pos,l.$to.pos,r,a))&&e.dispatch(a()),n.preventDefault()}};function ja(e){return{left:e.clientX,top:e.clientY}}function US(e,t){let n=t.x-e.clientX,l=t.y-e.clientY;return n*n+l*l<100}function vo(e,t,n,l,r){if(l==-1)return!1;let a=e.state.doc.resolve(l);for(let i=a.depth+1;i>0;i--)if(e.someProp(t,s=>i>a.depth?s(e,n,a.nodeAfter,a.before(i),r,!0):s(e,n,a.node(i),a.before(i),r,!1)))return!0;return!1}function zl(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let l=e.state.tr.setSelection(t);l.setMeta("pointer",!0),e.dispatch(l)}function zS(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),l=n.nodeAfter;return l&&l.isAtom&&he.isSelectable(l)?(zl(e,new he(n)),!0):!1}function VS(e,t){if(t==-1)return!1;let n=e.state.selection,l,r;n instanceof he&&(l=n.node);let a=e.state.doc.resolve(t);for(let i=a.depth+1;i>0;i--){let s=i>a.depth?a.nodeAfter:a.node(i);if(he.isSelectable(s)){l&&n.$from.depth>0&&i>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(i);break}}return r!=null?(zl(e,he.create(e.state.doc,r)),!0):!1}function $S(e,t,n,l,r){return vo(e,"handleClickOn",t,n,l)||e.someProp("handleClick",a=>a(e,t,l))||(r?VS(e,n):zS(e,n))}function qS(e,t,n,l){return vo(e,"handleDoubleClickOn",t,n,l)||e.someProp("handleDoubleClick",r=>r(e,t,l))}function WS(e,t,n,l){return vo(e,"handleTripleClickOn",t,n,l)||e.someProp("handleTripleClick",r=>r(e,t,l))||YS(e,n,l)}function YS(e,t,n){if(n.button!=0)return!1;let l=e.state.doc;if(t==-1)return l.inlineContent?(zl(e,be.create(l,0,l.content.size)),!0):!1;let r=l.resolve(t);for(let a=r.depth+1;a>0;a--){let i=a>r.depth?r.nodeAfter:r.node(a),s=r.before(a);if(i.inlineContent)zl(e,be.create(l,s+1,s+1+i.content.size));else if(he.isSelectable(i))zl(e,he.create(l,s));else continue;return!0}}function yo(e){return Ka(e)}const Up=Dt?"metaKey":"ctrlKey";ht.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let l=yo(e),r=Date.now(),a="singleClick";r-e.input.lastClick.time<500&&US(n,e.input.lastClick)&&!n[Up]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button};let i=e.posAtCoords(ja(n));i&&(a=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new jS(e,i,n,!!l)):(a=="doubleClick"?qS:WS)(e,i.pos,i.inside,n)?n.preventDefault():Nn(e,"pointer"))};class jS{constructor(t,n,l,r){this.view=t,this.pos=n,this.event=l,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!l[Up],this.allowDefault=l.shiftKey;let a,i;if(n.inside>-1)a=t.state.doc.nodeAt(n.inside),i=n.inside;else{let c=t.state.doc.resolve(n.pos);a=c.parent,i=c.depth?c.before():0}const s=r?null:l.target,o=s?t.docView.nearestDesc(s,!0):null;this.target=o&&o.nodeDOM.nodeType==1?o.nodeDOM:null;let{selection:u}=t.state;l.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof he&&u.from<=i&&u.to>i)&&(this.mightDrag={node:a,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Mt&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Nn(t,"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(()=>an(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(ja(t))),this.updateAllowDefault(t),this.allowDefault||!n?Nn(this.view,"pointer"):$S(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||st&&this.mightDrag&&!this.mightDrag.node.isAtom||et&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(zl(this.view,Te.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Nn(this.view,"pointer")}move(t){this.updateAllowDefault(t),Nn(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}ht.touchstart=e=>{e.input.lastTouch=Date.now(),yo(e),Nn(e,"pointer")},ht.touchmove=e=>{e.input.lastTouch=Date.now(),Nn(e,"pointer")},ht.contextmenu=e=>yo(e);function zp(e,t){return e.composing?!0:st&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const KS=ln?5e3:-1;pt.compositionstart=pt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof be&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(l=>l.type.spec.inclusive===!1)||et&&Jh&&GS(e)))e.markCursor=e.state.storedMarks||n.marks(),Ka(e,!0),e.markCursor=null;else if(Ka(e,!t.selection.empty),Mt&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let l=e.domSelectionRange();for(let r=l.focusNode,a=l.focusOffset;r&&r.nodeType==1&&a!=0;){let i=a<0?r.lastChild:r.childNodes[a-1];if(!i)break;if(i.nodeType==3){let s=e.domSelection();s&&s.collapse(i,i.nodeValue.length);break}else r=i,a=-1}}e.input.composing=!0}Vp(e,KS)};function GS(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let l=t.childNodes[n];return l.nodeType==1&&l.contentEditable=="false"}pt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Vp(e,20))};function Vp(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ka(e),t))}function $p(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=XS());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function QS(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=V6(t.focusNode,t.focusOffset),l=$6(t.focusNode,t.focusOffset);if(n&&l&&n!=l){let r=l.pmViewDesc,a=e.domObserver.lastChangedTextNode;if(n==a||l==a)return a;if(!r||!r.isText(l.nodeValue))return l;if(e.input.compositionNode==l){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return l}}return n||l}function XS(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Ka(e,t=!1){if(!(ln&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),$p(e),t||e.docView&&e.docView.dirty){let n=so(e),l=e.state.selection;return n&&!n.eq(l)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!l.$from.node(l.$from.sharedDepth(l.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function JS(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let l=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),l.removeAllRanges(),l.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Vr=yt&&Sn<15||Fl&&j6<604;ht.copy=pt.cut=(e,t)=>{let n=t,l=e.state.selection,r=n.type=="cut";if(l.empty)return;let a=Vr?null:n.clipboardData,i=l.content(),{dom:s,text:o}=ho(e,i);a?(n.preventDefault(),a.clearData(),a.setData("text/html",s.innerHTML),a.setData("text/plain",o)):JS(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ZS(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ex(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,l=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),l.parentNode&&l.parentNode.removeChild(l),n?$r(e,l.value,null,r,t):$r(e,l.textContent,l.innerHTML,r,t)},50)}function $r(e,t,n,l,r){let a=Mp(e,t,n,l,e.state.selection.$from);if(e.someProp("handlePaste",o=>o(e,r,a||ae.empty)))return!0;if(!a)return!1;let i=ZS(a),s=i?e.state.tr.replaceSelectionWith(i,l):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qp(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}pt.paste=(e,t)=>{let n=t;if(e.composing&&!ln)return;let l=Vr?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;l&&$r(e,qp(l),l.getData("text/html"),r,n)?n.preventDefault():ex(e,n)};class Wp{constructor(t,n,l){this.slice=t,this.move=n,this.node=l}}const tx=Dt?"altKey":"ctrlKey";function Yp(e,t){let n;return e.someProp("dragCopies",l=>{n=n||l(t)}),n!=null?!n:!t[tx]}ht.dragstart=(e,t)=>{let n=t,l=e.input.mouseDown;if(l&&l.done(),!n.dataTransfer)return;let r=e.state.selection,a=r.empty?null:e.posAtCoords(ja(n)),i;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof he?r.to-1:r.to))){if(l&&l.mightDrag)i=he.create(e.state.doc,l.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(i=he.create(e.state.doc,d.posBefore))}}let s=(i||e.state.selection).content(),{dom:o,text:u,slice:c}=ho(e,s);(!n.dataTransfer.files.length||!et||Xh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Vr?"Text":"text/html",o.innerHTML),n.dataTransfer.effectAllowed="copyMove",Vr||n.dataTransfer.setData("text/plain",u),e.dragging=new Wp(c,Yp(e,n),i)},ht.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},pt.dragover=pt.dragenter=(e,t)=>t.preventDefault(),pt.drop=(e,t)=>{try{nx(e,t,e.dragging)}finally{e.dragging=null}};function nx(e,t,n){if(!t.dataTransfer)return;let l=e.posAtCoords(ja(t));if(!l)return;let r=e.state.doc.resolve(l.pos),a=n&&n.slice;a?e.someProp("transformPasted",h=>{a=h(a,e,!1)}):a=Mp(e,qp(t.dataTransfer),Vr?null:t.dataTransfer.getData("text/html"),!1,r);let i=!!(n&&Yp(e,t));if(e.someProp("handleDrop",h=>h(e,t,a||ae.empty,i))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Ph(e.state.doc,r.pos,a):r.pos;s==null&&(s=r.pos);let o=e.state.tr;if(i){let{node:h}=n;h?h.replace(o):o.deleteSelection()}let u=o.mapping.map(s),c=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=o.doc;if(c?o.replaceRangeWith(u,u,a.content.firstChild):o.replaceRange(u,u,a),o.doc.eq(d))return;let f=o.doc.resolve(u);if(c&&he.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))o.setSelection(new he(f));else{let h=o.mapping.map(s);o.mapping.maps[o.mapping.maps.length-1].forEach((m,v,g,E)=>h=E),o.setSelection(uo(e,f,o.doc.resolve(h)))}e.focus(),e.dispatch(o.setMeta("uiEvent","drop"))}ht.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&an(e)},20))},ht.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},ht.beforeinput=(e,t)=>{if(et&&ln&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:l}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=l||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",a=>a(e,ll(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in pt)ht[e]=pt[e];function qr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ga{constructor(t,n){this.toDOM=t,this.spec=n||sl,this.side=this.spec.side||0}map(t,n,l,r){let{pos:a,deleted:i}=t.mapResult(n.from+r,this.side<0?-1:1);return i?null:new Nt(a-l,a-l,this)}valid(){return!0}eq(t){return this==t||t instanceof Ga&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&qr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class wn{constructor(t,n){this.attrs=t,this.spec=n||sl}map(t,n,l,r){let a=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-l,i=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-l;return a>=i?null:new Nt(a,i,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof wn&&qr(this.attrs,t.attrs)&&qr(this.spec,t.spec)}static is(t){return t.type instanceof wn}destroy(){}}class Eo{constructor(t,n){this.attrs=t,this.spec=n||sl}map(t,n,l,r){let a=t.mapResult(n.from+r,1);if(a.deleted)return null;let i=t.mapResult(n.to+r,-1);return i.deleted||i.pos<=a.pos?null:new Nt(a.pos-l,i.pos-l,this)}valid(t,n){let{index:l,offset:r}=t.content.findIndex(n.from),a;return r==n.from&&!(a=t.child(l)).isText&&r+a.nodeSize==n.to}eq(t){return this==t||t instanceof Eo&&qr(this.attrs,t.attrs)&&qr(this.spec,t.spec)}destroy(){}}class Nt{constructor(t,n,l){this.from=t,this.to=n,this.type=l}copy(t,n){return new Nt(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,l){return this.type.map(t,this,n,l)}static widget(t,n,l){return new Nt(t,t,new Ga(n,l))}static inline(t,n,l,r){return new Nt(t,n,new wn(l,r))}static node(t,n,l,r){return new Nt(t,n,new Eo(l,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof wn}get widget(){return this.type instanceof Ga}}const Vl=[],sl={};class We{constructor(t,n){this.local=t.length?t:Vl,this.children=n.length?n:Vl}static create(t,n){return n.length?Qa(n,t,0,sl):ot}find(t,n,l){let r=[];return this.findInner(t??0,n??1e9,r,0,l),r}findInner(t,n,l,r,a){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=n&&s.to>=t&&(!a||a(s.spec))&&l.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,n-s,l,r+s,a)}}map(t,n,l){return this==ot||t.maps.length==0?this:this.mapInner(t,n,0,0,l||sl)}mapInner(t,n,l,r,a){let i;for(let s=0;s<this.local.length;s++){let o=this.local[s].map(t,l,r);o&&o.type.valid(n,o)?(i||(i=[])).push(o):a.onRemove&&a.onRemove(this.local[s].spec)}return this.children.length?lx(this.children,i||[],t,n,l,r,a):i?new We(i.sort(ol),Vl):ot}add(t,n){return n.length?this==ot?We.create(t,n):this.addInner(t,n,0):this}addInner(t,n,l){let r,a=0;t.forEach((s,o)=>{let u=o+l,c;if(c=Kp(n,s,u)){for(r||(r=this.children.slice());a<r.length&&r[a]<o;)a+=3;r[a]==o?r[a+2]=r[a+2].addInner(s,c,u+1):r.splice(a,0,o,o+s.nodeSize,Qa(c,s,u+1,sl)),a+=3}});let i=jp(a?Gp(n):n,-l);for(let s=0;s<i.length;s++)i[s].type.valid(t,i[s])||i.splice(s--,1);return new We(i.length?this.local.concat(i).sort(ol):this.local,r||this.children)}remove(t){return t.length==0||this==ot?this:this.removeInner(t,0)}removeInner(t,n){let l=this.children,r=this.local;for(let a=0;a<l.length;a+=3){let i,s=l[a]+n,o=l[a+1]+n;for(let c=0,d;c<t.length;c++)(d=t[c])&&d.from>s&&d.to<o&&(t[c]=null,(i||(i=[])).push(d));if(!i)continue;l==this.children&&(l=this.children.slice());let u=l[a+2].removeInner(i,s+1);u!=ot?l[a+2]=u:(l.splice(a,3),a-=3)}if(r.length){for(let a=0,i;a<t.length;a++)if(i=t[a])for(let s=0;s<r.length;s++)r[s].eq(i,n)&&(r==this.local&&(r=this.local.slice()),r.splice(s--,1))}return l==this.children&&r==this.local?this:r.length||l.length?new We(r,l):ot}forChild(t,n){if(this==ot)return this;if(n.isLeaf)return We.empty;let l,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(l=this.children[s+2]);break}let a=t+1,i=a+n.content.size;for(let s=0;s<this.local.length;s++){let o=this.local[s];if(o.from<i&&o.to>a&&o.type instanceof wn){let u=Math.max(a,o.from)-a,c=Math.min(i,o.to)-a;u<c&&(r||(r=[])).push(o.copy(u,c))}}if(r){let s=new We(r.sort(ol),Vl);return l?new In([s,l]):s}return l||ot}eq(t){if(this==t)return!0;if(!(t instanceof We)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return To(this.localsInner(t))}localsInner(t){if(this==ot)return Vl;if(t.inlineContent||!this.local.some(wn.is))return this.local;let n=[];for(let l=0;l<this.local.length;l++)this.local[l].type instanceof wn||n.push(this.local[l]);return n}forEachSet(t){t(this)}}We.empty=new We([],[]),We.removeOverlap=To;const ot=We.empty;class In{constructor(t){this.members=t}map(t,n){const l=this.members.map(r=>r.map(t,n,sl));return In.from(l)}forChild(t,n){if(n.isLeaf)return We.empty;let l=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(t,n);a!=ot&&(a instanceof In?l=l.concat(a.members):l.push(a))}return In.from(l)}eq(t){if(!(t instanceof In)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,l=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(t);if(a.length)if(!n)n=a;else{l&&(n=n.slice(),l=!1);for(let i=0;i<a.length;i++)n.push(a[i])}}return n?To(l?n:n.sort(ol)):Vl}static from(t){switch(t.length){case 0:return ot;case 1:return t[0];default:return new In(t.every(n=>n instanceof We)?t:t.reduce((n,l)=>n.concat(l instanceof We?l:l.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function lx(e,t,n,l,r,a,i){let s=e.slice();for(let u=0,c=a;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,h,m,v)=>{let g=v-m-(h-f);for(let E=0;E<s.length;E+=3){let N=s[E+1];if(N<0||f>N+c-d)continue;let A=s[E]+c-d;h>=A?s[E+1]=f<=A?-2:-1:f>=c&&g&&(s[E]+=g,s[E+1]+=g)}d+=g}),c=n.maps[u].map(c,-1)}let o=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(s[u+1]==-2){o=!0,s[u+1]=-1;continue}let c=n.map(e[u]+a),d=c-r;if(d<0||d>=l.content.size){o=!0;continue}let f=n.map(e[u+1]+a,-1),h=f-r,{index:m,offset:v}=l.content.findIndex(d),g=l.maybeChild(m);if(g&&v==d&&v+g.nodeSize==h){let E=s[u+2].mapInner(n,g,c+1,e[u]+a+1,i);E!=ot?(s[u]=d,s[u+1]=h,s[u+2]=E):(s[u+1]=-2,o=!0)}else o=!0}if(o){let u=rx(s,e,t,n,r,a,i),c=Qa(u,l,0,i);t=c.local;for(let d=0;d<s.length;d+=3)s[d+1]<0&&(s.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let h=c.children[d];for(;f<s.length&&s[f]<h;)f+=3;s.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new We(t.sort(ol),s)}function jp(e,t){if(!t||!e.length)return e;let n=[];for(let l=0;l<e.length;l++){let r=e[l];n.push(new Nt(r.from+t,r.to+t,r.type))}return n}function rx(e,t,n,l,r,a,i){function s(o,u){for(let c=0;c<o.local.length;c++){let d=o.local[c].map(l,r,u);d?n.push(d):i.onRemove&&i.onRemove(o.local[c].spec)}for(let c=0;c<o.children.length;c+=3)s(o.children[c+2],o.children[c]+u+1)}for(let o=0;o<e.length;o+=3)e[o+1]==-1&&s(e[o+2],t[o]+a+1);return n}function Kp(e,t,n){if(t.isLeaf)return null;let l=n+t.nodeSize,r=null;for(let a=0,i;a<e.length;a++)(i=e[a])&&i.from>n&&i.to<l&&((r||(r=[])).push(i),e[a]=null);return r}function Gp(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Qa(e,t,n,l){let r=[],a=!1;t.forEach((s,o)=>{let u=Kp(e,s,o+n);if(u){a=!0;let c=Qa(u,s,n+o+1,l);c!=ot&&r.push(o,o+s.nodeSize,c)}});let i=jp(a?Gp(e):e,-n).sort(ol);for(let s=0;s<i.length;s++)i[s].type.valid(t,i[s])||(l.onRemove&&l.onRemove(i[s].spec),i.splice(s--,1));return i.length||r.length?new We(i,r):ot}function ol(e,t){return e.from-t.from||e.to-t.to}function To(e){let t=e;for(let n=0;n<t.length-1;n++){let l=t[n];if(l.from!=l.to)for(let r=n+1;r<t.length;r++){let a=t[r];if(a.from==l.from){a.to!=l.to&&(t==e&&(t=e.slice()),t[r]=a.copy(a.from,l.to),Qp(t,r+1,a.copy(l.to,a.to)));continue}else{a.from<l.to&&(t==e&&(t=e.slice()),t[n]=l.copy(l.from,a.from),Qp(t,r,l.copy(a.from,l.to)));break}}}return t}function Qp(e,t,n){for(;t<e.length&&ol(n,e[t])>0;)t++;e.splice(t,0,n)}function Co(e){let t=[];return e.someProp("decorations",n=>{let l=n(e.state);l&&l!=ot&&t.push(l)}),e.cursorWrapper&&t.push(We.create(e.state.doc,[e.cursorWrapper.deco])),In.from(t)}const ax={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ix=yt&&Sn<=11;class sx{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class ox{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sx,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(l=>{for(let r=0;r<l.length;r++)this.queue.push(l[r]);yt&&Sn<=11&&l.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():st&&t.composing&&l.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ix&&(this.onCharData=l=>{this.queue.push({target:l.target,type:"characterData",oldValue:l.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,ax)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);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(xp(this.view)){if(this.suppressingSelectionUpdates)return an(this.view);if(yt&&Sn<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&nl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,l;for(let a=t.focusNode;a;a=Rl(a))n.add(a);for(let a=t.anchorNode;a;a=Rl(a))if(n.has(a)){l=a;break}let r=l&&this.view.docView.nearestDesc(l);if(r&&r.ignoreMutation({type:"selection",target:l.nodeType==3?l.parentNode:l}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let l=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(l)&&xp(t)&&!this.ignoreSelectionChange(l),a=-1,i=-1,s=!1,o=[];if(t.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],o);d&&(a=a<0?d.from:Math.min(d.from,a),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(s=!0))}if(o.some(c=>c.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let c of o)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(Mt&&o.length){let c=o.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||dx(t,d)!=h)&&f.remove()}}}let u=null;a<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&$a(l)&&(u=so(t))&&u.eq(Te.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,an(t),this.currentSelection.set(l),t.scrollToSelection()):(a>-1||r)&&(a>-1&&(t.docView.markDirty(a,i),ux(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,fx(t,o)),this.handleDOMChange(a,i,s,o),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(l)||an(t),this.currentSelection.set(l))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let l=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(l==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!l||l.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;c<t.addedNodes.length;c++){let d=t.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(l.contentDOM&&l.contentDOM!=l.dom&&!l.contentDOM.contains(t.target))return{from:l.posBefore,to:l.posAfter};let r=t.previousSibling,a=t.nextSibling;if(yt&&Sn<=11&&t.addedNodes.length)for(let c=0;c<t.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=t.addedNodes[c];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(r=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(a=f)}let i=r&&r.parentNode==t.target?Ze(r)+1:0,s=l.localPosFromDOM(t.target,i,-1),o=a&&a.parentNode==t.target?Ze(a):t.target.childNodes.length,u=l.localPosFromDOM(t.target,o,1);return{from:s,to:u}}else return t.type=="attributes"?{from:l.posAtStart-l.border,to:l.posAtEnd+l.border}:(this.lastChangedTextNode=t.target,{from:l.posAtStart,to:l.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Xp=new WeakMap,Jp=!1;function ux(e){if(!Xp.has(e)&&(Xp.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Mt,Jp)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."),Jp=!0}}function Zp(e,t){let n=t.startContainer,l=t.startOffset,r=t.endContainer,a=t.endOffset,i=e.domAtPos(e.state.selection.anchor);return nl(i.node,i.offset,r,a)&&([n,l,r,a]=[r,a,n,l]),{anchorNode:n,anchorOffset:l,focusNode:r,focusOffset:a}}function cx(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Zp(e,r)}let n;function l(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",l,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",l,!0),n?Zp(e,n):null}function dx(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let l=e.docView.nearestDesc(n,!0);if(l&&l.node.isBlock)return n}return null}function fx(e,t){var n;let{focusNode:l,focusOffset:r}=e.domSelectionRange();for(let a of t)if(((n=a.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let i=a.nextSibling;for(;i&&i.nodeName!="TD"&&i.nodeName!="TH";)i=i.nextSibling;if(i){let s=i;for(;;){let o=s.firstChild;if(!o||o.nodeType!=1||o.contentEditable=="false"||/^(BR|IMG)$/.test(o.nodeName))break;s=o}s.insertBefore(a,s.firstChild),l==a&&e.domSelection().collapse(a,r)}else a.parentNode.removeChild(a)}}function hx(e,t,n){let{node:l,fromOffset:r,toOffset:a,from:i,to:s}=e.docView.parseRange(t,n),o=e.domSelectionRange(),u,c=o.anchorNode;if(c&&e.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:o.anchorOffset}],$a(o)||u.push({node:o.focusNode,offset:o.focusOffset})),et&&e.input.lastKeyCode===8)for(let g=a;g>r;g--){let E=l.childNodes[g-1],N=E.pmViewDesc;if(E.nodeName=="BR"&&!N){a=g;break}if(!N||N.size)break}let d=e.state.doc,f=e.someProp("domParser")||wr.fromSchema(e.state.schema),h=d.resolve(i),m=null,v=f.parse(l,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:r,to:a,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:px,context:h});if(u&&u[0].pos!=null){let g=u[0].pos,E=u[1]&&u[1].pos;E==null&&(E=g),m={anchor:g+i,head:E+i}}return{doc:v,sel:m,from:i,to:s}}function px(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(st&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||st&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const bx=/^(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 mx(e,t,n,l,r){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let _=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,I=so(e,_);if(I&&!e.state.selection.eq(I)){if(et&&ln&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",R=>R(e,ll(13,"Enter"))))return;let k=e.state.tr.setSelection(I);_=="pointer"?k.setMeta("pointer",!0):_=="key"&&k.scrollIntoView(),a&&k.setMeta("composition",a),e.dispatch(k)}return}let i=e.state.doc.resolve(t),s=i.sharedDepth(n);t=i.before(s+1),n=e.state.doc.resolve(n).after(s+1);let o=e.state.selection,u=hx(e,t,n),c=e.state.doc,d=c.slice(u.from,u.to),f,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let m=yx(d.content,u.doc.content,u.from,f,h);if(m&&e.input.domChangeCount++,(Fl&&e.input.lastIOSEnter>Date.now()-225||ln)&&r.some(_=>_.nodeType==1&&!bx.test(_.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",_=>_(e,ll(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(l&&o instanceof be&&!o.empty&&o.$head.sameParent(o.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:o.from,endA:o.to,endB:o.to};else{if(u.sel){let _=e0(e,e.state.doc,u.sel);if(_&&!_.eq(e.state.selection)){let I=e.state.tr.setSelection(_);a&&I.setMeta("composition",a),e.dispatch(I)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof be&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),yt&&Sn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let v=u.doc.resolveNoCache(m.start-u.from),g=u.doc.resolveNoCache(m.endB-u.from),E=c.resolve(m.start),N=v.sameParent(g)&&v.parent.inlineContent&&E.end()>=m.endA;if((Fl&&e.input.lastIOSEnter>Date.now()-225&&(!N||r.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!N&&v.pos<u.doc.content.size&&(!v.sameParent(g)||!v.parent.inlineContent)&&v.pos<g.pos&&!/\S/.test(u.doc.textBetween(v.pos,g.pos,"","")))&&e.someProp("handleKeyDown",_=>_(e,ll(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&vx(c,m.start,m.endA,v,g)&&e.someProp("handleKeyDown",_=>_(e,ll(8,"Backspace")))){ln&&et&&e.domObserver.suppressSelectionUpdates();return}et&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),ln&&!N&&v.start()!=g.start()&&g.parentOffset==0&&v.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,g=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(_){return _(e,ll(13,"Enter"))})},20));let A=m.start,L=m.endA,O=_=>{let I=_||e.state.tr.replace(A,L,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let k=e0(e,I.doc,u.sel);k&&!(et&&e.composing&&k.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(k.head==A||k.head==I.mapping.map(L)-1)||yt&&k.empty&&k.head==A)&&I.setSelection(k)}return a&&I.setMeta("composition",a),I.scrollIntoView()},S;if(N)if(v.pos==g.pos){yt&&Sn<=11&&v.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>an(e),20));let _=O(e.state.tr.delete(A,L)),I=c.resolve(m.start).marksAcross(c.resolve(m.endA));I&&_.ensureMarks(I),e.dispatch(_)}else if(m.endA==m.endB&&(S=gx(v.parent.content.cut(v.parentOffset,g.parentOffset),E.parent.content.cut(E.parentOffset,m.endA-E.start())))){let _=O(e.state.tr);S.type=="add"?_.addMark(A,L,S.mark):_.removeMark(A,L,S.mark),e.dispatch(_)}else if(v.parent.child(v.index()).isText&&v.index()==g.index()-(g.textOffset?0:1)){let _=v.parent.textBetween(v.parentOffset,g.parentOffset),I=()=>O(e.state.tr.insertText(_,A,L));e.someProp("handleTextInput",k=>k(e,A,L,_,I))||e.dispatch(I())}else e.dispatch(O());else e.dispatch(O())}function e0(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:uo(e,t.resolve(n.anchor),t.resolve(n.head))}function gx(e,t){let n=e.firstChild.marks,l=t.firstChild.marks,r=n,a=l,i,s,o;for(let c=0;c<l.length;c++)r=l[c].removeFromSet(r);for(let c=0;c<n.length;c++)a=n[c].removeFromSet(a);if(r.length==1&&a.length==0)s=r[0],i="add",o=c=>c.mark(s.addToSet(c.marks));else if(r.length==0&&a.length==1)s=a[0],i="remove",o=c=>c.mark(s.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<t.childCount;c++)u.push(o(t.child(c)));if(K.from(u).eq(e))return{mark:s,type:i}}function vx(e,t,n,l,r){if(n-t<=r.pos-l.pos||So(l,!0,!1)<r.pos)return!1;let a=e.resolve(t);if(!l.parent.isTextblock){let s=a.nodeAfter;return s!=null&&n==t+s.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let i=e.resolve(So(a,!0,!0));return!i.parent.isTextblock||i.pos>n||So(i,!0,!1)<n?!1:l.parent.content.cut(l.parentOffset).eq(i.parent.content)}function So(e,t,n){let l=e.depth,r=t?e.end():e.pos;for(;l>0&&(t||e.indexAfter(l)==e.node(l).childCount);)l--,r++,t=!1;if(n){let a=e.node(l).maybeChild(e.indexAfter(l));for(;a&&!a.isLeaf;)a=a.firstChild,r++}return r}function yx(e,t,n,l,r){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:i,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(r=="end"){let o=Math.max(0,a-Math.min(i,s));l-=i+o-a}if(i<a&&e.size<t.size){let o=l<=a&&l>=i?a-l:0;a-=o,a&&a<t.size&&t0(t.textBetween(a-1,a+1))&&(a+=o?1:-1),s=a+(s-i),i=a}else if(s<a){let o=l<=a&&l>=s?a-l:0;a-=o,a&&a<e.size&&t0(e.textBetween(a-1,a+1))&&(a+=o?1:-1),i=a+(i-s),s=a}return{start:a,endA:i,endB:s}}function t0(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class n0{constructor(t,n){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 PS,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(s0),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=a0(this),r0(this),this.nodeViews=i0(this),this.docView=fp(this.state.doc,l0(this),Co(this),this.dom,this),this.domObserver=new ox(this,(l,r,a,i)=>mx(this,l,r,a,i)),this.domObserver.start(),BS(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&mo(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(s0),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let l in this._props)n[l]=this._props[l];n.state=this.state;for(let l in t)n[l]=t[l];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var l;let r=this.state,a=!1,i=!1;t.storedMarks&&this.composing&&($p(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=i0(this);Tx(h,this.nodeViews)&&(this.nodeViews=h,a=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&mo(this),this.editable=a0(this),r0(this);let o=Co(this),u=l0(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=a||!this.docView.matchesNode(t.doc,u,o);(d||!t.selection.eq(r.selection))&&(i=!0);let f=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Q6(this);if(i){this.domObserver.stop();let h=d&&(yt||et)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&Ex(r.selection,t.selection);if(d){let m=et?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=QS(this)),(a||!this.docView.update(t.doc,u,o,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=fp(t.doc,u,o,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ES(this))?an(this,h):(Cp(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((l=this.dragging)===null||l===void 0)&&l.node&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&X6(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zh(this,n.getBoundingClientRect(),t)}else Zh(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let l=this.directPlugins[n];l.spec.view&&this.pluginViews.push(l.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let l=this.state.plugins[n];l.spec.view&&this.pluginViews.push(l.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let l=this.pluginViews[n];l.update&&l.update(this,t)}}updateDraggedNode(t,n){let l=t.node,r=-1;if(l.from<this.state.doc.content.size&&this.state.doc.nodeAt(l.from)==l.node)r=l.from;else{let a=l.from+(this.state.doc.content.size-n.doc.content.size);(a>0&&a<this.state.doc.content.size&&this.state.doc.nodeAt(a))==l.node&&(r=a)}this.dragging=new Wp(t.slice,t.move,r<0?void 0:he.create(this.state.doc,r))}someProp(t,n){let l=this._props&&this._props[t],r;if(l!=null&&(r=n?n(l):l))return r;for(let i=0;i<this.directPlugins.length;i++){let s=this.directPlugins[i].props[t];if(s!=null&&(r=n?n(s):s))return r}let a=this.state.plugins;if(a)for(let i=0;i<a.length;i++){let s=a[i].props[t];if(s!=null&&(r=n?n(s):s))return r}}hasFocus(){if(yt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&J6(this.dom),an(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return lS(this,t)}coordsAtPos(t,n=1){return ap(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,l=-1){let r=this.docView.posFromDOM(t,n,l);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,n){return oS(this,n||this.state,t)}pasteHTML(t,n){return $r(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return $r(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return ho(this,t)}destroy(){this.docView&&(RS(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Co(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,U6())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return HS(this,t)}domSelectionRange(){let t=this.domSelection();return t?st&&this.root.nodeType===11&&W6(this.dom.ownerDocument)==this.dom&&cx(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}n0.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function l0(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let l in n)l=="class"?t.class+=" "+n[l]:l=="style"?t.style=(t.style?t.style+";":"")+n[l]:!t[l]&&l!="contenteditable"&&l!="nodeName"&&(t[l]=String(n[l]))}),t.translate||(t.translate="no"),[Nt.node(0,e.state.doc.content.size,t)]}function r0(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Nt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function a0(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Ex(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function i0(e){let t=Object.create(null);function n(l){for(let r in l)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=l[r])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Tx(e,t){let n=0,l=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let r in t)l++;return n!=l}function s0(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var _n={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:"'"},Xa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cx=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sx=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)_n[48+tt]=_n[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)_n[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)_n[tt]=String.fromCharCode(tt+32),Xa[tt]=String.fromCharCode(tt);for(var xo in _n)Xa.hasOwnProperty(xo)||(Xa[xo]=_n[xo]);function xx(e){var t=Cx&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Sx&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Xa:_n)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const kx=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Ax=typeof navigator<"u"&&/Win/.test(navigator.platform);function Nx(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let l,r,a,i;for(let s=0;s<t.length-1;s++){let o=t[s];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))l=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))a=!0;else if(/^mod$/i.test(o))kx?i=!0:r=!0;else throw new Error("Unrecognized modifier name: "+o)}return l&&(n="Alt-"+n),r&&(n="Ctrl-"+n),i&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function wx(e){let t=Object.create(null);for(let n in e)t[Nx(n)]=e[n];return t}function ko(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Ix(e){return new ft({props:{handleKeyDown:o0(e)}})}function o0(e){let t=wx(e);return function(n,l){let r=xx(l),a,i=t[ko(r,l)];if(i&&i(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(l.shiftKey){let s=t[ko(r,l,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((l.altKey||l.metaKey||l.ctrlKey)&&!(Ax&&l.ctrlKey&&l.altKey)&&(a=_n[l.keyCode])&&a!=r){let s=t[ko(a,l)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const Ao=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function u0(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const c0=(e,t,n)=>{let l=u0(e,n);if(!l)return!1;let r=No(l);if(!r){let i=l.blockRange(),s=i&&Ml(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}let a=r.nodeBefore;if(y0(e,r,t,-1))return!0;if(l.parent.content.size==0&&($l(a,"end")||he.isSelectable(a)))for(let i=l.depth;;i--){let s=Ua(e.doc,l.before(i),l.after(i),ae.empty);if(s&&s.slice.size<s.to-s.from){if(t){let o=e.tr.step(s);o.setSelection($l(a,"end")?Te.findFrom(o.doc.resolve(o.mapping.map(r.pos,-1)),-1):he.create(o.doc,r.pos-a.nodeSize)),t(o.scrollIntoView())}return!0}if(i==1||l.node(i-1).childCount>1)break}return a.isAtom&&r.depth==l.depth-1?(t&&t(e.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},_x=(e,t,n)=>{let l=u0(e,n);if(!l)return!1;let r=No(l);return r?d0(e,r,t):!1},Ox=(e,t,n)=>{let l=h0(e,n);if(!l)return!1;let r=wo(l);return r?d0(e,r,t):!1};function d0(e,t,n){let l=t.nodeBefore,r=l,a=t.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let c=r.lastChild;if(!c)return!1;r=c}let i=t.nodeAfter,s=i,o=t.pos+1;for(;!s.isTextblock;o++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let u=Ua(e.doc,a,o,ae.empty);if(!u||u.from!=a||u instanceof qe&&u.slice.size>=o-a)return!1;if(n){let c=e.tr.step(u);c.setSelection(be.create(c.doc,a)),n(c.scrollIntoView())}return!0}function $l(e,t,n=!1){for(let l=e;l;l=t=="start"?l.firstChild:l.lastChild){if(l.isTextblock)return!0;if(n&&l.childCount!=1)return!1}return!1}const f0=(e,t,n)=>{let{$head:l,empty:r}=e.selection,a=l;if(!r)return!1;if(l.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):l.parentOffset>0)return!1;a=No(l)}let i=a&&a.nodeBefore;return!i||!he.isSelectable(i)?!1:(t&&t(e.tr.setSelection(he.create(e.doc,a.pos-i.nodeSize)).scrollIntoView()),!0)};function No(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function h0(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const p0=(e,t,n)=>{let l=h0(e,n);if(!l)return!1;let r=wo(l);if(!r)return!1;let a=r.nodeAfter;if(y0(e,r,t,1))return!0;if(l.parent.content.size==0&&($l(a,"start")||he.isSelectable(a))){let i=Ua(e.doc,l.before(),l.after(),ae.empty);if(i&&i.slice.size<i.to-i.from){if(t){let s=e.tr.step(i);s.setSelection($l(a,"start")?Te.findFrom(s.doc.resolve(s.mapping.map(r.pos)),1):he.create(s.doc,s.mapping.map(r.pos))),t(s.scrollIntoView())}return!0}}return a.isAtom&&r.depth==l.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},b0=(e,t,n)=>{let{$head:l,empty:r}=e.selection,a=l;if(!r)return!1;if(l.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):l.parentOffset<l.parent.content.size)return!1;a=wo(l)}let i=a&&a.nodeAfter;return!i||!he.isSelectable(i)?!1:(t&&t(e.tr.setSelection(he.create(e.doc,a.pos)).scrollIntoView()),!0)};function wo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Mx=(e,t)=>{let n=e.selection,l=n instanceof he,r;if(l){if(n.node.isTextblock||!Tn(e.doc,n.from))return!1;r=n.from}else if(r=Ha(e.doc,n.from,-1),r==null)return!1;if(t){let a=e.tr.join(r);l&&a.setSelection(he.create(a.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},Dx=(e,t)=>{let n=e.selection,l;if(n instanceof he){if(n.node.isTextblock||!Tn(e.doc,n.to))return!1;l=n.to}else if(l=Ha(e.doc,n.to,1),l==null)return!1;return t&&t(e.tr.join(l).scrollIntoView()),!0},Lx=(e,t)=>{let{$from:n,$to:l}=e.selection,r=n.blockRange(l),a=r&&Ml(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)},m0=(e,t)=>{let{$head:n,$anchor:l}=e.selection;return!n.parent.type.spec.code||!n.sameParent(l)?!1:(t&&t(e.tr.insertText(`
30
- `).scrollIntoView()),!0)};function Io(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Px=(e,t)=>{let{$head:n,$anchor:l}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(l))return!1;let r=n.node(-1),a=n.indexAfter(-1),i=Io(r.contentMatchAt(a));if(!i||!r.canReplaceWith(a,a,i))return!1;if(t){let s=n.after(),o=e.tr.replaceWith(s,s,i.createAndFill());o.setSelection(Te.near(o.doc.resolve(s),1)),t(o.scrollIntoView())}return!0},g0=(e,t)=>{let n=e.selection,{$from:l,$to:r}=n;if(n instanceof At||l.parent.inlineContent||r.parent.inlineContent)return!1;let a=Io(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let i=(!l.parentOffset&&r.index()<r.parent.childCount?l:r).pos,s=e.tr.insert(i,a.createAndFill());s.setSelection(be.create(s.doc,i+1)),t(s.scrollIntoView())}return!0},v0=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(tn(e.doc,a))return t&&t(e.tr.split(a).scrollIntoView()),!0}let l=n.blockRange(),r=l&&Ml(l);return r==null?!1:(t&&t(e.tr.lift(l,r).scrollIntoView()),!0)};function Bx(e){return(t,n)=>{let{$from:l,$to:r}=t.selection;if(t.selection instanceof he&&t.selection.node.isBlock)return!l.parentOffset||!tn(t.doc,l.pos)?!1:(n&&n(t.tr.split(l.pos).scrollIntoView()),!0);if(!l.depth)return!1;let a=[],i,s,o=!1,u=!1;for(let h=l.depth;;h--)if(l.node(h).isBlock){o=l.end(h)==l.pos+(l.depth-h),u=l.start(h)==l.pos-(l.depth-h),s=Io(l.node(h-1).contentMatchAt(l.indexAfter(h-1))),a.unshift(o&&s?{type:s}:null),i=h;break}else{if(h==1)return!1;a.unshift(null)}let c=t.tr;(t.selection instanceof be||t.selection instanceof At)&&c.deleteSelection();let d=c.mapping.map(l.pos),f=tn(c.doc,d,a.length,a);if(f||(a[0]=s?{type:s}:null,f=tn(c.doc,d,a.length,a)),!f)return!1;if(c.split(d,a.length,a),!o&&u&&l.node(i).type!=s){let h=c.mapping.map(l.before(i)),m=c.doc.resolve(h);s&&l.node(i-1).canReplaceWith(m.index(),m.index()+1,s)&&c.setNodeMarkup(c.mapping.map(l.before(i)),s)}return n&&n(c.scrollIntoView()),!0}}const Rx=Bx(),Fx=(e,t)=>{let{$from:n,to:l}=e.selection,r,a=n.sharedDepth(l);return a==0?!1:(r=n.before(a),t&&t(e.tr.setSelection(he.create(e.doc,r))),!0)};function Hx(e,t,n){let l=t.nodeBefore,r=t.nodeAfter,a=t.index();return!l||!r||!l.type.compatibleContent(r.type)?!1:!l.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-l.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(r.isTextblock||Tn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function y0(e,t,n,l){let r=t.nodeBefore,a=t.nodeAfter,i,s,o=r.type.spec.isolating||a.type.spec.isolating;if(!o&&Hx(e,t,n))return!0;let u=!o&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&s.matchType(i[0]||a.type).validEnd){if(n){let h=t.pos+a.nodeSize,m=K.empty;for(let E=i.length-1;E>=0;E--)m=K.from(i[E].create(null,m));m=K.from(r.copy(m));let v=e.tr.step(new Ke(t.pos-1,h,t.pos,h,new ae(m,1,0),i.length,!0)),g=v.doc.resolve(h+2*i.length);g.nodeAfter&&g.nodeAfter.type==r.type&&Tn(v.doc,g.pos)&&v.join(g.pos),n(v.scrollIntoView())}return!0}let c=a.type.spec.isolating||l>0&&o?null:Te.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),f=d&&Ml(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(u&&$l(a,"start",!0)&&$l(r,"end")){let h=r,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let v=a,g=1;for(;!v.isTextblock;v=v.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,v.content)){if(n){let E=K.empty;for(let A=m.length-1;A>=0;A--)E=K.from(m[A].copy(E));let N=e.tr.step(new Ke(t.pos-m.length,t.pos+a.nodeSize,t.pos+g,t.pos+a.nodeSize-g,new ae(E,m.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function E0(e){return function(t,n){let l=t.selection,r=e<0?l.$from:l.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(t.tr.setSelection(be.create(t.doc,e<0?r.start(a):r.end(a)))),!0):!1}}const Ux=E0(-1),zx=E0(1);function Vx(e,t=null){return function(n,l){let{$from:r,$to:a}=n.selection,i=r.blockRange(a),s=i&&Ys(i,e,t);return s?(l&&l(n.tr.wrap(i,s).scrollIntoView()),!0):!1}}function T0(e,t=null){return function(n,l){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[a];n.doc.nodesBetween(i,s,(o,u)=>{if(r)return!1;if(!(!o.isTextblock||o.hasMarkup(e,t)))if(o.type==e)r=!0;else{let c=n.doc.resolve(u),d=c.index();r=c.parent.canReplaceWith(d,d+1,e)}})}if(!r)return!1;if(l){let a=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[i];a.setBlockType(s,o,e,t)}l(a.scrollIntoView())}return!0}}function _o(...e){return function(t,n,l){for(let r=0;r<e.length;r++)if(e[r](t,n,l))return!0;return!1}}_o(Ao,c0,f0),_o(Ao,p0,b0),_o(m0,g0,v0,Rx),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function $x(e,t=null){return function(n,l){let{$from:r,$to:a}=n.selection,i=r.blockRange(a);if(!i)return!1;let s=l?n.tr:null;return qx(s,i,e,t)?(l&&l(s.scrollIntoView()),!0):!1}}function qx(e,t,n,l=null){let r=!1,a=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let o=i.resolve(t.start-2);a=new Ma(o,o,t.depth),t.endIndex<t.parent.childCount&&(t=new Ma(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let s=Ys(a,n,l,t);return s?(e&&Wx(e,t,s,r,n),!0):!1}function Wx(e,t,n,l,r){let a=K.empty;for(let c=n.length-1;c>=0;c--)a=K.from(n[c].type.create(n[c].attrs,a));e.step(new Ke(t.start-(l?2:0),t.end,t.start,t.end,new ae(a,0,0),n.length,!0));let i=0;for(let c=0;c<n.length;c++)n[c].type==r&&(i=c+1);let s=n.length-i,o=t.start+n.length-(l?2:0),u=t.parent;for(let c=t.startIndex,d=t.endIndex,f=!0;c<d;c++,f=!1)!f&&tn(e.doc,o,s)&&(e.split(o,s),o+=2*s),o+=u.child(c).nodeSize;return e}function Yx(e){return function(t,n){let{$from:l,$to:r}=t.selection,a=l.blockRange(r,i=>i.childCount>0&&i.firstChild.type==e);return a?n?l.node(a.depth-1).type==e?jx(t,n,e,a):Kx(t,n,a):!0:!1}}function jx(e,t,n,l){let r=e.tr,a=l.end,i=l.$to.end(l.depth);a<i&&(r.step(new Ke(a-1,i,a,i,new ae(K.from(n.create(null,l.parent.copy())),1,0),1,!0)),l=new Ma(r.doc.resolve(l.$from.pos),r.doc.resolve(i),l.depth));const s=Ml(l);if(s==null)return!1;r.lift(l,s);let o=r.doc.resolve(r.mapping.map(a,-1)-1);return Tn(r.doc,o.pos)&&o.nodeBefore.type==o.nodeAfter.type&&r.join(o.pos),t(r.scrollIntoView()),!0}function Kx(e,t,n){let l=e.tr,r=n.parent;for(let h=n.end,m=n.endIndex-1,v=n.startIndex;m>v;m--)h-=r.child(m).nodeSize,l.delete(h-1,h+1);let a=l.doc.resolve(n.start),i=a.nodeAfter;if(l.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,o=n.endIndex==r.childCount,u=a.node(-1),c=a.index(-1);if(!u.canReplace(c+(s?0:1),c+1,i.content.append(o?K.empty:K.from(r))))return!1;let d=a.pos,f=d+i.nodeSize;return l.step(new Ke(d-(s?1:0),f+(o?1:0),d+1,f-1,new ae((s?K.empty:K.from(r.copy(K.empty))).append(o?K.empty:K.from(r.copy(K.empty))),s?0:1,o?0:1),s?0:1)),t(l.scrollIntoView()),!0}function Gx(e){return function(t,n){let{$from:l,$to:r}=t.selection,a=l.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!a)return!1;let i=a.startIndex;if(i==0)return!1;let s=a.parent,o=s.child(i-1);if(o.type!=e)return!1;if(n){let u=o.lastChild&&o.lastChild.type==s.type,c=K.from(u?e.create():null),d=new ae(K.from(e.create(null,K.from(s.type.create(null,c)))),u?3:1,0),f=a.start,h=a.end;n(t.tr.step(new Ke(f-(u?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function Ja(e){const{state:t,transaction:n}=e;let{selection:l}=n,{doc:r}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return l},get doc(){return r},get tr(){return l=n.selection,r=n.doc,a=n.storedMarks,n}}}class Za{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:n,state:l}=this,{view:r}=n,{tr:a}=l,i=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([s,o])=>[s,(...c)=>{const d=o(...c)(i);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:l,editor:r,state:a}=this,{view:i}=r,s=[],o=!!t,u=t||a.tr,c=()=>(!o&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(u),s.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(l).map(([f,h])=>[f,(...v)=>{const g=this.buildProps(u,n),E=h(...v)(g);return s.push(E),d}])),run:c};return d}createCan(t){const{rawCommands:n,state:l}=this,r=!1,a=t||l.tr,i=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([o,u])=>[o,(...c)=>u(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(t,n=!0){const{rawCommands:l,editor:r,state:a}=this,{view:i}=r,s={tr:t,editor:r,view:i,state:Ja({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(l).map(([o,u])=>[o,(...c)=>u(...c)(s)]))}};return s}}class Qx{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const l=this.callbacks[t];return l&&l.forEach(r=>r.apply(this,n)),this}off(t,n){const l=this.callbacks[t];return l&&(n?this.callbacks[t]=l.filter(r=>r!==n):delete this.callbacks[t]),this}once(t,n){const l=(...r)=>{this.off(t,l),n.apply(this,r)};return this.on(t,l)}removeAllListeners(){this.callbacks={}}}function se(e,t,n){return e.config[t]===void 0&&e.parent?se(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?se(e.parent,t,n):null}):e.config[t]}function ei(e){const t=e.filter(r=>r.type==="extension"),n=e.filter(r=>r.type==="node"),l=e.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:l}}function C0(e){const t=[],{nodeExtensions:n,markExtensions:l}=ei(e),r=[...n,...l],a={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(i=>{const s={name:i.name,options:i.options,storage:i.storage,extensions:r},o=se(i,"addGlobalAttributes",s);if(!o)return;o().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,h])=>{t.push({type:d,name:f,attribute:{...a,...h}})})})})}),r.forEach(i=>{const s={name:i.name,options:i.options,storage:i.storage},o=se(i,"addAttributes",s);if(!o)return;const u=o();Object.entries(u).forEach(([c,d])=>{const f={...a,...d};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,t.push({type:i.name,name:c,attribute:f})})}),t}function Ge(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function bt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const l={...t};return Object.entries(n).forEach(([r,a])=>{if(!l[r]){l[r]=a;return}if(r==="class"){const s=a?String(a).split(" "):[],o=l[r]?l[r].split(" "):[],u=s.filter(c=>!o.includes(c));l[r]=[...o,...u].join(" ")}else if(r==="style"){const s=a?a.split(";").map(c=>c.trim()).filter(Boolean):[],o=l[r]?l[r].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;o.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),s.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),l[r]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else l[r]=a}),l},{})}function Oo(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,l)=>bt(n,l),{})}function S0(e){return typeof e=="function"}function Ce(e,t=void 0,...n){return S0(e)?t?e.bind(t)(...n):e(...n):e}function Xx(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Jx(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function x0(e,t){return"style"in e?e:{...e,getAttrs:n=>{const l=e.getAttrs?e.getAttrs(n):e.attrs;if(l===!1)return!1;const r=t.reduce((a,i)=>{const s=i.attribute.parseHTML?i.attribute.parseHTML(n):Jx(n.getAttribute(i.name));return s==null?a:{...a,[i.name]:s}},{});return{...l,...r}}}}function k0(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Xx(n)?!1:n!=null))}function Zx(e,t){var n;const l=C0(e),{nodeExtensions:r,markExtensions:a}=ei(e),i=(n=r.find(u=>se(u,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(r.map(u=>{const c=l.filter(E=>E.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:t},f=e.reduce((E,N)=>{const A=se(N,"extendNodeSchema",d);return{...E,...A?A(u):{}}},{}),h=k0({...f,content:Ce(se(u,"content",d)),marks:Ce(se(u,"marks",d)),group:Ce(se(u,"group",d)),inline:Ce(se(u,"inline",d)),atom:Ce(se(u,"atom",d)),selectable:Ce(se(u,"selectable",d)),draggable:Ce(se(u,"draggable",d)),code:Ce(se(u,"code",d)),whitespace:Ce(se(u,"whitespace",d)),linebreakReplacement:Ce(se(u,"linebreakReplacement",d)),defining:Ce(se(u,"defining",d)),isolating:Ce(se(u,"isolating",d)),attrs:Object.fromEntries(c.map(E=>{var N;return[E.name,{default:(N=E?.attribute)===null||N===void 0?void 0:N.default}]}))}),m=Ce(se(u,"parseHTML",d));m&&(h.parseDOM=m.map(E=>x0(E,c)));const v=se(u,"renderHTML",d);v&&(h.toDOM=E=>v({node:E,HTMLAttributes:Oo(E,c)}));const g=se(u,"renderText",d);return g&&(h.toText=g),[u.name,h]})),o=Object.fromEntries(a.map(u=>{const c=l.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:t},f=e.reduce((g,E)=>{const N=se(E,"extendMarkSchema",d);return{...g,...N?N(u):{}}},{}),h=k0({...f,inclusive:Ce(se(u,"inclusive",d)),excludes:Ce(se(u,"excludes",d)),group:Ce(se(u,"group",d)),spanning:Ce(se(u,"spanning",d)),code:Ce(se(u,"code",d)),attrs:Object.fromEntries(c.map(g=>{var E;return[g.name,{default:(E=g?.attribute)===null||E===void 0?void 0:E.default}]}))}),m=Ce(se(u,"parseHTML",d));m&&(h.parseDOM=m.map(g=>x0(g,c)));const v=se(u,"renderHTML",d);return v&&(h.toDOM=g=>v({mark:g,HTMLAttributes:Oo(g,c)})),[u.name,h]}));return new bh({topNode:i,nodes:s,marks:o})}function Mo(e,t){return t.nodes[e]||t.marks[e]||null}function A0(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function Do(e,t){const n=el.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const ek=(e,t=500)=>{let n="";const l=e.parentOffset;return e.parent.nodesBetween(Math.max(0,l-t),l,(r,a,i,s)=>{var o,u;const c=((u=(o=r.type.spec).toText)===null||u===void 0?void 0:u.call(o,{node:r,pos:a,parent:i,index:s}))||r.textContent||"%leaf%";n+=r.isAtom&&!r.isText?c:c.slice(0,Math.max(0,l-a))}),n};function Lo(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class ti{constructor(t){this.find=t.find,this.handler=t.handler}}const tk=(e,t)=>{if(Lo(t))return t.exec(e);const n=t(e);if(!n)return null;const l=[n.text];return l.index=n.index,l.input=e,l.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),l.push(n.replaceWith)),l};function ni(e){var t;const{editor:n,from:l,to:r,text:a,rules:i,plugin:s}=e,{view:o}=n;if(o.composing)return!1;const u=o.state.doc.resolve(l);if(u.parent.type.spec.code||!((t=u.nodeBefore||u.nodeAfter)===null||t===void 0)&&t.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=ek(u)+a;return i.forEach(f=>{if(c)return;const h=tk(d,f.find);if(!h)return;const m=o.state.tr,v=Ja({state:o.state,transaction:m}),g={from:l-(h[0].length-a.length),to:r},{commands:E,chain:N,can:A}=new Za({editor:n,state:v});f.handler({state:v,range:g,match:h,commands:E,chain:N,can:A})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:l,to:r,text:a}),o.dispatch(m),c=!0)}),c}function nk(e){const{editor:t,rules:n}=e,l=new ft({state:{init(){return null},apply(r,a,i){const s=r.getMeta(l);if(s)return s;const o=r.getMeta("applyInputRules");return!!o&&setTimeout(()=>{let{text:c}=o;typeof c=="string"?c=c:c=Do(K.from(c),i.schema);const{from:d}=o,f=d+c.length;ni({editor:t,from:d,to:f,text:c,rules:n,plugin:l})}),r.selectionSet||r.docChanged?null:a}},props:{handleTextInput(r,a,i,s){return ni({editor:t,from:a,to:i,text:s,rules:n,plugin:l})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:a}=r.state.selection;a&&ni({editor:t,from:a.pos,to:a.pos,text:"",rules:n,plugin:l})}),!1)},handleKeyDown(r,a){if(a.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?ni({editor:t,from:i.pos,to:i.pos,text:`
31
- `,rules:n,plugin:l}):!1}},isInputRules:!0});return l}function lk(e){return Object.prototype.toString.call(e).slice(8,-1)}function li(e){return lk(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function ri(e,t){const n={...e};return li(e)&&li(t)&&Object.keys(t).forEach(l=>{li(t[l])&&li(e[l])?n[l]=ri(e[l],t[l]):n[l]=t[l]}),n}class On{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ce(se(this,"addOptions",{name:this.name}))),this.storage=Ce(se(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new On(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>ri(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new On(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ce(se(n,"addOptions",{name:n.name})),n.storage=Ce(se(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:l}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find(u=>u?.type.name===n.name))return!1;const o=i.find(u=>u?.type.name===n.name);return o&&l.removeStoredMark(o),l.insertText(" ",r.pos),t.view.dispatch(l),!0}return!1}}function rk(e){return typeof e=="number"}class ak{constructor(t){this.find=t.find,this.handler=t.handler}}const ik=(e,t,n)=>{if(Lo(t))return[...e.matchAll(t)];const l=t(e,n);return l?l.map(r=>{const a=[r.text];return a.index=r.index,a.input=e,a.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),a.push(r.replaceWith)),a}):[]};function sk(e){const{editor:t,state:n,from:l,to:r,rule:a,pasteEvent:i,dropEvent:s}=e,{commands:o,chain:u,can:c}=new Za({editor:t,state:n}),d=[];return n.doc.nodesBetween(l,r,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const v=Math.max(l,m),g=Math.min(r,m+h.content.size),E=h.textBetween(v-m,g-m,void 0,"");ik(E,a.find,i).forEach(A=>{if(A.index===void 0)return;const L=v+A.index+1,O=L+A[0].length,S={from:n.tr.mapping.map(L),to:n.tr.mapping.map(O)},_=a.handler({state:n,range:S,match:A,commands:o,chain:u,can:c,pasteEvent:i,dropEvent:s});d.push(_)})}),d.every(h=>h!==null)}let ai=null;const ok=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function uk(e){const{editor:t,rules:n}=e;let l=null,r=!1,a=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s;try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}const o=({state:c,from:d,to:f,rule:h,pasteEvt:m})=>{const v=c.tr,g=Ja({state:c,transaction:v});if(!(!sk({editor:t,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:s})||!v.steps.length)){try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return n.map(c=>new ft({view(d){const f=m=>{var v;l=!((v=d.dom.parentElement)===null||v===void 0)&&v.contains(m.target)?d.dom.parentElement:null,l&&(ai=t)},h=()=>{ai&&(ai=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(a=l===d.dom.parentElement,s=f,!a){const h=ai;h?.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return i=f,r=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(d,f,h)=>{const m=d[0],v=m.getMeta("uiEvent")==="paste"&&!r,g=m.getMeta("uiEvent")==="drop"&&!a,E=m.getMeta("applyPasteRules"),N=!!E;if(!v&&!g&&!N)return;if(N){let{text:O}=E;typeof O=="string"?O=O:O=Do(K.from(O),h.schema);const{from:S}=E,_=S+O.length,I=ok(O);return o({rule:c,state:h,from:S,to:{b:_},pasteEvt:I})}const A=f.doc.content.findDiffStart(h.doc.content),L=f.doc.content.findDiffEnd(h.doc.content);if(!(!rk(A)||!L||A===L.b))return o({rule:c,state:h,from:A,to:L,pasteEvt:i})}}))}function ck(e){const t=e.filter((n,l)=>e.indexOf(n)!==l);return Array.from(new Set(t))}class ql{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ql.resolve(t),this.schema=Zx(this.extensions,n),this.setupExtensions()}static resolve(t){const n=ql.sort(ql.flatten(t)),l=ck(n.map(r=>r.name));return l.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${l.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const l={name:n.name,options:n.options,storage:n.storage},r=se(n,"addExtensions",l);return r?[n,...this.flatten(r())]:n}).flat(10)}static sort(t){return t.sort((l,r)=>{const a=se(l,"priority")||100,i=se(r,"priority")||100;return a>i?-1:a<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const l={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Mo(n.name,this.schema)},r=se(n,"addCommands",l);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this,n=ql.sort([...this.extensions].reverse()),l=[],r=[],a=n.map(i=>{const s={name:i.name,options:i.options,storage:i.storage,editor:t,type:Mo(i.name,this.schema)},o=[],u=se(i,"addKeyboardShortcuts",s);let c={};if(i.type==="mark"&&se(i,"exitable",s)&&(c.ArrowRight=()=>On.handleExit({editor:t,mark:i})),u){const v=Object.fromEntries(Object.entries(u()).map(([g,E])=>[g,()=>E({editor:t})]));c={...c,...v}}const d=Ix(c);o.push(d);const f=se(i,"addInputRules",s);A0(i,t.options.enableInputRules)&&f&&l.push(...f());const h=se(i,"addPasteRules",s);A0(i,t.options.enablePasteRules)&&h&&r.push(...h());const m=se(i,"addProseMirrorPlugins",s);if(m){const v=m();o.push(...v)}return o}).flat();return[nk({editor:t,rules:l}),...uk({editor:t,rules:r}),...a]}get attributes(){return C0(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=ei(this.extensions);return Object.fromEntries(n.filter(l=>!!se(l,"addNodeView")).map(l=>{const r=this.attributes.filter(o=>o.type===l.name),a={name:l.name,options:l.options,storage:l.storage,editor:t,type:Ge(l.name,this.schema)},i=se(l,"addNodeView",a);if(!i)return[];const s=(o,u,c,d,f)=>{const h=Oo(o,r);return i()({node:o,view:u,getPos:c,decorations:d,innerDecorations:f,editor:t,extension:l,HTMLAttributes:h})};return[l.name,s]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const l={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Mo(t.name,this.schema)};t.type==="mark"&&(!((n=Ce(se(t,"keepOnSplit",l)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const r=se(t,"onBeforeCreate",l),a=se(t,"onCreate",l),i=se(t,"onUpdate",l),s=se(t,"onSelectionUpdate",l),o=se(t,"onTransaction",l),u=se(t,"onFocus",l),c=se(t,"onBlur",l),d=se(t,"onDestroy",l);r&&this.editor.on("beforeCreate",r),a&&this.editor.on("create",a),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),o&&this.editor.on("transaction",o),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class ut{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ce(se(this,"addOptions",{name:this.name}))),this.storage=Ce(se(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ut(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>ri(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new ut({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ce(se(n,"addOptions",{name:n.name})),n.storage=Ce(se(n,"addStorage",{name:n.name,options:n.options})),n}}function N0(e,t,n){const{from:l,to:r}=t,{blockSeparator:a=`
29
+ `))),0,0),e.someProp("transformPasted",f=>{s=f(s,e,!0)}),s;let d=e.someProp("clipboardTextParser",f=>f(t,r,l,e));if(d)s=d;else{let f=r.marks(),{schema:h}=e.state,m=el.fromSchema(h);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let g=i.appendChild(document.createElement("p"));v&&g.appendChild(m.serializeNode(h.text(v,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),i=OS(n),Rr&&MS(i);let u=i&&i.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||wr.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(o||c),context:r,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!wS.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)s=DS(Bp(s,+c[1],+c[2]),c[4]);else if(s=ae.maxOpen(IS(s.content,r),!0),s.openStart||s.openEnd){let d=0,f=0;for(let h=s.content.firstChild;d<s.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=s.content.lastChild;f<s.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);s=Bp(s,d,f)}return e.someProp("transformPasted",d=>{s=d(s,e,o)}),s}const wS=/^(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 IS(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),a,i=[];if(e.forEach(s=>{if(!i)return;let o=r.findWrapping(s.type),u;if(!o)return i=null;if(u=i.length&&a.length&&Lp(o,a,s,i[i.length-1],0))i[i.length-1]=u;else{i.length&&(i[i.length-1]=Pp(i[i.length-1],a.length));let c=Dp(s,o);i.push(c),r=r.matchType(c.type),a=o}}),i)return K.from(i)}return e}function Dp(e,t,n=0){for(let l=t.length-1;l>=n;l--)e=t[l].create(null,K.from(e));return e}function Lp(e,t,n,l,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let a=Lp(e,t,n,l.lastChild,r+1);if(a)return l.copy(l.content.replaceChild(l.childCount-1,a));if(l.contentMatchAt(l.childCount).matchType(r==e.length-1?n.type:e[r+1]))return l.copy(l.content.append(K.from(Dp(n,e,r+1))))}}function Pp(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Pp(e.lastChild,t-1)),l=e.contentMatchAt(e.childCount).fillBefore(K.empty,!0);return e.copy(n.append(l))}function po(e,t,n,l,r,a){let i=t<0?e.firstChild:e.lastChild,s=i.content;return e.childCount>1&&(a=0),r<l-1&&(s=po(s,t,n,l,r+1,a)),r>=n&&(s=t<0?i.contentMatchAt(0).fillBefore(s,a<=r).append(s):s.append(i.contentMatchAt(i.childCount).fillBefore(K.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,i.copy(s))}function Bp(e,t,n){return t<e.openStart&&(e=new ae(po(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(po(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Rp={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 Fp=null;function Hp(){return Fp||(Fp=document.implementation.createHTMLDocument("title"))}let bo=null;function _S(e){let t=window.trustedTypes;return t?(bo||(bo=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),bo.createHTML(e)):e}function OS(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Hp().createElement("div"),l=/<([a-z][^>\s]+)/i.exec(e),r;if((r=l&&Rp[l[1].toLowerCase()])&&(e=r.map(a=>"<"+a+">").join("")+e+r.map(a=>"</"+a+">").reverse().join("")),n.innerHTML=_S(e),r)for(let a=0;a<r.length;a++)n=n.querySelector(r[a])||n;return n}function MS(e){let t=e.querySelectorAll(et?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let l=t[n];l.childNodes.length==1&&l.textContent==" "&&l.parentNode&&l.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),l)}}function DS(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,l;try{l=JSON.parse(t)}catch{return e}let{content:r,openStart:a,openEnd:i}=e;for(let s=l.length-2;s>=0;s-=2){let o=n.nodes[l[s]];if(!o||o.hasRequiredAttrs())break;r=K.from(o.create(l[s+1],r)),a++,i++}return new ae(r,a,i)}const ht={},pt={},LS={touchstart:!0,touchmove:!0};class PS{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function BS(e){for(let t in ht){let n=ht[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=l=>{FS(e,l)&&!go(e,l)&&(e.editable||!(l.type in pt))&&n(e,l)},LS[t]?{passive:!0}:void 0)}st&&e.dom.addEventListener("input",()=>null),mo(e)}function Nn(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function RS(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function mo(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=l=>go(e,l))})}function go(e,t){return e.someProp("handleDOMEvents",n=>{let l=n[t.type];return l?l(e,t)||t.defaultPrevented:!1})}function FS(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function HS(e,t){!go(e,t)&&ht[t.type]&&(e.editable||!(t.type in pt))&&ht[t.type](e,t)}pt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!zp(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(ln&&et&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Fl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let l=Date.now();e.input.lastIOSEnter=l,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==l&&(e.someProp("handleKeyDown",r=>r(e,ll(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",l=>l(e,n))||NS(e,n)?n.preventDefault():Nn(e,"key")},pt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},pt.keypress=(e,t)=>{let n=t;if(zp(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Dt&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let l=e.state.selection;if(!(l instanceof be)||!l.$from.sameParent(l.$to)){let r=String.fromCharCode(n.charCode),a=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",i=>i(e,l.$from.pos,l.$to.pos,r,a))&&e.dispatch(a()),n.preventDefault()}};function ja(e){return{left:e.clientX,top:e.clientY}}function US(e,t){let n=t.x-e.clientX,l=t.y-e.clientY;return n*n+l*l<100}function vo(e,t,n,l,r){if(l==-1)return!1;let a=e.state.doc.resolve(l);for(let i=a.depth+1;i>0;i--)if(e.someProp(t,s=>i>a.depth?s(e,n,a.nodeAfter,a.before(i),r,!0):s(e,n,a.node(i),a.before(i),r,!1)))return!0;return!1}function zl(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let l=e.state.tr.setSelection(t);l.setMeta("pointer",!0),e.dispatch(l)}function zS(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),l=n.nodeAfter;return l&&l.isAtom&&he.isSelectable(l)?(zl(e,new he(n)),!0):!1}function VS(e,t){if(t==-1)return!1;let n=e.state.selection,l,r;n instanceof he&&(l=n.node);let a=e.state.doc.resolve(t);for(let i=a.depth+1;i>0;i--){let s=i>a.depth?a.nodeAfter:a.node(i);if(he.isSelectable(s)){l&&n.$from.depth>0&&i>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(i);break}}return r!=null?(zl(e,he.create(e.state.doc,r)),!0):!1}function $S(e,t,n,l,r){return vo(e,"handleClickOn",t,n,l)||e.someProp("handleClick",a=>a(e,t,l))||(r?VS(e,n):zS(e,n))}function qS(e,t,n,l){return vo(e,"handleDoubleClickOn",t,n,l)||e.someProp("handleDoubleClick",r=>r(e,t,l))}function WS(e,t,n,l){return vo(e,"handleTripleClickOn",t,n,l)||e.someProp("handleTripleClick",r=>r(e,t,l))||YS(e,n,l)}function YS(e,t,n){if(n.button!=0)return!1;let l=e.state.doc;if(t==-1)return l.inlineContent?(zl(e,be.create(l,0,l.content.size)),!0):!1;let r=l.resolve(t);for(let a=r.depth+1;a>0;a--){let i=a>r.depth?r.nodeAfter:r.node(a),s=r.before(a);if(i.inlineContent)zl(e,be.create(l,s+1,s+1+i.content.size));else if(he.isSelectable(i))zl(e,he.create(l,s));else continue;return!0}}function yo(e){return Ka(e)}const Up=Dt?"metaKey":"ctrlKey";ht.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let l=yo(e),r=Date.now(),a="singleClick";r-e.input.lastClick.time<500&&US(n,e.input.lastClick)&&!n[Up]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button};let i=e.posAtCoords(ja(n));i&&(a=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new jS(e,i,n,!!l)):(a=="doubleClick"?qS:WS)(e,i.pos,i.inside,n)?n.preventDefault():Nn(e,"pointer"))};class jS{constructor(t,n,l,r){this.view=t,this.pos=n,this.event=l,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!l[Up],this.allowDefault=l.shiftKey;let a,i;if(n.inside>-1)a=t.state.doc.nodeAt(n.inside),i=n.inside;else{let c=t.state.doc.resolve(n.pos);a=c.parent,i=c.depth?c.before():0}const s=r?null:l.target,o=s?t.docView.nearestDesc(s,!0):null;this.target=o&&o.nodeDOM.nodeType==1?o.nodeDOM:null;let{selection:u}=t.state;l.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof he&&u.from<=i&&u.to>i)&&(this.mightDrag={node:a,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Mt&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Nn(t,"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(()=>an(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(ja(t))),this.updateAllowDefault(t),this.allowDefault||!n?Nn(this.view,"pointer"):$S(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||st&&this.mightDrag&&!this.mightDrag.node.isAtom||et&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(zl(this.view,Ce.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Nn(this.view,"pointer")}move(t){this.updateAllowDefault(t),Nn(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}ht.touchstart=e=>{e.input.lastTouch=Date.now(),yo(e),Nn(e,"pointer")},ht.touchmove=e=>{e.input.lastTouch=Date.now(),Nn(e,"pointer")},ht.contextmenu=e=>yo(e);function zp(e,t){return e.composing?!0:st&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const KS=ln?5e3:-1;pt.compositionstart=pt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof be&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(l=>l.type.spec.inclusive===!1)||et&&Jh&&GS(e)))e.markCursor=e.state.storedMarks||n.marks(),Ka(e,!0),e.markCursor=null;else if(Ka(e,!t.selection.empty),Mt&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let l=e.domSelectionRange();for(let r=l.focusNode,a=l.focusOffset;r&&r.nodeType==1&&a!=0;){let i=a<0?r.lastChild:r.childNodes[a-1];if(!i)break;if(i.nodeType==3){let s=e.domSelection();s&&s.collapse(i,i.nodeValue.length);break}else r=i,a=-1}}e.input.composing=!0}Vp(e,KS)};function GS(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let l=t.childNodes[n];return l.nodeType==1&&l.contentEditable=="false"}pt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Vp(e,20))};function Vp(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ka(e),t))}function $p(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=XS());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function QS(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=V6(t.focusNode,t.focusOffset),l=$6(t.focusNode,t.focusOffset);if(n&&l&&n!=l){let r=l.pmViewDesc,a=e.domObserver.lastChangedTextNode;if(n==a||l==a)return a;if(!r||!r.isText(l.nodeValue))return l;if(e.input.compositionNode==l){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return l}}return n||l}function XS(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Ka(e,t=!1){if(!(ln&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),$p(e),t||e.docView&&e.docView.dirty){let n=so(e),l=e.state.selection;return n&&!n.eq(l)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!l.$from.node(l.$from.sharedDepth(l.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function JS(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let l=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),l.removeAllRanges(),l.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Vr=yt&&Sn<15||Fl&&j6<604;ht.copy=pt.cut=(e,t)=>{let n=t,l=e.state.selection,r=n.type=="cut";if(l.empty)return;let a=Vr?null:n.clipboardData,i=l.content(),{dom:s,text:o}=ho(e,i);a?(n.preventDefault(),a.clearData(),a.setData("text/html",s.innerHTML),a.setData("text/plain",o)):JS(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ZS(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ex(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,l=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),l.parentNode&&l.parentNode.removeChild(l),n?$r(e,l.value,null,r,t):$r(e,l.textContent,l.innerHTML,r,t)},50)}function $r(e,t,n,l,r){let a=Mp(e,t,n,l,e.state.selection.$from);if(e.someProp("handlePaste",o=>o(e,r,a||ae.empty)))return!0;if(!a)return!1;let i=ZS(a),s=i?e.state.tr.replaceSelectionWith(i,l):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qp(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}pt.paste=(e,t)=>{let n=t;if(e.composing&&!ln)return;let l=Vr?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;l&&$r(e,qp(l),l.getData("text/html"),r,n)?n.preventDefault():ex(e,n)};class Wp{constructor(t,n,l){this.slice=t,this.move=n,this.node=l}}const tx=Dt?"altKey":"ctrlKey";function Yp(e,t){let n;return e.someProp("dragCopies",l=>{n=n||l(t)}),n!=null?!n:!t[tx]}ht.dragstart=(e,t)=>{let n=t,l=e.input.mouseDown;if(l&&l.done(),!n.dataTransfer)return;let r=e.state.selection,a=r.empty?null:e.posAtCoords(ja(n)),i;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof he?r.to-1:r.to))){if(l&&l.mightDrag)i=he.create(e.state.doc,l.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(i=he.create(e.state.doc,d.posBefore))}}let s=(i||e.state.selection).content(),{dom:o,text:u,slice:c}=ho(e,s);(!n.dataTransfer.files.length||!et||Xh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Vr?"Text":"text/html",o.innerHTML),n.dataTransfer.effectAllowed="copyMove",Vr||n.dataTransfer.setData("text/plain",u),e.dragging=new Wp(c,Yp(e,n),i)},ht.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},pt.dragover=pt.dragenter=(e,t)=>t.preventDefault(),pt.drop=(e,t)=>{try{nx(e,t,e.dragging)}finally{e.dragging=null}};function nx(e,t,n){if(!t.dataTransfer)return;let l=e.posAtCoords(ja(t));if(!l)return;let r=e.state.doc.resolve(l.pos),a=n&&n.slice;a?e.someProp("transformPasted",h=>{a=h(a,e,!1)}):a=Mp(e,qp(t.dataTransfer),Vr?null:t.dataTransfer.getData("text/html"),!1,r);let i=!!(n&&Yp(e,t));if(e.someProp("handleDrop",h=>h(e,t,a||ae.empty,i))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Ph(e.state.doc,r.pos,a):r.pos;s==null&&(s=r.pos);let o=e.state.tr;if(i){let{node:h}=n;h?h.replace(o):o.deleteSelection()}let u=o.mapping.map(s),c=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=o.doc;if(c?o.replaceRangeWith(u,u,a.content.firstChild):o.replaceRange(u,u,a),o.doc.eq(d))return;let f=o.doc.resolve(u);if(c&&he.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))o.setSelection(new he(f));else{let h=o.mapping.map(s);o.mapping.maps[o.mapping.maps.length-1].forEach((m,v,g,E)=>h=E),o.setSelection(uo(e,f,o.doc.resolve(h)))}e.focus(),e.dispatch(o.setMeta("uiEvent","drop"))}ht.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&an(e)},20))},ht.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},ht.beforeinput=(e,t)=>{if(et&&ln&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:l}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=l||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",a=>a(e,ll(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in pt)ht[e]=pt[e];function qr(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ga{constructor(t,n){this.toDOM=t,this.spec=n||sl,this.side=this.spec.side||0}map(t,n,l,r){let{pos:a,deleted:i}=t.mapResult(n.from+r,this.side<0?-1:1);return i?null:new Nt(a-l,a-l,this)}valid(){return!0}eq(t){return this==t||t instanceof Ga&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&qr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class wn{constructor(t,n){this.attrs=t,this.spec=n||sl}map(t,n,l,r){let a=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-l,i=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-l;return a>=i?null:new Nt(a,i,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof wn&&qr(this.attrs,t.attrs)&&qr(this.spec,t.spec)}static is(t){return t.type instanceof wn}destroy(){}}class Eo{constructor(t,n){this.attrs=t,this.spec=n||sl}map(t,n,l,r){let a=t.mapResult(n.from+r,1);if(a.deleted)return null;let i=t.mapResult(n.to+r,-1);return i.deleted||i.pos<=a.pos?null:new Nt(a.pos-l,i.pos-l,this)}valid(t,n){let{index:l,offset:r}=t.content.findIndex(n.from),a;return r==n.from&&!(a=t.child(l)).isText&&r+a.nodeSize==n.to}eq(t){return this==t||t instanceof Eo&&qr(this.attrs,t.attrs)&&qr(this.spec,t.spec)}destroy(){}}class Nt{constructor(t,n,l){this.from=t,this.to=n,this.type=l}copy(t,n){return new Nt(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,l){return this.type.map(t,this,n,l)}static widget(t,n,l){return new Nt(t,t,new Ga(n,l))}static inline(t,n,l,r){return new Nt(t,n,new wn(l,r))}static node(t,n,l,r){return new Nt(t,n,new Eo(l,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof wn}get widget(){return this.type instanceof Ga}}const Vl=[],sl={};class We{constructor(t,n){this.local=t.length?t:Vl,this.children=n.length?n:Vl}static create(t,n){return n.length?Qa(n,t,0,sl):ot}find(t,n,l){let r=[];return this.findInner(t??0,n??1e9,r,0,l),r}findInner(t,n,l,r,a){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=n&&s.to>=t&&(!a||a(s.spec))&&l.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,n-s,l,r+s,a)}}map(t,n,l){return this==ot||t.maps.length==0?this:this.mapInner(t,n,0,0,l||sl)}mapInner(t,n,l,r,a){let i;for(let s=0;s<this.local.length;s++){let o=this.local[s].map(t,l,r);o&&o.type.valid(n,o)?(i||(i=[])).push(o):a.onRemove&&a.onRemove(this.local[s].spec)}return this.children.length?lx(this.children,i||[],t,n,l,r,a):i?new We(i.sort(ol),Vl):ot}add(t,n){return n.length?this==ot?We.create(t,n):this.addInner(t,n,0):this}addInner(t,n,l){let r,a=0;t.forEach((s,o)=>{let u=o+l,c;if(c=Kp(n,s,u)){for(r||(r=this.children.slice());a<r.length&&r[a]<o;)a+=3;r[a]==o?r[a+2]=r[a+2].addInner(s,c,u+1):r.splice(a,0,o,o+s.nodeSize,Qa(c,s,u+1,sl)),a+=3}});let i=jp(a?Gp(n):n,-l);for(let s=0;s<i.length;s++)i[s].type.valid(t,i[s])||i.splice(s--,1);return new We(i.length?this.local.concat(i).sort(ol):this.local,r||this.children)}remove(t){return t.length==0||this==ot?this:this.removeInner(t,0)}removeInner(t,n){let l=this.children,r=this.local;for(let a=0;a<l.length;a+=3){let i,s=l[a]+n,o=l[a+1]+n;for(let c=0,d;c<t.length;c++)(d=t[c])&&d.from>s&&d.to<o&&(t[c]=null,(i||(i=[])).push(d));if(!i)continue;l==this.children&&(l=this.children.slice());let u=l[a+2].removeInner(i,s+1);u!=ot?l[a+2]=u:(l.splice(a,3),a-=3)}if(r.length){for(let a=0,i;a<t.length;a++)if(i=t[a])for(let s=0;s<r.length;s++)r[s].eq(i,n)&&(r==this.local&&(r=this.local.slice()),r.splice(s--,1))}return l==this.children&&r==this.local?this:r.length||l.length?new We(r,l):ot}forChild(t,n){if(this==ot)return this;if(n.isLeaf)return We.empty;let l,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(l=this.children[s+2]);break}let a=t+1,i=a+n.content.size;for(let s=0;s<this.local.length;s++){let o=this.local[s];if(o.from<i&&o.to>a&&o.type instanceof wn){let u=Math.max(a,o.from)-a,c=Math.min(i,o.to)-a;u<c&&(r||(r=[])).push(o.copy(u,c))}}if(r){let s=new We(r.sort(ol),Vl);return l?new In([s,l]):s}return l||ot}eq(t){if(this==t)return!0;if(!(t instanceof We)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return To(this.localsInner(t))}localsInner(t){if(this==ot)return Vl;if(t.inlineContent||!this.local.some(wn.is))return this.local;let n=[];for(let l=0;l<this.local.length;l++)this.local[l].type instanceof wn||n.push(this.local[l]);return n}forEachSet(t){t(this)}}We.empty=new We([],[]),We.removeOverlap=To;const ot=We.empty;class In{constructor(t){this.members=t}map(t,n){const l=this.members.map(r=>r.map(t,n,sl));return In.from(l)}forChild(t,n){if(n.isLeaf)return We.empty;let l=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(t,n);a!=ot&&(a instanceof In?l=l.concat(a.members):l.push(a))}return In.from(l)}eq(t){if(!(t instanceof In)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,l=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(t);if(a.length)if(!n)n=a;else{l&&(n=n.slice(),l=!1);for(let i=0;i<a.length;i++)n.push(a[i])}}return n?To(l?n:n.sort(ol)):Vl}static from(t){switch(t.length){case 0:return ot;case 1:return t[0];default:return new In(t.every(n=>n instanceof We)?t:t.reduce((n,l)=>n.concat(l instanceof We?l:l.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function lx(e,t,n,l,r,a,i){let s=e.slice();for(let u=0,c=a;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,h,m,v)=>{let g=v-m-(h-f);for(let E=0;E<s.length;E+=3){let N=s[E+1];if(N<0||f>N+c-d)continue;let A=s[E]+c-d;h>=A?s[E+1]=f<=A?-2:-1:f>=c&&g&&(s[E]+=g,s[E+1]+=g)}d+=g}),c=n.maps[u].map(c,-1)}let o=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(s[u+1]==-2){o=!0,s[u+1]=-1;continue}let c=n.map(e[u]+a),d=c-r;if(d<0||d>=l.content.size){o=!0;continue}let f=n.map(e[u+1]+a,-1),h=f-r,{index:m,offset:v}=l.content.findIndex(d),g=l.maybeChild(m);if(g&&v==d&&v+g.nodeSize==h){let E=s[u+2].mapInner(n,g,c+1,e[u]+a+1,i);E!=ot?(s[u]=d,s[u+1]=h,s[u+2]=E):(s[u+1]=-2,o=!0)}else o=!0}if(o){let u=rx(s,e,t,n,r,a,i),c=Qa(u,l,0,i);t=c.local;for(let d=0;d<s.length;d+=3)s[d+1]<0&&(s.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let h=c.children[d];for(;f<s.length&&s[f]<h;)f+=3;s.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new We(t.sort(ol),s)}function jp(e,t){if(!t||!e.length)return e;let n=[];for(let l=0;l<e.length;l++){let r=e[l];n.push(new Nt(r.from+t,r.to+t,r.type))}return n}function rx(e,t,n,l,r,a,i){function s(o,u){for(let c=0;c<o.local.length;c++){let d=o.local[c].map(l,r,u);d?n.push(d):i.onRemove&&i.onRemove(o.local[c].spec)}for(let c=0;c<o.children.length;c+=3)s(o.children[c+2],o.children[c]+u+1)}for(let o=0;o<e.length;o+=3)e[o+1]==-1&&s(e[o+2],t[o]+a+1);return n}function Kp(e,t,n){if(t.isLeaf)return null;let l=n+t.nodeSize,r=null;for(let a=0,i;a<e.length;a++)(i=e[a])&&i.from>n&&i.to<l&&((r||(r=[])).push(i),e[a]=null);return r}function Gp(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Qa(e,t,n,l){let r=[],a=!1;t.forEach((s,o)=>{let u=Kp(e,s,o+n);if(u){a=!0;let c=Qa(u,s,n+o+1,l);c!=ot&&r.push(o,o+s.nodeSize,c)}});let i=jp(a?Gp(e):e,-n).sort(ol);for(let s=0;s<i.length;s++)i[s].type.valid(t,i[s])||(l.onRemove&&l.onRemove(i[s].spec),i.splice(s--,1));return i.length||r.length?new We(i,r):ot}function ol(e,t){return e.from-t.from||e.to-t.to}function To(e){let t=e;for(let n=0;n<t.length-1;n++){let l=t[n];if(l.from!=l.to)for(let r=n+1;r<t.length;r++){let a=t[r];if(a.from==l.from){a.to!=l.to&&(t==e&&(t=e.slice()),t[r]=a.copy(a.from,l.to),Qp(t,r+1,a.copy(l.to,a.to)));continue}else{a.from<l.to&&(t==e&&(t=e.slice()),t[n]=l.copy(l.from,a.from),Qp(t,r,l.copy(a.from,l.to)));break}}}return t}function Qp(e,t,n){for(;t<e.length&&ol(n,e[t])>0;)t++;e.splice(t,0,n)}function Co(e){let t=[];return e.someProp("decorations",n=>{let l=n(e.state);l&&l!=ot&&t.push(l)}),e.cursorWrapper&&t.push(We.create(e.state.doc,[e.cursorWrapper.deco])),In.from(t)}const ax={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ix=yt&&Sn<=11;class sx{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class ox{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sx,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(l=>{for(let r=0;r<l.length;r++)this.queue.push(l[r]);yt&&Sn<=11&&l.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():st&&t.composing&&l.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ix&&(this.onCharData=l=>{this.queue.push({target:l.target,type:"characterData",oldValue:l.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,ax)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);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(xp(this.view)){if(this.suppressingSelectionUpdates)return an(this.view);if(yt&&Sn<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&nl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,l;for(let a=t.focusNode;a;a=Rl(a))n.add(a);for(let a=t.anchorNode;a;a=Rl(a))if(n.has(a)){l=a;break}let r=l&&this.view.docView.nearestDesc(l);if(r&&r.ignoreMutation({type:"selection",target:l.nodeType==3?l.parentNode:l}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let l=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(l)&&xp(t)&&!this.ignoreSelectionChange(l),a=-1,i=-1,s=!1,o=[];if(t.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],o);d&&(a=a<0?d.from:Math.min(d.from,a),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(s=!0))}if(o.some(c=>c.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let c of o)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(Mt&&o.length){let c=o.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||dx(t,d)!=h)&&f.remove()}}}let u=null;a<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&$a(l)&&(u=so(t))&&u.eq(Ce.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,an(t),this.currentSelection.set(l),t.scrollToSelection()):(a>-1||r)&&(a>-1&&(t.docView.markDirty(a,i),ux(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,fx(t,o)),this.handleDOMChange(a,i,s,o),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(l)||an(t),this.currentSelection.set(l))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let l=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(l==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!l||l.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;c<t.addedNodes.length;c++){let d=t.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(l.contentDOM&&l.contentDOM!=l.dom&&!l.contentDOM.contains(t.target))return{from:l.posBefore,to:l.posAfter};let r=t.previousSibling,a=t.nextSibling;if(yt&&Sn<=11&&t.addedNodes.length)for(let c=0;c<t.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=t.addedNodes[c];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(r=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(a=f)}let i=r&&r.parentNode==t.target?Ze(r)+1:0,s=l.localPosFromDOM(t.target,i,-1),o=a&&a.parentNode==t.target?Ze(a):t.target.childNodes.length,u=l.localPosFromDOM(t.target,o,1);return{from:s,to:u}}else return t.type=="attributes"?{from:l.posAtStart-l.border,to:l.posAtEnd+l.border}:(this.lastChangedTextNode=t.target,{from:l.posAtStart,to:l.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Xp=new WeakMap,Jp=!1;function ux(e){if(!Xp.has(e)&&(Xp.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Mt,Jp)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."),Jp=!0}}function Zp(e,t){let n=t.startContainer,l=t.startOffset,r=t.endContainer,a=t.endOffset,i=e.domAtPos(e.state.selection.anchor);return nl(i.node,i.offset,r,a)&&([n,l,r,a]=[r,a,n,l]),{anchorNode:n,anchorOffset:l,focusNode:r,focusOffset:a}}function cx(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return Zp(e,r)}let n;function l(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",l,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",l,!0),n?Zp(e,n):null}function dx(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let l=e.docView.nearestDesc(n,!0);if(l&&l.node.isBlock)return n}return null}function fx(e,t){var n;let{focusNode:l,focusOffset:r}=e.domSelectionRange();for(let a of t)if(((n=a.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let i=a.nextSibling;for(;i&&i.nodeName!="TD"&&i.nodeName!="TH";)i=i.nextSibling;if(i){let s=i;for(;;){let o=s.firstChild;if(!o||o.nodeType!=1||o.contentEditable=="false"||/^(BR|IMG)$/.test(o.nodeName))break;s=o}s.insertBefore(a,s.firstChild),l==a&&e.domSelection().collapse(a,r)}else a.parentNode.removeChild(a)}}function hx(e,t,n){let{node:l,fromOffset:r,toOffset:a,from:i,to:s}=e.docView.parseRange(t,n),o=e.domSelectionRange(),u,c=o.anchorNode;if(c&&e.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:o.anchorOffset}],$a(o)||u.push({node:o.focusNode,offset:o.focusOffset})),et&&e.input.lastKeyCode===8)for(let g=a;g>r;g--){let E=l.childNodes[g-1],N=E.pmViewDesc;if(E.nodeName=="BR"&&!N){a=g;break}if(!N||N.size)break}let d=e.state.doc,f=e.someProp("domParser")||wr.fromSchema(e.state.schema),h=d.resolve(i),m=null,v=f.parse(l,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:r,to:a,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:px,context:h});if(u&&u[0].pos!=null){let g=u[0].pos,E=u[1]&&u[1].pos;E==null&&(E=g),m={anchor:g+i,head:E+i}}return{doc:v,sel:m,from:i,to:s}}function px(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(st&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||st&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const bx=/^(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 mx(e,t,n,l,r){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let _=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,I=so(e,_);if(I&&!e.state.selection.eq(I)){if(et&&ln&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",R=>R(e,ll(13,"Enter"))))return;let k=e.state.tr.setSelection(I);_=="pointer"?k.setMeta("pointer",!0):_=="key"&&k.scrollIntoView(),a&&k.setMeta("composition",a),e.dispatch(k)}return}let i=e.state.doc.resolve(t),s=i.sharedDepth(n);t=i.before(s+1),n=e.state.doc.resolve(n).after(s+1);let o=e.state.selection,u=hx(e,t,n),c=e.state.doc,d=c.slice(u.from,u.to),f,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let m=yx(d.content,u.doc.content,u.from,f,h);if(m&&e.input.domChangeCount++,(Fl&&e.input.lastIOSEnter>Date.now()-225||ln)&&r.some(_=>_.nodeType==1&&!bx.test(_.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",_=>_(e,ll(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(l&&o instanceof be&&!o.empty&&o.$head.sameParent(o.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:o.from,endA:o.to,endB:o.to};else{if(u.sel){let _=e0(e,e.state.doc,u.sel);if(_&&!_.eq(e.state.selection)){let I=e.state.tr.setSelection(_);a&&I.setMeta("composition",a),e.dispatch(I)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof be&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),yt&&Sn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let v=u.doc.resolveNoCache(m.start-u.from),g=u.doc.resolveNoCache(m.endB-u.from),E=c.resolve(m.start),N=v.sameParent(g)&&v.parent.inlineContent&&E.end()>=m.endA;if((Fl&&e.input.lastIOSEnter>Date.now()-225&&(!N||r.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!N&&v.pos<u.doc.content.size&&(!v.sameParent(g)||!v.parent.inlineContent)&&v.pos<g.pos&&!/\S/.test(u.doc.textBetween(v.pos,g.pos,"","")))&&e.someProp("handleKeyDown",_=>_(e,ll(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&vx(c,m.start,m.endA,v,g)&&e.someProp("handleKeyDown",_=>_(e,ll(8,"Backspace")))){ln&&et&&e.domObserver.suppressSelectionUpdates();return}et&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),ln&&!N&&v.start()!=g.start()&&g.parentOffset==0&&v.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,g=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(_){return _(e,ll(13,"Enter"))})},20));let A=m.start,L=m.endA,O=_=>{let I=_||e.state.tr.replace(A,L,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let k=e0(e,I.doc,u.sel);k&&!(et&&e.composing&&k.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(k.head==A||k.head==I.mapping.map(L)-1)||yt&&k.empty&&k.head==A)&&I.setSelection(k)}return a&&I.setMeta("composition",a),I.scrollIntoView()},S;if(N)if(v.pos==g.pos){yt&&Sn<=11&&v.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>an(e),20));let _=O(e.state.tr.delete(A,L)),I=c.resolve(m.start).marksAcross(c.resolve(m.endA));I&&_.ensureMarks(I),e.dispatch(_)}else if(m.endA==m.endB&&(S=gx(v.parent.content.cut(v.parentOffset,g.parentOffset),E.parent.content.cut(E.parentOffset,m.endA-E.start())))){let _=O(e.state.tr);S.type=="add"?_.addMark(A,L,S.mark):_.removeMark(A,L,S.mark),e.dispatch(_)}else if(v.parent.child(v.index()).isText&&v.index()==g.index()-(g.textOffset?0:1)){let _=v.parent.textBetween(v.parentOffset,g.parentOffset),I=()=>O(e.state.tr.insertText(_,A,L));e.someProp("handleTextInput",k=>k(e,A,L,_,I))||e.dispatch(I())}else e.dispatch(O());else e.dispatch(O())}function e0(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:uo(e,t.resolve(n.anchor),t.resolve(n.head))}function gx(e,t){let n=e.firstChild.marks,l=t.firstChild.marks,r=n,a=l,i,s,o;for(let c=0;c<l.length;c++)r=l[c].removeFromSet(r);for(let c=0;c<n.length;c++)a=n[c].removeFromSet(a);if(r.length==1&&a.length==0)s=r[0],i="add",o=c=>c.mark(s.addToSet(c.marks));else if(r.length==0&&a.length==1)s=a[0],i="remove",o=c=>c.mark(s.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<t.childCount;c++)u.push(o(t.child(c)));if(K.from(u).eq(e))return{mark:s,type:i}}function vx(e,t,n,l,r){if(n-t<=r.pos-l.pos||So(l,!0,!1)<r.pos)return!1;let a=e.resolve(t);if(!l.parent.isTextblock){let s=a.nodeAfter;return s!=null&&n==t+s.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let i=e.resolve(So(a,!0,!0));return!i.parent.isTextblock||i.pos>n||So(i,!0,!1)<n?!1:l.parent.content.cut(l.parentOffset).eq(i.parent.content)}function So(e,t,n){let l=e.depth,r=t?e.end():e.pos;for(;l>0&&(t||e.indexAfter(l)==e.node(l).childCount);)l--,r++,t=!1;if(n){let a=e.node(l).maybeChild(e.indexAfter(l));for(;a&&!a.isLeaf;)a=a.firstChild,r++}return r}function yx(e,t,n,l,r){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:i,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(r=="end"){let o=Math.max(0,a-Math.min(i,s));l-=i+o-a}if(i<a&&e.size<t.size){let o=l<=a&&l>=i?a-l:0;a-=o,a&&a<t.size&&t0(t.textBetween(a-1,a+1))&&(a+=o?1:-1),s=a+(s-i),i=a}else if(s<a){let o=l<=a&&l>=s?a-l:0;a-=o,a&&a<e.size&&t0(e.textBetween(a-1,a+1))&&(a+=o?1:-1),i=a+(i-s),s=a}return{start:a,endA:i,endB:s}}function t0(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class n0{constructor(t,n){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 PS,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(s0),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=a0(this),r0(this),this.nodeViews=i0(this),this.docView=fp(this.state.doc,l0(this),Co(this),this.dom,this),this.domObserver=new ox(this,(l,r,a,i)=>mx(this,l,r,a,i)),this.domObserver.start(),BS(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&mo(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(s0),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let l in this._props)n[l]=this._props[l];n.state=this.state;for(let l in t)n[l]=t[l];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var l;let r=this.state,a=!1,i=!1;t.storedMarks&&this.composing&&($p(this),i=!0),this.state=t;let s=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=i0(this);Tx(h,this.nodeViews)&&(this.nodeViews=h,a=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&mo(this),this.editable=a0(this),r0(this);let o=Co(this),u=l0(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=a||!this.docView.matchesNode(t.doc,u,o);(d||!t.selection.eq(r.selection))&&(i=!0);let f=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Q6(this);if(i){this.domObserver.stop();let h=d&&(yt||et)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&Ex(r.selection,t.selection);if(d){let m=et?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=QS(this)),(a||!this.docView.update(t.doc,u,o,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=fp(t.doc,u,o,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ES(this))?an(this,h):(Cp(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((l=this.dragging)===null||l===void 0)&&l.node&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&X6(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zh(this,n.getBoundingClientRect(),t)}else Zh(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let l=this.directPlugins[n];l.spec.view&&this.pluginViews.push(l.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let l=this.state.plugins[n];l.spec.view&&this.pluginViews.push(l.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let l=this.pluginViews[n];l.update&&l.update(this,t)}}updateDraggedNode(t,n){let l=t.node,r=-1;if(l.from<this.state.doc.content.size&&this.state.doc.nodeAt(l.from)==l.node)r=l.from;else{let a=l.from+(this.state.doc.content.size-n.doc.content.size);(a>0&&a<this.state.doc.content.size&&this.state.doc.nodeAt(a))==l.node&&(r=a)}this.dragging=new Wp(t.slice,t.move,r<0?void 0:he.create(this.state.doc,r))}someProp(t,n){let l=this._props&&this._props[t],r;if(l!=null&&(r=n?n(l):l))return r;for(let i=0;i<this.directPlugins.length;i++){let s=this.directPlugins[i].props[t];if(s!=null&&(r=n?n(s):s))return r}let a=this.state.plugins;if(a)for(let i=0;i<a.length;i++){let s=a[i].props[t];if(s!=null&&(r=n?n(s):s))return r}}hasFocus(){if(yt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&J6(this.dom),an(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return lS(this,t)}coordsAtPos(t,n=1){return ap(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,l=-1){let r=this.docView.posFromDOM(t,n,l);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,n){return oS(this,n||this.state,t)}pasteHTML(t,n){return $r(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return $r(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return ho(this,t)}destroy(){this.docView&&(RS(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Co(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,U6())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return HS(this,t)}domSelectionRange(){let t=this.domSelection();return t?st&&this.root.nodeType===11&&W6(this.dom.ownerDocument)==this.dom&&cx(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}n0.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function l0(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let l in n)l=="class"?t.class+=" "+n[l]:l=="style"?t.style=(t.style?t.style+";":"")+n[l]:!t[l]&&l!="contenteditable"&&l!="nodeName"&&(t[l]=String(n[l]))}),t.translate||(t.translate="no"),[Nt.node(0,e.state.doc.content.size,t)]}function r0(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Nt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function a0(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Ex(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function i0(e){let t=Object.create(null);function n(l){for(let r in l)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=l[r])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Tx(e,t){let n=0,l=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let r in t)l++;return n!=l}function s0(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var _n={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:"'"},Xa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cx=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sx=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)_n[48+tt]=_n[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)_n[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)_n[tt]=String.fromCharCode(tt+32),Xa[tt]=String.fromCharCode(tt);for(var xo in _n)Xa.hasOwnProperty(xo)||(Xa[xo]=_n[xo]);function xx(e){var t=Cx&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Sx&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Xa:_n)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const kx=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Ax=typeof navigator<"u"&&/Win/.test(navigator.platform);function Nx(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let l,r,a,i;for(let s=0;s<t.length-1;s++){let o=t[s];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))l=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))a=!0;else if(/^mod$/i.test(o))kx?i=!0:r=!0;else throw new Error("Unrecognized modifier name: "+o)}return l&&(n="Alt-"+n),r&&(n="Ctrl-"+n),i&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function wx(e){let t=Object.create(null);for(let n in e)t[Nx(n)]=e[n];return t}function ko(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Ix(e){return new ft({props:{handleKeyDown:o0(e)}})}function o0(e){let t=wx(e);return function(n,l){let r=xx(l),a,i=t[ko(r,l)];if(i&&i(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(l.shiftKey){let s=t[ko(r,l,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((l.altKey||l.metaKey||l.ctrlKey)&&!(Ax&&l.ctrlKey&&l.altKey)&&(a=_n[l.keyCode])&&a!=r){let s=t[ko(a,l)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const Ao=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function u0(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const c0=(e,t,n)=>{let l=u0(e,n);if(!l)return!1;let r=No(l);if(!r){let i=l.blockRange(),s=i&&Ml(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}let a=r.nodeBefore;if(y0(e,r,t,-1))return!0;if(l.parent.content.size==0&&($l(a,"end")||he.isSelectable(a)))for(let i=l.depth;;i--){let s=Ua(e.doc,l.before(i),l.after(i),ae.empty);if(s&&s.slice.size<s.to-s.from){if(t){let o=e.tr.step(s);o.setSelection($l(a,"end")?Ce.findFrom(o.doc.resolve(o.mapping.map(r.pos,-1)),-1):he.create(o.doc,r.pos-a.nodeSize)),t(o.scrollIntoView())}return!0}if(i==1||l.node(i-1).childCount>1)break}return a.isAtom&&r.depth==l.depth-1?(t&&t(e.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},_x=(e,t,n)=>{let l=u0(e,n);if(!l)return!1;let r=No(l);return r?d0(e,r,t):!1},Ox=(e,t,n)=>{let l=h0(e,n);if(!l)return!1;let r=wo(l);return r?d0(e,r,t):!1};function d0(e,t,n){let l=t.nodeBefore,r=l,a=t.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let c=r.lastChild;if(!c)return!1;r=c}let i=t.nodeAfter,s=i,o=t.pos+1;for(;!s.isTextblock;o++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let u=Ua(e.doc,a,o,ae.empty);if(!u||u.from!=a||u instanceof qe&&u.slice.size>=o-a)return!1;if(n){let c=e.tr.step(u);c.setSelection(be.create(c.doc,a)),n(c.scrollIntoView())}return!0}function $l(e,t,n=!1){for(let l=e;l;l=t=="start"?l.firstChild:l.lastChild){if(l.isTextblock)return!0;if(n&&l.childCount!=1)return!1}return!1}const f0=(e,t,n)=>{let{$head:l,empty:r}=e.selection,a=l;if(!r)return!1;if(l.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):l.parentOffset>0)return!1;a=No(l)}let i=a&&a.nodeBefore;return!i||!he.isSelectable(i)?!1:(t&&t(e.tr.setSelection(he.create(e.doc,a.pos-i.nodeSize)).scrollIntoView()),!0)};function No(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function h0(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const p0=(e,t,n)=>{let l=h0(e,n);if(!l)return!1;let r=wo(l);if(!r)return!1;let a=r.nodeAfter;if(y0(e,r,t,1))return!0;if(l.parent.content.size==0&&($l(a,"start")||he.isSelectable(a))){let i=Ua(e.doc,l.before(),l.after(),ae.empty);if(i&&i.slice.size<i.to-i.from){if(t){let s=e.tr.step(i);s.setSelection($l(a,"start")?Ce.findFrom(s.doc.resolve(s.mapping.map(r.pos)),1):he.create(s.doc,s.mapping.map(r.pos))),t(s.scrollIntoView())}return!0}}return a.isAtom&&r.depth==l.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},b0=(e,t,n)=>{let{$head:l,empty:r}=e.selection,a=l;if(!r)return!1;if(l.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):l.parentOffset<l.parent.content.size)return!1;a=wo(l)}let i=a&&a.nodeAfter;return!i||!he.isSelectable(i)?!1:(t&&t(e.tr.setSelection(he.create(e.doc,a.pos)).scrollIntoView()),!0)};function wo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Mx=(e,t)=>{let n=e.selection,l=n instanceof he,r;if(l){if(n.node.isTextblock||!Tn(e.doc,n.from))return!1;r=n.from}else if(r=Ha(e.doc,n.from,-1),r==null)return!1;if(t){let a=e.tr.join(r);l&&a.setSelection(he.create(a.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},Dx=(e,t)=>{let n=e.selection,l;if(n instanceof he){if(n.node.isTextblock||!Tn(e.doc,n.to))return!1;l=n.to}else if(l=Ha(e.doc,n.to,1),l==null)return!1;return t&&t(e.tr.join(l).scrollIntoView()),!0},Lx=(e,t)=>{let{$from:n,$to:l}=e.selection,r=n.blockRange(l),a=r&&Ml(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)},m0=(e,t)=>{let{$head:n,$anchor:l}=e.selection;return!n.parent.type.spec.code||!n.sameParent(l)?!1:(t&&t(e.tr.insertText(`
30
+ `).scrollIntoView()),!0)};function Io(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Px=(e,t)=>{let{$head:n,$anchor:l}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(l))return!1;let r=n.node(-1),a=n.indexAfter(-1),i=Io(r.contentMatchAt(a));if(!i||!r.canReplaceWith(a,a,i))return!1;if(t){let s=n.after(),o=e.tr.replaceWith(s,s,i.createAndFill());o.setSelection(Ce.near(o.doc.resolve(s),1)),t(o.scrollIntoView())}return!0},g0=(e,t)=>{let n=e.selection,{$from:l,$to:r}=n;if(n instanceof At||l.parent.inlineContent||r.parent.inlineContent)return!1;let a=Io(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let i=(!l.parentOffset&&r.index()<r.parent.childCount?l:r).pos,s=e.tr.insert(i,a.createAndFill());s.setSelection(be.create(s.doc,i+1)),t(s.scrollIntoView())}return!0},v0=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(tn(e.doc,a))return t&&t(e.tr.split(a).scrollIntoView()),!0}let l=n.blockRange(),r=l&&Ml(l);return r==null?!1:(t&&t(e.tr.lift(l,r).scrollIntoView()),!0)};function Bx(e){return(t,n)=>{let{$from:l,$to:r}=t.selection;if(t.selection instanceof he&&t.selection.node.isBlock)return!l.parentOffset||!tn(t.doc,l.pos)?!1:(n&&n(t.tr.split(l.pos).scrollIntoView()),!0);if(!l.depth)return!1;let a=[],i,s,o=!1,u=!1;for(let h=l.depth;;h--)if(l.node(h).isBlock){o=l.end(h)==l.pos+(l.depth-h),u=l.start(h)==l.pos-(l.depth-h),s=Io(l.node(h-1).contentMatchAt(l.indexAfter(h-1))),a.unshift(o&&s?{type:s}:null),i=h;break}else{if(h==1)return!1;a.unshift(null)}let c=t.tr;(t.selection instanceof be||t.selection instanceof At)&&c.deleteSelection();let d=c.mapping.map(l.pos),f=tn(c.doc,d,a.length,a);if(f||(a[0]=s?{type:s}:null,f=tn(c.doc,d,a.length,a)),!f)return!1;if(c.split(d,a.length,a),!o&&u&&l.node(i).type!=s){let h=c.mapping.map(l.before(i)),m=c.doc.resolve(h);s&&l.node(i-1).canReplaceWith(m.index(),m.index()+1,s)&&c.setNodeMarkup(c.mapping.map(l.before(i)),s)}return n&&n(c.scrollIntoView()),!0}}const Rx=Bx(),Fx=(e,t)=>{let{$from:n,to:l}=e.selection,r,a=n.sharedDepth(l);return a==0?!1:(r=n.before(a),t&&t(e.tr.setSelection(he.create(e.doc,r))),!0)};function Hx(e,t,n){let l=t.nodeBefore,r=t.nodeAfter,a=t.index();return!l||!r||!l.type.compatibleContent(r.type)?!1:!l.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-l.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(r.isTextblock||Tn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function y0(e,t,n,l){let r=t.nodeBefore,a=t.nodeAfter,i,s,o=r.type.spec.isolating||a.type.spec.isolating;if(!o&&Hx(e,t,n))return!0;let u=!o&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&s.matchType(i[0]||a.type).validEnd){if(n){let h=t.pos+a.nodeSize,m=K.empty;for(let E=i.length-1;E>=0;E--)m=K.from(i[E].create(null,m));m=K.from(r.copy(m));let v=e.tr.step(new Ke(t.pos-1,h,t.pos,h,new ae(m,1,0),i.length,!0)),g=v.doc.resolve(h+2*i.length);g.nodeAfter&&g.nodeAfter.type==r.type&&Tn(v.doc,g.pos)&&v.join(g.pos),n(v.scrollIntoView())}return!0}let c=a.type.spec.isolating||l>0&&o?null:Ce.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),f=d&&Ml(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(u&&$l(a,"start",!0)&&$l(r,"end")){let h=r,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let v=a,g=1;for(;!v.isTextblock;v=v.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,v.content)){if(n){let E=K.empty;for(let A=m.length-1;A>=0;A--)E=K.from(m[A].copy(E));let N=e.tr.step(new Ke(t.pos-m.length,t.pos+a.nodeSize,t.pos+g,t.pos+a.nodeSize-g,new ae(E,m.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function E0(e){return function(t,n){let l=t.selection,r=e<0?l.$from:l.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(t.tr.setSelection(be.create(t.doc,e<0?r.start(a):r.end(a)))),!0):!1}}const Ux=E0(-1),zx=E0(1);function Vx(e,t=null){return function(n,l){let{$from:r,$to:a}=n.selection,i=r.blockRange(a),s=i&&Ys(i,e,t);return s?(l&&l(n.tr.wrap(i,s).scrollIntoView()),!0):!1}}function T0(e,t=null){return function(n,l){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[a];n.doc.nodesBetween(i,s,(o,u)=>{if(r)return!1;if(!(!o.isTextblock||o.hasMarkup(e,t)))if(o.type==e)r=!0;else{let c=n.doc.resolve(u),d=c.index();r=c.parent.canReplaceWith(d,d+1,e)}})}if(!r)return!1;if(l){let a=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[i];a.setBlockType(s,o,e,t)}l(a.scrollIntoView())}return!0}}function _o(...e){return function(t,n,l){for(let r=0;r<e.length;r++)if(e[r](t,n,l))return!0;return!1}}_o(Ao,c0,f0),_o(Ao,p0,b0),_o(m0,g0,v0,Rx),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function $x(e,t=null){return function(n,l){let{$from:r,$to:a}=n.selection,i=r.blockRange(a);if(!i)return!1;let s=l?n.tr:null;return qx(s,i,e,t)?(l&&l(s.scrollIntoView()),!0):!1}}function qx(e,t,n,l=null){let r=!1,a=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let o=i.resolve(t.start-2);a=new Ma(o,o,t.depth),t.endIndex<t.parent.childCount&&(t=new Ma(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let s=Ys(a,n,l,t);return s?(e&&Wx(e,t,s,r,n),!0):!1}function Wx(e,t,n,l,r){let a=K.empty;for(let c=n.length-1;c>=0;c--)a=K.from(n[c].type.create(n[c].attrs,a));e.step(new Ke(t.start-(l?2:0),t.end,t.start,t.end,new ae(a,0,0),n.length,!0));let i=0;for(let c=0;c<n.length;c++)n[c].type==r&&(i=c+1);let s=n.length-i,o=t.start+n.length-(l?2:0),u=t.parent;for(let c=t.startIndex,d=t.endIndex,f=!0;c<d;c++,f=!1)!f&&tn(e.doc,o,s)&&(e.split(o,s),o+=2*s),o+=u.child(c).nodeSize;return e}function Yx(e){return function(t,n){let{$from:l,$to:r}=t.selection,a=l.blockRange(r,i=>i.childCount>0&&i.firstChild.type==e);return a?n?l.node(a.depth-1).type==e?jx(t,n,e,a):Kx(t,n,a):!0:!1}}function jx(e,t,n,l){let r=e.tr,a=l.end,i=l.$to.end(l.depth);a<i&&(r.step(new Ke(a-1,i,a,i,new ae(K.from(n.create(null,l.parent.copy())),1,0),1,!0)),l=new Ma(r.doc.resolve(l.$from.pos),r.doc.resolve(i),l.depth));const s=Ml(l);if(s==null)return!1;r.lift(l,s);let o=r.doc.resolve(r.mapping.map(a,-1)-1);return Tn(r.doc,o.pos)&&o.nodeBefore.type==o.nodeAfter.type&&r.join(o.pos),t(r.scrollIntoView()),!0}function Kx(e,t,n){let l=e.tr,r=n.parent;for(let h=n.end,m=n.endIndex-1,v=n.startIndex;m>v;m--)h-=r.child(m).nodeSize,l.delete(h-1,h+1);let a=l.doc.resolve(n.start),i=a.nodeAfter;if(l.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,o=n.endIndex==r.childCount,u=a.node(-1),c=a.index(-1);if(!u.canReplace(c+(s?0:1),c+1,i.content.append(o?K.empty:K.from(r))))return!1;let d=a.pos,f=d+i.nodeSize;return l.step(new Ke(d-(s?1:0),f+(o?1:0),d+1,f-1,new ae((s?K.empty:K.from(r.copy(K.empty))).append(o?K.empty:K.from(r.copy(K.empty))),s?0:1,o?0:1),s?0:1)),t(l.scrollIntoView()),!0}function Gx(e){return function(t,n){let{$from:l,$to:r}=t.selection,a=l.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!a)return!1;let i=a.startIndex;if(i==0)return!1;let s=a.parent,o=s.child(i-1);if(o.type!=e)return!1;if(n){let u=o.lastChild&&o.lastChild.type==s.type,c=K.from(u?e.create():null),d=new ae(K.from(e.create(null,K.from(s.type.create(null,c)))),u?3:1,0),f=a.start,h=a.end;n(t.tr.step(new Ke(f-(u?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function Ja(e){const{state:t,transaction:n}=e;let{selection:l}=n,{doc:r}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return l},get doc(){return r},get tr(){return l=n.selection,r=n.doc,a=n.storedMarks,n}}}class Za{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:n,state:l}=this,{view:r}=n,{tr:a}=l,i=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([s,o])=>[s,(...c)=>{const d=o(...c)(i);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:l,editor:r,state:a}=this,{view:i}=r,s=[],o=!!t,u=t||a.tr,c=()=>(!o&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(u),s.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(l).map(([f,h])=>[f,(...v)=>{const g=this.buildProps(u,n),E=h(...v)(g);return s.push(E),d}])),run:c};return d}createCan(t){const{rawCommands:n,state:l}=this,r=!1,a=t||l.tr,i=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([o,u])=>[o,(...c)=>u(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(t,n=!0){const{rawCommands:l,editor:r,state:a}=this,{view:i}=r,s={tr:t,editor:r,view:i,state:Ja({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(l).map(([o,u])=>[o,(...c)=>u(...c)(s)]))}};return s}}class Qx{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const l=this.callbacks[t];return l&&l.forEach(r=>r.apply(this,n)),this}off(t,n){const l=this.callbacks[t];return l&&(n?this.callbacks[t]=l.filter(r=>r!==n):delete this.callbacks[t]),this}once(t,n){const l=(...r)=>{this.off(t,l),n.apply(this,r)};return this.on(t,l)}removeAllListeners(){this.callbacks={}}}function se(e,t,n){return e.config[t]===void 0&&e.parent?se(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?se(e.parent,t,n):null}):e.config[t]}function ei(e){const t=e.filter(r=>r.type==="extension"),n=e.filter(r=>r.type==="node"),l=e.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:l}}function C0(e){const t=[],{nodeExtensions:n,markExtensions:l}=ei(e),r=[...n,...l],a={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(i=>{const s={name:i.name,options:i.options,storage:i.storage,extensions:r},o=se(i,"addGlobalAttributes",s);if(!o)return;o().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,h])=>{t.push({type:d,name:f,attribute:{...a,...h}})})})})}),r.forEach(i=>{const s={name:i.name,options:i.options,storage:i.storage},o=se(i,"addAttributes",s);if(!o)return;const u=o();Object.entries(u).forEach(([c,d])=>{const f={...a,...d};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,t.push({type:i.name,name:c,attribute:f})})}),t}function Ge(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function bt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const l={...t};return Object.entries(n).forEach(([r,a])=>{if(!l[r]){l[r]=a;return}if(r==="class"){const s=a?String(a).split(" "):[],o=l[r]?l[r].split(" "):[],u=s.filter(c=>!o.includes(c));l[r]=[...o,...u].join(" ")}else if(r==="style"){const s=a?a.split(";").map(c=>c.trim()).filter(Boolean):[],o=l[r]?l[r].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;o.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),s.forEach(c=>{const[d,f]=c.split(":").map(h=>h.trim());u.set(d,f)}),l[r]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else l[r]=a}),l},{})}function Oo(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,l)=>bt(n,l),{})}function S0(e){return typeof e=="function"}function Se(e,t=void 0,...n){return S0(e)?t?e.bind(t)(...n):e(...n):e}function Xx(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Jx(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function x0(e,t){return"style"in e?e:{...e,getAttrs:n=>{const l=e.getAttrs?e.getAttrs(n):e.attrs;if(l===!1)return!1;const r=t.reduce((a,i)=>{const s=i.attribute.parseHTML?i.attribute.parseHTML(n):Jx(n.getAttribute(i.name));return s==null?a:{...a,[i.name]:s}},{});return{...l,...r}}}}function k0(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Xx(n)?!1:n!=null))}function Zx(e,t){var n;const l=C0(e),{nodeExtensions:r,markExtensions:a}=ei(e),i=(n=r.find(u=>se(u,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(r.map(u=>{const c=l.filter(E=>E.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:t},f=e.reduce((E,N)=>{const A=se(N,"extendNodeSchema",d);return{...E,...A?A(u):{}}},{}),h=k0({...f,content:Se(se(u,"content",d)),marks:Se(se(u,"marks",d)),group:Se(se(u,"group",d)),inline:Se(se(u,"inline",d)),atom:Se(se(u,"atom",d)),selectable:Se(se(u,"selectable",d)),draggable:Se(se(u,"draggable",d)),code:Se(se(u,"code",d)),whitespace:Se(se(u,"whitespace",d)),linebreakReplacement:Se(se(u,"linebreakReplacement",d)),defining:Se(se(u,"defining",d)),isolating:Se(se(u,"isolating",d)),attrs:Object.fromEntries(c.map(E=>{var N;return[E.name,{default:(N=E?.attribute)===null||N===void 0?void 0:N.default}]}))}),m=Se(se(u,"parseHTML",d));m&&(h.parseDOM=m.map(E=>x0(E,c)));const v=se(u,"renderHTML",d);v&&(h.toDOM=E=>v({node:E,HTMLAttributes:Oo(E,c)}));const g=se(u,"renderText",d);return g&&(h.toText=g),[u.name,h]})),o=Object.fromEntries(a.map(u=>{const c=l.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:t},f=e.reduce((g,E)=>{const N=se(E,"extendMarkSchema",d);return{...g,...N?N(u):{}}},{}),h=k0({...f,inclusive:Se(se(u,"inclusive",d)),excludes:Se(se(u,"excludes",d)),group:Se(se(u,"group",d)),spanning:Se(se(u,"spanning",d)),code:Se(se(u,"code",d)),attrs:Object.fromEntries(c.map(g=>{var E;return[g.name,{default:(E=g?.attribute)===null||E===void 0?void 0:E.default}]}))}),m=Se(se(u,"parseHTML",d));m&&(h.parseDOM=m.map(g=>x0(g,c)));const v=se(u,"renderHTML",d);return v&&(h.toDOM=g=>v({mark:g,HTMLAttributes:Oo(g,c)})),[u.name,h]}));return new bh({topNode:i,nodes:s,marks:o})}function Mo(e,t){return t.nodes[e]||t.marks[e]||null}function A0(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function Do(e,t){const n=el.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const ek=(e,t=500)=>{let n="";const l=e.parentOffset;return e.parent.nodesBetween(Math.max(0,l-t),l,(r,a,i,s)=>{var o,u;const c=((u=(o=r.type.spec).toText)===null||u===void 0?void 0:u.call(o,{node:r,pos:a,parent:i,index:s}))||r.textContent||"%leaf%";n+=r.isAtom&&!r.isText?c:c.slice(0,Math.max(0,l-a))}),n};function Lo(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class ti{constructor(t){this.find=t.find,this.handler=t.handler}}const tk=(e,t)=>{if(Lo(t))return t.exec(e);const n=t(e);if(!n)return null;const l=[n.text];return l.index=n.index,l.input=e,l.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),l.push(n.replaceWith)),l};function ni(e){var t;const{editor:n,from:l,to:r,text:a,rules:i,plugin:s}=e,{view:o}=n;if(o.composing)return!1;const u=o.state.doc.resolve(l);if(u.parent.type.spec.code||!((t=u.nodeBefore||u.nodeAfter)===null||t===void 0)&&t.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=ek(u)+a;return i.forEach(f=>{if(c)return;const h=tk(d,f.find);if(!h)return;const m=o.state.tr,v=Ja({state:o.state,transaction:m}),g={from:l-(h[0].length-a.length),to:r},{commands:E,chain:N,can:A}=new Za({editor:n,state:v});f.handler({state:v,range:g,match:h,commands:E,chain:N,can:A})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:l,to:r,text:a}),o.dispatch(m),c=!0)}),c}function nk(e){const{editor:t,rules:n}=e,l=new ft({state:{init(){return null},apply(r,a,i){const s=r.getMeta(l);if(s)return s;const o=r.getMeta("applyInputRules");return!!o&&setTimeout(()=>{let{text:c}=o;typeof c=="string"?c=c:c=Do(K.from(c),i.schema);const{from:d}=o,f=d+c.length;ni({editor:t,from:d,to:f,text:c,rules:n,plugin:l})}),r.selectionSet||r.docChanged?null:a}},props:{handleTextInput(r,a,i,s){return ni({editor:t,from:a,to:i,text:s,rules:n,plugin:l})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:a}=r.state.selection;a&&ni({editor:t,from:a.pos,to:a.pos,text:"",rules:n,plugin:l})}),!1)},handleKeyDown(r,a){if(a.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?ni({editor:t,from:i.pos,to:i.pos,text:`
31
+ `,rules:n,plugin:l}):!1}},isInputRules:!0});return l}function lk(e){return Object.prototype.toString.call(e).slice(8,-1)}function li(e){return lk(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function ri(e,t){const n={...e};return li(e)&&li(t)&&Object.keys(t).forEach(l=>{li(t[l])&&li(e[l])?n[l]=ri(e[l],t[l]):n[l]=t[l]}),n}class On{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Se(se(this,"addOptions",{name:this.name}))),this.storage=Se(se(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new On(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>ri(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new On(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(se(n,"addOptions",{name:n.name})),n.storage=Se(se(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:l}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const i=r.marks();if(!!!i.find(u=>u?.type.name===n.name))return!1;const o=i.find(u=>u?.type.name===n.name);return o&&l.removeStoredMark(o),l.insertText(" ",r.pos),t.view.dispatch(l),!0}return!1}}function rk(e){return typeof e=="number"}class ak{constructor(t){this.find=t.find,this.handler=t.handler}}const ik=(e,t,n)=>{if(Lo(t))return[...e.matchAll(t)];const l=t(e,n);return l?l.map(r=>{const a=[r.text];return a.index=r.index,a.input=e,a.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),a.push(r.replaceWith)),a}):[]};function sk(e){const{editor:t,state:n,from:l,to:r,rule:a,pasteEvent:i,dropEvent:s}=e,{commands:o,chain:u,can:c}=new Za({editor:t,state:n}),d=[];return n.doc.nodesBetween(l,r,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const v=Math.max(l,m),g=Math.min(r,m+h.content.size),E=h.textBetween(v-m,g-m,void 0,"");ik(E,a.find,i).forEach(A=>{if(A.index===void 0)return;const L=v+A.index+1,O=L+A[0].length,S={from:n.tr.mapping.map(L),to:n.tr.mapping.map(O)},_=a.handler({state:n,range:S,match:A,commands:o,chain:u,can:c,pasteEvent:i,dropEvent:s});d.push(_)})}),d.every(h=>h!==null)}let ai=null;const ok=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function uk(e){const{editor:t,rules:n}=e;let l=null,r=!1,a=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s;try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}const o=({state:c,from:d,to:f,rule:h,pasteEvt:m})=>{const v=c.tr,g=Ja({state:c,transaction:v});if(!(!sk({editor:t,state:g,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:m,dropEvent:s})||!v.steps.length)){try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return n.map(c=>new ft({view(d){const f=m=>{var v;l=!((v=d.dom.parentElement)===null||v===void 0)&&v.contains(m.target)?d.dom.parentElement:null,l&&(ai=t)},h=()=>{ai&&(ai=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(a=l===d.dom.parentElement,s=f,!a){const h=ai;h?.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,f)=>{var h;const m=(h=f.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return i=f,r=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(d,f,h)=>{const m=d[0],v=m.getMeta("uiEvent")==="paste"&&!r,g=m.getMeta("uiEvent")==="drop"&&!a,E=m.getMeta("applyPasteRules"),N=!!E;if(!v&&!g&&!N)return;if(N){let{text:O}=E;typeof O=="string"?O=O:O=Do(K.from(O),h.schema);const{from:S}=E,_=S+O.length,I=ok(O);return o({rule:c,state:h,from:S,to:{b:_},pasteEvt:I})}const A=f.doc.content.findDiffStart(h.doc.content),L=f.doc.content.findDiffEnd(h.doc.content);if(!(!rk(A)||!L||A===L.b))return o({rule:c,state:h,from:A,to:L,pasteEvt:i})}}))}function ck(e){const t=e.filter((n,l)=>e.indexOf(n)!==l);return Array.from(new Set(t))}class ql{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ql.resolve(t),this.schema=Zx(this.extensions,n),this.setupExtensions()}static resolve(t){const n=ql.sort(ql.flatten(t)),l=ck(n.map(r=>r.name));return l.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${l.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const l={name:n.name,options:n.options,storage:n.storage},r=se(n,"addExtensions",l);return r?[n,...this.flatten(r())]:n}).flat(10)}static sort(t){return t.sort((l,r)=>{const a=se(l,"priority")||100,i=se(r,"priority")||100;return a>i?-1:a<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const l={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Mo(n.name,this.schema)},r=se(n,"addCommands",l);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this,n=ql.sort([...this.extensions].reverse()),l=[],r=[],a=n.map(i=>{const s={name:i.name,options:i.options,storage:i.storage,editor:t,type:Mo(i.name,this.schema)},o=[],u=se(i,"addKeyboardShortcuts",s);let c={};if(i.type==="mark"&&se(i,"exitable",s)&&(c.ArrowRight=()=>On.handleExit({editor:t,mark:i})),u){const v=Object.fromEntries(Object.entries(u()).map(([g,E])=>[g,()=>E({editor:t})]));c={...c,...v}}const d=Ix(c);o.push(d);const f=se(i,"addInputRules",s);A0(i,t.options.enableInputRules)&&f&&l.push(...f());const h=se(i,"addPasteRules",s);A0(i,t.options.enablePasteRules)&&h&&r.push(...h());const m=se(i,"addProseMirrorPlugins",s);if(m){const v=m();o.push(...v)}return o}).flat();return[nk({editor:t,rules:l}),...uk({editor:t,rules:r}),...a]}get attributes(){return C0(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=ei(this.extensions);return Object.fromEntries(n.filter(l=>!!se(l,"addNodeView")).map(l=>{const r=this.attributes.filter(o=>o.type===l.name),a={name:l.name,options:l.options,storage:l.storage,editor:t,type:Ge(l.name,this.schema)},i=se(l,"addNodeView",a);if(!i)return[];const s=(o,u,c,d,f)=>{const h=Oo(o,r);return i()({node:o,view:u,getPos:c,decorations:d,innerDecorations:f,editor:t,extension:l,HTMLAttributes:h})};return[l.name,s]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const l={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Mo(t.name,this.schema)};t.type==="mark"&&(!((n=Se(se(t,"keepOnSplit",l)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const r=se(t,"onBeforeCreate",l),a=se(t,"onCreate",l),i=se(t,"onUpdate",l),s=se(t,"onSelectionUpdate",l),o=se(t,"onTransaction",l),u=se(t,"onFocus",l),c=se(t,"onBlur",l),d=se(t,"onDestroy",l);r&&this.editor.on("beforeCreate",r),a&&this.editor.on("create",a),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),o&&this.editor.on("transaction",o),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class ut{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Se(se(this,"addOptions",{name:this.name}))),this.storage=Se(se(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ut(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>ri(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new ut({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(se(n,"addOptions",{name:n.name})),n.storage=Se(se(n,"addStorage",{name:n.name,options:n.options})),n}}function N0(e,t,n){const{from:l,to:r}=t,{blockSeparator:a=`
32
32
 
33
- `,textSerializers:i={}}=n||{};let s="";return e.nodesBetween(l,r,(o,u,c,d)=>{var f;o.isBlock&&u>l&&(s+=a);const h=i?.[o.type.name];if(h)return c&&(s+=h({node:o,pos:u,parent:c,index:d,range:t})),!1;o.isText&&(s+=(f=o?.text)===null||f===void 0?void 0:f.slice(Math.max(l,u)-u,r-u))}),s}function w0(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const dk=ut.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ft({key:new Rt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:l,selection:r}=t,{ranges:a}=r,i=Math.min(...a.map(c=>c.$from.pos)),s=Math.max(...a.map(c=>c.$to.pos)),o=w0(n);return N0(l,{from:i,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:o})}}})]}}),fk=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),hk=(e=!1)=>({commands:t})=>t.setContent("",e),pk=()=>({state:e,tr:t,dispatch:n})=>{const{selection:l}=t,{ranges:r}=l;return n&&r.forEach(({$from:a,$to:i})=>{e.doc.nodesBetween(a.pos,i.pos,(s,o)=>{if(s.type.isText)return;const{doc:u,mapping:c}=t,d=u.resolve(c.map(o)),f=u.resolve(c.map(o+s.nodeSize)),h=d.blockRange(f);if(!h)return;const m=Ml(h);if(s.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(h.start,v)}(m||m===0)&&t.lift(h,m)})}),!0},bk=e=>t=>e(t),mk=()=>({state:e,dispatch:t})=>g0(e,t),gk=(e,t)=>({editor:n,tr:l})=>{const{state:r}=n,a=r.doc.slice(e.from,e.to);l.deleteRange(e.from,e.to);const i=l.mapping.map(t);return l.insert(i,a.content),l.setSelection(new be(l.doc.resolve(Math.max(i-1,0)))),!0},vk=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,l=n.$anchor.node();if(l.content.size>0)return!1;const r=e.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===l.type){if(t){const s=r.before(a),o=r.after(a);e.delete(s,o).scrollIntoView()}return!0}return!1},yk=e=>({tr:t,state:n,dispatch:l})=>{const r=Ge(e,n.schema),a=t.selection.$anchor;for(let i=a.depth;i>0;i-=1)if(a.node(i).type===r){if(l){const o=a.before(i),u=a.after(i);t.delete(o,u).scrollIntoView()}return!0}return!1},Ek=e=>({tr:t,dispatch:n})=>{const{from:l,to:r}=e;return n&&t.delete(l,r),!0},Tk=()=>({state:e,dispatch:t})=>Ao(e,t),Ck=()=>({commands:e})=>e.keyboardShortcut("Enter"),Sk=()=>({state:e,dispatch:t})=>Px(e,t);function ii(e,t,n={strict:!0}){const l=Object.keys(t);return l.length?l.every(r=>n.strict?t[r]===e[r]:Lo(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function I0(e,t,n={}){return e.find(l=>l.type===t&&ii(Object.fromEntries(Object.keys(n).map(r=>[r,l.attrs[r]])),n))}function _0(e,t,n={}){return!!I0(e,t,n)}function Po(e,t,n){var l;if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===t)||(n=n||((l=r.node.marks[0])===null||l===void 0?void 0:l.attrs),!I0([...r.node.marks],t,n)))return;let i=r.index,s=e.start()+r.offset,o=i+1,u=s+r.node.nodeSize;for(;i>0&&_0([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&_0([...e.parent.child(o).marks],t,n);)u+=e.parent.child(o).nodeSize,o+=1;return{from:s,to:u}}function Mn(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const xk=(e,t={})=>({tr:n,state:l,dispatch:r})=>{const a=Mn(e,l.schema),{doc:i,selection:s}=n,{$from:o,from:u,to:c}=s;if(r){const d=Po(o,a,t);if(d&&d.from<=u&&d.to>=c){const f=be.create(i,d.from,d.to);n.setSelection(f)}}return!0},kk=e=>t=>{const n=typeof e=="function"?e(t):e;for(let l=0;l<n.length;l+=1)if(n[l](t))return!0;return!1};function O0(e){return e instanceof be}function ul(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function M0(e,t=null){if(!t)return null;const n=Te.atStart(e),l=Te.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return l;const r=n.from,a=l.to;return t==="all"?be.create(e,ul(0,r,a),ul(e.content.size,r,a)):be.create(e,ul(t,r,a),ul(t,r,a))}function D0(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function si(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ak(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const Nk=(e=null,t={})=>({editor:n,view:l,tr:r,dispatch:a})=>{t={scrollIntoView:!0,...t};const i=()=>{(si()||D0())&&l.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(l.focus(),Ak()&&!si()&&!D0()&&l.dom.focus({preventScroll:!0}))})};if(l.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!O0(n.state.selection))return i(),!0;const s=M0(r.doc,e)||n.state.selection,o=n.state.selection.eq(s);return a&&(o||r.setSelection(s),o&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},wk=(e,t)=>n=>e.every((l,r)=>t(l,{...n,index:r})),Ik=(e,t)=>({tr:n,commands:l})=>l.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),L0=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const l=t[n];l.nodeType===3&&l.nodeValue&&/^(\n\s\s|\n)$/.test(l.nodeValue)?e.removeChild(l):l.nodeType===1&&L0(l)}return e};function oi(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return L0(n)}function Wr(e,t,n){if(e instanceof vn||e instanceof K)return e;n={slice:!0,parseOptions:{},...n};const l=typeof e=="object"&&e!==null,r=typeof e=="string";if(l)try{if(Array.isArray(e)&&e.length>0)return K.fromArray(e.map(s=>t.nodeFromJSON(s)));const i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",a),Wr("",t,n)}if(r){if(n.errorOnInvalidContent){let i=!1,s="";const o=new bh({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(i=!0,s=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?wr.fromSchema(o).parseSlice(oi(e),n.parseOptions):wr.fromSchema(o).parse(oi(e),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const a=wr.fromSchema(t);return n.slice?a.parseSlice(oi(e),n.parseOptions).content:a.parse(oi(e),n.parseOptions)}return Wr("",t,n)}function _k(e,t,n){const l=e.steps.length-1;if(l<t)return;const r=e.steps[l];if(!(r instanceof qe||r instanceof Ke))return;const a=e.mapping.maps[l];let i=0;a.forEach((s,o,u,c)=>{i===0&&(i=c)}),e.setSelection(Te.near(e.doc.resolve(i),n))}const Ok=e=>!("type"in e),Mk=(e,t,n)=>({tr:l,dispatch:r,editor:a})=>{var i;if(r){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;const o=g=>{a.emit("contentError",{editor:a,error:g,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Wr(t,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){o(g)}try{s=Wr(t,a.schema,{parseOptions:u,errorOnInvalidContent:(i=n.errorOnInvalidContent)!==null&&i!==void 0?i:a.options.enableContentCheck})}catch(g){return o(g),!1}let{from:c,to:d}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},f=!0,h=!0;if((Ok(s)?s:[s]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),c===d&&h){const{parent:g}=l.doc.resolve(c);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(c-=1,d+=1)}let v;if(f){if(Array.isArray(t))v=t.map(g=>g.text||"").join("");else if(t instanceof K){let g="";t.forEach(E=>{E.text&&(g+=E.text)}),v=g}else typeof t=="object"&&t&&t.text?v=t.text:v=t;l.insertText(v,c,d)}else v=s,l.replaceWith(c,d,v);n.updateSelection&&_k(l,l.steps.length-1,-1),n.applyInputRules&&l.setMeta("applyInputRules",{from:c,text:v}),n.applyPasteRules&&l.setMeta("applyPasteRules",{from:c,text:v})}return!0},Dk=()=>({state:e,dispatch:t})=>Mx(e,t),Lk=()=>({state:e,dispatch:t})=>Dx(e,t),Pk=()=>({state:e,dispatch:t})=>c0(e,t),Bk=()=>({state:e,dispatch:t})=>p0(e,t),Rk=()=>({state:e,dispatch:t,tr:n})=>{try{const l=Ha(e.doc,e.selection.$from.pos,-1);return l==null?!1:(n.join(l,2),t&&t(n),!0)}catch{return!1}},Fk=()=>({state:e,dispatch:t,tr:n})=>{try{const l=Ha(e.doc,e.selection.$from.pos,1);return l==null?!1:(n.join(l,2),t&&t(n),!0)}catch{return!1}},Hk=()=>({state:e,dispatch:t})=>_x(e,t),Uk=()=>({state:e,dispatch:t})=>Ox(e,t);function P0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function zk(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let l,r,a,i;for(let s=0;s<t.length-1;s+=1){const o=t[s];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))l=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))a=!0;else if(/^mod$/i.test(o))si()||P0()?i=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${o}`)}return l&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const Vk=e=>({editor:t,view:n,tr:l,dispatch:r})=>{const a=zk(e).split(/-(?!$)/),i=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),s=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),o=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,s))});return o?.steps.forEach(u=>{const c=u.map(l.mapping);c&&r&&l.maybeStep(c)}),!0};function Yr(e,t,n={}){const{from:l,to:r,empty:a}=e.selection,i=t?Ge(t,e.schema):null,s=[];e.doc.nodesBetween(l,r,(d,f)=>{if(d.isText)return;const h=Math.max(l,f),m=Math.min(r,f+d.nodeSize);s.push({node:d,from:h,to:m})});const o=r-l,u=s.filter(d=>i?i.name===d.node.type.name:!0).filter(d=>ii(d.node.attrs,n,{strict:!1}));return a?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=o}const $k=(e,t={})=>({state:n,dispatch:l})=>{const r=Ge(e,n.schema);return Yr(n,r,t)?Lx(n,l):!1},qk=()=>({state:e,dispatch:t})=>v0(e,t),Wk=e=>({state:t,dispatch:n})=>{const l=Ge(e,t.schema);return Yx(l)(t,n)},Yk=()=>({state:e,dispatch:t})=>m0(e,t);function ui(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function B0(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((l,r)=>(n.includes(r)||(l[r]=e[r]),l),{})}const jk=(e,t)=>({tr:n,state:l,dispatch:r})=>{let a=null,i=null;const s=ui(typeof e=="string"?e:e.name,l.schema);return s?(s==="node"&&(a=Ge(e,l.schema)),s==="mark"&&(i=Mn(e,l.schema)),r&&n.selection.ranges.forEach(o=>{l.doc.nodesBetween(o.$from.pos,o.$to.pos,(u,c)=>{a&&a===u.type&&n.setNodeMarkup(c,void 0,B0(u.attrs,t)),i&&u.marks.length&&u.marks.forEach(d=>{i===d.type&&n.addMark(c,c+u.nodeSize,i.create(B0(d.attrs,t)))})})}),!0):!1},Kk=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Gk=()=>({tr:e,dispatch:t})=>{if(t){const n=new At(e.doc);e.setSelection(n)}return!0},Qk=()=>({state:e,dispatch:t})=>f0(e,t),Xk=()=>({state:e,dispatch:t})=>b0(e,t),Jk=()=>({state:e,dispatch:t})=>Fx(e,t),Zk=()=>({state:e,dispatch:t})=>zx(e,t),eA=()=>({state:e,dispatch:t})=>Ux(e,t);function Bo(e,t,n={},l={}){return Wr(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:l.errorOnInvalidContent})}const tA=(e,t=!1,n={},l={})=>({editor:r,tr:a,dispatch:i,commands:s})=>{var o,u;const{doc:c}=a;if(n.preserveWhitespace!=="full"){const d=Bo(e,r.schema,n,{errorOnInvalidContent:(o=l.errorOnInvalidContent)!==null&&o!==void 0?o:r.options.enableContentCheck});return i&&a.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!t),!0}return i&&a.setMeta("preventUpdate",!t),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:(u=l.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function R0(e,t){const n=Mn(t,e.schema),{from:l,to:r,empty:a}=e.selection,i=[];a?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(l,r,o=>{i.push(...o.marks)});const s=i.find(o=>o.type.name===n.name);return s?{...s.attrs}:{}}function nA(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function lA(e,t){for(let n=e.depth;n>0;n-=1){const l=e.node(n);if(t(l))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:l}}}function Ro(e){return t=>lA(t.$from,e)}function rA(e,t){const n={from:0,to:e.content.size};return N0(e,n,t)}function aA(e,t){const n=Ge(t,e.schema),{from:l,to:r}=e.selection,a=[];e.doc.nodesBetween(l,r,s=>{a.push(s)});const i=a.reverse().find(s=>s.type.name===n.name);return i?{...i.attrs}:{}}function iA(e,t){const n=ui(typeof t=="string"?t:t.name,e.schema);return n==="node"?aA(e,t):n==="mark"?R0(e,t):{}}function F0(e,t,n){const l=[];return e===t?n.resolve(e).marks().forEach(r=>{const a=n.resolve(e),i=Po(a,r.type);i&&l.push({mark:r,...i})}):n.nodesBetween(e,t,(r,a)=>{!r||r?.nodeSize===void 0||l.push(...r.marks.map(i=>({from:a,to:a+r.nodeSize,mark:i})))}),l}function ci(e,t,n){return Object.fromEntries(Object.entries(n).filter(([l])=>{const r=e.find(a=>a.type===t&&a.name===l);return r?r.attribute.keepOnSplit:!1}))}function Fo(e,t,n={}){const{empty:l,ranges:r}=e.selection,a=t?Mn(t,e.schema):null;if(l)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>a?a.name===d.type.name:!0).find(d=>ii(d.attrs,n,{strict:!1}));let i=0;const s=[];if(r.forEach(({$from:d,$to:f})=>{const h=d.pos,m=f.pos;e.doc.nodesBetween(h,m,(v,g)=>{if(!v.isText&&!v.marks.length)return;const E=Math.max(h,g),N=Math.min(m,g+v.nodeSize),A=N-E;i+=A,s.push(...v.marks.map(L=>({mark:L,from:E,to:N})))})}),i===0)return!1;const o=s.filter(d=>a?a.name===d.mark.type.name:!0).filter(d=>ii(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=s.filter(d=>a?d.mark.type!==a&&d.mark.type.excludes(a):!0).reduce((d,f)=>d+f.to-f.from,0);return(o>0?o+u:o)>=i}function sA(e,t,n={}){if(!t)return Yr(e,null,n)||Fo(e,null,n);const l=ui(t,e.schema);return l==="node"?Yr(e,t,n):l==="mark"?Fo(e,t,n):!1}function H0(e,t){const{nodeExtensions:n}=ei(t),l=n.find(i=>i.name===e);if(!l)return!1;const r={name:l.name,options:l.options,storage:l.storage},a=Ce(se(l,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function di(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var l;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((l=e.text)!==null&&l!==void 0?l:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(a=>{r!==!1&&(di(a,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function oA(e){return e instanceof he}function uA(e,t,n){var l;const{selection:r}=t;let a=null;if(O0(r)&&(a=r.$cursor),a){const s=(l=e.storedMarks)!==null&&l!==void 0?l:a.marks();return!!n.isInSet(s)||!s.some(o=>o.type.excludes(n))}const{ranges:i}=r;return i.some(({$from:s,$to:o})=>{let u=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,o.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const h=!f||f.type.allowsMarkType(n),m=!!n.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(n));u=h&&m}return!u}),u})}const cA=(e,t={})=>({tr:n,state:l,dispatch:r})=>{const{selection:a}=n,{empty:i,ranges:s}=a,o=Mn(e,l.schema);if(r)if(i){const u=R0(l,o);n.addStoredMark(o.create({...u,...t}))}else s.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;l.doc.nodesBetween(c,d,(f,h)=>{const m=Math.max(h,c),v=Math.min(h+f.nodeSize,d);f.marks.find(E=>E.type===o)?f.marks.forEach(E=>{o===E.type&&n.addMark(m,v,o.create({...E.attrs,...t}))}):n.addMark(m,v,o.create(t))})});return uA(l,n,o)},dA=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),fA=(e,t={})=>({state:n,dispatch:l,chain:r})=>{const a=Ge(e,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),a.isTextblock?r().command(({commands:s})=>T0(a,{...i,...t})(n)?!0:s.clearNodes()).command(({state:s})=>T0(a,{...i,...t})(s,l)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},hA=e=>({tr:t,dispatch:n})=>{if(n){const{doc:l}=t,r=ul(e,0,l.content.size),a=he.create(l,r);t.setSelection(a)}return!0},pA=e=>({tr:t,dispatch:n})=>{if(n){const{doc:l}=t,{from:r,to:a}=typeof e=="number"?{from:e,to:e}:e,i=be.atStart(l).from,s=be.atEnd(l).to,o=ul(r,i,s),u=ul(a,i,s),c=be.create(l,o,u);t.setSelection(c)}return!0},bA=e=>({state:t,dispatch:n})=>{const l=Ge(e,t.schema);return Gx(l)(t,n)};function U0(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const l=n.filter(r=>t?.includes(r.type.name));e.tr.ensureMarks(l)}}const mA=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:l,editor:r})=>{const{selection:a,doc:i}=t,{$from:s,$to:o}=a,u=r.extensionManager.attributes,c=ci(u,s.node().type.name,s.node().attrs);if(a instanceof he&&a.node.isBlock)return!s.parentOffset||!tn(i,s.pos)?!1:(l&&(e&&U0(n,r.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const d=o.parentOffset===o.parent.content.size,f=s.depth===0?void 0:nA(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=d&&f?[{type:f,attrs:c}]:void 0,m=tn(t.doc,t.mapping.map(s.pos),1,h);if(!h&&!m&&tn(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:c}]:void 0),l){if(m&&(a instanceof be&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,h),f&&!d&&!s.parentOffset&&s.parent.type!==f)){const v=t.mapping.map(s.before()),g=t.doc.resolve(v);s.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&U0(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return m},gA=(e,t={})=>({tr:n,state:l,dispatch:r,editor:a})=>{var i;const s=Ge(e,l.schema),{$from:o,$to:u}=l.selection,c=l.selection.node;if(c&&c.isBlock||o.depth<2||!o.sameParent(u))return!1;const d=o.node(-1);if(d.type!==s)return!1;const f=a.extensionManager.attributes;if(o.parent.content.size===0&&o.node(-1).childCount===o.indexAfter(-1)){if(o.depth===2||o.node(-3).type!==s||o.index(-2)!==o.node(-2).childCount-1)return!1;if(r){let E=K.empty;const N=o.index(-1)?1:o.index(-2)?2:3;for(let I=o.depth-N;I>=o.depth-3;I-=1)E=K.from(o.node(I).copy(E));const A=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3,L={...ci(f,o.node().type.name,o.node().attrs),...t},O=((i=s.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(L))||void 0;E=E.append(K.from(s.createAndFill(null,O)||void 0));const S=o.before(o.depth-(N-1));n.replace(S,o.after(-A),new ae(E,4-N,0));let _=-1;n.doc.nodesBetween(S,n.doc.content.size,(I,k)=>{if(_>-1)return!1;I.isTextblock&&I.content.size===0&&(_=k+1)}),_>-1&&n.setSelection(be.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const h=u.pos===o.end()?d.contentMatchAt(0).defaultType:null,m={...ci(f,d.type.name,d.attrs),...t},v={...ci(f,o.node().type.name,o.node().attrs),...t};n.delete(o.pos,u.pos);const g=h?[{type:s,attrs:m},{type:h,attrs:v}]:[{type:s,attrs:m}];if(!tn(n.doc,o.pos,2))return!1;if(r){const{selection:E,storedMarks:N}=l,{splittableMarks:A}=a.extensionManager,L=N||E.$to.parentOffset&&E.$from.marks();if(n.split(o.pos,2,g).scrollIntoView(),!L||!r)return!0;const O=L.filter(S=>A.includes(S.type.name));n.ensureMarks(O)}return!0},Ho=(e,t)=>{const n=Ro(i=>i.type===t)(e.selection);if(!n)return!0;const l=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(l===void 0)return!0;const r=e.doc.nodeAt(l);return n.node.type===r?.type&&Tn(e.doc,n.pos)&&e.join(n.pos),!0},Uo=(e,t)=>{const n=Ro(i=>i.type===t)(e.selection);if(!n)return!0;const l=e.doc.resolve(n.start).after(n.depth);if(l===void 0)return!0;const r=e.doc.nodeAt(l);return n.node.type===r?.type&&Tn(e.doc,l)&&e.join(l),!0};var vA=Object.freeze({__proto__:null,blur:fk,clearContent:hk,clearNodes:pk,command:bk,createParagraphNear:mk,cut:gk,deleteCurrentNode:vk,deleteNode:yk,deleteRange:Ek,deleteSelection:Tk,enter:Ck,exitCode:Sk,extendMarkRange:xk,first:kk,focus:Nk,forEach:wk,insertContent:Ik,insertContentAt:Mk,joinBackward:Pk,joinDown:Lk,joinForward:Bk,joinItemBackward:Rk,joinItemForward:Fk,joinTextblockBackward:Hk,joinTextblockForward:Uk,joinUp:Dk,keyboardShortcut:Vk,lift:$k,liftEmptyBlock:qk,liftListItem:Wk,newlineInCode:Yk,resetAttributes:jk,scrollIntoView:Kk,selectAll:Gk,selectNodeBackward:Qk,selectNodeForward:Xk,selectParentNode:Jk,selectTextblockEnd:Zk,selectTextblockStart:eA,setContent:tA,setMark:cA,setMeta:dA,setNode:fA,setNodeSelection:hA,setTextSelection:pA,sinkListItem:bA,splitBlock:mA,splitListItem:gA,toggleList:(e,t,n,l={})=>({editor:r,tr:a,state:i,dispatch:s,chain:o,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=r.extensionManager,h=Ge(e,i.schema),m=Ge(t,i.schema),{selection:v,storedMarks:g}=i,{$from:E,$to:N}=v,A=E.blockRange(N),L=g||v.$to.parentOffset&&v.$from.marks();if(!A)return!1;const O=Ro(S=>H0(S.type.name,d))(v);if(A.depth>=1&&O&&A.depth-O.depth<=1){if(O.node.type===h)return u.liftListItem(m);if(H0(O.node.type.name,d)&&h.validContent(O.node.content)&&s)return o().command(()=>(a.setNodeMarkup(O.pos,h),!0)).command(()=>Ho(a,h)).command(()=>Uo(a,h)).run()}return!n||!L||!s?o().command(()=>c().wrapInList(h,l)?!0:u.clearNodes()).wrapInList(h,l).command(()=>Ho(a,h)).command(()=>Uo(a,h)).run():o().command(()=>{const S=c().wrapInList(h,l),_=L.filter(I=>f.includes(I.type.name));return a.ensureMarks(_),S?!0:u.clearNodes()}).wrapInList(h,l).command(()=>Ho(a,h)).command(()=>Uo(a,h)).run()},toggleMark:(e,t={},n={})=>({state:l,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,i=Mn(e,l.schema);return Fo(l,i,t)?r.unsetMark(i,{extendEmptyMarkRange:a}):r.setMark(i,t)},toggleNode:(e,t,n={})=>({state:l,commands:r})=>{const a=Ge(e,l.schema),i=Ge(t,l.schema),s=Yr(l,a,n);let o;return l.selection.$anchor.sameParent(l.selection.$head)&&(o=l.selection.$anchor.parent.attrs),s?r.setNode(i,o):r.setNode(a,{...o,...n})},toggleWrap:(e,t={})=>({state:n,commands:l})=>{const r=Ge(e,n.schema);return Yr(n,r,t)?l.lift(r):l.wrapIn(r,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let l=0;l<n.length;l+=1){const r=n[l];let a;if(r.spec.isInputRules&&(a=r.getState(e))){if(t){const i=e.tr,s=a.transform;for(let o=s.steps.length-1;o>=0;o-=1)i.step(s.steps[o].invert(s.docs[o]));if(a.text){const o=i.doc.resolve(a.from).marks();i.replaceWith(a.from,a.to,e.schema.text(a.text,o))}else i.delete(a.from,a.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:l,ranges:r}=n;return l||t&&r.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:l,dispatch:r})=>{var a;const{extendEmptyMarkRange:i=!1}=t,{selection:s}=n,o=Mn(e,l.schema),{$from:u,empty:c,ranges:d}=s;if(!r)return!0;if(c&&i){let{from:f,to:h}=s;const m=(a=u.marks().find(g=>g.type===o))===null||a===void 0?void 0:a.attrs,v=Po(u,o,m);v&&(f=v.from,h=v.to),n.removeMark(f,h,o)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,o)});return n.removeStoredMark(o),!0},updateAttributes:(e,t={})=>({tr:n,state:l,dispatch:r})=>{let a=null,i=null;const s=ui(typeof e=="string"?e:e.name,l.schema);return s?(s==="node"&&(a=Ge(e,l.schema)),s==="mark"&&(i=Mn(e,l.schema)),r&&n.selection.ranges.forEach(o=>{const u=o.$from.pos,c=o.$to.pos;let d,f,h,m;n.selection.empty?l.doc.nodesBetween(u,c,(v,g)=>{a&&a===v.type&&(h=Math.max(g,u),m=Math.min(g+v.nodeSize,c),d=g,f=v)}):l.doc.nodesBetween(u,c,(v,g)=>{g<u&&a&&a===v.type&&(h=Math.max(g,u),m=Math.min(g+v.nodeSize,c),d=g,f=v),g>=u&&g<=c&&(a&&a===v.type&&n.setNodeMarkup(g,void 0,{...v.attrs,...t}),i&&v.marks.length&&v.marks.forEach(E=>{if(i===E.type){const N=Math.max(g,u),A=Math.min(g+v.nodeSize,c);n.addMark(N,A,i.create({...E.attrs,...t}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),i&&f.marks.length&&f.marks.forEach(v=>{i===v.type&&n.addMark(h,m,i.create({...v.attrs,...t}))}))}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:l})=>{const r=Ge(e,n.schema);return Vx(r,t)(n,l)},wrapInList:(e,t={})=>({state:n,dispatch:l})=>{const r=Ge(e,n.schema);return $x(r,t)(n,l)}});const yA=ut.create({name:"commands",addCommands(){return{...vA}}}),EA=ut.create({name:"drop",addProseMirrorPlugins(){return[new ft({key:new Rt("tiptapDrop"),props:{handleDrop:(e,t,n,l)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:l})}}})]}}),TA=ut.create({name:"editable",addProseMirrorPlugins(){return[new ft({key:new Rt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),CA=new Rt("focusEvents"),SA=ut.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new ft({key:CA,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const l=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(l),!1},blur:(t,n)=>{e.isFocused=!1;const l=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(l),!1}}}})]}}),xA=ut.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:s})=>{const{selection:o,doc:u}=s,{empty:c,$anchor:d}=o,{pos:f,parent:h}=d,m=d.parent.isTextblock&&f>0?s.doc.resolve(f-1):d,v=m.parent.type.spec.isolating,g=d.pos-d.parentOffset,E=v&&m.parent.childCount===1?g===d.pos:Te.atStart(u).from===f;return!c||!h.type.isTextblock||h.textContent.length||!E||E&&d.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),l={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...l},a={...l,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return si()||P0()?a:r},addProseMirrorPlugins(){return[new ft({key:new Rt("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(v=>v.getMeta("composition")))return;const l=e.some(v=>v.docChanged)&&!t.doc.eq(n.doc),r=e.some(v=>v.getMeta("preventClearDocument"));if(!l||r)return;const{empty:a,from:i,to:s}=t.selection,o=Te.atStart(t.doc).from,u=Te.atEnd(t.doc).to;if(a||!(i===o&&s===u)||!di(n.doc))return;const f=n.tr,h=Ja({state:n,transaction:f}),{commands:m}=new Za({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),kA=ut.create({name:"paste",addProseMirrorPlugins(){return[new ft({key:new Rt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),AA=ut.create({name:"tabindex",addProseMirrorPlugins(){return[new ft({key:new Rt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class cl{get name(){return this.node.type.name}constructor(t,n,l=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=l,this.resolvedPos=t,this.editor=n,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,l=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}n=this.from+1,l=this.to-1}this.editor.commands.insertContentAt({from:n,to:l},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new cl(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new cl(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new cl(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,l)=>{const r=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,i=this.pos+l+(a?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const s=this.resolvedPos.doc.resolve(i);if(!r&&s.depth<=this.depth)return;const o=new cl(s,this.editor,r,r?n:null);r&&(o.actualDepth=this.depth+1),t.push(new cl(s,this.editor,r,r?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let l=null,r=this.parent;for(;r&&!l;){if(r.node.type.name===t)if(Object.keys(n).length>0){const a=r.node.attrs,i=Object.keys(n);for(let s=0;s<i.length;s+=1){const o=i[s];if(a[o]!==n[o])break}}else l=r;r=r.parent}return l}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},l=!1){let r=[];if(!this.children||this.children.length===0)return r;const a=Object.keys(n);return this.children.forEach(i=>{l&&r.length>0||(i.node.type.name===t&&a.every(o=>n[o]===i.node.attrs[o])&&r.push(i),!(l&&r.length>0)&&(r=r.concat(i.querySelectorAll(t,n,l))))}),r}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}}const NA=`.ProseMirror {
33
+ `,textSerializers:i={}}=n||{};let s="";return e.nodesBetween(l,r,(o,u,c,d)=>{var f;o.isBlock&&u>l&&(s+=a);const h=i?.[o.type.name];if(h)return c&&(s+=h({node:o,pos:u,parent:c,index:d,range:t})),!1;o.isText&&(s+=(f=o?.text)===null||f===void 0?void 0:f.slice(Math.max(l,u)-u,r-u))}),s}function w0(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const dk=ut.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ft({key:new Rt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:l,selection:r}=t,{ranges:a}=r,i=Math.min(...a.map(c=>c.$from.pos)),s=Math.max(...a.map(c=>c.$to.pos)),o=w0(n);return N0(l,{from:i,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:o})}}})]}}),fk=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),hk=(e=!1)=>({commands:t})=>t.setContent("",e),pk=()=>({state:e,tr:t,dispatch:n})=>{const{selection:l}=t,{ranges:r}=l;return n&&r.forEach(({$from:a,$to:i})=>{e.doc.nodesBetween(a.pos,i.pos,(s,o)=>{if(s.type.isText)return;const{doc:u,mapping:c}=t,d=u.resolve(c.map(o)),f=u.resolve(c.map(o+s.nodeSize)),h=d.blockRange(f);if(!h)return;const m=Ml(h);if(s.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(h.start,v)}(m||m===0)&&t.lift(h,m)})}),!0},bk=e=>t=>e(t),mk=()=>({state:e,dispatch:t})=>g0(e,t),gk=(e,t)=>({editor:n,tr:l})=>{const{state:r}=n,a=r.doc.slice(e.from,e.to);l.deleteRange(e.from,e.to);const i=l.mapping.map(t);return l.insert(i,a.content),l.setSelection(new be(l.doc.resolve(Math.max(i-1,0)))),!0},vk=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,l=n.$anchor.node();if(l.content.size>0)return!1;const r=e.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===l.type){if(t){const s=r.before(a),o=r.after(a);e.delete(s,o).scrollIntoView()}return!0}return!1},yk=e=>({tr:t,state:n,dispatch:l})=>{const r=Ge(e,n.schema),a=t.selection.$anchor;for(let i=a.depth;i>0;i-=1)if(a.node(i).type===r){if(l){const o=a.before(i),u=a.after(i);t.delete(o,u).scrollIntoView()}return!0}return!1},Ek=e=>({tr:t,dispatch:n})=>{const{from:l,to:r}=e;return n&&t.delete(l,r),!0},Tk=()=>({state:e,dispatch:t})=>Ao(e,t),Ck=()=>({commands:e})=>e.keyboardShortcut("Enter"),Sk=()=>({state:e,dispatch:t})=>Px(e,t);function ii(e,t,n={strict:!0}){const l=Object.keys(t);return l.length?l.every(r=>n.strict?t[r]===e[r]:Lo(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function I0(e,t,n={}){return e.find(l=>l.type===t&&ii(Object.fromEntries(Object.keys(n).map(r=>[r,l.attrs[r]])),n))}function _0(e,t,n={}){return!!I0(e,t,n)}function Po(e,t,n){var l;if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===t)||(n=n||((l=r.node.marks[0])===null||l===void 0?void 0:l.attrs),!I0([...r.node.marks],t,n)))return;let i=r.index,s=e.start()+r.offset,o=i+1,u=s+r.node.nodeSize;for(;i>0&&_0([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&_0([...e.parent.child(o).marks],t,n);)u+=e.parent.child(o).nodeSize,o+=1;return{from:s,to:u}}function Mn(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const xk=(e,t={})=>({tr:n,state:l,dispatch:r})=>{const a=Mn(e,l.schema),{doc:i,selection:s}=n,{$from:o,from:u,to:c}=s;if(r){const d=Po(o,a,t);if(d&&d.from<=u&&d.to>=c){const f=be.create(i,d.from,d.to);n.setSelection(f)}}return!0},kk=e=>t=>{const n=typeof e=="function"?e(t):e;for(let l=0;l<n.length;l+=1)if(n[l](t))return!0;return!1};function O0(e){return e instanceof be}function ul(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function M0(e,t=null){if(!t)return null;const n=Ce.atStart(e),l=Ce.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return l;const r=n.from,a=l.to;return t==="all"?be.create(e,ul(0,r,a),ul(e.content.size,r,a)):be.create(e,ul(t,r,a),ul(t,r,a))}function D0(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function si(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ak(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const Nk=(e=null,t={})=>({editor:n,view:l,tr:r,dispatch:a})=>{t={scrollIntoView:!0,...t};const i=()=>{(si()||D0())&&l.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(l.focus(),Ak()&&!si()&&!D0()&&l.dom.focus({preventScroll:!0}))})};if(l.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!O0(n.state.selection))return i(),!0;const s=M0(r.doc,e)||n.state.selection,o=n.state.selection.eq(s);return a&&(o||r.setSelection(s),o&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},wk=(e,t)=>n=>e.every((l,r)=>t(l,{...n,index:r})),Ik=(e,t)=>({tr:n,commands:l})=>l.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),L0=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const l=t[n];l.nodeType===3&&l.nodeValue&&/^(\n\s\s|\n)$/.test(l.nodeValue)?e.removeChild(l):l.nodeType===1&&L0(l)}return e};function oi(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return L0(n)}function Wr(e,t,n){if(e instanceof vn||e instanceof K)return e;n={slice:!0,parseOptions:{},...n};const l=typeof e=="object"&&e!==null,r=typeof e=="string";if(l)try{if(Array.isArray(e)&&e.length>0)return K.fromArray(e.map(s=>t.nodeFromJSON(s)));const i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",a),Wr("",t,n)}if(r){if(n.errorOnInvalidContent){let i=!1,s="";const o=new bh({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(i=!0,s=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?wr.fromSchema(o).parseSlice(oi(e),n.parseOptions):wr.fromSchema(o).parse(oi(e),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const a=wr.fromSchema(t);return n.slice?a.parseSlice(oi(e),n.parseOptions).content:a.parse(oi(e),n.parseOptions)}return Wr("",t,n)}function _k(e,t,n){const l=e.steps.length-1;if(l<t)return;const r=e.steps[l];if(!(r instanceof qe||r instanceof Ke))return;const a=e.mapping.maps[l];let i=0;a.forEach((s,o,u,c)=>{i===0&&(i=c)}),e.setSelection(Ce.near(e.doc.resolve(i),n))}const Ok=e=>!("type"in e),Mk=(e,t,n)=>({tr:l,dispatch:r,editor:a})=>{var i;if(r){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;const o=g=>{a.emit("contentError",{editor:a,error:g,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Wr(t,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){o(g)}try{s=Wr(t,a.schema,{parseOptions:u,errorOnInvalidContent:(i=n.errorOnInvalidContent)!==null&&i!==void 0?i:a.options.enableContentCheck})}catch(g){return o(g),!1}let{from:c,to:d}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},f=!0,h=!0;if((Ok(s)?s:[s]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),c===d&&h){const{parent:g}=l.doc.resolve(c);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(c-=1,d+=1)}let v;if(f){if(Array.isArray(t))v=t.map(g=>g.text||"").join("");else if(t instanceof K){let g="";t.forEach(E=>{E.text&&(g+=E.text)}),v=g}else typeof t=="object"&&t&&t.text?v=t.text:v=t;l.insertText(v,c,d)}else v=s,l.replaceWith(c,d,v);n.updateSelection&&_k(l,l.steps.length-1,-1),n.applyInputRules&&l.setMeta("applyInputRules",{from:c,text:v}),n.applyPasteRules&&l.setMeta("applyPasteRules",{from:c,text:v})}return!0},Dk=()=>({state:e,dispatch:t})=>Mx(e,t),Lk=()=>({state:e,dispatch:t})=>Dx(e,t),Pk=()=>({state:e,dispatch:t})=>c0(e,t),Bk=()=>({state:e,dispatch:t})=>p0(e,t),Rk=()=>({state:e,dispatch:t,tr:n})=>{try{const l=Ha(e.doc,e.selection.$from.pos,-1);return l==null?!1:(n.join(l,2),t&&t(n),!0)}catch{return!1}},Fk=()=>({state:e,dispatch:t,tr:n})=>{try{const l=Ha(e.doc,e.selection.$from.pos,1);return l==null?!1:(n.join(l,2),t&&t(n),!0)}catch{return!1}},Hk=()=>({state:e,dispatch:t})=>_x(e,t),Uk=()=>({state:e,dispatch:t})=>Ox(e,t);function P0(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function zk(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let l,r,a,i;for(let s=0;s<t.length-1;s+=1){const o=t[s];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))l=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))a=!0;else if(/^mod$/i.test(o))si()||P0()?i=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${o}`)}return l&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const Vk=e=>({editor:t,view:n,tr:l,dispatch:r})=>{const a=zk(e).split(/-(?!$)/),i=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),s=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),o=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,s))});return o?.steps.forEach(u=>{const c=u.map(l.mapping);c&&r&&l.maybeStep(c)}),!0};function Yr(e,t,n={}){const{from:l,to:r,empty:a}=e.selection,i=t?Ge(t,e.schema):null,s=[];e.doc.nodesBetween(l,r,(d,f)=>{if(d.isText)return;const h=Math.max(l,f),m=Math.min(r,f+d.nodeSize);s.push({node:d,from:h,to:m})});const o=r-l,u=s.filter(d=>i?i.name===d.node.type.name:!0).filter(d=>ii(d.node.attrs,n,{strict:!1}));return a?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=o}const $k=(e,t={})=>({state:n,dispatch:l})=>{const r=Ge(e,n.schema);return Yr(n,r,t)?Lx(n,l):!1},qk=()=>({state:e,dispatch:t})=>v0(e,t),Wk=e=>({state:t,dispatch:n})=>{const l=Ge(e,t.schema);return Yx(l)(t,n)},Yk=()=>({state:e,dispatch:t})=>m0(e,t);function ui(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function B0(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((l,r)=>(n.includes(r)||(l[r]=e[r]),l),{})}const jk=(e,t)=>({tr:n,state:l,dispatch:r})=>{let a=null,i=null;const s=ui(typeof e=="string"?e:e.name,l.schema);return s?(s==="node"&&(a=Ge(e,l.schema)),s==="mark"&&(i=Mn(e,l.schema)),r&&n.selection.ranges.forEach(o=>{l.doc.nodesBetween(o.$from.pos,o.$to.pos,(u,c)=>{a&&a===u.type&&n.setNodeMarkup(c,void 0,B0(u.attrs,t)),i&&u.marks.length&&u.marks.forEach(d=>{i===d.type&&n.addMark(c,c+u.nodeSize,i.create(B0(d.attrs,t)))})})}),!0):!1},Kk=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Gk=()=>({tr:e,dispatch:t})=>{if(t){const n=new At(e.doc);e.setSelection(n)}return!0},Qk=()=>({state:e,dispatch:t})=>f0(e,t),Xk=()=>({state:e,dispatch:t})=>b0(e,t),Jk=()=>({state:e,dispatch:t})=>Fx(e,t),Zk=()=>({state:e,dispatch:t})=>zx(e,t),eA=()=>({state:e,dispatch:t})=>Ux(e,t);function Bo(e,t,n={},l={}){return Wr(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:l.errorOnInvalidContent})}const tA=(e,t=!1,n={},l={})=>({editor:r,tr:a,dispatch:i,commands:s})=>{var o,u;const{doc:c}=a;if(n.preserveWhitespace!=="full"){const d=Bo(e,r.schema,n,{errorOnInvalidContent:(o=l.errorOnInvalidContent)!==null&&o!==void 0?o:r.options.enableContentCheck});return i&&a.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!t),!0}return i&&a.setMeta("preventUpdate",!t),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:(u=l.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function R0(e,t){const n=Mn(t,e.schema),{from:l,to:r,empty:a}=e.selection,i=[];a?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(l,r,o=>{i.push(...o.marks)});const s=i.find(o=>o.type.name===n.name);return s?{...s.attrs}:{}}function nA(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function lA(e,t){for(let n=e.depth;n>0;n-=1){const l=e.node(n);if(t(l))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:l}}}function Ro(e){return t=>lA(t.$from,e)}function rA(e,t){const n={from:0,to:e.content.size};return N0(e,n,t)}function aA(e,t){const n=Ge(t,e.schema),{from:l,to:r}=e.selection,a=[];e.doc.nodesBetween(l,r,s=>{a.push(s)});const i=a.reverse().find(s=>s.type.name===n.name);return i?{...i.attrs}:{}}function iA(e,t){const n=ui(typeof t=="string"?t:t.name,e.schema);return n==="node"?aA(e,t):n==="mark"?R0(e,t):{}}function F0(e,t,n){const l=[];return e===t?n.resolve(e).marks().forEach(r=>{const a=n.resolve(e),i=Po(a,r.type);i&&l.push({mark:r,...i})}):n.nodesBetween(e,t,(r,a)=>{!r||r?.nodeSize===void 0||l.push(...r.marks.map(i=>({from:a,to:a+r.nodeSize,mark:i})))}),l}function ci(e,t,n){return Object.fromEntries(Object.entries(n).filter(([l])=>{const r=e.find(a=>a.type===t&&a.name===l);return r?r.attribute.keepOnSplit:!1}))}function Fo(e,t,n={}){const{empty:l,ranges:r}=e.selection,a=t?Mn(t,e.schema):null;if(l)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>a?a.name===d.type.name:!0).find(d=>ii(d.attrs,n,{strict:!1}));let i=0;const s=[];if(r.forEach(({$from:d,$to:f})=>{const h=d.pos,m=f.pos;e.doc.nodesBetween(h,m,(v,g)=>{if(!v.isText&&!v.marks.length)return;const E=Math.max(h,g),N=Math.min(m,g+v.nodeSize),A=N-E;i+=A,s.push(...v.marks.map(L=>({mark:L,from:E,to:N})))})}),i===0)return!1;const o=s.filter(d=>a?a.name===d.mark.type.name:!0).filter(d=>ii(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=s.filter(d=>a?d.mark.type!==a&&d.mark.type.excludes(a):!0).reduce((d,f)=>d+f.to-f.from,0);return(o>0?o+u:o)>=i}function sA(e,t,n={}){if(!t)return Yr(e,null,n)||Fo(e,null,n);const l=ui(t,e.schema);return l==="node"?Yr(e,t,n):l==="mark"?Fo(e,t,n):!1}function H0(e,t){const{nodeExtensions:n}=ei(t),l=n.find(i=>i.name===e);if(!l)return!1;const r={name:l.name,options:l.options,storage:l.storage},a=Se(se(l,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function di(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var l;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((l=e.text)!==null&&l!==void 0?l:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(a=>{r!==!1&&(di(a,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function oA(e){return e instanceof he}function uA(e,t,n){var l;const{selection:r}=t;let a=null;if(O0(r)&&(a=r.$cursor),a){const s=(l=e.storedMarks)!==null&&l!==void 0?l:a.marks();return!!n.isInSet(s)||!s.some(o=>o.type.excludes(n))}const{ranges:i}=r;return i.some(({$from:s,$to:o})=>{let u=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,o.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const h=!f||f.type.allowsMarkType(n),m=!!n.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(n));u=h&&m}return!u}),u})}const cA=(e,t={})=>({tr:n,state:l,dispatch:r})=>{const{selection:a}=n,{empty:i,ranges:s}=a,o=Mn(e,l.schema);if(r)if(i){const u=R0(l,o);n.addStoredMark(o.create({...u,...t}))}else s.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;l.doc.nodesBetween(c,d,(f,h)=>{const m=Math.max(h,c),v=Math.min(h+f.nodeSize,d);f.marks.find(E=>E.type===o)?f.marks.forEach(E=>{o===E.type&&n.addMark(m,v,o.create({...E.attrs,...t}))}):n.addMark(m,v,o.create(t))})});return uA(l,n,o)},dA=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),fA=(e,t={})=>({state:n,dispatch:l,chain:r})=>{const a=Ge(e,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),a.isTextblock?r().command(({commands:s})=>T0(a,{...i,...t})(n)?!0:s.clearNodes()).command(({state:s})=>T0(a,{...i,...t})(s,l)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},hA=e=>({tr:t,dispatch:n})=>{if(n){const{doc:l}=t,r=ul(e,0,l.content.size),a=he.create(l,r);t.setSelection(a)}return!0},pA=e=>({tr:t,dispatch:n})=>{if(n){const{doc:l}=t,{from:r,to:a}=typeof e=="number"?{from:e,to:e}:e,i=be.atStart(l).from,s=be.atEnd(l).to,o=ul(r,i,s),u=ul(a,i,s),c=be.create(l,o,u);t.setSelection(c)}return!0},bA=e=>({state:t,dispatch:n})=>{const l=Ge(e,t.schema);return Gx(l)(t,n)};function U0(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const l=n.filter(r=>t?.includes(r.type.name));e.tr.ensureMarks(l)}}const mA=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:l,editor:r})=>{const{selection:a,doc:i}=t,{$from:s,$to:o}=a,u=r.extensionManager.attributes,c=ci(u,s.node().type.name,s.node().attrs);if(a instanceof he&&a.node.isBlock)return!s.parentOffset||!tn(i,s.pos)?!1:(l&&(e&&U0(n,r.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const d=o.parentOffset===o.parent.content.size,f=s.depth===0?void 0:nA(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=d&&f?[{type:f,attrs:c}]:void 0,m=tn(t.doc,t.mapping.map(s.pos),1,h);if(!h&&!m&&tn(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:c}]:void 0),l){if(m&&(a instanceof be&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,h),f&&!d&&!s.parentOffset&&s.parent.type!==f)){const v=t.mapping.map(s.before()),g=t.doc.resolve(v);s.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&U0(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return m},gA=(e,t={})=>({tr:n,state:l,dispatch:r,editor:a})=>{var i;const s=Ge(e,l.schema),{$from:o,$to:u}=l.selection,c=l.selection.node;if(c&&c.isBlock||o.depth<2||!o.sameParent(u))return!1;const d=o.node(-1);if(d.type!==s)return!1;const f=a.extensionManager.attributes;if(o.parent.content.size===0&&o.node(-1).childCount===o.indexAfter(-1)){if(o.depth===2||o.node(-3).type!==s||o.index(-2)!==o.node(-2).childCount-1)return!1;if(r){let E=K.empty;const N=o.index(-1)?1:o.index(-2)?2:3;for(let I=o.depth-N;I>=o.depth-3;I-=1)E=K.from(o.node(I).copy(E));const A=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3,L={...ci(f,o.node().type.name,o.node().attrs),...t},O=((i=s.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(L))||void 0;E=E.append(K.from(s.createAndFill(null,O)||void 0));const S=o.before(o.depth-(N-1));n.replace(S,o.after(-A),new ae(E,4-N,0));let _=-1;n.doc.nodesBetween(S,n.doc.content.size,(I,k)=>{if(_>-1)return!1;I.isTextblock&&I.content.size===0&&(_=k+1)}),_>-1&&n.setSelection(be.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const h=u.pos===o.end()?d.contentMatchAt(0).defaultType:null,m={...ci(f,d.type.name,d.attrs),...t},v={...ci(f,o.node().type.name,o.node().attrs),...t};n.delete(o.pos,u.pos);const g=h?[{type:s,attrs:m},{type:h,attrs:v}]:[{type:s,attrs:m}];if(!tn(n.doc,o.pos,2))return!1;if(r){const{selection:E,storedMarks:N}=l,{splittableMarks:A}=a.extensionManager,L=N||E.$to.parentOffset&&E.$from.marks();if(n.split(o.pos,2,g).scrollIntoView(),!L||!r)return!0;const O=L.filter(S=>A.includes(S.type.name));n.ensureMarks(O)}return!0},Ho=(e,t)=>{const n=Ro(i=>i.type===t)(e.selection);if(!n)return!0;const l=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(l===void 0)return!0;const r=e.doc.nodeAt(l);return n.node.type===r?.type&&Tn(e.doc,n.pos)&&e.join(n.pos),!0},Uo=(e,t)=>{const n=Ro(i=>i.type===t)(e.selection);if(!n)return!0;const l=e.doc.resolve(n.start).after(n.depth);if(l===void 0)return!0;const r=e.doc.nodeAt(l);return n.node.type===r?.type&&Tn(e.doc,l)&&e.join(l),!0};var vA=Object.freeze({__proto__:null,blur:fk,clearContent:hk,clearNodes:pk,command:bk,createParagraphNear:mk,cut:gk,deleteCurrentNode:vk,deleteNode:yk,deleteRange:Ek,deleteSelection:Tk,enter:Ck,exitCode:Sk,extendMarkRange:xk,first:kk,focus:Nk,forEach:wk,insertContent:Ik,insertContentAt:Mk,joinBackward:Pk,joinDown:Lk,joinForward:Bk,joinItemBackward:Rk,joinItemForward:Fk,joinTextblockBackward:Hk,joinTextblockForward:Uk,joinUp:Dk,keyboardShortcut:Vk,lift:$k,liftEmptyBlock:qk,liftListItem:Wk,newlineInCode:Yk,resetAttributes:jk,scrollIntoView:Kk,selectAll:Gk,selectNodeBackward:Qk,selectNodeForward:Xk,selectParentNode:Jk,selectTextblockEnd:Zk,selectTextblockStart:eA,setContent:tA,setMark:cA,setMeta:dA,setNode:fA,setNodeSelection:hA,setTextSelection:pA,sinkListItem:bA,splitBlock:mA,splitListItem:gA,toggleList:(e,t,n,l={})=>({editor:r,tr:a,state:i,dispatch:s,chain:o,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=r.extensionManager,h=Ge(e,i.schema),m=Ge(t,i.schema),{selection:v,storedMarks:g}=i,{$from:E,$to:N}=v,A=E.blockRange(N),L=g||v.$to.parentOffset&&v.$from.marks();if(!A)return!1;const O=Ro(S=>H0(S.type.name,d))(v);if(A.depth>=1&&O&&A.depth-O.depth<=1){if(O.node.type===h)return u.liftListItem(m);if(H0(O.node.type.name,d)&&h.validContent(O.node.content)&&s)return o().command(()=>(a.setNodeMarkup(O.pos,h),!0)).command(()=>Ho(a,h)).command(()=>Uo(a,h)).run()}return!n||!L||!s?o().command(()=>c().wrapInList(h,l)?!0:u.clearNodes()).wrapInList(h,l).command(()=>Ho(a,h)).command(()=>Uo(a,h)).run():o().command(()=>{const S=c().wrapInList(h,l),_=L.filter(I=>f.includes(I.type.name));return a.ensureMarks(_),S?!0:u.clearNodes()}).wrapInList(h,l).command(()=>Ho(a,h)).command(()=>Uo(a,h)).run()},toggleMark:(e,t={},n={})=>({state:l,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,i=Mn(e,l.schema);return Fo(l,i,t)?r.unsetMark(i,{extendEmptyMarkRange:a}):r.setMark(i,t)},toggleNode:(e,t,n={})=>({state:l,commands:r})=>{const a=Ge(e,l.schema),i=Ge(t,l.schema),s=Yr(l,a,n);let o;return l.selection.$anchor.sameParent(l.selection.$head)&&(o=l.selection.$anchor.parent.attrs),s?r.setNode(i,o):r.setNode(a,{...o,...n})},toggleWrap:(e,t={})=>({state:n,commands:l})=>{const r=Ge(e,n.schema);return Yr(n,r,t)?l.lift(r):l.wrapIn(r,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let l=0;l<n.length;l+=1){const r=n[l];let a;if(r.spec.isInputRules&&(a=r.getState(e))){if(t){const i=e.tr,s=a.transform;for(let o=s.steps.length-1;o>=0;o-=1)i.step(s.steps[o].invert(s.docs[o]));if(a.text){const o=i.doc.resolve(a.from).marks();i.replaceWith(a.from,a.to,e.schema.text(a.text,o))}else i.delete(a.from,a.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:l,ranges:r}=n;return l||t&&r.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:l,dispatch:r})=>{var a;const{extendEmptyMarkRange:i=!1}=t,{selection:s}=n,o=Mn(e,l.schema),{$from:u,empty:c,ranges:d}=s;if(!r)return!0;if(c&&i){let{from:f,to:h}=s;const m=(a=u.marks().find(g=>g.type===o))===null||a===void 0?void 0:a.attrs,v=Po(u,o,m);v&&(f=v.from,h=v.to),n.removeMark(f,h,o)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,o)});return n.removeStoredMark(o),!0},updateAttributes:(e,t={})=>({tr:n,state:l,dispatch:r})=>{let a=null,i=null;const s=ui(typeof e=="string"?e:e.name,l.schema);return s?(s==="node"&&(a=Ge(e,l.schema)),s==="mark"&&(i=Mn(e,l.schema)),r&&n.selection.ranges.forEach(o=>{const u=o.$from.pos,c=o.$to.pos;let d,f,h,m;n.selection.empty?l.doc.nodesBetween(u,c,(v,g)=>{a&&a===v.type&&(h=Math.max(g,u),m=Math.min(g+v.nodeSize,c),d=g,f=v)}):l.doc.nodesBetween(u,c,(v,g)=>{g<u&&a&&a===v.type&&(h=Math.max(g,u),m=Math.min(g+v.nodeSize,c),d=g,f=v),g>=u&&g<=c&&(a&&a===v.type&&n.setNodeMarkup(g,void 0,{...v.attrs,...t}),i&&v.marks.length&&v.marks.forEach(E=>{if(i===E.type){const N=Math.max(g,u),A=Math.min(g+v.nodeSize,c);n.addMark(N,A,i.create({...E.attrs,...t}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),i&&f.marks.length&&f.marks.forEach(v=>{i===v.type&&n.addMark(h,m,i.create({...v.attrs,...t}))}))}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:l})=>{const r=Ge(e,n.schema);return Vx(r,t)(n,l)},wrapInList:(e,t={})=>({state:n,dispatch:l})=>{const r=Ge(e,n.schema);return $x(r,t)(n,l)}});const yA=ut.create({name:"commands",addCommands(){return{...vA}}}),EA=ut.create({name:"drop",addProseMirrorPlugins(){return[new ft({key:new Rt("tiptapDrop"),props:{handleDrop:(e,t,n,l)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:l})}}})]}}),TA=ut.create({name:"editable",addProseMirrorPlugins(){return[new ft({key:new Rt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),CA=new Rt("focusEvents"),SA=ut.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new ft({key:CA,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const l=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(l),!1},blur:(t,n)=>{e.isFocused=!1;const l=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(l),!1}}}})]}}),xA=ut.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:s})=>{const{selection:o,doc:u}=s,{empty:c,$anchor:d}=o,{pos:f,parent:h}=d,m=d.parent.isTextblock&&f>0?s.doc.resolve(f-1):d,v=m.parent.type.spec.isolating,g=d.pos-d.parentOffset,E=v&&m.parent.childCount===1?g===d.pos:Ce.atStart(u).from===f;return!c||!h.type.isTextblock||h.textContent.length||!E||E&&d.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),l={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...l},a={...l,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return si()||P0()?a:r},addProseMirrorPlugins(){return[new ft({key:new Rt("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(v=>v.getMeta("composition")))return;const l=e.some(v=>v.docChanged)&&!t.doc.eq(n.doc),r=e.some(v=>v.getMeta("preventClearDocument"));if(!l||r)return;const{empty:a,from:i,to:s}=t.selection,o=Ce.atStart(t.doc).from,u=Ce.atEnd(t.doc).to;if(a||!(i===o&&s===u)||!di(n.doc))return;const f=n.tr,h=Ja({state:n,transaction:f}),{commands:m}=new Za({editor:this.editor,state:h});if(m.clearNodes(),!!f.steps.length)return f}})]}}),kA=ut.create({name:"paste",addProseMirrorPlugins(){return[new ft({key:new Rt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),AA=ut.create({name:"tabindex",addProseMirrorPlugins(){return[new ft({key:new Rt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class cl{get name(){return this.node.type.name}constructor(t,n,l=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=l,this.resolvedPos=t,this.editor=n,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,l=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}n=this.from+1,l=this.to-1}this.editor.commands.insertContentAt({from:n,to:l},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new cl(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new cl(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new cl(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,l)=>{const r=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,i=this.pos+l+(a?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const s=this.resolvedPos.doc.resolve(i);if(!r&&s.depth<=this.depth)return;const o=new cl(s,this.editor,r,r?n:null);r&&(o.actualDepth=this.depth+1),t.push(new cl(s,this.editor,r,r?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let l=null,r=this.parent;for(;r&&!l;){if(r.node.type.name===t)if(Object.keys(n).length>0){const a=r.node.attrs,i=Object.keys(n);for(let s=0;s<i.length;s+=1){const o=i[s];if(a[o]!==n[o])break}}else l=r;r=r.parent}return l}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},l=!1){let r=[];if(!this.children||this.children.length===0)return r;const a=Object.keys(n);return this.children.forEach(i=>{l&&r.length>0||(i.node.type.name===t&&a.every(o=>n[o]===i.node.attrs[o])&&r.push(i),!(l&&r.length>0)&&(r=r.concat(i.querySelectorAll(t,n,l))))}),r}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}}const NA=`.ProseMirror {
34
34
  position: relative;
35
35
  }
36
36
 
@@ -106,7 +106,7 @@ img.ProseMirror-separator {
106
106
  opacity: 0
107
107
  }`;function wA(e,t,n){const l=document.querySelector("style[data-tiptap-style]");if(l!==null)return l;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}class IA extends Qx{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),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,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>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("contentError",this.options.onContentError),this.createView(),this.injectCSS(),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:l,moved:r})=>this.options.onDrop(n,l,r)),this.on("paste",({event:n,slice:l})=>this.options.onPaste(n,l)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}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&&document&&(this.css=wA(NA,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const l=S0(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:l});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const n=this.state.plugins;let l=n;if([].concat(t).forEach(a=>{const i=typeof a=="string"?`${a}$`:a.key;l=l.filter(s=>!s.key.startsWith(i))}),n.length===l.length)return;const r=this.state.reconfigure({plugins:l});return this.view.updateState(r),r}createExtensionManager(){var t,n;const r=[...this.options.enableCoreExtensions?[TA,dk.configure({blockSeparator:(n=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),yA,SA,xA,AA,EA,kA].filter(a=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[a.name]!==!1:!0):[],...this.options.extensions].filter(a=>["extension","node","mark"].includes(a?.type));this.extensionManager=new ql(r,this)}createCommandManager(){this.commandManager=new Za({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let n;try{n=Bo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),n=Bo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const l=M0(n,this.options.autofocus);this.view=new n0(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Bl.create({doc:n,selection:l||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(i=>{var s;return(s=this.capturedTransaction)===null||s===void 0?void 0:s.step(i)});return}const n=this.state.apply(t),l=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),l&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus"),a=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),a&&this.emit("blur",{editor:this,event:a.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return iA(this.state,t)}isActive(t,n){const l=typeof t=="string"?t:null,r=typeof t=="string"?n:t;return sA(this.state,l,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Do(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
108
108
 
109
- `,textSerializers:l={}}=t||{};return rA(this.state.doc,{blockSeparator:n,textSerializers:{...w0(this.schema),...l}})}get isEmpty(){return di(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var l;return((l=this.$doc)===null||l===void 0?void 0:l.querySelector(t,n))||null}$nodes(t,n){var l;return((l=this.$doc)===null||l===void 0?void 0:l.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new cl(n,this)}get $doc(){return this.$pos(0)}}function Wl(e){return new ti({find:e.find,handler:({state:t,range:n,match:l})=>{const r=Ce(e.getAttributes,void 0,l);if(r===!1||r===null)return null;const{tr:a}=t,i=l[l.length-1],s=l[0];if(i){const o=s.search(/\S/),u=n.from+s.indexOf(i),c=u+i.length;if(F0(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(v=>v===e.type&&v!==h.mark.type)).filter(h=>h.to>u).length)return null;c<n.to&&a.delete(c,n.to),u>n.from&&a.delete(n.from+o,u);const f=n.from+o+i.length;a.addMark(n.from+o,f,e.type.create(r||{})),a.removeStoredMark(e.type)}}})}function _A(e){return new ti({find:e.find,handler:({state:t,range:n,match:l})=>{const r=Ce(e.getAttributes,void 0,l)||{},{tr:a}=t,i=n.from;let s=n.to;const o=e.type.create(r);if(l[1]){const u=l[0].lastIndexOf(l[1]);let c=i+u;c>s?c=s:s=c+l[1].length;const d=l[0][l[0].length-1];a.insertText(d,i+l[0].length-1),a.replaceWith(c,s,o)}else if(l[0]){const u=e.type.isInline?i:i-1;a.insert(u,e.type.create(r)).delete(a.mapping.map(i),a.mapping.map(s))}a.scrollIntoView()}})}function zo(e){return new ti({find:e.find,handler:({state:t,range:n,match:l})=>{const r=t.doc.resolve(n.from),a=Ce(e.getAttributes,void 0,l)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)}})}function jr(e){return new ti({find:e.find,handler:({state:t,range:n,match:l,chain:r})=>{const a=Ce(e.getAttributes,void 0,l)||{},i=t.tr.delete(n.from,n.to),o=i.doc.resolve(n.from).blockRange(),u=o&&Ys(o,e.type,a);if(!u)return null;if(i.wrap(o,u),e.keepMarks&&e.editor){const{selection:d,storedMarks:f}=t,{splittableMarks:h}=e.editor.extensionManager,m=f||d.$to.parentOffset&&d.$from.marks();if(m){const v=m.filter(g=>h.includes(g.type.name));i.ensureMarks(v)}}if(e.keepAttributes){const d=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(d,a).run()}const c=i.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&Tn(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(l,c))&&i.join(n.from-1)}})}class Et{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ce(se(this,"addOptions",{name:this.name}))),this.storage=Ce(se(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Et(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>ri(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Et(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ce(se(n,"addOptions",{name:n.name})),n.storage=Ce(se(n,"addStorage",{name:n.name,options:n.options})),n}}function Yl(e){return new ak({find:e.find,handler:({state:t,range:n,match:l,pasteEvent:r})=>{const a=Ce(e.getAttributes,void 0,l,r);if(a===!1||a===null)return null;const{tr:i}=t,s=l[l.length-1],o=l[0];let u=n.to;if(s){const c=o.search(/\S/),d=n.from+o.indexOf(s),f=d+s.length;if(F0(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(g=>g===e.type&&g!==m.mark.type)).filter(m=>m.to>d).length)return null;f<n.to&&i.delete(f,n.to),d>n.from&&i.delete(n.from+c,d),u=n.from+c+s.length,i.addMark(n.from+c,u,e.type.create(a||{})),i.removeStoredMark(e.type)}}})}function OA(e,t){const{selection:n}=e,{$from:l}=n;if(n instanceof he){const a=l.index();return l.parent.canReplaceWith(a,a+1,t)}let r=l.depth;for(;r>=0;){const a=l.index(r);if(l.node(r).contentMatchAt(a).matchType(t))return!0;r-=1}return!1}function MA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vo={exports:{}},$o={};/**
109
+ `,textSerializers:l={}}=t||{};return rA(this.state.doc,{blockSeparator:n,textSerializers:{...w0(this.schema),...l}})}get isEmpty(){return di(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var l;return((l=this.$doc)===null||l===void 0?void 0:l.querySelector(t,n))||null}$nodes(t,n){var l;return((l=this.$doc)===null||l===void 0?void 0:l.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new cl(n,this)}get $doc(){return this.$pos(0)}}function Wl(e){return new ti({find:e.find,handler:({state:t,range:n,match:l})=>{const r=Se(e.getAttributes,void 0,l);if(r===!1||r===null)return null;const{tr:a}=t,i=l[l.length-1],s=l[0];if(i){const o=s.search(/\S/),u=n.from+s.indexOf(i),c=u+i.length;if(F0(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(v=>v===e.type&&v!==h.mark.type)).filter(h=>h.to>u).length)return null;c<n.to&&a.delete(c,n.to),u>n.from&&a.delete(n.from+o,u);const f=n.from+o+i.length;a.addMark(n.from+o,f,e.type.create(r||{})),a.removeStoredMark(e.type)}}})}function _A(e){return new ti({find:e.find,handler:({state:t,range:n,match:l})=>{const r=Se(e.getAttributes,void 0,l)||{},{tr:a}=t,i=n.from;let s=n.to;const o=e.type.create(r);if(l[1]){const u=l[0].lastIndexOf(l[1]);let c=i+u;c>s?c=s:s=c+l[1].length;const d=l[0][l[0].length-1];a.insertText(d,i+l[0].length-1),a.replaceWith(c,s,o)}else if(l[0]){const u=e.type.isInline?i:i-1;a.insert(u,e.type.create(r)).delete(a.mapping.map(i),a.mapping.map(s))}a.scrollIntoView()}})}function zo(e){return new ti({find:e.find,handler:({state:t,range:n,match:l})=>{const r=t.doc.resolve(n.from),a=Se(e.getAttributes,void 0,l)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)}})}function jr(e){return new ti({find:e.find,handler:({state:t,range:n,match:l,chain:r})=>{const a=Se(e.getAttributes,void 0,l)||{},i=t.tr.delete(n.from,n.to),o=i.doc.resolve(n.from).blockRange(),u=o&&Ys(o,e.type,a);if(!u)return null;if(i.wrap(o,u),e.keepMarks&&e.editor){const{selection:d,storedMarks:f}=t,{splittableMarks:h}=e.editor.extensionManager,m=f||d.$to.parentOffset&&d.$from.marks();if(m){const v=m.filter(g=>h.includes(g.type.name));i.ensureMarks(v)}}if(e.keepAttributes){const d=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(d,a).run()}const c=i.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&Tn(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(l,c))&&i.join(n.from-1)}})}class Et{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Se(se(this,"addOptions",{name:this.name}))),this.storage=Se(se(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Et(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>ri(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Et(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Se(se(n,"addOptions",{name:n.name})),n.storage=Se(se(n,"addStorage",{name:n.name,options:n.options})),n}}function Yl(e){return new ak({find:e.find,handler:({state:t,range:n,match:l,pasteEvent:r})=>{const a=Se(e.getAttributes,void 0,l,r);if(a===!1||a===null)return null;const{tr:i}=t,s=l[l.length-1],o=l[0];let u=n.to;if(s){const c=o.search(/\S/),d=n.from+o.indexOf(s),f=d+s.length;if(F0(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(g=>g===e.type&&g!==m.mark.type)).filter(m=>m.to>d).length)return null;f<n.to&&i.delete(f,n.to),d>n.from&&i.delete(n.from+c,d),u=n.from+c+s.length,i.addMark(n.from+c,u,e.type.create(a||{})),i.removeStoredMark(e.type)}}})}function OA(e,t){const{selection:n}=e,{$from:l}=n;if(n instanceof he){const a=l.index();return l.parent.canReplaceWith(a,a+1,t)}let r=l.depth;for(;r>=0;){const a=l.index(r);if(l.node(r).contentMatchAt(a).matchType(t))return!0;r-=1}return!1}function MA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vo={exports:{}},$o={};/**
110
110
  * @license React
111
111
  * use-sync-external-store-shim.production.min.js
112
112
  *
@@ -140,15 +140,15 @@ img.ProseMirror-separator {
140
140
  * LICENSE file in the root directory of this source tree.
141
141
  */var q0;function qA(){return q0||(q0=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=y,t=fi;function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var l=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,o=e.useDebugValue;function u(c,d,f,h,m){var v=a(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var E=s(function(){var O=!1,S,_,I=function(H){if(!O){O=!0,S=H;var q=h(H);if(m!==void 0&&g.hasValue){var B=g.value;if(m(B,q))return _=B,B}return _=q,q}var T=S,F=_;if(l(T,H))return F;var V=h(H);return m!==void 0&&m(F,V)?F:(S=H,_=V,V)},k=f===void 0?null:f,R=function(){return I(d())},M=k===null?void 0:function(){return I(k())};return[R,M]},[d,f,h,m]),N=E[0],A=E[1],L=r(c,N,A);return i(function(){g.hasValue=!0,g.value=L},[L]),o(L),L}jo.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),jo}process.env.NODE_ENV==="production"?Wo.exports=$A():Wo.exports=qA();var WA=Wo.exports;const YA=typeof window<"u"?y.useLayoutEffect:y.useEffect;class jA{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 n=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},l=this.editor;return l.on("transaction",n),()=>{l.off("transaction",n)}}}}function KA(e){var t;const[n]=y.useState(()=>new jA(e.editor)),l=WA.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:VA);return YA(()=>n.watch(e.editor),[e.editor,n]),y.useDebugValue(l),l}const W0=process.env.NODE_ENV!=="production",Ko=typeof window>"u",GA=Ko||!!(typeof window<"u"&&window.next);class Go{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Ko||GA?(W0&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Ko&&W0)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...l)=>{var r,a;return(a=(r=this.options.current).onBeforeCreate)===null||a===void 0?void 0:a.call(r,...l)},onBlur:(...l)=>{var r,a;return(a=(r=this.options.current).onBlur)===null||a===void 0?void 0:a.call(r,...l)},onCreate:(...l)=>{var r,a;return(a=(r=this.options.current).onCreate)===null||a===void 0?void 0:a.call(r,...l)},onDestroy:(...l)=>{var r,a;return(a=(r=this.options.current).onDestroy)===null||a===void 0?void 0:a.call(r,...l)},onFocus:(...l)=>{var r,a;return(a=(r=this.options.current).onFocus)===null||a===void 0?void 0:a.call(r,...l)},onSelectionUpdate:(...l)=>{var r,a;return(a=(r=this.options.current).onSelectionUpdate)===null||a===void 0?void 0:a.call(r,...l)},onTransaction:(...l)=>{var r,a;return(a=(r=this.options.current).onTransaction)===null||a===void 0?void 0:a.call(r,...l)},onUpdate:(...l)=>{var r,a;return(a=(r=this.options.current).onUpdate)===null||a===void 0?void 0:a.call(r,...l)},onContentError:(...l)=>{var r,a;return(a=(r=this.options.current).onContentError)===null||a===void 0?void 0:a.call(r,...l)},onDrop:(...l)=>{var r,a;return(a=(r=this.options.current).onDrop)===null||a===void 0?void 0:a.call(r,...l)},onPaste:(...l)=>{var r,a;return(a=(r=this.options.current).onPaste)===null||a===void 0?void 0:a.call(r,...l)}};return new IA(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(l=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(l)?!0:l==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((r,a)=>{var i;return r===((i=n.extensions)===null||i===void 0?void 0:i[a])}):t[l]===n[l])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?Go.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((l,r)=>l===t[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}}function QA(e={},t=[]){const n=y.useRef(e);n.current=e;const[l]=y.useState(()=>new Go(n)),r=fi.useSyncExternalStore(l.subscribe,l.getEditor,l.getServerSnapshot);return y.useDebugValue(r),y.useEffect(l.onRender(t)),KA({editor:r,selector:({transactionNumber:a})=>e.shouldRerenderOnTransaction===!1?null:e.immediatelyRender&&a===0?0:a+1}),r}y.createContext({editor:null}).Consumer;const XA=y.createContext({onDragStart:void 0}),JA=()=>y.useContext(XA);y.forwardRef((e,t)=>{const{onDragStart:n}=JA(),l=e.as||"div";return y.createElement(l,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});const ZA=/^\s*>\s$/,e4=Et.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[jr({find:ZA,type:this.type})]}}),t4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,n4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,l4=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,r4=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,a4=On.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Wl({find:t4,type:this.type}),Wl({find:l4,type:this.type})]},addPasteRules(){return[Yl({find:n4,type:this.type}),Yl({find:r4,type:this.type})]}}),i4="listItem",Y0="textStyle",j0=/^\s*([-+*])\s$/,s4=Et.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:e}){return["ul",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(i4,this.editor.getAttributes(Y0)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=jr({find:j0,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=jr({find:j0,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Y0),editor:this.editor})),[e]}}),o4=/(^|[^`])`([^`]+)`(?!`)/,u4=/(^|[^`])`([^`]+)`(?!`)/g,c4=On.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Wl({find:o4,type:this.type})]},addPasteRules(){return[Yl({find:u4,type:this.type})]}}),d4=/^```([a-z]+)?[\s\n]$/,f4=/^~~~([a-z]+)?[\s\n]$/,h4=Et.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,a=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",bt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:l,empty:r}=n;if(!r||l.parent.type!==this.type)return!1;const a=l.parentOffset===l.parent.nodeSize-2,i=l.parent.textContent.endsWith(`
142
142
 
143
- `);return!a||!i?!1:e.chain().command(({tr:s})=>(s.delete(l.pos-2,l.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:l}=t,{$from:r,empty:a}=n;if(!a||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const s=r.after();return s===void 0?!1:l.nodeAt(s)?e.commands.command(({tr:u})=>(u.setSelection(Te.near(l.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[zo({find:d4,type:this.type,getAttributes:e=>({language:e[1]})}),zo({find:f4,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new ft({key:new Rt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),l=t.clipboardData.getData("vscode-editor-data"),r=l?JSON.parse(l):void 0,a=r?.mode;if(!n||!a)return!1;const{tr:i,schema:s}=e.state,o=s.text(n.replace(/\r\n?/g,`
144
- `));return i.replaceSelectionWith(this.type.create({language:a},o)),i.selection.$from.parent.type!==this.type&&i.setSelection(be.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),e.dispatch(i),!0}}})]}}),p4=Et.create({name:"doc",topNode:!0,content:"block+"});function b4(e={}){return new ft({view(t){return new m4(t,e)}})}class m4{constructor(t,n){var l;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(l=n.width)!==null&&l!==void 0?l:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let a=i=>{this[r](i)};return t.dom.addEventListener(r,a),{name:r,handler:a}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,l,r=this.editorView.dom,a=r.getBoundingClientRect(),i=a.width/r.offsetWidth,s=a.height/r.offsetHeight;if(n){let d=t.nodeBefore,f=t.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let m=h.getBoundingClientRect(),v=d?m.bottom:m.top;d&&f&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*s;l={left:m.left,right:m.right,top:v-g,bottom:v+g}}}}if(!l){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;l={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,c;if(!o||o==document.body&&getComputedStyle(o).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=o.getBoundingClientRect(),f=d.width/o.offsetWidth,h=d.height/o.offsetHeight;u=d.left-o.scrollLeft*f,c=d.top-o.scrollTop*h}this.element.style.left=(l.left-u)/i+"px",this.element.style.top=(l.top-c)/s+"px",this.element.style.width=(l.right-l.left)/i+"px",this.element.style.height=(l.bottom-l.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),l=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=l&&l.type.spec.disableDropCursor,a=typeof r=="function"?r(this.editorView,n,t):r;if(n&&!a){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=Ph(this.editorView.state.doc,i,this.editorView.dragging.slice);s!=null&&(i=s)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const g4=ut.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[b4(this.options)]}});class Re extends Te{constructor(t){super(t,t)}map(t,n){let l=t.resolve(n.map(this.head));return Re.valid(l)?new Re(l):Te.near(l)}content(){return ae.empty}eq(t){return t instanceof Re&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Re(t.resolve(n.pos))}getBookmark(){return new Qo(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!v4(t)||!y4(t))return!1;let l=n.type.spec.allowGapCursor;if(l!=null)return l;let r=n.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,l=!1){e:for(;;){if(!l&&Re.valid(t))return t;let r=t.pos,a=null;for(let i=t.depth;;i--){let s=t.node(i);if(n>0?t.indexAfter(i)<s.childCount:t.index(i)>0){a=s.child(n>0?t.indexAfter(i):t.index(i)-1);break}else if(i==0)return null;r+=n;let o=t.doc.resolve(r);if(Re.valid(o))return o}for(;;){let i=n>0?a.firstChild:a.lastChild;if(!i){if(a.isAtom&&!a.isText&&!he.isSelectable(a)){t=t.doc.resolve(r+a.nodeSize*n),l=!1;continue e}break}a=i,r+=n;let s=t.doc.resolve(r);if(Re.valid(s))return s}return null}}}Re.prototype.visible=!1,Re.findFrom=Re.findGapCursorFrom,Te.jsonID("gapcursor",Re);class Qo{constructor(t){this.pos=t}map(t){return new Qo(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Re.valid(n)?new Re(n):Te.near(n)}}function K0(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function v4(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),l=e.node(t);if(n==0){if(l.type.spec.isolating)return!0;continue}for(let r=l.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||K0(r.type))return!0;if(r.inlineContent)return!1}}return!0}function y4(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),l=e.node(t);if(n==l.childCount){if(l.type.spec.isolating)return!0;continue}for(let r=l.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||K0(r.type))return!0;if(r.inlineContent)return!1}}return!0}function E4(){return new ft({props:{decorations:x4,createSelectionBetween(e,t,n){return t.pos==n.pos&&Re.valid(n)?new Re(n):null},handleClick:C4,handleKeyDown:T4,handleDOMEvents:{beforeinput:S4}}})}const T4=o0({ArrowLeft:hi("horiz",-1),ArrowRight:hi("horiz",1),ArrowUp:hi("vert",-1),ArrowDown:hi("vert",1)});function hi(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(l,r,a){let i=l.selection,s=t>0?i.$to:i.$from,o=i.empty;if(i instanceof be){if(!a.endOfTextblock(n)||s.depth==0)return!1;o=!1,s=l.doc.resolve(t>0?s.after():s.before())}let u=Re.findGapCursorFrom(s,t,o);return u?(r&&r(l.tr.setSelection(new Re(u))),!0):!1}}function C4(e,t,n){if(!e||!e.editable)return!1;let l=e.state.doc.resolve(t);if(!Re.valid(l))return!1;let r=e.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&he.isSelectable(e.state.doc.nodeAt(r.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Re(l))),!0)}function S4(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Re))return!1;let{$from:n}=e.state.selection,l=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!l)return!1;let r=K.empty;for(let i=l.length-1;i>=0;i--)r=K.from(l[i].createAndFill(null,r));let a=e.state.tr.replace(n.pos,n.pos,new ae(r,0,0));return a.setSelection(be.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function x4(e){if(!(e.selection instanceof Re))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",We.create(e.doc,[Nt.widget(e.selection.head,t,{key:"gapcursor"})])}const k4=ut.create({name:"gapCursor",addProseMirrorPlugins(){return[E4()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Ce(se(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),A4=Et.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",bt(this.options.HTMLAttributes,e)]},renderText(){return`
143
+ `);return!a||!i?!1:e.chain().command(({tr:s})=>(s.delete(l.pos-2,l.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:l}=t,{$from:r,empty:a}=n;if(!a||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const s=r.after();return s===void 0?!1:l.nodeAt(s)?e.commands.command(({tr:u})=>(u.setSelection(Ce.near(l.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[zo({find:d4,type:this.type,getAttributes:e=>({language:e[1]})}),zo({find:f4,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new ft({key:new Rt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),l=t.clipboardData.getData("vscode-editor-data"),r=l?JSON.parse(l):void 0,a=r?.mode;if(!n||!a)return!1;const{tr:i,schema:s}=e.state,o=s.text(n.replace(/\r\n?/g,`
144
+ `));return i.replaceSelectionWith(this.type.create({language:a},o)),i.selection.$from.parent.type!==this.type&&i.setSelection(be.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),e.dispatch(i),!0}}})]}}),p4=Et.create({name:"doc",topNode:!0,content:"block+"});function b4(e={}){return new ft({view(t){return new m4(t,e)}})}class m4{constructor(t,n){var l;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(l=n.width)!==null&&l!==void 0?l:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let a=i=>{this[r](i)};return t.dom.addEventListener(r,a),{name:r,handler:a}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,l,r=this.editorView.dom,a=r.getBoundingClientRect(),i=a.width/r.offsetWidth,s=a.height/r.offsetHeight;if(n){let d=t.nodeBefore,f=t.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let m=h.getBoundingClientRect(),v=d?m.bottom:m.top;d&&f&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*s;l={left:m.left,right:m.right,top:v-g,bottom:v+g}}}}if(!l){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;l={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,c;if(!o||o==document.body&&getComputedStyle(o).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=o.getBoundingClientRect(),f=d.width/o.offsetWidth,h=d.height/o.offsetHeight;u=d.left-o.scrollLeft*f,c=d.top-o.scrollTop*h}this.element.style.left=(l.left-u)/i+"px",this.element.style.top=(l.top-c)/s+"px",this.element.style.width=(l.right-l.left)/i+"px",this.element.style.height=(l.bottom-l.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),l=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=l&&l.type.spec.disableDropCursor,a=typeof r=="function"?r(this.editorView,n,t):r;if(n&&!a){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=Ph(this.editorView.state.doc,i,this.editorView.dragging.slice);s!=null&&(i=s)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const g4=ut.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[b4(this.options)]}});class Re extends Ce{constructor(t){super(t,t)}map(t,n){let l=t.resolve(n.map(this.head));return Re.valid(l)?new Re(l):Ce.near(l)}content(){return ae.empty}eq(t){return t instanceof Re&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Re(t.resolve(n.pos))}getBookmark(){return new Qo(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!v4(t)||!y4(t))return!1;let l=n.type.spec.allowGapCursor;if(l!=null)return l;let r=n.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,l=!1){e:for(;;){if(!l&&Re.valid(t))return t;let r=t.pos,a=null;for(let i=t.depth;;i--){let s=t.node(i);if(n>0?t.indexAfter(i)<s.childCount:t.index(i)>0){a=s.child(n>0?t.indexAfter(i):t.index(i)-1);break}else if(i==0)return null;r+=n;let o=t.doc.resolve(r);if(Re.valid(o))return o}for(;;){let i=n>0?a.firstChild:a.lastChild;if(!i){if(a.isAtom&&!a.isText&&!he.isSelectable(a)){t=t.doc.resolve(r+a.nodeSize*n),l=!1;continue e}break}a=i,r+=n;let s=t.doc.resolve(r);if(Re.valid(s))return s}return null}}}Re.prototype.visible=!1,Re.findFrom=Re.findGapCursorFrom,Ce.jsonID("gapcursor",Re);class Qo{constructor(t){this.pos=t}map(t){return new Qo(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Re.valid(n)?new Re(n):Ce.near(n)}}function K0(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function v4(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),l=e.node(t);if(n==0){if(l.type.spec.isolating)return!0;continue}for(let r=l.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||K0(r.type))return!0;if(r.inlineContent)return!1}}return!0}function y4(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),l=e.node(t);if(n==l.childCount){if(l.type.spec.isolating)return!0;continue}for(let r=l.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||K0(r.type))return!0;if(r.inlineContent)return!1}}return!0}function E4(){return new ft({props:{decorations:x4,createSelectionBetween(e,t,n){return t.pos==n.pos&&Re.valid(n)?new Re(n):null},handleClick:C4,handleKeyDown:T4,handleDOMEvents:{beforeinput:S4}}})}const T4=o0({ArrowLeft:hi("horiz",-1),ArrowRight:hi("horiz",1),ArrowUp:hi("vert",-1),ArrowDown:hi("vert",1)});function hi(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(l,r,a){let i=l.selection,s=t>0?i.$to:i.$from,o=i.empty;if(i instanceof be){if(!a.endOfTextblock(n)||s.depth==0)return!1;o=!1,s=l.doc.resolve(t>0?s.after():s.before())}let u=Re.findGapCursorFrom(s,t,o);return u?(r&&r(l.tr.setSelection(new Re(u))),!0):!1}}function C4(e,t,n){if(!e||!e.editable)return!1;let l=e.state.doc.resolve(t);if(!Re.valid(l))return!1;let r=e.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&he.isSelectable(e.state.doc.nodeAt(r.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Re(l))),!0)}function S4(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Re))return!1;let{$from:n}=e.state.selection,l=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!l)return!1;let r=K.empty;for(let i=l.length-1;i>=0;i--)r=K.from(l[i].createAndFill(null,r));let a=e.state.tr.replace(n.pos,n.pos,new ae(r,0,0));return a.setSelection(be.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function x4(e){if(!(e.selection instanceof Re))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",We.create(e.doc,[Nt.widget(e.selection.head,t,{key:"gapcursor"})])}const k4=ut.create({name:"gapCursor",addProseMirrorPlugins(){return[E4()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Se(se(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),A4=Et.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",bt(this.options.HTMLAttributes,e)]},renderText(){return`
145
145
  `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:l})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:r,storedMarks:a}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=l.extensionManager,o=a||r.$to.parentOffset&&r.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&o&&i){const d=o.filter(f=>s.includes(f.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),N4=Et.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,bt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>zo({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var pi=200,Qe=function(){};Qe.prototype.append=function(t){return t.length?(t=Qe.from(t),!this.length&&t||t.length<pi&&this.leafAppend(t)||this.length<pi&&t.leafPrepend(this)||this.appendInner(t)):this},Qe.prototype.prepend=function(t){return t.length?Qe.from(t).append(this):this},Qe.prototype.appendInner=function(t){return new w4(this,t)},Qe.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Qe.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},Qe.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Qe.prototype.forEach=function(t,n,l){n===void 0&&(n=0),l===void 0&&(l=this.length),n<=l?this.forEachInner(t,n,l,0):this.forEachInvertedInner(t,n,l,0)},Qe.prototype.map=function(t,n,l){n===void 0&&(n=0),l===void 0&&(l=this.length);var r=[];return this.forEach(function(a,i){return r.push(t(a,i))},n,l),r},Qe.from=function(t){return t instanceof Qe?t:t&&t.length?new G0(t):Qe.empty};var G0=function(e){function t(l){e.call(this),this.values=l}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(r,a){return r==0&&a==this.length?this:new t(this.values.slice(r,a))},t.prototype.getInner=function(r){return this.values[r]},t.prototype.forEachInner=function(r,a,i,s){for(var o=a;o<i;o++)if(r(this.values[o],s+o)===!1)return!1},t.prototype.forEachInvertedInner=function(r,a,i,s){for(var o=a-1;o>=i;o--)if(r(this.values[o],s+o)===!1)return!1},t.prototype.leafAppend=function(r){if(this.length+r.length<=pi)return new t(this.values.concat(r.flatten()))},t.prototype.leafPrepend=function(r){if(this.length+r.length<=pi)return new t(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Qe);Qe.empty=new G0([]);var w4=function(e){function t(n,l){e.call(this),this.left=n,this.right=l,this.length=n.length+l.length,this.depth=Math.max(n.depth,l.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(l){return l<this.left.length?this.left.get(l):this.right.get(l-this.left.length)},t.prototype.forEachInner=function(l,r,a,i){var s=this.left.length;if(r<s&&this.left.forEachInner(l,r,Math.min(a,s),i)===!1||a>s&&this.right.forEachInner(l,Math.max(r-s,0),Math.min(this.length,a)-s,i+s)===!1)return!1},t.prototype.forEachInvertedInner=function(l,r,a,i){var s=this.left.length;if(r>s&&this.right.forEachInvertedInner(l,r-s,Math.max(a,s)-s,i+s)===!1||a<s&&this.left.forEachInvertedInner(l,Math.min(r,s),a,i)===!1)return!1},t.prototype.sliceInner=function(l,r){if(l==0&&r==this.length)return this;var a=this.left.length;return r<=a?this.left.slice(l,r):l>=a?this.right.slice(l-a,r-a):this.left.slice(l,a).append(this.right.slice(0,r-a))},t.prototype.leafAppend=function(l){var r=this.right.leafAppend(l);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(l){var r=this.left.leafPrepend(l);if(r)return new t(r,this.right)},t.prototype.appendInner=function(l){return this.left.depth>=Math.max(this.right.depth,l.depth)+1?new t(this.left,new t(this.right,l)):new t(this,l)},t}(Qe);const I4=500;class Ft{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let l=this.items.length;for(;;l--)if(this.items.get(l-1).selection){--l;break}let r,a;n&&(r=this.remapping(l,this.items.length),a=r.maps.length);let i=t.tr,s,o,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(l,f+1),a=r.maps.length),a--,c.push(d);return}if(r){c.push(new Gt(d.map));let h=d.step.map(r.slice(a)),m;h&&i.maybeStep(h).doc&&(m=i.mapping.maps[i.mapping.maps.length-1],u.push(new Gt(m,void 0,void 0,u.length+c.length))),a--,m&&r.appendMap(m,a)}else i.maybeStep(d.step);if(d.selection)return s=r?d.selection.map(r.slice(a)):d.selection,o=new Ft(this.items.slice(0,l).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:i,selection:s}}addTransform(t,n,l,r){let a=[],i=this.eventCount,s=this.items,o=!r&&s.length?s.get(s.length-1):null;for(let c=0;c<t.steps.length;c++){let d=t.steps[c].invert(t.docs[c]),f=new Gt(t.mapping.maps[c],d,n),h;(h=o&&o.merge(f))&&(f=h,c?a.pop():s=s.slice(0,s.length-1)),a.push(f),n&&(i++,n=void 0),r||(o=f)}let u=i-l.depth;return u>O4&&(s=_4(s,u),i-=u),new Ft(s.append(a),i)}remapping(t,n){let l=new Or;return this.items.forEach((r,a)=>{let i=r.mirrorOffset!=null&&a-r.mirrorOffset>=t?l.maps.length-r.mirrorOffset:void 0;l.appendMap(r.map,i)},t,n),l}addMaps(t){return this.eventCount==0?this:new Ft(this.items.append(t.map(n=>new Gt(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let l=[],r=Math.max(0,this.items.length-n),a=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach(f=>{f.selection&&s--},r);let o=n;this.items.forEach(f=>{let h=a.getMirror(--o);if(h==null)return;i=Math.min(i,h);let m=a.maps[h];if(f.step){let v=t.steps[h].invert(t.docs[h]),g=f.selection&&f.selection.map(a.slice(o+1,h));g&&s++,l.push(new Gt(m,v,g))}else l.push(new Gt(m))},r);let u=[];for(let f=n;f<i;f++)u.push(new Gt(a.maps[f]));let c=this.items.slice(0,r).append(u).append(l),d=new Ft(c,s);return d.emptyItemCount()>I4&&(d=d.compress(this.items.length-l.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),l=n.maps.length,r=[],a=0;return this.items.forEach((i,s)=>{if(s>=t)r.push(i),i.selection&&a++;else if(i.step){let o=i.step.map(n.slice(l)),u=o&&o.getMap();if(l--,u&&n.appendMap(u,l),o){let c=i.selection&&i.selection.map(n.slice(l));c&&a++;let d=new Gt(u.invert(),o,c),f,h=r.length-1;(f=r.length&&r[h].merge(d))?r[h]=f:r.push(d)}}else i.map&&l--},this.items.length,0),new Ft(Qe.from(r.reverse()),a)}}Ft.empty=new Ft(Qe.empty,0);function _4(e,t){let n;return e.forEach((l,r)=>{if(l.selection&&t--==0)return n=r,!1}),e.slice(n)}class Gt{constructor(t,n,l,r){this.map=t,this.step=n,this.selection=l,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Gt(n.getMap().invert(),n,this.selection)}}}class Dn{constructor(t,n,l,r,a){this.done=t,this.undone=n,this.prevRanges=l,this.prevTime=r,this.prevComposition=a}}const O4=20;function M4(e,t,n,l){let r=n.getMeta(dl),a;if(r)return r.historyState;n.getMeta(P4)&&(e=new Dn(e.done,e.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(i&&i.getMeta(dl))return i.getMeta(dl).redo?new Dn(e.done.addTransform(n,void 0,l,bi(t)),e.undone,Q0(n.mapping.maps),e.prevTime,e.prevComposition):new Dn(e.done,e.undone.addTransform(n,void 0,l,bi(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),o=e.prevTime==0||!i&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-l.newGroupDelay||!D4(n,e.prevRanges)),u=i?Xo(e.prevRanges,n.mapping):Q0(n.mapping.maps);return new Dn(e.done.addTransform(n,o?t.selection.getBookmark():void 0,l,bi(t)),Ft.empty,u,n.time,s??e.prevComposition)}else return(a=n.getMeta("rebased"))?new Dn(e.done.rebased(n,a),e.undone.rebased(n,a),Xo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Dn(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Xo(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function D4(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((l,r)=>{for(let a=0;a<t.length;a+=2)l<=t[a+1]&&r>=t[a]&&(n=!0)}),n}function Q0(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((l,r,a,i)=>t.push(a,i));return t}function Xo(e,t){if(!e)return null;let n=[];for(let l=0;l<e.length;l+=2){let r=t.map(e[l],1),a=t.map(e[l+1],-1);r<=a&&n.push(r,a)}return n}function L4(e,t,n){let l=bi(t),r=dl.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,l);if(!a)return null;let i=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),r,l),o=new Dn(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(i).setMeta(dl,{redo:n,historyState:o})}let Jo=!1,X0=null;function bi(e){let t=e.plugins;if(X0!=t){Jo=!1,X0=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Jo=!0;break}}return Jo}const dl=new Rt("history"),P4=new Rt("closeHistory");function B4(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new ft({key:dl,state:{init(){return new Dn(Ft.empty,Ft.empty,null,0,-1)},apply(t,n,l){return M4(n,l,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let l=n.inputType,r=l=="historyUndo"?Z0:l=="historyRedo"?eb:null;return!r||!t.editable?!1:(n.preventDefault(),r(t.state,t.dispatch))}}}})}function J0(e,t){return(n,l)=>{let r=dl.getState(n);if(!r||(e?r.undone:r.done).eventCount==0)return!1;if(l){let a=L4(r,n,e);a&&l(t?a.scrollIntoView():a)}return!0}}const Z0=J0(!1,!0),eb=J0(!0,!0),R4=ut.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Z0(e,t),redo:()=>({state:e,dispatch:t})=>eb(e,t)}},addProseMirrorPlugins(){return[B4(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()}}}),F4=Et.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",bt(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!OA(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$from:l,$to:r}=n,a=e();return l.parentOffset===0?a.insertContentAt({from:Math.max(l.pos-1,0),to:r.pos},{type:this.name}):oA(n)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:i,dispatch:s})=>{var o;if(s){const{$to:u}=i.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?i.setSelection(be.create(i.doc,u.pos+1)):u.nodeAfter.isBlock?i.setSelection(he.create(i.doc,u.pos)):i.setSelection(be.create(i.doc,u.pos));else{const d=(o=u.parent.type.contentMatch.defaultType)===null||o===void 0?void 0:o.create();d&&(i.insert(c,d),i.setSelection(be.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[_A({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),H4=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,U4=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,z4=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,V4=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,$4=On.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wl({find:H4,type:this.type}),Wl({find:z4,type:this.type})]},addPasteRules(){return[Yl({find:U4,type:this.type}),Yl({find:V4,type:this.type})]}}),q4=Et.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",bt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),W4="listItem",tb="textStyle",nb=/^(\d+)\.\s$/,Y4=Et.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:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bt(this.options.HTMLAttributes,n),0]:["ol",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(W4,this.editor.getAttributes(tb)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=jr({find:nb,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=jr({find:nb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(tb)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),j4=Et.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),K4=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,G4=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Q4=On.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",bt(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wl({find:K4,type:this.type})]},addPasteRules(){return[Yl({find:G4,type:this.type})]}}),X4=Et.create({name:"text",group:"inline"}),J4=ut.create({name:"starterKit",addExtensions(){const e=[];return this.options.bold!==!1&&e.push(a4.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(e4.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(s4.configure(this.options.bulletList)),this.options.code!==!1&&e.push(c4.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(h4.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(p4.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(g4.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(k4.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(A4.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(N4.configure(this.options.heading)),this.options.history!==!1&&e.push(R4.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(F4.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push($4.configure(this.options.italic)),this.options.listItem!==!1&&e.push(q4.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(Y4.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(j4.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Q4.configure(this.options.strike)),this.options.text!==!1&&e.push(X4.configure(this.options.text)),e}}),Z4=ut.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ft({key:new Rt("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:l}=t,r=[];if(!n)return null;const a=this.editor.isEmpty;return e.descendants((i,s)=>{const o=l>=s&&l<=s+i.nodeSize,u=!i.isLeaf&&di(i);if((o||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];a&&c.push(this.options.emptyEditorClass);const d=Nt.node(s,s+i.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:s,hasAnchor:o}):this.options.placeholder});r.push(d)}return this.options.includeChildren}),We.create(e,r)}}})]}});function eN(e){return[J4.configure({heading:{levels:[1,2,3]},history:{depth:50}}),Z4.configure({placeholder:e.placeholder??"",showOnlyWhenEditable:!0,emptyEditorClass:"rte-richtext-empty"})]}const tN=({expanded:e,onToggle:t})=>b.jsxs("button",{type:"button",className:"rte-richtext-toggle","data-expanded":e?"true":"false",onClick:t,children:[b.jsx("i",{className:`iconfont ${e?"icon-shouqi1":"icon-zhankai2"}`}),b.jsx("span",{className:"rte-richtext-toggle-label",children:e?"收起":"展开"})]}),lb=y.memo(({node:e,value:t,onChange:n,disabled:l,error:r,nodeDefaults:a,onExpandChange:i})=>{const s=typeof e.minHeight=="number"?e.minHeight:a?.richtext?.minHeight??40,o=typeof e.maxHeight=="number"?e.maxHeight:a?.richtext?.maxHeight??160,u=Math.max(o,s),c=e.expandable!==!1,[d,f]=y.useState(!1),h=y.useRef(n),m=y.useRef(e.key);y.useEffect(()=>{h.current=n},[n]),y.useEffect(()=>{m.current=e.key},[e.key]);const v=QA({extensions:eN({placeholder:e.placeholder}),content:t||"",editable:!l,onUpdate:({editor:A})=>{const L=m.current;L&&h.current(L,A.getHTML())},editorProps:{attributes:{class:"rte-richtext","data-type":"richtext","data-key":e.key??""}}});y.useEffect(()=>{if(!v)return;const A=v.getHTML(),L=t??"";A!==L&&(v.isFocused||v.commands.setContent(L,!1))},[t,v]),y.useEffect(()=>{v&&v.setEditable(!l)},[l,v]);const g=y.useCallback(()=>{f(A=>{const L=!A;return e.key&&i?.(e.key,L),L})},[e.key,i]);if(!v)return null;const E={"--rte-richtext-min-height":`${s}px`,"--rte-richtext-max-height":`${u}px`},N=["rte-richtext-wrapper",c?"rte-richtext-toggleable":"",d?"rte-richtext-expanded":""].filter(Boolean).join(" ");return b.jsx("div",{className:`rte-richtext-container ${d?"rte-richtext-host-expanded":""} ${r?"rte-richtext-error":""}`,"data-key":e.key,children:b.jsxs("div",{className:N,style:E,children:[b.jsx(UA,{editor:v}),c&&b.jsx(tN,{expanded:d,onToggle:g})]})})});lb.displayName="RichtextNode";const nN=e=>{const{node:t}=e;switch(t.type){case"text":return b.jsx(Ou,{node:t});case"tag":{const l=!e.hideAgentClose&&!!e.onAgentExit&&!t.tooltip?{...t,tooltip:"点击退出智能体"}:t;return b.jsx(Mu,{node:l,hideClose:e.hideAgentClose,onClose:()=>e.onAgentExit?.("tag-close"),tooltipZIndex:1e4})}case"variable":return b.jsx(yf,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"number-input":return b.jsx(Ef,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"select":return b.jsx(Tf,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"searchable-select":return b.jsx(Cf,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"datepicker":return b.jsx(If,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"cascader":return b.jsx(_f,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"textarea":return b.jsx(Of,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error,nodeDefaults:e.nodeDefaults});case"multi-variable":return b.jsx(Df,{node:t,value:Array.isArray(e.value)?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error,reportListFetch:e.reportListFetch,onReportGoGenerate:e.onReportGoGenerate,onViewReport:e.onViewReport,hideCurrentSessionReport:e.hideCurrentSessionReport,reportNames:e.reportNames,onResolveName:e.onResolveMultiName,onClearReport:e.onClearReport,onShiftReportNames:e.onShiftReportNames});case"multi-variable-select":return b.jsx(Pf,{node:t,value:Array.isArray(e.value)?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error,reportListFetch:e.reportListFetch,onReportGoGenerate:e.onReportGoGenerate,onViewReport:e.onViewReport,hideCurrentSessionReport:e.hideCurrentSessionReport,reportNames:e.reportNames,onResolveName:e.onResolveMultiName,onClearReport:e.onClearReport,onAnalyzeReport:e.onAnalyzeMultiReport,onShiftReportNames:e.onShiftReportNames});case"upload":return b.jsx(Ff,{node:t,files:e.files??{},onFileChange:e.onFileChange??(()=>{}),disabled:e.disabled,error:e.error});case"video-url":return b.jsx(Wf,{node:t,value:typeof e.value=="string"?e.value:void 0,thumbnail:t.key?e.thumbnails?.[t.key]:void 0,onChange:(n,l)=>e.onChange(n,l),onThumbnailChange:e.onThumbnailChange,videoUrlParse:e.videoUrlParse,onParsingChange:e.onVideoParsingChange,disabled:e.disabled,error:e.error});case"video-upload":return b.jsx(Yf,{node:t,value:typeof e.value=="string"?e.value:void 0,thumbnail:t.key?e.thumbnails?.[t.key]:void 0,onChange:(n,l)=>e.onChange(n,l),onThumbnailChange:e.onThumbnailChange,onFileChange:e.onFileChange,videoUpload:e.videoUpload,onParsingChange:e.onVideoParsingChange,disabled:e.disabled,error:e.error});case"report-url":return b.jsx(Kf,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),onParse:t.key&&e.onReportUrlParse?n=>e.onReportUrlParse(t.key,n):void 0,reportListFetch:e.reportListFetch,onReportGoGenerate:e.onReportGoGenerate,reportName:t.key&&e.reportNames?e.reportNames[t.key]:void 0,onClearReport:e.onClearReport&&t.key?()=>e.onClearReport(t.key):void 0,onViewReport:e.onViewReport,hideCurrentSessionReport:e.hideCurrentSessionReport,disabled:e.disabled,error:e.error});case"markdown":return b.jsx(zC,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),onParse:t.key&&e.onMarkdownParse?n=>e.onMarkdownParse(t.key,n):void 0,disabled:e.disabled,error:e.error});case"markdown-name":return b.jsx(VC,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),onParse:t.key&&e.onMarkdownNameParse?n=>e.onMarkdownNameParse(t.key,n):void 0,disabled:e.disabled,error:e.error});case"report-module":return b.jsx(UC,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"markdown-module":return b.jsx($C,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error});case"richtext":return b.jsx(lb,{node:t,value:typeof e.value=="string"?e.value:void 0,onChange:(n,l)=>e.onChange(n,l),disabled:e.disabled,error:e.error,nodeDefaults:e.nodeDefaults,onExpandChange:e.onRichtextExpandChange});default:return b.jsx(hm,{node:e.node,value:e.value,onChange:e.onChange,index:e.index})}},rb=y.memo(nN);rb.displayName="NodeRenderer";const ab=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string"),ib=(e,t)=>e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,l)=>n===t[l]):!1,lN=e=>{const t=new Map;for(const n of e)if(n.type==="upload"&&n.key){const l=typeof n.maxCount=="number"&&typeof n.minCount=="number"&&n.maxCount>1;t.set(n.key,{batch:l,maxCount:l?n.maxCount:1})}return t};function rN(e,t,n,l,r,a){const i=y.useRef({});y.useEffect(()=>{if(!e)return;const s=lN(l);n(u=>{const c={...u};let d=!1;for(const[f,h]of Object.entries(e)){if(s.has(f)||!ab(h))continue;const m=c[f],v=m===void 0||m===""||Array.isArray(m)&&m.length===0,g=!ib(i.current[f],h);(v||g)&&(ib(m,h)||(c[f]=h,d=!0))}return d?c:u}),a(u=>{const c={...u};let d=!1;for(const[f,h]of s){const m=e[f];if(m==null)continue;const v=(Array.isArray(m)?m:[m]).filter(g=>g!=null&&g!=="");if(v.length!==0)if(h.batch)for(let g=0;g<v.length&&g<h.maxCount;g+=1){const E=`${f}-${g}`;c[E]==null&&(c[E]=v[g],d=!0)}else c[f]==null&&(c[f]=v[0],d=!0)}return d?c:u});const o={};for(const[u,c]of Object.entries(e))ab(c)&&(o[u]=c);i.current=o},[e,l,n,a])}const sb=new Set(["upload"]);function ob(e){return sb.has(e.type)?typeof e.maxCount=="number"&&typeof e.minCount=="number"&&e.maxCount>1?`至少上传 ${e.minCount} 个文件`:"请上传":"请填写"}function ub(e){return e.type==="report-module"||e.type==="markdown-module"?`${e.key}__module_${e.moduleIndex??0}`:e.key}function aN(e,t,n,l=new Set){const r={},a=new Map;for(const i of e){if(!i.required||!i.key||l.has(i.key))continue;const s=i.exclusionGroup;if(s&&s!=="separator"){const o=a.get(s)??[];o.push(i),a.set(s,o);continue}mi(i,t,n)||(r[ub(i)]=ob(i))}for(const[,i]of a)if(!i.some(s=>mi(s,t,n)))for(const s of i)r[ub(s)]=ob(s);return r}function mi(e,t,n){if(!e.key)return!0;if(sb.has(e.type)){if(typeof e.maxCount=="number"&&typeof e.minCount=="number"&&e.maxCount>1){let s=0;for(let o=0;o<(e.maxCount??0);o+=1)n[`${e.key}-${o}`]&&(s+=1);return s>=(e.minCount??1)}return!!n[e.key]}const l=e.type==="report-module"||e.type==="markdown-module"?`${e.key}__module_${e.moduleIndex??0}`:e.key,r=t[l];return r!==void 0&&r!==""&&!(Array.isArray(r)&&(r.length===0||r.every(i=>!i||!i.trim())))?!0:e.defaultValue!==void 0&&e.defaultValue!==null&&String(e.defaultValue)!==""}function iN(e,t,n,l=new Set){const r=e.filter(s=>s.required&&s.key&&!l.has(s.key));if(r.length===0)return!0;const a=new Map,i=[];for(const s of r){const o=s.exclusionGroup;if(o&&o!=="separator"){const u=a.get(o)??[];u.push(s),a.set(o,u)}else i.push(s)}for(const s of i)if(!mi(s,t,n))return!1;for(const[,s]of a)if(!s.some(o=>mi(o,t,n)))return!1;return!0}function sN(e){const[t,n]=y.useState({}),l=y.useCallback((a,i,s=new Set)=>{const o=aN(e,a,i,s);return n(o),Object.keys(o).length===0},[e]),r=y.useCallback(a=>{n(i=>{if(!(a in i))return i;const s={...i};return delete s[a],s})},[]);return{errors:t,validate:l,clearError:r}}function oN(e,t){if(!e.conditional)return!0;const{dependsOn:n,condition:l,values:r}=e.conditional,a=t[n],i=Array.isArray(a)?a[0]:a;if(i==null||i==="")return!1;switch(l){case"in":return r.includes(i);case"notIn":return!r.includes(i);case"equals":return r.length>0&&i===r[0];case"notEquals":return r.length>0&&i!==r[0];default:return!0}}function uN(e,t){const n=new Set;return e.forEach((l,r)=>{oN(l,t)||n.add(r)}),n}const cN=new Set(["upload"]);function cb(e,t,n){if(!e.key)return!1;if(cN.has(e.type)){if(n[e.key]!=null)return!0;if(typeof e.maxCount=="number"&&e.maxCount>1){for(let r=0;r<e.maxCount;r+=1)if(n[`${e.key}-${r}`]!=null)return!0}return!1}const l=t[e.key];return Array.isArray(l)?l.some(r=>r&&r.trim().length>0):l!=null&&String(l).trim()!==""}function dN(e,t){const n=[];let l=[];return e.forEach((r,a)=>{t.has(a)||(r.exclusionGroup?l.push({node:r,originalIndex:a}):(l.length&&n.push(l),l=[]))}),l.length&&n.push(l),n}function fN(e,t,n,l,r){const a=[];let i=[];const s=[];for(const d of e){if(d.node.exclusionGroup==="separator"){i.length&&a.push(i),i=[],s.push(d);continue}d.node.key&&i.push(d)}i.length&&a.push(i);const o=a.map(d=>d.some(({node:f})=>cb(f,t,n)));if(!o.some(Boolean))return;const c=o.findIndex(Boolean);a.forEach((d,f)=>{if(f!==c)for(const{node:h}of d)h.key&&l.add(h.key)});for(const d of s)r.add(d.originalIndex)}function hN(e,t,n,l){const r=new Map;for(const{node:i}of e)!i.exclusionGroup||!i.key||(cb(i,t,n)?r.set(i.exclusionGroup,!0):r.has(i.exclusionGroup)||r.set(i.exclusionGroup,!1));let a=null;for(const{node:i}of e)if(i.exclusionGroup&&i.exclusionGroup!=="separator"&&r.get(i.exclusionGroup)){a=i.exclusionGroup;break}if(a)for(const{node:i}of e)!i.key||!i.exclusionGroup||i.exclusionGroup!==a&&l.add(i.key)}function pN(e,t,n){const l=uN(e,t),r=new Set;l.forEach(o=>{const u=e[o]?.key;u&&r.add(u)});const a=dN(e,l),i=new Set(r),s=new Set;for(const o of a)o.some(({node:c})=>c.exclusionGroup==="separator")?fN(o,t,n,i,s):hN(o,t,n,i);return{excludedKeys:i,hiddenSeparatorIndexes:s,conditionalHiddenIndexes:l}}function bN(e,t,n){return y.useMemo(()=>pN(e,t,n),[e,t,n])}function mN(e){const t=y.useRef({}),n=y.useRef({}),l=y.useCallback(async(s,o)=>{if(!e.reportAnalyze)return{status:"unconfigured"};const u=(t.current[s]??0)+1;t.current[s]=u;try{const c=await e.reportAnalyze(Rs(o));return t.current[s]!==u?{status:"stale"}:{status:"success",modules:c.modules}}catch{return t.current[s]!==u?{status:"stale"}:{status:"failed"}}},[e.reportAnalyze]),r=y.useCallback(async(s,o)=>{if(!e.markdownAnalyze)return null;const u=(t.current[s]??0)+1;t.current[s]=u;try{const c=await e.markdownAnalyze({text:o});return t.current[s]!==u?null:c}catch{return null}},[e.markdownAnalyze]),a=y.useCallback(async(s,o)=>{if(!e.markdownNameAnalyze)return null;const u=(t.current[s]??0)+1;t.current[s]=u;try{const c=await e.markdownNameAnalyze({text:o});return t.current[s]!==u?null:c}catch{return null}},[e.markdownNameAnalyze]),i=y.useCallback(async(s,o,u)=>{if(!e.reportNameResolve)return{status:"skip"};const c=(o||"").trim();if(!/^https?:\/\//i.test(c))return{status:"skip"};const d=(n.current[s]??0)+1;n.current[s]=d;try{const f=await e.reportNameResolve({url:c,nodeKey:s,nodeType:u});return n.current[s]!==d?{status:"stale"}:{status:"success",name:f.name,url:f.url||c}}catch{return n.current[s]!==d?{status:"stale"}:{status:"failed"}}},[e.reportNameResolve]);return{analyzeReport:l,analyzeMarkdown:r,analyzeMarkdownName:a,resolveReportName:i}}const db=/​/g,gi=e=>String(e??"").replace(db,"").trim(),gN=e=>!e||!/<[a-z][\s\S]*>/i.test(e)?e:(new DOMParser().parseFromString(e,"text/html").body.textContent||"").replace(db,"").trim(),vN=e=>e==="multi-variable"||e==="multi-variable-select",vi=(e,t)=>{if(!t)return"";const n=e[t];return Array.isArray(n)?gi(n[0]):gi(n)},yN=(e,t)=>{if(!t)return[];const n=e[t];if(Array.isArray(n))return n.map(gi).filter(Boolean);const l=gi(n);return l?[l]:[]},Zo=e=>typeof e=="string"?decodeURIComponent(e.split("/").pop()?.split("?")[0]||"file"):e.name;async function EN(e){const t=e.split("/").pop()?.split("?")[0]||"file",n=decodeURIComponent(t);try{const l=await fetch(`/api/image-proxy?url=${encodeURIComponent(e)}`);if(!l.ok)return e;const r=await l.blob();return new File([r],n,{type:r.type||"application/octet-stream"})}catch{return e}}const eu=async(e,t,n,l,r)=>{if(!(n==null||n==="")){if(n instanceof File){e.append(t,n);return}if(r&&typeof n=="string"&&/^https?:\/\//i.test(n)){const a=await EN(n);e.append(t,a);return}if(Array.isArray(n)){if(l.has(t)){for(const a of n)await eu(e,t,a,l,r);return}for(let a=0;a<n.length;a+=1)await eu(e,`${t}[${a}]`,n[a],l,r);return}e.append(t,String(n))}},TN=["variable","report-url","markdown","markdown-name","select","searchable-select","cascader","textarea","richtext","datepicker","number-input","video-url"];async function CN(e){const{config:t,values:n,files:l,footerFiles:r,markdownModules:a,excludedKeys:i,hiddenSeparatorIndexes:s}=e,o={},u=[],c=new Set(["url"]);for(let m=0;m<t.length;m+=1){const v=t[m],g=v.key;if(!(g&&i?.has(g))){if(v.type==="text"||v.type==="tag"){if(v.exclusionGroup==="separator"&&s?.has(m))continue;v.text&&u.push(v.text);continue}if(g&&vN(v.type)){const E=yN(n,g);E.length>0&&(o[g]=E,c.add(g),u.push(E.join(" ")));continue}if(g&&TN.includes(v.type)){let E=vi(n,g);if(!E&&v.type==="number-input"&&typeof v.defaultNumber=="number"&&(E=String(v.defaultNumber)),!E&&typeof v.defaultValue=="string"&&v.defaultValue!==""&&(E=v.defaultValue),!E)continue;if(o[g]=E,u.push(E),v.type==="report-url"){const N=o.url;o.url=N===void 0?E:Array.isArray(N)?[...N,E]:[String(N),E]}if(v.type==="markdown"||v.type==="markdown-name"){const N=v.sourceTextKey||`${g}__sourceText`;o[N]=E}continue}if(g&&(v.type==="report-module"||v.type==="markdown-module")){const E=`${g}__module_${v.moduleIndex??0}`,N=vi(n,E)||vi(n,g),A=gN(N);A&&(Array.isArray(o[g])||(o[g]=[]),o[g].push(A),c.add(g),u.push(A));continue}if(g&&v.type==="upload"){if(typeof v.maxCount=="number"&&typeof v.minCount=="number"&&v.maxCount>1){const N=[];for(let A=0;A<(v.maxCount??0);A+=1){const L=l[`${g}-${A}`];L&&N.push(L)}N.length>0&&(o[g]=N,u.push(` [附带${N.length}个文件: ${N.map(Zo).join(", ")}] `))}else{const N=l[g];N&&(o[g]=N,u.push(` [附带文件: ${Zo(N)}] `))}continue}if(g&&v.type==="video-upload"){const E=l[g];if(E)o[g]=E,u.push(` [附带视频: ${Zo(E)}] `);else{const N=vi(n,g);N&&(o[g]=N,u.push(N))}continue}}}const d=u.join("").trim(),f=new FormData;f.append("fullPrompt",d);const h=new Set;for(const m of t)m.type==="upload"&&m.key&&h.add(m.key);if(a)for(const m of t){if(!m.key||m.type!=="markdown"&&m.type!=="markdown-name")continue;const v=a[m.key];if(!v||v.length===0)continue;const g=v.map(N=>(N?.markdown||"").trim()).filter(N=>N.length>0);if(g.length===0)continue;const E=`${m.key}__markdown`;o[E]=g,c.add(E)}for(const[m,v]of Object.entries(o))await eu(f,m,v,c,h.has(m));return r.forEach(m=>{f.append("fileUrls",m)}),{formData:f,fullPrompt:d,hasContent:d.length>0||r.length>0}}function SN(e,t,n=new Set){const l=[];let r=!1;for(const a of e){if((a.type==="markdown"||a.type==="markdown-name")&&a.key){const s=t.markdownModules[a.key],o=n.has(a.key),u=!!s&&s.length>0;if(a.type==="markdown-name"){l.push(a),o&&!u&&l.push({type:"text",className:"rte-markdown-parsing",text:"解析中...",exclusionGroup:a.exclusionGroup}),u&&(s.forEach((c,d)=>{l.push({type:"markdown-module",key:a.key,moduleIndex:d,text:c.title,placeholder:"可编辑,内容不能为空",exclusionGroup:a.exclusionGroup,required:a.required})}),r=!0);continue}if(o&&!u){l.push({type:"text",key:a.key,className:"rte-markdown-parsing",text:"解析中...",exclusionGroup:a.exclusionGroup});continue}if(u){s.forEach((c,d)=>{l.push({type:"markdown-module",key:a.key,moduleIndex:d,text:c.title,placeholder:"可编辑,内容不能为空",exclusionGroup:a.exclusionGroup,required:a.required})}),r=!0;continue}l.push(a);continue}if(r){if(a.type==="text"&&a.text?.startsWith(`
146
- `)){l.push({...a,text:a.text.slice(1)}),r=!1;continue}if(a.exclusionGroup==="separator"){l.push(a);continue}}l.push(a),a.type==="report-url"&&a.key&&t.reportModules[a.key]&&t.reportModules[a.key].forEach((s,o)=>{l.push({type:"report-module",key:a.key,moduleIndex:o,text:s.title,exclusionGroup:a.exclusionGroup,required:a.required})})}return l}const xN={reportModules:{},markdownModules:{}},kN={adjustX:1,adjustY:1,shiftX:!1,shiftY:!1},fb=y.memo(({options:e,onSelect:t,disabled:n,currentAgent:l,onOpenChange:r})=>{const[a,i]=y.useState(!1),s=d=>{i(d),r?.(d)},o=e.filter(d=>d.isShowNew!==1).map(d=>({key:d.key,label:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d.icon&&b.jsx("i",{className:d.icon}),b.jsx("span",{children:d.label})]}),onClick:()=>t?.(d)})),c=`rte-agent-badge${!!l?" rte-agent-badge-selected":a?" rte-agent-badge-active":""}`;return b.jsx(ue.Dropdown,{menu:{items:o,selectedKeys:l?[String(l.key)]:[]},disabled:n,placement:"bottomLeft",autoAdjustOverflow:kN,getPopupContainer:xr,trigger:["click"],overlayClassName:"rte-agent-dropdown",onOpenChange:s,children:b.jsxs("div",{className:c,style:{cursor:e.length>0?"pointer":"default"},children:[b.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),b.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})});fb.displayName="AgentDropdown";function hb(e="width"){const t=y.useRef(null),[n,l]=y.useState(!1),r=y.useCallback(()=>{const a=t.current;a&&l(e==="height"?a.scrollHeight>a.clientHeight:a.scrollWidth>a.clientWidth)},[e]);return[t,n,r]}const AN=["全部技能","我的技能","订阅技能","系统技能"],NN=["all","mine","subscribe","system"],wN=20,IN={system:"系统技能",mine:"我的技能",subscribe:"订阅技能"},Ln="基于用户上传的抖音推广数据,智能分析高潜力商品与爆品抖音推广数据,智能分析高潜力商品与爆品商品机会",Pn=["淘宝天猫","抖音电商","市场选品","京东商城","拼多多","小红书","快手电商","视频号"],Bn="当用户需要尖锐吐槽、阴阳怪气评论、犀利差评、回怼话术或讽刺性改写时使用本技能;用户只需提供对象、场景、原话或想表达的不满,即可触发生成。",_N=[{id:"c1",title:"抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让",desc:Ln,tags:Pn,badge:"system",heat:"3.5",usageInstruction:Bn},{id:"c2",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"system",heat:"6.6",usageInstruction:Bn},{id:"c3",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"subscribe",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"subscribe",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",heat:"6.6",usageInstruction:Bn}],ON=e=>({id:e.id,title:e.title,desc:e.desc??"",usageInstruction:e.usageInstruction,tags:e.tags??[],badge:e.badge??"system",heat:e.heat}),MN=()=>b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:b.jsx("path",{d:"M6.2 1a5.2 5.2 0 0 1 4.06 8.45l2.6 2.6a.6.6 0 0 1-.85.85l-2.6-2.6A5.2 5.2 0 1 1 6.2 1Zm0 1.2a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z",fill:"#4E5969"})}),DN=[()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M5.99358 8.85714C6.27231 8.85714 6.53962 8.97003 6.73671 9.17096C6.9338 9.37189 7.04453 9.64441 7.04453 9.92857V12.9286C7.04453 13.2127 6.9338 13.4853 6.73671 13.6862C6.53962 13.8871 6.27231 14 5.99358 14H3.05094L2.94375 13.9946C2.6849 13.9676 2.4451 13.8436 2.27076 13.6467C2.09642 13.4497 1.99994 13.1939 2 12.9286V9.92857C1.99994 9.66329 2.09642 9.40742 2.27076 9.21049C2.4451 9.01355 2.6849 8.88956 2.94375 8.8625L3.05094 8.85714H5.99358ZM11.0087 8.74571C11.0323 8.68643 11.0727 8.63567 11.1247 8.59993C11.1768 8.5642 11.2381 8.54511 11.3008 8.54511C11.3636 8.54511 11.4249 8.5642 11.477 8.59993C11.529 8.63567 11.5694 8.68643 11.593 8.74571L12.1521 10.1675C12.168 10.2079 12.1917 10.2446 12.2219 10.2753C12.252 10.3061 12.288 10.3303 12.3276 10.3464L13.8021 10.9486C13.8585 10.9716 13.9072 11.0109 13.9423 11.0615C13.9773 11.1121 13.9973 11.172 13.9997 11.234C14.0022 11.2959 13.987 11.3572 13.956 11.4106C13.9251 11.4639 13.8796 11.507 13.8252 11.5346L12.3024 12.3104C12.2369 12.3438 12.1849 12.3995 12.1553 12.4679L11.5888 13.7675C11.564 13.8242 11.5236 13.8724 11.4725 13.9062C11.4214 13.94 11.3618 13.958 11.3008 13.958C11.2399 13.958 11.1803 13.94 11.1292 13.9062C11.0781 13.8724 11.0377 13.8242 11.0129 13.7675L10.4454 12.4679C10.4158 12.3995 10.3638 12.3438 10.2982 12.3104L8.77753 11.5357C8.7231 11.5081 8.67767 11.465 8.6467 11.4117C8.61574 11.3583 8.60056 11.297 8.603 11.235C8.60545 11.1731 8.62541 11.1132 8.66047 11.0626C8.69554 11.0119 8.74422 10.9727 8.80065 10.9496L10.2751 10.3475C10.3147 10.3313 10.3507 10.3071 10.3809 10.2764C10.411 10.2456 10.4348 10.209 10.4506 10.1686L11.0097 8.74679L11.0087 8.74571ZM3.05094 12.9286H5.99358V9.92857H3.05094V12.9286ZM5.99358 2C6.57371 2 7.04453 2.48 7.04453 3.07143V6.07143C7.04453 6.35559 6.9338 6.62811 6.73671 6.82904C6.53962 7.02997 6.27231 7.14286 5.99358 7.14286H3.05094L2.94375 7.1375C2.6849 7.11044 2.4451 6.98644 2.27076 6.78951C2.09642 6.59258 1.99994 6.33671 2 6.07143V3.07143C1.99994 2.80615 2.09642 2.55028 2.27076 2.35335C2.4451 2.15641 2.6849 2.03242 2.94375 2.00536L3.05094 2H5.99358ZM12.7196 2C12.9984 2 13.2657 2.11288 13.4628 2.31381C13.6598 2.51475 13.7706 2.78727 13.7706 3.07143V6.07143C13.7706 6.35559 13.6598 6.62811 13.4628 6.82904C13.2657 7.02997 12.9984 7.14286 12.7196 7.14286H9.77698L9.66873 7.1375C9.41016 7.10996 9.17075 6.98579 8.99668 6.78893C8.8226 6.59207 8.72619 6.33647 8.72604 6.07143V3.07143C8.72596 2.80632 8.82228 2.55059 8.99641 2.35368C9.17053 2.15677 9.41007 2.03266 9.66873 2.00536L9.77698 2H12.7196ZM9.77698 6.07143H12.7196V3.07143H9.77698V6.07143ZM3.05094 6.07143H5.99358V3.07143H3.05094V6.07143Z",fill:"currentColor"})}),()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M12.6358 2.44435C12.8831 2.19815 13.2831 2.199 13.5293 2.44624C13.7755 2.69349 13.7746 3.0935 13.5274 3.33968L3.31858 13.5054C3.07133 13.7516 2.67132 13.7508 2.42513 13.5035C2.17893 13.2563 2.17977 12.8563 2.42701 12.6101L12.6358 2.44435Z",fill:"currentColor"}),b.jsx("path",{d:"M5.27212 5.97815L4.9117 7.22356C4.85382 7.42362 4.64471 7.53887 4.44466 7.48097C4.38352 7.46327 4.32785 7.43039 4.28284 7.38538C4.23783 7.34037 4.20495 7.2847 4.18726 7.22356L3.82686 5.97814C3.76198 5.75394 3.64142 5.54982 3.47639 5.38478C3.31136 5.21975 3.10723 5.09917 2.88304 5.03429L1.6376 4.67391C1.43755 4.61602 1.3223 4.40692 1.3802 4.20687C1.39789 4.14573 1.43077 4.09006 1.47578 4.04505C1.52079 4.00004 1.57646 3.96716 1.6376 3.94946L2.88303 3.58908C3.10722 3.5242 3.31135 3.40363 3.47638 3.23859C3.64141 3.07356 3.76198 2.86943 3.82686 2.64523L4.18726 1.39981C4.24514 1.19975 4.45425 1.08451 4.65429 1.1424C4.71544 1.1601 4.77111 1.19298 4.81612 1.23799C4.86112 1.283 4.89401 1.33867 4.9117 1.39981L5.27209 2.64523C5.33696 2.86943 5.45753 3.07356 5.62257 3.2386C5.7876 3.40363 5.99173 3.5242 6.21593 3.58908L7.46135 3.94946C7.66141 4.00735 7.77666 4.21646 7.71876 4.4165C7.70107 4.47764 7.66818 4.53331 7.62318 4.57832C7.57817 4.62333 7.5225 4.65621 7.46135 4.67391L6.21593 5.03429C5.99173 5.09917 5.7876 5.21974 5.62257 5.38478C5.45753 5.54981 5.33696 5.75394 5.27209 5.97814L5.27212 5.97815ZM12.4587 10.7095L12.3937 10.934C12.3494 11.0869 12.1896 11.175 12.0368 11.1308C11.99 11.1172 11.9475 11.0921 11.9131 11.0577C11.8787 11.0233 11.8536 10.9808 11.8401 10.934L11.7751 10.7095C11.7102 10.4853 11.5896 10.2811 11.4246 10.1161C11.2596 9.95108 11.0554 9.83051 10.8312 9.76564L10.6067 9.70065C10.4538 9.65642 10.3657 9.49662 10.41 9.34376C10.4235 9.29703 10.4486 9.25448 10.483 9.22009C10.5174 9.18569 10.5599 9.16056 10.6067 9.14704L10.8312 9.08206C11.0554 9.01718 11.2596 8.89661 11.4246 8.73158C11.5896 8.56655 11.7102 8.36242 11.7751 8.13823L11.8401 7.91366C11.8843 7.76078 12.0441 7.67272 12.197 7.71694C12.2437 7.73046 12.2862 7.75559 12.3206 7.78999C12.355 7.82439 12.3801 7.86693 12.3937 7.91366L12.4587 8.13823C12.5235 8.36242 12.6441 8.56655 12.8091 8.73158C12.9742 8.89661 13.1783 9.01718 13.4025 9.08206L13.6271 9.14704C13.7799 9.19129 13.868 9.35108 13.8238 9.50394C13.8102 9.55067 13.7851 9.59321 13.7507 9.62761C13.7163 9.662 13.6738 9.68713 13.6271 9.70065L13.4025 9.76564C13.1783 9.83051 12.9742 9.95108 12.8091 10.1161C12.6441 10.2811 12.5235 10.4853 12.4587 10.7095ZM8.73493 13.6947L8.66994 13.9193C8.6257 14.0722 8.46591 14.1602 8.31305 14.116C8.26632 14.1025 8.22378 14.0774 8.18938 14.043C8.15498 14.0086 8.12986 13.966 8.11634 13.9193L8.05135 13.6947C7.98647 13.4705 7.8659 13.2664 7.70087 13.1014C7.53584 12.9363 7.33171 12.8158 7.10752 12.7509L6.88295 12.6859C6.73007 12.6417 6.64201 12.4819 6.68624 12.329C6.69976 12.2823 6.72489 12.2397 6.75928 12.2054C6.79368 12.171 6.83622 12.1458 6.88295 12.1323L7.10752 12.0673C7.33171 12.0024 7.53584 11.8819 7.70087 11.7168C7.8659 11.5518 7.98647 11.3477 8.05135 11.1235L8.11634 10.8989C8.16058 10.746 8.32037 10.658 8.47323 10.7022C8.51996 10.7157 8.5625 10.7409 8.5969 10.7753C8.6313 10.8097 8.65642 10.8522 8.66994 10.8989L8.73493 11.1235C8.7998 11.3477 8.92037 11.5518 9.08541 11.7168C9.25044 11.8819 9.45456 12.0024 9.67876 12.0673L9.90333 12.1323C10.0562 12.1766 10.1443 12.3363 10.1 12.4892C10.0865 12.5359 10.0614 12.5785 10.027 12.6129C9.9926 12.6473 9.95006 12.6724 9.90333 12.6859L9.67876 12.7509C9.45456 12.8158 9.25044 12.9363 9.08541 13.1014C8.92037 13.2664 8.7998 13.4705 8.73493 13.6947Z",fill:"currentColor"})]}),()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M12.2 1.69995H3.8C3.2201 1.69995 2.75 2.17467 2.75 2.76025V13.3632C2.75 13.3754 2.75021 13.3875 2.75061 13.3996C2.76856 13.9361 3.21367 14.2996 3.68722 14.2996C3.86807 14.2996 4.05311 14.2465 4.22003 14.1298L7.39764 11.9084C7.5726 11.7858 7.78102 11.72 7.99466 11.7198C8.2083 11.7197 8.4168 11.7853 8.59191 11.9077L11.7803 14.1308C11.9471 14.2471 12.1318 14.3 12.3124 14.3C12.7861 14.3 13.2314 13.9362 13.2494 13.3996C13.2498 13.3875 13.25 13.3754 13.25 13.3632V2.76025C13.25 2.17467 12.7799 1.69995 12.2 1.69995ZM12.2 13.1434L9.19248 11.0464C8.83927 10.8001 8.42531 10.6699 7.99537 10.6699C7.56449 10.6698 7.14976 10.8005 6.79602 11.0478L3.8 13.1423V2.76025C3.8 2.75802 3.8 2.75322 3.80289 2.74995H12.1971C12.2 2.75322 12.2 2.75801 12.2 2.76025V13.1434Z",fill:"currentColor"}),b.jsx("path",{d:"M10.4117 6.27223H8.52499V4.36187C8.52499 4.07192 8.28994 3.83687 7.99999 3.83687C7.71004 3.83687 7.47499 4.07192 7.47499 4.36187V6.27223H5.58828C5.29833 6.27223 5.06328 6.50728 5.06328 6.79723V6.80751C5.06328 7.09746 5.29833 7.33251 5.58828 7.33251H7.47499V9.24287C7.47499 9.53282 7.71004 9.76787 7.99999 9.76787C8.28994 9.76787 8.52499 9.53282 8.52499 9.24287V7.33251H10.4117C10.7017 7.33251 10.9367 7.09746 10.9367 6.80751V6.79723C10.9367 6.50728 10.7017 6.27223 10.4117 6.27223Z",fill:"currentColor"})]}),()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M11.8231 2.3562H4.19204C3.60373 2.36812 3.04399 2.61212 2.63483 3.03501C2.22567 3.4579 2.00026 4.02539 2.00775 4.61377V9.14983C2.00026 9.73821 2.22567 10.3057 2.63483 10.7286C3.04399 11.1515 3.60373 11.3955 4.19204 11.4074H11.8231C12.4114 11.3955 12.9711 11.1515 13.3803 10.7286C13.7895 10.3057 14.0149 9.73821 14.0074 9.14983V4.61377C14.0149 4.02539 13.7895 3.4579 13.3803 3.03501C12.9711 2.61212 12.4114 2.36812 11.8231 2.3562ZM12.9152 9.12192C12.9176 9.26764 12.8911 9.41238 12.8375 9.54789C12.7839 9.6834 12.704 9.80701 12.6026 9.91167C12.5012 10.0163 12.3802 10.1 12.2464 10.1579C12.1127 10.2157 11.9688 10.2467 11.8231 10.249H4.19204C3.89804 10.2434 3.61817 10.1218 3.41354 9.91067C3.20891 9.6995 3.09616 9.41594 3.09989 9.12192V4.61377C3.09759 4.46822 3.12403 4.32364 3.17771 4.18833C3.23139 4.05303 3.31126 3.92964 3.41272 3.82526C3.51418 3.72088 3.63525 3.63756 3.76898 3.58006C3.90272 3.52257 4.04648 3.49204 4.19204 3.49022H11.8231C12.1165 3.49572 12.3958 3.61686 12.6004 3.82727C12.8049 4.03768 12.9181 4.32034 12.9152 4.61377V9.12192Z",fill:"currentColor"}),b.jsx("path",{d:"M11.0091 13.6431H5.01099C4.862 13.6431 4.71911 13.5839 4.61376 13.4785C4.50841 13.3732 4.44922 13.2303 4.44922 13.0813C4.44922 12.9323 4.50841 12.7894 4.61376 12.6841C4.71911 12.5787 4.862 12.5195 5.01099 12.5195H11.0091C11.1581 12.5195 11.3009 12.5787 11.4063 12.6841C11.5117 12.7894 11.5708 12.9323 11.5708 13.0813C11.5708 13.2303 11.5117 13.3732 11.4063 13.4785C11.3009 13.5839 11.1581 13.6431 11.0091 13.6431Z",fill:"currentColor"})]})],LN=()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M14.365 4.88313C13.9832 4.88313 13.7286 5.13768 13.7286 5.51949V12.9649C13.7286 13.4104 13.4104 13.7286 12.965 13.7286H3.03771C2.59225 13.7286 2.27407 13.4104 2.27407 12.9649V3.03768C2.27407 2.59222 2.59225 2.27404 3.03771 2.27404H6.66498C7.0468 2.27404 7.30134 2.01949 7.30134 1.63768C7.30134 1.25586 7.0468 1.00131 6.66498 1.00131H3.03771C1.89225 1.00131 1.00134 1.89222 1.00134 3.03768V12.9649C1.00134 14.1104 1.89225 15.0013 3.03771 15.0013H12.965C14.1104 15.0013 15.0013 14.1104 15.0013 12.9649V5.51949C15.0013 5.20131 14.7468 4.88313 14.365 4.88313Z",fill:"#666666"}),b.jsx("path",{d:"M5.2637 7.55586C5.00916 7.30131 4.62734 7.30131 4.37279 7.55586C4.11825 7.8104 4.11825 8.19222 4.37279 8.44677L7.55461 11.6286C7.61825 11.6922 7.68188 11.7559 7.74552 11.7559C7.80916 11.8195 7.93643 11.8195 8.00007 11.8195C8.0637 11.8195 8.19098 11.8195 8.25461 11.7559C8.31825 11.6922 8.38188 11.6922 8.44552 11.6286L11.6273 8.44677C11.8819 8.19222 11.8819 7.8104 11.6273 7.55586C11.3728 7.30131 10.991 7.30131 10.7364 7.55586L8.63643 9.65586V8.00131C8.63643 4.81949 11.1819 2.27404 14.3637 2.27404C14.7455 2.27404 15.0001 2.01949 15.0001 1.63768C15.0001 1.25586 14.7455 1.00131 14.3637 1.00131C10.4819 1.00131 7.3637 4.11949 7.3637 8.00131V9.65586L5.2637 7.55586Z",fill:"#666666"})]}),PN=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b.jsx("path",{d:"M9.60187 14.5546C9.23569 14.5546 8.94275 14.4081 8.6498 14.1884C8.35686 13.8955 8.13716 13.5293 8.13716 13.0899V11.6251C6.52597 11.6251 3.88948 12.0646 2.49801 13.9687C2.2783 14.3349 1.76565 14.5546 1.32623 14.6278H1.10653C0.374166 14.4813 -0.0652517 13.8222 0.00799105 13.0899C0.374166 9.94073 1.47272 7.67041 3.37683 6.13247C4.76831 5.03394 6.3795 4.44805 8.13716 4.30157V2.9101C8.13716 2.25098 8.4301 1.66509 9.01599 1.44538C9.52864 1.29892 10.1145 1.37215 10.5539 1.81157L15.241 6.57189C15.6072 6.86484 15.8269 7.30424 15.9001 7.81689C15.9734 8.32955 15.8269 8.8422 15.4607 9.20837C15.3875 9.28161 15.3143 9.42807 15.1678 9.50132L10.6272 14.1152C10.3342 14.4081 9.96804 14.5546 9.60187 14.5546ZM8.43009 10.1604H9.60187V13.0899L14.2157 8.32955L14.289 8.25631C14.3622 8.18308 14.3622 8.0366 14.3622 7.96336C14.3622 7.81689 14.289 7.74366 14.2157 7.67041L14.1425 7.59718L9.52864 2.9101V5.69306L8.50333 5.7663C6.96539 5.7663 5.50066 6.27894 4.25567 7.23101C2.79094 8.40278 1.83889 10.3069 1.54595 12.7969C3.37683 10.5266 6.5992 10.1604 8.43009 10.1604Z",fill:"currentColor"})}),BN=()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("path",{d:"M13.85 7.35C13.4903 7.35 13.2 7.64033 13.2 8V12.3333C13.2 12.8114 12.8114 13.2 12.3333 13.2H3.66667C3.18856 13.2 2.8 12.8114 2.8 12.3333V3.66667C2.8 3.18856 3.18856 2.8 3.66667 2.8H8C8.35967 2.8 8.65 2.50967 8.65 2.15C8.65 1.79033 8.35967 1.5 8 1.5H3.23333C2.27567 1.5 1.5 2.27567 1.5 3.23333V12.7667C1.5 13.7243 2.27567 14.5 3.23333 14.5H12.7667C13.7243 14.5 14.5 13.7243 14.5 12.7667V8C14.5 7.64033 14.2097 7.35 13.85 7.35Z",fill:"currentColor"}),b.jsx("path",{d:"M5.7483 10.4682C6.00108 10.721 6.41419 10.721 6.66697 10.4682L13.7144 3.42075C13.9672 3.16797 13.9672 2.75486 13.7144 2.50208C13.4616 2.24931 13.0485 2.24931 12.7957 2.50208L5.7483 9.54808C5.49552 9.80086 5.49552 10.2154 5.7483 10.4682Z",fill:"currentColor"})]}),RN=()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("path",{d:"M4.12488 5.02012H11.8779L11.1331 12.6138C11.1164 12.7828 11.0373 12.9396 10.9114 13.0536C10.7855 13.1676 10.6217 13.2307 10.4518 13.2306H5.55096C5.38127 13.2304 5.21769 13.1672 5.09198 13.0533C4.96627 12.9393 4.88739 12.7827 4.87067 12.6138L4.12488 5.02012ZM3.80233 3.74945C3.66582 3.74934 3.53081 3.77782 3.40598 3.83306C3.28116 3.8883 3.16929 3.96908 3.07757 4.07018C2.98586 4.17128 2.91634 4.29048 2.8735 4.42008C2.83065 4.54969 2.81542 4.68683 2.8288 4.82268L3.60586 12.738C3.65342 13.2208 3.87886 13.6688 4.23837 13.9947C4.59787 14.3206 5.06573 14.5012 5.55096 14.5012H10.4518C10.9371 14.5012 11.4049 14.3206 11.7644 13.9947C12.1239 13.6688 12.3494 13.2208 12.3969 12.738L13.175 4.82268C13.1883 4.68683 13.1731 4.54969 13.1303 4.42008C13.0874 4.29048 13.0179 4.17128 12.9262 4.07018C12.8345 3.96908 12.7226 3.8883 12.5978 3.83306C12.4729 3.77782 12.3379 3.74934 12.2014 3.74945H3.80135H3.80233Z",fill:"currentColor"}),b.jsx("path",{d:"M1.5 4.28322C1.5 4.11472 1.56694 3.95312 1.68608 3.83397C1.80523 3.71482 1.96683 3.64789 2.13533 3.64789H13.8646C13.948 3.64787 14.0306 3.6643 14.1077 3.69622C14.1848 3.72814 14.2549 3.77494 14.3139 3.83394C14.3729 3.89293 14.4197 3.96298 14.4516 4.04007C14.4836 4.11715 14.5 4.19978 14.5 4.28322C14.5 4.36666 14.4836 4.44929 14.4516 4.52638C14.4197 4.60347 14.3729 4.67351 14.3139 4.73251C14.2549 4.7915 14.1848 4.8383 14.1077 4.87022C14.0306 4.90214 13.948 4.91857 13.8646 4.91855H2.13533C1.96683 4.91855 1.80523 4.85162 1.68608 4.73247C1.56694 4.61332 1.5 4.45172 1.5 4.28322Z",fill:"currentColor"}),b.jsx("path",{d:"M5.02081 3.11277C5.02081 2.22135 5.74314 1.5 6.63358 1.5H9.3704C10.2618 1.5 10.9832 2.22135 10.9832 3.11277V4.92102H5.02081V3.11277ZM6.63358 2.77067C6.58866 2.77067 6.54417 2.77952 6.50266 2.79671C6.46116 2.8139 6.42345 2.8391 6.39168 2.87087C6.35991 2.90263 6.33471 2.94035 6.31752 2.98185C6.30033 3.02336 6.29148 3.06784 6.29148 3.11277V3.65036H9.7125V3.11277C9.7125 3.06784 9.70366 3.02336 9.68646 2.98185C9.66927 2.94035 9.64407 2.90263 9.61231 2.87087C9.58054 2.8391 9.54282 2.8139 9.50132 2.79671C9.45981 2.77952 9.41533 2.77067 9.3704 2.77067H6.63358Z",fill:"currentColor"})]}),FN=()=>b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M8.87301 3.52364C9.08579 3.52364 9.28984 3.60817 9.4403 3.75862C9.59075 3.90907 9.67527 4.11313 9.67527 4.3259V11.8137C9.67527 12.0265 9.59075 12.2305 9.4403 12.381C9.28984 12.5314 9.08579 12.6159 8.87301 12.6159H2.98976C2.88441 12.6159 2.78008 12.5952 2.68275 12.5549C2.58541 12.5146 2.49697 12.4555 2.42248 12.381C2.34798 12.3065 2.28889 12.218 2.24857 12.1207C2.20825 12.0234 2.1875 11.919 2.1875 11.8137V4.3259C2.1875 4.11313 2.27202 3.90907 2.42248 3.75862C2.57293 3.60817 2.77699 3.52364 2.98976 3.52364H8.87301ZM8.60559 4.59332H3.25718V11.5463H8.60559V4.59332ZM11.0102 1.38428C11.2098 1.38415 11.4022 1.45838 11.5499 1.59248C11.6977 1.72658 11.7901 1.91092 11.8093 2.10952L11.8125 2.18654V9.40315C11.8123 9.53947 11.7601 9.67059 11.6666 9.76971C11.573 9.86884 11.4451 9.92849 11.309 9.93648C11.1729 9.94447 11.0389 9.90019 10.9344 9.8127C10.8298 9.7252 10.7627 9.60109 10.7466 9.46573L10.7428 9.40315V2.45396H5.39655C5.26555 2.45394 5.13911 2.40585 5.04121 2.3188C4.94332 2.23175 4.88078 2.1118 4.86545 1.9817L4.86171 1.91912C4.86172 1.78812 4.90982 1.66168 4.99687 1.56379C5.08392 1.46589 5.20387 1.40335 5.33397 1.38802L5.39655 1.38428H11.0102Z",fill:"currentColor"})}),HN=()=>b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M1.5548 5.88011C1.4304 5.76419 1.26586 5.70108 1.09584 5.70408C0.925831 5.70708 0.76362 5.77595 0.643383 5.89619C0.523147 6.01643 0.454274 6.17864 0.451274 6.34865C0.448274 6.51867 0.511382 6.68321 0.627302 6.80761L5.0023 11.1826C5.12535 11.3055 5.29215 11.3745 5.46605 11.3745C5.63996 11.3745 5.80676 11.3055 5.9298 11.1826L13.3673 3.74511C13.4832 3.62071 13.5463 3.45617 13.5433 3.28615C13.5403 3.11614 13.4715 2.95393 13.3512 2.83369C13.231 2.71345 13.0688 2.64458 12.8988 2.64158C12.7287 2.63858 12.5642 2.70169 12.4398 2.81761L5.46605 9.79049L1.5548 5.87923V5.88011Z",fill:"currentColor"})}),UN=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M9.60188 14.5546C9.23571 14.5546 8.94276 14.4081 8.64982 14.1884C8.35687 13.8955 8.13717 13.5293 8.13717 13.0899V11.6251C6.52599 11.6251 3.88949 12.0646 2.49803 13.9687C2.27831 14.3349 1.76566 14.5546 1.32625 14.6278H1.10654C0.374181 14.4813 -0.0652364 13.8222 0.00800631 13.0899C0.374181 9.94073 1.47273 7.67041 3.37685 6.13247C4.76833 5.03394 6.37951 4.44805 8.13717 4.30157V2.9101C8.13717 2.25098 8.43012 1.66509 9.01601 1.44538C9.52865 1.29892 10.1145 1.37215 10.5539 1.81157L15.241 6.57189C15.6072 6.86484 15.8269 7.30424 15.9002 7.81689C15.9734 8.32955 15.8269 8.8422 15.4607 9.20837C15.3875 9.28161 15.3143 9.42807 15.1678 9.50132L10.6272 14.1152C10.3342 14.4081 9.96806 14.5546 9.60188 14.5546ZM8.4301 10.1604H9.60188V13.0899L14.2157 8.32955L14.289 8.25631C14.3622 8.18308 14.3622 8.0366 14.3622 7.96336C14.3622 7.81689 14.289 7.74366 14.2157 7.67041L14.1425 7.59718L9.52865 2.9101V5.69306L8.50335 5.7663C6.9654 5.7663 5.50068 6.27894 4.25568 7.23101C2.79096 8.40278 1.83891 10.3069 1.54596 12.7969C3.37685 10.5266 6.59922 10.1604 8.4301 10.1604Z",fill:"#7C3AED"})}),zN=({code:e})=>{const{message:t}=ue.App.useApp(),[n,l]=y.useState(!1),r=async a=>{a.stopPropagation();try{await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),2e3)}catch{t.error("复制失败")}};return b.jsxs("div",{className:"rte-skill-share",onClick:a=>a.stopPropagation(),children:[b.jsxs("div",{className:"rte-skill-share-head",children:[b.jsxs("div",{className:"rte-skill-share-title",children:[b.jsx(UN,{}),b.jsx("span",{children:"分享码"})]}),b.jsx("span",{className:"rte-skill-share-hint",children:"复制后粘贴在「导入技能」即可使用"})]}),b.jsxs("div",{className:"rte-skill-share-box",children:[b.jsx("span",{className:"rte-skill-share-code",children:e}),b.jsxs("button",{type:"button",className:`rte-skill-share-copy${n?" rte-skill-share-copy-done":""}`,onClick:r,children:[n?b.jsx(HN,{}):b.jsx(FN,{}),b.jsx("span",{children:n?"已复制":"复制"})]})]})]})},VN=({card:e,selected:t,onClick:n,onShare:l,onEdit:r,onDelete:a,onUse:i,getPopupContainer:s})=>{const o=_=>_.stopPropagation(),[u,c,d]=hb(),[f,h,m]=hb("height"),[v,g]=y.useState(!1),[E,N]=y.useState(""),[A,L]=y.useState(!1),O=v||A,S=async _=>{if(g(_),!_){N("");return}try{const I=await l();N(typeof I=="string"&&I?I:`SK-${e.id}`)}catch{N(`SK-${e.id}`)}};return b.jsxs("div",{className:`rte-skill-card${t?" rte-skill-card-selected":""}${O?" rte-skill-card-pinned":""}`,onClick:n,"data-rte-skill-card":"true","aria-pressed":t,children:[b.jsxs("div",{className:"rte-skill-card-header",children:[b.jsx($n,{title:c?e.title:"",placement:"top",mouseEnterDelay:.3,getPopupContainer:s,zIndex:1e4,children:b.jsx("div",{className:"rte-skill-card-title",ref:u,onMouseEnter:d,children:e.title})}),b.jsxs("div",{className:`rte-skill-card-aside${O?" rte-skill-card-aside-pinned":""}`,children:[b.jsx("span",{className:`rte-skill-card-badge rte-skill-card-badge-${e.badge}`,children:IN[e.badge]}),b.jsxs("div",{className:`rte-skill-card-actions${O?" rte-skill-card-actions-pinned":""}`,children:[e.badge==="mine"&&b.jsx(ue.Popover,{open:v,onOpenChange:S,trigger:"click",placement:"bottomRight",arrow:!1,overlayClassName:"rte-skill-share-popover",zIndex:1e4,getPopupContainer:s,content:b.jsx(zN,{code:E}),children:b.jsx("button",{type:"button",className:`rte-skill-card-action${v?" rte-skill-card-action-active":""}`,title:"分享","aria-label":"分享",onClick:o,children:b.jsx(PN,{})})}),e.badge==="mine"&&b.jsx("button",{type:"button",className:"rte-skill-card-action",title:"编辑","aria-label":"编辑",onClick:_=>{o(_),r()},children:b.jsx(BN,{})}),e.badge!=="mine"&&b.jsx("button",{type:"button",className:"rte-skill-card-action",title:"查看详情","aria-label":"查看详情",onClick:_=>{o(_),r()},children:b.jsx("i",{className:"iconfont icon-chakanjinengxiangqing"})}),e.badge!=="system"&&b.jsx(ue.Popconfirm,{title:"删除技能后不可恢复,确认删除吗?",open:A,onOpenChange:L,okText:"确认",cancelText:"取消",placement:"bottomRight",arrow:!1,overlayClassName:"rte-skill-delete-confirm",zIndex:1e4,icon:b.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 9C1.5 4.85786 4.85786 1.5 9 1.5C13.1421 1.5 16.5 4.85786 16.5 9C16.5 13.1421 13.1421 16.5 9 16.5C4.85786 16.5 1.5 13.1421 1.5 9ZM8.25 11.25V12.75H9.75V11.25H8.25ZM9.75 10.5L9.75 5.25H8.25L8.25 10.5H9.75Z",fill:"#F53F3F"})}),okButtonProps:{danger:!0},getPopupContainer:s,onConfirm:_=>{_?.stopPropagation(),L(!1),a()},onCancel:_=>{_?.stopPropagation(),L(!1)},children:b.jsx("button",{type:"button",className:`rte-skill-card-action rte-skill-card-action-delete${A?" rte-skill-card-action-active":""}`,title:"删除","aria-label":"删除",onClick:o,children:b.jsx(RN,{})})})]})]})]}),b.jsx($n,{title:h?e.desc:"",placement:"top",mouseEnterDelay:.3,getPopupContainer:s,zIndex:1e4,children:b.jsx("div",{className:"rte-skill-card-desc",ref:f,onMouseEnter:m,children:e.desc})})]})},pb=y.memo(({selectedId:e,onSelect:t,onCardClick:n,onAction:l,skillListFetch:r,onHeaderAction:a,showCreateSkill:i=!0,createDisabled:s})=>{const{message:o}=ue.App.useApp(),[u,c]=y.useState(0),[d,f]=y.useState(r?[]:_N),[h,m]=y.useState(!1),[v,g]=y.useState(!!r),E=y.useRef(0),N=y.useCallback(()=>{g(!0),E.current=window.setTimeout(()=>{g(!1),m(!0)},300)},[]),A=y.useCallback(()=>{window.clearTimeout(E.current),g(!1),m(!1)},[]),[L,O]=y.useState(""),[S,_]=y.useState(""),I=_l(),k=I?()=>I:void 0,R=y.useRef(0),M=y.useRef(null),H=y.useRef(0),q=y.useRef(0),B=y.useCallback(()=>{const C=M.current;C&&(C.classList.add("is-scrolling"),window.clearTimeout(q.current),q.current=window.setTimeout(()=>{C.classList.remove("is-scrolling")},300))},[]);y.useEffect(()=>{const C=window.setTimeout(()=>_(L.trim()),300);return()=>window.clearTimeout(C)},[L]);const T=y.useCallback(async()=>{if(!r)return;const C=++R.current;N();try{const Z=await r({skillType:NN[u],pageIndex:1,pageSize:wN,keyword:S||void 0});if(C!==R.current)return;f(Z.map(ON))}catch{C===R.current&&o.error("技能列表加载失败")}finally{C===R.current&&A()}},[r,u,S,N,A]);y.useEffect(()=>{T()},[T]),y.useEffect(()=>{M.current?.scrollTo({top:0})},[u,S]);const[F,V]=y.useState(!1);y.useLayoutEffect(()=>{if(u===0&&!h&&d.length>0){const C=M.current;C&&(H.current=C.clientHeight),V(!1)}else!h&&d.length>0&&H.current>0?requestAnimationFrame(()=>{const C=M.current;C&&V(C.scrollHeight<H.current)}):V(!1)},[u,h,d]);const $=C=>{n?.({id:C.id,title:C.title}),t?.({id:C.id,title:C.title,desc:C.desc||void 0,usageInstruction:C.usageInstruction})},X=async C=>{try{await l?.("delete",{id:C.id,title:C.title})}catch{o.error("删除失败");return}e===C.id&&t?.(null),r?await T():f(Z=>Z.filter(ie=>ie.id!==C.id)),o.success("已删除技能")};return b.jsxs("div",{className:"rte-skill-panel",children:[b.jsxs("div",{className:"rte-skill-panel-header",children:[b.jsxs("div",{className:"rte-skill-search",children:[b.jsx("input",{className:"rte-skill-search-input",placeholder:"请输入想搜索的技能名称或描述",value:L,onChange:C=>O(C.target.value)}),b.jsx("span",{className:"rte-skill-search-icon",children:b.jsx(MN,{})})]}),b.jsxs("div",{className:"rte-skill-actions",children:[b.jsxs("button",{type:"button",className:"rte-skill-import-btn",onClick:()=>a?.("import"),children:[b.jsx(LN,{}),b.jsx("span",{children:"导入技能"})]}),i&&b.jsxs("button",{type:"button",className:`rte-skill-create-btn${s?" rte-skill-create-btn-disabled":""}`,disabled:s,onClick:()=>!s&&a?.("create"),children:[b.jsx("i",{className:"iconfont icon-jiyudangqianduihuachuangjianjineng"}),b.jsx("span",{children:"基于当前会话创建技能"})]})]})]}),b.jsxs("div",{className:"rte-skill-panel-body",children:[b.jsx("div",{className:"rte-skill-sidebar",children:AN.map((C,Z)=>{const ie=DN[Z];return b.jsxs("div",{className:`rte-skill-sidebar-item${Z===u?" rte-skill-sidebar-item-active":""}`,onClick:()=>c(Z),children:[b.jsx(ie,{}),b.jsx("span",{children:C})]},C)})}),h?b.jsx("div",{className:"rte-skill-cards-status",style:H.current?{minHeight:H.current}:void 0,children:b.jsx(ue.Spin,{})}):d.length===0?b.jsx("div",{className:"rte-skill-cards-status",style:H.current?{minHeight:H.current}:void 0,children:!v&&b.jsxs(b.Fragment,{children:[b.jsx("img",{className:"rte-skill-empty-img",src:"https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/website/kongzhuangtai.svg",alt:"暂无数据"}),b.jsx("span",{className:"rte-skill-empty-text",children:"暂无技能"})]})}):b.jsxs("div",{className:"rte-skill-cards",ref:M,onScroll:B,style:u!==0&&H.current?{minHeight:H.current}:void 0,children:[d.map(C=>b.jsx(VN,{card:C,selected:e===C.id,onClick:()=>$(C),onShare:()=>l?.("share",{id:C.id,title:C.title}),onEdit:()=>l?.("edit",{id:C.id,title:C.title}),onDelete:()=>X(C),onUse:()=>t?.({id:C.id,title:C.title,desc:C.desc||void 0,usageInstruction:C.usageInstruction}),getPopupContainer:k},C.id)),F&&b.jsx("div",{className:"rte-skill-cards-end",children:"暂无更多技能~"})]})]})]})});pb.displayName="SkillPanel";const yi=4,$N=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M10.4103 0.600098C11.2711 0.600098 11.9863 1.2657 11.9863 2.1081C11.9863 2.2985 11.9479 2.4873 11.8751 2.6641L10.9119 4.9921H12.6255C13.4455 4.9921 14.1327 5.5961 14.1959 6.3817L14.2007 6.5009C14.2007 6.8905 14.0431 7.2641 13.7639 7.5433L6.28226 15.0321C6.05292 15.2576 5.74735 15.3888 5.42594 15.3999C5.10452 15.411 4.79062 15.3012 4.54626 15.0921C4.19986 14.7929 4.05346 14.3297 4.16706 13.9113L5.20146 9.4593H3.28146C2.63906 9.4593 2.09506 8.9873 2.03666 8.3649L2.03186 8.2537C2.03186 8.0993 2.06306 7.9457 2.12066 7.8073L4.67986 1.5513C4.92146 0.970498 5.50306 0.600098 6.14306 0.600098H10.4103ZM10.4103 1.8001H6.14386C5.97906 1.8001 5.83986 1.8889 5.78866 2.0105L3.23586 8.2521C3.24066 8.2521 3.24626 8.2537 3.25346 8.2553L3.28306 8.2585H5.55506C5.62866 8.2585 5.70146 8.2665 5.77186 8.2833C6.26786 8.4001 6.58466 8.8937 6.45506 9.3713L5.33506 14.1857L5.35586 14.1969C5.37426 14.2017 5.39586 14.2009 5.41266 14.1953L5.43426 14.1833L12.9151 6.6953C12.9414 6.67028 12.9625 6.64029 12.9772 6.60706C12.9919 6.57383 12.9999 6.53802 13.0007 6.5017C13.0007 6.3417 12.8415 6.1937 12.6247 6.1937H10.4887C10.3799 6.1937 10.2719 6.1745 10.1687 6.1377C10.0535 6.09806 9.94761 6.03536 9.85749 5.95342C9.76737 5.87149 9.6949 5.77204 9.64451 5.66115C9.59412 5.55026 9.56687 5.43027 9.56442 5.30849C9.56197 5.18672 9.58437 5.06572 9.63026 4.9529L10.7671 2.2049C10.7797 2.17445 10.7862 2.14184 10.7863 2.1089C10.7863 1.9481 10.6279 1.8001 10.4111 1.8001H10.4103ZM7.10386 2.6433C7.25151 2.70252 7.3696 2.81796 7.43215 2.96423C7.49471 3.1105 7.49662 3.27562 7.43746 3.4233L6.79746 5.0233C6.73604 5.16775 6.62045 5.28238 6.4755 5.34261C6.33054 5.40283 6.16775 5.40385 6.02205 5.34544C5.87635 5.28704 5.75934 5.17386 5.69612 5.03018C5.6329 4.88651 5.6285 4.72378 5.68386 4.5769L6.32386 2.9769C6.38308 2.82925 6.49852 2.71116 6.64479 2.6486C6.79106 2.58605 6.95618 2.58414 7.10386 2.6433Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.2"})}),bb=y.memo(({disabled:e,selectedSkill:t,onSkillSelect:n,onSkillCardClick:l,onSkillAction:r,skillListFetch:a,onSkillHeaderAction:i,showCreateSkill:s,skillPanelOpen:o,onSkillPanelOpenChange:u,createDisabled:c,skillPanelOpenDelay:d})=>{const[f,h]=y.useState(!1),m=o!==void 0,[v,g]=y.useState(o??!1),E=y.useRef(0);y.useEffect(()=>{if(m)return o?d&&d>0?E.current=window.setTimeout(()=>g(!0),d):g(!0):(window.clearTimeout(E.current),g(!1)),()=>window.clearTimeout(E.current)},[m,o,d]);const N=m?v:f,A=y.useCallback(T=>{const F=typeof T=="function"?T(N):T;m||h(F),u?.(F)},[m,N,u]),[L,O]=y.useState(null),S=y.useRef(null),_=y.useRef(null),I=_l(),k=y.useCallback(()=>(S.current?.closest(".rich-text-editor")??S.current)?.getBoundingClientRect()??null,[]),R=y.useCallback(()=>{const T=k();if(!T)return;const F=Math.max(0,window.innerHeight-T.bottom-yi*2),V=Math.max(0,T.top-yi*2),X=(_.current?.scrollHeight??0)>F&&V>F,C=X?V:F,ie=(_.current?.offsetParent??I)?.getBoundingClientRect(),D=ie?.left??0,pe=ie?.top??0,Se=T.left-D;if(X){const ce=(ie?.height??window.innerHeight)-(T.top-yi-pe);O({left:Se,bottom:ce,width:T.width,maxHeight:C})}else O({left:Se,top:T.bottom+yi-pe,width:T.width,maxHeight:C})},[k,I]);y.useLayoutEffect(()=>{if(!N)return;R();const T=requestAnimationFrame(R);window.addEventListener("scroll",R,!0),window.addEventListener("resize",R);const F=_.current?new ResizeObserver(R):null;F&&_.current&&F.observe(_.current);const V=S.current?.closest(".rich-text-editor"),$=V?new ResizeObserver(R):null;return $&&V&&$.observe(V),()=>{cancelAnimationFrame(T),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R),F?.disconnect(),$?.disconnect()}},[N,R]),y.useEffect(()=>{if(!N||m)return;const T=F=>{const V=F.target;S.current?.contains(V)||_.current?.contains(V)||V instanceof Element&&V.closest(".rte-skill-delete-confirm, .rte-skill-share-popover")||A(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[N,m]);const M=y.useCallback(()=>{e||A(T=>!T)},[e]),H=y.useCallback(T=>{n?.(T),T&&A(!1)},[n]),q=!!t,B=`rte-skill-badge${q?" rte-skill-badge-selected":N?" rte-skill-badge-active":""}`;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{ref:S,className:B,onClick:M,"data-rte-skill-button":"true","aria-pressed":N||q,style:{cursor:e?"not-allowed":"pointer"},children:[b.jsx($N,{}),b.jsx("span",{className:"rte-skill-text",children:"技能"})]}),N&&Ni.createPortal(b.jsx("div",{ref:_,className:"rte-skill-panel-popup","data-placement":L?.bottom!==void 0?"top":"bottom",style:{position:"fixed",left:L?.left??0,top:L?.top,bottom:L?.bottom,width:L?.width,zIndex:9999,maxHeight:L?.maxHeight,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:16,visibility:L?"visible":"hidden"},children:b.jsx(pb,{selectedId:t?.id??null,onSelect:H,onCardClick:l,onAction:r,skillListFetch:a,onHeaderAction:i,showCreateSkill:s,createDisabled:c})}),I??document.body)]})});bb.displayName="SkillButton";const qN=10*1024*1024,WN=50*1024*1024,YN="图片大小不能超过 10MB",jN="文件总大小不能超过 50MB",KN=e=>e.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||""),GN=(e,t)=>{let n=!1;const l=t.filter(o=>KN(o)&&o.size>qN?(n=!0,!1):!0),r=e.reduce((o,u)=>o+u.size,0),a=[];let i=r,s=!1;for(const o of l){if(i+o.size>WN){s=!0;break}a.push(o),i+=o.size}return{accepted:a,imageOversize:n,totalExceeded:s}},mb=y.memo(({files:e,onChange:t,disabled:n})=>{const{message:l}=ue.App.useApp(),r=y.useRef(null),a=y.useCallback(s=>{const o=Array.from(s.target.files??[]);if(s.target.value="",o.length===0)return;const{accepted:u,imageOversize:c,totalExceeded:d}=GN(e,o);c&&l.error(YN),d&&l.error(jN),u.length>0&&t([...e,...u])},[e,t,l]),i=y.useCallback(()=>{n||r.current?.click()},[n]);return b.jsxs("div",{className:"rte-footer-upload",children:[b.jsx("div",{className:"rte-footer-upload-btn",onClick:i,title:"上传文件",style:{cursor:n?"not-allowed":"pointer",opacity:n?.6:1,pointerEvents:n?"none":"auto"},children:b.jsx("i",{className:"iconfont icon-lianjie",style:{fontSize:"16px"}})}),b.jsx("input",{ref:r,type:"file",multiple:!0,style:{display:"none"},onChange:a})]})});mb.displayName="UploadButton";const QN=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M12.0699 1.36475C13.3354 1.36475 14.3603 2.39083 14.3603 3.65507V7.92055C14.3603 8.10909 14.2854 8.28992 14.152 8.42324C14.0187 8.55656 13.8379 8.63146 13.6494 8.63146C13.4608 8.63146 13.28 8.55656 13.1467 8.42324C13.0133 8.28992 12.9384 8.10909 12.9384 7.92055V3.65507C12.9384 3.42473 12.8469 3.20382 12.6841 3.04095C12.5212 2.87807 12.3003 2.78657 12.0699 2.78657H2.59111C2.36077 2.78657 2.13986 2.87807 1.97698 3.04095C1.81411 3.20382 1.72261 3.42473 1.72261 3.65507V7.68121C2.56978 6.63735 3.37666 6.10417 4.20014 6.10417C5.39447 6.10417 7.15517 7.56983 9.80806 10.5711C9.93297 10.7125 9.99659 10.8977 9.98492 11.086C9.97326 11.2743 9.88726 11.4503 9.74585 11.5752C9.67583 11.6371 9.59432 11.6845 9.50596 11.7149C9.4176 11.7452 9.32413 11.7579 9.23089 11.7521C9.04257 11.7404 8.8666 11.6544 8.74169 11.513C6.41226 8.87791 4.7902 7.52599 4.20014 7.52599C3.71198 7.52599 2.91931 8.276 1.95602 9.8329L1.72379 10.2192V12.3448C1.72379 12.8247 2.11242 13.2133 2.59229 13.2133H10.2465C10.435 13.2133 10.6158 13.2882 10.7491 13.4215C10.8825 13.5548 10.9574 13.7357 10.9574 13.9242C10.9574 14.1128 10.8825 14.2936 10.7491 14.4269C10.6158 14.5602 10.435 14.6351 10.2465 14.6351H2.59111C1.98367 14.6351 1.40112 14.3938 0.971602 13.9643C0.542083 13.5348 0.300781 12.9522 0.300781 12.3448V3.65507C0.300781 2.39083 1.32568 1.36475 2.59111 1.36475H12.0699ZM13.2074 9.58053C13.6162 9.55328 13.4242 10.5083 14.0581 11.1007C14.6908 11.6931 15.6755 11.4881 15.7003 11.9147C15.7252 12.3412 14.6956 12.269 14.16 12.827C13.6221 13.3839 13.7406 14.2145 13.301 14.2346C12.8626 14.256 13.1067 13.391 12.41 12.8081C11.7133 12.2263 10.8851 12.3886 10.8851 11.9739C10.8851 11.5592 11.7927 11.8021 12.4029 11.173C13.0131 10.5426 12.7986 9.6066 13.2086 9.58053H13.2074ZM10.0948 3.81384C10.3333 3.81384 10.5695 3.86082 10.7899 3.9521C11.0103 4.04339 11.2105 4.17718 11.3792 4.34585C11.5478 4.51451 11.6816 4.71475 11.7729 4.93512C11.8642 5.1555 11.9112 5.39169 11.9112 5.63022C11.9112 5.86875 11.8642 6.10495 11.7729 6.32532C11.6816 6.5457 11.5478 6.74593 11.3792 6.9146C11.2105 7.08327 11.0103 7.21706 10.7899 7.30834C10.5695 7.39962 10.3333 7.44661 10.0948 7.44661C9.61306 7.44661 9.15105 7.25524 8.81041 6.9146C8.46978 6.57396 8.27841 6.11196 8.27841 5.63022C8.27841 5.14849 8.46978 4.68648 8.81041 4.34585C9.15105 4.00521 9.61306 3.81384 10.0948 3.81384ZM10.0948 5.0769C10.0221 5.0769 9.95017 5.09121 9.88304 5.11902C9.81591 5.14682 9.75491 5.18758 9.70353 5.23896C9.65215 5.29034 9.61139 5.35134 9.58358 5.41847C9.55578 5.48561 9.54146 5.55756 9.54146 5.63022C9.54146 5.70289 9.55578 5.77484 9.58358 5.84197C9.61139 5.90911 9.65215 5.9701 9.70353 6.02148C9.75491 6.07287 9.81591 6.11362 9.88304 6.14143C9.95017 6.16924 10.0221 6.18355 10.0948 6.18355C10.2415 6.18355 10.3823 6.12525 10.4861 6.02148C10.5898 5.91772 10.6481 5.77697 10.6481 5.63022C10.6481 5.48347 10.5898 5.34273 10.4861 5.23896C10.3823 5.13519 10.2415 5.0769 10.0948 5.0769Z",fill:"currentColor"})}),gb=y.memo(({selected:e,onClick:t,disabled:n})=>{const l=y.useCallback(()=>{n||t?.()},[n,t]),r=`rte-ai-image-badge${e?" rte-ai-image-badge-selected":""}`;return b.jsxs("div",{className:r,onClick:l,"data-rte-ai-image-button":"true","aria-pressed":!!e,style:{cursor:n?"not-allowed":"pointer"},children:[b.jsx(QN,{}),b.jsx("span",{className:"rte-ai-image-text",children:"AI生图"})]})});gb.displayName="AIImageButton";const vb=y.memo(({onClick:e,loading:t,disabled:n})=>b.jsx("button",{type:"button",className:"rich-text-editor-send-button","data-testid":"rte-send-button",onClick:e,disabled:n||t,children:t?b.jsx("span",{className:"rte-send-spinner"}):b.jsx("i",{className:"iconfont icon-fasong"})}));vb.displayName="SendButton";const yb=y.memo(({currentAgent:e})=>{const t=e?.points;return t==null?null:b.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[b.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),b.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(t)]}),e?.labelValue===2&&b.jsx("div",{className:"rte-limited-free-badge",children:b.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]})});yb.displayName="PointsBadge";const Eb=y.memo(({isProcessing:e,loading:t,disabled:n,sendDisabled:l,showFooterUpload:r=!0,footerFiles:a,onFooterFilesChange:i,agentOptions:s,onAgentSelect:o,onAgentDropdownOpenChange:u,hideAgentButton:c,currentAgent:d,selectedSkill:f,onSkillSelect:h,onSkillCardClick:m,onSkillAction:v,skillListFetch:g,onSkillHeaderAction:E,showCreateSkill:N,createDisabled:A,skillPanelOpen:L,onSkillPanelOpenChange:O,skillPanelOpenDelay:S,onAIImageClick:_,aiImageSelected:I,onSend:k,padding:R="12px 16px"})=>{const M=y.useCallback(H=>{if(H.reduce((T,F)=>T+F.size,0)>52428800){const T=[];let F=0;for(const V of H){if(F+V.size>52428800)break;T.push(V),F+=V.size}i(T)}else i(H)},[i]);return b.jsxs("div",{className:"rich-text-editor-footer",style:{padding:R},children:[b.jsxs("div",{className:"rich-text-editor-footer-left",children:[r&&b.jsx(mb,{files:a,onChange:M,disabled:n||e}),r&&b.jsx("div",{className:"rte-footer-divider"}),b.jsxs("div",{className:"rich-text-editor-brand",children:[!c&&s&&s.length>0&&b.jsx(fb,{options:s,onSelect:o,disabled:n||e,currentAgent:d,onOpenChange:u}),b.jsx(bb,{disabled:n||e,selectedSkill:f,onSkillSelect:h,onSkillCardClick:m,onSkillAction:v,skillListFetch:g,onSkillHeaderAction:E,showCreateSkill:N,createDisabled:A,skillPanelOpen:L,onSkillPanelOpenChange:O,skillPanelOpenDelay:S}),b.jsx(gb,{selected:I,onClick:_,disabled:n||e})]})]}),b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[b.jsxs("div",{className:"rte-brand-badge",children:[b.jsx("div",{className:"rte-brand-badge",children:b.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""})}),b.jsx("span",{className:"rte-brand-text",style:{marginLeft:"4px"},children:"SealSeek 2.0"})]}),b.jsx(yb,{currentAgent:d}),b.jsx(vb,{onClick:k,loading:t||e,disabled:n||l})]})]})});Eb.displayName="Footer";const XN=e=>e<1024?`${e}B`:e<1024*1024?`${Math.round(e/1024)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,JN=e=>(e.type?.startsWith("image/")??!1)||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||""),ZN=e=>{const t=(e||"").split(".").pop()?.toLowerCase()||"";return["xls","xla","xlb","xlc","xlm","xlsx","xlt","xlw","csv","tsv","iif"].includes(t)?"icon-a-xlsxcsv":["doc","docx","dot","odt","rtf","wiz"].includes(t)?"icon-docx":["ppt","pptx","pot","ppa","pps","pwz"].includes(t)?"icon-ppt":["txt","asm","bat","c","cc","conf","cpp","css","cxx","def","dic","eml","h","hh","in","js","ksh","php","pkl","rb","tar","tex","ts","xml"].includes(t)?"icon-txt":t==="pdf"?"icon-pdf":["html","htm","json","ics","ifb"].includes(t)?"icon-a-htmljson":t==="md"?"icon-md":"icon-lianjie"},ew=({file:e,onRemove:t})=>{const n=JN(e),l=Bf(n?e:null);return b.jsxs("div",{className:"rte-footer-file-chip",children:[n?b.jsx(ue.Image,{className:"rte-footer-file-thumb",width:32,height:32,src:l,alt:e.name,preview:{mask:null,getContainer:()=>document.body}}):b.jsx("div",{className:"rte-footer-file-icon",children:b.jsx("svg",{style:{width:"18px",height:"18px"},"aria-hidden":"true",children:b.jsx("use",{xlinkHref:`#${ZN(e.name)}`})})}),b.jsxs("div",{className:"rte-footer-file-info",children:[b.jsx("span",{className:"rte-footer-file-name",title:e.name,children:e.name}),b.jsx("span",{className:"rte-footer-file-size",children:XN(e.size)})]}),b.jsx("span",{className:"rte-footer-file-remove",onClick:r=>{r.stopPropagation(),t()},children:b.jsx("i",{className:"iconfont icon-guanbi",style:{width:"8px",height:"8px",fontSize:"8px",display:"flex",alignItems:"center"}})})]})},Tb=y.memo(({files:e,onChange:t})=>{const n=y.useRef(null),[l,r]=y.useState({showLeft:!1,showRight:!1}),a=y.useCallback(()=>{const o=n.current;o&&r({showLeft:o.scrollLeft>0,showRight:o.scrollLeft+o.clientWidth<o.scrollWidth-1})},[]);y.useLayoutEffect(()=>{a()},[e,a]);const i=y.useCallback(o=>{const u=n.current;u&&(u.scrollBy({left:o*200,behavior:"smooth"}),window.setTimeout(a,300))},[a]),s=y.useCallback(o=>()=>t(e.filter((u,c)=>c!==o)),[e,t]);return e.length===0?null:b.jsxs("div",{className:"rte-footer-files-wrapper",children:[l.showLeft&&b.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-left",children:b.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-left",onClick:()=>i(-1),children:b.jsx("svg",{style:{width:"16px",height:"16px",transform:"rotate(180deg)"},"aria-hidden":"true",children:b.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})}),b.jsx("div",{className:"rte-footer-files-list",ref:n,onScroll:a,children:e.map((o,u)=>b.jsx(ew,{file:o,onRemove:s(u)},`${o.name}-${o.size}-${u}`))}),l.showRight&&b.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-right",children:b.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-right",onClick:()=>i(1),children:b.jsx("svg",{style:{width:"16px",height:"16px"},"aria-hidden":"true",children:b.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})})]})});Tb.displayName="FooterFilesList";const Cb=9999,tw=({messageRef:e})=>{const{message:t}=ue.App.useApp();return e.current=t,null},tu=y.memo(({title:e,onClose:t,exitTip:n="点击退出技能"})=>b.jsx($n,{title:n,placement:"top",zIndex:1e4,children:b.jsx("span",{className:"tag-node group",contentEditable:!1,children:b.jsx("span",{className:"tag-label","data-tag-clickable":"true",onMouseDown:l=>{l.preventDefault(),l.stopPropagation()},onClick:l=>{l.preventDefault(),l.stopPropagation(),t()},children:e})})}));tu.displayName="SkillTag";const Sb=e=>{const{config:t,onSend:n,isProcessing:l=!1,disabled:r=!1,placeholder:a,nodeValues:i,onFilesChange:s,onFooterFilesChange:o,footerFiles:u,width:c,background:d="transparent",border:f,maxHeight:h,minHeight:m,editorMinHeight:v,editorPadding:g,className:E,videoUrlParse:N,videoUpload:A,reportAnalyze:L,reportListFetch:O,onReportGoGenerate:S,reportNameResolve:_,onViewReport:I,hideCurrentSessionReport:k,markdownAnalyze:R,markdownNameAnalyze:M,agentOptions:H,onAgentSelect:q,onAgentExit:B,onSkillAction:T,onSkillCardClick:F,onSkillHeaderAction:V,skillListFetch:$,showCreateSkill:X,createDisabled:C,skillPanelOpen:Z,onSkillPanelOpenChange:ie,skillPanelOpenDelay:D,selectedSkill:pe,onSkillSelect:Se,onAIImageClick:ke,aiImageSelected:ce,onAIImageExit:Ne,loading:Oe,hideButtons:Ae,footerPadding:nt,showFooterUpload:Ht,lockStructure:sn=!0,collapsed:ze=!1,onCollapsedChange:Rn,collapseTransitionMs:ve=260,nodeDefaults:Fe,onExpandedHeightChange:on,collapsedTotalHeight:Qt,toggleOnBlankClick:Fn=!0,getPopupContainer:Hn,scrollContainerRef:Mb,autoCollapseOnScroll:Db}=e,[Xt,Un]=y.useState({}),[Y,te]=y.useState({}),[de,me]=y.useState(u??[]),[Me,wt]=y.useState({}),[Pt,ct]=y.useState(xN),[zn,Vn]=y.useState(()=>new Set),[Xe,un]=y.useState(()=>new Set),[Tt,bw]=y.useState(()=>new Set),[Lb,Qr]=y.useState({}),[fl,mw]=y.useState(null),[gw,Pb]=y.useState(null),lu=y.useRef(null);y.useLayoutEffect(()=>{const U=lu.current?.ownerDocument??document,J=U.createElement("div");return J.className="rte-message-host",J.style.cssText="position:fixed;inset:0;z-index:2000000000;pointer-events:none;",U.body.appendChild(J),Pb(J),()=>{J.remove(),Pb(null)}},[]);const vw=y.useCallback(()=>Hn?.()??fl??document.body,[Hn,fl]),ru=y.useRef(null),[Ei,yw]=y.useState(null),Ew=y.useCallback((U,J)=>{yw(J?U:null)},[]),hl=y.useRef(null),[Tw,Cw]=y.useState(58),[pl,Bb]=y.useState(58),[au,Rb]=y.useState(!1),Fb=y.useRef(0),Hb=y.useRef(ze),[Ti,Ub]=y.useState(!1);Hb.current!==ze&&(Hb.current=ze,Fb.current=(typeof performance<"u"?performance.now():Date.now())+ve,Ub(!0)),y.useEffect(()=>{if(!Ti)return;const U=setTimeout(()=>Ub(!1),ve);return()=>clearTimeout(U)},[Ti,ze,ve]);const[bl,zb]=y.useState(""),Xr=y.useRef(null),iu=y.useRef(null),[Jr,Vb]=y.useState(0),[su,$b]=y.useState(0),ou=y.useRef(!1);y.useEffect(()=>{if(!u||u.length===de.length&&u.every((ne,le)=>{const ee=de[le];return ee&&ne.name===ee.name&&ne.size===ee.size&&ne.lastModified===ee.lastModified}))return;const J=50*1024*1024;if(u.reduce((ne,le)=>ne+le.size,0)>J){const ne=[];let le=0;for(const ee of u){if(le+ee.size>J)break;ne.push(ee),le+=ee.size}me(ne)}else ou.current=!0,me(u)},[u]);const Ct=y.useMemo(()=>SN(t,Pt,zn),[t,Pt,zn]),uu=y.useRef(null),qb=y.useRef(!1);y.useEffect(()=>{const U=t.find(J=>J.type==="tag")?.text??null;if(!qb.current){qb.current=!0,uu.current=U;return}uu.current!==U&&(uu.current=U,me(J=>J.length===0?J:[]))},[t]);const ml=y.useMemo(()=>{const U=t.find(J=>J.type==="tag")?.text;if(!(!U||!H))return H.find(J=>J.label===U)},[t,H]),cu=y.useMemo(()=>t.some(U=>U.type==="tag"),[t]),Sw=X??!cu;rN(i,Xt,Un,Ct,Y,te);const Zr=y.useRef(new Map),Wb=y.useRef(""),Yb=(t.find(U=>U.type==="tag")?.text||"")+"||"+t.filter(U=>U.key&&U.type!=="report-module"&&U.type!=="markdown-module").map(U=>`${U.type}:${U.key}`).join("|");Wb.current!==Yb&&(Wb.current=Yb,Zr.current=new Map);const[lt,ea]=y.useState(null),[Jt,Kl]=y.useState(!1);y.useEffect(()=>{pe!==void 0&&ea(pe)},[pe]),y.useEffect(()=>{ce!==void 0&&Kl(ce)},[ce]);const jb=y.useCallback(U=>{ea(U),U&&Kl(!1),Se?.(U),U&&ml&&B?.("skill-switch")},[ml,B,Se]),xw=y.useCallback(U=>{ea(null),Kl(!1),q?.(U)},[q]),kw=y.useCallback(()=>{Kl(!0),ea(null),ml&&B?.("ai-image-switch"),ke?.()},[ml,B,ke]);y.useEffect(()=>{ml&&(ea(null),Kl(!1))},[ml]);const{errors:Aw,validate:Kb,clearError:Gb}=sN(Ct),{excludedKeys:Gl,hiddenSeparatorIndexes:du,conditionalHiddenIndexes:Nw}=bN(Ct,Xt,Y),{analyzeReport:Ci,analyzeMarkdown:Qb,analyzeMarkdownName:Xb,resolveReportName:Si}=mN({reportAnalyze:L,markdownAnalyze:R,markdownNameAnalyze:M,reportNameResolve:_}),Jb=U=>typeof U!="string"?!U:U.replace(/<[^>]*>/g,"").replace(/&nbsp;/gi,"").replace(/\s/g,"").replace(/[​‌‍]/g,"").trim()==="",fu=y.useCallback((U,J)=>{Un(ne=>({...ne,[U]:J})),Gb(U);const re=/^(.+)__module_\d+$/.exec(U);if(re&&Jb(J)){const ne=re[1];Ct.find(ee=>ee.key===ne&&ee.type==="markdown-module")&&Un(ee=>{const fe={...ee,[U]:J};return Object.keys(fe).filter(ye=>ye.startsWith(`${ne}__module_`)).every(ye=>Jb(fe[ye]))&&(ct(ye=>{if(!ye.markdownModules[ne])return ye;const De={...ye.markdownModules};return delete De[ne],{...ye,markdownModules:De}}),Object.keys(fe).filter(ye=>ye.startsWith(`${ne}__module_`)).forEach(ye=>delete fe[ye]),fe[ne]=""),fe});return}if(typeof J=="string"&&J.trim()===""){const ne=Ct.find(le=>le.key===U);ne?.type==="report-url"?(ct(le=>{if(!le.reportModules[U])return le;const ee={...le.reportModules};return delete ee[U],{...le,reportModules:ee}}),Qr(le=>{if(!(U in le))return le;const ee={...le};return delete ee[U],ee})):(ne?.type==="markdown"||ne?.type==="markdown-name")&&ct(le=>{if(!le.markdownModules[U])return le;const ee={...le.markdownModules};return delete ee[U],{...le,markdownModules:ee}})}},[Gb,Ct]),ww=y.useCallback((U,J)=>{te(re=>({...re,[U]:J}))},[]),Iw=y.useCallback((U,J)=>wt(re=>({...re,[U]:J})),[]),_w=y.useCallback(U=>{Qr(J=>{if(!(U in J))return J;const re=U.match(/^(.+)_(\d+)$/);if(!re){const ge={...J};return delete ge[U],ge}const[,ne,le]=re,ee=parseInt(le,10),fe={};for(const[ge,ye]of Object.entries(J)){if(ge===U)continue;const De=ge.match(/^(.+)_(\d+)$/);if(De&&De[1]===ne){const dt=parseInt(De[2],10);dt>ee?fe[`${ne}_${dt-1}`]=ye:fe[ge]=ye}else fe[ge]=ye}return fe})},[]),Ow=y.useCallback((U,J)=>{Qr(re=>{const ne=`${U}_`,le=[];for(const fe of Object.keys(re)){if(!fe.startsWith(ne))continue;const ge=fe.slice(ne.length);/^\d+$/.test(ge)&&le.push([Number(ge),re[fe]])}if(le.length===0)return re;const ee={...re};for(const[fe]of le)delete ee[`${U}_${fe}`];for(const[fe,ge]of le){if(fe===J)continue;const ye=fe>J?fe-1:fe;ee[`${U}_${ye}`]=ge}return ee})},[]),hu=y.useCallback(async(U,J,re)=>{const ne=await Si(U,J,re);return ne.status==="success"&&Qr(le=>({...le,[U]:ne.name})),ne},[Si]),Mw=y.useCallback((U,J)=>{Ci(U,J).then(re=>{re.status==="success"&&ct(ne=>({...ne,reportModules:{...ne.reportModules,[U]:re.modules}}))})},[Ci]),pu=y.useCallback(async(U,J)=>{un(re=>{const ne=new Set(re);return ne.add(U),ne});try{const re=Si(U,J,"report-url").then(le=>{le.status==="success"&&Qr(ee=>({...ee,[U]:le.name}))}),ne=Ci(U,J).then(le=>{le.status==="success"?(ct(ee=>({...ee,reportModules:{...ee.reportModules,[U]:le.modules}})),Un(ee=>{const fe={...ee};return le.modules.forEach((ge,ye)=>{fe[`${U}__module_${ye}`]=ge.content}),fe})):le.status==="failed"&&(fu(U,""),Un(ee=>{let fe=!1;const ge={...ee};for(const ye of Object.keys(ge))ye.startsWith(`${U}__module_`)&&(delete ge[ye],fe=!0);return fe?ge:ee}))});await Promise.all([re,ne])}finally{un(re=>{if(!re.has(U))return re;const ne=new Set(re);return ne.delete(U),ne})}},[Ci,Si,fu]),Dw=y.useCallback((U,J)=>{bw(re=>{const ne=new Set(re);return J?ne.add(U):ne.delete(U),ne.size===re.size&&[...ne].every(le=>re.has(le))?re:ne})},[]);y.useEffect(()=>{if(!i||t.length===0)return;const U=t.filter(re=>re.type==="report-url"&&re.key),J=t.filter(re=>re.type==="multi-variable-select"&&re.key);if(!(U.length===0&&J.length===0)){for(const re of U){const ne=re.key,le=i[ne]??i[`${ne}__url`];if(!le||typeof le=="string"&&!le.trim())continue;const ee=Array.isArray(le)?String(le[0]??""):String(le);ee&&Zr.current.get(ne)!==ee&&(Zr.current.set(ne,ee),setTimeout(()=>{pu(ne,ee)},100))}for(const re of J){const ne=re.key,le=i[ne];!Array.isArray(le)||le.length===0||le.forEach((ee,fe)=>{const ge=typeof ee=="string"?ee.trim():"";if(!ge)return;const ye=`${ne}_${fe}`;Zr.current.get(ye)!==ge&&(Zr.current.set(ye,ge),setTimeout(()=>{hu(ye,ge,"multi-variable-select")},100))})}}},[i,t,pu,hu]);const xi=y.useCallback(async(U,J,re)=>{const le=Date.now();Vn(ee=>{const fe=new Set(ee);return fe.add(U),fe});try{const ee=await re(U,J),fe=Date.now()-le;fe<500&&await new Promise(ge=>setTimeout(ge,500-fe)),ee&&(ct(ge=>({...ge,markdownModules:{...ge.markdownModules,[U]:ee.modules}})),Un(ge=>{const ye={...ge};return ee.modules.forEach((De,dt)=>{ye[`${U}__module_${dt}`]=De.content}),ye}))}finally{Vn(ee=>{if(!ee.has(U))return ee;const fe=new Set(ee);return fe.delete(U),fe})}},[]),Lw=y.useCallback((U,J)=>xi(U,J,Qb),[xi,Qb]),Pw=y.useCallback((U,J)=>xi(U,J,Xb),[xi,Xb]);y.useEffect(()=>{s?.(Y)},[Y,s]),y.useEffect(()=>{if(ou.current){ou.current=!1;return}o?.(de)},[de,o]);const bu=y.useCallback(async()=>{if(l||r||Xe.size>0||Tt.size>0)return;const U=cu?1:lt?2:Jt?3:void 0,J=U===void 0?void 0:{...lt?{skillCode:lt.id,skillName:lt.title}:{},generateImage:U};if(t.length===0){const ee=bl.trim();if(!ee&&!de.length)return;const fe=lt?`【${lt.title}】${ee}`:ee;if(de.length){const ge=new FormData;fe&&ge.append("prompt",fe),de.forEach(ye=>ge.append("files",ye)),n(ge,fe,J)}else n(ee,fe,J);zb(""),me([]);return}if(!Kb(Xt,Y,Gl))return;const{formData:re,fullPrompt:ne,hasContent:le}=await CN({config:Ct,values:Xt,files:Y,footerFiles:de,markdownModules:Pt.markdownModules,excludedKeys:Gl,hiddenSeparatorIndexes:du});le&&(n(re,ne,J),me([]))},[t.length,bl,lt,cu,Jt,Ct,Xt,Y,de,Pt.markdownModules,l,r,Xe,Tt,Kb,n,Gl,du]),Bw=y.useCallback(U=>{U.key==="Enter"&&(U.nativeEvent.isComposing||U.keyCode===229||U.shiftKey||(U.preventDefault(),bu()))},[bu]),Rw=y.useMemo(()=>Xe.size>0||Tt.size>0?!1:t.length===0?bl.trim().length>0:iN(Ct,Xt,Y,Gl),[Xe,Tt,t.length,bl,Ct,Xt,Y,Gl]),mu=y.useCallback(()=>{const U=iu.current,J=U?.querySelector(".tag-node");if(!U||!J)return!1;const re=J.getClientRects();if(re.length===0)return!1;const ne=U.getBoundingClientRect().left,le=re[0],ee=re[re.length-1],fe=Math.max(0,ee.right-ne-2);return Vb(fe),$b(Math.max(0,Math.round(ee.top-le.top))),fe>0},[]);y.useLayoutEffect(()=>{if(!lt&&!Jt){Vb(0),$b(0);return}let U=!1,J=0,re=0;const ne=()=>{U||mu()||++re>=30||(J=requestAnimationFrame(ne))};ne();const le=iu.current;if(!le||typeof ResizeObserver>"u")return()=>{U=!0,J&&cancelAnimationFrame(J)};const ee=new ResizeObserver(()=>mu());return ee.observe(le),()=>{U=!0,J&&cancelAnimationFrame(J),ee.disconnect()}},[lt,Jt,t.length,mu]),y.useEffect(()=>{!lt&&!Jt||t.length>0||Xr.current?.focus()},[lt,Jt,t.length]);const[Fw,Zb]=y.useState(!1);y.useEffect(()=>{const U=J=>{const re=lu.current;if(!re)return;const ne=J.target;re.contains(ne)||fl&&fl.contains(ne)?Zb(!0):Zb(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[fl]);const em=y.useCallback(()=>{requestAnimationFrame(()=>{if(t.length===0){Xr.current?.focus();return}hl.current?.querySelector('textarea:not([disabled]), input:not([disabled]):not([type="hidden"]), [contenteditable="true"]')?.focus()})},[t.length]),Hw=y.useCallback(U=>{ie?.(U),U&&em()},[ie,em]);y.useLayoutEffect(()=>{const U=Xr.current;U&&(U.style.height="auto",U.style.height=`${U.scrollHeight}px`,Jr>0&&(U.style.textIndent="0px",U.offsetWidth,U.style.textIndent=`${Jr}px`))},[bl,Jr,su]);const Uw={width:c,background:d,border:f,maxHeight:h,...m&&!ze?{minHeight:m}:{},...v?{"--rte-editor-min-height":typeof v=="number"?`${v}px`:v}:{},...g?{"--rte-editor-padding":g}:{}},tm=typeof Qt=="number"?Qt:Tw,nm=ze?tm:Math.max(pl,tm),lm={maxHeight:nm,minHeight:ze?0:Ti?nm:void 0,overflow:ze||Ti?"hidden":"auto",transition:au?"none":`max-height ${ve}ms cubic-bezier(0.4, 0, 0.2, 1), min-height ${ve}ms cubic-bezier(0.4, 0, 0.2, 1)`,willChange:"max-height, min-height"},rm=y.useCallback(()=>{ze&&Fn&&Rn?.(!1),Xr.current?.focus()},[ze,Fn,Rn]),am=y.useRef(0),zw=y.useCallback(()=>{const U=hl.current,J=document.activeElement;!U||!J||!U.contains(J)||(am.current=typeof performance<"u"?performance.now():Date.now())},[]),ki=y.useCallback(()=>{const U=hl.current;if(!(!U||(typeof performance<"u"?performance.now():Date.now())<Fb.current)){if(!ze){const re=U.style.maxHeight;U.style.maxHeight="none";const ne=U.offsetHeight,le=U.scrollHeight,ee=U.parentElement;let fe=1/0;if(ee){let De=0;for(const Ai of Array.from(ee.children))Ai!==U&&(De+=Ai.offsetHeight);const dt=getComputedStyle(ee),gu=parseFloat(dt.paddingTop)+parseFloat(dt.paddingBottom);fe=Math.max(0,ee.clientHeight-De-gu)}U.style.maxHeight=re;const ge=Math.max(Math.ceil(le||0),Math.ceil(ne||0)),ye=Math.min(ge,Math.ceil(fe));ye>0&&Bb(De=>De===ye?De:ye)}try{const re=U.getBoundingClientRect(),ne=U.querySelector(".rte-config-fade")??U,le=document.createRange();le.selectNodeContents(ne);const ee=Array.from(le.getClientRects()).filter(fe=>fe.height>0);if(ee.length>0){const fe=Math.min(...ee.map(gl=>gl.top)),ge=parseFloat(getComputedStyle(U).lineHeight)||34,ye=Math.max(ge,1),De=fe+ye*.5;let dt=0;for(const gl of ee)gl.top<De&&(dt=Math.max(dt,gl.bottom));const gu=dt>0?Math.ceil(dt-re.top):0,Ai=getComputedStyle(U),$w=parseFloat(Ai.paddingTop)||0,qw=Math.ceil($w+ye),vu=Math.max(gu,qw);vu>0&&Cw(gl=>gl===vu?gl:vu)}}catch{}}},[ze]),Ql=y.useMemo(()=>Ct.filter(U=>U.key&&U.type!=="report-module"&&U.type!=="markdown-module").map(U=>`${U.type}:${U.key}`).join("|"),[Ct]),im=y.useRef(Ql);im.current!==Ql&&(im.current=Ql,ze||(Bb(Cb),Rb(!0))),y.useEffect(()=>{if(!au)return;const U=setTimeout(()=>Rb(!1),ve);return()=>clearTimeout(U)},[au,Ql,ve]),y.useLayoutEffect(()=>{const U=hl.current;if(!U||(ki(),typeof ResizeObserver>"u"))return;const J=()=>{const ee=hl.current;if(!ee)return;(typeof performance<"u"?performance.now():Date.now())-am.current<600&&ee.contains(document.activeElement)&&ee.scrollHeight>ee.clientHeight&&(ee.scrollTop=ee.scrollHeight)},re=new ResizeObserver(()=>ki());re.observe(U);const ne=U.querySelector(".rte-default-textarea, .rte-config-fade"),le=ne?new ResizeObserver(()=>{ki(),J()}):null;return ne&&le&&le.observe(ne),()=>{re.disconnect(),le?.disconnect()}},[ki,Ct,Y,de.length,Lb,ze,Ql,bl]);const sm=y.useRef(-1);y.useEffect(()=>{ze||pl<=0||pl>=Cb||sm.current!==pl&&(sm.current=pl,on?.(pl))},[pl,ze,on]);const om=y.useMemo(()=>new Set(["pdf","xla","xlb","xlc","xlm","xls","xlsx","xlt","xlw","csv","tsv","iif","doc","docx","dot","odt","rtf","pot","ppa","pps","ppt","pptx","pwz","wiz","asm","bat","c","cc","conf","cpp","css","cxx","def","dic","eml","h","hh","htm","html","ics","ifb","in","js","json","ksh","png","jpeg","jpg","gif","webp","md","php","pkl","rb","tar","tex","ts","txt","xml"]),[]),Vw=y.useCallback(U=>{const J=U.clipboardData?.files;if(!J||J.length===0||(U.preventDefault(),t.some(De=>De.type==="tag")))return;const ne=[];let le=!1;for(const De of Array.from(J)){const dt=(De.name||"").split(".").pop()?.toLowerCase()||"";om.has(dt)?ne.push(De):le=!0}if(le&&ru.current?.error("粘贴文件中含不支持的类型,已自动过滤"),ne.length===0)return;const ee=50*1024*1024,fe=de.reduce((De,dt)=>De+dt.size,0),ge=[];let ye=fe;for(const De of ne){if(ye+De.size>ee){ru.current?.error("文件总大小不能超过 50MB");break}ge.push(De),ye+=De.size}ge.length>0&&me(De=>[...ge,...De])},[om,t,de]);return b.jsx(ue.ConfigProvider,{getPopupContainer:vw,children:b.jsxs(ue.App,{component:!1,message:{getContainer:()=>gw??fl??document.body},children:[b.jsx(tw,{messageRef:ru}),b.jsxs(gf.Provider,{value:fl,children:[b.jsxs("div",{ref:lu,className:`rich-text-editor ${Ei?"rte-richtext-container-expanded":""} ${Fw?"rte-editor-selected":""} ${E??""}`,"data-component":"structured-editor",style:Uw,onPaste:Vw,children:[b.jsx(Tb,{files:de,onChange:me}),t.length===0?b.jsxs("div",{ref:hl,className:`rte-editor rte-editor-default${lt||Jt?" rte-editor-default-with-skill":""}`,style:lm,onClick:rm,children:[(lt||Jt)&&b.jsx("span",{ref:iu,className:"rte-skill-inline-tag-wrap",contentEditable:!1,children:lt?b.jsx(tu,{title:lt.title,onClose:()=>jb(null)}):b.jsx(tu,{title:"AI生图",exitTip:"点击退出 AI 生图",onClose:()=>{Kl(!1),Ne?.()}})}),b.jsx("textarea",{ref:Xr,className:"rte-default-textarea",value:bl,onChange:U=>zb(U.target.value),onKeyDown:Bw,placeholder:Jt?"请描述你想要的图片":lt?.usageInstruction||a||"",disabled:r,rows:1,style:{textIndent:Jr?`${Jr}px`:void 0,paddingTop:su?`${su}px`:void 0}})]}):b.jsx("div",{ref:hl,className:`rte-editor${Ei?" rte-richtext-fullscreen-active":""}`,style:lm,onClick:rm,onInput:zw,children:b.jsx("div",{className:"rte-config-fade",children:Ct.map((U,J)=>{if(Nw.has(J)||U.key&&Gl.has(U.key)||U.exclusionGroup==="separator"&&du.has(J)||Ei&&U.key!==Ei)return null;const re=(U.type==="report-module"||U.type==="markdown-module")&&U.key?`${U.key}__module_${U.moduleIndex??0}`:U.key;return b.jsx(rb,{node:U,value:re?Xt[re]:void 0,files:Y,onChange:fu,onFileChange:ww,thumbnails:Me,onThumbnailChange:Iw,videoUrlParse:N,videoUpload:A,onVideoParsingChange:Dw,reportListFetch:O,onReportGoGenerate:S,onViewReport:I,hideCurrentSessionReport:k,reportNames:Lb,onClearReport:_w,onResolveMultiName:hu,onAnalyzeMultiReport:Mw,onShiftReportNames:Ow,onAgentExit:B,hideAgentClose:Ae==="hideTagClose",onReportUrlParse:pu,onMarkdownParse:Lw,onMarkdownNameParse:Pw,onRichtextExpandChange:Ew,disabled:r,error:re?Aw[re]:void 0,index:J,nodeDefaults:Fe},re??`text-${J}`)})},Ql)}),b.jsx(Eb,{isProcessing:l,loading:Oe,disabled:r,sendDisabled:!Rw,showFooterUpload:Ht,footerFiles:de,onFooterFilesChange:me,agentOptions:H,onAgentSelect:xw,hideAgentButton:Ae==="hideAgent",currentAgent:ml,selectedSkill:lt,onSkillSelect:jb,onSkillCardClick:F,onSkillAction:T,skillListFetch:$,onSkillHeaderAction:V,showCreateSkill:Sw,createDisabled:C,skillPanelOpen:Z,onSkillPanelOpenChange:Hw,skillPanelOpenDelay:D,onAIImageClick:kw,aiImageSelected:Jt,onSend:bu,padding:nt})]}),b.jsx("div",{className:"rte-popup-host",ref:mw})]})]})})},xb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",nw=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],lw=({autoLoading:e,batchSize:t,loadingProgress:n,loadIcon:l,onBatchSizeChange:r,onLoadNextPage:a,onStartAutoLoad:i,onStopLoad:s})=>e&&n?b.jsxs("div",{className:"auto_load_progress",children:[l||b.jsx("img",{src:xb,alt:"自动加载",width:14,height:14}),b.jsxs("span",{children:["正在加载第",n.currentPage,"/",n.totalPages,"页"]}),b.jsx(ue.Progress,{percent:n.percentage,type:"line",size:[160,8]}),b.jsx("span",{onClick:s,className:"auto_load_stop_btn",children:"停止加载"})]}):b.jsxs("div",{className:"auto_load_container",children:[b.jsx("div",{onClick:a,className:"auto_load_next_btn",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:"加载下一页"}),b.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:[b.jsxs("div",{className:"auto_load_btn",onClick:e?void 0:i,children:[l||b.jsx("img",{src:xb,alt:"自动加载",width:14,height:14}),b.jsx("span",{children:"自动加载"})]}),b.jsx(ue.Select,{value:t,onChange:r,options:nw,disabled:e,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),rw=({current:e,loadIcon:t,pageSize:n,total:l,cachedPages:r,loadedCount:a,autoLoading:i=!1,loadingProgress:s,onChange:o,onLoadNextPage:u,onStartAutoLoad:c,onStopLoading:d})=>{const[f,h]=y.useState(5),m=Math.ceil(l/n),v=y.useMemo(()=>r.length>=m,[r,m]),g=()=>Array.from({length:m},(A,L)=>L+1).filter(A=>!r.includes(A)).slice(0,f),E=(N,A,L)=>{const O=r.includes(N);return A==="prev"||A==="next"||A==="jump-prev"||A==="jump-next"?b.jsx("div",{className:"pageBox",children:L}):b.jsxs("div",{className:"pageBox",style:{backgroundColor:e===N?"#2563EB":"#f5f5f5",color:e===N?"#fff":O?"#171717":"#a3a3a3"},children:[N,!O&&b.jsx("span",{className:"unload_spot"})]})};return b.jsxs("div",{className:"pagination_footer",children:[b.jsxs("div",{className:"pagination_leftWrap",children:[b.jsxs("span",{className:"pagination_total",children:[b.jsx(Ut.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",a,"/",l,"条数据"]}),!v&&b.jsx(lw,{loadIcon:t||void 0,autoLoading:i,batchSize:f,loadingProgress:s,disabled:!u||!c,onBatchSizeChange:h,onLoadNextPage:()=>u?.(),onStartAutoLoad:()=>{const N=g();c?.(N)},onStopLoad:()=>d?.()})]}),b.jsx(ue.Pagination,{current:e,pageSize:n,total:l,onChange:N=>o(N),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:E})]})},kb=e=>{const{loading:t,autoLoading:n,loadingProgress:l,columns:r=[],dataSource:a=[],total:i,current:s,pageSize:o,cachedPages:u,onChangePage:c,onLoadNextPage:d,onStartAutoLoad:f,onStopLoading:h,...m}=e,v=y.useRef(null),g=y.useCallback(E=>{c(E),u.includes(E)&&v.current?.scrollTo({key:`${(E-1)*o+1}`})},[u,c,o]);return b.jsxs("div",{className:"flex flex-col",children:[b.jsx(ue.Table,{ref:v,...m,columns:r,dataSource:a,pagination:!1,virtual:!0}),b.jsx(rw,{loading:t,autoLoading:n,loadingProgress:l,current:s,pageSize:o,total:i,loadedCount:a.length,cachedPages:u,onChange:g,onLoadNextPage:d,onStartAutoLoad:f,onStopLoading:h})]})};kb.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const Ab=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:l=!0,value:r,onChange:a,...i})=>{const[s,o]=y.useState(""),[u,c]=y.useState(0),[d,f]=y.useState(!1),[h,m]=y.useState(!1),[v,g]=y.useState(!1),E=y.useRef(void 0),N=y.useRef(void 0),A=y.useRef(e),L=y.useRef(u),O=y.useRef(h),S=y.useRef(s);y.useEffect(()=>{A.current=e,L.current=u,O.current=h,S.current=s});const _=y.useCallback((B,T)=>{let F=0;g(!0);const V=()=>{F<B.length?(o(B.slice(0,F+1)),F++,N.current=window.setTimeout(V,n)):(g(!1),T?.())};V()},[n]),I=y.useCallback(B=>{let T=S.current.length;const F=()=>{T>0?(o(S.current.slice(0,T-1)),T--,N.current=window.setTimeout(F,n/2)):B?.()};F()},[n]),k=y.useCallback(()=>{if(A.current.length===0||O.current)return;f(!0);const B=A.current[L.current];S.current?I(()=>{_(B,()=>{E.current=window.setTimeout(()=>{c(T=>(T+1)%A.current.length),f(!1)},2e3)})}):_(B,()=>{E.current=window.setTimeout(()=>{c(T=>(T+1)%A.current.length),f(!1)},2e3)})},[I,_]);y.useEffect(()=>(l&&e.length>0&&!h&&k(),()=>{E.current&&window.clearTimeout(E.current),N.current&&window.clearTimeout(N.current)}),[u,h,l,e.length,k]),y.useEffect(()=>{!d&&l&&e.length>0&&!h&&k()},[u,d,l,e.length,h,k]);const R=B=>{m(!0),E.current&&window.clearTimeout(E.current),N.current&&window.clearTimeout(N.current),f(!1),g(!1),i.onFocus?.(B)},M=B=>{m(!1),!r&&e.length>0&&(o(""),c(0)),i.onBlur?.(B)},H=B=>{a?.(B.target.value),i.onChange?.(B)},q=()=>h||r?t:s||t;return b.jsxs("div",{style:{position:"relative"},children:[b.jsx(ue.Input,{...i,value:r,onChange:H,onFocus:R,onBlur:M,placeholder:q(),style:{...i.style,position:"relative",zIndex:1}}),!h&&!r&&s&&b.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[b.jsx("span",{children:s}),v&&b.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),b.jsx("style",{children:`
146
+ `)){l.push({...a,text:a.text.slice(1)}),r=!1;continue}if(a.exclusionGroup==="separator"){l.push(a);continue}}l.push(a),a.type==="report-url"&&a.key&&t.reportModules[a.key]&&t.reportModules[a.key].forEach((s,o)=>{l.push({type:"report-module",key:a.key,moduleIndex:o,text:s.title,exclusionGroup:a.exclusionGroup,required:a.required})})}return l}const xN={reportModules:{},markdownModules:{}},kN={adjustX:1,adjustY:1,shiftX:!1,shiftY:!1},fb=y.memo(({options:e,onSelect:t,disabled:n,currentAgent:l,onOpenChange:r})=>{const[a,i]=y.useState(!1),s=d=>{i(d),r?.(d)},o=e.filter(d=>d.isShowNew!==1).map(d=>({key:d.key,label:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[d.icon&&b.jsx("i",{className:d.icon}),b.jsx("span",{children:d.label})]}),onClick:()=>t?.(d)})),c=`rte-agent-badge${!!l?" rte-agent-badge-selected":a?" rte-agent-badge-active":""}`;return b.jsx(ue.Dropdown,{menu:{items:o,selectedKeys:l?[String(l.key)]:[]},disabled:n,placement:"bottomLeft",autoAdjustOverflow:kN,getPopupContainer:xr,trigger:["click"],overlayClassName:"rte-agent-dropdown",onOpenChange:s,children:b.jsxs("div",{className:c,style:{cursor:e.length>0?"pointer":"default"},children:[b.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),b.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})});fb.displayName="AgentDropdown";function hb(e="width"){const t=y.useRef(null),[n,l]=y.useState(!1),r=y.useCallback(()=>{const a=t.current;a&&l(e==="height"?a.scrollHeight>a.clientHeight:a.scrollWidth>a.clientWidth)},[e]);return[t,n,r]}const AN=["全部技能","我的技能","订阅技能","系统技能"],NN=["all","mine","subscribe","system"],wN=20,IN={system:"系统技能",mine:"我的技能",subscribe:"订阅技能"},Ln="基于用户上传的抖音推广数据,智能分析高潜力商品与爆品抖音推广数据,智能分析高潜力商品与爆品商品机会",Pn=["淘宝天猫","抖音电商","市场选品","京东商城","拼多多","小红书","快手电商","视频号"],Bn="当用户需要尖锐吐槽、阴阳怪气评论、犀利差评、回怼话术或讽刺性改写时使用本技能;用户只需提供对象、场景、原话或想表达的不满,即可触发生成。",_N=[{id:"c1",title:"抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让抖音推广找潜力爆品热让",desc:Ln,tags:Pn,badge:"system",heat:"3.5",usageInstruction:Bn},{id:"c2",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"system",heat:"6.6",usageInstruction:Bn},{id:"c3",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"subscribe",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"subscribe",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",heat:"6.6",usageInstruction:Bn},{id:"c4",title:"抖音推广找潜力爆品",desc:Ln,tags:Pn,badge:"mine",heat:"6.6",usageInstruction:Bn}],ON=e=>({id:e.id,title:e.title,desc:e.desc??"",usageInstruction:e.usageInstruction,tags:e.tags??[],badge:e.badge??"system",heat:e.heat}),MN=()=>b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:b.jsx("path",{d:"M6.2 1a5.2 5.2 0 0 1 4.06 8.45l2.6 2.6a.6.6 0 0 1-.85.85l-2.6-2.6A5.2 5.2 0 1 1 6.2 1Zm0 1.2a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z",fill:"#4E5969"})}),DN=[()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M5.99358 8.85714C6.27231 8.85714 6.53962 8.97003 6.73671 9.17096C6.9338 9.37189 7.04453 9.64441 7.04453 9.92857V12.9286C7.04453 13.2127 6.9338 13.4853 6.73671 13.6862C6.53962 13.8871 6.27231 14 5.99358 14H3.05094L2.94375 13.9946C2.6849 13.9676 2.4451 13.8436 2.27076 13.6467C2.09642 13.4497 1.99994 13.1939 2 12.9286V9.92857C1.99994 9.66329 2.09642 9.40742 2.27076 9.21049C2.4451 9.01355 2.6849 8.88956 2.94375 8.8625L3.05094 8.85714H5.99358ZM11.0087 8.74571C11.0323 8.68643 11.0727 8.63567 11.1247 8.59993C11.1768 8.5642 11.2381 8.54511 11.3008 8.54511C11.3636 8.54511 11.4249 8.5642 11.477 8.59993C11.529 8.63567 11.5694 8.68643 11.593 8.74571L12.1521 10.1675C12.168 10.2079 12.1917 10.2446 12.2219 10.2753C12.252 10.3061 12.288 10.3303 12.3276 10.3464L13.8021 10.9486C13.8585 10.9716 13.9072 11.0109 13.9423 11.0615C13.9773 11.1121 13.9973 11.172 13.9997 11.234C14.0022 11.2959 13.987 11.3572 13.956 11.4106C13.9251 11.4639 13.8796 11.507 13.8252 11.5346L12.3024 12.3104C12.2369 12.3438 12.1849 12.3995 12.1553 12.4679L11.5888 13.7675C11.564 13.8242 11.5236 13.8724 11.4725 13.9062C11.4214 13.94 11.3618 13.958 11.3008 13.958C11.2399 13.958 11.1803 13.94 11.1292 13.9062C11.0781 13.8724 11.0377 13.8242 11.0129 13.7675L10.4454 12.4679C10.4158 12.3995 10.3638 12.3438 10.2982 12.3104L8.77753 11.5357C8.7231 11.5081 8.67767 11.465 8.6467 11.4117C8.61574 11.3583 8.60056 11.297 8.603 11.235C8.60545 11.1731 8.62541 11.1132 8.66047 11.0626C8.69554 11.0119 8.74422 10.9727 8.80065 10.9496L10.2751 10.3475C10.3147 10.3313 10.3507 10.3071 10.3809 10.2764C10.411 10.2456 10.4348 10.209 10.4506 10.1686L11.0097 8.74679L11.0087 8.74571ZM3.05094 12.9286H5.99358V9.92857H3.05094V12.9286ZM5.99358 2C6.57371 2 7.04453 2.48 7.04453 3.07143V6.07143C7.04453 6.35559 6.9338 6.62811 6.73671 6.82904C6.53962 7.02997 6.27231 7.14286 5.99358 7.14286H3.05094L2.94375 7.1375C2.6849 7.11044 2.4451 6.98644 2.27076 6.78951C2.09642 6.59258 1.99994 6.33671 2 6.07143V3.07143C1.99994 2.80615 2.09642 2.55028 2.27076 2.35335C2.4451 2.15641 2.6849 2.03242 2.94375 2.00536L3.05094 2H5.99358ZM12.7196 2C12.9984 2 13.2657 2.11288 13.4628 2.31381C13.6598 2.51475 13.7706 2.78727 13.7706 3.07143V6.07143C13.7706 6.35559 13.6598 6.62811 13.4628 6.82904C13.2657 7.02997 12.9984 7.14286 12.7196 7.14286H9.77698L9.66873 7.1375C9.41016 7.10996 9.17075 6.98579 8.99668 6.78893C8.8226 6.59207 8.72619 6.33647 8.72604 6.07143V3.07143C8.72596 2.80632 8.82228 2.55059 8.99641 2.35368C9.17053 2.15677 9.41007 2.03266 9.66873 2.00536L9.77698 2H12.7196ZM9.77698 6.07143H12.7196V3.07143H9.77698V6.07143ZM3.05094 6.07143H5.99358V3.07143H3.05094V6.07143Z",fill:"currentColor"})}),()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M12.6358 2.44435C12.8831 2.19815 13.2831 2.199 13.5293 2.44624C13.7755 2.69349 13.7746 3.0935 13.5274 3.33968L3.31858 13.5054C3.07133 13.7516 2.67132 13.7508 2.42513 13.5035C2.17893 13.2563 2.17977 12.8563 2.42701 12.6101L12.6358 2.44435Z",fill:"currentColor"}),b.jsx("path",{d:"M5.27212 5.97815L4.9117 7.22356C4.85382 7.42362 4.64471 7.53887 4.44466 7.48097C4.38352 7.46327 4.32785 7.43039 4.28284 7.38538C4.23783 7.34037 4.20495 7.2847 4.18726 7.22356L3.82686 5.97814C3.76198 5.75394 3.64142 5.54982 3.47639 5.38478C3.31136 5.21975 3.10723 5.09917 2.88304 5.03429L1.6376 4.67391C1.43755 4.61602 1.3223 4.40692 1.3802 4.20687C1.39789 4.14573 1.43077 4.09006 1.47578 4.04505C1.52079 4.00004 1.57646 3.96716 1.6376 3.94946L2.88303 3.58908C3.10722 3.5242 3.31135 3.40363 3.47638 3.23859C3.64141 3.07356 3.76198 2.86943 3.82686 2.64523L4.18726 1.39981C4.24514 1.19975 4.45425 1.08451 4.65429 1.1424C4.71544 1.1601 4.77111 1.19298 4.81612 1.23799C4.86112 1.283 4.89401 1.33867 4.9117 1.39981L5.27209 2.64523C5.33696 2.86943 5.45753 3.07356 5.62257 3.2386C5.7876 3.40363 5.99173 3.5242 6.21593 3.58908L7.46135 3.94946C7.66141 4.00735 7.77666 4.21646 7.71876 4.4165C7.70107 4.47764 7.66818 4.53331 7.62318 4.57832C7.57817 4.62333 7.5225 4.65621 7.46135 4.67391L6.21593 5.03429C5.99173 5.09917 5.7876 5.21974 5.62257 5.38478C5.45753 5.54981 5.33696 5.75394 5.27209 5.97814L5.27212 5.97815ZM12.4587 10.7095L12.3937 10.934C12.3494 11.0869 12.1896 11.175 12.0368 11.1308C11.99 11.1172 11.9475 11.0921 11.9131 11.0577C11.8787 11.0233 11.8536 10.9808 11.8401 10.934L11.7751 10.7095C11.7102 10.4853 11.5896 10.2811 11.4246 10.1161C11.2596 9.95108 11.0554 9.83051 10.8312 9.76564L10.6067 9.70065C10.4538 9.65642 10.3657 9.49662 10.41 9.34376C10.4235 9.29703 10.4486 9.25448 10.483 9.22009C10.5174 9.18569 10.5599 9.16056 10.6067 9.14704L10.8312 9.08206C11.0554 9.01718 11.2596 8.89661 11.4246 8.73158C11.5896 8.56655 11.7102 8.36242 11.7751 8.13823L11.8401 7.91366C11.8843 7.76078 12.0441 7.67272 12.197 7.71694C12.2437 7.73046 12.2862 7.75559 12.3206 7.78999C12.355 7.82439 12.3801 7.86693 12.3937 7.91366L12.4587 8.13823C12.5235 8.36242 12.6441 8.56655 12.8091 8.73158C12.9742 8.89661 13.1783 9.01718 13.4025 9.08206L13.6271 9.14704C13.7799 9.19129 13.868 9.35108 13.8238 9.50394C13.8102 9.55067 13.7851 9.59321 13.7507 9.62761C13.7163 9.662 13.6738 9.68713 13.6271 9.70065L13.4025 9.76564C13.1783 9.83051 12.9742 9.95108 12.8091 10.1161C12.6441 10.2811 12.5235 10.4853 12.4587 10.7095ZM8.73493 13.6947L8.66994 13.9193C8.6257 14.0722 8.46591 14.1602 8.31305 14.116C8.26632 14.1025 8.22378 14.0774 8.18938 14.043C8.15498 14.0086 8.12986 13.966 8.11634 13.9193L8.05135 13.6947C7.98647 13.4705 7.8659 13.2664 7.70087 13.1014C7.53584 12.9363 7.33171 12.8158 7.10752 12.7509L6.88295 12.6859C6.73007 12.6417 6.64201 12.4819 6.68624 12.329C6.69976 12.2823 6.72489 12.2397 6.75928 12.2054C6.79368 12.171 6.83622 12.1458 6.88295 12.1323L7.10752 12.0673C7.33171 12.0024 7.53584 11.8819 7.70087 11.7168C7.8659 11.5518 7.98647 11.3477 8.05135 11.1235L8.11634 10.8989C8.16058 10.746 8.32037 10.658 8.47323 10.7022C8.51996 10.7157 8.5625 10.7409 8.5969 10.7753C8.6313 10.8097 8.65642 10.8522 8.66994 10.8989L8.73493 11.1235C8.7998 11.3477 8.92037 11.5518 9.08541 11.7168C9.25044 11.8819 9.45456 12.0024 9.67876 12.0673L9.90333 12.1323C10.0562 12.1766 10.1443 12.3363 10.1 12.4892C10.0865 12.5359 10.0614 12.5785 10.027 12.6129C9.9926 12.6473 9.95006 12.6724 9.90333 12.6859L9.67876 12.7509C9.45456 12.8158 9.25044 12.9363 9.08541 13.1014C8.92037 13.2664 8.7998 13.4705 8.73493 13.6947Z",fill:"currentColor"})]}),()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M12.2 1.69995H3.8C3.2201 1.69995 2.75 2.17467 2.75 2.76025V13.3632C2.75 13.3754 2.75021 13.3875 2.75061 13.3996C2.76856 13.9361 3.21367 14.2996 3.68722 14.2996C3.86807 14.2996 4.05311 14.2465 4.22003 14.1298L7.39764 11.9084C7.5726 11.7858 7.78102 11.72 7.99466 11.7198C8.2083 11.7197 8.4168 11.7853 8.59191 11.9077L11.7803 14.1308C11.9471 14.2471 12.1318 14.3 12.3124 14.3C12.7861 14.3 13.2314 13.9362 13.2494 13.3996C13.2498 13.3875 13.25 13.3754 13.25 13.3632V2.76025C13.25 2.17467 12.7799 1.69995 12.2 1.69995ZM12.2 13.1434L9.19248 11.0464C8.83927 10.8001 8.42531 10.6699 7.99537 10.6699C7.56449 10.6698 7.14976 10.8005 6.79602 11.0478L3.8 13.1423V2.76025C3.8 2.75802 3.8 2.75322 3.80289 2.74995H12.1971C12.2 2.75322 12.2 2.75801 12.2 2.76025V13.1434Z",fill:"currentColor"}),b.jsx("path",{d:"M10.4117 6.27223H8.52499V4.36187C8.52499 4.07192 8.28994 3.83687 7.99999 3.83687C7.71004 3.83687 7.47499 4.07192 7.47499 4.36187V6.27223H5.58828C5.29833 6.27223 5.06328 6.50728 5.06328 6.79723V6.80751C5.06328 7.09746 5.29833 7.33251 5.58828 7.33251H7.47499V9.24287C7.47499 9.53282 7.71004 9.76787 7.99999 9.76787C8.28994 9.76787 8.52499 9.53282 8.52499 9.24287V7.33251H10.4117C10.7017 7.33251 10.9367 7.09746 10.9367 6.80751V6.79723C10.9367 6.50728 10.7017 6.27223 10.4117 6.27223Z",fill:"currentColor"})]}),()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M11.8231 2.3562H4.19204C3.60373 2.36812 3.04399 2.61212 2.63483 3.03501C2.22567 3.4579 2.00026 4.02539 2.00775 4.61377V9.14983C2.00026 9.73821 2.22567 10.3057 2.63483 10.7286C3.04399 11.1515 3.60373 11.3955 4.19204 11.4074H11.8231C12.4114 11.3955 12.9711 11.1515 13.3803 10.7286C13.7895 10.3057 14.0149 9.73821 14.0074 9.14983V4.61377C14.0149 4.02539 13.7895 3.4579 13.3803 3.03501C12.9711 2.61212 12.4114 2.36812 11.8231 2.3562ZM12.9152 9.12192C12.9176 9.26764 12.8911 9.41238 12.8375 9.54789C12.7839 9.6834 12.704 9.80701 12.6026 9.91167C12.5012 10.0163 12.3802 10.1 12.2464 10.1579C12.1127 10.2157 11.9688 10.2467 11.8231 10.249H4.19204C3.89804 10.2434 3.61817 10.1218 3.41354 9.91067C3.20891 9.6995 3.09616 9.41594 3.09989 9.12192V4.61377C3.09759 4.46822 3.12403 4.32364 3.17771 4.18833C3.23139 4.05303 3.31126 3.92964 3.41272 3.82526C3.51418 3.72088 3.63525 3.63756 3.76898 3.58006C3.90272 3.52257 4.04648 3.49204 4.19204 3.49022H11.8231C12.1165 3.49572 12.3958 3.61686 12.6004 3.82727C12.8049 4.03768 12.9181 4.32034 12.9152 4.61377V9.12192Z",fill:"currentColor"}),b.jsx("path",{d:"M11.0091 13.6431H5.01099C4.862 13.6431 4.71911 13.5839 4.61376 13.4785C4.50841 13.3732 4.44922 13.2303 4.44922 13.0813C4.44922 12.9323 4.50841 12.7894 4.61376 12.6841C4.71911 12.5787 4.862 12.5195 5.01099 12.5195H11.0091C11.1581 12.5195 11.3009 12.5787 11.4063 12.6841C11.5117 12.7894 11.5708 12.9323 11.5708 13.0813C11.5708 13.2303 11.5117 13.3732 11.4063 13.4785C11.3009 13.5839 11.1581 13.6431 11.0091 13.6431Z",fill:"currentColor"})]})],LN=()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[b.jsx("path",{d:"M14.365 4.88313C13.9832 4.88313 13.7286 5.13768 13.7286 5.51949V12.9649C13.7286 13.4104 13.4104 13.7286 12.965 13.7286H3.03771C2.59225 13.7286 2.27407 13.4104 2.27407 12.9649V3.03768C2.27407 2.59222 2.59225 2.27404 3.03771 2.27404H6.66498C7.0468 2.27404 7.30134 2.01949 7.30134 1.63768C7.30134 1.25586 7.0468 1.00131 6.66498 1.00131H3.03771C1.89225 1.00131 1.00134 1.89222 1.00134 3.03768V12.9649C1.00134 14.1104 1.89225 15.0013 3.03771 15.0013H12.965C14.1104 15.0013 15.0013 14.1104 15.0013 12.9649V5.51949C15.0013 5.20131 14.7468 4.88313 14.365 4.88313Z",fill:"#666666"}),b.jsx("path",{d:"M5.2637 7.55586C5.00916 7.30131 4.62734 7.30131 4.37279 7.55586C4.11825 7.8104 4.11825 8.19222 4.37279 8.44677L7.55461 11.6286C7.61825 11.6922 7.68188 11.7559 7.74552 11.7559C7.80916 11.8195 7.93643 11.8195 8.00007 11.8195C8.0637 11.8195 8.19098 11.8195 8.25461 11.7559C8.31825 11.6922 8.38188 11.6922 8.44552 11.6286L11.6273 8.44677C11.8819 8.19222 11.8819 7.8104 11.6273 7.55586C11.3728 7.30131 10.991 7.30131 10.7364 7.55586L8.63643 9.65586V8.00131C8.63643 4.81949 11.1819 2.27404 14.3637 2.27404C14.7455 2.27404 15.0001 2.01949 15.0001 1.63768C15.0001 1.25586 14.7455 1.00131 14.3637 1.00131C10.4819 1.00131 7.3637 4.11949 7.3637 8.00131V9.65586L5.2637 7.55586Z",fill:"#666666"})]}),PN=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b.jsx("path",{d:"M9.60187 14.5546C9.23569 14.5546 8.94275 14.4081 8.6498 14.1884C8.35686 13.8955 8.13716 13.5293 8.13716 13.0899V11.6251C6.52597 11.6251 3.88948 12.0646 2.49801 13.9687C2.2783 14.3349 1.76565 14.5546 1.32623 14.6278H1.10653C0.374166 14.4813 -0.0652517 13.8222 0.00799105 13.0899C0.374166 9.94073 1.47272 7.67041 3.37683 6.13247C4.76831 5.03394 6.3795 4.44805 8.13716 4.30157V2.9101C8.13716 2.25098 8.4301 1.66509 9.01599 1.44538C9.52864 1.29892 10.1145 1.37215 10.5539 1.81157L15.241 6.57189C15.6072 6.86484 15.8269 7.30424 15.9001 7.81689C15.9734 8.32955 15.8269 8.8422 15.4607 9.20837C15.3875 9.28161 15.3143 9.42807 15.1678 9.50132L10.6272 14.1152C10.3342 14.4081 9.96804 14.5546 9.60187 14.5546ZM8.43009 10.1604H9.60187V13.0899L14.2157 8.32955L14.289 8.25631C14.3622 8.18308 14.3622 8.0366 14.3622 7.96336C14.3622 7.81689 14.289 7.74366 14.2157 7.67041L14.1425 7.59718L9.52864 2.9101V5.69306L8.50333 5.7663C6.96539 5.7663 5.50066 6.27894 4.25567 7.23101C2.79094 8.40278 1.83889 10.3069 1.54595 12.7969C3.37683 10.5266 6.5992 10.1604 8.43009 10.1604Z",fill:"currentColor"})}),BN=()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("path",{d:"M13.85 7.35C13.4903 7.35 13.2 7.64033 13.2 8V12.3333C13.2 12.8114 12.8114 13.2 12.3333 13.2H3.66667C3.18856 13.2 2.8 12.8114 2.8 12.3333V3.66667C2.8 3.18856 3.18856 2.8 3.66667 2.8H8C8.35967 2.8 8.65 2.50967 8.65 2.15C8.65 1.79033 8.35967 1.5 8 1.5H3.23333C2.27567 1.5 1.5 2.27567 1.5 3.23333V12.7667C1.5 13.7243 2.27567 14.5 3.23333 14.5H12.7667C13.7243 14.5 14.5 13.7243 14.5 12.7667V8C14.5 7.64033 14.2097 7.35 13.85 7.35Z",fill:"currentColor"}),b.jsx("path",{d:"M5.7483 10.4682C6.00108 10.721 6.41419 10.721 6.66697 10.4682L13.7144 3.42075C13.9672 3.16797 13.9672 2.75486 13.7144 2.50208C13.4616 2.24931 13.0485 2.24931 12.7957 2.50208L5.7483 9.54808C5.49552 9.80086 5.49552 10.2154 5.7483 10.4682Z",fill:"currentColor"})]}),RN=()=>b.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("path",{d:"M4.12488 5.02012H11.8779L11.1331 12.6138C11.1164 12.7828 11.0373 12.9396 10.9114 13.0536C10.7855 13.1676 10.6217 13.2307 10.4518 13.2306H5.55096C5.38127 13.2304 5.21769 13.1672 5.09198 13.0533C4.96627 12.9393 4.88739 12.7827 4.87067 12.6138L4.12488 5.02012ZM3.80233 3.74945C3.66582 3.74934 3.53081 3.77782 3.40598 3.83306C3.28116 3.8883 3.16929 3.96908 3.07757 4.07018C2.98586 4.17128 2.91634 4.29048 2.8735 4.42008C2.83065 4.54969 2.81542 4.68683 2.8288 4.82268L3.60586 12.738C3.65342 13.2208 3.87886 13.6688 4.23837 13.9947C4.59787 14.3206 5.06573 14.5012 5.55096 14.5012H10.4518C10.9371 14.5012 11.4049 14.3206 11.7644 13.9947C12.1239 13.6688 12.3494 13.2208 12.3969 12.738L13.175 4.82268C13.1883 4.68683 13.1731 4.54969 13.1303 4.42008C13.0874 4.29048 13.0179 4.17128 12.9262 4.07018C12.8345 3.96908 12.7226 3.8883 12.5978 3.83306C12.4729 3.77782 12.3379 3.74934 12.2014 3.74945H3.80135H3.80233Z",fill:"currentColor"}),b.jsx("path",{d:"M1.5 4.28322C1.5 4.11472 1.56694 3.95312 1.68608 3.83397C1.80523 3.71482 1.96683 3.64789 2.13533 3.64789H13.8646C13.948 3.64787 14.0306 3.6643 14.1077 3.69622C14.1848 3.72814 14.2549 3.77494 14.3139 3.83394C14.3729 3.89293 14.4197 3.96298 14.4516 4.04007C14.4836 4.11715 14.5 4.19978 14.5 4.28322C14.5 4.36666 14.4836 4.44929 14.4516 4.52638C14.4197 4.60347 14.3729 4.67351 14.3139 4.73251C14.2549 4.7915 14.1848 4.8383 14.1077 4.87022C14.0306 4.90214 13.948 4.91857 13.8646 4.91855H2.13533C1.96683 4.91855 1.80523 4.85162 1.68608 4.73247C1.56694 4.61332 1.5 4.45172 1.5 4.28322Z",fill:"currentColor"}),b.jsx("path",{d:"M5.02081 3.11277C5.02081 2.22135 5.74314 1.5 6.63358 1.5H9.3704C10.2618 1.5 10.9832 2.22135 10.9832 3.11277V4.92102H5.02081V3.11277ZM6.63358 2.77067C6.58866 2.77067 6.54417 2.77952 6.50266 2.79671C6.46116 2.8139 6.42345 2.8391 6.39168 2.87087C6.35991 2.90263 6.33471 2.94035 6.31752 2.98185C6.30033 3.02336 6.29148 3.06784 6.29148 3.11277V3.65036H9.7125V3.11277C9.7125 3.06784 9.70366 3.02336 9.68646 2.98185C9.66927 2.94035 9.64407 2.90263 9.61231 2.87087C9.58054 2.8391 9.54282 2.8139 9.50132 2.79671C9.45981 2.77952 9.41533 2.77067 9.3704 2.77067H6.63358Z",fill:"currentColor"})]}),FN=()=>b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M8.87301 3.52364C9.08579 3.52364 9.28984 3.60817 9.4403 3.75862C9.59075 3.90907 9.67527 4.11313 9.67527 4.3259V11.8137C9.67527 12.0265 9.59075 12.2305 9.4403 12.381C9.28984 12.5314 9.08579 12.6159 8.87301 12.6159H2.98976C2.88441 12.6159 2.78008 12.5952 2.68275 12.5549C2.58541 12.5146 2.49697 12.4555 2.42248 12.381C2.34798 12.3065 2.28889 12.218 2.24857 12.1207C2.20825 12.0234 2.1875 11.919 2.1875 11.8137V4.3259C2.1875 4.11313 2.27202 3.90907 2.42248 3.75862C2.57293 3.60817 2.77699 3.52364 2.98976 3.52364H8.87301ZM8.60559 4.59332H3.25718V11.5463H8.60559V4.59332ZM11.0102 1.38428C11.2098 1.38415 11.4022 1.45838 11.5499 1.59248C11.6977 1.72658 11.7901 1.91092 11.8093 2.10952L11.8125 2.18654V9.40315C11.8123 9.53947 11.7601 9.67059 11.6666 9.76971C11.573 9.86884 11.4451 9.92849 11.309 9.93648C11.1729 9.94447 11.0389 9.90019 10.9344 9.8127C10.8298 9.7252 10.7627 9.60109 10.7466 9.46573L10.7428 9.40315V2.45396H5.39655C5.26555 2.45394 5.13911 2.40585 5.04121 2.3188C4.94332 2.23175 4.88078 2.1118 4.86545 1.9817L4.86171 1.91912C4.86172 1.78812 4.90982 1.66168 4.99687 1.56379C5.08392 1.46589 5.20387 1.40335 5.33397 1.38802L5.39655 1.38428H11.0102Z",fill:"currentColor"})}),HN=()=>b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M1.5548 5.88011C1.4304 5.76419 1.26586 5.70108 1.09584 5.70408C0.925831 5.70708 0.76362 5.77595 0.643383 5.89619C0.523147 6.01643 0.454274 6.17864 0.451274 6.34865C0.448274 6.51867 0.511382 6.68321 0.627302 6.80761L5.0023 11.1826C5.12535 11.3055 5.29215 11.3745 5.46605 11.3745C5.63996 11.3745 5.80676 11.3055 5.9298 11.1826L13.3673 3.74511C13.4832 3.62071 13.5463 3.45617 13.5433 3.28615C13.5403 3.11614 13.4715 2.95393 13.3512 2.83369C13.231 2.71345 13.0688 2.64458 12.8988 2.64158C12.7287 2.63858 12.5642 2.70169 12.4398 2.81761L5.46605 9.79049L1.5548 5.87923V5.88011Z",fill:"currentColor"})}),UN=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M9.60188 14.5546C9.23571 14.5546 8.94276 14.4081 8.64982 14.1884C8.35687 13.8955 8.13717 13.5293 8.13717 13.0899V11.6251C6.52599 11.6251 3.88949 12.0646 2.49803 13.9687C2.27831 14.3349 1.76566 14.5546 1.32625 14.6278H1.10654C0.374181 14.4813 -0.0652364 13.8222 0.00800631 13.0899C0.374181 9.94073 1.47273 7.67041 3.37685 6.13247C4.76833 5.03394 6.37951 4.44805 8.13717 4.30157V2.9101C8.13717 2.25098 8.43012 1.66509 9.01601 1.44538C9.52865 1.29892 10.1145 1.37215 10.5539 1.81157L15.241 6.57189C15.6072 6.86484 15.8269 7.30424 15.9002 7.81689C15.9734 8.32955 15.8269 8.8422 15.4607 9.20837C15.3875 9.28161 15.3143 9.42807 15.1678 9.50132L10.6272 14.1152C10.3342 14.4081 9.96806 14.5546 9.60188 14.5546ZM8.4301 10.1604H9.60188V13.0899L14.2157 8.32955L14.289 8.25631C14.3622 8.18308 14.3622 8.0366 14.3622 7.96336C14.3622 7.81689 14.289 7.74366 14.2157 7.67041L14.1425 7.59718L9.52865 2.9101V5.69306L8.50335 5.7663C6.9654 5.7663 5.50068 6.27894 4.25568 7.23101C2.79096 8.40278 1.83891 10.3069 1.54596 12.7969C3.37685 10.5266 6.59922 10.1604 8.4301 10.1604Z",fill:"#7C3AED"})}),zN=({code:e})=>{const{message:t}=ue.App.useApp(),[n,l]=y.useState(!1),r=async a=>{a.stopPropagation();try{await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),2e3)}catch{t.error("复制失败")}};return b.jsxs("div",{className:"rte-skill-share",onClick:a=>a.stopPropagation(),children:[b.jsxs("div",{className:"rte-skill-share-head",children:[b.jsxs("div",{className:"rte-skill-share-title",children:[b.jsx(UN,{}),b.jsx("span",{children:"分享码"})]}),b.jsx("span",{className:"rte-skill-share-hint",children:"复制后粘贴在「导入技能」即可使用"})]}),b.jsxs("div",{className:"rte-skill-share-box",children:[b.jsx("span",{className:"rte-skill-share-code",children:e}),b.jsxs("button",{type:"button",className:`rte-skill-share-copy${n?" rte-skill-share-copy-done":""}`,onClick:r,children:[n?b.jsx(HN,{}):b.jsx(FN,{}),b.jsx("span",{children:n?"已复制":"复制"})]})]})]})},VN=({card:e,selected:t,onClick:n,onShare:l,onEdit:r,onDelete:a,onUse:i,getPopupContainer:s})=>{const o=_=>_.stopPropagation(),[u,c,d]=hb(),[f,h,m]=hb("height"),[v,g]=y.useState(!1),[E,N]=y.useState(""),[A,L]=y.useState(!1),O=v||A,S=async _=>{if(g(_),!_){N("");return}try{const I=await l();N(typeof I=="string"&&I?I:`SK-${e.id}`)}catch{N(`SK-${e.id}`)}};return b.jsxs("div",{className:`rte-skill-card${t?" rte-skill-card-selected":""}${O?" rte-skill-card-pinned":""}`,onClick:n,"data-rte-skill-card":"true","aria-pressed":t,children:[b.jsxs("div",{className:"rte-skill-card-header",children:[b.jsx($n,{title:c?e.title:"",placement:"top",mouseEnterDelay:.3,getPopupContainer:s,zIndex:1e4,children:b.jsx("div",{className:"rte-skill-card-title",ref:u,onMouseEnter:d,children:e.title})}),b.jsxs("div",{className:`rte-skill-card-aside${O?" rte-skill-card-aside-pinned":""}`,children:[b.jsx("span",{className:`rte-skill-card-badge rte-skill-card-badge-${e.badge}`,children:IN[e.badge]}),b.jsxs("div",{className:`rte-skill-card-actions${O?" rte-skill-card-actions-pinned":""}`,children:[e.badge==="mine"&&b.jsx(ue.Popover,{open:v,onOpenChange:S,trigger:"click",placement:"bottomRight",arrow:!1,overlayClassName:"rte-skill-share-popover",zIndex:1e4,getPopupContainer:s,content:b.jsx(zN,{code:E}),children:b.jsx("button",{type:"button",className:`rte-skill-card-action${v?" rte-skill-card-action-active":""}`,title:"分享","aria-label":"分享",onClick:o,children:b.jsx(PN,{})})}),e.badge==="mine"&&b.jsx("button",{type:"button",className:"rte-skill-card-action",title:"编辑","aria-label":"编辑",onClick:_=>{o(_),r()},children:b.jsx(BN,{})}),e.badge!=="mine"&&b.jsx("button",{type:"button",className:"rte-skill-card-action",title:"查看详情","aria-label":"查看详情",onClick:_=>{o(_),r()},children:b.jsx("i",{className:"iconfont icon-chakanjinengxiangqing"})}),e.badge!=="system"&&b.jsx(ue.Popconfirm,{title:"删除技能后不可恢复,确认删除吗?",open:A,onOpenChange:L,okText:"确认",cancelText:"取消",placement:"bottomRight",arrow:!1,overlayClassName:"rte-skill-delete-confirm",zIndex:1e4,icon:b.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 9C1.5 4.85786 4.85786 1.5 9 1.5C13.1421 1.5 16.5 4.85786 16.5 9C16.5 13.1421 13.1421 16.5 9 16.5C4.85786 16.5 1.5 13.1421 1.5 9ZM8.25 11.25V12.75H9.75V11.25H8.25ZM9.75 10.5L9.75 5.25H8.25L8.25 10.5H9.75Z",fill:"#F53F3F"})}),okButtonProps:{danger:!0},getPopupContainer:s,onConfirm:_=>{_?.stopPropagation(),L(!1),a()},onCancel:_=>{_?.stopPropagation(),L(!1)},children:b.jsx("button",{type:"button",className:`rte-skill-card-action rte-skill-card-action-delete${A?" rte-skill-card-action-active":""}`,title:"删除","aria-label":"删除",onClick:o,children:b.jsx(RN,{})})})]})]})]}),b.jsx($n,{title:h?e.desc:"",placement:"top",mouseEnterDelay:.3,getPopupContainer:s,zIndex:1e4,children:b.jsx("div",{className:"rte-skill-card-desc",ref:f,onMouseEnter:m,children:e.desc})})]})},pb=y.memo(({selectedId:e,onSelect:t,onCardClick:n,onAction:l,skillListFetch:r,onHeaderAction:a,showCreateSkill:i=!0,createDisabled:s})=>{const{message:o}=ue.App.useApp(),[u,c]=y.useState(0),[d,f]=y.useState(r?[]:_N),[h,m]=y.useState(!1),[v,g]=y.useState(!!r),E=y.useRef(0),N=y.useCallback(()=>{g(!0),E.current=window.setTimeout(()=>{g(!1),m(!0)},300)},[]),A=y.useCallback(()=>{window.clearTimeout(E.current),g(!1),m(!1)},[]),[L,O]=y.useState(""),[S,_]=y.useState(""),I=_l(),k=I?()=>I:void 0,R=y.useRef(0),M=y.useRef(null),H=y.useRef(0),q=y.useRef(0),B=y.useCallback(()=>{const C=M.current;C&&(C.classList.add("is-scrolling"),window.clearTimeout(q.current),q.current=window.setTimeout(()=>{C.classList.remove("is-scrolling")},300))},[]);y.useEffect(()=>{const C=window.setTimeout(()=>_(L.trim()),300);return()=>window.clearTimeout(C)},[L]);const T=y.useCallback(async()=>{if(!r)return;const C=++R.current;N();try{const Z=await r({skillType:NN[u],pageIndex:1,pageSize:wN,keyword:S||void 0});if(C!==R.current)return;f(Z.map(ON))}catch{C===R.current&&o.error("技能列表加载失败")}finally{C===R.current&&A()}},[r,u,S,N,A]);y.useEffect(()=>{T()},[T]),y.useEffect(()=>{M.current?.scrollTo({top:0})},[u,S]);const[F,V]=y.useState(!1);y.useLayoutEffect(()=>{if(u===0&&!h&&d.length>0){const C=M.current;C&&(H.current=C.clientHeight),V(!1)}else!h&&d.length>0&&H.current>0?requestAnimationFrame(()=>{const C=M.current;C&&V(C.scrollHeight<H.current)}):V(!1)},[u,h,d]);const $=C=>{n?.({id:C.id,title:C.title}),t?.({id:C.id,title:C.title,desc:C.desc||void 0,usageInstruction:C.usageInstruction})},X=async C=>{try{await l?.("delete",{id:C.id,title:C.title})}catch{o.error("删除失败");return}e===C.id&&t?.(null),r?await T():f(Z=>Z.filter(ie=>ie.id!==C.id)),o.success("已删除技能")};return b.jsxs("div",{className:"rte-skill-panel",children:[b.jsxs("div",{className:"rte-skill-panel-header",children:[b.jsxs("div",{className:"rte-skill-search",children:[b.jsx("input",{className:"rte-skill-search-input",placeholder:"请输入想搜索的技能名称或描述",value:L,onChange:C=>O(C.target.value)}),b.jsx("span",{className:"rte-skill-search-icon",children:b.jsx(MN,{})})]}),b.jsxs("div",{className:"rte-skill-actions",children:[b.jsxs("button",{type:"button",className:"rte-skill-import-btn",onClick:()=>a?.("import"),children:[b.jsx(LN,{}),b.jsx("span",{children:"导入技能"})]}),i&&b.jsxs("button",{type:"button",className:`rte-skill-create-btn${s?" rte-skill-create-btn-disabled":""}`,disabled:s,onClick:()=>!s&&a?.("create"),children:[b.jsx("i",{className:"iconfont icon-jiyudangqianduihuachuangjianjineng"}),b.jsx("span",{children:"基于当前会话创建技能"})]})]})]}),b.jsxs("div",{className:"rte-skill-panel-body",children:[b.jsx("div",{className:"rte-skill-sidebar",children:AN.map((C,Z)=>{const ie=DN[Z];return b.jsxs("div",{className:`rte-skill-sidebar-item${Z===u?" rte-skill-sidebar-item-active":""}`,onClick:()=>c(Z),children:[b.jsx(ie,{}),b.jsx("span",{children:C})]},C)})}),h?b.jsx("div",{className:"rte-skill-cards-status",style:H.current?{minHeight:H.current}:void 0,children:b.jsx(ue.Spin,{})}):d.length===0?b.jsx("div",{className:"rte-skill-cards-status",style:H.current?{minHeight:H.current}:void 0,children:!v&&b.jsxs(b.Fragment,{children:[b.jsx("img",{className:"rte-skill-empty-img",src:"https://sealseek-public-read.oss-cn-hangzhou.aliyuncs.com/file/website/kongzhuangtai.svg",alt:"暂无数据"}),b.jsx("span",{className:"rte-skill-empty-text",children:"暂无技能"})]})}):b.jsxs("div",{className:"rte-skill-cards",ref:M,onScroll:B,style:u!==0&&H.current?{minHeight:H.current}:void 0,children:[d.map(C=>b.jsx(VN,{card:C,selected:e===C.id,onClick:()=>$(C),onShare:()=>l?.("share",{id:C.id,title:C.title}),onEdit:()=>l?.("edit",{id:C.id,title:C.title}),onDelete:()=>X(C),onUse:()=>t?.({id:C.id,title:C.title,desc:C.desc||void 0,usageInstruction:C.usageInstruction}),getPopupContainer:k},C.id)),F&&b.jsx("div",{className:"rte-skill-cards-end",children:"暂无更多技能~"})]})]})]})});pb.displayName="SkillPanel";const yi=4,$N=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M10.4103 0.600098C11.2711 0.600098 11.9863 1.2657 11.9863 2.1081C11.9863 2.2985 11.9479 2.4873 11.8751 2.6641L10.9119 4.9921H12.6255C13.4455 4.9921 14.1327 5.5961 14.1959 6.3817L14.2007 6.5009C14.2007 6.8905 14.0431 7.2641 13.7639 7.5433L6.28226 15.0321C6.05292 15.2576 5.74735 15.3888 5.42594 15.3999C5.10452 15.411 4.79062 15.3012 4.54626 15.0921C4.19986 14.7929 4.05346 14.3297 4.16706 13.9113L5.20146 9.4593H3.28146C2.63906 9.4593 2.09506 8.9873 2.03666 8.3649L2.03186 8.2537C2.03186 8.0993 2.06306 7.9457 2.12066 7.8073L4.67986 1.5513C4.92146 0.970498 5.50306 0.600098 6.14306 0.600098H10.4103ZM10.4103 1.8001H6.14386C5.97906 1.8001 5.83986 1.8889 5.78866 2.0105L3.23586 8.2521C3.24066 8.2521 3.24626 8.2537 3.25346 8.2553L3.28306 8.2585H5.55506C5.62866 8.2585 5.70146 8.2665 5.77186 8.2833C6.26786 8.4001 6.58466 8.8937 6.45506 9.3713L5.33506 14.1857L5.35586 14.1969C5.37426 14.2017 5.39586 14.2009 5.41266 14.1953L5.43426 14.1833L12.9151 6.6953C12.9414 6.67028 12.9625 6.64029 12.9772 6.60706C12.9919 6.57383 12.9999 6.53802 13.0007 6.5017C13.0007 6.3417 12.8415 6.1937 12.6247 6.1937H10.4887C10.3799 6.1937 10.2719 6.1745 10.1687 6.1377C10.0535 6.09806 9.94761 6.03536 9.85749 5.95342C9.76737 5.87149 9.6949 5.77204 9.64451 5.66115C9.59412 5.55026 9.56687 5.43027 9.56442 5.30849C9.56197 5.18672 9.58437 5.06572 9.63026 4.9529L10.7671 2.2049C10.7797 2.17445 10.7862 2.14184 10.7863 2.1089C10.7863 1.9481 10.6279 1.8001 10.4111 1.8001H10.4103ZM7.10386 2.6433C7.25151 2.70252 7.3696 2.81796 7.43215 2.96423C7.49471 3.1105 7.49662 3.27562 7.43746 3.4233L6.79746 5.0233C6.73604 5.16775 6.62045 5.28238 6.4755 5.34261C6.33054 5.40283 6.16775 5.40385 6.02205 5.34544C5.87635 5.28704 5.75934 5.17386 5.69612 5.03018C5.6329 4.88651 5.6285 4.72378 5.68386 4.5769L6.32386 2.9769C6.38308 2.82925 6.49852 2.71116 6.64479 2.6486C6.79106 2.58605 6.95618 2.58414 7.10386 2.6433Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.2"})}),bb=y.memo(({disabled:e,selectedSkill:t,onSkillSelect:n,onSkillCardClick:l,onSkillAction:r,skillListFetch:a,onSkillHeaderAction:i,showCreateSkill:s,skillPanelOpen:o,onSkillPanelOpenChange:u,createDisabled:c,skillPanelOpenDelay:d})=>{const[f,h]=y.useState(!1),m=o!==void 0,[v,g]=y.useState(o??!1),E=y.useRef(0);y.useEffect(()=>{if(m)return o?d&&d>0?E.current=window.setTimeout(()=>g(!0),d):g(!0):(window.clearTimeout(E.current),g(!1)),()=>window.clearTimeout(E.current)},[m,o,d]);const N=m?v:f,A=y.useCallback(T=>{const F=typeof T=="function"?T(N):T;m||h(F),u?.(F)},[m,N,u]),[L,O]=y.useState(null),S=y.useRef(null),_=y.useRef(null),I=_l(),k=y.useCallback(()=>(S.current?.closest(".rich-text-editor")??S.current)?.getBoundingClientRect()??null,[]),R=y.useCallback(()=>{const T=k();if(!T)return;const F=Math.max(0,window.innerHeight-T.bottom-yi*2),V=Math.max(0,T.top-yi*2),X=(_.current?.scrollHeight??0)>F&&V>F,C=X?V:F,ie=(_.current?.offsetParent??I)?.getBoundingClientRect(),D=ie?.left??0,pe=ie?.top??0,ge=T.left-D;if(X){const ce=(ie?.height??window.innerHeight)-(T.top-yi-pe);O({left:ge,bottom:ce,width:T.width,maxHeight:C})}else O({left:ge,top:T.bottom+yi-pe,width:T.width,maxHeight:C})},[k,I]);y.useLayoutEffect(()=>{if(!N)return;R();const T=requestAnimationFrame(R);window.addEventListener("scroll",R,!0),window.addEventListener("resize",R);const F=_.current?new ResizeObserver(R):null;F&&_.current&&F.observe(_.current);const V=S.current?.closest(".rich-text-editor"),$=V?new ResizeObserver(R):null;return $&&V&&$.observe(V),()=>{cancelAnimationFrame(T),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R),F?.disconnect(),$?.disconnect()}},[N,R]),y.useEffect(()=>{if(!N||m)return;const T=F=>{const V=F.target;S.current?.contains(V)||_.current?.contains(V)||V instanceof Element&&V.closest(".rte-skill-delete-confirm, .rte-skill-share-popover")||A(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[N,m]);const M=y.useCallback(()=>{e||A(T=>!T)},[e]),H=y.useCallback(T=>{n?.(T),T&&A(!1)},[n]),q=!!t,B=`rte-skill-badge${q?" rte-skill-badge-selected":N?" rte-skill-badge-active":""}`;return b.jsxs(b.Fragment,{children:[b.jsxs("div",{ref:S,className:B,onClick:M,"data-rte-skill-button":"true","aria-pressed":N||q,style:{cursor:e?"not-allowed":"pointer"},children:[b.jsx($N,{}),b.jsx("span",{className:"rte-skill-text",children:"技能"})]}),N&&Ni.createPortal(b.jsx("div",{ref:_,className:"rte-skill-panel-popup","data-placement":L?.bottom!==void 0?"top":"bottom",style:{position:"fixed",left:L?.left??0,top:L?.top,bottom:L?.bottom,width:L?.width,zIndex:9999,maxHeight:L?.maxHeight,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:16,visibility:L?"visible":"hidden"},children:b.jsx(pb,{selectedId:t?.id??null,onSelect:H,onCardClick:l,onAction:r,skillListFetch:a,onHeaderAction:i,showCreateSkill:s,createDisabled:c})}),I??document.body)]})});bb.displayName="SkillButton";const qN=10*1024*1024,WN=50*1024*1024,YN="图片大小不能超过 10MB",jN="文件总大小不能超过 50MB",KN=e=>e.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||""),GN=(e,t)=>{let n=!1;const l=t.filter(o=>KN(o)&&o.size>qN?(n=!0,!1):!0),r=e.reduce((o,u)=>o+u.size,0),a=[];let i=r,s=!1;for(const o of l){if(i+o.size>WN){s=!0;break}a.push(o),i+=o.size}return{accepted:a,imageOversize:n,totalExceeded:s}},mb=y.memo(({files:e,onChange:t,disabled:n})=>{const{message:l}=ue.App.useApp(),r=y.useRef(null),a=y.useCallback(s=>{const o=Array.from(s.target.files??[]);if(s.target.value="",o.length===0)return;const{accepted:u,imageOversize:c,totalExceeded:d}=GN(e,o);c&&l.error(YN),d&&l.error(jN),u.length>0&&t([...e,...u])},[e,t,l]),i=y.useCallback(()=>{n||r.current?.click()},[n]);return b.jsxs("div",{className:"rte-footer-upload",children:[b.jsx("div",{className:"rte-footer-upload-btn",onClick:i,title:"上传文件",style:{cursor:n?"not-allowed":"pointer",opacity:n?.6:1,pointerEvents:n?"none":"auto"},children:b.jsx("i",{className:"iconfont icon-lianjie",style:{fontSize:"16px"}})}),b.jsx("input",{ref:r,type:"file",multiple:!0,style:{display:"none"},onChange:a})]})});mb.displayName="UploadButton";const QN=()=>b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:b.jsx("path",{d:"M12.0699 1.36475C13.3354 1.36475 14.3603 2.39083 14.3603 3.65507V7.92055C14.3603 8.10909 14.2854 8.28992 14.152 8.42324C14.0187 8.55656 13.8379 8.63146 13.6494 8.63146C13.4608 8.63146 13.28 8.55656 13.1467 8.42324C13.0133 8.28992 12.9384 8.10909 12.9384 7.92055V3.65507C12.9384 3.42473 12.8469 3.20382 12.6841 3.04095C12.5212 2.87807 12.3003 2.78657 12.0699 2.78657H2.59111C2.36077 2.78657 2.13986 2.87807 1.97698 3.04095C1.81411 3.20382 1.72261 3.42473 1.72261 3.65507V7.68121C2.56978 6.63735 3.37666 6.10417 4.20014 6.10417C5.39447 6.10417 7.15517 7.56983 9.80806 10.5711C9.93297 10.7125 9.99659 10.8977 9.98492 11.086C9.97326 11.2743 9.88726 11.4503 9.74585 11.5752C9.67583 11.6371 9.59432 11.6845 9.50596 11.7149C9.4176 11.7452 9.32413 11.7579 9.23089 11.7521C9.04257 11.7404 8.8666 11.6544 8.74169 11.513C6.41226 8.87791 4.7902 7.52599 4.20014 7.52599C3.71198 7.52599 2.91931 8.276 1.95602 9.8329L1.72379 10.2192V12.3448C1.72379 12.8247 2.11242 13.2133 2.59229 13.2133H10.2465C10.435 13.2133 10.6158 13.2882 10.7491 13.4215C10.8825 13.5548 10.9574 13.7357 10.9574 13.9242C10.9574 14.1128 10.8825 14.2936 10.7491 14.4269C10.6158 14.5602 10.435 14.6351 10.2465 14.6351H2.59111C1.98367 14.6351 1.40112 14.3938 0.971602 13.9643C0.542083 13.5348 0.300781 12.9522 0.300781 12.3448V3.65507C0.300781 2.39083 1.32568 1.36475 2.59111 1.36475H12.0699ZM13.2074 9.58053C13.6162 9.55328 13.4242 10.5083 14.0581 11.1007C14.6908 11.6931 15.6755 11.4881 15.7003 11.9147C15.7252 12.3412 14.6956 12.269 14.16 12.827C13.6221 13.3839 13.7406 14.2145 13.301 14.2346C12.8626 14.256 13.1067 13.391 12.41 12.8081C11.7133 12.2263 10.8851 12.3886 10.8851 11.9739C10.8851 11.5592 11.7927 11.8021 12.4029 11.173C13.0131 10.5426 12.7986 9.6066 13.2086 9.58053H13.2074ZM10.0948 3.81384C10.3333 3.81384 10.5695 3.86082 10.7899 3.9521C11.0103 4.04339 11.2105 4.17718 11.3792 4.34585C11.5478 4.51451 11.6816 4.71475 11.7729 4.93512C11.8642 5.1555 11.9112 5.39169 11.9112 5.63022C11.9112 5.86875 11.8642 6.10495 11.7729 6.32532C11.6816 6.5457 11.5478 6.74593 11.3792 6.9146C11.2105 7.08327 11.0103 7.21706 10.7899 7.30834C10.5695 7.39962 10.3333 7.44661 10.0948 7.44661C9.61306 7.44661 9.15105 7.25524 8.81041 6.9146C8.46978 6.57396 8.27841 6.11196 8.27841 5.63022C8.27841 5.14849 8.46978 4.68648 8.81041 4.34585C9.15105 4.00521 9.61306 3.81384 10.0948 3.81384ZM10.0948 5.0769C10.0221 5.0769 9.95017 5.09121 9.88304 5.11902C9.81591 5.14682 9.75491 5.18758 9.70353 5.23896C9.65215 5.29034 9.61139 5.35134 9.58358 5.41847C9.55578 5.48561 9.54146 5.55756 9.54146 5.63022C9.54146 5.70289 9.55578 5.77484 9.58358 5.84197C9.61139 5.90911 9.65215 5.9701 9.70353 6.02148C9.75491 6.07287 9.81591 6.11362 9.88304 6.14143C9.95017 6.16924 10.0221 6.18355 10.0948 6.18355C10.2415 6.18355 10.3823 6.12525 10.4861 6.02148C10.5898 5.91772 10.6481 5.77697 10.6481 5.63022C10.6481 5.48347 10.5898 5.34273 10.4861 5.23896C10.3823 5.13519 10.2415 5.0769 10.0948 5.0769Z",fill:"currentColor"})}),gb=y.memo(({selected:e,onClick:t,disabled:n})=>{const l=y.useCallback(()=>{n||t?.()},[n,t]),r=`rte-ai-image-badge${e?" rte-ai-image-badge-selected":""}`;return b.jsxs("div",{className:r,onClick:l,"data-rte-ai-image-button":"true","aria-pressed":!!e,style:{cursor:n?"not-allowed":"pointer"},children:[b.jsx(QN,{}),b.jsx("span",{className:"rte-ai-image-text",children:"AI生图"})]})});gb.displayName="AIImageButton";const vb=y.memo(({onClick:e,loading:t,disabled:n})=>b.jsx("button",{type:"button",className:"rich-text-editor-send-button","data-testid":"rte-send-button",onClick:e,disabled:n||t,children:t?b.jsx("span",{className:"rte-send-spinner"}):b.jsx("i",{className:"iconfont icon-fasong"})}));vb.displayName="SendButton";const yb=y.memo(({currentAgent:e})=>{const t=e?.points;return t==null?null:b.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[b.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),b.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(t)]}),e?.labelValue===2&&b.jsx("div",{className:"rte-limited-free-badge",children:b.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]})});yb.displayName="PointsBadge";const Eb=y.memo(({isProcessing:e,loading:t,disabled:n,sendDisabled:l,showFooterUpload:r=!0,footerFiles:a,onFooterFilesChange:i,agentOptions:s,onAgentSelect:o,onAgentDropdownOpenChange:u,hideAgentButton:c,currentAgent:d,selectedSkill:f,onSkillSelect:h,onSkillCardClick:m,onSkillAction:v,skillListFetch:g,onSkillHeaderAction:E,showCreateSkill:N,createDisabled:A,skillPanelOpen:L,onSkillPanelOpenChange:O,skillPanelOpenDelay:S,onAIImageClick:_,aiImageSelected:I,onSend:k,padding:R="12px 16px"})=>{const M=y.useCallback(H=>{if(H.reduce((T,F)=>T+F.size,0)>52428800){const T=[];let F=0;for(const V of H){if(F+V.size>52428800)break;T.push(V),F+=V.size}i(T)}else i(H)},[i]);return b.jsxs("div",{className:"rich-text-editor-footer",style:{padding:R},children:[b.jsxs("div",{className:"rich-text-editor-footer-left",children:[r&&b.jsx(mb,{files:a,onChange:M,disabled:n||e}),r&&b.jsx("div",{className:"rte-footer-divider"}),b.jsxs("div",{className:"rich-text-editor-brand",children:[!c&&s&&s.length>0&&b.jsx(fb,{options:s,onSelect:o,disabled:n||e,currentAgent:d,onOpenChange:u}),b.jsx(bb,{disabled:n||e,selectedSkill:f,onSkillSelect:h,onSkillCardClick:m,onSkillAction:v,skillListFetch:g,onSkillHeaderAction:E,showCreateSkill:N,createDisabled:A,skillPanelOpen:L,onSkillPanelOpenChange:O,skillPanelOpenDelay:S}),b.jsx(gb,{selected:I,onClick:_,disabled:n||e})]})]}),b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[b.jsxs("div",{className:"rte-brand-badge",children:[b.jsx("div",{className:"rte-brand-badge",children:b.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""})}),b.jsx("span",{className:"rte-brand-text",style:{marginLeft:"4px"},children:"SealSeek 2.0"})]}),b.jsx(yb,{currentAgent:d}),b.jsx(vb,{onClick:k,loading:t||e,disabled:n||l})]})]})});Eb.displayName="Footer";const XN=e=>e<1024?`${e}B`:e<1024*1024?`${Math.round(e/1024)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,JN=e=>(e.type?.startsWith("image/")??!1)||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||""),ZN=e=>{const t=(e||"").split(".").pop()?.toLowerCase()||"";return["xls","xla","xlb","xlc","xlm","xlsx","xlt","xlw","csv","tsv","iif"].includes(t)?"icon-a-xlsxcsv":["doc","docx","dot","odt","rtf","wiz"].includes(t)?"icon-docx":["ppt","pptx","pot","ppa","pps","pwz"].includes(t)?"icon-ppt":["txt","asm","bat","c","cc","conf","cpp","css","cxx","def","dic","eml","h","hh","in","js","ksh","php","pkl","rb","tar","tex","ts","xml"].includes(t)?"icon-txt":t==="pdf"?"icon-pdf":["html","htm","json","ics","ifb"].includes(t)?"icon-a-htmljson":t==="md"?"icon-md":"icon-lianjie"},ew=({file:e,onRemove:t})=>{const n=JN(e),l=Bf(n?e:null);return b.jsxs("div",{className:"rte-footer-file-chip",children:[n?b.jsx(ue.Image,{className:"rte-footer-file-thumb",width:32,height:32,src:l,alt:e.name,preview:{mask:null,getContainer:()=>document.body}}):b.jsx("div",{className:"rte-footer-file-icon",children:b.jsx("svg",{style:{width:"18px",height:"18px"},"aria-hidden":"true",children:b.jsx("use",{xlinkHref:`#${ZN(e.name)}`})})}),b.jsxs("div",{className:"rte-footer-file-info",children:[b.jsx("span",{className:"rte-footer-file-name",title:e.name,children:e.name}),b.jsx("span",{className:"rte-footer-file-size",children:XN(e.size)})]}),b.jsx("span",{className:"rte-footer-file-remove",onClick:r=>{r.stopPropagation(),t()},children:b.jsx("i",{className:"iconfont icon-guanbi",style:{width:"8px",height:"8px",fontSize:"8px",display:"flex",alignItems:"center"}})})]})},Tb=y.memo(({files:e,onChange:t})=>{const n=y.useRef(null),[l,r]=y.useState({showLeft:!1,showRight:!1}),a=y.useCallback(()=>{const o=n.current;o&&r({showLeft:o.scrollLeft>0,showRight:o.scrollLeft+o.clientWidth<o.scrollWidth-1})},[]);y.useLayoutEffect(()=>{a()},[e,a]);const i=y.useCallback(o=>{const u=n.current;u&&(u.scrollBy({left:o*200,behavior:"smooth"}),window.setTimeout(a,300))},[a]),s=y.useCallback(o=>()=>t(e.filter((u,c)=>c!==o)),[e,t]);return e.length===0?null:b.jsxs("div",{className:"rte-footer-files-wrapper",children:[l.showLeft&&b.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-left",children:b.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-left",onClick:()=>i(-1),children:b.jsx("svg",{style:{width:"16px",height:"16px",transform:"rotate(180deg)"},"aria-hidden":"true",children:b.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})}),b.jsx("div",{className:"rte-footer-files-list",ref:n,onScroll:a,children:e.map((o,u)=>b.jsx(ew,{file:o,onRemove:s(u)},`${o.name}-${o.size}-${u}`))}),l.showRight&&b.jsx("div",{className:"rte-footer-files-mask rte-footer-files-mask-right",children:b.jsx("span",{className:"rte-footer-files-arrow rte-footer-files-arrow-right",onClick:()=>i(1),children:b.jsx("svg",{style:{width:"16px",height:"16px"},"aria-hidden":"true",children:b.jsx("use",{xlinkHref:"#icon-fanhuijiantou"})})})})]})});Tb.displayName="FooterFilesList";const Cb=9999,tw=({messageRef:e})=>{const{message:t}=ue.App.useApp();return e.current=t,null},tu=y.memo(({title:e,onClose:t,exitTip:n="点击退出技能"})=>b.jsx($n,{title:n,placement:"top",zIndex:1e4,children:b.jsx("span",{className:"tag-node group",contentEditable:!1,children:b.jsx("span",{className:"tag-label","data-tag-clickable":"true",onMouseDown:l=>{l.preventDefault(),l.stopPropagation()},onClick:l=>{l.preventDefault(),l.stopPropagation(),t()},children:e})})}));tu.displayName="SkillTag";const Sb=e=>{const{config:t,onSend:n,isProcessing:l=!1,disabled:r=!1,placeholder:a,nodeValues:i,onFilesChange:s,onFooterFilesChange:o,footerFiles:u,width:c,background:d="transparent",border:f,maxHeight:h,minHeight:m,editorMinHeight:v,editorPadding:g,className:E,videoUrlParse:N,videoUpload:A,reportAnalyze:L,reportListFetch:O,onReportGoGenerate:S,reportNameResolve:_,onViewReport:I,hideCurrentSessionReport:k,markdownAnalyze:R,markdownNameAnalyze:M,agentOptions:H,onAgentSelect:q,onAgentExit:B,onSkillAction:T,onSkillCardClick:F,onSkillHeaderAction:V,skillListFetch:$,showCreateSkill:X,createDisabled:C,skillPanelOpen:Z,onSkillPanelOpenChange:ie,skillPanelOpenDelay:D,selectedSkill:pe,onSkillSelect:ge,onAIImageClick:ke,aiImageSelected:ce,onAIImageExit:Ne,loading:Oe,hideButtons:Ae,footerPadding:nt,showFooterUpload:Ht,lockStructure:sn=!0,collapsed:ze=!1,onCollapsedChange:Rn,collapseTransitionMs:ye=260,nodeDefaults:Fe,onExpandedHeightChange:on,collapsedTotalHeight:Qt,toggleOnBlankClick:Fn=!0,getPopupContainer:Hn,scrollContainerRef:Mb,autoCollapseOnScroll:Db}=e,[Xt,Un]=y.useState({}),[Y,te]=y.useState({}),[de,me]=y.useState(u??[]),[Me,wt]=y.useState({}),[Pt,ct]=y.useState(xN),[zn,Vn]=y.useState(()=>new Set),[Xe,un]=y.useState(()=>new Set),[Tt,bw]=y.useState(()=>new Set),[Lb,Qr]=y.useState({}),[fl,mw]=y.useState(null),[gw,Pb]=y.useState(null),lu=y.useRef(null);y.useLayoutEffect(()=>{const U=lu.current?.ownerDocument??document,J=U.createElement("div");return J.className="rte-message-host",J.style.cssText="position:fixed;inset:0;z-index:2000000000;pointer-events:none;",U.body.appendChild(J),Pb(J),()=>{J.remove(),Pb(null)}},[]);const vw=y.useCallback(()=>Hn?.()??fl??document.body,[Hn,fl]),ru=y.useRef(null),[Ei,yw]=y.useState(null),Ew=y.useCallback((U,J)=>{yw(J?U:null)},[]),hl=y.useRef(null),[Tw,Cw]=y.useState(58),[pl,Bb]=y.useState(58),[au,Rb]=y.useState(!1),Fb=y.useRef(0),Hb=y.useRef(ze),[Ti,Ub]=y.useState(!1);Hb.current!==ze&&(Hb.current=ze,Fb.current=(typeof performance<"u"?performance.now():Date.now())+ye,Ub(!0)),y.useEffect(()=>{if(!Ti)return;const U=setTimeout(()=>Ub(!1),ye);return()=>clearTimeout(U)},[Ti,ze,ye]);const[bl,zb]=y.useState(""),Xr=y.useRef(null),iu=y.useRef(null),[Jr,Vb]=y.useState(0),[su,$b]=y.useState(0),ou=y.useRef(!1);y.useEffect(()=>{if(!u||u.length===de.length&&u.every((ne,le)=>{const ee=de[le];return ee&&ne.name===ee.name&&ne.size===ee.size&&ne.lastModified===ee.lastModified}))return;const J=50*1024*1024;if(u.reduce((ne,le)=>ne+le.size,0)>J){const ne=[];let le=0;for(const ee of u){if(le+ee.size>J)break;ne.push(ee),le+=ee.size}me(ne)}else ou.current=!0,me(u)},[u]);const Ct=y.useMemo(()=>SN(t,Pt,zn),[t,Pt,zn]),uu=y.useRef(null),qb=y.useRef(!1);y.useEffect(()=>{const U=t.find(J=>J.type==="tag")?.text??null;if(!qb.current){qb.current=!0,uu.current=U;return}uu.current!==U&&(uu.current=U,me(J=>J.length===0?J:[]))},[t]);const ml=y.useMemo(()=>{const U=t.find(J=>J.type==="tag")?.text;if(!(!U||!H))return H.find(J=>J.label===U)},[t,H]),cu=y.useMemo(()=>t.some(U=>U.type==="tag"),[t]),Sw=X??!cu;rN(i,Xt,Un,Ct,Y,te);const Zr=y.useRef(new Map),Wb=y.useRef(""),Yb=(t.find(U=>U.type==="tag")?.text||"")+"||"+t.filter(U=>U.key&&U.type!=="report-module"&&U.type!=="markdown-module").map(U=>`${U.type}:${U.key}`).join("|");Wb.current!==Yb&&(Wb.current=Yb,Zr.current=new Map);const[lt,ea]=y.useState(null),[Jt,Kl]=y.useState(!1);y.useEffect(()=>{pe!==void 0&&ea(pe)},[pe]),y.useEffect(()=>{ce!==void 0&&Kl(ce)},[ce]);const jb=y.useCallback(U=>{ea(U),U&&Kl(!1),ge?.(U),U&&ml&&B?.("skill-switch")},[ml,B,ge]),xw=y.useCallback(U=>{ea(null),Kl(!1),ge?.(null),q?.(U)},[q,ge]),kw=y.useCallback(()=>{Kl(!0),ea(null),ge?.(null),ml&&B?.("ai-image-switch"),ke?.()},[ml,B,ke,ge]);y.useEffect(()=>{ml&&(ea(null),Kl(!1))},[ml]);const{errors:Aw,validate:Kb,clearError:Gb}=sN(Ct),{excludedKeys:Gl,hiddenSeparatorIndexes:du,conditionalHiddenIndexes:Nw}=bN(Ct,Xt,Y),{analyzeReport:Ci,analyzeMarkdown:Qb,analyzeMarkdownName:Xb,resolveReportName:Si}=mN({reportAnalyze:L,markdownAnalyze:R,markdownNameAnalyze:M,reportNameResolve:_}),Jb=U=>typeof U!="string"?!U:U.replace(/<[^>]*>/g,"").replace(/&nbsp;/gi,"").replace(/\s/g,"").replace(/[​‌‍]/g,"").trim()==="",fu=y.useCallback((U,J)=>{Un(ne=>({...ne,[U]:J})),Gb(U);const re=/^(.+)__module_\d+$/.exec(U);if(re&&Jb(J)){const ne=re[1];Ct.find(ee=>ee.key===ne&&ee.type==="markdown-module")&&Un(ee=>{const fe={...ee,[U]:J};return Object.keys(fe).filter(Ee=>Ee.startsWith(`${ne}__module_`)).every(Ee=>Jb(fe[Ee]))&&(ct(Ee=>{if(!Ee.markdownModules[ne])return Ee;const De={...Ee.markdownModules};return delete De[ne],{...Ee,markdownModules:De}}),Object.keys(fe).filter(Ee=>Ee.startsWith(`${ne}__module_`)).forEach(Ee=>delete fe[Ee]),fe[ne]=""),fe});return}if(typeof J=="string"&&J.trim()===""){const ne=Ct.find(le=>le.key===U);ne?.type==="report-url"?(ct(le=>{if(!le.reportModules[U])return le;const ee={...le.reportModules};return delete ee[U],{...le,reportModules:ee}}),Qr(le=>{if(!(U in le))return le;const ee={...le};return delete ee[U],ee})):(ne?.type==="markdown"||ne?.type==="markdown-name")&&ct(le=>{if(!le.markdownModules[U])return le;const ee={...le.markdownModules};return delete ee[U],{...le,markdownModules:ee}})}},[Gb,Ct]),ww=y.useCallback((U,J)=>{te(re=>({...re,[U]:J}))},[]),Iw=y.useCallback((U,J)=>wt(re=>({...re,[U]:J})),[]),_w=y.useCallback(U=>{Qr(J=>{if(!(U in J))return J;const re=U.match(/^(.+)_(\d+)$/);if(!re){const ve={...J};return delete ve[U],ve}const[,ne,le]=re,ee=parseInt(le,10),fe={};for(const[ve,Ee]of Object.entries(J)){if(ve===U)continue;const De=ve.match(/^(.+)_(\d+)$/);if(De&&De[1]===ne){const dt=parseInt(De[2],10);dt>ee?fe[`${ne}_${dt-1}`]=Ee:fe[ve]=Ee}else fe[ve]=Ee}return fe})},[]),Ow=y.useCallback((U,J)=>{Qr(re=>{const ne=`${U}_`,le=[];for(const fe of Object.keys(re)){if(!fe.startsWith(ne))continue;const ve=fe.slice(ne.length);/^\d+$/.test(ve)&&le.push([Number(ve),re[fe]])}if(le.length===0)return re;const ee={...re};for(const[fe]of le)delete ee[`${U}_${fe}`];for(const[fe,ve]of le){if(fe===J)continue;const Ee=fe>J?fe-1:fe;ee[`${U}_${Ee}`]=ve}return ee})},[]),hu=y.useCallback(async(U,J,re)=>{const ne=await Si(U,J,re);return ne.status==="success"&&Qr(le=>({...le,[U]:ne.name})),ne},[Si]),Mw=y.useCallback((U,J)=>{Ci(U,J).then(re=>{re.status==="success"&&ct(ne=>({...ne,reportModules:{...ne.reportModules,[U]:re.modules}}))})},[Ci]),pu=y.useCallback(async(U,J)=>{un(re=>{const ne=new Set(re);return ne.add(U),ne});try{const re=Si(U,J,"report-url").then(le=>{le.status==="success"&&Qr(ee=>({...ee,[U]:le.name}))}),ne=Ci(U,J).then(le=>{le.status==="success"?(ct(ee=>({...ee,reportModules:{...ee.reportModules,[U]:le.modules}})),Un(ee=>{const fe={...ee};return le.modules.forEach((ve,Ee)=>{fe[`${U}__module_${Ee}`]=ve.content}),fe})):le.status==="failed"&&(fu(U,""),Un(ee=>{let fe=!1;const ve={...ee};for(const Ee of Object.keys(ve))Ee.startsWith(`${U}__module_`)&&(delete ve[Ee],fe=!0);return fe?ve:ee}))});await Promise.all([re,ne])}finally{un(re=>{if(!re.has(U))return re;const ne=new Set(re);return ne.delete(U),ne})}},[Ci,Si,fu]),Dw=y.useCallback((U,J)=>{bw(re=>{const ne=new Set(re);return J?ne.add(U):ne.delete(U),ne.size===re.size&&[...ne].every(le=>re.has(le))?re:ne})},[]);y.useEffect(()=>{if(!i||t.length===0)return;const U=t.filter(re=>re.type==="report-url"&&re.key),J=t.filter(re=>re.type==="multi-variable-select"&&re.key);if(!(U.length===0&&J.length===0)){for(const re of U){const ne=re.key,le=i[ne]??i[`${ne}__url`];if(!le||typeof le=="string"&&!le.trim())continue;const ee=Array.isArray(le)?String(le[0]??""):String(le);ee&&Zr.current.get(ne)!==ee&&(Zr.current.set(ne,ee),setTimeout(()=>{pu(ne,ee)},100))}for(const re of J){const ne=re.key,le=i[ne];!Array.isArray(le)||le.length===0||le.forEach((ee,fe)=>{const ve=typeof ee=="string"?ee.trim():"";if(!ve)return;const Ee=`${ne}_${fe}`;Zr.current.get(Ee)!==ve&&(Zr.current.set(Ee,ve),setTimeout(()=>{hu(Ee,ve,"multi-variable-select")},100))})}}},[i,t,pu,hu]);const xi=y.useCallback(async(U,J,re)=>{const le=Date.now();Vn(ee=>{const fe=new Set(ee);return fe.add(U),fe});try{const ee=await re(U,J),fe=Date.now()-le;fe<500&&await new Promise(ve=>setTimeout(ve,500-fe)),ee&&(ct(ve=>({...ve,markdownModules:{...ve.markdownModules,[U]:ee.modules}})),Un(ve=>{const Ee={...ve};return ee.modules.forEach((De,dt)=>{Ee[`${U}__module_${dt}`]=De.content}),Ee}))}finally{Vn(ee=>{if(!ee.has(U))return ee;const fe=new Set(ee);return fe.delete(U),fe})}},[]),Lw=y.useCallback((U,J)=>xi(U,J,Qb),[xi,Qb]),Pw=y.useCallback((U,J)=>xi(U,J,Xb),[xi,Xb]);y.useEffect(()=>{s?.(Y)},[Y,s]),y.useEffect(()=>{if(ou.current){ou.current=!1;return}o?.(de)},[de,o]);const bu=y.useCallback(async()=>{if(l||r||Xe.size>0||Tt.size>0)return;const U=cu?1:lt?2:Jt?3:void 0,J=U===void 0?void 0:{...lt?{skillCode:lt.id,skillName:lt.title}:{},generateImage:U};if(t.length===0){const ee=bl.trim();if(!ee&&!de.length)return;const fe=lt?`【${lt.title}】${ee}`:ee;if(de.length){const ve=new FormData;fe&&ve.append("prompt",fe),de.forEach(Ee=>ve.append("files",Ee)),n(ve,fe,J)}else n(ee,fe,J);zb(""),me([]);return}if(!Kb(Xt,Y,Gl))return;const{formData:re,fullPrompt:ne,hasContent:le}=await CN({config:Ct,values:Xt,files:Y,footerFiles:de,markdownModules:Pt.markdownModules,excludedKeys:Gl,hiddenSeparatorIndexes:du});le&&(n(re,ne,J),me([]))},[t.length,bl,lt,cu,Jt,Ct,Xt,Y,de,Pt.markdownModules,l,r,Xe,Tt,Kb,n,Gl,du]),Bw=y.useCallback(U=>{U.key==="Enter"&&(U.nativeEvent.isComposing||U.keyCode===229||U.shiftKey||(U.preventDefault(),bu()))},[bu]),Rw=y.useMemo(()=>Xe.size>0||Tt.size>0?!1:t.length===0?bl.trim().length>0:iN(Ct,Xt,Y,Gl),[Xe,Tt,t.length,bl,Ct,Xt,Y,Gl]),mu=y.useCallback(()=>{const U=iu.current,J=U?.querySelector(".tag-node");if(!U||!J)return!1;const re=J.getClientRects();if(re.length===0)return!1;const ne=U.getBoundingClientRect().left,le=re[0],ee=re[re.length-1],fe=Math.max(0,ee.right-ne-2);return Vb(fe),$b(Math.max(0,Math.round(ee.top-le.top))),fe>0},[]);y.useLayoutEffect(()=>{if(!lt&&!Jt){Vb(0),$b(0);return}let U=!1,J=0,re=0;const ne=()=>{U||mu()||++re>=30||(J=requestAnimationFrame(ne))};ne();const le=iu.current;if(!le||typeof ResizeObserver>"u")return()=>{U=!0,J&&cancelAnimationFrame(J)};const ee=new ResizeObserver(()=>mu());return ee.observe(le),()=>{U=!0,J&&cancelAnimationFrame(J),ee.disconnect()}},[lt,Jt,t.length,mu]),y.useEffect(()=>{!lt&&!Jt||t.length>0||Xr.current?.focus()},[lt,Jt,t.length]);const[Fw,Zb]=y.useState(!1);y.useEffect(()=>{const U=J=>{const re=lu.current;if(!re)return;const ne=J.target;re.contains(ne)||fl&&fl.contains(ne)?Zb(!0):Zb(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[fl]);const em=y.useCallback(()=>{requestAnimationFrame(()=>{if(t.length===0){Xr.current?.focus();return}hl.current?.querySelector('textarea:not([disabled]), input:not([disabled]):not([type="hidden"]), [contenteditable="true"]')?.focus()})},[t.length]),Hw=y.useCallback(U=>{ie?.(U),U&&em()},[ie,em]);y.useLayoutEffect(()=>{const U=Xr.current;U&&(U.style.height="auto",U.style.height=`${U.scrollHeight}px`,Jr>0&&(U.style.textIndent="0px",U.offsetWidth,U.style.textIndent=`${Jr}px`))},[bl,Jr,su]);const Uw={width:c,background:d,border:f,maxHeight:h,...m&&!ze?{minHeight:m}:{},...v?{"--rte-editor-min-height":typeof v=="number"?`${v}px`:v}:{},...g?{"--rte-editor-padding":g}:{}},tm=typeof Qt=="number"?Qt:Tw,nm=ze?tm:Math.max(pl,tm),lm={maxHeight:nm,minHeight:ze?0:Ti?nm:void 0,overflow:ze||Ti?"hidden":"auto",transition:au?"none":`max-height ${ye}ms cubic-bezier(0.4, 0, 0.2, 1), min-height ${ye}ms cubic-bezier(0.4, 0, 0.2, 1)`,willChange:"max-height, min-height"},rm=y.useCallback(()=>{ze&&Fn&&Rn?.(!1),Xr.current?.focus()},[ze,Fn,Rn]),am=y.useRef(0),zw=y.useCallback(()=>{const U=hl.current,J=document.activeElement;!U||!J||!U.contains(J)||(am.current=typeof performance<"u"?performance.now():Date.now())},[]),ki=y.useCallback(()=>{const U=hl.current;if(!(!U||(typeof performance<"u"?performance.now():Date.now())<Fb.current)){if(!ze){const re=U.style.maxHeight;U.style.maxHeight="none";const ne=U.offsetHeight,le=U.scrollHeight,ee=U.parentElement;let fe=1/0;if(ee){let De=0;for(const Ai of Array.from(ee.children))Ai!==U&&(De+=Ai.offsetHeight);const dt=getComputedStyle(ee),gu=parseFloat(dt.paddingTop)+parseFloat(dt.paddingBottom);fe=Math.max(0,ee.clientHeight-De-gu)}U.style.maxHeight=re;const ve=Math.max(Math.ceil(le||0),Math.ceil(ne||0)),Ee=Math.min(ve,Math.ceil(fe));Ee>0&&Bb(De=>De===Ee?De:Ee)}try{const re=U.getBoundingClientRect(),ne=U.querySelector(".rte-config-fade")??U,le=document.createRange();le.selectNodeContents(ne);const ee=Array.from(le.getClientRects()).filter(fe=>fe.height>0);if(ee.length>0){const fe=Math.min(...ee.map(gl=>gl.top)),ve=parseFloat(getComputedStyle(U).lineHeight)||34,Ee=Math.max(ve,1),De=fe+Ee*.5;let dt=0;for(const gl of ee)gl.top<De&&(dt=Math.max(dt,gl.bottom));const gu=dt>0?Math.ceil(dt-re.top):0,Ai=getComputedStyle(U),$w=parseFloat(Ai.paddingTop)||0,qw=Math.ceil($w+Ee),vu=Math.max(gu,qw);vu>0&&Cw(gl=>gl===vu?gl:vu)}}catch{}}},[ze]),Ql=y.useMemo(()=>Ct.filter(U=>U.key&&U.type!=="report-module"&&U.type!=="markdown-module").map(U=>`${U.type}:${U.key}`).join("|"),[Ct]),im=y.useRef(Ql);im.current!==Ql&&(im.current=Ql,ze||(Bb(Cb),Rb(!0))),y.useEffect(()=>{if(!au)return;const U=setTimeout(()=>Rb(!1),ye);return()=>clearTimeout(U)},[au,Ql,ye]),y.useLayoutEffect(()=>{const U=hl.current;if(!U||(ki(),typeof ResizeObserver>"u"))return;const J=()=>{const ee=hl.current;if(!ee)return;(typeof performance<"u"?performance.now():Date.now())-am.current<600&&ee.contains(document.activeElement)&&ee.scrollHeight>ee.clientHeight&&(ee.scrollTop=ee.scrollHeight)},re=new ResizeObserver(()=>ki());re.observe(U);const ne=U.querySelector(".rte-default-textarea, .rte-config-fade"),le=ne?new ResizeObserver(()=>{ki(),J()}):null;return ne&&le&&le.observe(ne),()=>{re.disconnect(),le?.disconnect()}},[ki,Ct,Y,de.length,Lb,ze,Ql,bl]);const sm=y.useRef(-1);y.useEffect(()=>{ze||pl<=0||pl>=Cb||sm.current!==pl&&(sm.current=pl,on?.(pl))},[pl,ze,on]);const om=y.useMemo(()=>new Set(["pdf","xla","xlb","xlc","xlm","xls","xlsx","xlt","xlw","csv","tsv","iif","doc","docx","dot","odt","rtf","pot","ppa","pps","ppt","pptx","pwz","wiz","asm","bat","c","cc","conf","cpp","css","cxx","def","dic","eml","h","hh","htm","html","ics","ifb","in","js","json","ksh","png","jpeg","jpg","gif","webp","md","php","pkl","rb","tar","tex","ts","txt","xml"]),[]),Vw=y.useCallback(U=>{const J=U.clipboardData?.files;if(!J||J.length===0||(U.preventDefault(),t.some(De=>De.type==="tag")))return;const ne=[];let le=!1;for(const De of Array.from(J)){const dt=(De.name||"").split(".").pop()?.toLowerCase()||"";om.has(dt)?ne.push(De):le=!0}if(le&&ru.current?.error("粘贴文件中含不支持的类型,已自动过滤"),ne.length===0)return;const ee=50*1024*1024,fe=de.reduce((De,dt)=>De+dt.size,0),ve=[];let Ee=fe;for(const De of ne){if(Ee+De.size>ee){ru.current?.error("文件总大小不能超过 50MB");break}ve.push(De),Ee+=De.size}ve.length>0&&me(De=>[...ve,...De])},[om,t,de]);return b.jsx(ue.ConfigProvider,{getPopupContainer:vw,children:b.jsxs(ue.App,{component:!1,message:{getContainer:()=>gw??fl??document.body},children:[b.jsx(tw,{messageRef:ru}),b.jsxs(gf.Provider,{value:fl,children:[b.jsxs("div",{ref:lu,className:`rich-text-editor ${Ei?"rte-richtext-container-expanded":""} ${Fw?"rte-editor-selected":""} ${E??""}`,"data-component":"structured-editor",style:Uw,onPaste:Vw,children:[b.jsx(Tb,{files:de,onChange:me}),t.length===0?b.jsxs("div",{ref:hl,className:`rte-editor rte-editor-default${lt||Jt?" rte-editor-default-with-skill":""}`,style:lm,onClick:rm,children:[(lt||Jt)&&b.jsx("span",{ref:iu,className:"rte-skill-inline-tag-wrap",contentEditable:!1,children:lt?b.jsx(tu,{title:lt.title,onClose:()=>jb(null)}):b.jsx(tu,{title:"AI生图",exitTip:"点击退出 AI 生图",onClose:()=>{Kl(!1),Ne?.()}})}),b.jsx("textarea",{ref:Xr,className:"rte-default-textarea",value:bl,onChange:U=>zb(U.target.value),onKeyDown:Bw,placeholder:Jt?"请描述你想要的图片":lt?.usageInstruction||a||"",disabled:r,rows:1,style:{textIndent:Jr?`${Jr}px`:void 0,paddingTop:su?`${su}px`:void 0}})]}):b.jsx("div",{ref:hl,className:`rte-editor${Ei?" rte-richtext-fullscreen-active":""}`,style:lm,onClick:rm,onInput:zw,children:b.jsx("div",{className:"rte-config-fade",children:Ct.map((U,J)=>{if(Nw.has(J)||U.key&&Gl.has(U.key)||U.exclusionGroup==="separator"&&du.has(J)||Ei&&U.key!==Ei)return null;const re=(U.type==="report-module"||U.type==="markdown-module")&&U.key?`${U.key}__module_${U.moduleIndex??0}`:U.key;return b.jsx(rb,{node:U,value:re?Xt[re]:void 0,files:Y,onChange:fu,onFileChange:ww,thumbnails:Me,onThumbnailChange:Iw,videoUrlParse:N,videoUpload:A,onVideoParsingChange:Dw,reportListFetch:O,onReportGoGenerate:S,onViewReport:I,hideCurrentSessionReport:k,reportNames:Lb,onClearReport:_w,onResolveMultiName:hu,onAnalyzeMultiReport:Mw,onShiftReportNames:Ow,onAgentExit:B,hideAgentClose:Ae==="hideTagClose",onReportUrlParse:pu,onMarkdownParse:Lw,onMarkdownNameParse:Pw,onRichtextExpandChange:Ew,disabled:r,error:re?Aw[re]:void 0,index:J,nodeDefaults:Fe},re??`text-${J}`)})},Ql)}),b.jsx(Eb,{isProcessing:l,loading:Oe,disabled:r,sendDisabled:!Rw,showFooterUpload:Ht,footerFiles:de,onFooterFilesChange:me,agentOptions:H,onAgentSelect:xw,hideAgentButton:Ae==="hideAgent",currentAgent:ml,selectedSkill:lt,onSkillSelect:jb,onSkillCardClick:F,onSkillAction:T,skillListFetch:$,onSkillHeaderAction:V,showCreateSkill:Sw,createDisabled:C,skillPanelOpen:Z,onSkillPanelOpenChange:Hw,skillPanelOpenDelay:D,onAIImageClick:kw,aiImageSelected:Jt,onSend:bu,padding:nt})]}),b.jsx("div",{className:"rte-popup-host",ref:mw})]})]})})},xb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",nw=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],lw=({autoLoading:e,batchSize:t,loadingProgress:n,loadIcon:l,onBatchSizeChange:r,onLoadNextPage:a,onStartAutoLoad:i,onStopLoad:s})=>e&&n?b.jsxs("div",{className:"auto_load_progress",children:[l||b.jsx("img",{src:xb,alt:"自动加载",width:14,height:14}),b.jsxs("span",{children:["正在加载第",n.currentPage,"/",n.totalPages,"页"]}),b.jsx(ue.Progress,{percent:n.percentage,type:"line",size:[160,8]}),b.jsx("span",{onClick:s,className:"auto_load_stop_btn",children:"停止加载"})]}):b.jsxs("div",{className:"auto_load_container",children:[b.jsx("div",{onClick:a,className:"auto_load_next_btn",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:"加载下一页"}),b.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:[b.jsxs("div",{className:"auto_load_btn",onClick:e?void 0:i,children:[l||b.jsx("img",{src:xb,alt:"自动加载",width:14,height:14}),b.jsx("span",{children:"自动加载"})]}),b.jsx(ue.Select,{value:t,onChange:r,options:nw,disabled:e,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),rw=({current:e,loadIcon:t,pageSize:n,total:l,cachedPages:r,loadedCount:a,autoLoading:i=!1,loadingProgress:s,onChange:o,onLoadNextPage:u,onStartAutoLoad:c,onStopLoading:d})=>{const[f,h]=y.useState(5),m=Math.ceil(l/n),v=y.useMemo(()=>r.length>=m,[r,m]),g=()=>Array.from({length:m},(A,L)=>L+1).filter(A=>!r.includes(A)).slice(0,f),E=(N,A,L)=>{const O=r.includes(N);return A==="prev"||A==="next"||A==="jump-prev"||A==="jump-next"?b.jsx("div",{className:"pageBox",children:L}):b.jsxs("div",{className:"pageBox",style:{backgroundColor:e===N?"#2563EB":"#f5f5f5",color:e===N?"#fff":O?"#171717":"#a3a3a3"},children:[N,!O&&b.jsx("span",{className:"unload_spot"})]})};return b.jsxs("div",{className:"pagination_footer",children:[b.jsxs("div",{className:"pagination_leftWrap",children:[b.jsxs("span",{className:"pagination_total",children:[b.jsx(Ut.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",a,"/",l,"条数据"]}),!v&&b.jsx(lw,{loadIcon:t||void 0,autoLoading:i,batchSize:f,loadingProgress:s,disabled:!u||!c,onBatchSizeChange:h,onLoadNextPage:()=>u?.(),onStartAutoLoad:()=>{const N=g();c?.(N)},onStopLoad:()=>d?.()})]}),b.jsx(ue.Pagination,{current:e,pageSize:n,total:l,onChange:N=>o(N),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:E})]})},kb=e=>{const{loading:t,autoLoading:n,loadingProgress:l,columns:r=[],dataSource:a=[],total:i,current:s,pageSize:o,cachedPages:u,onChangePage:c,onLoadNextPage:d,onStartAutoLoad:f,onStopLoading:h,...m}=e,v=y.useRef(null),g=y.useCallback(E=>{c(E),u.includes(E)&&v.current?.scrollTo({key:`${(E-1)*o+1}`})},[u,c,o]);return b.jsxs("div",{className:"flex flex-col",children:[b.jsx(ue.Table,{ref:v,...m,columns:r,dataSource:a,pagination:!1,virtual:!0}),b.jsx(rw,{loading:t,autoLoading:n,loadingProgress:l,current:s,pageSize:o,total:i,loadedCount:a.length,cachedPages:u,onChange:g,onLoadNextPage:d,onStartAutoLoad:f,onStopLoading:h})]})};kb.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const Ab=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:l=!0,value:r,onChange:a,...i})=>{const[s,o]=y.useState(""),[u,c]=y.useState(0),[d,f]=y.useState(!1),[h,m]=y.useState(!1),[v,g]=y.useState(!1),E=y.useRef(void 0),N=y.useRef(void 0),A=y.useRef(e),L=y.useRef(u),O=y.useRef(h),S=y.useRef(s);y.useEffect(()=>{A.current=e,L.current=u,O.current=h,S.current=s});const _=y.useCallback((B,T)=>{let F=0;g(!0);const V=()=>{F<B.length?(o(B.slice(0,F+1)),F++,N.current=window.setTimeout(V,n)):(g(!1),T?.())};V()},[n]),I=y.useCallback(B=>{let T=S.current.length;const F=()=>{T>0?(o(S.current.slice(0,T-1)),T--,N.current=window.setTimeout(F,n/2)):B?.()};F()},[n]),k=y.useCallback(()=>{if(A.current.length===0||O.current)return;f(!0);const B=A.current[L.current];S.current?I(()=>{_(B,()=>{E.current=window.setTimeout(()=>{c(T=>(T+1)%A.current.length),f(!1)},2e3)})}):_(B,()=>{E.current=window.setTimeout(()=>{c(T=>(T+1)%A.current.length),f(!1)},2e3)})},[I,_]);y.useEffect(()=>(l&&e.length>0&&!h&&k(),()=>{E.current&&window.clearTimeout(E.current),N.current&&window.clearTimeout(N.current)}),[u,h,l,e.length,k]),y.useEffect(()=>{!d&&l&&e.length>0&&!h&&k()},[u,d,l,e.length,h,k]);const R=B=>{m(!0),E.current&&window.clearTimeout(E.current),N.current&&window.clearTimeout(N.current),f(!1),g(!1),i.onFocus?.(B)},M=B=>{m(!1),!r&&e.length>0&&(o(""),c(0)),i.onBlur?.(B)},H=B=>{a?.(B.target.value),i.onChange?.(B)},q=()=>h||r?t:s||t;return b.jsxs("div",{style:{position:"relative"},children:[b.jsx(ue.Input,{...i,value:r,onChange:H,onFocus:R,onBlur:M,placeholder:q(),style:{...i.style,position:"relative",zIndex:1}}),!h&&!r&&s&&b.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[b.jsx("span",{children:s}),v&&b.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),b.jsx("style",{children:`
147
147
  @keyframes blink {
148
148
  0%, 50% { opacity: 1; }
149
149
  51%, 100% { opacity: 0; }
150
150
  }
151
- `})]})};Ab.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Nb=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:l=!0,value:r="",onChange:a,onSubmit:i,maxLength:s=500,showCount:o=!0,submitText:u="发送",disabled:c=!1,rows:d=4,style:f,...h})=>{const[m,v]=y.useState(""),[g,E]=y.useState(0),[N,A]=y.useState(!1),[L,O]=y.useState(!1),[S,_]=y.useState(!1),[I,k]=y.useState(r||""),R=y.useRef(void 0),M=y.useRef(void 0),H=y.useRef(e),q=y.useRef(g),B=y.useRef(L),T=y.useRef(m),F=y.useRef(null);y.useEffect(()=>{H.current=e,q.current=g,B.current=L,T.current=m});const V=y.useCallback((ce,Ne)=>{let Oe=0;_(!0);const Ae=()=>{Oe<ce.length?(v(ce.slice(0,Oe+1)),Oe++,M.current=window.setTimeout(Ae,n)):(_(!1),Ne?.())};Ae()},[n]),$=y.useCallback(ce=>{let Ne=T.current.length;const Oe=()=>{Ne>0?(v(T.current.slice(0,Ne-1)),Ne--,M.current=window.setTimeout(Oe,n/2)):ce?.()};Oe()},[n]),X=y.useCallback(()=>{if(H.current.length===0||B.current)return;A(!0);const ce=H.current[q.current];T.current?$(()=>{V(ce,()=>{R.current=window.setTimeout(()=>{E(Ne=>(Ne+1)%H.current.length),A(!1)},2e3)})}):V(ce,()=>{R.current=window.setTimeout(()=>{E(Ne=>(Ne+1)%H.current.length),A(!1)},2e3)})},[$,V]);y.useEffect(()=>(l&&e.length>0&&!L&&X(),()=>{R.current&&window.clearTimeout(R.current),M.current&&window.clearTimeout(M.current)}),[g,L,l,e.length,X]),y.useEffect(()=>{!N&&l&&e.length>0&&!L&&X()},[g,N,l,e.length,L,X]);const C=ce=>{O(!0),R.current&&window.clearTimeout(R.current),M.current&&window.clearTimeout(M.current),A(!1),_(!1),h.onFocus?.(ce)},Z=ce=>{O(!1),!r&&e.length>0&&(v(""),E(0)),h.onBlur?.(ce)},ie=ce=>{const Ne=ce.target.value;s&&Ne.length>s||(a?a(Ne):k(Ne),h.onChange?.(ce))},D=()=>{const ce=a?r:I;ce.trim()&&!c&&(i?.(ce),a||k(""))},pe=ce=>{(ce.ctrlKey||ce.metaKey)&&ce.key==="Enter"&&(ce.preventDefault(),D()),h.onKeyDown?.(ce)},Se=a?r:I,ke=c||!Se.trim()||(s?Se.length>s:!1);return b.jsxs("div",{style:{position:"relative",...f},children:[b.jsxs("div",{style:{position:"relative"},children:[b.jsx("textarea",{ref:F,value:a?r:I,onChange:ie,onFocus:ce=>{ce.target.style.borderColor="#1890ff",ce.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",C(ce)},onBlur:ce=>{ce.target.style.borderColor="#d9d9d9",ce.target.style.boxShadow="none",Z(ce)},onKeyDown:pe,placeholder:L||Se?t:"",maxLength:s,rows:d,disabled:c,style:{width:"100%",minHeight:`${d*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...h.style},...h}),!L&&!Se&&m&&b.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[b.jsx("span",{children:m}),S&&b.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),b.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:b.jsx(ue.Button,{type:"primary",size:"small",icon:b.jsx(Ut.SendOutlined,{}),onClick:D,disabled:ke,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:u})})]}),o&&b.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[Se.length,"/",s]}),b.jsx("style",{children:`
151
+ `})]})};Ab.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Nb=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:l=!0,value:r="",onChange:a,onSubmit:i,maxLength:s=500,showCount:o=!0,submitText:u="发送",disabled:c=!1,rows:d=4,style:f,...h})=>{const[m,v]=y.useState(""),[g,E]=y.useState(0),[N,A]=y.useState(!1),[L,O]=y.useState(!1),[S,_]=y.useState(!1),[I,k]=y.useState(r||""),R=y.useRef(void 0),M=y.useRef(void 0),H=y.useRef(e),q=y.useRef(g),B=y.useRef(L),T=y.useRef(m),F=y.useRef(null);y.useEffect(()=>{H.current=e,q.current=g,B.current=L,T.current=m});const V=y.useCallback((ce,Ne)=>{let Oe=0;_(!0);const Ae=()=>{Oe<ce.length?(v(ce.slice(0,Oe+1)),Oe++,M.current=window.setTimeout(Ae,n)):(_(!1),Ne?.())};Ae()},[n]),$=y.useCallback(ce=>{let Ne=T.current.length;const Oe=()=>{Ne>0?(v(T.current.slice(0,Ne-1)),Ne--,M.current=window.setTimeout(Oe,n/2)):ce?.()};Oe()},[n]),X=y.useCallback(()=>{if(H.current.length===0||B.current)return;A(!0);const ce=H.current[q.current];T.current?$(()=>{V(ce,()=>{R.current=window.setTimeout(()=>{E(Ne=>(Ne+1)%H.current.length),A(!1)},2e3)})}):V(ce,()=>{R.current=window.setTimeout(()=>{E(Ne=>(Ne+1)%H.current.length),A(!1)},2e3)})},[$,V]);y.useEffect(()=>(l&&e.length>0&&!L&&X(),()=>{R.current&&window.clearTimeout(R.current),M.current&&window.clearTimeout(M.current)}),[g,L,l,e.length,X]),y.useEffect(()=>{!N&&l&&e.length>0&&!L&&X()},[g,N,l,e.length,L,X]);const C=ce=>{O(!0),R.current&&window.clearTimeout(R.current),M.current&&window.clearTimeout(M.current),A(!1),_(!1),h.onFocus?.(ce)},Z=ce=>{O(!1),!r&&e.length>0&&(v(""),E(0)),h.onBlur?.(ce)},ie=ce=>{const Ne=ce.target.value;s&&Ne.length>s||(a?a(Ne):k(Ne),h.onChange?.(ce))},D=()=>{const ce=a?r:I;ce.trim()&&!c&&(i?.(ce),a||k(""))},pe=ce=>{(ce.ctrlKey||ce.metaKey)&&ce.key==="Enter"&&(ce.preventDefault(),D()),h.onKeyDown?.(ce)},ge=a?r:I,ke=c||!ge.trim()||(s?ge.length>s:!1);return b.jsxs("div",{style:{position:"relative",...f},children:[b.jsxs("div",{style:{position:"relative"},children:[b.jsx("textarea",{ref:F,value:a?r:I,onChange:ie,onFocus:ce=>{ce.target.style.borderColor="#1890ff",ce.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",C(ce)},onBlur:ce=>{ce.target.style.borderColor="#d9d9d9",ce.target.style.boxShadow="none",Z(ce)},onKeyDown:pe,placeholder:L||ge?t:"",maxLength:s,rows:d,disabled:c,style:{width:"100%",minHeight:`${d*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...h.style},...h}),!L&&!ge&&m&&b.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[b.jsx("span",{children:m}),S&&b.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),b.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:b.jsx(ue.Button,{type:"primary",size:"small",icon:b.jsx(Ut.SendOutlined,{}),onClick:D,disabled:ke,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:u})})]}),o&&b.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[ge.length,"/",s]}),b.jsx("style",{children:`
152
152
  @keyframes blink {
153
153
  0%, 50% { opacity: 1; }
154
154
  51%, 100% { opacity: 0; }